sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a51650ba76bd137eda33b8a522b61ecede3851ab31cc1346aede68f65e0267b6
MATLAB
8,773
337
clear all load('calcium_activity_matrix_60584_session17.mat') %Preprocessing dt=117; spikes=full(spikes_d_s); downsampling_factor=4; fs_120 = 7.73; fs_30 = 30.95; fs = fs_120/downsampling_factor; maxlag=floor(560*fs_120); [N,T]=size(spikes); FRp = spikes_downsample(spikes,N,downsampling_factor); %% Oscillations in si...
8d3345ba812b561c0bf5a6792288a6689d54778976285d820b12e071f8e1fc5a
MATLAB
8,775
157
% THETA SEQUENCES QUANTIFICATION: SPIKE TRAIN CORRELATION % MH, 2020 % From Feng et al (2015,J Neuro). For each theta sequence, calculate Pearson's linear correlation coefficient between spike timing and place cell peak % firing positions for spikes emitted during 45-315 degrees of individual theta cycle (referenced to...
814cba6607e8778668390960fa3359db2ced85b73510fe809f0e4ea3d7c32134
MATLAB
8,779
196
function [spikes,D,parameters] = generateRogCrf(num_trials,num_stims,parameters) %% generateRogCrf produces spike counts/rates for the pairwise Ratio of Gaussians model assuming a contrast response parametrization % INPUTS % num_trials - number of trials (default = 1000) % num_stims - number of contra...
e774214de6ccc2296d44bffacf67b1f166c47386ad8396714700593b6ca2548e
MATLAB
8,796
283
% Created by A. Benitez Andonegui, M. Luehrs % Modified by A. Vorreuther %%% define variables for loading data, plotting & computing ITR values %%% close all fileName = "figure6_effect_trial_repetitions_itr_data.xlsx"; % accuracy matrix: nsubj x ntrials % pathToViolinPlotFunc = "C:\Users\Anna\Desktop\fNIRS\brainAR-...
8467a53c398cddbe3b8d052968865b469757beb2a81bfcd9cfe7b965617d2dd5
MATLAB
8,800
232
function Mus_stitch_Hui(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); result=target; id=islice; xx=disp(1); xy=disp(2); yy=disp(3); yx=disp(4); % mosaic parameters numX=mosaic(1); numY=mosaic(2); X...
94500a449dcbf46000c7ef92a40cfe4e6a4b7e871c45017413d0d20802b4375a
MATLAB
8,806
248
function im = nodeGrps_vesSegment(nodePos, nodeEdges) % Compute graph node and edge properties from a matrix of node positions in % (x,y,z) coordinates and a matrix of the node endpoints for each segment. % NOTE: this % % INPUTS: % nodePos (double mat): [x,3] matrix of the (x,y,z) coordinates for % ...
14b4bbf563048a18b640f46d4317940f720805f18e87a8fe8de3b3065948fb88
MATLAB
8,811
232
function Mub_stitch_Hui(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); result=target; id=islice; xx=disp(1); xy=disp(2); yy=disp(3); yx=disp(4); % mosaic parameters numX=mosaic(1); numY=mosaic(2); X...
bab09318f3e8bd6329955ddee16bbdb3eb6ea34d58be1e23f4f65d826094ead8
MATLAB
8,811
204
function [outSignal,outSampleFreq,outPeriods,outFANI] = IPEMPeriodicityPitch (varargin) % Usage: % [outSignal,outSampleFreq,outPeriods,outFANI] = IPEMPeriodicityPitch ... % (inMatrix,inSampleFreq,inLowFrequency,... % inFrameWidth,inFrameStepSize,inPlotFlag) % % Descr...
df14bbda3a26a8079374572b104d9e923e09c87843a9c21c8051edb3f6a2b347
MATLAB
8,814
313
function DeLongUserInterface() %% %% Reference: % @article{sun2014fast, % title={Fast Implementation of DeLong's Algorithm for Comparing the Areas Under Correlated Receiver Operating Characteristic Curves}, % author={Xu Sun and Weichao Xu}, % journal={IEEE Signal Processing Letters}, % volume={21}, % number={...
2e4ae725df0094d0047894c95c4c851ff351a9052f6f5260d62ad5ecea65c06d
MATLAB
8,828
252
function [k_corner,info] = corner(rho,eta,fig) %CORNER Find corner of discrete L-curve via adaptive pruning algorithm. % % [k_corner,info] = corner(rho,eta,fig) % % Returns the integer k_corner such that the corner of the log-log % L-curve is located at ( log(rho(k_corner)) , log(eta(k_corner)) ). % % The vecto...
11d33f79500ae51f7c8b813be9a238c6d1a52b06b1b64d16ad0ce06e64393cca
MATLAB
8,829
206
function gap_linking_str = fun_graph_connect_gap_p2p_no_backtrack(vessel_image, vessel_mask, p_1_pos, p_2_pos, connectivity) % fun_graph_connect_gap_ep2ep finds the link that connect the two given % endpoitns % Input: % vessel_image: 3D numerical array, image of the vessel % vessel_mask: 3D logical array, mask of...
7c85375aa73c41ca0fbcedee4146ad95ae004c45b932f04d03840b2c522a84f9
MATLAB
8,856
235
clear all %This program is used to get the connectivity network colored by only %green and red. %2.0 version for 10 fun areas. %get the baseline matrix. %The file 'BaselineMatrix' is a 20x20x6 matrix incluidng the data of M125689. %There are 6 lines of code used to load the dat...
630524bca0703b0e4fa8f535d73470263250e5cbcf5e435d7c3c4fb8c2604000
MATLAB
8,861
207
function [sig_cells_sc,areasScreening] = NWB_calcSelective_SC(nwbAll,all_units, params) %NWB_CALCSELECTIVE_SC Takes the output of NWB_SB_extractUnits and runs %selectivity tests for the screening task. Optionally does plotting of %response histograms. if isfield(params,'rateFilter') rateFilter = params.rate...
65edb6aab64b4bb2f406a57450eb65dd95d18845bea75c6ba8a7b9c059dc9fb7
MATLAB
8,863
218
%% Add trigger info to event.tsv files and copy events.json file to sub folders. % % For information about NatMEG-PD please refer to the data descriptor: % % Vinding, M. C., Eriksson, A., Comarovschii, I., Waldthaler, J., Manting, C. L., % Oostenveld, R., Ingvar, M., Svenningsson, P., & Lundqvist, D. (2024). The %...
17efb1e63ffeba765555c03256b5c9eb118dad19678bc6b9af52fd0dcc5e0cd8
MATLAB
8,866
233
function MIP_stitch_Ann(target, P2path,datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'mip/vol',num2str(islice),'/'); cd(filepath); ...
6e619c1df6c46cc9580adf55124621ef3139bad1c56474b4116070589464f702
MATLAB
8,867
349
function [T, reuse] = Gdsft_gram(ob, W, reuse) %function [T, reuse] = Gdsft_gram(A, W, reuse) %| %| Construct Toeplitz gram matrix object T = A'WA for a Gdsft object. %| This object performs T*x rapidly using an over-sampled FFT. %| %| in %| A [M np] Gdsft object (fatrix2) %| W [M M] W = Gdiag() for fatrix2 (often s...
868e2d2e0bd3732f1b2567d20c77db891c3aa191dbfb0b98099b9516ffd70b0c
MATLAB
8,867
231
function Mus_stitch_7688(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); result=target; id=islice; xx=disp(1); xy=disp(2); yy=disp(3); yx=disp(4); % mosaic parameters numX=mosaic(1); num...
62e17d064246ff966a78fccfbdff414fa0016727ca5caf0fbeaf40cd9cabc49f
MATLAB
8,877
153
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 MAP2 %vol(ch3, 0, 5000) 568 Sox2 %vol(ch4, 0, 5000) 488 Ki67 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(Nuc...
2781b8fc29098d74c2c6d3aacef2d145d3116f149268ec49f11b13ea6a260cd2
MATLAB
8,894
308
function [hout] = addedvarplot_modified(varargin) %ADDEDVARPLOT Create added-variable plot for stepwise regression % ADDEDVARPLOT(X,Y,VNUM,INMODEL) produces an added-variable plot for the % response Y and the predictor in column VNUM of X. This plot illustrates % the incremental effect of this predictor in a reg...
f85b44b5ac8ee5eed9299ad62bf83f4fd31a632933a595db7436c21a347d74cb
MATLAB
8,896
304
function G = Gtomo2_strip(sg, ig, varargin) %function G = Gtomo2_strip(sg, ig, options) % % Generate a 2D system matrix for tomographic image reconstruction, % based on a square pixel basis and strip-integral detector model, % i.e., a rectangular detector response. % Works for parallel-beam, arc-fan, and flat-fan geom...
3609e88fb5f9e70c83110d952e80bcbca1ca57cbce03789826195d7853e14a65
MATLAB
8,898
263
%% Figure 4g % this script rungs additional analysis required for the plots of figure % 4g. %% clear ft_defaults %% addpath /Users/'Janweber 1'/Documents/MATLAB/general_functions/ path_out = '/Users/Janweber 1/Desktop/PhD_HelfrichLab/Project_1_Predictions_ECoG/Results/Figures/submission_natcomm_v3/Figure_4/revis...
9409f0beb2fb692ecb11401d00c1e0e76f5a8ce85f7e8d0096c9e6eb2b89a900
MATLAB
8,899
179
%{ AnalysisPluginExample - simple example script to show users how to make analysis plugins HOW TO USE THIS TEMPLATE Edit only the three ZONE blocks below: ZONE 1 set numVar, your parameter labels, and optional default values ZONE 2 unpack your parameters from UserVar ZONE 3 initialize custom outputs ...
a850b6dc5fc339ee9393160e8019df22209d503586bc7b0d264e22444769c3d5
MATLAB
8,901
331
clear %set some options that are the same for all simulations %saving options saveon=0; map_options.save=saveon; vox_options.save=saveon; %noise level and type SNR = 200; noisetype = 'rician'; %% Simulate a simple volume fraction image. % Each voxel is the weighting of the corresponding % canonical spectral comp...
41ce3b528060a424442474ee84deec4c46d4e8945909a96b5b4d4b0acaa9c7d8
MATLAB
8,905
258
clear all; addpath(genpath(pwd)) glmFlag = 'jumps_absolute'; options = continuous_RDK_set_options('iMac'); % subject list subjectList = [16 18:21, 24, 26, 27, 28, 29, 31, 33, 34, 35, 42, 43, 47, 50, 51, 52, 54, 55, 57, 58]; %32 taken out %subjectList = [62:64,66,68,70]; % vertical motion only csdFlag = 0; % 1 for...
b377a647d4f958734b22384f263b6e742a83e123e8e707fc47215f76dc0cce4e
MATLAB
8,905
255
function varargout = spm_platform(varargin) % Platform specific configuration parameters for SPM % % FORMAT ans = spm_platform(arg) % arg - optional string argument, can be % - 'bigend' - return whether this architecture is bigendian % - 0 - is little endian % - 1 ...
b9c5254ae32c8b6a194143dbf58a3e1ef3ed5825d095de5dac1059a1c1c4681f
MATLAB
8,905
249
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); listname=['targetRight']; cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{1}],[cn1{2}]}; condnames=...
b38e96ed4d87e27b591b2dd637089e964ca00106c8f5e09a4d1ac23228c2f7ba
MATLAB
8,907
200
classdef TestFifoBuffer < matlab.unittest.TestCase %TESTFIFOBUFFER Unit-test-class for FIFOBUFFER methods(TestClassSetup) function setupPath(testCase) addpath('../src') end end methods(Test) function testValidLength(testCase) length = 14; ...
f2feca2698b00ccf6d938ab0fb9091dc895123401fcc7093e7d0fccb129f54b3
MATLAB
8,907
265
function [D, Isubj]=ribbon_dir_adf(dirname, th_pval) % For each subject in the directory "dirname": % Computes the Dice coefficients measuring the overlap of the % Cortical Ribbon volume computed % 1- from the subcortical labeling % 2- as the space between the white and the pial surface % %...
d659aea428486a0b840eebf96239402c641662ee1872acec9b3ef82dd9627adb
MATLAB
8,912
230
function D = spm_eeg_inv_forward(varargin) % Compute M/EEG leadfield % FORMAT D = spm_eeg_inv_forward(D,val) % % D - input struct % (optional) fields of S: % D - filename of EEG/MEG mat-file % % Output: % D - EEG/MEG struct with filenames of Gain matrices) %_________________...
4d5f7710bad2a85005368b600a0a9858fbbb1e4a99d3bdca2c662be04688b5ef
MATLAB
8,918
197
function gap_linking_str = fun_graph_connect_gap_p2p(vessel_image, vessel_mask, p_1_pos, p_2_pos, connectivity) % fun_graph_connect_gap_ep2ep finds the link that connect the two given % endpoitns % Input: % vessel_image: 3D numerical array, image of the vessel % vessel_mask: 3D logical array, mask of the ves...
5dbab741b9dc313152bd28da840ec54ef1e7270046e6ae21dcf22fc1fde75b0d
MATLAB
8,920
188
function [lickt,lickx,post,posx,speed, sp, ... all_fr, avg_all_fr, all_corrmatrix, avg_all_corrmatrix,... all_waveforms, cells_to_plot,spike_depth,... all_drugEffectScores, trial,all_cellCorrScore,... trials_corrTemplate, avg_all_cellCorrScore, avg_cell_fr,... trial_ds, all_frTime,all_cellStabilityS...
6c1193ddc50c620ea62e7b3212aaf1658c731d18fe77ff79d37ea85a1b5387cb
MATLAB
8,920
294
%| Example regularized estimation of MR coil sensitivity maps. %| mri_sensemap_demo1.m %| %| This is an older slower method that is made obsolete by the new version: %| ir_mri_sensemap_admm.m %| (However, for small 2D problems the cholesky approach below is best.) %| %| Copyright 2005-9-12, Jeff Fessler, University of ...
893143caaab3d9cbf58ba186cb56b5ff6830e8cffc09cbf92253a46ba74b4cbb
MATLAB
8,927
259
function make_figure6(plotVariables,options) %this used to be called make_figure2.m, but has been renamed to align with %the figures for final publication %%% change regressor indices when using the response or response_coherence %%% GLM!!! glmFlag = 'all_regressors'; % subject list subjectList = [16 18:21, 24, ...
7103c43446a2962ae2bf0429c63fb403596c892a385cf7b16cca7d3ba3151a8e
MATLAB
8,930
241
function Ori_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch,aip_threshold) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'orientation/vol',num2str(isli...
89bc401fe9273f116ba63180eb4ee857efd06df0a032a1b9322e0754fe110fa9
MATLAB
8,930
296
function [p,f] = spm_powell(p,xi,tolsc,func,varargin) % Powell optimisation method % FORMAT [p,f] = spm_powell(p,xi,tolsc,func,varargin) % p - Starting parameter values % xi - columns containing directions in which to begin searching % tolsc - stopping criteria, optimisation stops when % ...
8ab594bcd72bcf327383412257fe17394398c65c2e2e14e41d0eeaf098bdefe9
MATLAB
8,941
254
% Add path for shared functions addpath ../Shared_functions/ % Parameters for cells % -------------------- pick_peak_flag = 0; % Data parameters % --------------- frate = 6.83; N_frames = 52; dt = 1/frate; t = (0:dt:dt*(N_frames-1))-3; t1 = ceil((3+1)*frate); t2 = ceil((3+2)*frate); % T4 Contrast data % ----------...
7f098a1da32347f820f724b979e9a48e2adcf1bd9856d1f8893ecd0bfdc1dc4f
MATLAB
8,949
196
% load_EDF.m % % Purpose: % Load EDF format PSG data file. Text header and binary timeseries. % Data is loaded and converted to Physical values. % % Usage: % [INFO,TS]=load_EDF(filename, standardEpochLength) % % Requirements: % Traditional EDF format. Will not work with EDF+ % % Notes: % Byte resolution = 2 bytes...
c4a11b13aa251e8b1402f7993748865cf19e27d1ba58db5c6787fc30f9e421d3
MATLAB
8,951
278
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
9038b1a02d5aa608b64bcb655df31abd38afca3676798288b76112152af26562
MATLAB
8,958
327
function [vSVD,SVD,ME] = motionSVD(videoFile, roiFile,nt,ns) % This script is a modification of % https://github.com/MouseLand/facemap/blob/main/matlab/computeSVDmotion.m % to incooperate the data structure produced in the Nienborg lab. % % The three MATLAB scripts, svdecon.m, gather_try.m, normc.m, used in this...
bb9442009b7f256cb53a65236532e94b573574eb150fc39f7227b6e06c1fc8f4
MATLAB
8,962
373
% Autocorrelations for PaS example session clear all close all rec_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; mouse='L8M4'; load([rec_path,strcat('recording_dates_',mouse,'.mat')]); day=17; s=2; munit=dates.ses{day}(s); file_name=[dpath ['...
81342110051c0e8ed6200575042c19475f08914aa4ad530adfa73f3e9894def2
MATLAB
8,977
226
function habituation_6well_part2_automated % Sep 30 2013: Actually this program tries to output some incorrect values % that are calculated in an obsolete, noisy way (based on fit for each bout). % It also creates some plots, and these plots are correct, and based on average % amplitudes for the 1st and 2nd...
d35b062a0f15f242b409ffb1595794d9750a5b61b264c23964ef280d12411174
MATLAB
8,979
391
classdef c_progress < handle % c_progress - Class for printing loop progress updates and estimating time remaining % % Example: % N = 100; % prog = c_progress(N,'Loop %d/%d'); % first %d is current loop variable, second %d is total % prog.start(); % for i=1:N % prog.update(); % pause(0.1) % do some wo...
91df0311fd3415e498045622413c7f450afe074731eda652f7684091c16e9864
MATLAB
8,984
227
function [newpupil, newblinksmp, nanIdx, dat] = blink_interpolate(data, blinksmp, plotme) % interpolates blinks and missing data % Anne Urai, 2016 % get the stuff we need dat.time = data.time{1}; dat.pupil = data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:); dat.gazex ...
5348567f49868ef482b947de1d96bfec6abfbfdb9f6acf45f5d9c6ed37d31dfd
MATLAB
8,995
158
function [X, fX, i] = minimize(X, f, length, varargin) % Minimize a differentiable multivariate function. % % Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... ) % % where the starting point is given by "X" (D by 1), and the function named in % the string "f", must return a function value and a vector of par...
b6ac2dfb05688d1062fa6a3ab932cb72ed222dfef9b2eab8f7fc4564530264e3
MATLAB
8,997
322
% This code requires that there are at least five points for each % injection site, otherwise NaN is returned % % SC -> Retina % % injectionType: 'APfix' or 'MLfix' % nRep: number of repetitions % maxDist: largest allowed distance between injections (for later % iterations we can ignore higher distances). % k0: In case...
ce22d86a1b1960c89240f9e1280073dd9ddec6488f92610744a36d14c04bf215
MATLAB
9,006
206
function [TPP, half_laps_times] = phase_precession_relative_location load('extracted_CSC.mat') load('extracted_place_fields.mat') load('extracted_clusters.mat') load('extracted_position.mat') load('extracted_laps.mat') %Get timestamps for each half lap half_laps_times = extract_running_laps(position,lap_times); ...
3027280c4adf86b530e54d8023351d2b0c9e55edf04b0da9e60b144aeebee6aa
MATLAB
9,010
269
function spm_preproc_write(p,opts) % Write out VBM preprocessed data % FORMAT spm_preproc_write(p,opts) % p - results from spm_prep2sn % opts - writing options. A struct containing these fields: % biascor - write bias corrected image % cleanup - level of brain segmentation cleanup % GM - f...
a7ab89c5b25f7653a048d7dd4c7b55822b23ed9c9af6eafa94ee996a77bf6bc2
MATLAB
9,010
226
function fit_linear_Model_M2(exname, include_eye) results_dir = sprintf('../data/analysis/%s', exname); % load preprocessed dataset if ~include_eye load(sprintf('../data/preprocessed/%s/preprocessed_data.mat', exname), 'D'); else load(sprintf('../data/preprocessed/%s/preprocessed_data.mat', exname), 'D_eye');...
517c05f87893f30336e6e47c3be6099dfe35d50652e2d10c8f7b35be0ae1f66f
MATLAB
9,012
218
function SBJ08k_HFA_channel_categories_stats(an_id, model_id, stat_id) if exist('/home/knight/hoycw/','dir'); root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/'; ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end addpath([root_dir 'PRJ_Error/scripts/']); addpath([r...
aebaae893db8128b629842da712277c064996247c0223376b5178d0643590633
MATLAB
9,013
312
function varargout=sigstar(groups,stats, limY, nosort) % sigstar - Add significance stars to bar charts, boxplots, line charts, etc, % Rob Campbell (2023). raacampbell/sigstar (https://github.com/raacampbell/sigstar), GitHub. Retrieved August 1, 2023. % H = sigstar(groups,stats,nsort) % % Purpose ...
d549fcead2dbd2b7a66277eab4c57b98507c7fd2b20c0a2a23fa40ebd1086853
MATLAB
9,022
247
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); listname='TarLR-conIncon'; cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{7}],[cn1{8}]}; condnames=l...
a4c571bf3c5e63fd2819bc6cfe803ef4aa985c896d6884e6faefc834259a3cec
MATLAB
9,023
286
function [ddr, ddl, Isubj]=cc_cut_dir_adf(dirname, th_pval) % For each subject in the directory "dirname": % Computes the Dice coefficients measuring the overlap % of the WM volume in right and left hemispheres to check % if the corpus_callosum is correctly located. % % Uses the p values % % % cc_cut_dir_afd.m %...
eda4477ba2b08dac23ea18fec5f8a633a23e37dee3753bcafadade2a7cb3251b
MATLAB
9,028
183
clear; subjectID = 'C1'; load(sprintf('TrainData_100Hz_%s_Unsorted.mat', subjectID)); if ~isempty(subjectID) switch subjectID case 'C1' arrayInfo = UC_chan_mapper('FullMapLatMed.txt'); case 'P2' arrayInfo = Pitt_chan_mapper_CRS02b('FullMapLatMed.txt'); case 'P3' ...
2bb379c64e4c3bfaf3f17fbd0b3c47e2d0d635d683594232257f558cd262360d
MATLAB
9,029
290
function [img_est, full_kspace] = ... ir_mri_partial_fourier_3d(partial_kspace, full_dims, varargin) %function [img, full_kspace] = ... %| ir_mri_partial_fourier_3d(partial_kspace, full_dims, varargin) %| %| 2D and 3D versions of Xu and Haacke's 2001 "Partial Fourier imaging in %| multi-dimensions: A means to save a ...
04b7682853462b53d5a972a39217075820576ff803d373d2dc2a0fc8c2969731
MATLAB
9,032
205
%% MEG-BIDS, the brain imaging data structure extended to magnetoencephalography. % This script uses the FieldTrip toolbox to reorganize MEG data to BIDS. % % For information about NatMEG-PD please refer to the data descriptor: % % Vinding, M. C., Eriksson, A., Comarovschii, I., Waldthaler, J., Manting, C. L., % Oos...
8de337ac8dfea6c4b8b9a80439d1972f0188d71034d0e20a44fc662e0ba6db88
MATLAB
9,034
206
function gap_linking_str = fun_graph_connect_gap_p2p_no_backtrack(vessel_image, vessel_mask, p_1_pos, p_2_pos, connectivity) % fun_graph_connect_gap_ep2ep finds the link that connect the two given % endpoitns % Input: % vessel_image: 3D numerical array, image of the vessel % vessel_mask: 3D logical array, ma...
5a4745bdd764b20fc6066e59baacd5ab41aa8180ce570bb5bcb4d13d330d8193
MATLAB
9,043
230
function SBJ08i_HFA_plot_grp_mLME_ROI_spider(SBJ_id,proc_id,an_id,model_id,stat_id,cat_id,... roi_id,save_fig,varargin) %% Plot spider plot of proportion of electrodes per puns category for each ROI % INPUTS: % SBJ_id [str] - ID of subject list to load % proc_id [str] - ID ...
a5ecaad509c74b36b849bdbaab718a99a2410b105b25f21908054d8b707c05e0
MATLAB
9,044
214
function SBJ08c_HFA_plot_grp_mGLM_ROI_hist(SBJ_id,proc_id,an_id,model_id,stat_id,... roi_id,save_fig,varargin) % Plots histograms of mGLM max beta by ROI % COMMENTS NOT YET ADJUSTED % gROI version: one plot; subplots per gROI (lines still colored by ROI) % INPUTS: % SBJ_id ...
a3b477361d9d337286f130453aec95682224445943d872da90e3605e51ff4fa3
MATLAB
9,055
248
function varargout = spm_dcm_ui(Action) % User interface for Dynamic Causal Modelling (DCM) % FORMAT spm_dcm_ui('specify') % FORMAT spm_dcm_ui('estimate') % FORMAT spm_dcm_ui('search') % FORMAT spm_dcm_ui('optimise') % FORMAT spm_dcm_ui('review') % FORMAT spm_dcm_ui('compare') % FORMAT spm_dcm_ui('average (BPA)') % FOR...
1737b288b6060030835355e27bb7eb961e0c7a4e8fa5fce00a273ad69cd03be7
MATLAB
9,062
242
% use General Linear Kalman Filter to estimate TV-MVAR model clear all; close all; clc tic % develop for 1 subj subj = '39'; cd(['/tmp/yassamri/iEEG/sandra/subj_' subj]) load(['trial_data_subj_onset_' subj '_ref__select_chan_3.mat']) trial_data = trial_data(1:30,1:1500,10:19); % test on 30 trials, 1.5 seconds, 10 elec...
ada37ad7bb950877aa1e8828ed3b40d141eaab5edc694c450754a653d64e0ba7
MATLAB
9,062
204
function bootstrap_peak_latency_rsa_avg_timesteps(subjects,conditions_int) %BOOTSTRAP_PEAK_LATENCY_RSA_AVG_TIMESTEPS Apply bootstrapping to calculate the 95% confidence %interval of peak latency difference (for RSA between RNN and %EEG-categorization task). Results are for all RNN timepoints & for the median. % %Input...
5dffc7da0a25af067ef8e8fba15fdc741eb5e4620300acae21fa774253e8f3e8
MATLAB
9,069
389
function x = wls_simplex(A, y, Wh, x, varargin) %function x = wls_simplex(A, y, Wh, x, [options]) %| %| min_x || Wh * (A x - y) ||^2 + reg || x ||^2 %| subject to simplex constraint: 0 <= x <= 1 and sum(x) = 1 %| %| one version is based on: %| x = lsqlin(C,d,A,b,Aeq,beq) solves the least-squares %| (with equality cons...
5f432904731706e4d4885a1eb21b1c48ec7d7a37155c1da1b26ec2506d398c82
MATLAB
9,084
306
%% gf_vs_m clear all close all clc nrmz=10000; sp=1; %% load mouse- old (stav) % disp('m-old') % load('/data/Technion_analysis/goldfish/mouse_data_matrix.mat', 'mouse_geneid','mouse_sampleid','mouse_data','mouse_cluster_name'); % type_nt=readtable('/data/Technion_analysis/goldfish/type_neurotansmitors.xlsx','VariableN...
b7c2719091b733c33b00ec2a62c25d8bdbe21d017df06d3b00e6684e87cc1cd5
MATLAB
9,092
239
function [labels, names, colors, line_styles, markers] = fn_regressor_label_styles(model_id) %% Converts the name of a model into regressor labels, plotting colors/styles % ^ = regressors were only used for early model comparison (not in the paper) % Generally, RL features are better than anything else for near...
3a3cf54a64916e5ba1268e8d1e0f3fbf5ec2c80eabda8e0e3c2cfacce5aac71d
MATLAB
9,096
320
clear all % Add package to read NPY files into matlab addpath('/Users/askeller/Documents/npy-matlab/') folder_name='/Users/askeller/Documents/Kellernet_PrelimAnalysis/RidgeResults/results_rest_Aug22'; file_name_pred1='thompson_PC1_prediction.npy'; file_name_pred2='thompson_PC2_prediction.npy'; file_name_pred3='thomp...
5a5a216315daa9b2c1d8ccb9d2320543eb04e59d89beed1ed723974917d521d9
MATLAB
9,100
168
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 MAP2 %vol(ch3, 0, 5000) 568 TotSyn %vol(ch4, 0, 5000) 488 pSyn ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,...
8915cf144a5e2923a2a55d147ffc0c20679631eb089341585850e5be8b6801a9
MATLAB
9,107
303
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SCORCH calculations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % spatially correlated coherence % pathing needs to be corrected based on users machine % dependency: custom coherency function ...
3b35041d2f1b6b5be5ed9ccb0bc9a3b2fb20146aa1882c7a73e797c55198a2ba
MATLAB
9,110
358
%| pet_2z_example.m %| %| Illustrate image reconstruction for multislice 2D PET, aka 2.5D PET, %| including both intra and inter-slice regularization. %| %| Copyright 2005-6-13, Jeff Fessler, University of Michigan % true emission map if ~isvar('xtrue'), printm 'xtrue' ig = image_geom('nx', 64, 'ny', 56, 'nz', 30, 'd...
ad7ed157b964536afd84de54494b55849aebfb8d44748765ea9b72dd0838e237
MATLAB
9,115
249
function [pHat, accept, ll] = runMCMC(data,mcmc,mP,model,sensors,dss,environment) % function runMCMC(data,mcmc,mP,model,sensors,environment) % Performs a run of the MCMC identification procedure. % % Inputs: % - data: a timetable which contains the data to be used by the tool; % - mcmc: a structure that contains t...
5b4202aa4843b3fce5a367d0fb067bbfe229546602f4ff63b9738b91ba0d08fb
MATLAB
9,120
228
function status = sendCommand2Host(hostHandle, command, wait4Feedback) % Sends a command to one or more remote computers, where % connect2ControlComputer executes it. The command is a string, e.g. built % with printCmd; a semicolon is appended. Make sure that the files the % command uses exist on the remote computer, s...
043ae1d4a3ffd40bab2d7edf74cf639efa93855aaa3fec7e52e2eccf59e453c6
MATLAB
9,131
258
function R2_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,ds,stitch) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % ...
4e8525ef4fa0519c432f1dd616febdae2ae13feeaee50ed2b7a6dcbe49ef6218
MATLAB
9,135
258
function ZR_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,ds,stitch) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % ...
63e7cded406a99d5f1115c0c9f0f9cd073c504c202103ce12b7f9d5d4a98f284
MATLAB
9,141
234
function Ret_stitch_Ann(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'retardance/vol',num2str(islice),'/'); cd(fil...
68d639356e07169b0a8a642a9db4e6b46f656bcafaac16cb19c250a9043c24a0
MATLAB
9,148
227
% fdr_bh() - Executes the Benjamini & Hochberg (1995) and the Benjamini & % Yekutieli (2001) procedure for controlling the false discovery % rate (FDR) of a family of hypothesis tests. FDR is the expected % proportion of rejected hypotheses that are mistakenly rejected % ...
8fbf91dbd195734e9c960ca284df819f3519c0ff3bfa5371a0f0969250764337
MATLAB
9,161
210
function SBJ06g_ERP_plot_grp_GLM_onsets_ROI(SBJ_id,proc_id,an_id,model_id,stat_id,roi_id,... plt_id,save_fig,varargin)%gm_thresh,z_thresh, % Load ERP mGLM results to plot onsets of signifcant effects per ROI % INPUTS: % SBJ_id [str] - ID of subject list to load % plt.grp_...
7d0f2c1d976421b53b6ece0f87d7191d4c74487daf7d3df9703d3d4a711a91ee
MATLAB
9,163
221
function Optical_fitting_PTSD1(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','...
cd45aba607fb64b3401ff31c6e092eb117532aa377d1feeff3f17dfa7ce87314
MATLAB
9,163
220
function Optical_fitting_8921(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','T...
c767273eb527c96a3df035e7b87c8fb0f95fd423d56b984eb32674c259fd1075
MATLAB
9,169
220
function Optical_fitting_6692_tmp(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off...
2afc54eea5589e4bd870c51e62442e1648cf504acbd6eae4a2c495d0964fd989
MATLAB
9,171
246
function model = mTRFtrain(stim,resp,fs,Dir,tmin,tmax,lambda,varargin) %MTRFTRAIN Train a linear encoding/decoding model. % MODEL = MTRFTRAIN(STIM,RESP,FS,DIR,TMIN,TMAX,LAMBDA) trains a forward % encoding model (stimulus to neural response) or a backward decoding % model (neural response to stimulus) using time-...
3cd73daa4044c5dc1d61cea411e8a8cdc0c378d8861ad6fc6685489077561adb
MATLAB
9,176
243
function [ExpParameters,Correlation] = calculate_collapsed_integration_kernels(all_responses,SubjectList,nS, mean_stim_streams, stim_streams, trigger_streams,lags) %% loop through subjects and find button presses mean_coherences = []; for subject = 1 : nS subjectID = SubjectList(subject); for condition =...
87eb4f260553535bbe7201c3cf095c8638db5539ce6fca2e261966189d28bf62
MATLAB
9,177
241
%% Plot a set of example to show regression pipeline %% Define Paths of Loading Files and Save Files currentFolder = mfilename('fullpath'); % determine the filepath based on where the script locates scriptFN = mfilename; filePath = erase(erase(currentFolder, scriptFN), strcat('scripts', filesep)); searchPath = strcat(...
04d738a038049dbb92e3c4f007cc2d18a19bf5e4bd8d536b58f677e703865db7
MATLAB
9,179
221
function Optical_fitting_NC(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','Tol...
26fa8b85372b6625db0c8d7db1055612804ca2bf712b4a8f89241ab7e7ac145e
MATLAB
9,180
220
function Optical_fitting_6692(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Display','off','T...
4df95a3de595a95017f271c50373484fa6733ab405a172b115016e19583ac1f0
MATLAB
9,185
259
%% Script to create output for Supp Fig. 2 - analysis of pitch rotation during turn between outbound segments % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Calculate pitch rotation during the rotation at the outbound segment. A % different pitch rotation might indicate a difference in angular velocity % ...
d245950a1fe298d7b289cc24b6aa696e249c6e5ab9343d8a0e7143169b5812ae
MATLAB
9,188
231
% This simulation reproduces the fmri-based motion direction reconstruction % analysis step-by-step. It's written in the form of a tutorial and it's % divided in 3 parts: data generation, voxel-wise GPR estimation, searchlight % based stimulus reconstruction. % %Written By Joram Soch & Riccardo Barbieri. %Other Contri...
2558a72aaf321407a0791710168c1acdb909ca9a5beca0bbc0e9a3222c508573
MATLAB
9,189
289
function varargout=adjustablesigstar(groups,stats,nosort,sigstaroptions) % sigstar - Add significance stars to bar charts, boxplots, line charts, etc, % % H = sigstar(groups,stats,nsort) % % Purpose % Add stars and lines highlighting significant differences between pairs of groups. % The us...
8085341285f5e9bfcafe72a96368c5002045371cb81872189d05c69e0b1f1068
MATLAB
9,191
208
function dth_pseudotrials_SVM_cross_validated_removed_scene_searchlight(subject,task) %DTH_PSEUDOTRIALS_SVM_CROSS_VALIDATED_REMOVED_SCENE Performs the distance-to-hyperplane analysis using SVM on %a balanced dataset. Instead of creating pseudoconditions out of scenes, %the trials from across conditions are lumped into ...
76d5f0216341b0e6c9977f4b711ce05b5f18ec31385b9e49dd9cd725158f0702
MATLAB
9,199
167
function thetaSeq_units_properties = find_thetaSeq_active_units_ID load('X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Cell_count\cell_classification.mat') load('X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 3\Theta sequence scores\thetaseq_scores_individual_laps.mat') if ~exist('X:\Bendo...
1c2489f86f5359f410ecb114df2133f7f8a1c3e39210fd0da4239e033fb0b7f5
MATLAB
9,206
326
function [xs, info] = pwls_pcg1(x, A, W, yi, R, varargin) %function [xs, info] = pwls_pcg1(x, A, W, yi, R, [options]) %| %| penalized weighted least squares (PWLS) %| with convex non-quadratic regularization, %| minimized via preconditioned conjugate gradient algorithm. %| cost(x) = (y-Ax)'W(y-Ax)/2 + R(x) %| %| in %|...
eb83c3296c8e9ab0e52583ae725e91c3ff845a740b20fdd76891b848912a5021
MATLAB
9,215
240
classdef SuhWebUpdate < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause ...
6af7e5f7d7d82953d2487da5efe9ac876ca17dcb19dc3fceded5704da0a7be24
MATLAB
9,216
213
% PlaceCellAna.m % This analyzes place field etc from CMBH file and save in a form that is comparable with the PF ranking made by PlotBinFirRate.m. %output data % pData{ian, iday}.spi(icells) : Spatial info % pData{ian, iday}.rate_map{icells} : Rate map of selected section, includes rm{i}.rate_map, rm{i}.x...
2f8abc3169516aacbf12a725af5aab8b337423e34abfadf3a2606c15773f2baa
MATLAB
9,242
221
%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION % DIS_rev2_fig_1 % Script to analyse data and produce Fig. 1 for: % Grieves, Shinder, Rosow, Kenna and Taube (2022) % The neural correlates of spatial disorientation in head direction cells. eNeuro % % USAGE: % MAP_generate_maps...
d4bee6a34d851f905291beabc427a41942c9d7ef714933541e5fef9df4cc8482
MATLAB
9,243
326
function ob = Gtomo3(sys_type, mask, nx, ny, nz, varargin) %function ob = Gtomo3(sys_type, mask, nx, ny, nz, options) %| %| Construct Gtomo3 object, for 3D tomographic image reconstruction, %| especially for SPECT and perhaps PET. (For CT use Gcone; see below.) %| This object does 3d forward and backprojection using ...
aaaad7e35cb7d6666abf063023756149cdab09b19a24c67b503548e7002ce014
MATLAB
9,245
231
function r_out = Calculate_crossing_points(CellX,pick_peak_flag) % <pick_peak_flag> % When 0: calculated for frames 28-29, T4 T5 mean isoluminances are 5.82 and 7.12 % When -1: calculated for frames 25-26, when frame rate = 6.147 % Have regimes for ON and OFF cells. if (CellX.ON_flag == 1) % ON peak_stim = ...
c0ae8b5da217c56c44274247e38e67428ab182b4208dd6d97a388199084abf30
MATLAB
9,252
251
function [PairwiseSigTable, xpos,out_st] = boxplot_multcompare(data_mat,group_ids, varargin) % function boxplot_multsig(data_table, ind_var,group_var, type_var,varargin) % data_mat[2d array]: data with rows for observations and columns for % variables (study groups). % group_names [cell string]: list of groups names ...
1c0bfa69db22908b620fdfcfab274d71ac2337422f146383105bcb1358b89e96
MATLAB
9,259
288
clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
2a64e9e0d2b41c499e6a8818b402e48a61141b7bfb4e0f0aa41eb68110b25b45
MATLAB
9,266
240
function checkSound(devIndex, latencyClass) % Measures how well the sound hardware of this computer keeps up, by % opening the audio device once per latency class, playing a tone through % each and reporting what happened. Use it when sound crackles, drags or % plays at the wrong speed, to see which setting your machin...
e1bbda02cce3d64f915cb200d20a55305824170b12f0e79b92290628e5b3292c
MATLAB
9,266
257
function [VDM,IPcell]=FieldMap_create(fm_imgs,epi_img,pm_defs) % Function to create VDM file from fieldmap images and can be called % using FieldMap_preprocess.m % % This function uses routines from the FieldMap toolbox to: % 1) Create a single field map from input fieldmap data. % 2) Convert fieldmap to a voxel displa...
11f04f2a5e565da59dfd13a7ddce03757d4c79d4fe733cc6ec6c901b9167017c
MATLAB
9,277
256
classdef ToolBarMethods % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior Un...
f4b58d4a0f543e9cdd8d2f4305d8600fd18f1d68748c1180a19652147d3211e0
MATLAB
9,281
300
function [w1 dphase theta B1q]=RF_pulse(P,teile,B1overide) % comments here % last change: 2015/06/11 by PS if nargin>2 P.B1=B1overide; end; tpulse=0:P.tp/teile:P.tp; dphase=0; if any(strcmp(P.shape,'SPINLOCK')) % lineare erhöhung der pulse bei td ungl. 0 % w1 =tpulse*0+ (P.n*P.tp+(P.n-1)*P.td)/(P.n*P.tp)*...