sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
36a1963ea3bed3aa20415c91765c2017e21ba886c35bbe70f85ed6adf99c9811 | MATLAB | 4,767 | 112 | % MAKEELEC - subroutine to make electrode file in EEGPLOT
%
% Usage: >> makeelec(chans)
% >> [channames] = makeelec(chans)
%
% Inputs:
% chans - number of channels
%
% Author: Colin Humprhies, CNL / Salk Institute, 1996
%
% See also: EEGPLOT
% Copyright (C) Colin Humphries, CNL / Salk Institute, Aug, 19... |
f5116207bd9adb75b820dc364941db3deeccc8a6c94f9634775b88dde08e456e | MATLAB | 4,767 | 122 | function tapas_hgf_whichworld_plotTraj(r)
% Plots trajectories estimated by fitModel for the hgf_whichworld perceptual model
% Usage: est = tapas_fitModel(responses, inputs); tapas_hgf_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) ... |
07b2fb8280619c544cfc0ed2a028311a6af1d9b5647e141a0486c448b34e0f0f | MATLAB | 4,769 | 105 | % EEG_UNIFORMEPOCHINFO - make uniform event field information within
% epochs by filling in empty field values with
% values of other events in the same epoch. This
% is particularly useful when time-locking event
% do... |
d001898c217ea989d591156e42154afd80dbf022b43828bc370709f564e72ed9 | MATLAB | 4,769 | 109 | function [varargout] = likInvGauss(link, hyp, y, mu, s2, inf, i)
% likInvGauss - Inverse Gaussian likelihood function for strictly positive data
% y. The expression for the likelihood is
% likInvGauss(f) = sqrt(lam/(2*pi*y^3))*exp(-lam*(mu-y)^2/(2*mu^2*y)) with
% mean=mu and variance=mu^3/lam where mu = g(f) is th... |
157ffd7e8320c71657ae5e55959f7e99bc36c2b65a33528cc12e994f8610c76b | MATLAB | 4,770 | 128 | function y = bbinopdf(x,n,a,b)
%BBINOPDF Beta-binomial probability distribution function.
% Y = BBINOPDF(X,N,A,B) returns the beta-binomial probability
% density function with parameters N, A and B at the values in X.
% Note: The density function is zero unless N, A and B are integers.
%
% The Beta-binomial dist... |
829149c1c6d9a546555728841713b19f6f5e61dba81848bc33c5dfb102c54f42 | MATLAB | 4,772 | 99 | %% the beta parameters from a ROI
%% extract beta estimates from VML task
clear
% sub-pil001 and sub-pil002 have no localizer
%'sub-011' have no hMT;'sub-013' no (rhMT rMTt),'sub-014' no MTt
%'sub-008' have only right mst - !! do manually
subjectList= {'sub-001','sub-002','sub-003','sub-004','sub-005','sub-006','sub... |
c2ac37799a597441cc5e864af643bdbc7ecfd6c057ba304228da444907b69461 | MATLAB | 4,773 | 178 | function fear_icaReact_shuffle_cond(basename)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
load([basename '.basicMetadata.mat'])
load([basicMetaData.Basename '.okUnit.spikes.mat'])
load([basicMetaData.Basename '.sessions.events.mat'])
load([basicMetaData.Basename '.sleepstate.states.mat'])
para... |
cad06e2dd7a80f0d6c2e74c2ae7b9a90a9079c68b1c936ca5707dacca7de052c | MATLAB | 4,774 | 115 | % This MATLAB script can be used to reproduce the result of Go/No-go task-based resopnse selection ERP
%
% Please download BBCItoolbox to 'MyToolboxDir'
% Please download dataset to 'NirsMyDataDir' and 'EegMyDataDir'
% The authors would be grateful if published reports of research using this code
% (or a modified versi... |
b2dd3c8580fd77a75f9496b546a7d92516b940184d07010cbc66563917409505 | MATLAB | 4,778 | 123 | % std_saveindvar - save independent variables of a STUDY
%
% Usage:
% std_saveindvar(STUDY, indvars, filename);
% std_saveindvar(STUDY, indvars, filename, session, group);
%
% Input:
% STUDY - EEGLAB STUDY structure
% indvars - [cell] cell array of independent variables
% filename - [string] file name to save... |
e62405fe86b0b45122f56eecddac44a4b860c27976e55a350ee0f807440df030 | MATLAB | 4,779 | 141 | function M = positivefactory(m, n)
% Manifold of m-by-n matrices with positive entries; scale invariant metric
%
% function M = positivefactory(m)
% function M = positivefactory(m, n)
%
% A point X on the manifold M is represented as a matrix X of size mxn with
% all individual entries real, strictly positive. By defau... |
5ab4ba4f172ae66b47af46099662eb01ae173c4682879378c6dc5228f83dbfa0 | MATLAB | 4,781 | 121 | function ConcatGroupSICA(TCSListName, MapListName, VolMapListName, SpectraListName, InputStats, sICAdim, RunsXNumTimePoints, OutTCSName, OutTCSMaskName, OutAnnsubName, OutAvgTCSName, OutAbsAvgTCSName, OutAvgSpectraName, OutAvgMapsName, OutAvgVolMapsName)
%if isdeployed()
%better solution for compiled m... |
d9952d2006f9d78b31e99174545094f6af20a717f4d2a377566a6ca269889bf6 | MATLAB | 4,781 | 116 | function TOL_fig_gentry1948(config,params,dat)
% TOL_fig_gentry1948, figure of Gentry et al. (1948) apparatus and design
% Figure S8 for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80
% years on: A meta-analysis reveals poor replicability and little evidence for
% shortcutting. European Journal of Neuroscience... |
aa86d7373f819a626083b4fff3cde84ffb07a30986ca4e5a845b6fbebbe2111d | MATLAB | 4,782 | 125 | % NEWTIMEFTRIALBASELN - Remove baseline power values for single trials in
% newtimef. This only remove single trial baseline (not the average
% baseline).
%
% Usage:
% >> tf = newtimefbaseln(tf, tvals, 'key', val);
%
% Inputs:
% tf - [3-D or 4-D array] single-trial spectral estimates
% ... |
4a84d21e965527bbcbf1c8805118605c4de24e78533f969d239c4b9bd9c2cfca | MATLAB | 4,783 | 137 | % REJKURT - calculation of kutosis of a 1D, 2D or 3D array and
% rejection of outliers values of the input data array
% using the discrete kutosis of the values in that dimension.
%
% Usage:
% >> [kurtosis rej] = rejkurt( signal, threshold, kurtosis, normalize);
%
% Inputs:
% signal ... |
62428ba55907cddb63e27dfbe1905a1a26958c212bd769db457f7cd1cb8320e8 | MATLAB | 4,785 | 129 | function out = WL_scal2frq(y, wname, amax, delta)
% WL_scal2frq Frequency components in a periodic time series
%
% Estimates frequency components using functions from Matlab's Wavelet Toolbox,
% including the scal2frq function.
%
% ---INPUTS:
% y, the input time series
%
% wname, the name of the mother wavelet to ana... |
36297a2bf677fb36d448a401b5c80ecf0e594290a2290fe87eb562a2ad9abb35 | MATLAB | 4,786 | 146 | %% FC matrix construction
folderlist = dir('PATH_TO_DATASET/derivatives/xcp_d_without_GSR_bandpass_output/sub-*');
folderlist = folderlist(1:2:end); % Extract only folders
LOR_time = [1160
1385
1573
1010
898
1385
1085
1310
1573
898
485
2248
1010
1573
898
1985
1310
1310
1310
635
1573
1010
4... |
6d6bd726aaf9497f872d35590faa12d85c0cb366906184f8c5fb41b9040e5133 | MATLAB | 4,786 | 159 | function showVol(volORmap, title, figI, right, skipNslices, nHorPanels, nVerPanels, labels, labelPos)
% USAGE: showVol(vol, [title, figI, right, skipNslices, nHorPanels, nVerPanels, labels, labelPos])
%
% FUNCTION: to display a volume as a set of slices
%
% ARGUMENTS:
% vol the volume as a stack o... |
b96fbd56cc5d8d031790871e22c1f959392a2612b55084a594ccd3d54e652691 | MATLAB | 4,786 | 144 | function [ fHdl ] = plot( obj, subjects )
% Plot cluster and subject-level estimation result from HUGE model.
%
% INPUTS:
% obj - A tapas_Huge object containing estimation results.
%
% OPTIONAL INPUTS:
% subjects - A vector containing indices of subjects for which to plot
% detailed results.
%
% OUT... |
25027f703f737c3a4005093575f57beaf892922fd81966e438702c99c39e6b60 | MATLAB | 4,787 | 147 | function fear_addZNCCGtoReacCCG(basename,varargin)
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
load([basicMetaData.Basename '.SleepState.states.mat'])
load([basicMetaData.Basename '.sessions.events.mat'])
param.ccgFile='-instReacCCG_... |
470d62e78553dee343b6a189b6a8944781f9aa660ff3bfb5e15d81b84af8e152 | MATLAB | 4,787 | 139 | % brainstorm2eeglab - convert Brainstorm structures to EEGLAB dataset
%
% EEG = brainstorm2eeglab(bst, epochType);
%
% Inputs:
% bst - Brainstorm string for a folder containing data epoch files or Brainstorm
% data epoch structure
% epochType - [string] epoch type. Only import these epochs which
% ... |
595908106967e8cc75f2379c1853453bc62391b3b9c71a9722e6c3abb7471f2d | MATLAB | 4,787 | 125 | function [outliersHigh, outliersLow, verbose] = ...
tapas_physio_cardiac_detect_outliers(tCardiac,percentile,...
deviationPercentUp,deviationPercentDown, verbose, ah)
% detects outliers (missed or erroneous pulses) in heartrate given a sequence of heartbeat pulses
%
% output = tapas_physio_cardiac_detect_outl... |
1da3914328ca033bfdf4322423e2a3939eaff9a82ba81a035cdf0b06a7e6be3e | MATLAB | 4,788 | 88 | clear all
close all
%%
data_path='path_to_the_dataset';
load(fullfile(data_path,'data_ccg_nCRF.mat'));
load(fullfile(data_path,'data_ccg_CRF.mat'));
%%
color_bo=[238,42,123]/255;
cmap=brewermap(256,'*RdBu'); %% prefer
bin_edge_asym=-0.19:0.02:0.19;
bin_ccglag=-100:1:100;
%%
layer_label={'56','4C','4AB','23','WM'};
la... |
bd9d8607a5a4b099905592ce298de424bc187f9b694ddd50b433283e4778cd7e | MATLAB | 4,788 | 136 | function [rel_rms, abs_rms] = y_FD_Jenkinson(RealignmentParameterFile,ReferenceImage)
% function [rel_rms, abs_rms] = y_FD_Jenkinson(RealignmentParameterFile,ReferenceImage)
% Calculate FD Jenkinson (relative RMS) and absolute RMS based on SPM's realignment parameters
% Reference: Jenkinson, M., Bannister, P., Brady, M... |
78fdde2f55f0429c83e71069d908a24fc171eb2d88b1bab6d325398697a495d5 | MATLAB | 4,792 | 137 | % EEG_REJSUPERPOSE - superpose rejections of a EEG dataset.
%
% Usage:
% >> EEGOUT = eeg_rejsuperpose( EEGIN, typerej, Rmanual, Rthres, ...
% Rconst, Rent, Rkurt, Rfreq, Rothertype);
%
% Inputs:
% EEGIN - input dataset
% typerej - type of rejection (1=raw data; 0=ica).
% Rmanual - ... |
9b1c7f3ec2ce586dd7a285f8bac24c389ae5e7780311fd063c780f4a69b757ca | MATLAB | 4,793 | 83 | function TMSTargetSite(T1Dir,FunDir,subjID,PosNeg,VoxThr)
%% this function based on the FC maps
OutDir=FunDir ;
if strcmp(subjID(end-4:end-1),'_Run')
subjnew = subjID(1:end-5);
else
subjnew = subjID;
end
MATdir = [T1Dir,filesep,subjnew,filesep,'y_ac_coT1B.nii'];
invMatDir = [T1Dir,filesep,subjnew,filesep,... |
73d129464fb42fa86b093d2842ea93ae22026c7ad484e058b8ab3939b6104e73 | MATLAB | 4,795 | 105 | function [S,t,f,Serr]=mtspecgramc(data,movingwin,params)
% Multi-taper time-frequency spectrum - continuous process
%
% Usage:
% [S,t,f,Serr]=mtspecgramc(data,movingwin,params)
% Input:
% Note units have to be consistent. Thus, if movingwin is in seconds, Fs
% has to be in Hz. see chronux.m for more information.
% ... |
9141c1efc14aa4d23d1527fc0548b45ca5d64f704ced5bb1f16887c138a19184 | MATLAB | 4,796 | 180 | % WorkingMemory
function [counts,indices] = WMCounts(data,baitedArms)
RAT = 1;
DAY = 2;
TRIAL = 3;
CONF = 4;
GROUP = 5;
ARM = 6;
WORKB = 6;
WORKU = 7;
% Constants
nDays = max(data(:,DAY));
nTrials = 3;
nArms = 8;
nGroups = max(data(:,GROUP));
nConfigurations = max(data(:,CONF));
nRats = length(unique(data(:,RAT))... |
99cbe8fdcad28c26ab93cc210274d6d23809870409abc0961633a7458891fa5a | MATLAB | 4,801 | 137 | function [vols,flt] = smoothvolumes(vols,volsize,fwhm,mode)
% function [vols,flt] = smoothvolumes(vols,volsize,fwhm,mode)
%
% <vols> are one or more 3D volumes concatenated along the fourth dimension
% or a cell vector of things like that.
% <volsize> is a 3-element vector with the voxel size
% <fwhm> is a 3-element... |
35e2bacf0704cd3368be3eac2a7dcf629620080a1a000bd65297ad1b2fd26e1e | MATLAB | 4,802 | 90 | function [INV1final, INV2final] = Correct_INV1INV2_withMP2RAGEuni(INV1img,INV2img,MP2RAGEimg, CorrectBoth )
% usage:
% function [INV1final, INV2final] = Correct_INV1INV2_withMP2RAGEuni(INV1img,INV2img,MP2RAGEimg )
% all inputs and outputs are structures where the image informtion is
% stored on the .img field
% just ... |
3cd1146780d1131a08a20a5b22ef3ff2564c1e607145a3f329ceff46630aee7a | MATLAB | 4,807 | 139 | % (C) Copyright 2020 CPP visual motion localizer developpers
function [cfg] = expDesign(cfg, displayFigs)
% Creates the sequence of blocks and the events in them
%
% The conditions are consecutive static and motion blocks
% (Gives better results than randomised).
%
% Style guide: constants are ... |
f9196329b4d294cde5956a5b738de2ade707aa4dcb41d2d8b9a50767cecb81da | MATLAB | 4,807 | 148 | function [maps,stats] = SurveyFiringMaps(units,varargin)
%SurveyFiringMaps - Compute and plot firing maps for all subsessions.
%
% USAGE
%
% [maps,stats] = SurveyFiringMaps(units,<options>)
%
% units optional list of units, i.e. [electrode group, cluster]
% pairs; set cluster to -1 to... |
daf86c07353f9bc3274417559fd771a8aef48eca182e86fc4fb998b4545f6d90 | MATLAB | 4,809 | 148 | % LAPPLOT - Compute the discrete laplacian of EEG scalp distribution(s)
%
% Usage:
% >> laplace = lapplot(map,eloc_file,draw)
%
% Inputs:
% map - Activity levels, size (nelectrodes,nmaps)
% eloc_file - Electrode location filename (.loc file)
% For format, see >> topopl... |
254de713b31d7b2f6e1dcbab92872c3c96ba9b6797335e10ade339355e2a1d43 | MATLAB | 4,810 | 85 | function res = arg_nogui(varargin)
% Like arg(), but not displayed by GUIs.
% Spec = arg_nogui(Names,Default,Range,Options...)
%
% This type of functon argument specifier behaves like arg(), except that it will not be displayed
% in GUIs that are generated for the function. This is mainly used for optional arguments t... |
8ef350362d9882da358f4aa60a0cb9230215720b379cb5b9fa83b9109927f149 | MATLAB | 4,811 | 133 | %% clustering indexes on retinal data
sampCents = arrayfun(@(i) load(['v3_samp_500_halo_corrected_exp_',num2str(i),'_sampCent.mat']),1:4,'uni',0);
%sampCents_mat = cellfun(@(x) cat(2,x.sampCent{:}),sampCents,'uni',0);
sampCents_mat = cellfun(@(x) cat(2,x.sampCent{randi(length(x.sampCent),6000,1)}),sampCents,'uni',0);
s... |
3b2a950e78ac0a22a4c120008159e9766c455be7ca6ac167638a2dbd07ba6964 | MATLAB | 4,813 | 150 | function sidecar = bids_sidecar(filename, suffix, extension)
% BIDS_SIDECAR will search for corresponding BIDS sidecar files that go together with
% a specific data file. This function respects the inheritance rules and will also
% search higher up in the directory structure.
%
% Use as
% sidecar = bids_sidecar(file... |
1d1e019462f04ff295bee240f38b6e69a5eb5f2ef0705c32e1448cd4469618af | MATLAB | 4,815 | 163 | function run_permuztest_examples
%RUN_PERMUZTEST_EXAMPLES Run one-sample permutation Z-test examples.
% Generates random multivariate data for a sample X, containing 20
% variables, each with a mean value of 0, except for the first 10
% variables which have a mean value of -1. Each variable has 30
% observatio... |
85bc0ed1f10ad41f290a3c42dc188fff4667e39060d66a356f758581cf2b61a9 | MATLAB | 4,816 | 122 | function preprocess_nsd_epialignment(sessix)
% idea is to get as close as you can with simple low-dimensional (and principled/controlled) linear methods...
%%%%% SETUP
% setup
nsdsetup;
datadir = datadirs{sessix};
ppdir = regexprep(datadir,'rawdata','ppdata');
outputdir = sprintf('%s/../%s-sessioncoregistration',... |
29e9e47b43fb93c5346343ff19595a08b4a1a45631862841b92118609a38702f | MATLAB | 4,820 | 177 | function [ltom, htom, mtol, mtoh,...
ltom_incong, htom_incong, sems, outmat] =...
block_dynamics_latency(A, twin, smoothfactor, z_arg, varargin)
% block_dynamics_latency - plot how latency changes around block
% transitions
% INPUTS:
% A struct- Rat behavioral data. Usually BestFitEarly.(RAT_ID).All.ratTria... |
409471a944f8bea16ae468ae04c6e7099ce14745cb0dfef4b76533aef38a5c9a | MATLAB | 4,822 | 136 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% single diffusion encoding (SDE)
% this is a simple clinical scan with 2 shells at b = 1000 and b = 2000
% resolution 1.5mm isotropic
% load the data
x = load('data_examples/single_diffenc');
dataSDE = x.dataSDE;
%% perform esti... |
5b6868179154609262b301a32b317f313fb223feeebb5b9ab3763cfa451f6204 | MATLAB | 4,825 | 169 | function coactPaper_figureS16()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=5;
fontsize=6;
close all
fh=initFig('width',7.7,'height',3.25,'font','Arial','fontsize',fontsize);
x=12;
y=2;
panel_01(x,y,fontsize)
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/figS16_%s.pdf',datestr(now,'yyy... |
e8a6e98c68d502380ba281f4058dbcb775093f5c9af75a2f002b53ffc6c2a7c8 | MATLAB | 4,825 | 140 | function [matched,only1,only2] = Match(list1,list2,varargin)
%Match - Replace values in one list with closest values in a second list.
%
% USAGE
%
% [matched,only1,only2] = Match(list1,list2,<options>)
%
% list1 first list
% list2 second list
% <options> optional list of property-va... |
470cfffc4b857f5bf63bd24d5d9e654d4625570ad3abbe7279ab83a143344e95 | MATLAB | 4,826 | 134 | clear; clc; warning('off','all');
diary(fullfile('.', 'results', 'Figure4_log.txt'));
diary on;
%% load the fitted log_10(EC50) matrix
load(fullfile('.', 'data', 'log10EC50.mat'));
cMatrix = log10EC50;
%% apply PCA on the EC50 matrix
% replace NaN in the EC50 matrix with 0
cMatrix(isnan(cMatrix)) = 0;
% PCA. We p... |
f0197398f44f0c9865ece199e29a3201b3cab3c01721320ec87b6384c2715321 | MATLAB | 4,826 | 133 | % svd_warmstart_02PA - PA Absil - Started Tue 11 Jun 2013
% Modifs.
% svd_warmstart_01PA - PA Absil - Started Tue 11 Jun 2013
% Matlab code for testing warm-start truncated SVD, using the Manopt toolbox.
% This script has been tested with Manopt 1.0.2.
% The rest of this script is modeled on the example found... |
ba98b23063b6e6fb4a69d05a702330b8edb049e7da2f325b773a89e4d43ae83d | MATLAB | 4,834 | 119 | function eval(obj, inputs, derOutputs, varargin)
%EVAL Evaluate the DAGNN
% EVAL(obj, inputs) evaluates the DaG for the specified input
% values. `inputs` is a cell array of the type `{'inputName',
% inputValue, ...}`. This call results in a forward pass through the
% graph, computing the values of the output v... |
1a2e04de3c1320f3d1a24f083b90c6c5727eda2ab55e89934bb5fa727b510f86 | MATLAB | 4,835 | 154 | function [ ] = tapas_ceode_init()
% [ ] = tapas_ceode_init()
%
% Intitialization function of the tapas/ceode toolbox. It adds the relevant
% toolbox function to the path. Additionally, it tests for the availability
% of an SPM version, and performs a simple test to investigate
% compatibility between the toolboxes us... |
66e7b49c8bb64c6f19450144963c8419bf6ad9950440b0a0e34d72682d7ef2bf | MATLAB | 4,835 | 128 | function [synchronized,Ie,Is] = Sync(samples,sync,varargin)
%Sync - Make sample timestamps relative to synchronizing events.
%
% Select samples that fall around synchronizing events, and make their
% timestamps relative to the synchronizing events. This can be used to
% build e.g. spike raster plots or successive evok... |
4206c3ab1f6df298e02752c747fc385e2feffc8d5035eef56183f74ac72a5539 | MATLAB | 4,837 | 113 | %{
preprocess.PrepareGalvoAverageFrame (imported) # average frame for each slice and channel after corrections
-> preprocess.PrepareGalvoMotion
-> preprocess.Channel
---
frame : longblob # average frame ater Anscombe, max-weighting,
%}
classdef PrepareGalvoAverageFrame < dj.... |
35fc4026724edb8d418010079ced484516974deb8e125e6124885377308a0787 | MATLAB | 4,839 | 151 | function ch2roi_plot_spectra_oneFig(GRUP, groupInfo)
% plots spectra + SNR of grouped channels into defined ROIs (anatomic areas)
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected freq. band
% - significance (difference of conditions, from baseline (TO DO), or all)
% settings ... |
4ac6dd34d66ed45db9e09f61e623172291c8b45b7540306cb99f482f731ab637 | MATLAB | 4,839 | 108 | % DetectSWR_check_helper - script that can be manually called from DetectSWR
% First, remove points that occur in noisy lfp periods
tl = (1:length(lfp))'/1250; % timestamps for lfp
t = featureTs/1250; % timestamps for candidate ripple events
bad = false(size(t));
try % optionally, remove periods of noisy LFP (large de... |
004d041393aa4e12ed3719090ccd840c234abec0530be6b8866319ffb7395caf | MATLAB | 4,841 | 177 | % projectOptions_demo is a nullary function which initialises a struct
% containing the preferences and details for a particular project; in this case
% the demo for the toolbox. It should be edited to taste before a project is
% run, and a new one created for each substantially different project (though
% the options ... |
330557e9e1c670c45315e641b774ebb534cdd83b9ceb9c3640a5022ec7faf5f0 | MATLAB | 4,841 | 145 | % EEG = interp_mont() - Interpolate current data to coordinates from a specified
% sfp file.
%
% Usage:
% >> com= interp_mont(EEG, coordfname, varargin);
%
% Inputs:
% EEG - input EEG structure
% coordfname - name of sfp file containing new channel coordinates.
% varargin - key/val pa... |
f209255d605d91156465f4bcfe6501a53848ec5b55334d429e4bd40f2782deb7 | MATLAB | 4,842 | 139 | %% RDF = BackgroundRemovalMacro(totalField,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimens... |
89ef71b610d57421e4449d5c7f4af4cc89b2650fbcdee432c06d0c1124532174 | MATLAB | 4,844 | 150 | function M = spectrahedronfactory(n, k)
% Manifold of n-by-n symmetric positive semidefinite matrices of rank k
% with trace (sum of diagonal elements) equal to 1.
%
% function M = spectrahedronfactory(n, k)
%
% A point X on the manifold is parameterized as YY^T where Y is a matrix of
% size nxk. As such, X is symmetri... |
cd948155ca28d9730e7eb762b60ae31421061ce812e318272f17ec122c02158f | MATLAB | 4,846 | 157 | function [data,t] = SurveyCCG(units,varargin)
%SurveyCCG - Compute and plot cross-correlograms (CCGs) for all subsessions.
%
% USAGE
%
% [data,t] = SurveyCCG(units,<options>)
%
% units optional list of units, i.e. [electrode group, cluster]
% pairs; set cluster to -1 to process all cl... |
ba92eefe576cfdf7151524cd397b8de09f80095129056270b8203dae27107ac2 | MATLAB | 4,847 | 130 | %% function chi = qsmSingleStepVSHARP(totalField,mask,matrixSize,voxelSize,varargin)
%
% Usage:
% chi = qsmFANSI(totalField,mask,matrixSize,voxelSize,...
% 'tol',1e-2,'lambda',2.9e-2,'iteration',50,'magnitude',magn);
%
% Input
% --------------
% totalField : unwrapped total field
% mask ... |
0ab33654e3432b054eac4eba5479defc2c9bb27f37dbdea7d03e47216d849387 | MATLAB | 4,848 | 180 | function [eh,ph,ds,gs] = datadotplot(ax,dat,varargin)
% name short description
% longer description
%
% USAGE
%
% out = name(in) process with default settings
%
% out = name(in,optional) process using optional argument 1
%
% out = rate_mapper(__,name,value) process with Name-Value pairs
%
% INPUT
%
% 'in' - Scalar, po... |
fab8d275b445a816037e9aae4dc8c528dd6bd251edc99c4dca981643969ae0b1 | MATLAB | 4,848 | 165 | function DB = read_database2(name, savename, varargin)
% Reads a CSV file into a meta-analysis database struct format using Matlab's importdata
%
% Usage:
% -------------------------------------------------------------------------
% DB = read_database2(name, savename, ['CalculateContrasts'])
%
% - runs Meta_Set... |
2c0fed303700657083b507a52d985f0d0f8f7da9e9e124c5222e077c39ccd715 | MATLAB | 4,849 | 151 | function [options]=setExportPath(dcimgPath)
% add up description
%% All Options
options.dcimgPath=dcimgPath;
options.dcimgPathG=[];
options.dcimgPathR=[];
options.h5PathG=[];
options.h5PathR=[];
options.exportFolder=[];
options.metadataPath=[];
options.loading=true;
options.registration=false;
options.motionCorr=true... |
018bba24220a6238074d14c096877b9688d8d545e86eb9592d1a916881c491c0 | MATLAB | 4,850 | 121 | clc;clear;close all;
%%
DataManager = FileManager;
dataset_name = 'Lightfield';
stack = 'Zhang2020';
segmentation_version = 'auto';
raw_data_folder = DataManager.fp_raw_data_folder(dataset_name, stack);
mask_folder = DataManager.fp_mask_folder(dataset_name, stack, segmentation_version);
graph_folder = fullfile(DataMana... |
db0efcaa28b0fd71a2f0c60e52762502e2a0ae8823dab26a6780c6c9cb79020f | MATLAB | 4,850 | 150 | function fh = tapas_physio_plot_raw_physdata_siemens_tics(tCardiac, c, tRespiration, r, ...
hasCardiacFile, hasRespirationFile, cpulse, rpulse, cacq_codes, ...
racq_codes)
% Plots raw physiological data from Siemens TICS format
%
% output = tapas_physio_plot_raw_physdata_siemens_tics(input)
%
% IN
%
% OUT
%
%... |
dc4ee265cf64befd8e48fbf27f6b34e51ab742c862239b6fa2a91906772bd347 | MATLAB | 4,850 | 55 | function [matlabbatch] = batch_func_job(path_func, path_anat, filter_func, filter_anat)
selector_func = strcat({'File Selector (Batch Mode): Selected Files'}, {' '}, {'('}, strcat('^', filter_func), {')'});
selector_anat = strcat({'File Selector (Batch Mode): Selected Files'}, {' '}, {'('}, strcat('^', filter_anat), {... |
5e751570aa2152980583034875ea66d6ccbb155900d52d6ff009e0c281a2b24a | MATLAB | 4,853 | 197 | function plot_fig5c(datadir)
% Plot firing rate of two example cells on current and subsequent trial
% following a positive and negative RPE.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
% load data
fpath = fullfile(datadir, 'data-published/NpxData/pD1pD2.... |
99734e3197dc757ab58978a029cdb59f731e8f9b4e8e0d98d6f11c6560f83785 | MATLAB | 4,855 | 173 | function [C3] = Biased_Movement(C3, myelin, funcs, PB)
% BIASED_MOVEMENT
%
% Performs biased movement of C3 agents toward nearby healthy myelin.
% Bias strength depends on distance and directional components.
%
% INPUTS:
% C3 - structure containing C3 agent positions
% myelin - myelin structure (state and spat... |
ac37269e25f464488a67ee4702c3ea4085c5e2911184ec855ae25ae67067b5c3 | MATLAB | 4,855 | 177 | % projectOptions_demo is a nullary function which initialises a struct
% containing the preferences and details for a particular project; in this case
% the demo for the toolbox. It should be edited to taste before a project is
% run, and a new one created for each substantially different project (though
% the opt... |
36005120e2db59c64cb22d7f5af4afd865b02c582f7d5950e5575931ab7a20cd | MATLAB | 4,858 | 115 | % POP_CHANCENTER - recenter cartesian X,Y,Z channel coordinates
%
% Usage:
% >> chanlocs = pop_chancenter(chanlocs); % pop up interactive window
% >> [chanlocs centerloc] = pop_chancenter(chanlocs, center, omitchan);
%
% Inputs:
% chanlocs = eeglab channel location structure (see READLOCS)
% center =... |
548d3e777c2557c626f3bba5d1a05b06a38f8b35c428724bfa1a53a80fc3b460 | MATLAB | 4,859 | 117 | function plot(recording,cfg,varargin)
% Plot the contents of a McsRecording object.
%
% function plot(recording,cfg,varargin)
%
% Input:
%
% recording- A McsRecording object
%
% cfg - Either empty (for default parameters) or a structure with
% (some of) the following fields:
% ... |
a202253a11b4a0d45715caf3a7d53b85a5246cbadde8f6203ed24b10c4ed1f0d | MATLAB | 4,860 | 113 | function [varargout] = likT(hyp, y, mu, s2, inf, i)
% likT - Student's t likelihood function for regression.
% The expression for the likelihood is
% likT(t) = Z * ( 1 + (t-y)^2/(nu*sn^2) ).^(-(nu+1)/2),
% where Z = gamma((nu+1)/2) / (gamma(nu/2)*sqrt(nu*pi)*sn)
% and y is the mean (for nu>1) and nu*sn^2/(nu-2) is ... |
dc4dcdd88c899ee3e64c3ef8407fef4ff61de897de5724add0ad128de2c341dc | MATLAB | 4,860 | 94 | % hctsa_smoke_report
% Diagnostic (not a test): evaluates the full hctsa feature library on a
% small panel of diverse synthetic time series and reports
% - operations that error on any series,
% - features that are NaN/special on every series,
% - features that take a single value across all series (candidates f... |
035480f203ffdb8dfeca9a14d1ce27a43b6c7028c54c5204895b757efc4d01a1 | MATLAB | 4,863 | 140 | % BIDS_COMPARE - compare two BIDS folders.
%
% Usage:
% eeg_compare(folder1, folder2, errorFlag);
%
% Input:
% folder1 - [string] first BIDS folder
% folder2 - [string] second BIDS folder
% errorFlag - [true|false] generate error if true (warning if false)
%
% Author: Arnaud Delorme, 2023
% Copyright (C) 2023... |
16b853684172683e4cc1da85dea3dd479b125df04c98eb41c483d4d4ff59e59c | MATLAB | 4,863 | 155 | function data = fixsampleinfo(data)
% FIXSAMPLEINFO checks for the existence of a sampleinfo and trialinfo field in the
% provided raw or timelock data structure. If present, nothing is done; if absent,
% this function attempts to reconstruct them based on either an trl-matrix present in
% the cfg-tree, or by just ass... |
a086964cc78de6861bdf1b52bd11832659a0ea3e8f939bfd1cec4df0eecb17c5 | MATLAB | 4,865 | 121 | function [isConstant, dy, verbose] = tapas_physio_detect_constants(y, ...
nMinConstantSamples, deltaMaxDiff, verbose)
% Detects constant portions of input time series, e.g. to flag breathing
% belt detachment/clipping
%
%[isConstant, dabsY, verbose] = tapas_physio_detect_constants(y, ...
% nMinConstantSamples, d... |
e0a83dfa605c67e2559cc26e043e661ccfee2bfe5e7f9674097e161c898a322e | MATLAB | 4,866 | 198 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% computes signal of a dispersed stick
%
% S = dispstick(D, a, n,sch,type)
% D - of the stick
% a - conc. parameter
% n - direction of stick
% sch - diff scheme (in q-space coords)
% type - gaussian - backprojected Gaussian
% poisson - ... |
5e507fdab4c07b853dddc92c1a196fb4c9b8d1aa80be0a2f5409a455c4d80fbb | MATLAB | 4,867 | 170 | function FigureS12(datadir, codedir)
%FigureS12 Males and females have comparable wait time ratios (top) and
% trial initiation time ratios (bottom)
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'Ignor... |
8a0ac9dd4647bb624ebb4539f3341873e1b9cf30a294097d052fc00d31f61789 | MATLAB | 4,867 | 170 | %% z-correct
close all
clear all
rng(10)
fl = 'Z:\CLOOSE_benchmark_tests\z_correction\test_beads_z_correction\test_beads_z_correction_000_002\test_beads_z_correction_000_002';
dead_band = 80;
cXY = [30, 210; 70, 198];
z_nplanes = 21;
frames_tmp = sbxgrabframe(fl, 1, -1);
frames_tmp = squeeze(frames_tmp);
frames_tm... |
0229b60a99135a19c7810c72e83a95350316d561014af2c7cfccde414c166f80 | MATLAB | 4,870 | 145 | function [maps,stats] = SurveyFiringMapsScale(units,varargin)
%SurveyFiringMaps - Compute and plot firing maps for all subsessions.
%
% USAGE
%
% [maps,stats] = SurveyFiringMapsScale(units,<options>)
%
% units optional list of units, i.e. [electrode group, cluster]
% pairs; set cluste... |
75827a3707e387597b334e2784e458d90d8c32c74353caaf203d1f171ae7c8f9 | MATLAB | 4,870 | 167 | function L = gen_gaussian_noise(T, dt, tau_L, sigma_s)
% GENERATE_GAUSSIAN_NOISE - Generate temporally correlated Gaussian noise
%
% H1 Line: Create Gaussian noise with specified temporal correlation
%
% Syntax:
% L = generate_gaussian_noise(T, dt, tau_L, sigma_s)
%
% Description:
% Generates a time series of Gauss... |
8c762e1485be73046e5a67ed2851c9e0b90421e8e8a6f9929858b67b764e1d77 | MATLAB | 4,870 | 125 | function [curve,stats] = FiringCurve(samples,spikes,varargin)
%FiringCurve - Compute firing curve (e.g. for a head direction cell).
%
% Compute firing curve (e.g. for a head direction cell, or a place or grid cell
% on a linear track), as well as occupancy and spike count curves. Optionnally,
% curve statistics can... |
bae76ab6755dfaf987a7b95fc9880864fda0be51b10f72eedddbf789019935dc | MATLAB | 4,870 | 123 | %{
aod_monet.RF (computed) # receptive fields from the monet stimulus
-> aodpre.Sync
-> aodpre.Spikes
-----
nbins : smallint # temporal bins
bin_size : float # (ms) temporal bin size
degrees_x : float # degrees along x
... |
7683d9e70f509f3ae777dd9ba8552c3d5dd3de746a989f10ecefd370252fad81 | MATLAB | 4,872 | 131 | tic
clear;
fs = 3000;
num_points = 21;
thresholds = struct(...
'peakThresh', 0.1, ...
'halfXThresh', 0.6, ...
'zeroXThresh', 0.4);
matFiles ='merged_peak_library';
data = load(matFiles);
mergedPeakTable = data.mergedPeakTable;
LibraryM... |
78dee3c515eafc7888ed4948da2a39d1af99e42a586c4a3757c731ceb7405de6 | MATLAB | 4,874 | 142 | function MDSRDMs(varargin)
% MDSRDMs({RDMs, [RDMs2, ...]}, userOptions, localOptions)
% This function performs second-order MDS, visualising the dissimilarities
% between RDMs. A point in a second-order MDS arrangement represents an
% RDM. The arrangement reflects the extent to which regional
% representational geomet... |
e43557c685e6d8b355c5b8dd38a6f72a1917ac7f0e4e6e441b2123a5d1e84ae7 | MATLAB | 4,874 | 136 | function [selectionDimInfo, selectionIndexArray, ...
unusedVarargin] = select(this, varargin)
% Returns indexArray and corresponding dimInfo of sub-selection from array
% specified by dimInfo
%
% [selectionDimInfo, selectionIndexArray, unusedVarargin] = ...
% dimInfo.select('type', 'index'/'label', 'invert... |
252834068302e39915220f86a1b38b15e94ad5d90d7dc806ad9eb395ea16e0cd | MATLAB | 4,875 | 142 | function [core_svd,state_pks_full,param] = findSVDensemble(data,coords,param)
% Find ensembles using SVD method.
% INPUT:
% data: N-by-T binary spike matrix, where N is the number of neurons,
% T is number of frames
% coords: N-by-2 matrix, containing coordinates of corresponding
% neurons (for ... |
0c435b8ddf0beae69190cfce001f8ea97ab0314d2604e5789398da1dd80cb339 | MATLAB | 4,877 | 126 | % postprocessing for all ofc data (stratified and non-stratified)
%location of analysis codebase
codepath = '~/projects/constantinoplelab/Analysis/';
% add code paths
addpath(genpath(codepath))
addpath(genpath(codepath + "david"))
addpath(genpath(codepath + "maggie"))
%for saving pds correctly so illustrator can mo... |
b533560d2532d4850266d9d6dd38c77ec1daba03abdd2d371513c1215170fe8a | MATLAB | 4,878 | 139 | function varargout = AFQstat(varargin)
% AFQSTAT M-file for AFQstat.fig
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @AFQstat_OpeningFcn, ...
... |
bbf29f5a06560ad5dcde8f9b706da2e89f333246a3db58312c20049528b1bbe7 | MATLAB | 4,884 | 114 | function [unitType, unitType_string] = bc_getQualityUnitType(param, qMetric, savePath)
% JF, Classify units into good/mua/noise/non-somatic
% ------
% Inputs
% ------
% param: struct containing paramaters for classification
% qMetric: struct containing fields of size nUnits x 1
% ------
% Outputs
% ------
% unitType - ... |
db3c1460f98cd111826a81af014315ee19f6da966557751e314fc9f66f4852f5 | MATLAB | 4,886 | 143 | function [core_svd,state_pks_full,param] = findSVDensemble(data,coords,param)
% Find ensembles using SVD method.
% INPUT:
% data: N-by-T binary spike matrix, where N is the number of neurons,
% T is number of frames
% coords: N-by-2 matrix, containing coordinates of corresponding
% neurons (for ... |
c84c05ac1f2be042cea0c8989b3019aa1b1cb0f99b1e6893fa582dc41485acb5 | MATLAB | 4,888 | 147 | function [c,sz,cx,xunq,xunq2cl]=surfing_clusterize(x,nbrs,n2a)
% fast depth-first clustering (supports both surface and volume)
%
% [C,SZ,CX[,XUNQ,XUNQ2CL]]=SURFING_CLUST(X,NBRS[,N2A])
% INPUTS:
% X Nx1 vector for N data values
% NBRS NxP matrix with neighbours of X (at most P per value in X),
% ... |
622b8121aeea978caa703250da03236b98f6ebf4244e2f9821dcdfd819dec4d8 | MATLAB | 4,889 | 139 | %% This file is used to crop regions for one-color STORM analysis
clear all;
close all;
clc;
binpath = '\\E1-054867\Jinyu\20250330 Actin in neuron\Analysis\#3 LatB'; %%%%%%% path that you saved your png and bin files
mkdir([binpath '\diat_regions']);
ipath=[binpath '\diat_regions\'];
filename = dir(fullfile(strcat([bin... |
1a39f98bb41e387bf838e83c165a725f1e85f1b4d5e213474fdc69e1858734e6 | MATLAB | 4,890 | 122 | function TS_LowDimInspect(whatData,whatAlgorithm,maxLength)
% LowDimGUI Plot time series in low-dimensional projection.
%
%---INPUTS:
% whatData: The HCTSA data file to use
% whatAlgorithm: The dimensionality-reduction algorithm to use ('pca','tsne')
% maxLength: maximum length of time series to display in the inspecto... |
77e6fc36768b752fd0b9fc8698ad2aa399cc8a6ca684e306cd892b664e23198d | MATLAB | 4,890 | 148 | % EEGH - history function.
%
% Usage:
% >> eegh( arg );
% >> eegh( arg1, arg2 );
%
% Inputs:
% - With no argument, it return the command history.
% - arg is a string: with a string argument it pulls the command
% onto the stack.
% - arg is a number>0: execute the element i... |
3c66af97c97703ca068e775e93b84ccaa0f3c79dc426ed12e56a07245b564f68 | MATLAB | 4,891 | 175 | %op_removeWater.m
%Jay Hennessy, McGill University 2017.
%
% USAGE:
% out=op_removeWater(out,wlim,Kinit,M,plot_bool);
%
% DESCRIPTION:
% This function removes the water signal from MRS data using HSVD method
% described by H. BARKHUIJSEN et al. 1987.
%
% INPUTS:
% in = MRS data structure used by FID-a toolkit... |
5dd30867bcaa3e226c243d9f6ad50d9b744d7a81640c096370fd2bcd8e4ca1c8 | MATLAB | 4,893 | 95 | %% Getting started with EEGLAB history
% The line below was added by us to locate data files
eeglab_path = fileparts(which('eeglab.m'));
% Start eeglab
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
% Change option to process multiple datasets
pop_editoptions( 'option_storedisk', 0);
% Load the dataset (We modified the pa... |
b0865528d236c6e20da9b2f0d6693b43008617e87eb2e9004f9bed13107d2ca9 | MATLAB | 4,893 | 125 |
%% predicted
clear;
mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble';
sub_pool = [1:28, 30, 32, 33, 34, 35];
% sub_pool = {'11', '12', '13', '14', '15', '16', '17', '18', '19', '20'};
mask = MRIread('/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble/mask/mask_wholebrain.nii'); %mask_no... |
86a97f6c8e8e57c17635e2a212f1b39151810b63c65c6d9ace55b13d5a7fb0aa | MATLAB | 4,894 | 123 | function plot(analogStream,cfg,varargin)
% Plot the contents of a McsAnalogStream object.
%
% function plot(analogStream,cfg,varargin)
%
% Produces a time series plot with the channels overlayed over each other.
%
% Input:
%
% analogStream - A McsAnalogStream object
%
% cfg - Either em... |
e70cd858d488329df41671bacfe2074e196c3af47cf0917c84b07559b983abfa | MATLAB | 4,894 | 135 | function topoplotMeanWithError(params, statData)
% plots as a grid values in 'statData' cell struct with fields:
% yVals: [sample x ch]
% yErrs: [sample x ch]
% xVals: x-Axis values (vector)
% info: struct with supplementary informatio
% (c) Jiri, Jan11
for sig = 1:size(statData,1)
assert(size(statDat... |
39ce2e927a6bec9bac6eabd47fdcf8a46a8c4b2e0e3d3c841b86b6d70e83eab4 | MATLAB | 4,895 | 154 | function handle = createNarrowColorbar(location)
% CREATENARROWCOLORBAR Create a narrow colorbar
%
% Syntax:
% h = createNarrowColorbar()
% h = createNarrowColorbar(location)
%
% Description:
% Creates a narrow colorbar that takes up less space than default.
%
% Inputs:
% location - 'vert' (default) or 'horiz'
... |
5dcb80d46f6afb5ed51b06cda8e1b1b932da13259c61195cc5e7afcc28656a18 | MATLAB | 4,895 | 164 | function fear_check_deltaWaves(basename,varargin)
% clear
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
param.freqRange=[30,600];
param.smWin=0.1; %in sec
param.tAr... |
314d83fb1e49d7f169649a608ab7164347619949b61cc5f8a8918fd603cad68d | MATLAB | 4,898 | 112 | classdef squeakData < handle
properties
calls
currentcall = 1
current_call_valid = true
windowposition = 1;
lastWindowPosition = -1;
cmap = 'inferno'
cmapName = {'inferno'}
settings = struct()
defaultSettings = struct()
squeakfolder
... |
86e23a36beb9cedd9973a754bd4cb556445707534b7363e3137ff170a2e2c67b | MATLAB | 4,898 | 131 | classdef McsStream < handle
% Superclass for the different streams.
%
% Reads and stores the Info struct and the other data attributes.
properties (SetAccess = protected)
StreamInfoVersion % (scalar) Version of the stream protocol
StreamGUID % (string) The stream GUID
... |
a08f108f7c2c46776f7ae5788be19720dc36939eeae446002ff23c1c5d1381fb | MATLAB | 4,900 | 171 | close all
clear all
load('Z:\CLOOSE_benchmark_tests\MC\MC_values_new_method.mat')
dispX = cell(6,6);
dispY = cell(6, 6);
xc = nan(6);
yc = nan(6);
for k = 1:6
for kk = 1:5
k
kk
dispX{k, kk} = MC_values{k,kk}(1, :) - (-MC_values{k,kk}(3, :));
figure(1)
plot(di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.