sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
11a0d9488595ed1823ded0bf8b843e18e95e5cc81abd83f516a0fd16d9e0ec65
MATLAB
5,240
165
function create_quadrature_filters_for_morphon_registration2d(varargin) % CREATE_QUADRATURE_FILTERS_FOR_MORPHON_REGISTRATION2D Creates 2D quadrature filters for usage in Morphon registration % % create_quadrature_filters_for_morphon_registration2d() % % INPUT ARGUMENTS % N/A % % OPTIONAL INPUT ARGUMENTS % See "Advanced...
3b843db5057b787f9ef4c9d2e1a576ae5b1d4085c2f59b104c24f5806c77da52
MATLAB
5,242
153
function [errs warns] = unit_scramble_regressors() % [ERRS WARNS] = UNIT_SCRAMBLE_REGRESSORS() % % This is a script that tests the SCRAMBLE_REGRESSORS function. % It mainly tests the optional ACTIVE_SELNAME argument to exclude % time points from being scrambled. % INPUT ARGUMENTS: % (none) % % OUTPUT ARGUMENTS: % ERR...
3faf9279897e527e6daaf0ea76c26819a6a63ab43eae29bdbd8fb66a887684c6
MATLAB
5,245
228
function Duszkiewicz2024_Figure_SingleRec_LFP % This script reporoduces panels from Figure: % Extended Data Figure 9 % Run in folder A3706-200313 to reproduce manuscript figure % % Dependencies: % TStoolbox % Buzcode % TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewi...
2ec3bcee7e8d9e5147632bb2c0d085e6f5d75d61b472da5e38894169f4576fd2
MATLAB
5,255
179
function fo = identifyLinesAndAlignSlide_GoOverAllOptions(f,vLinePositions,hLinePositions,... pixelSize_um,octVolumeJson,histologyFluorescenceIm) %This script goes over all options for feducial lines, chooses the best one %and allows user to manually select if it wants another option %INPUTS: % f - fiducialL...
38e506a7758c8032d73b97742bbb765b758ae69a9cd7a3c72625ebd7e13b89d0
MATLAB
5,264
171
% Probability Tuning curves supPath = 'C:\noga\TD complex spike analysis\Data\albert\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); bool_task = ~cellfun(@isempty,regexp({task_info.task},'pursuit_8_dir_75and25')); bool_type = ~cellfun(@isempty,regexp({task_info.cell_type},'PC cs')); bool...
d1e8e3c136ffd18bac5b14689a9191646a0207fd4fa78b21fc905b8fd6a1ef5b
MATLAB
5,266
173
% Probability Tuning curves supPath = 'C:\noga\TD complex spike analysis\Data\albert\saccade_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); bool_task = ~cellfun(@isempty,regexp({task_info.task},'saccade_8_dir_75and25')); bool_type = ~cellfun(@isempty,regexp({task_info.cell_type},'PC cs')); bool...
574f1758786d4ee81654c8dea25a65f8194efd3b1f3b8e03d0e52d6ba61d9cf5
MATLAB
5,268
198
function hopf_DTI_Grange_tbi(s,condition) %addpath('/Volumes/LASA/TBI_project/TBI_openneuro/Hopf_model/TBI_replication/inputs/'); load(sprintf('results_f_diff_fce_cond%d_ON_tbi.mat',condition)); load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi.mat',condition)); load SClongrange.mat; load schaefer_MK.mat; load('tse...
a1b5d015a2a0fc19c6fea1ba69ed497843b0478e4f0028f569d8baab92915e89
MATLAB
5,285
178
function infocapacity_hopf_errorhete_tbi(s,condition) rng(s); measure='err_hete'; if condition==1 G=optG_tbicond1; %OptG TBI ses1 elseif condition==2 G=optG_tbicond2; %OptG TBI ses2 elseif condition==3 G=optG_tbicond3; %OptG TBI ses3 end NPARCELLS=1000; NR=400; NRini=20; NRfin=380; NSUBSIM=100; %number...
06d131b56eb47e5c61625665b9b7c7f3590b301089ffa246768261467a5ef14c
MATLAB
5,289
132
% Add repts and CI. Used for publication % % Each array is channels x time x trial % This use cross-validation where GLM is computed for each training fold % and SS beta coefficients from training folds are used for test fold. % Used for IPS % STATUS: Inactive(?) % % SYNTAX: % [performanceLDALedoit] = ... % calcCu...
17ea7387d622d866fddbbae68ae66d380668f4f0fa00df4738180b20a18e8569
MATLAB
5,298
121
function [Ci,Q]=modularity_und(A,gamma) %MODULARITY_UND Optimal community structure and modularity % % Ci = modularity_und(W); % [Ci Q] = modularity_und(W,gamma); % % The optimal community structure is a subdivision of the network into % nonoverlapping groups of nodes in a way that maximizes the numb...
7b092db2ae2e77708dc1c9c5bb52d244af27088533f62477e5974ba1c61c6ed3
MATLAB
5,300
177
function [subj] = statmap_searchlight(subj,data_patname,regsname,selname,new_map_patname,extra_arg) % [SUBJ] = STATMAP_SEARCHLIGHT( SUBJ, ... % DATA_PATNAME,REGSNAME,SELNAME,NEW_MAP_PATNAME,EXTRA_ARG) % % OBJ_FUNCT (required, default = ''), % e.g. 'statmap_classify' % % ADJ_LIST (required) - as produced by CREATE_AD...
2014fe222668a68c5d1890ff8730ba737d881dd2ce77294ca6fbfb01c8f63ee9
MATLAB
5,310
147
function [hdr,vol] = mom_read_minc1_octave(file_name,opt) % Read a MINC1 file in Octave % To learn more about the MINC format : % http://en.wikibooks.org/wiki/MINC % % SYNTAX: % [HDR,VOL] = MOM_READ_MINC1_OCTAVE(FILE_NAME) % % INPUTS: % FILE_NAME (string) the name of a minc file % % OUTPUTS: % HDR (structure) the...
bdb69daf5025a8212fc0c239fe5d76f7c2dd7afd2fdda12a33126bcfdbebdb98
MATLAB
5,310
142
function [areas,total_bins,overlap_bins, total_area, overlap_area]=... ISI_conduction_time_peak_finding_210909... (stim,stim_dir,times_struct_stim,stim_duration,parent_dir,if_cw) % Testing peak finding capabilities across multiple units for elimination % of zeros % Fixed saving issue and added bin count for per...
906345afa615789d6a5da453f01cf9c3fadf7258c9fa1271773b6201c101c564
MATLAB
5,312
205
function [errmsgs warnmsgs] = unit_hd_scripts() % USAGE :[ERRMSGS WARNMSGS] = UNIT_HD_SCRIPTS() % % This is a script that tests the move_pattern_to_hd and the % load_pattern_from_hd functions. % % ERRMSGS = cell array holding the error strings % describing any tests that failed. If this is empty, % that's a good thi...
095701be224f37bbc7fdf4ab17b7359a83a10b415194a56fc564ffe31f4e3e91
MATLAB
5,313
153
function [pparam, K, clabel] = mv_preprocess_average_kernel(pparam, K, clabel) % Kernel averaging is the generalization of sample averaging to the % non-linear case. The samples are not averaged in input space (which is % non-linear) but rather in Reproducing Kernel Hilbert Space (RKHS), in % which the data is linearl...
3e94732d75b162cc991e858ad5bf93753cd93582c1fafb0b9c5d489379968b0f
MATLAB
5,324
132
%% THREE CLUSTERS ON TWO LEVELS (UFOs, 2 kHz) % SETTING clear rng(29) % seed Path = [pwd, '\IN_sims\']; clrs = ["b","r","g","k","c","y"]; % colors per_clr = [0.9290,0.6940,0.1250]; % periodogram color % TIME T = 12000; % time span dt = 0.01; % COUPLING eps1 = 0.06; % within a cluster eps2 = ...
74e1d86793796c06ce514dfbe1cbe1a496cc38a5e98f1667ba3eefbe7e49865f
MATLAB
5,328
95
% Extract single HRF from dcNew variable, the output of GLM fitting function % save to mat file. function createSingleTrialHRF_Updated_MultiOnly(sbjNum,movieList,numClasses) %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir =...
6bcc3d6f735203eea074aa8821680c2516f42bd2e5bc888a8fa6335e4fedbe5c
MATLAB
5,333
131
% STATUS: Inactive(?) % % SYNTAX: % [performanceLDALedoitHbO] = ... % calcCumSum_DiffTLen_AllChn_CompClassifiers_Final_NoSave(sbjNum,... % trialsTr,trialsTst,movieListTrain,movieListTest,numClasses,... % mlActAuto,timeLen) % % DESCRIPTION: % Perform cross validation where SS beta coefficients from train...
2eee27de4ade2b7e4fae215b066f3242122ca9b52de151c729a7474c605f5a82
MATLAB
5,340
131
% Fit Helper % % Descriptions tba % % $Author: Peng Li, Ph.D. % Division of Sleep Medicine, Brigham & Women's Hospital % Division of Sleep Medicine, Harvard Medical School % $Date: Dec 26, 2019 % % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % ...
92d6da14a8e221b7e3d145f7ce58da725a5df2a95dfc123366e64a71f9d76aa8
MATLAB
5,342
162
% This script is a demo showing some simple decoding on simulated toy data. % The toy data are simple matlab matrices and no "real" fMRI or EEG data. fpath = fileparts(fileparts(mfilename('fullpath'))); addpath(fpath) clear variables dbstop if error % if something goes wrong res_fig = figure; %% Set the ...
1b899ec16628318096bfe95c284fcbca040991fdf027d003b8a214b312c3eba2
MATLAB
5,345
172
function [Azloo,Azsig,Y,a,v,D,Azloomedian] = single_trial_analysis_EEG(X, truth, duration, skipLOO, perm, eigratio,gamma, method) % INPUT: % X (data matrix) = % [Ch1: Sample1toM (Trial1) Sample1toM (Trial2) .... Sample1toM (TrialN)] % [Ch2: Sample1toM (Trial1) Sample1toM (Trial2) .... Sample1toM (Tr...
22ba31dcc8adb834472fb5a7b711ad8fd7cb60ee7d4ad346b36ce16d15b6b81b
MATLAB
5,345
177
function [theta_est, theta_err, LLF, ctable_mod, ctable_fit, py_corr,theta_init] = mADC_model_fit_sel_angles_resp_error_const(ctable, angles,d_limit,Aeq,beq,lb,ub,r_init) %% function that fits the m-ADC model to data in a contingency table % % Sridhar Devarajan, Sep 2016 % sridhar@cns.iisc.ernet.in % % Usage:...
7cfc0b8ad7f7a331d1b004fd25c23c3c825e6cb9e93b662a7246c47fbbfdb310
MATLAB
5,351
161
function simulateBehavior(models,paratype,fbtype,nSubjects) % input parameter % - models % - paratype ( % empprior = parameters drawn from empirical prior distributions % random = drawn from random (=uniform) distributions % fitted = drawn from behavioral data % - fbtype ( % value = magnit...
20f26384040b720e537c7fc501fe2febddf50859005d0803b6185bb59d0f9ded
MATLAB
5,362
139
function [synLat,synStrZ,synStrR,sigBounds] = FindSynapse_SameShank(cch,varargin) % FindSynapse_SameShank - find putatitve monosynaptic connections based on % cross-correlograms for same-shank cell pairs % % USAGE % [excPairs,inhPairs,excTimes,inhTimes,excStrength,inhStrength,hiBounds,loBounds] = FindSynapse_SameShan...
6f63a66cf08979ec172069634d77babe8aa2dee95cb51ba78d65ee5fdad513b5
MATLAB
5,366
173
% Dependency of LoadPosition. % [CleanWhl GoodRanges] = CleanWhlFR(Whl, StretchLen, JumpSize,Gap); % % "cleans up" a wheel file by interpolating missing stretches % up to StretchLen long (default 20), for which the endpoints % don't differ by more than JumpSize, (default 30). % % also returns the ranges where the whl ...
8467ac6e4a712335a141b919e68c3bdcd6e4740498791d8abbc33707ebaf9540
MATLAB
5,371
190
clear [task_info,supPath,MaestroPath] = ... loadDBAndSpecifyDataPaths('Vermis'); %load('sessionMap.mat') K_FOLD = 10; EPOCH = 'cue'; req_params = reqParamsEffectSize("both"); raster_params.align_to = EPOCH; raster_params.time_before = 0; raster_params.time_after = 800; raster_params.smoothing_margins = 100; ts...
9d795667714ca66a39a1c094b9eea1afcf49ecda094650211f5b6bc58f526f95
MATLAB
5,375
206
classdef Description % % Class to deal with dataset_description files. % % USAGE:: % % ds_desc = bids.Description(pipeline, BIDS); % % :param pipeline: pipeline name % :type pipeline: char % % :param BIDS: output from BIDS layout to identify the source dataset % used when creatin...
b91406f26428f9a6cda2fccef7c945842361c9671e01f6cf45b706de6003cde9
MATLAB
5,376
122
function preprocess_param = mv_get_preprocess_param(preprocess, preprocess_param) % Returns a parameter struct with default parameters for a given % preprocessing function. % %Usage: % param = mv_get_preprocess_param(preprocess_fun, <param>) % %Parameters: % preprocess_fun - [string] specifying the preprocessing fun...
d60529d22cbba9a05f38268e2f82c6d2f9f9099dff7f1f0a58a3f419621224bd
MATLAB
5,391
114
% function output = transres_accuracy_pairwise(decoding_out, chancelevel, varargin) % % For more than two classes, rather than getting the mean multiclass % accuracy across all classes (i.e. chance = 1/n_label), report the mean % accuracy of all pairwise comparisons (i.e. chance = 1/2). % % This code runs faster if all...
59313252fb60e696ddb23b04a1f243994f6f5bb7118f5b81182e5eb0414c8923
MATLAB
5,399
208
clear all [task_info,supPath,MaestroPath] =... loadDBAndSpecifyDataPaths('Vermis'); PROBABILITIES = 0:25:100; NUM_COND = 20; req_params.remove_repeats = 0; req_params.grade = 7; req_params.cell_type = 'CRB|PC|BG|SNR'; req_params.task = 'choice'; req_params.ID = 4000:6000; req_params.num_trials = 180; req_params.re...
ebc064a6cee65273d665ad2c24dbd01297dded9b5fb9a2579610f4af991fa4df
MATLAB
5,402
104
%Figure 3 %Calculations needed for plotting %Percent of participants who said object apeared slanted SL_cont_square_percent = sum(SL_cont_square)./SubjNum*100; SL_exp_square_percent = sum(SL_exp_square)./SubjNum*100; SL_cont_phone_percent = sum(SL_cont_phone)./SubjNum*100; SL_exp_phone_percent = sum(SL_e...
4500b7b1ccc42dd7fde27b52187568db1053cb0a71438248de7e98be6157ddbe
MATLAB
5,410
194
function selection = checkboxinputdlg(choices, name) % Syntax: % % selection = checkboxinputdlg(choices) % selection = checkboxinputdlg(choices, name) % % Inputs: % % choices: Cell array of strings specifying the radio button choices % to select from. % name: (Optional) argument n...
35b5321c70fa36c01dcae308a4892486eae628df6a80e1eb41ab3e77490ac2b8
MATLAB
5,412
180
function [x, options, flog, pointlog] = graddesc(f, x, options, gradf, ... varargin) %GRADDESC Gradient descent optimization. % % Description % [X, OPTIONS, FLOG, POINTLOG] = GRADDESC(F, X, OPTIONS, GRADF) uses % batch gradient descent to find a local minimum of the function F(X) % whose gradient is given by GRADF(...
3fc06a347175efc7702f39f8023bee405ec733a1dd89e4b57972bf5d454fbd79
MATLAB
5,413
183
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Written by James N Ingram, 2023 clear all; close all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% L0 = 0.060; % m L1 = 0.035; % m L2 = 0.050; % m % Valid values for the angles between 1st and ...
15e9e4fb92a02f65f58daf67991a34baa8797afcbd87b7c9f4247a6d9308fb4d
MATLAB
5,422
149
function output_filenames = create_scans_tsv(varargin) % % Create a simple scans.tsv for each participant of a BIDS dataset. % % USAGE:: % % output_filename = bids.util.create_scans_tsv(layout_or_path, ... % 'use_schema', true, ... % ...
8885ccfbe2c8a7b07c8f151e78f4888be2e7252a0be82ea4e53367c6b2ddc758
MATLAB
5,430
170
function dimensions = yOCTLoadInterfFromFile_ThorlabsHeader (inputDataFolder, OCTSystem, chirp) %This function loads dimensions structure header % INPUTS: % - inputDataFolder - OCT folder with header.xml file or srr files % Optional inputs, if they are unknown, we will figure them out % OCTSystem if we know it...
6066d52231879ec5527608a026c695ca8e7741a3b9cac7a4a9fad49680e90f58
MATLAB
5,432
195
function hopf_DTI_Grange_tbi_lesions_mask_2SD_bin(s,condition) %load data load(sprintf('results_f_diff_fce_cond%d_ON_tbi.mat',condition)); load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi.mat',condition)); load SClongrange.mat; load schaefer_MK.mat; load('tseries_openneuro_tbi_tp123_sch1000.mat'); load('lesion_mas...
bff8d8dba5ae732ecadf59d9a5e3249f72290679b066a46690d9663cb164f7ca
MATLAB
5,437
163
function [results_data] = plot_cue_opp_evokResp_bin_rsc(cueMI, oppMI, evokResp_quad, evokResp, iWindow, iMonkey, yl, trial_type); %% windows window_names = ["cue onset", "pre blank onset", "post blank onset"]; %% Plots V4 f-MI cued vs opp histograms (locked to onset) %% Code cueMI_temp = []; oppMI_temp = []; evokR...
ca63088f124ffa1019abcf8006406f31661a018b2309c91a8a193e49d7789a7d
MATLAB
5,441
178
function [theta_est, theta_err, LLF, ctable_mod, ctable_fit, py_corr,theta_init] = mADC_model_fit_sel_angles_resp_error_const_L2(ctable, angles,d_limit,Aeq,beq,lb,ub,r_init,lambda) %% function that fits the m-ADC model to data in a contingency table % % Sridhar Devarajan, Sep 2016 % sridhar@cns.iisc.ernet.in %...
70fc0a285c2bfa6045db0916496e16e4de16317e576ee619c7c27a08dd7c379e
MATLAB
5,443
194
function hopf_DTI_Grange_tbi_lesions_mask_2SD_weight(s,condition) load(sprintf('results_f_diff_fce_cond%d_ON_tbi.mat',condition)); load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi.mat',condition)); load SClongrange.mat; load schaefer_MK.mat; load('tseries_openneuro_tbi_tp123_sch1000.mat'); load('lesion_mask_2SD_we...
73620f27392f24e79c361d808d049134b2ba01f9a01adab218fee1545b6e38e2
MATLAB
5,443
155
clear [task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis'); K_FOLD = 10; req_params.grade = 7; req_params.cell_type = {'PC ss', 'PC cs', 'CRB','SNR', 'BG msn'}; req_params.task = 'pursuit_8_dir_75and25'; %req_params.ID = [4081,4081,4198,4198,4210,4211,4238,4238,4269,4269,4307,4307,4307,4307,4307,4307,4310,4331,...
0e6543fb90e7e2e97932a40d3314c69c9c1f3b55cc468697e27029be22ef78b6
MATLAB
5,444
195
%% Compare Conjunction test exp1 vs exp3 clear all; clc; mdir=pwd; cd('../Data') load AccuracyDATA.mat load BaseDATA.mat JointTrExp3 = [2; 4; 7; 8; 11; 12]; %%% Subjects who received Conjunction training (in addition to Separate training) in experiment 3 cd(mdir); %% PfigDir='../Figures'; Tst1=A...
f2c23d16851ea5fdab045b8f6a9d7685347f0ed354f1b2b892362eccc91e1b81
MATLAB
5,448
133
clear,clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to predict the learning outcomes of week 8 % intervetion % % Jin % 8/17/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% set the file path current_path = pwd; working_p...
86c35786645c72c1ea5526cfaf2741c93b21ac72fabbb1e613d5ca7eaf3f5a2b
MATLAB
5,455
143
% READBIN read data from binary file % % GENERAL optimized for huge files, multiple (dis)contiguous channels, and multiple (dis)contiguous periods % % FILE STRUCTURE sample by sample; in each sample - channel by channel: % % c1t1 c2t1 ... cNt1 // sample 1 % ...
88fa96c2a58a31cf1a70a9524913617ef1b0ee9ccb630132ec50f20b1e2f463f
MATLAB
5,460
155
% function aligntsp2(file, [front, back]) % % Making whl file for two colors. Originally from 'aligntsp.m' by Tony Berenyi. % % tsp(t,:) = [timestamp, color1-X, color1-Y, color2-X, color2-Y, color3-X, color3-Y] % 'front' and 'back' assigns which color (1, 2 or 3) should be used. if -1, then all rows are -1. function a...
9a1e057e0827c562383a064cda04815f6e4530f693eb4ef86c29bf168eeb536b
MATLAB
5,464
199
function [scratchpad] = train_svdlr(trainpats,traintargs,in_args,cv_args) % Experimental classifier: SVD combined with logistic regression. % % License: %===================================================================== % % This is part of the Princeton MVPA toolbox, released under % the GPL. See http://www.csbmb....
caf95a2a41b138e97a14cb156cd5d321524e7234c1e0e775095ba73a9b2205a0
MATLAB
5,466
172
function create_quadrature_filters_for_morphon_registration3d(varargin) % CREATE_QUADRATURE_FILTERS_FOR_MORPHON_REGISTRATION3D Creates 3D quadrature filters for usage in Morphon registration % % create_quadrature_filters_for_morphon_registration3d() % % INPUT ARGUMENTS % N/A % % OPTIONAL INPUT ARGUMENTS % See "Advanced...
3945aaea94d4fef50e1682e1e6f8799569e2c2a6034042624ba09e4cf23bc80e
MATLAB
5,470
194
function hopf_DTI_Grange_tbi_lesions_mask1halfSD_weight(s,condition) load(sprintf('results_f_diff_fce_cond%d_ON_tbi.mat',condition)); load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi.mat',condition)); load SClongrange.mat; load schaefer_MK.mat; load('tseries_openneuro_tbi_tp123_sch1000.mat'); load('lesion_mask_1an...
8255d2900f8dd3f3aee9942c6a21d1c0664d6a41b34aa08bd74ca3277a7f7cc1
MATLAB
5,471
167
function [subj] = load_afni_pattern(subj,new_patname,maskname,filenames,varargin) % Loads an AFNI dataset into a subject structure % % [SUBJ] = LOAD_AFNI_PATTERN(SUBJ,NEW_PATNAME,MASKNAME,FILENAMES,...) % % Adds the following objects: % - pattern object called NEW_PATNAME masked by MASKNAME % % NEW_PATNAME is the name...
7658608d2b4941a3fdd1b6861c8f6d7dafca1a5718fb0d7b6d808cbee8f7c3df
MATLAB
5,476
191
% Implementation of MUSE for comparison (on Matlab R2018b) % (c) Erpeng Dai, Stanford University close all clear clc %% Input parameters MB=3; Rpe=1; vcc_flag=0; par.ky_s = 150; par.ky_r = 200; par.kx_r = 200; par.nSL = 1; par.nCH = 32; par.nB = 1; par.nNEX0 = 1; par.nNEX = 1; par.blipsign = 1; par.nSHOT = 4; %% SM...
4b0b9b164c5169fce3c119ac7c34dee3fcad474bcf458d9eefe1b67ddd9f6089
MATLAB
5,477
185
%% Plot PC activity during VORD and cancellation function [fH_vord, fH_canc, fH_vord_split, fH_canc_split] = ... plotCancellation(I, K1, K2, K0) ylims_canc = [-.6 2.2]; ylims_vord = .6 * [-1 1]; tt = (1:8000)*K1.dt-K1.dt; % Allow two cycles % Function to negate gain if abs(phase) > 90 deg flipGain = @(gain, ph) ...
e70b9a951c6ba824900f79d5b0522983ef6839b051f8c01be503dcea869d1be7
MATLAB
5,481
85
%Evaluates significance and amplitude of SPEP. %2024/02/25 function evaluate_SPEP_degree(fnames) %create output folder if it does not exist: if ~exist([fnames.analysis_folder,'/LFP/spep_erp'],'dir') mkdir([fnames.analysis_folder,'/LFP/spep_erp']); end for ref_method={'Laplacian'} ERP_r...
7ef9d92e8f3962b546146dc7e72fa8f76b5a891fa96f679e507878c3de8caed1
MATLAB
5,483
147
function varargout = choose_method(varargin) % CHOOSE_METHOD M-file for choose_method.fig % CHOOSE_METHOD, by itself, creates a new CHOOSE_METHOD or raises the existing % singleton*. % % H = CHOOSE_METHOD returns the handle to a new CHOOSE_METHOD or the handle to % the existing singleton*. % ...
13c1b08c8fd6c3e2ec7107f88b4ecd8ca646989700115cd57b63f3842ed2c593
MATLAB
5,488
99
%Returns a structure with tables, matrices and neuron names for the %forward & backwards connectome of the C. elegans function [Celegans]=Organizer(expression_type,diagonal_symmetry,off_diagonal_symmetry) %Creattion of name ordering for neuron based on Natt. Comm paper Celegans.NeuronNames.NodesB_gap = {'VA02';'VA03';...
05be95a4b425bf9ca41a211b7209cdc8584be0425564d85a4cd9c577e3605df6
MATLAB
5,492
195
function hopf_DTI_Grange_tbi_lesions_mask1halfSD_bin(s,condition) %load data load(sprintf('results_f_diff_fce_cond%d_ON_tbi.mat',condition)); load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi.mat',condition)); load SClongrange.mat; load schaefer_MK.mat; load('tseries_openneuro_tbi_tp123_sch1000.mat'); load('lesion_...
c40de687a2729b4961e8d7ce7df5717c1386ef42f6180dfc7449f83d0fa16a70
MATLAB
5,501
120
function [CORRECTED_STATS] = DoseResponseCurves(change_struct,tseries_idx_struct,TreatmentLevels, condition,... TITLE, YLABEL, YLIMS, XLABEL, XLIMS,... DATACOLORS, stdOrsem, LW, STATS, pairedOrunpaired) % DoseResponseCurves plots line plots for each condition with mean +- error % for each treatment level. I...
d592bd2a73855018667d53cabe5e11576eee6c42f98ae9f2e60226d2173e4976
MATLAB
5,511
146
%DEMEV1 Demonstrate Bayesian regression for the MLP. % % Description % The problem consists an input variable X which sampled from a % Gaussian distribution, and a target variable T generated by computing % SIN(2*PI*X) and adding Gaussian noise. A 2-layer network with linear % outputs is trained by minimizing a sum-of-...
fb9f90ada4de1b58deb21ef19a138ea3e517c680d33a75af0d12ad73e976fa00
MATLAB
5,522
80
function [ interpulse_duration_ms, num_pulses, num_bursts, pulseduration_ms, uncaging_start_ms, uncaging_end_ms, uncaging_duration_ms, uncaging_frame_start, uncaging_frame_end, max_voltage ] = square_pulse_detection( r, frameRate ) %square_pulse_detection detects square pulses from a voltage recording %(column 1: tim...
cd260b7c065c6a4d20d553247caf978b3f90fa4bc0839ecb44cefa11e1e8029c
MATLAB
5,523
164
function createInstallFile(options) global installfilename global platform platform = []; % Start with a clean slate cleanup('','','start'); installfilename = sprintf('%s_install', lower(getAppname())); [~, exename] = getAppname(); setNamespace(exename) % Generate a LastCheckForUpdates.dat in case that we haven't...
7a247f2e56204853f8630fdd4ff2ed32fed194b2afae7772d8bfc0310534162c
MATLAB
5,528
185
%This script runs all preprocessing sequentially %% Inputs SubjectFolderIn = s3SubjectPath('01'); SubjectFolderOut = SubjectFolderIn; %Where to save folder to isRunInAutomatedMode = true; %When set to false, will allow human more control to select info % Specify what kind of processing is needed isUploadToC...
79ecd59657849fa4b665a8ff0923b13b4689a7b30ccb4d11b6f66b98086e7c01
MATLAB
5,531
152
% function [results, cfg] = decoding_example(decoding_type,labelname1,labelname2,beta_dir,output_dir,radius,cfg) % % This is a general function for two class classification with SPM, using a % linear SVM as implemented in the libsvm software, with accuracy images % (for searchlight) or variables (for ROI or wholebr...
d1b0caf252f5fb61a136585b9ee9d795bdc25f286155f61c97f42d93ea077301
MATLAB
5,531
150
Condition_Name = cond_labels; Channels = cluster_labels; %% Define variables for ROI topoplot ROI_plot_t = [1200 1700]; ROI_plot_f = [4 7]; %% Load all data for sub = 1:length(subject_list) subject = subject_list{sub}; load([TFR_Data subject, '_tf_data_' int2str(1)]) % initialize matri...
d2c5afb61cc78f9c1ed2023cf966adf3e5f327f40c15f80f236f673ca413762c
MATLAB
5,535
193
function [mask]=DSC_mri_mask(volumes,options) % ultima modifica: Marco Castellaro 08/07/2010 %Funzione del pacchetto DSC_mri - DSC_mri_mask %Autore: Castellaro Marco - Università di Padova - DEI % %Calcola le maschere per esami DSC-MRI. % %Parametri in ingresso: volumes (Matrice 4D) che contiene gli andamenti del %seg...
3bdc47662cc309aa8616e273d8cb97439374db4064251355741046a951cc9beb
MATLAB
5,536
131
function [ ResBVC ] = getCellTypeProportions( Res, area, varargin ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% prms.ageBins = [16 18; 19 21; 22 25; 40 40]; % de...
5e4f86b863b9ab99dc619e300dd7d029587f27c80023242705c7eeaa3bd8d7e6
MATLAB
5,540
163
% Parallel medial axis thinning of a 3D binary volume % % MATLAB vectorized implementation of the algorithm by % Ta-Chih Lee, Rangasami L. Kashyap and Chong-Nam Chu % "Building skeleton models via 3-D medial surface/axis thinning algorithms." % Computer Vision, Graphics, and Image Processing, 56(6):462–478, 1994. ...
baa1da953226f9ed77ff2633d1c2d6f2d10802b5549a202f4a450c7546b61a7d
MATLAB
5,542
114
% different from redefineStimulusClassesUpdated02. % removed prune channels step to observe auditory cortical regions. function plotSingleTrialHRF_UpdatedDCNew(sbjNum) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; saveDir2 = ['C:\Users\mn0...
c2c5d538f3644257b6a5c8dbe359ad7bf91d356a5fb86b6b19d2728b91977072
MATLAB
5,542
150
function [gamma_fit_mean, gamma_fit_se, gamma_range, full_res] = extractGammaFitRegion(pfit_G) % starting at each point, how many decades of scaling can you have before % the standard deviation of the mean gamma fits (scaled by sqrt(4), because % we have overlapping quarters) is > 3 SE of an typical individual gamma % ...
225eddb1a862018d606177e9eb4de0a052150c11835202c44538224bea7c6476
MATLAB
5,544
113
%Plots flicker modulation significance and amplitude on 3D model of subject's brain. %2024/02/25 function plot_ind_entrainment_3d(fnames,ref_method) %initialize subject structure: subject=fetch_subject_data(fnames.root_dir,{fnames.subjectID},'anat'); subject_nber=1; %get mni template data: mni...
49b4e1e2c8917d9503ddac99058a3299cc65414869be430da1097854e8d11ff0
MATLAB
5,545
213
clear; clc [task_info, supPath] = loadDBAndSpecifyDataPaths('Golda'); req_params.grade = 7; req_params.cell_type = 'PC|CRB'; req_params.task = 'pursuit_8_dir_75and25'; req_params.num_trials = 50; req_params.remove_question_marks = 1; raster_params.align_to = 'targetMovementOnset'; raster_params.cue_time = 500; raste...
4cdf6b89cfb22b515cc1b4d3386574ebe533feafa5d714b970ef13e2f5ade6e0
MATLAB
5,546
95
function [G,h] = build_G_h_linear3d(b,delta_c,transformationModel) % BUILD_G_H_LINEAR3D Builds the equation system G*p = h % % INPUT ARGUMENTS % b - b = [b2 b1 b3]' % delta_c - c_fixed - c_moving % transformationModel - Transformation model (translation or affine) % % OPTIONAL INPUT...
8a9c7aca71fe5ad598ebf32b81f20b913bc4abafc882dfb167813c45c49337d4
MATLAB
5,547
159
% test if distribution of two sets are different from randomly sample from % the sets nIter = 2000; nSample = 10; ndim = 2; kldmethod = 4; % kldmethod 2: only avaiable for ndim = 2 Zt = nan(nIter, 1); Zr = nan(nIter, nSample); p = nan(nIter, nSample); fullset = unique(tabd(:,1)); fullset(isnan(fullset)) = [];...
d0a27f9132b1e5559f20f9182b0cab13053bfd855b0f91101db485d8880a4888
MATLAB
5,568
139
function [rho, pval, regionList, xRegional, yRegional] = regionalCorr(atlasFile, xFiles, yFile, corrMethod) % regionalCorr computes correlations between regional cell proportion values % (extracted from a list of NIfTI files, one per cell type) and a neuroimaging phenotype. % % INPUTS: % atlasFile - string; filename ...
18fadabf635362065075dcc6dc3f3fda86de721a4e31df100391a1c7623aaf43
MATLAB
5,579
194
%DEMGTM2 Demonstrate GTM for visualisation. % % Description % This script demonstrates the use of a GTM with a two-dimensional % latent space to visualise data in a higher dimensional space. This is % done through the use of the mean responsibility and magnification % factors. % % See also % DEMGTM1, GTM, GTMEM, GTMP...
6d1d67a056df6ceff1d1018e2f100341389a2da1d56c9a4da960523ced8b7b0c
MATLAB
5,585
200
%% polar histogram for phase angle cutoff=[25,15,15,15]; set(0,'defaultAxesFontSize',20) set(0,'defaultAxesTickLength',[0.04,0.08]) set(0,'defaultaxeslinewidth',2) if ~exist('graph', 'dir') mkdir('graph'); end cw=load('matching_table_cw.mat'); ccw=load('matching_table_ccw.mat'); region=["EC-DG","DG-CA3","CA3-CA1"...
76777a1b6b61b48d55a0100761e0a9acbb5bb8e9e6fd25483c4d32e5dd43c1a4
MATLAB
5,585
115
% load your file % variable name in the .mat file for WT = ["tf_wt_global", "tf_wt_delta", % "tf_wt_theta", "tf_wt_alpha", "tf_wt_beta", "tf_wt_gamma"," tf_wt_HFO"] % variable name in the .mat file for KO = ["tf_ko_global", "tf_ko_delta", % "tf_ko_theta", "tf_ko_alpha", "tf_ko_beta", "tf_ko_gamma"," tf_ko_HFO"]...
d44b4cdb81c0ccd49dcdaabf530cefc9827eabc8e92f97057fd691384303d815
MATLAB
5,587
192
function [A,node,link] = Skel2Graph3D(skel,THR) % SKEL2GRAPH3D Calculate the network graph of a 3D voxel skeleton % % [A,node,link] = SKEL2GRAPH3D(skel,THR) % % where "skel" is the input 3D binary image, and "THR" is a threshold for % the minimum length of branches. A is the adjacency matrix, and node/link % ar...
fcd3c81998705e95e82eeba1432c4ec343f974f84418049bf406e6276cd6f495
MATLAB
5,587
190
function infocapacity_hopf_errorhete_tbi(s,condition) rng(s); measure='err_hete'; load('optG_tbi_mask1halfSD_bin_allsub_cond_1.mat') %load('optG_tbi_mask1halfSD_bin_allsub_cond_2.mat') %load('optG_tbi_mask1halfSD_bin_allsub_cond_3.mat') for sbj=1:12 if condition==1 G=optG_tbicond1_sub(1,sbj); %OptG TBI ...
e578c2c489e3e8d76ce8a72cf0567b56a43ec62c69a6737b39cac05907754bdb
MATLAB
5,588
184
% tCFS_prepE2_data %this script concats group effects for b-CFS and re-CFS, and exports in %JASP friendly format. % reorient load. job=[]; job.concatGFX= 1; % job.plotPFX=1; % job.plotGFX=0; %% set up some directories. %PC % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\De...
5f05c2d466a67b083cb84c654d6bb45e0c596bf321a11a54eb9193bfb7058d97
MATLAB
5,599
195
% SINDETECT automatic detection of sine waves in an otherwise random signal % % CALL [ pidx, aidx, trains, meandurs, si, zi, clu ] = sindetect( x, minAmp, minCC, minDC, minDur, rmvMed ) % % GETS x signal % minAmp threshold for noise {1} % minCC thr...
9130138160b5993d03e1eda79f8edc58baf4940cd5c7f352e0fb319f007ab12a
MATLAB
5,600
172
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 = 'PC ss|CRB'; req_params.task = 'saccade_8_dir_75and25'; req_params.ID = 4000:5000; req_params.num_trials = 50; req_params.remove_question_marks = 1; raster_pa...
641e3b18934bf0e3612dbeaffbdb1ee4eda988beffc7e64211cef8a64213d792
MATLAB
5,601
176
function infocapacity_hopf_errorhete(s,condition) %%This script introduces perturbation in the Hopf model by varying the %%value of the bifurcation parameter a rng(s); measure='err_hete'; if condition==1 G=optG_hc_tp1; end NPARCELLS=1000; NR=400; NRini=20; NRfin=380; NSUBSIM=100; %number of iterations, 100...
606bfa10c9430fd874ae1f868a1205602b017db0403226627aa02af39cc96246
MATLAB
5,606
204
function p = parse_filename(filename, fields, tolerant, verbose) % % Split a filename into its building constituents % % USAGE:: % % p = bids.internal.parse_filename(filename, fields, tolerant, verbose) % % :param filename: filename to parse that follows the pattern % ``sub-label[_e...
0ff1ad402b2dfe3b371c8f12d33e1e29e2c76576ff2c8fe6b5e20532409888dc
MATLAB
5,618
145
%Code to generate T2 maps for a 140x100x9X15 MRI scan %This is done using method 2 where we first apply the ROI mask on the T2 scan %and then generate T2 maps only for the ROI's %each pixel in the ROI is fit with a monoexponential decay for 15 time points. %Here, we DO NOT average T2 values for a ROI thereby pro...
2e0a056626d96f79f68e240c1c0b7db22a093736fe79230c9bbfe4945c5a8677
MATLAB
5,627
155
function tform = align_recording_to_allen_Vickers_A1V1M2_affine(image,alignareas,affine) %% Align recording to Allen CCF given an image % INPUTSa % image - this could be Kmeans map, or a mean of the gcamp activity % % alignareas - additional areas in the form 'L area', with a space between % L/R and area name. the use...
c130ec0746f0c315c518e8171feaca4559e24a0d0750336e6d028c7eef2f3c3d
MATLAB
5,632
145
function [slideJson,isIdentifySuccssful] = identifyLinesAndAlignSlide(slideJson,octVolumeJson,identifyMethod,SlidesJsonsStack,histologyFluorescenceIm) %This function preforms the basic preprocessing of a slide, identify the %lines and do a single plane alignment %INPUTS: % - slideJson - Single slide JSON file % ...
ed0aa6338f87d2304cf4f1f8d951d0110d8dd6f5d89bcb609ead55344f0a3c9c
MATLAB
5,638
178
function [adj_list_pat_idx scratch adj_list_mask_idx] = adj_cuboid(mask,varargin) % Creates adjacency list using cuboid neighborhoods % % [adj_list_pat_idx scratch adj_list_mask_idx] = adj_cuboid(mask,varargin) % % Create an adjacency list using a rectangular neighborhood % function. See GET_ADJACENCY and ADJ_SPHERE f...
158c5e094e32a313e6c51befb2276730c2ac1a86e9a086baad469169f34333c8
MATLAB
5,648
129
function [cfg,sl_template] = decoding_prepare_searchlight(cfg) % function [cfg,sl_template] = decoding_prepare_searchlight(cfg) % % This function computes a reference sphere of coordinates around zero to % use in the definition of searchlights. When shifted to the current % searchlight center, it can be used to g...
9b3bb889fcbcf90ee5ab40cf1800cfff3cad19299273f18d9568b8d85064eaae
MATLAB
5,663
141
% Plot voltage for article figure % Note: SpikeReader returns entries with 1 less index then NeuronReader. % E.g., length(stel_nV.v) vs. length(stel_nS). % Todo: This could be looked into to see if the indices are offset by 1. initOAT; plot_voltage=1; % choose to plot current or voltage % read in voltages stel_nR = Ne...
2667940be31b0a9e4eb9147a1576009130a9e0ff91033fa05f1628f5871c62c6
MATLAB
5,668
183
function [subj] = load_bv_pattern(subj,new_patname,maskname,filenames,varargin) % Loads a BrainVoyager .vtc pattern using the MVPA toolbox % % [SUBJ] = LOAD_BV_PATTERN(SUBJ,NEW_PATNAME,MASKNAME,FILENAMES,VARARGIN) % % Adds the following objects: % - pattern object called NEW_PATNAME masked by MASKNAME % % In order to ...
f38f906015eee947353bb72f33cca8aaadafd304ca1bd2563258d1edfb9cfc5f
MATLAB
5,668
193
function hopf_DTI_Grange_hc(s,condition) %load data load(sprintf('results_f_diff_fce_cond%d_ON_hc.mat',condition)); % load frequency with maximal power (of narrowly filtered data) by area computed in script Compute_Hopf_Freq_hc.m load(sprintf('empirical_spacorr_rest_cond_%d_ON_hc.mat',condition)); %load empirical FC ...
ec8b6e9c0a660162ce03ceea7556b8b3d0b37589349bfc85a614a4e289e0a74f
MATLAB
5,671
196
function hopf_DTI_Grange_hc(s,condition) %load data load(sprintf('results_f_diff_fce_cond%d_ON_hc.mat',condition)); % load frequency with maximal power (of narrowly filtered data) by area computed in script Compute_Hopf_Freq_hc.m load(sprintf('empirical_spacorr_rest_cond_%d_ON_hc.mat',condition)); %load empirical ...
67edc69c3b032f2bd2b35045093bb0b47b4e76ea8ab7c3832a7a83da38d5bfd1
MATLAB
5,675
196
clc; close all; warning off all; clearvars; % preparation fileScript = matlab.desktop.editor.getActiveFilename; [pathProject,name,ext] = fileparts(fileScript) ; % path to working directory/current folder % path to working directory/main folder addpath (pathProject) addp...
af1d3e4234933d2076e49ddd4f09a1e0cb723a486071de15d930142140b0e15b
MATLAB
5,683
203
% tCFS_E2_figure3 % job=[]; % job.concatGFX= 1; % job.plotPFX=0; % job.plotGFX=0; % plotType==1; % as per other MS figure %% set up some directories. % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop\tracking-CFS'; homedir = 'C:\Users\mdav0285\Documents\GitHub\tCFS-ver1';...
7d15afebbe191338344739ce2a6a33a288baf383e47ece3b6bd5bbb62bd75f74
MATLAB
5,692
163
%% Parameters and data % parameters nbins = 360; smoothTh = 0:12; velTh = 2; % velocity threshold (2 = default) mergeTh = 0; % threshold for merging run epochs (0 = no merging) %load data load(fullfile('Data','BehavEpochs')); load(fullfile('Data','SpikeData'),'S'); load(fullfile('Dat...
7d5543b703184d0d4c4af39de4272fb36de5b812b3e64e1efb314941c4608ea2
MATLAB
5,692
186
function [cbv,cbf,mtt,cbv_lc,ttp,mask,aif,conc,s0,fwhm,K2_map]=DSC_mri_core(volumes,te,tr,optionsIN,aif,mask) % last modification: Marco Castellaro 26/05/2018 addpath('utils') %----- CHECK OF INPUT PARAMETERS - PART 1 ---------------------- % Check that input and output has the minimum number of mandatory parameters ...
84379d6dd4f635c5dc46f77cdb5cf56abcb6b85f208c357156094b56b379dd07
MATLAB
5,693
142
function [params, fitcurve, costv, errs] = estimateCenterSurround(inputs, options) nROI = size(inputs, 1); IsPCA = 0; RmvPeakRange = [1:5 14:30]; IsDebug = 0; DataOrgnization = [7 30];%[7 30][7 33] nTime = DataOrgnization(2); EstimationType = 'DoG'; % 'DoG', 'Amp' Dmt = [10 25 50 100 200 300 400]; AmpDiame...
8a0fab0e5cf04c2fbec21ce723c1c013bfa91c0797ebbffc457781a628ef4162
MATLAB
5,693
177
function infocapacity_hopf_errorhete_hc_tp2(s,condition) %%This script introduces perturbation in the Hopf model by varying the %%value of the bifurcation parameter a rng(s); measure='err_hete'; if condition==1 G=optG_hc_tp2; %Optimal G weight for healthy controls, manual input end NPARCELLS=1000; NR=400; NR...
feb98da8c67487c88919ba0cf0b44fdc0e3a0f092c333e33597c924cf975dda5
MATLAB
5,695
209
function [s,mxy] = isochromat_GRE_BM(theta,phi,TR,T1x,T2x,f,ka,Niso,varargin) % [F0,Fn,Zn,F] = isochromat_GRE_BM(theta,phi,TR,T1x,T2x,f,ka,Niso,varargin) % % Isochromat based simualtion of Bloch McConnell coupled systems w/ gradient echo sequences % % arguments: % theta: vector of flip an...
7c859b34f82b142006bae1a5c1a15fce4c59e103aa1638c5f7f05bb28e9aac72
MATLAB
5,697
250
function [errmsgs warnmsgs] = unit_class_gnb(varargin) % USAGE :[ERRMSGS WARNMSGS] = TEST_(...) % % This is a script that tests % % INPUT ARGUMENTS: % % STDOUT (optional, default = true) If true, prints errors and % warnings to screen as they occur. % % OUTPUT ARGUMENTS: % % ERRMSGS = cell array holding the error s...
0ec4d66ced8aca1a7ed9f13abddb6fd4d15047338a85600985eda77936589dc8
MATLAB
5,699
194
function [errs warns] = unit_check_1ofn_regressors() %#ok<STOUT>%ignore that errs and warns arn't used, since no code has been written yet... % [ERRS WARNS] = UNIT_CHECK_1OFN_REGRESSORS() % %Description: %{ This function will test the behavior of the check 1ofn_regressors function to make sure it meets the re...