sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d988a9dcc4be8bed780daff2364899442290ce626a5f48e420d970a90bd26c44
MATLAB
1,836
44
function ms = msSelectROIs(ms) %MSSELECTROIS User interface for selection of ROIs for aligment algorithm. % The motion correction algorithm (sbxalign.m and fftalign.m) came from Dario Ringash, % https://scanbox.wordpress.com/2014/03/20/recursive-image-alignment-and-statistics/. % We suggest using a small ROI ro...
9dc159283fb62077ddcf07d9741fa9a0540457fe19bceed1e02c2a38dc9b969d
MATLAB
1,837
57
clear all supPath = 'C:\Users\Noga\Documents\Vermis Data'; load ('C:\Users\Noga\Documents\Vermis Data\task_info'); req_params.grade = 7; req_params.cell_type = 'CRB'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:5000; req_params.num_trials = 20; req_params.remove_question_marks = 1; raster_params....
eaa9d6d6422a058bf13f549ebfb3b99c18cd7218a4dba5df63156c7e45d6dc2e
MATLAB
1,837
60
function test_suite = test_bids_query_mrs %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 test_functions = localfunctions(); %#ok<*NASGU> catch % no problem; early Matlab versions can use initTestSuite fine end initTestSuite; end function test_bids_query_asl_basic_2dmrsi() ...
87c9f08412e5f94ff9d4cd07a1a081feb69099e8be2c0eeb226dbc9a86fd89ee
MATLAB
1,839
70
function net = vbhafa_z(Y, Qns, maxdim, nIter, tol, pcaflag) QnsCell = {Qns}; Ycell = Y; Y = cell2mat(Y); nStates = size(Qns, 2); [p n] = size(Y); k = maxdim + 1; approach = 1; net = struct( ... 'model','variational SAFA', ... 'hparams',struct('mcl',[],'psii',[],'pa',[],'pb',[],... 'alpha',[],'alphaa'...
9f117264cd74845dde9a868492dd332e313fa205fd46376f6231d397f6e6d1a0
MATLAB
1,839
83
function unitTest = Homer3(groupDirs, inputFileFormat, unitTest) % Syntax: % unitTest = Homer3(groupDirs, inputFileFormat) % % Examples: % % Homer3({'.'}, '.snirf') % Homer3({'.'}, '.nirs') % global logger global cfg setNamespace('Homer3'); if ~exist('groupDirs','var') || isempty(groupDirs) ...
bcdeb5192b7fb06e9d5dad12a1349a2d392b2002c5bea74c0aeafa37f4c20cf5
MATLAB
1,839
53
% if trials var already filtered out trials by condition/locations, then % just filter out movieIdx to same criteria. % for fNIRS only % For sbj 08 and 10 % trials is already 90 trials, movieIdx has 180 trials. function [trials,varargout] = keepCorrectTrials_Special(sbjNum,trials,behFN,numClasses,movieIdx) load(be...
f63e6d33a3e2e3e851f6d7daebd9b17680a480fc574abde864d74e51e1438606
MATLAB
1,839
53
function recX = reconstruct_data(mappedX, mapping) %RECONSTRUCT_DATA Reconstructs data from low-dimensional data representation % % recX = reconstruct_data(mappedX, mapping) % % The function tries to reconstruct the original data from the % low-dimensional representation in mappedX. The function requires the % origin...
219b248b128945814c79e4ff73d7427a6edbed3b6de2eb9b4ce4164a0bea9508
MATLAB
1,840
45
%% Extracting EEG timing test %% Open EEGlab eeglab; % run EEGLAB % Check if variable EEG_timingtest_video_align exists already. If yes, load it. if exist([output_dir output_general 'VideoBasedMarkers\EEG_timingtest_video_align.mat']) == 2 load([output_dir output_general 'VideoBasedMarkers\EEG_timingtest_v...
5065f11400b8d5598cbcb21074899171b22e6c069a92887a754f8415a82ce685
MATLAB
1,840
60
function [subj] = rename_group(subj,objtype,old_groupname,new_groupname,varargin) % Changes the groupname for all objects in a group % % [SUBJ] = RENAME_GROUP(SUBJ,OBJTYPE,OLD_GROUPNAME,NEW_GROUPNAME,...) % % This goes through all the objects of a specific type, finds those % with group_name OLD_GROUPNAME, and sets it...
52d9ed4ee57457bfc5643546e7ce0b7998f7ec08ab7483cd5fdd2a40be0997dd
MATLAB
1,840
70
function [SF,chpt,estsigma]=automated_step_detection(trace,varargin) %input arguments %first: position trace with steps %second: width of moving median filter (this removes short back and forth %stepping %third: step size filter (in a single run all steps below the threshold are %removed and the step function is ...
0bfc1555b7fe5a0f0c45e80f472903273e09ea934322ad87c0927a6d25224cb8
MATLAB
1,842
51
function [all_artifacts] = corr_artifact_blink_sacc_EKG(cfg) % unpack cfg compdat = cfg.compdat; %components data sigdat = cfg.sigdat; % EEG data sig_index = cfg.sig_index; nindex = length(sig_index);% number/index of EOG channel p_thresh = cfg.p_thresh; % pvalue thres .05 r_thresh = cfg.r_thresh; % r value th...
70b1f1f9bf21de20930c6a50281abc3e34252e4629398a230b546baa9823d35d
MATLAB
1,842
66
function [data, label] = gmmsamp(mix, n) %GMMSAMP Sample from a Gaussian mixture distribution. % % Description % % DATA = GSAMP(MIX, N) generates a sample of size N from a Gaussian % mixture distribution defined by the MIX data structure. The matrix X % has N rows in which each row represents a MIX.NIN-dimensional samp...
620141977193dedbec38e55cc844739029fbb2634446aa43a3697eeb49e53421
MATLAB
1,843
63
function [eye, p] = eye_pp(i_sub, p) % Get subject ID as string sub_str = num2str(i_sub,'%02i'); % Initialize output variables eye = []; % Check if subject has the right number of .asc files (each only has one % per session) f1 = dir(fullfile(p.base_dir, 'Nifti', ['sub-' sub_str], 'ses-01', 'eye', '*.asc')); f2 = di...
03534660b64bfa5281b9582442cacd5610a3d2b00a992c27908b44492c096692
MATLAB
1,845
48
function [sig_cells_sb, areas_sb] = NWB_SB_plotCell_Sternberg(nwbAll,all_units,params) %NWB_SB_PLOTCELL_STERNBERG Plots example cells from Kyzar et al 2023 % Outputs results of calcSelective_SB %% Speficy unit filter unit_examples = [... % Specify by sub-id, ses-id, unit_id % See Daume et al. Fig 3a 5, 1, 29; ...
15419f948e5e18207cfcb1f73fc545ed454c39349cbf557b149424f206780585
MATLAB
1,845
64
function chirp = yOCTLoadInterfFromFile_ThorlabsLoadChirp(fp) %This function loads a chirp file for thorlabs system. %fp - can be the exact file path of the chirp file or a path to the %thorlabs datafolder %% Get file path pointing on to the chirp file [~,fname] = fileparts(fp); if isempty(fname) %We got ...
825b590eabcba35f29f34dc3539bdd329236b4ba7fe7108abc46a8569a42f613
MATLAB
1,846
59
function [subj] = remove_objfield(subj,objtype,objname,fieldname) % Removes a field from the object % % [SUBJ] = REMOVE_OBJFIELD(SUBJ,OBJTYPE,OBJNAME,FIELDNAME) % % If OBJTYPE == 'subj', removes a field from the SUBJ root. Can't % be used to delete any of the main types or any required fields % License: %============...
fc33f02f0e20283694ec1eb43e2645292662303eeb543b7273628b24a8b89fe0
MATLAB
1,848
61
function Results = getRespLatencies(d,minDate,maxDate,maxBin,RespWin,minRespDelay,sessionFilter) %UNTITLED Summary of this function goes here % Detailed explanation goes here if nargin < 5, RespWin = Inf; end if nargin < 6, minRespDelay = 0; end if nargin < 7 || isempty(sessionFilter); selectSessions = 0; elseif(is...
f4fed798ade334b58a5588499de194fa2723c26b4b193c48b39875d64feb175f
MATLAB
1,851
77
function [HdI,pHdI] = HDIndex(S,ang,ep,varargin) % USAGE % HdI = HDIndex(S{c},ang,ep) % % Inputs: % S: spike train % ang: a tsd object of head orientation % ep: an intervalSet object defining the time of valid pos tracking % % options: % [h,d,mu,p,kappa] = HDIndex(S,ang,ep,nbBins,sdSm...
c02603e2e5d582e3097c17f3c04704516ed5965ca792cfea7b1a127ae603ebff
MATLAB
1,852
63
function r = sbxalign(vidobj,idx, ROI,plotting) % based on work of Dario Ringach % https://scanbox.org/2014/03/20/recursive-image-alignment-and-statistics/ if(length(idx)==1) hLarge = fspecial('average', 40); hSmall = fspecial('average', 2); imgA = msReadFrame(vidobj,idx,true,false,false); imgA = (fi...
07bf78c7f57177ec383bc0cd0f56b9af123c9afee848fa000836163d6fd24f6c
MATLAB
1,854
56
function intoFolder(parentNode, topFolder, expd, varargin) % INTOFOLDER walk subfolders (1 level) and create child nodes to parent % node treeHandle % % It supports multiple topFolders, and the parentNode should have the % same numel return as topFolder % % VARARGIN % context menu: Op...
aa928a9799f3f3211739ce27e069542476a3877f27bef316b97862a65685d9b2
MATLAB
1,854
72
function [snirf, nirsfiles] = Nirs2Snirf(dirname, nirsfiles0, replace, ntimebases) % % Syntax: % snirf = Nirs2Snirf(dirname, nirsfiles) % snirf = Nirs2Snirf(dirname, nirsfiles, replace) % snirf = Nirs2Snirf(dirname, nirsfiles, replace, ntimebases) % % Description: % Convert all .nirs files in the folder dirname...
4b5ed531bc7c42da55c9b23128a0c24b57b552254a63655d0d07dc30b2c73f8a
MATLAB
1,855
50
function [dFFTraces] = dFF_lowerXPercent_20220127(RawTraces, SecPerFrame, MovingWindow, LowerXPercent) % dFF_lower calculates the dF/F from raw traces, taking the lower X% of % frames in the moving window to calculated the mean fluorescence % Michelle Cahill 20220127 (adapted from Nicole DelRosso and from dFF_lower_...
e3e950bb49c4636504463346340ce3623572b451c80165ea93960bc0ab04354b
MATLAB
1,855
81
function pth = resolve_bids_uri(uri, layout) % % Resolve a bids URI to a fullpath. % % USAGE:: % % res = bids.internal.endsWith(str, pattern) % % :param uri: BIDS URI (taken from an IntendedFor field) % :type uri: char or cellstr % % :param layout: BIDS layout where the URI is resolved. % :ty...
023bdb2258c3e77fcb2b54836c930dc21a352eba142e1b7a47e220e81c11ef42
MATLAB
1,858
60
% JN 2022-04-26 % Convert sorted combinato output to Matlab files in Matlab. % This is useful for working with Combinato outputs % without using Python at all. folder = '/home/johannes/Downloads/'; chan = 29; label = 'joh'; sign = 'pos'; ffolder = fullfile(folder, sprintf('CSC%d', chan)); dfile = fullfile(ffolder, ...
1836a9fc0845d9b547e3a81d174de8ec1cba59f57ae05c187c35af3a528c12ec
MATLAB
1,859
53
% function [cfg,data_train_trans,data_test_trans,score] = transfeat_PCA(cfg,data_train,data_test) % % no help available, please check code % Update: 2016-08-25: Removed call of princomp, because direct call is faster function [cfg,data_train_trans,data_test_trans,score] = transfeat_PCA(cfg,data_train,data_test)...
4dd4159dd460709dc6dae96aea3c44b53881e88ba0fb5b8339f3fba3c4148677
MATLAB
1,860
65
function [y, z, a] = mlpfwd(net, x) %MLPFWD Forward propagation through 2-layer network. % % Description % Y = MLPFWD(NET, X) takes a network data structure NET together with a % matrix X of input vectors, and forward propagates the inputs through % the network to generate a matrix Y of output vectors. Each row of X % ...
bf6342b28db4087e582c9b564212790fb5c7a0daa497c493bcfce3ae21f20844
MATLAB
1,860
53
function step1_data = analysis_step1(params, f) switch params.acquisition_system case 'Doric' %% LOAD DORIC DATA step1_data = open_doric(f, params); case 'RWD' step1_data = open_rwd(f, params); end step1_data.sfreq = 1/mean(diff(step1_data.time)); rc = params.re...
92b3371db1bf6c5cc11810589ca4ae08c78dba77b77f9389697794900f607061
MATLAB
1,861
44
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_weight_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_mask1halfSD_weight/'); addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Hopf_...
a61df4d7ac322042aafbde1082ee014366dddfc6947c3070beb5127d9840af96
MATLAB
1,861
44
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_weight_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_mask1halfSD_weight/'); addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_homogene...
6a2405f478fae99be5d00b44b45b6b4443c87daba77868f3a434fb2a27bfb7d1
MATLAB
1,866
65
%% Add path addpath(genpath('../../Ionnic Channel'),genpath('../../Tools'), genpath('../../Synapses'), genpath('../../Datas')); %% Import data from neuron (FS) dt = 2^-6; Vmem = -90:dt:60; l_V = length(Vmem); Vtraub = -55; %% Anonymous function minf_simp ...
9a963ea02a2b69bcd99c354c947f82ae0fe6cf25a2e2f7cd408b0731e16577e9
MATLAB
1,866
62
function behav = msSelectPropsForTracking(behav) %MSSELECTPROPSFORTRACKING Summary of this function goes here % Detailed explanation goes here userInput = 'N'; green = cat(3, zeros(behav.height,behav.width), ... ones(behav.height,behav.width), ... zeros(behav.height,behav.width)); frame = double...
a3c279a766bcc256edc3ba87a4ec591cb5c4f4832272c512d7d194766fee113b
MATLAB
1,867
75
function [area,conduction_time]= Spike_Hist_Area_210406(hist_vec,z,current_elec_pair) % Sam Lassers Brewer Lab 1/8/21 % Starting out, this function has an arbitrary bounding method % Make minimum bin size (get distribution of spikes) %% TODO % Create a running list of last created png images created. % Compare area t...
19591d7dbc82a0816e563bf48c6cb097227e6a94380c0bcebc8f43571d941762
MATLAB
1,869
51
% dip test % this code tests that the elekta co-ordinate system for SSS basis sets % works...by imaging simulated sources within it clear all; close all; spm('defaults','eeg');addpath 'C:\home\Data\4AshO' %spmfile = 'C:\home\Data\DBS-MEG\Phantom\090715\SPMstim\spmeeg_uespmeeg_phantom090715_BrainampDBS_20150709_02.mat...
aded9267af20e1cfb77ed5ef2dabc9e149ef6bb99bc1a4f46d248c16169c67e7
MATLAB
1,874
78
function [Hp,Hs]=shadeplot(x,y,sd,linestyle,shadecolor) % function [Hp,Hs]=shadeplot(x,y,sd,linestyle,shadecolor) % % Plot x,y with shaded regions to indicate y +/- sd. % % x,y,sd - Vectors of identical length. % linestyle - Attributes as per standard plot function. % shadecolor - RGB vector for color of shaded ...
c1a302cad14a02af27c52b2e1fed641bbdab6c3c2d42b6e1a9709fab3bc9feb5
MATLAB
1,874
71
function status = UnitTestsAll_Snirf(standalone) global DEBUG1 global QUICK_TEST global procStreamStyle global testidx; global logger t_local = tic; if ~exist('standalone','var') standalone = true; end DEBUG1=0; testidx=0; procStreamStyle = 'snirf'; % Clean up before we start UnitTests_Init(standalone, true, 'U...
ddcb4b6e157ed9901917d3497670076474c6a100fdc00d4e699623d46efa6cef
MATLAB
1,874
70
%initialize matlab close all clearvars clc % Determine where your m-file's folder is. folder = fileparts(which(mfilename)); % Add that folder plus all subfolders to the path. addpath(genpath(folder)); %user input [file, path]=uigetfile('.txt','Select single MINFLUX data file'); if isequal(file,0) d...
bb9e3fd6dc1b969ca7d75c3a1aeac489a8bdfc3df9f6c34cb4d548bbbd74cb12
MATLAB
1,875
62
function data = PrairieLink_ReadRawFile(varargin) % Read binary file generated by PrairieLinkRawDataStream % Lloyd Russell 2017 % Varargin: % 1: full path to file % 2: first frame to read % 3: number of frames to read % To do: % * allow direct resaving to tiff? % Open the file if nargin filePath = ...
bc7aedf9dccfaf1fd34fe963bd783247e8db2d87862677f09bbc2ead9f4e6555
MATLAB
1,875
91
function [G,sup_scale,deep_scale] = GsGd(L,N,R,Norm) % this is the matrix which will be multiplied by the alpha coefficients in % order to get data for the superficial or deep components. if isempty(L) L = 7; end if isempty(N) N = 7; end if isempty(R) R = [0.06 0.17]; end if isempty(Norm) Norm = 0; end %...
e892a3f925c134cf845b658e7a6d840fc6c77656c5ab1b608bdd5be12df49035
MATLAB
1,875
52
% if trials var already filtered out trials by condition/locations, then % just filter out movieIdx to same criteria. % trials var should have 90 trials % Important, keep number of trials in trials and movieIdx the same % for fNIRS only % For sbj 08 and 10, use keepCorrectTrials_Special function [trials,varargout] = k...
1c5380d75fcf26ca2f2a6b3f7d84faa74ba21ce88b6512bfe5df7ce3ed9b6fba
MATLAB
1,876
54
function BC=betweenness_bin(G) %BETWEENNESS_BIN Node betweenness centrality % % BC = betweenness_bin(A); % % Node betweenness centrality is the fraction of all shortest paths in % the network that contain a given node. Nodes with high values of % betweenness centrality participate in a large number ...
4542215f9b27817407357d70d1553c273430aa02bc3256a971fefd1164c33b9d
MATLAB
1,876
59
function [all_same,diff_vol,diff_ind,maxabs_diff] = compare_volumes(fnames,writeout) % function [all_same,diff_vol,diff_ind,maxabs_diff] = compare_volumes(fnames,writeout) % % Function to compare multiple volumes. Should be provided as list of file % names. If writeout == 1, then write difference image to pwd, b...
71a860f1667692e1145f0de3dd6d09179d7980f2f2d733e6ebfbcca43b3607e1
MATLAB
1,877
66
supPath = 'C:\noga\TD complex spike analysis\Data\albert\speed_2_dir_0,50,100'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'speed_2_dir_0,50,100'; req_params.ID = 4000:5000; req_params.num_trials = 30; req_params.remove_question_marks ...
e6f29860b5cd7197017e0fa21632c2449fb2570e05d9c8010b903e30a78fb6ea
MATLAB
1,877
51
function output = hidden_state_estimate(steps,chpt,L,stsz) % transition states assignment 1=initial dummy state to assure all possible % initial states / 2=bound to bound / 3=bound to unbound / 4=unbound to bound / 5=bound to % bound (reduced stepsize)/ 6=unbound to unbound (enhanced stepsize) xemi=1:1:100; % pos...
1c52a07bdf693b2f95f18a658d4a874d43cb07e83be64fe2f3071c397b56b751
MATLAB
1,879
61
clear all %% Load data load(fullfile('Data','SpikeData'),'S'); load(fullfile('Data','BehavEpochs'),'wakeEp'); load(fullfile('Data','Angle')); load(fullfile('Data','CellTypes')); led1 = load(fullfile('Data','LED1_TS.csv')); baseEp = intervalSet(led1(1,1),led1(2,1)); % we can take the du...
1f267614b8902c7062a01944e6b3cd9fd6105f7e9a8a0fdb2585fd6deb1f23b5
MATLAB
1,881
77
function [h,B,mu,p,kappa,h0] = HeadDirectionField(tsa,ang,GoodRanges,varargin) % USAGE % [h,B,mu,p,kappa] = HeadDirectionField(tsa,ang,GoodRanges) % % Inputs: % tsa: a ts object (typically a cell!) % ang: a tsd object of head orientation % GoodRanges: an intervalSet object defining the time of...
42e87948816956ab5abf7b6e9cdbb7fa530e748e4c7cd7c11fde4d3d8fa73211
MATLAB
1,881
58
clear; clc [task_info, supPath ,~,task_DB_path] = ... loadDBAndSpecifyDataPaths('Vermis'); req_params.grade = 7; req_params.cell_type = 'CRB|PC'; req_params.task = 'speed_2_dir_0,50,100'; req_params.ID = 4000:6000; req_params.num_trials = 50; req_params.remove_question_marks = 1; raster_params.time_before = -100;...
e901abe53b1e37be6ae1a02d5e3e1f8b76356f02cc276ad3750f4b27435e187c
MATLAB
1,884
37
%Plots flicker stimulus on plot. %2024/02/25 function plot_flicker(freq,y_lim,duration,patch_color,single_pulse,varargin) %COMMENTS EXPLAINING BELOW? if ~isempty(varargin) height_divider=varargin{1}; else height_divider=5; end yrange=[y_lim(2) y_lim(2)+((y_lim(2)-y_lim(1))/height_d...
107a75c9ffa76aa6d1e438c143e922fb8a932640cff06502e6c1858b38b3c0e7
MATLAB
1,885
81
function [h,B,hdi,mu,p,kappa,h0] = HeadDirectionField(tsa,ang,GoodRanges,varargin) % USAGE % [h,d,mu,p,kappa] = HeadDirectionField(tsa,ang,GoodRanges) % % Inputs: % tsa: a ts object (typically a cell!) % ang: a tsd object of head orientation % GoodRanges: an intervalSet object defining the tim...
c3c784ca1b84ed888ce5b9832f3dbcccae81b5b8ec51c092f9ccd5f4804b5ec5
MATLAB
1,885
61
% % For a linear classifier (SVM, LDA), define the hyperplane and the signal axis % % Beta/Bias: parameters as derived from fitclinear or fitcdiscr % P: Dimensionality of the data % %urut/Aug'23 function [signalVector_derived, signalVector_fromModel_norm, fHyperplane, fBoundLine] = LinearClassifier_getSignalAxis(Betas,...
9f573b5e510d858e3b13b212d199b5075ecfcb5a195829211a836a97a0530a92
MATLAB
1,886
69
function [spkBurstIx,burstLg,burstIdx,burstLgInd] = BurstSpikes(S,varargin) % % [spkBurstIx,burstLg] = BurstSpikes(S) % % Detects burst spikes and computes burst index % Input: % S: a ts object of spike timing. % Output: % spkBurstIx: a vector same length as S, indicating spike index in each % burst (0 f...
0af56eb32245bc886f025444f0859eb1decab582951fab38ec72bac73b71a3c6
MATLAB
1,888
44
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask2SD_bin_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_homogeneous/outputs/Trials/HC/'); addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_mask...
88d929c9af4db334077cc4174deddf797a439599db0d6444ec384e83e3871eb9
MATLAB
1,888
44
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask2SD_bin_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Hopf_hc_tp2/outputs/Trials/'); addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_mask...
1a6a2cc55b3501cec137869f6c9f98daee343fdb0fb31e9ed3a9b93e3c1ea248
MATLAB
1,889
54
% In order to bring an old version of datafiles up to speed (to convert to % current format) use this script. It runs over all subjects of some % library for the purpose of finding old / unsupported data files and % converting them to current version %% Inputs % Which library to run on [subjectsPath,subjects...
6bd4761737f26eb903b46ba65c057b06d527c8ad934f36b194511185c38d1f5b
MATLAB
1,889
62
function [scratchpad] = train_template(trainpats,traintargs,in_args,cv_args) % Template for creating custom training functions % % [SCRATCHPAD] = TRAIN_TEMPLATE(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS) % % See 'Creating your own training function' in manual.htm % % See the related TEST_TEMPLATE function that gets called ...
1ddf7ff0a34ea5b6a6572467979c30dbf691508623491f7c0ba4f0245f8926a3
MATLAB
1,892
54
function L= Computer_laplacian_matrix(W) if W == W' fprintf('Run the first case undirected graph') % out-degree matrix D=diag(sum(W,2)); Wsymm=D^(-1/2)*W*D^(-1/2); Wnew=Wsymm; n_ROI = size(W,1); % compute normalized undirected graph Laplacian: L^=D^(-1/2)...
e3b0d0dcdbda08d29041106393d72ba7b7a65ecf0bfd94ec452a7bed3e533af4
MATLAB
1,893
69
function data_detrended = detrend_spline(data, n_nodes) % function data = detrend_spline(data, n_nodes) % % Remove slow temporal drifts from the data of each voxel using cubic % spline interpolation. % % Input: % - data: [n_tr, n_voxel, n_run] array with data. % - n_nodes: Number of nodes for spline fitting (reco...
0c85de9a443bbc801df3c10e98a7b6899a30747322c164fc72577830f95d0eed
MATLAB
1,895
43
function new_matched=convert_allregion_unit_matched_220413(allregion_unit_matched) new_matched=[]; for i=1:length(allregion_unit_matched) recording_data=[]; Subregion=unique(allregion_unit_matched{i}.Subregion,'stable'); for j=1:length(Subregion) tunnels=cellstr(allregion_unit_matched{i}.("Electrod...
87b0ea4d5acba000712a029b87a2e22b83124fd5ce93f1db736f96514671157f
MATLAB
1,895
62
function [downsampled_array] = downsample_HD(array, factor,varargin) % Default method is mean method = 'mean'; for v = 1:numel(varargin) if strcmpi(varargin{1},'sum') method = 'sum'; elseif strcmpi(varargin{v},'median') method = 'median'; elseif strcmpi(varargin{v},'prctile') met...
6b2132838134ca2988121fbe1482977a6cbeac2bf98b11f40e1d9d312c493c09
MATLAB
1,896
73
function im = intervalMean(tsa, is, varargin) % Computes mean of of data in each of subset of a given interval % % USAGE: % im = intervalMean(tsa, is, options) % % INPUTS: % tsa - a tsd object % is - an intervalSet % % OUTPUTS: % im - a tsd object, where the timestamps correspond to each inter...
dd09989ea8e7f743fe21c532dfbfccc54da02181c828160133a275a6c7799836
MATLAB
1,896
51
% Vm = vsh_modified_in_fast(theta,phi,l,m,p0) % % Vector spherical harmonic funtion modified from Hill's function % V_lm for quantum numbers l and m. Angles theta and phi should be % given in radians. p0 contains the values of the Legendre polynomial. % function Vm = vsh_modified_in_fast(theta,phi,l,m,p0) % Copyright ...
0a4cfbba25f6d8b871dbb4e7e27281c6cd4029eca658582693427adcf403e24e
MATLAB
1,898
54
function this = cosinorAnalysis(this) %COSINORANALYSIS Perform cosinor analysis on an ACTI object % % $Author: Peng Li % $Date: Jul 01, 2020 % period = this.CosinorInfo.HarmonicsInHour; minLen = this.CosinorInfo.MinimumLengthInDays; epoch = this.Epoch; % in sec x = this.Data; x(this.GapSeries)...
7b38c811ef2bc6970cf6d7c30e017bef59a5a6c76b4222d91f53275d839ee58f
MATLAB
1,898
86
clear DEGREES = 0:45:315; GAUS_WIDTH = [5:5:150]; PD = 180; NOISE_STD = 0:0.1:3; NUM_TRIALS_PER_COND = 100; REPEATS = 1000; figure; ax1 = subplot(1,2,1); hold(ax1,"on") for i = 1:length(GAUS_WIDTH) % DEGREES = DEGREES(randperm(length(DEGREES),2)); disp ([num2str(i) '/' num2str(length(GAUS_WIDTH))]) ...
e9ce79d12bc58ea2b66db9703fa58fdce0d7fae722b611517c3ee1280928d893
MATLAB
1,898
70
%% SI ANALYSIS: Simulating 2-ADC Model by varying criterion with fixed d' % This is to show that varying criterion alone is a valid strategy to % increase percent correct in a mADC task with high cue validity %% Initializing parameters cols=[1,0,0;0,1,0;0,0,1]; % Colors % Sensitivity d1=1; d2=1; d=[...
5f39226f327e4c5aef6863fc5b695ba12487f34a3101509c0a0d8230770aca7c
MATLAB
1,899
49
function refreshGaps(this, actigraphy) % REFRESHGAPS Update gap patches from ACTIGRAPHY % % $Author: Peng Li % $Date: Feb 29, 2026 % ax = actigraphy.actiAxis; yrange = actigraphy.Decoration.YLim; delete(findobj(ax, 'Tag', 'GapPatch')); delete(findobj(ax, 'Tag', 'GapText')); if ~isempty(this.Gap) ...
02450ffe505a0ddeb8b04addddf8c79e8bb92622e5612c36b0dad7380acdc2dd
MATLAB
1,908
82
function [ang,GoodRanges,ep] = HeadDirection_Wrapper(fbasename,varargin) % loads head-direction from a position file file (ending in .whl) % % USAGE % [ang,GoodRanges] = HeadDirectionWhl(fbasename,options) % % INPUT: % fbasename: session file basename % whlStruct (optional): a structure containing po...
d10e3a3c0382819856bdd5b7013e6f5fd095e1591863fc0751701aefcdf0b560
MATLAB
1,912
75
function L = CrossValidationPeerHDCheck(Starget,Qassembly,Qtarget,ang,ep) nbEp = 10; fprintf('Launching Cross-validated Peer info\n') epV = regIntervals(ep,nbEp); dQ = Data(Qtarget); nbC = size(dQ,2); L = NaN(nbEp,nbC); % weights = zeros(nbC,nbEp,nbC-1); angq = Restrict(ang,Qtarget); for ii=1:nbEp fprintf('.'...
8c29d7018891ae82cd1530dd88f3c98837d82b38f6231104b283dd74fca271c6
MATLAB
1,916
53
function plotSine(K1, K2, K0, I, learn_color) % (temmporarly?) helper function -- plot VORD sine for PC freq = 0.5; dt = K1.dt; tt_sine = (0:2/dt)'*dt; head_curr = sin(2*pi*freq*tt_sine); % TODO: make sure these match!!! [Ehat_orig, Phat_orig] = modelImpulse(getImpulse(K1, I, 1), I, head_curr, zeros(size(head_curr)),...
bde2e974b799d0bcfe048ffc628cee7d4a9be598197c1b76c8070a94bec31fc5
MATLAB
1,916
60
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to perform CCA for brain-behavior analysis % % Jin % 7/25/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% set the file path current_path = pwd; working_path = current_p...
5ac8494d6e9a8b59c9453fa357547664a6844dc4ed34b7a780975bd9a824c1af
MATLAB
1,920
61
addpath(genpath('/dagher/dagher11/filip/Software/BrainSpace-0.1.2')); addpath(genpath('/dagher/dagher11/filip/Software/gifti-main')); addpath(genpath('/dagher/dagher11/filip/Software/netneurotools')); addpath(genpath('/dagher/dagher11/filip/Software/neuromaps')); [v_dkt_lh, l_dkt_lh, ct_dkt_lh]=read_annotation('/dagh...
b3e178449273b2fd10ead2de2c3ffd267f24adab63cdb72a6cdc83dcd143e801
MATLAB
1,921
51
function updateSubmodulesWithoutGit(submodules, branch) if isempty(submodules) return; end if isempty(branch) return; end for ii = 1:size(submodules,1) url = submodules{ii,1}; submodulepath = submodules{ii,3}; [~, submodulename] = fileparts(url); filenameDownload = sprintf('....
4839644650d044a2c9da949d318353a2f16c31901f1b4414ab4f2c8d34a1ea04
MATLAB
1,922
43
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_bin_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_homogeneous/outputs/Trials/HC/'); addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_...
9e3e094b264f2d5c08c88abbb447868159c7339bc4705938fdea092bfdd41bd6
MATLAB
1,922
43
clear all; outdir='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Lesions_Hopf_mask1halfSD_bin_corr/outputs/Trials/'; addpath(outdir) addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/Hopf_model/TBI_ON_Hopf_hc_tp2/outputs/Trials/'); addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_Hopf_...
ad75ca234dec34f56c334012df294b7d6dedd9111115e3f9c0667b93c8c84a9f
MATLAB
1,922
61
addpath(genpath('/dagher/dagher11/filip/Software/BrainSpace-0.1.2')); addpath(genpath('/dagher/dagher11/filip/Software/gifti-main')); addpath(genpath('/dagher/dagher11/filip/Software/netneurotools')); addpath(genpath('/dagher/dagher11/filip/Software/neuromaps')); [v_dkt_lh, l_dkt_lh, ct_dkt_lh]=read_annotation('/dagh...
dff9443b8ad55bf718a76d0baf98ab43f0428b6691fc984939972dd18d23d388
MATLAB
1,924
47
function M=fEPIa_shortTR(Mx0,My0,Mz0,nExt,nStartExt,TR,TE,shortTR,T1,T2,FAdeg,FreqOffset) %% Simulate the multiple measurment of EPI CSF signal and more saturated signal at the last measurement FA = FAdeg*pi/180; % radian M0=1; bettaTT=2*pi*FreqOffset*TE; Dtt=[ exp(-TE/T2)*cos(bettaTT) exp(-TE/T2)*sin(bettaTT) ...
9672ad3b3676b6098c867e46d0647ca1edb0a2b919f39fb7f69d0cf4e3ee80e6
MATLAB
1,925
67
%% Plot choice vs mADC scatter plot ( Pooled across sessions + angles ) load('choice_vs_madc_RFTrials.mat') %% Monkey G sens_madc{1} = best_thet_est.G{1}(1,1:4); c_madc{1} = best_thet_est.G{1}(1,5:8); for iLoc=1:4 bias_madc{1}(iLoc)=exp(-(sens_madc{1}(iLoc)*(c_madc{1}(iLoc)-(0.5*sens_madc{1}(iLoc)))...
98c4741fd442ba448d8ce771cf52eccf8038f09b3b2886187ef25353b03f2c32
MATLAB
1,925
59
function VBpost = mstep_VBVAR(data,Ybar,VBprior,Gammas,barAlpha,Lambda,state) [VBpost.mua VBpost.Lambda_a] = updata_Qa(data,Ybar,barAlpha,Gammas,Lambda,state); [VBpost.nuN, VBpost.WN,VBpost.Lambda] = update_QLambda(data,Ybar,Gammas,VBprior,VBpost.mua,VBpost.Lambda_a,state); [VBpost.aN,VBpost.bN,VBpost.barAlpha] = upd...
a19d79003f0acb9fd7c42156747637e5192cffb5c5d4a98bb6f8994b9025a679
MATLAB
1,925
50
function [ranks,decoding_out] = RFE(cfg,ranks,final_n_vox,iteration,data_train,labels_train,data_test,labels_test) % This is a subfunction for feature_selection_embedded. The general % structure is (also for other such functions): % INPUT: % cfg: contains all configuration information % ranks: index which pa...
f7afa08d9f4478f01aa75250f1812b03b9237df9096fb4e5d620cf75eb77b406
MATLAB
1,925
53
function [pparam, X, clabel] = mv_preprocess_undersample(pparam, X, clabel) % Undersamples the majority class(es) in unbalanced data. % %Usage: % [pparam, X, clabel] = mv_preprocess_undersample(pparam, X, clabel) % %Parameters: % X - [samples x ... x ...] data matrix % clabel - [samples x 1] vector...
db8b5ac70c0352691cf5791a6503f66df3f751d378988e20d52b8867d7181839
MATLAB
1,926
73
function status = UnitTestsAll_Nirs(standalone) global DEBUG1 global QUICK_TEST global procStreamStyle global testidx; global logger t1 = tic; reg = RegistriesClass('reset'); if ~exist('standalone','var') standalone = true; end DEBUG1=0; testidx=0; procStreamStyle = 'nirs'; UnitTests_Init(standalone); logger =...
d74334cae74f2db7f5b4c310379ca96df0628d11a65b7b69af78e23dbbd96cb9
MATLAB
1,928
72
function S = smooth(tsa, l, varargin) % Smooth a TSD % % USAGE: % S = smooth(tsa, l, OptionName, OptionValue, ...) % % % This is intended for continuously sampled tsd-s, the sampling rate is % guessed with the median inter-event interval method (see MEDIAN_DT) % If there are some missing values, they ...
7ed1140e7230192b056cbb5126060c7de693e56adb404965882470bc9624da6a
MATLAB
1,930
63
function pass = print_unittest_result(msg,expect, actual, tol) % Prints the unittest result. Compares the expected result to the actual % result. If the difference is < tol, the test is passed. Otherwise it is % failed. % % Parameters: % msg - [char] message string % expect - [double] expected result ...
3653454524e0d51cd9796a0cfe307e2116326eceafe83c2a9555b06c9e2681ad
MATLAB
1,931
66
%% Behavior figure clear all [task_info,supPath,MaestroPath] = loadDBAndSpecifyDataPaths('Golda'); req_params.grade = 7; req_params.cell_type = 'CRB|PC ss'; req_params.task = 'speed_2_dir_0,50,100'; req_params.ID = 5600:6000; req_params.num_trials = 60; req_params.remove_question_marks =0; behavior_params.time_aft...
3d6ab97702e67439b54f76ef4d08cbef7090458b85032f4bf5f0dd14d9a4bf40
MATLAB
1,932
43
% function for fitting the model and % checking if it provides a perfect prediction of all choice data, % in which case, a better model is where the scaling factor is infinite function [bestb,out] = fitandcheckmodel(startingpoints,lb,ub,DVH,data,type) b = nan(size(startingpoints)); negLLlist = nan(size(b,1),...
74af570f7b4a8ccdeca6b3a33a743d65809995f76b55b46f8c292c0e662b822c
MATLAB
1,932
59
function [extra, invhess] = fevbayes(net, y, a, x, t, x_test, invhess) %FEVBAYES Evaluate Bayesian regularisation for network forward propagation. % % Description % EXTRA = FEVBAYES(NET, Y, A, X, T, X_TEST) takes a network data % structure NET together with a set of hidden unit activations A from % test inputs X_TEST,...
57677013f04f5b761d9ebcedf2c0d549b8a470791e7b4cd4b14b240fbf049bfb
MATLAB
1,936
57
function p = genpath_nosvn(d) %GENPATH Generate recursive toolbox path (ignoring .svn entries) % P = GENPATH returns a new path string by adding % all the subdirectories of MATLABROOT/toolbox, including empty % subdirectories. % % P = GENPATH(D) returns a path string starting in D, plus, recursively, all ...
756304c784e912ac391fb81bad342175faea723fd28d3a076bb0bb997b3682f4
MATLAB
1,936
60
%% Significance as function of time, trials without saccade clear all supPath = 'C:\noga\TD complex spike analysis\Data\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:5...
b41c5124f206b9efdf77399268eb2bc7f1ce863ab63006ce7d92ae9b8e229bd6
MATLAB
1,936
63
% STATUS: Active % % SYNTAX: % [singleTrialHRFHbOM, singleTrialHRFHbRM, singleTrialHRFHbTM] ... % = createSingleTrialHRF_MultiOnly_NoSave(trialsCont, allSMultiple) % % DESCRIPTION: % Reformat continuous data format (channels x time) into epoched data % format (channels x time x trials). Split into 3 different chr...
bcef1490ac56503b8e00709ae6c054beba5a1b36f8e3ee37012943793a829f36
MATLAB
1,937
54
function imetronic_DB= synchronize_imetronic_data(filepath, recording_config, data) [filepath_,name,ext] = fileparts(filepath); filelist = dir([filepath_ filesep '*.dat']); if ~length(filelist) imetronic_DB = [] return end imetronic_path = [filepath_ filesep filelist(1)....
70ccc50b8ed1f6a159636403c5b163699ea7792cf2b9528018b87373e269f80c
MATLAB
1,939
74
function photo_plots(data, plotname) if strcmp(plotname,'deinterleaved signals') fig=figure(); title('deinterleaved data') hold on plot(data.dein_signals.time,data.dein_signals.iso,'m') plot(data.dein_signals.time,data.dein_signals.physio,'b') legend({'iso', 'physio'...
c46739aa3a21b11d0a7e96fafcc43e61b95fb7f64db8caef40ef5f75105346ff
MATLAB
1,942
79
function hdv = mlphdotv(net, x, t, v) %MLPHDOTV Evaluate the product of the data Hessian with a vector. % % Description % % HDV = MLPHDOTV(NET, X, T, V) takes an MLP network data structure NET, % together with the matrix X of input vectors, the matrix T of target % vectors and an arbitrary row vector V whose length eq...
0a380073695c5cb58bac81b44cc2700b139071c2cd166e9c0d85b6c6f55a9525
MATLAB
1,945
84
function [theta_est_choice] = ... est_param_choice(monkey, RF, sessions, beh_dat, sessions_type) %% Function to estimate parameters on pooled across sessions onebyN_flag = 1; %% Code for both pooled and Jack-Knife Fitting if(sessions_type == "indiv_sessions") sessions_looped = sessions; ...
579e0ddbe71006feb3a889febecf67b3494e28f01633e7210a5772de44c1a8ed
MATLAB
1,945
67
function [subj] = init_subj(exp_name,id,varargin) % Returns an empty initialized SUBJ structure % % [SUBJ] = INIT_SUBJ(EXP_NAME,ID,...) % % The empty SUBJ structure contains no patterns, regressors, selectors % masks. Adds some rudimentary header info, including the following % string arguments % % EXP_NAME: The name ...
b3b38153b9faae5dde908082bc71d91a47c168746592265a167fd8e058a6ae57
MATLAB
1,945
62
function [subj] = create_norest_sel(subj,regsname,varargin) % Creates a selector with 1s for non-rest timepoints % % [SUBJ] = CREATE_NOREST_SEL(SUBJ,REGSNAME,...) % % Creates a boolean selector from the REGSNAME regressors with 1s % everywhere except where there are rest timepoints % (i.e. timepoints with no non-zero...
4daca70d355fb572f62f5f9814c608b22a096d3270dfb33308967770c3d9f2e0
MATLAB
1,946
63
addpath(genpath('/dagher/dagher11/filip/Software/BrainSpace-0.1.2')); addpath(genpath('/dagher/dagher11/filip/Software/gifti-main')); addpath(genpath('/dagher/dagher11/filip/Software/netneurotools')); addpath(genpath('/dagher/dagher11/filip/Software/neuromaps')); [v_dkt_lh, l_dkt_lh, ct_dkt_lh]=read_annotation('/dagh...
82da4a5349006d49a09834111ebd6201d83ac8bd3cd7a78bf6195aa353e39c74
MATLAB
1,951
88
clear all close all mkdir tempMAout mkdir MAout data=readtable('../../results/results_organized.xlsx'); %data=readtable('../../../PMmeta/AAL3/myAAL3/results_organized.xlsx'); dtistudies={ 'P18' % there would be also study P13 but we keep it since it has fMRI results 'P19' 'P20' 'P21' 'P22' 'P40' 'P48' 'P49' 'P50' 'P59...
46148730acb0dd3abaf987c9e8b768f628297da38bac1f89d1333750fe983aad
MATLAB
1,957
62
function [e, edata, eprior] = mlperr(net, x, t) %MLPERR Evaluate error function for 2-layer network. % % Description % E = MLPERR(NET, X, T) takes a network data structure NET together % with a matrix X of input vectors and a matrix T of target vectors, % and evaluates the error function E. The choice of error function...
7452717cd4fd557ab89f504c38d26042aefce5bcc680f1eec453dee62b980c1e
MATLAB
1,957
74
clear all close all format compact clc % script to calculate distances have been measured for all included scans (UsedSets) gt_dataPath = '/home/dichang/datasets/SampleSet/MVS_Data' [dataPath,resultsPath]=getPaths(); dataPaths = {'/home/dichang/code/related_work/u-mvsnet'} resultsPaths = {'/home/dichang/code/rel...
be2f798a9cbd0e8f6a99a2a1de6095a0c63d2ca3a18a91e23593ea8c9d1f38ed
MATLAB
1,958
59
function [subj] = rename_object(subj,objtype,old_objname,new_objname) % Rename an object OLD_OBJNAME TO NEW_OBJNAME % % [subj] = rename_object(subj,objtype,old_objname,new_objname) % % Note: this could cause friction in your scripts, if you've % forgotten to update the new name later. Also, other parts of the % toolbo...
892b9a77fffb5ee24ecc61c0d723cf70708186e48c17686bf79315c7a80f40c7
MATLAB
1,961
74
function [S] = wavescram(X, N, M) % WAVESCRAM - Efficient, toolbox-free wavelet scrambling. % % Usage: % % [S] = WAVESCRAM(X, N) % [S] = WAVESCRAM(X, N, M) % % WAVESCRAM takes an input signal X, performs an N-level discrete % wavelet transform using the Debauchies-4 wavelet, and then % generates M new signals that ha...
a355aa3b1525efa71af94b39eecbefda0012826b26a45c101fa834430dc9f161
MATLAB
1,962
65
function PlotOpticalFlow(OriginalImage, OpticalFlow, s, fac, varargin) im = OriginalImage.Image(:, :, :, OriginalImage.ActinChannel); vx = OpticalFlow.vxMat; vy = OpticalFlow.vyMat; % vx = imfilter(vx, fspecial('gaussian', 7, 1)); % vy = imfilter(vy, fspecial('gaussian', 7, 1)); rel = OpticalFlow.relMat; flag = 0; if l...