sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b2f570e61c25c314810b62301da5b8440d612ac4e5dfcc67a2255bec347421c9
MATLAB
5,131
147
function statTestResult = condColocStatTest(saveRes) %STATTESTRESULT takes compiled results from plotSaveConditionalColoc.m and do ranksum test on the results % %SYNOPSIS statTestResult = condColocStatTest(saveRes) % Function does a ranksum test comparing each conditional colocalization % measure to its corresponding...
10b0d2201c8b957742e9b71446a85e3787371097ad93f31a57c0197a3b86a8af
MATLAB
5,134
159
function fit = fit_meta_d_mcmc_groupCorr(nR_S1, nR_S2, mcmc_params, fncdf, fninv, name) % fit = fit_meta_d_mcmc_groupCorr(nR_S1_1, nR_S2_1, nR_S1_2, nR_S2_2, mcmc_params, fncdf, fninv) % % Estimates correlation coefficient between metacognitive effiency % estimates between two domains. See fit_meta_d_mcmc_group for ful...
c9c24f50dac25688268f54d70ef56e0e4ee91b6795a5c1f59dcc9e4a225ccb99
MATLAB
5,134
129
function call_behresp(handles) mainfig_pos = get(handles.mainfigure, 'Position'); clear trace_stamp_pool trace_num_all ttlabel_pool for k = 1:length(handles.datafilename) handles = loadtrace(handles, k); framestamp = handles.framestamp{1}; stampinfo = handles.stampinfo{1}; if handles.plotRawdff == 0 && ...
3b15389ebb499399e12f93befdeb6c5047f51746d6df21c72452db303c2e4a09
MATLAB
5,135
160
function coeffs = nonneg_poly_coeffs( deg, trig, mm ) %#ok %NONNEG_POLY_COEFFS Coefficients of nonnegative degree-n polynomials. % NONNEG_POLY_COEFFS(DEG), where DEG is a nonnegative integer, creates a % vector variable of length DEG+1 and treats its values as % coefficients of a polynomial (in the same sense...
d6809c8c296687fa9aed6e88037516b4fb9e88cad8c056609ae5890ff5443e1c
MATLAB
5,135
148
% Behavioral variables % ------------------------------------------------------------------------- % unpack variables names = DAT.BETWEENPERSON.between_subject_design.Properties.VariableNames; for i = 1:length(names) eval([names{i} ' = DAT.BETWEENPERSON.between_subject_design.' names{i} ';']) end disp(names) % Gr...
a472658c36afee0989a46a9be4d571b67792f6ad8aaa75b9044871d880206147
MATLAB
5,137
90
%%************************************************************************* %% parameters.m: set OPTIONS structure to specify default %% parameters for sqlp.m %% %% OPTIONS.vers : version of direction to use. %% 1 for HKM direction %% 2 for NT direction %...
653025cfbd5f77a96455746c2ab5bf69c190abcb2c5280cc31d6b368c7c704cd
MATLAB
5,138
101
function [ft_struct,rejected_comps] = RFT_IClabel(ft_struct,eeglab_template_file,numComp,threshold) %%% From a fieldtrip structure (with N trials), concatenates all trials, %%% create an eeglab structure with this 'single concatenated trial', %%% cleans the data with ASR, based on cutoff and windowlen ...
8a2d34493a5279ee4e20a19b1242d6bfd8eb34f26aa2a913427b9fb3e24d264a
MATLAB
5,138
140
% std_substudy() - create a sub-STUDY set by removing datasets, conditions, groups, or % subjects. % Usage: % >> [ STUDY ALLEEG ] = std_substudy(STUDY, ALLEEG, 'key', 'val', ...); % % Optional Inputs: % STUDY - existing study structure. % ALLEEG - vector of EEG da...
8184b8378745f9437fe9fec359ed41c91c174c1061886d96b1b2062f04da4ddf
MATLAB
5,139
164
%% Load and display JSON file with study info, if we have it plugin_display_study_info_json; %% Load DAT structure with setup info % ------------------------------------------------------------------------ savefilename = fullfile(resultsdir, 'image_names_and_setup.mat'); load(savefilename, 'DAT') % For publish outpu...
997a1abea0725e39e9daf55e5642b055349ec337ca26671bfd7808d4110538ef
MATLAB
5,141
112
function rqa_plot(data, rp, RESULTS, tau, dim, DIM, Zscore, Norm, radius, wrp, type) scrsz = get(0,'ScreenSize'); f = figure('Position',[scrsz(3)/4 scrsz(4)/4 scrsz(3)/3 scrsz(4)/2]);tabgp = uitabgroup(f); binary = uitab(tabgp,'Title','Binary'); heatmap = uitab(tabgp,'Title','Heatmap'); % Binary Plot (Tab 1) a1 = axes...
7bb129c368441aaeaa99ebec2d13236044781f19ff0462393954ab6d1676be69
MATLAB
5,142
123
classdef LeG_parfor_wait < handle %This class creates a waitbar or message when using for or parfor. %Required Input: %TotalMessage: N in "i = 1: N". %Optional Inputs: %'Waitbar': true of false (default). If true, this class creates a % waitbar. %'FileName': 'screen' or ...
9597d020074fa6fdef9287d4b609e4381f54173c57a67aa5c64ee09ec6fcbcdf
MATLAB
5,142
158
function [ cellinfo,filename ] = bz_LoadCellinfo(basePath,cellinfoName,varargin) %[ cellinfo,filename ] = bz_LoadCellinfo(basePath,cellinfoName) function for %for loading cellinfo.mat files. cellinfo.mat files are saved as: % datasetPath/baseName/baseName.cellinfoName.cellinfo.mat % %INPUT % basePath % cellinfoName...
7fc30b87629d7427ca5233e8d7e8140742c143f869cfc41fe98ecec84dc2a1de
MATLAB
5,143
105
function [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpb(data,win,params,segave,fscorr) % Multi-taper segmented spectrum for a univariate binned point process % % Usage: % % [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpb(data,win,params,segave,fscorr) % Input: % Note units have to be consistent. See chronux.m for more i...
be429d4a0f90409728e96e68ac85edbbbc9d1832dec82aba7a5b41fcbdbd104e
MATLAB
5,143
120
function [likelihood, results, label, params, tau] = CBIG_hMRF_adapt_d(params, label, i, full_corr_mat,... lh_mask, rh_mask, avg_mesh, tau, Neighborhood_lh, Neighborhood_rh, Neighborhood_lh_rh) % [likelihood, results, label, params, tau] = CBIG_hMRF_adapt_d(params, label, i, full_corr_mat,... % lh_mask, rh_mask, av...
d2bf32e73c01d9db5acb4436e9e8fb70b9df97d9e5649c7383f03911877dc441
MATLAB
5,143
179
%% figure S6 load('figure5_data') %% an_col = [30 58 205]/255; aw_col = [229 32 21]/255; % awake_color1_5 = [0.8272 0.3489 0.2865]; % anes_color1_5 = [0.1792 0.4769 0.7191]; norm_lim = [2.5*10^-3 3.17*10^-3]; x_lim = [0 360]; % Angle data range %% A % Define parameters norm_...
9bb8f0a60537aa2742ffa7f252b86804fa51ad491cdd8e9f6c66f9c01cc54969
MATLAB
5,145
161
function [tau, curve, info] = ami_kde(x, L, opts) %AMI_KDE Average mutual information versus lag, kernel density estimator. % TAU = AMI_KDE(X,L) returns the lag of the first local minimum of the % average mutual information of X with itself over lags 0:L, using Gaussian % kernel density estimates of the marginal ...
8ae5893f1a6b27ce15d9adc32e3439bc210ae0fb1f4e7437f5636ea79f0b3073
MATLAB
5,148
147
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
31fd88a1af2d7bac49fc46babfe02fd430dbbc3b381e251b822d5c131a0e82ec
MATLAB
5,150
147
function [dz,vdz,Adz]=two_group_test_spectrum(J1,J2,p,plt,f) % function [dz,vdz,Adz]=two_group_test_spectrum(J1,J2,p) % Test the null hypothesis (H0) that data sets J1, J2 in % two conditions c1,c2 have equal population spectrum % % Usage: % [dz,vdz,Adz]=two_sample_test_spectrum(J1,J2,p) % % Inputs: % J1 tapered fou...
64d097c742610795dfe1357d47d6b4959b58e56377f1eb8c2b06c3ad6855bc24
MATLAB
5,151
134
%EPS2PDF Convert an eps file to pdf format using ghostscript % % Examples: % eps2pdf source dest % eps2pdf(source, dest, crop) % eps2pdf(source, dest, crop, append) % eps2pdf(source, dest, crop, append, gray) % eps2pdf(source, dest, crop, append, gray, quality) % % This function converts an eps file...
446af4e7e22c0737c775514c8ff83082b24996fc9415228ebabd7f5f309af4d0
MATLAB
5,152
89
%% SimpleFieldSim3DViewElement - A panel that represents a View Element % to configure a SimpleFieldSim3D Graphics Object % % Andreas Husch % Centre Hospitalier de Luxembourg, Dep. of Neurosurgery / % University of Luxembourg - Luxembourg Centre for Systems Biomedicne % 2013 - 2017 % mail@andreashusch.de, husch.andrea...
eeba7c2f9c78248640ad062f356bcbc296c2d005a234b5bb523127e0cae26174
MATLAB
5,153
145
function [a, cb] = plot_subcortical(data, varargin); % % Usage: % [a, cb] = plot_subcortical(data, varargin); % % Description: % Plot subcortical surface with lateral and medial views (authors: @saratheriver) % % Inputs: % data (double array) - vector of data, size = [1 x v]. One value per % subcortical...
54d3339ac6bd9dfd6f1853a435aeba6ff1259fab1616dc96ac00c38d1677138c
MATLAB
5,158
231
function rtf(plot_frq,flag_save) close all evalin('base','stop=0;'); %=========SET THE BASIC FIGURE================= fig = figure('Position',[500,500,800,600],... 'NumberTitle','off',... 'Name','Scope',... 'doublebuffer','on',... 'HandleVisibility','on',... 'Ke...
e148c1e515a708005eee96bb63639818e2b79dbebf800343a72a60b3127629ac
MATLAB
5,158
144
function [dev devControl] =... bz_peerPrediction(spikeTimes,winRange,extraPredictors,pairsToRun) % INPUT % % spikeTimes - (M x N x D) matrix of spike times. M is the cell number, % N is the trial number, and D is length of a trial in % milliseconds % winRange - vector tha...
abea870acd7d06ffce225456ea2b4111c409412d7921e6cf6c0a57366a3ac24c
MATLAB
5,161
157
function y = base64encode(x, eol) %BASE64ENCODE Perform base64 encoding on a string. % % BASE64ENCODE(STR, EOL) encode the given string STR. EOL is the line ending % sequence to use; it is optional and defaults to '\n' (ASCII decimal 10). % The returned encoded string is broken into lines of no more than 76 % ...
49f360565302d4201b6351f3d9a7f4b6d3a7d59bd54ced80ae82f5d6866d96dc
MATLAB
5,162
114
function [leftpos rightpos leftM rightM] = getPFNbumps(allflies,trialtypes,flies,datatype) % This function produces summary data structures for the left and right % halves of the PB for PFN bump data. % Be sure to clear the values of 'leftpos', 'rightpos, 'leftM', and 'rightM' % before running the function. %...
87099925dc5bf08d239265939c53919207c809f8119b7cafb78e233294068297
MATLAB
5,162
162
% compplot() - plot a data epoch and maps its scalp topography at a given time % % Usage: To plot the projection of an ICA component onto the scalp % >> projdata = icaproj(data,weights,compindex); % % then >> compplot(projdata); % % else to plot an EEG epoch with a topoplot at one selected time point % ...
44a3f29d74c2ce6d334a54a87f047315d012096d0bf3371986358217e67b0c2e
MATLAB
5,163
166
%CCG - Compute multiple cross- and auto-correlograms % % USAGE % % [ccg,t] = CCG(times,groups,<options>) % % times times of all events % NOTE: spiketimes in SECONDS. % groups group IDs for each event in time list (should be % integers 1:nGroups) % % alter...
3de342832605e7169f46db79dca114c1af44aec3dc54cacf65e6d76320d62dc9
MATLAB
5,165
112
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
f3f2b946d132f57c158cf61df6f67169d52e79c67c3128843671597fae44c89c
MATLAB
5,165
136
function contact_perc_currents = ea_get_optimal_currents(N_contacts,stimfolder,side,plot_progress) % check pam_optimizer results and return currents for the best solution if side == 0 side_suffix = '_rh'; else side_suffix = '_lh'; end if isfile([stimfolder,filesep,'NB',side_suffix,filesep,'optim_iterations_C...
62b26454e78cc25408d20541da29d51cffdd3c9a46af927fccd3d7773c13a704
MATLAB
5,168
155
function [At,b,c,K]=fromsdpa(fname) % readsdpa Reads SDP problem from sparse SDPA-formatted input file. % [At,b,c,K] = readsdpa(fname) produces conic optimization problem % data, as can be used by sedumi. "fname" contains a full pathname % to the SDPA 4.10-formatted file. (SDPA is a stand-alone solver for % ...
7b438e3dfc74a4767ce87e53c3ab686d4bbf76f0d86bafc7f4b40a59cc6d6c77
MATLAB
5,170
172
function [pos_ts,pos,lfp_ts,lfp_sig,spk_ts] = import_spiking_data(filepath, tetrode, unit) % [pos_ts,pos,lfp_ts,lfp_sig,spk_ts] = import_spiking_data(filepath, tetrode, unit) % % Extracts behavioral, lfp and spiking data from filepath. % % Inputs: % filepath: Full path to the directory for the target session % tetr...
c139d88610ba8ec3057f6f0b23fbb93b99a8f13dc467bf7ba9cb374e16e46bb5
MATLAB
5,171
95
function [fid, hdr, cleanupObj] = write_nifti2_hdr(hdr, filename) mydelete(filename); %avoid permission issues, and replace links with files instead of overwriting the pointed-to file fid = fopen(filename, 'Wb'); %always write native-endian - capital W means fwrite() doesn't flush every call if fid == -1 ...
7a7262ac036d101bebb3c87e13e94f450cd8ec87ed0919b57be261052398d752
MATLAB
5,172
176
% THIS SCRIPT extracts region averages and local pattern expression in each % parcel of the Spm Anatomy v22c atlas % % - extracts local parcel means and all local pattern expression for all signatures. % - Preps file Parcellation_data.mat saved in "results" folder. % - Allow us to compare local pattern expression ac...
314ad4f1ae7d87bb9de17ecb46da319fa76e0bc81d44713ae4282b2f86ed03a9
MATLAB
5,175
133
%%*************************************************************** %% degeneracy: determine if an SDP problem is non-degenerate. %% %% [ddx,ddz,B1,B2,sig1,sig12] = degeneracy(blk,At,X,y,Z); %% %% Assume that strict complementarity holds: %% for primal non-degeneracy, we need rank([B1 B2]) = m %% for dual non-degeneracy,...
458065d50f6a4bb4e324eb3acd8ea904e408f5b0175edf1c3edb5a3f5328e7a7
MATLAB
5,175
125
% mainfolder0 = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Probability Score/1_Results/0_Final Results/Results_Main/'; % figurefolder = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Probability Score/1_Results/0_Final Results...
88f8b0c2e6a3b34e8fba6bf36bd521a35d37a46a14b8375042390bc8a4a7f339
MATLAB
5,177
174
% Digital circuit sizing example (GP) % Boyd, Kim, Patil, and Horowitz, "Digital circuit optimization % via geometric programming" % Written for CVX by Almir Mutapcic 02/08/06 % % Solves the problem of choosing gate scale factors x_i to give % minimum ckt delay, subject to limits on the total area and power. % Uses max...
6087d016b0ad6cd76ba528bfb6eac03f630971805ed303cd807de6ced1575f5d
MATLAB
5,178
105
% ----------------------------------------------------------------------- % % M U L T I P L E T E S T I N G % % ----------------------------------------------------------------------- % % Function 'fdr_BH' computes the Benjamini-Hochberg correction of the % % False Disc...
a40b1b1214859f862519bfe535f0b0d9c65694e28599284580229880056edd90
MATLAB
5,180
147
% THIS SCRIPT RUNS BETWEEN-PERSON CONTRASTS % Assuming that groups are concatenated into contrast image lists. % Requires DAT.BETWEENPERSON.group field specifying group membership for % each image. % -------------------------------------------------------------------- %% Load stats switch myscaling_svm_between ...
4291c91d6b30fe8b8120e9a4df021e5aefab3a2162cf1f537b3fb7c7c4bcdbf3
MATLAB
5,182
151
function [maps,stats] = SurveyFiringMapsAutoCorr(units,varargin) %SurveyFiringMapsAutoCorr - Compute and plot autocorrelogram maps for all conditions. % % USAGE % % [maps,stats] = SurveyFiringMapsAutoCorr(units,<options>) % % units optional list of units, i.e. [electrode group, cluster] % ...
c31d62ac6c2803aa873aeb8e0612a6e7c2153ab887cff8565965d23d9fc9077d
MATLAB
5,183
114
function [SS,tau]=mtspectrum_of_spectrumc(data,win,tapers2spec,params) % Multi-taper segmented, second spectrum (spectrum of the log spectrum) for a continuous process % This routine computes the second spectrum by explicitly evaluating the % Fourier transform (since the spectrum is symmetric in frequency, it uses ...
a573ab38ceb6f07e4259fffc65dbb1e9e95b3792a9ebb864e892f2544fcd7a1b
MATLAB
5,189
217
function [n weights fod] = csd(data,bDirs,HRdirs, Strue,lmax) SHscheme = genSH(double(bDirs'),lmax); SHschemeOUT = genSH(HRdirs',lmax); SHscheme300 = genSH(HRdirs',lmax); shhres = SH2RH(amp2SH(Strue,SHscheme)); %shhres/shhres(1) [n weights fod] = csdeconv (shhres, data, SHscheme,SHscheme300); function [ locm...
fd99d36df96ed947210eb45688348359b998fedeae8b16df365d0309564fcfb3
MATLAB
5,189
95
function [fid, hdr, cleanupObj] = write_nifti2_hdr(hdr, filename) mydelete(filename); %avoid permission issues, and replace links with files instead of overwriting the pointed-to file fid = fopen(filename, 'Wb'); %always write native-endian - capital W means fwrite() doesn't flush every call if fid == -1 ...
1bc9ffcb037e9117e65a0e0f2a46346089e7f33323b6fa2bb6d586c30b95225c
MATLAB
5,190
129
function affinefile = ea_spm_coreg(options,moving,fixed,costfun,doreslice,otherfiles,writeoutmat,interp) % Wrapper for SPM coregistration % % SPM modifies the header of the moving image when doing coregistration % (for both "Estimate" and "Estimate & Reslice"). This wrapper here will % only modify the header if 'doresl...
64ef9a3763e08f1699e0da39c1d3781f9b866f92aa590e767f8f89916c550188
MATLAB
5,192
150
%To combine vessel diameter along pericytes across animals allnames={ 'Tser4954b_res_cfr.mat' 'Tser4954c_res_cfr.mat' 'Tser5199_res_cfr.mat' 'Tser5072_res_cfr.mat' 'Tser5215_res_cfr.mat' }; groupname='stimAllTrials'; all_rr1a_microns=[]; all_rr1nSEM_microns=[]; all_rr1a_percent=[]; all_rr1nSEM_percent=[]; all_rr2a...
9391c4ae37131609b2f9394a952eaf0e180a0d0531be1f3b3eeda1752e9a5d3d
MATLAB
5,201
148
% LC oscillator design (GP) % Boyd, Kim, and Mohan, "Geometric programming and its % applications to EDA Problems", (DATE Tutorial 2005), pp.102-113. % Original code by S. Mohan % Written for CVX by Almir Mutapcic 02/08/06 % % Designs an LC oscillator consisting of a loop inductor, varactors % for fine tuning, binary w...
0cc9322210b9c77f27ee791723b072b30bfc307aae63d479a707ba28c9a000d2
MATLAB
5,203
91
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegpb(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra computed by segmenting % two univariate binned point processes into chunks % % Usage: % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegpb...
ffb089899e705b5b51ca6a7cc3cc147f4468dd1b9eac7b5604a5e6273b115cb1
MATLAB
5,212
152
function varargout = loadxml(filename,varargin) %LOADXML Load workspace variables from disk (XML file). % LOADXML FILENAME retrieves all variables from a file given a full % pathname or a MATLABPATH relative partial pathname (see PARTIALPATH). % If FILENAME has no extension LOAD looks for FILENAME and FILENAME....
f4b5b5aa50c810f6cd48c8f6acb8787d7de8a31dab295464f01d29727dbad1df
MATLAB
5,218
144
function obj=stat_ellipse(obj,varargin) %stat_ellipse() Create confidence ellipses around 2D groups of % points % % Parameters: % 'type': The default '95percentile' displays an ellipse that % contains 95% of the points (assuming a bivariate normal % distribution). The option 'ci' will first compute boostrapped % 2D mea...
8c651b906d22ef21891078a7026d153d08519b68724aa0f492cb248362f24592
MATLAB
5,221
126
function [hObject, eventdata, handles] = ea_convertGUIDEArguments(app, event) %CONVERTTOGUIDECALLBACKARGUMENTS Converts App Designer callback %arguments to GUIDE-style callback arguments. % [HOBJECT, EVENTDATA, HANDLES] = CONVERTTOGUIDECALLBACKARGUMENTS(APP, EVENT) % is automatically added to the be...
c196d86cab36d9015f01108ab3acf13cbf26dd86c12d61f6ddfed2d18680cac3
MATLAB
5,221
106
function ClincFreq_CalHeatNum(INDIR,OutHeatdir,SetUpPara,Para,AtlasTempU,dbmask) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; Dvol = sum(D)'; Dvole = sum(D,2); IgV = Para.IgP; indexs = find(Dvole>=(size(D,2)*IgV/100)); Dmasked = zeros(V.dim); Dmasked(indexs) = 1; f...
affb72b6bb5ca338f0c2d2ee59967ef31b27f81ea3a5aa97b28ba88d75caee2b
MATLAB
5,222
117
function CortElecs = ea_importcorticalels(options) % Import Cortical Electrodes % __________________________________________________________________________________ % Copyright (C) 2017 University of Pittsburgh (UPMC), Brain Modulation Lab % Ari Kappel % save info to struct CortElecs.patientname = options.patientname...
80355435cf10aeeed28d7784cdad7e06ddf4a65261f188ee1cb4f25e13663e2a
MATLAB
5,224
148
function [V, C, topo] = T1_edgeswap(V, C, topo, T1_edge_ID) % T1_EDGESWAP Perform a T1 (neighbor-exchange) topological transition on % a single edge (non-sheared PBC version). % % [V, C, topo] = T1_EDGESWAP(V, C, topo, T1_edge_ID) collapses the edge % T1_edge_ID (connecting vertices u0 and v0, shared by cells c1 a...
5ca5c158a0eecdf871bb70dd95f6f55ce5921486e95ee36e89f924867e9d2685
MATLAB
5,225
167
% cart2topo() - convert xyz-cartesian channel coordinates % to polar topoplot() coordinates. Input data % are points on a sphere centered at (0,0,0) % or at optional input 'center'. This function % is now DEPRECATED! See Important warning below. % % Usage: >> [t...
8bf1804d1875780ad4edeff9ceb043ea234e2e3ee7b3962047c116f5273d72d7
MATLAB
5,225
186
function baseline = CBIG_hypoTest_3t(betas, stats) % baseline = CBIG_hypoTest_3t(betas, stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md baseline = zeros(9, 3); %% AD fprintf('\n--------------------------------- AD ---------------------------------\n\n'); %...
9e61629101b889b23e84374a8017f0d03974f628ebdfb92a9dfd64a46eafeafe
MATLAB
5,228
76
function [matlabbatch]=batch_job(b,s,scannr) %----------------------------------------------------------------------- % Job configuration created by cfg_util (rev $Rev: 4252 $) %----------------------------------------------------------------------- %% matlabbatch{1}.spm.spatial.realignunwarp.data.scans = b(scannr).da...
59edbf9eaaa6d37cb7e3a41f5a25a08775b7375d3056ef08cfaf0320b133d406
MATLAB
5,233
103
function [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpt(data,win,params,segave,fscorr) % Multi-taper segmented spectrum for a univariate binned point process % % Usage: % % [S,f,R,varS,zerosp,C,Serr]=mtspectrumsegpt(data,win,params,segave,fscorr) % Input: % Note units have to be consistent. See chronux.m for more informat...
5c8d09b1b6a0d86595414e6f9467609c0ab58884b57b060ee8b963ea77899940
MATLAB
5,234
152
% Minimize thermal noise power of an array with arbitrary 2-D geometry % "Convex optimization examples" lecture notes (EE364) by S. Boyd % "Antenna array pattern synthesis via convex optimization" % by H. Lebret and S. Boyd % (figures are generated) % % Designs an antenna array such that: % - it has unit a sensitivity ...
0f55113fd5e0822939bcdbef0ef17339c2665c310d07390d802697473ec49a6a
MATLAB
5,236
122
function [ys,yi]=surr_pseudo_periodic(y,tau,dim,rho) % [ys,yi]=surr_pseudo_periodic(y,tau,dim,rho) % inputs - y, time series % - tau, time lag for phase space reconstruction % - dim, embedding dimension for phase space reconstruction % - rho, noise radius % outputs - ys, surrogate time series %...
d9e2c652430320f9718809384b1be513d64819b00c73b73a66f8118e2026facb
MATLAB
5,241
151
function frequency = Frequency(timestamps,varargin) %Frequency - Compute instantaneous frequency for a point process (e.g. a spike train). % % Compute instantaneous frequency either by smoothing the point process using a fixed % or adaptive Gaussian kernel, or by simply taking the inverse of the interevent intervals. ...
5b504cd31e0152eee9e62c2c19041adfd01564affb7d11e692a347b7bf85da26
MATLAB
5,244
164
%% RUN_MEASUREMENT_PREDICTION_STEP % Driver: resolve project paths, pick ROI(s), run measurement prediction, % optionally plot. import fnirspower.* P = fnirspower.setup_paths(); %% Load head model, forward model, dmu_a information montageName = 'dense'; % Files mesh_mat = fullfile(P.icbm_mesh_di...
c639b977623d9af321c6d3a933ec606aeac3aaf515d17cdf45f9309c1667d266
MATLAB
5,245
164
function [curves,stats] = SurveyTuningCurves(units,varargin) %SurveyTuningCurves - Compute and plot tuning curves for all subsessions. % % USAGE % % [curves,stats] = SurveyTuningCurves(units,<options>) % % units optional list of units, i.e. [electrode group, cluster] % pairs; set clus...
e62ea2d131d644370ce9a0b3ab3a2bfebf17ad400d08d13f1ddcd2ca3e27a871
MATLAB
5,246
99
function [Fval,A,f,sig,sd] = ftestc(data,params,p,plt) % computes the F-statistic for sine wave in locally-white noise (continuous data). % % [Fval,A,f,sig,sd] = ftestc(data,params,p,plt) % % Inputs: % data (data in [N,C] i.e. time x channels/trials or a single % vector) - required. % params...
4dade328fb314bb98f0c869f6eb8fbee20cdbbf420d7226e78578d312ec0ff16
MATLAB
5,248
103
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencypb(data1,data2,params,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra - binned point process % % Usage: % % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencypb(data1,data2,params,fscorr) % Input: % data1 (in form samples x ...
a3c20f5f1fa8826952041b9fb6e703b24f8ebbd1d8477ab60c4d395519d5037d
MATLAB
5,248
150
function oimg = loadtiff_old(path, sFrame, num2read) % Copyright (c) 2012, YoonOh Tak % All rights reserved. % Modified by Eftychios Pnevmatikakis, 01/2017. % % Redistribution and use in source and binary forms, with or without % modification, are permitted provided that the following conditions are % met: % % ...
d68ad7fa0aff9e93b785ae360772be5073198768366b52081b9eba24c3a33edf
MATLAB
5,249
135
function varargout = save(tree, filename) % XMLTREE/SAVE Save an XML tree in an XML file % FORMAT varargout = save(tree,filename) % % tree - XMLTree % filename - XML output filename % varargout - XML string %__________________________________________________________________________ % % Convert an XML tre...
30028b21c1c18814f3fb8796b1f630aaccc90f8901c1533b682fa7aa34407035
MATLAB
5,250
147
function colorMtx = colors(nColors, backgroundCol, type) % JF, get distinguishable color-blind friendly colors % ------ % Inputs % ------ % nColors: number of colors to return (default: 15) % backgroundCol: background color ('w' for white, 'b' for black, default: 'w') % type: colormap type ('standard', 'wang', 'ibm', '...
d55ce030a23825880a8e5b48b00c252f9ed1da514ec26ce940e2532844315c47
MATLAB
5,254
126
%% TITLE OF HELP FILE - e.g., HOW_DO_I_xxx... % One-line description of what this help file shows. %% General instructions % % Instructions for creating a file: % ----------------------------------------------------------------------- % % - Try to give a brief, but complete, description % - Code blocks with %% will ap...
262e4a2db9f21629a9874432b94e4c7f17debe8132c94245c12d2ad7d1812d9d
MATLAB
5,255
166
% Script that runs imposed perimeter model shown in Figure 6 for a specific % parameter choice % Adapted from Troost et al., 2023 %% RUN SCRIPT for SOP Weighted Lateral Inhibition Model clear; close all; clc; %% Model setup model.ratio = 'rho'; model.zone = 'Gaussian-like proneural genes'; %% Simulation paramete...
81c753975f9d7a9893eb87ae885fcd05903849beacff780e6a248a1a30c167bf
MATLAB
5,255
186
function baseline = CBIG_hypoTest_3t(betas, stats) % baseline = CBIG_hypoTest_3t(betas, stats) % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md baseline = zeros(9, 3); %% AD fprintf('\n--------------------------------- AD ---------------------------------\n\n'); %...
bcf91b0fc8d2e3ca671373b99edd3ac7dac15b27c0d609d917f02ff874c349d9
MATLAB
5,255
139
function S = preprocess(snirf_path, model, params) %NIRSPROC.PREPROCESS Motion→OD→filters→badch→DPF→Hb + stim vector (modular). % S = NIRSPROC.PREPROCESS(snirf_path, model, params) % % See also: nirsproc.load_trim_snirf, nirsproc.motion_to_od, % nirsproc.poly_detrend_cols, nirsproc.attenuate_spikes, ...
58b233a55efb3ea358557a72e08cfb20c5067990c8b5edc7e1b1d4646da5aec4
MATLAB
5,258
128
function handles = call_autoshaftDendr(handles, ifGUIdraw, resetparameter, ifhold) if nargin < 4 ifhold = 1; end if resetparameter prompt = {'Enter shaft segment length:'}; dlgtitle = 'Input'; dims = [1 35]; definput = {num2str(handles.defaultPara.shaftlength)}; answer = inputdlg(prompt,dlgtitle...
6b095ba40c169b2d82d9a8a731b8350b422202b8b5501e914e414c95d117eca9
MATLAB
5,258
131
function varargout = ea_sfc_setthreshs(varargin) % EA_SFC_SETTHRESHS MATLAB code for ea_sfc_setthreshs.fig % EA_SFC_SETTHRESHS, by itself, creates a new EA_SFC_SETTHRESHS or raises the existing % singleton*. % % H = EA_SFC_SETTHRESHS returns the handle to a new EA_SFC_SETTHRESHS or the handle to % t...
10f78f4bda3d0b757d888330845de124848b73bcb718e466781db993a185ee9c
MATLAB
5,260
195
function [redblue, red, blue] = CustomColormap( varargin) % generate blue and red colormaps % % Syntax % [redblue, red, blue] = CustomColormap(); % [redblue, red, blue] = CustomColormap( varargin); % % Input % Optional Key-value pairs % 'N', length of colormap, default 200 % 'r1', a value between 0 ...
7392e0ce09014153518799be2240f4137b7183cf7447534bff794b2f88f4d835
MATLAB
5,262
150
function condColocGeneralAnalysisMLMD(MLMD,ptOrBlob,varargin) %CONDCOLOCGENERALANALYSIS run colocalization analysis images with three channels with segmented and/or detected objects % % Function will run conditional colocalization analysis for three punctate % or non-punctate objects or a combination. It will make all ...
07f7a984781900635b4a06d962e2b1c50cf7730c6b55f086074e61398947335f
MATLAB
5,264
154
function [firingMaps] = bz_firingMapAvg(positions,spikes,varargin) % USAGE % [firingMaps] = bz_firingMapAvg(positions,spikes,varargin) % Calculates averaged firing map for a set of linear postions % % INPUTS % % spikes - buzcode format .cellinfo. struct with the following fields % .times % posit...
0b810f2de8fccf642e35a497b439bda77b434ad9b3350b1b4d0514b3a885953d
MATLAB
5,265
184
function[s,t,E] = sta(data_spk,data_lfp,smp,plt,w,T,D,err) % Spike Triggered Average % Usage: [s,t,E] = sta(data_spk,data_lfp,smp,plt,w,T,D,err) % % Inputs % % Note that all times...
49767866cc0c0f14f45c663426d0ed1d7098fe749b4ecb3d1d9ae9772d2e8320
MATLAB
5,265
148
function condColocAnalysisPt2Pt2PtMLMD(MLMD,varargin) %CONDCOLOCANALYSISPT2PT2PT run conditional colocalization analysis for 3 punctate objects. % %SYNOPSIS function condColocAnalysisPt2Pt2PtMLMD(MLMD,varargin) % % Function will run conditional colocalization analysis for three punctate % objects and will make all per...
c7b6a02b5ab7e4e96ced85667b84996900c216da9a51111c5fc6a223b9dfa620
MATLAB
5,268
173
%%********************************************************************* %% gpcomp: Compute tp=1/gp in Proposition 2 of the paper: %% %% R.M. Freund, F. Ordonez, and K.C. Toh, %% Behavioral measures and their correlation with IPM iteration counts %% on semi-definite programming problems, %% Mathematical Programmin...
44bde75ec709607e2f260abdf563ead99c16cb12f2830c8f0a07f08f0593369b
MATLAB
5,273
149
function [r]=ea_skipped_correlation(x,y,type) % performs a robust correlation using pearson/spearman correlation on % data cleaned up for bivariate outliers - that is after finding the % central point in the distribution using the mid covariance determinant, % orthogonal distances are computed to this point, and ...
b7ab0276c238cf26570b56ec19eab9e5d9d29c24b20992b0b1acd20faa765ae8
MATLAB
5,273
113
classdef CBIG_ASDf_unit_test < matlab.unittest.TestCase % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md methods (Test) function test_short(testCase) % create output folder CBIG_CODE_DIR = getenv('CBIG_CODE_DIR'); ...
a6293b5cc6e6abe0529a09ffeca958c7ffa3c1564c26023d090e8f31131b23aa
MATLAB
5,283
151
% go to data folder % cd(['D:\TinyDancers_Movement\DLC_output\velo_timeseries\']); cd(['D:\TinyDancers_Movement\DLC_output\PM_postimeseries\']); addpath('C:\Users\tnguyen\OneDrive - Fondazione Istituto Italiano Tecnologia\Documenti\MATLAB\toolboxes\fieldtrip-20220929'); ft_defaults; % load names of all files ...
7273a1e4d0b1c0c103fa791550f19d1096b46a54fd66c2379e0a8d839fafac87
MATLAB
5,285
139
function ea_importfssegmentations(options) if options.prefs.fs.subcorticalseg.thalamus % thalamus thaldict=getthalmap; temp=ea_getleadtempdir; system([options.prefs.fs.dir,filesep,'bin',filesep,... 'mri_convert',... ' ',ea_path_helper(fullfile(options.subj.freesurferDir,['sub-',option...
67d83eaeb6fb55e0dfd2207588d1e53ce87d364db355d2e3eb8bff702e12803e
MATLAB
5,290
190
function [spikemat] = bz_SpktToSpkmat(spikes, varargin) %spikemat = bz_SpktToSpkmat(spiketimes,<options>) takes a % 1 x N_neurons cell array of spiketimes and converts into a t/dt x N spike % matrix. % %INPUTS % spikes a structure with fields spikes.times % can also take a {Ncells} cell array of ...
891d1059c869b00c2ae01b02dc0efa69e9c81113ccdb3607ccd6696e8465ef2a
MATLAB
5,294
91
function [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherencysegpb(data1,data2,win,params,segave,fscorr) % Multi-taper coherency,cross-spectrum and individual spectra computed by segmenting % two univariate binned point processes into chunks % % Usage: % [C,phi,S12,S1,S2,f,zerosp,confC,phistd,Cerr]=coherency...
dc021744a766338b9f4f25063d8af93a2e491556875907fdbe6dbce651e56a3e
MATLAB
5,298
170
function ea_ants_apply_transforms(varargin) % Wrapper for antsApplyTransforms used for reapplying coregistration % (linear registration) and normalization (non-linear registration) ea_libs_helper; options = varargin{1}; useinverse = 0; if nargin == 1 input{1} = options.subj.coreg.anat.preop.(options.subj.Anchor...
f5a1fd4b1558d0834f65392ee325beef52fec04122ac66d762441b0c70d9a3a2
MATLAB
5,302
150
function NEV = rethresholdNSx(varargin) % rethresholdNSx % % Opens a NEV file and rethresholds it. It outputs a NEV structure into % MATLAB. This version currently does not save a new NEV file. % % All input arguments are optional. Input arguments must be in the % following order: % % NSx: The data struct...
5acb860c6c2290d75d1137e492dcceca6f8b48320cbd813342965ec295f26c9d
MATLAB
5,304
164
%CCG - Compute multiple cross- and auto-correlograms % % USAGE % % [ccg,t] = CCG(times,groups,<options>) % % times times of all events % NOTE: spiketimes in SECONDS. % groups group IDs for each event in time list (should be % integers 1:nGroups) %...
e44bd3221418833eabf814ad7df656a1664d3c54ac1d5f0e862386c00ab7c928
MATLAB
5,306
188
function [R,t,E] = psth(data,sig,plt,T,err,t) % function to plot trial averaged rate smoothed by % a Gaussian kernel - visual check on stationarity % Usage: [R,t,E] = psth(data,sig,plt,T,err,t) % % Inputs: % Note that all times h...
7c5d18ec5534ef7ff6b3f06fcb0c31e3f3d88dc913d50ce3bd0ec4f0f127a362
MATLAB
5,307
160
function y = base64encode(x, eol) %BASE64ENCODE Perform base64 encoding on a string. % % BASE64ENCODE(STR, EOL) encode the given string STR. EOL is the line ending % sequence to use; it is optional and defaults to '\n' (ASCII decimal 10). % The returned encoded string is broken into lines of no more than 76 % ...
ef477d550f50e8862030c2856425353cfde12f57e3465333bb3571e13ede56c2
MATLAB
5,308
111
function spikes = ss_outliers(spikes, reps) % SS_OUTLIERS K-means based outlier detection. % SPIKES = SS_OUTLIERS(SPIKES) takes and returns a spike-sorting object % SPIKES. It identifies likely outliers in the SPIKES.WAVEFORMS and moves % them from the (initially M x N) SPIKES.WAVEFORMS matrix to a (P x N...
51c6f6aa939d5bf779a8b276d2852ea082de645f3f38ab1d446da0a585335230
MATLAB
5,309
124
%% Script for fitting the interblade distribution histogram with a Gaussian mixture model with six peaks % version 1.1 (25/07/2025) % written by Clement Verkest & Stefan G Lechner % INPUT: requires the 'result' structure generated by 'MFX_PIEZO1_ALFA_01_main_script.m' % function FitInterbladeDistrib...
02a9f55c6a50268b225f7a4ed01c97e26977fb9515b32cfbe652574d48524573
MATLAB
5,310
145
% slider() - add slider to a figure % % Usage: % >> slider( handler, horiz, vert, horizmag, vertmag); % % Inputs: % handler - figure handler (for the current figure, use gcf) % horiz - [0|1] add a horizontal slider % vert - [0|1] add a horizontal slider % horizmag - magnify the width of the figure be...
417b691d3ae480a97c1c3147c4a02308da08bf2135e033d0a6ea5cb2930b2a15
MATLAB
5,316
97
function done = ea_coregpreopmr(options) % Entry function to coregister pre-op MRI done = 0; % Set anchor image anchor = options.subj.coreg.anat.preop.(options.subj.AnchorModality); % Set moving and output image preopImage = rmfield(options.subj.preproc.anat.preop, options.subj.AnchorModality); coregImage = rmfield(...
a67912e2aa04341dd0151c48175889b2ff16dcaf37fa4f3efc93b79aa56f5c73
MATLAB
5,317
158
function [R_points, t_points, im_mask_reg, handles] =... setupCross_SessionReg(handles, im_mask, withrotation, maskdir) %%%% im_mask_reg is a transformed version of im_mask to match %%%% im_current im_current = handles.im_norm; % ops.maxIter = 150; % ops.tot = 10^-4; % ops.distTh = [2, 50]; % ops.dispreg = 0; %%%%...
61d9bd1760ad4e6dacad36c3a4425bde24cbadc5bcba312496ca2421075199f1
MATLAB
5,318
157
function y = base64encode(x, eol) %BASE64ENCODE Perform base64 encoding on a string. % % BASE64ENCODE(STR, EOL) encode the given string STR. EOL is the line ending % sequence to use; it is optional and defaults to '\n' (ASCII decimal 10). % The returned encoded string is broken into lines of no more than 76...
d6ad2ef70ddc91b735c9a1fdd9354ba8cbf93d4ca0347babe6ade337366ba187
MATLAB
5,318
142
function [] = v2structDemo1() % V2STRUCTDEMO1 is a demo function showing some examples for using the function V2STRUCT % %% Last update: % 30.06.2011, Adi N. %% fprintf(['\nRunning demo function with examples for using the function vs2truct:\n',... 'Press any key between breaks.\n']); pause() fprintf(['\n...
5656234fe288217422ca363da1784c82e3c91665d82c6c75b102db8987b57c3f
MATLAB
5,319
161
function [A, vA, vB, bb_rel] = crop_borders(A, bcol, padding, crop_amounts) %CROP_BORDERS Crop the borders of an image or stack of images % % [B, vA, vB, bb_rel] = crop_borders(A, bcol, [padding]) % %IN: % A - HxWxCxN stack of images. % bcol - Cx1 background colour vector. % padding - scalar indicating ...
f3a450a079005232f0afecb2e34dabcda691613d3fd2fb4a7d5c855b66284a3f
MATLAB
5,319
117
%% Step 1 Tiny Dancers: Load EEG and preprocess % Steps are Bandpass filtering, Bad channel rejection, ASR, % Automatic ICA, Bad channel rejection part 2 and interpolation, followed % by rereferencing to the average % Trinh Nov 22 %% initialise fieldtrip clc clear all close all addpath('D:/MUSICOM_EEG/EEG/...
c5438901126930ef102d81acd029ded8b284016f7a36e73678dda2ce841bfec0
MATLAB
5,323
133
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% process_volume_gradients_eigenmodes.m %%% %%% MATLAB script to process volume gradients and eigenmodes from HCP data. %%% In particular, the script demonstrates how to %%% (1) calculate the z-scores of the gradients, %%% (2) calculate the ...
fe76a48ae2fb6a1b822540e16e0fdce17bf1a2e63ac64c802f86477c4f7a5bcc
MATLAB
5,324
148
%% Basic Image Visualization % % Using Basic Plot Methods (plot, orthviews, and montage) to Examine a Dataset % % Objects can have methods with intuitive names, some of which overlap % with names of functions in Matlab or other toolboxes. fmri_data.plot() % is one of these. When you call plot() and pass in an fmri_data...