sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
659fbc10d1e421c199954210d4cd84f011dffc62000fb3467f62e556a272dbd2
MATLAB
4,940
139
% THIS SCRIPT RUNS lassoPCR models for WITHIN-PERSON CONTRASTS it will % exclude conditions which have contrast values of 0 and contrasts that are binary (1/-1) % % Contrasts are pecified in DAT.contrasts % % This script makes sense to run if you have contrasts that are not simple % A vs. B (1 -1) comparisons. e.g., if...
296c7dcb19ab34076ca5459ec0670d8675e5d45dd38834655c78b49ca0d8f08a
MATLAB
4,942
137
function handles = dan_data_check(handles) % Checks that the score and ar files are the same dimensions as % the data %% % Authors: Dan Denis % Date: 2021-07-14 %% % Check the sleep stages stageFields= fieldnames(handles.psg.stages); stageFields(cellfun(@isempty, regexp(stageFields, 's\d', 'match'))) = []; for...
7620e4bd55ad0fd9ebca328b5471c5857f1c821f60bed776c4a4d2a5fa7561b2
MATLAB
4,942
144
function ts = run_init_cstminput_periodic(topology,homparam,hetparam,stiminput,init) % RUN with Initial Conditions, or zero trivial conditions if init = NaN; % Input is specified by user % Periodic boundary conditions % Takes in input of model parameters, timesteps and lengthsteps. % Returns timeseries at each point. ...
bd8f696690b7e01fe20a2d0086f397e64ded5b28b36d39fa5ab8f863fd2f1fc6
MATLAB
4,944
145
function [warped]= individual2sn(P, input) % INDIVIDUAL2SN warps the input coordinates (defined as Nx3 matrix) from % individual headspace coordinates into normalised MNI coordinates, using the % (inverse of the) warp parameters defined in the structure spmparams. % % this is code inspired by nutmeg and spm: nut_mri2m...
c904d654a095856fe5f32d8d58659460c77747ea49c8cdcfcaba04918c808556
MATLAB
4,949
111
function [ROC_AUC_val roc_curve] = get_AUC(target_present_vals, target_absent_vals) % This helper function calculate the area under an ROC curve based on a vector of values % when a target was present and a vector of values when a target was absent. % % Input params: % target_present_vals: column vector of va...
fd2d3b5b2afc94e8eb19c2e86ef4ca2c2a4bb6565d11911d94e9dbc3cda3395c
MATLAB
4,954
81
% Specialized analyses for FMAToolbox. % % Firing map and curves, etc. (place cells, grid cells, head direction cells). % % FiringCurve - Compute spatial firing curve (e.g. for a head direction cell). % FiringMap - Compute spatial firing map (e.g. for a place cell). % PhaseCurve ...
d1f67332b2deeff40e2d9628851b0f4864e3ec6a97c0b5d006fd575b71591126
MATLAB
4,955
131
function f=readPrairie2(froot,cycle,label,chno,imno) % Usage ... f=readPrairie2(froot,cycle,label,chno,imno) % % PrairieView data reader % This function will read individual images if the froot name includes the % file extension. If froot ends in a slash to indicate a folder, it will % read all images within cycles, la...
3cc8a889a450ebf44f5b01f415497ae70d623d6cdb3f63af6ea965bddafb4e2d
MATLAB
4,957
119
function outdir = LaBGAScore_export_scaled_contrasts(resultsdir, conidx, outdir, varargin) % Write the second-level contrast images to disk, one .nii per subject. % % :Usage: % :: % outdir = LaBGAScore_export_scaled_contrasts(resultsdir, conidx, outdir, ...) % % WHY THIS EXISTS. The decoding wrapper points cfg.files...
191d7ec95c7a3e0c24c38734134dd6760fdbf37a442083487dc95c0edba4b71c
MATLAB
4,958
155
% Section 7.4.3: Probability bounds example with Voronoi diagram % Boyd & Vandenberghe "Convex Optimization" % Original version by Lieven Vandenberghe % Adapted for CVX by Michael Grant, 2005/12/19 % Generates figures 7.5-7.8 % The constellation points. Feel free to change them, but they must % produce a valid Voronoi...
0a62f41fddd6537ec1dd6e41580cf4347f1465284539f71196303dfd0178df92
MATLAB
4,963
83
classdef Detrender < uint8 enumeration HIGHPASS (1) % highpass filter BUTTER_HIGH (2) % butterworth highpass filter MOVMEDIAN (3) % movmedian subtraction MOVNTHPRCT (4) % movmin subtraction ...
4632f86e1acd70339cfccb5e39e120b90f166bc20aa87ef51187035a656148d4
MATLAB
4,964
140
function [dist,binned,stats] = CircularDistribution(angles,varargin) %CircularDistribution - Compute circular distribution and statistics. % % USAGE % % [dist,binned,stats] = CircularDistribution(angles,<options>) % % angles angles in radians % <options> optional list of property-value pairs (se...
ab551dac78f6644a448da4cd01e79c2ec24c0aa9408e355a452c5385633219fd
MATLAB
4,964
117
% written by Yiyuan Han, Essex BCI-NE Lab, 10/01/2020 % Multi-class classifiers for each participant %% Only remain the participants with complete data in all of 4 classes classes = ['O' 'H' 'W' 'S']; classNum = length(classes); parIndices = find((ismember(blockTagsAC(:,1),validParticipants))&(ismember(blockTa...
ac6ccda13b767be01418f92db7fc9d8e7ab514a3a053fbb424bbbae65e1efd62
MATLAB
4,964
145
function [Y0,design_names,nDesignScores] = myPLS_getY(behavMode,... behaviorData,grouping,group_names,behav_names) % Number and IDs of groups groupIDs = unique(grouping); nGroups = length(groupIDs); % Number of behavior scores nBehav = size(behaviorData,2); % Number of subjects nSubj = size(behaviorData,1); % ...
8b5778eab9094e1e98c950d5b2041a7ec146e1023318b274fc197bd96206c269
MATLAB
4,968
58
% configure file for DTI tools % BATCH system (Volkmar Glauche) % % File created by Susanne Schnell %% function dtijobs = dti_cfg %_______________________________________________________________________ % dtijobs DTI tools %_______________________________________________________________________ dtijobs = cfg_c...
f9466c6db56437a8aed996dfb424e97352f2ba67e0d1f60d560f77cfe695a4a0
MATLAB
4,970
116
% imagescloglog() - make an imagesc(0) plot with log y-axis and % x-axis values % % Usage: >> imagescloglog(times,freqs,data); % Usage: >> imagescloglog(times,freqs,data,clim,xticks,yticks,'key','val',...); % % Inputs: % times = vector of x-axis values (LOG spaced) % freqs = vector of y-axis val...
7498fc3d11c9dd9f03e2ff2300229217e68809161f33e67e7277fb3ae100acd3
MATLAB
4,972
130
function [lh_labels, rh_labels, LI_lang] = CBIG_MSHBM_Epilepsy_LI(params) % ==================================== %% Help % ==================================== % % CBIG_MSHBM_Epilepsy_LI % % Estimates an individual-specific 15-network cortical parcellation for a % patient with drug-resistant epilepsy using the NIH 34-s...
68ced3bfd24fbf5d23f6da25d2144e11f49695b0eeb7e630c656155777f7f50c
MATLAB
4,975
139
function [confC,phistd,Cerr]=coherr(C,J1,J2,err,trialave,numsp1,numsp2) % Function to compute lower and upper confidence intervals on the coherency % given the tapered fourier transforms, errchk, trialave. % % Usage: [confC,phistd,Cerr]=coherr(C,J1,J2,err,trialave,numsp1,numsp2) % Inputs: % C - coherence % ...
14e7f0487aff24bf207aff3634ac381a896f190bb208dac1a99e28e62847d4cd
MATLAB
4,978
120
% std_readtopoclust() - Compute and return cluster component scalp maps. % Automatically inverts the polarity of component scalp maps % to best match the polarity of the cluster mean scalp map. % Usage: % >> [STUDY clsstruct] = std_readtopoclust(STUDY, ALLEEG, cluste...
4500af0ca40bb6125a944e6916d3d91d474e92adb315e4b385067fdb72450fc3
MATLAB
4,979
158
% eeg_laplac() - gives the laplacian for the data contained in EEG % for the values 1:stepl:end with electrodes position gived by EEG.chanlocs. % Step must be a number betwen 1 and length(EEG.data) % The metod used for computig the laplacian is the described by Perrin et al. % 1989 using a spline interpolation betwee...
9154a0c48c01dc586e2172319da54900ce880c08024a4b73ad1be8f526a2d9cd
MATLAB
4,979
130
% dipfit_nonlinear() - perform nonlinear dipole fit on one of the components % to improve the initial dipole model. Only selected dipoles % will be fitted. % % Usage: % >> EEGOUT = dipfit_nonlinear( EEGIN, optarg) % % Inputs: % ... % % Optional inputs are specified in key/value ...
330ad0346d53e794159412eaccaf2c8829aefe480b69c9940facb879a12c32fe
MATLAB
4,984
139
% pop_eventstat() - Computes and plots statistical characteristics of an EEG event, % including the data histogram, a fitted normal distribution, % a normal ditribution fitted on trimmed data, a boxplot, and % the QQ-plot. The estimates value are printed in a panel ...
ee5c7cf43b158edef0713b08e82022e6e723a2877de082c7b3bceb66cbd1facf
MATLAB
4,990
121
function [left right] = getPFNdata(allflies,trialtypes,flies,datatype,roi_idx) % This function produces summary data structures for the left and right % halves of the PB for PFN intensity data. % Be sure to clear the values of 'left' and 'right' before running the % function. % roi_idx should be % [1,2] for ...
06af2199bfdb28439eb16a9907c0715d5a43a21c704d1d0b7352aa8d30e4cd9f
MATLAB
4,992
145
function imwrite2tif(varargin) % IMWRITE2TIF Write image to tif file with specified datatype. % IMWRITE2TIF(IMGDATA,HEADER,IMFILE,DATATYPE) exports IMGDATA with HEADER % to TIF file named IMFILE. HEADER is usally obtained by IMFINFO from % original image file, and it can also be left empty. String DATATYPE % ...
1681acce6f5ba302061052920ada4fedbf69746d4e8419acde51dff76c0ad5ce
MATLAB
4,992
165
function [fig, varargout] = draw_surface_parcellation_dull(surface_to_plot, parc, hemisphere, medial_wall, with_medial, cmap) % draw_surface_parcellation_dull.m % % Draw parcellation on surface using a defined colormap with dull plot lighting % % Inputs: surface_to_plot : surface structure with fields % ...
6145b4c151163df14fcc8fd44a9b56f4da6a0bf6723a839e405e402ee426f2aa
MATLAB
4,993
130
function ProcessFluordata(flydata,name,per) matfiles = dir('*f*.mat'); for f = 1:length(matfiles) load(matfiles(f).name) if matfiles(f).name>10 if matfiles(f).name(11)=='1' disp('yes') flydata = res1; elseif matfiles(f).name(11)=='2' flydata = res...
91ded70b0cf24f141a7850d73335628064586f4cff0490851d5ccd42ac9796b1
MATLAB
4,993
86
function [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc(data1,data2,win,params) % Multi-taper coherency, cross-spectrum and individual spectra with segmenting - continuous process % computed by segmenting two univariate time series into chunks % % Usage: % [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc...
bc7a7eb0f40d2743ca30146d2fe2b4b9f6e607e1961ceb5e3b5ea5992a100990
MATLAB
4,996
130
function [firingMaps] = bz_firingMap1D(varargin) % USAGE % [firingMaps] = bz_firingMap1D(spikes,behavior,lfp,tau) % % INPUTS % % spikes - buzcode format .cellinfo. struct with the following fields % .times % % behavior - buzcode format behavior struct % % % tau - desired smoothing window ...
77828046275c299e6bef8d829825310018c63787b2823ed16ae17a8dd688c00a
MATLAB
4,999
151
classdef ea_conda_env properties name; yml; path; python; end properties (Dependent) is_created; installed_version; latest_version; end properties (Access = private, Constant) mamba_path = ea_conda.mamba_path; end methods ...
cf25a73b81801ffb2115a3b53cbf33524a47ab00e42105eb8af154ec800e7f2d
MATLAB
5,000
171
function [y,x,g] = tab2box(Xin,Yin,Gin) %TAB2BOX Prepare tabular data for boxPlot function % % Y = IOSR.STATISTICS.TAB2BOX(XIN,YIN) prepares data, in tabular form, % for use in the BOX_PLOT function. Specifically, XIN and YIN are vectors % (for example column vectors from a results table). Y is an N-by-P % num...
67acb7778cb5c9ece25fbd66a1fcbf542a804a229a8fbb4e4e7d6589690070bb
MATLAB
5,003
148
function matrixToNSx(varargin) % matrixToNSx % % Converts a MATLAB data matrix (channels as rows, samples as columns) into % a NSx file. % % Use matrixToNSx(inputData, samplingFreq, inputUnits, savedDataPath) % % All input arguments are optional. % % inputData: data matrix (channels as rows, samples as columns...
ccaa42188b7bfeb302d4f25b80609907e12d9645a1c9ce8a4ab0ca83a2590fdb
MATLAB
5,003
137
%% LaBGAScore_pet_prep_4_apply_signatures_and_save.m % % % *USAGE* % % This script % 1) calculates selected signature responses for PET images % included in DAT, and saves them to new fields in DAT. % 2) calculates responses per NPS subregion if NPS is selected, can/should % later be expanded to all signatu...
48547853fb1f1e2ad1a927768d11d0fceaf82bcc25965d28b8aae86fde61efe3
MATLAB
5,004
142
function varargout = palm_quickperms(varargin) % Create a set of permutations that is left in the Octave/Matlab workspace % for later use, or to be exported to other programs. % % [Pset,VG] = palm_quickperms(M,EB,P,EE,ISE,CMCx,CMCp) % % Inputs (to skip an argument, use an empty array, []): % M : Design matrix. It...
aef727396be7542908d360b2269ffdeefda01fe78fa7b7c71818501d1d21f132
MATLAB
5,011
183
function [vertices, edges, colors] = u3d_pre_contourgroup(ax) %U3D_PRE_CONTOURGROUP Preprocess contour output to u3d. % % usage % [vertices, edges, colors] = U3D_PRE_CONTOURGROUP % [vertices, edges, colors] = U3D_PRE_CONTOURGROUP(ax) % % input % ax = axes object handle % % output % vertices = posit...
02338b21dacd4f069ecf9b18472ac501f1d820fe69263fb04f505eef168fd0f3
MATLAB
5,014
131
% % KTNEVComments % % This is a class that deals with comments saved in a NEV file. The user % can read the comments, get their timestamp information and even add % comments to the NEV file and then save it as a new file. % % % addComment: Allows the user to add a new comment to the % ...
d355a5fe58166aa63d486728b061f9c5aa91c0a12ea43786a8e4e100677bdf84
MATLAB
5,014
132
%%*********************************************************************** %% nzlist: find the combined list of non-zero elements %% of Aj, j = 1:k, for each k, %% assuming that the Aj's are permuted such that %% A1 has the fewest nonzero elements, followed by A2, and so on. %% %% [isspA,nzlistA,...
efa86f3ffcd796f1a3ff497969f39739bebf932e004eba65a80e0d2f7f39fc24
MATLAB
5,015
139
function splitNSxNTrode % splitNSxNTrode % % Opens and splits an NSx file based on its NTrode groups. It depends on % openCCF file. % % Use splitNSxNTrode % % This function does not take any inputs. % % Example 1: % splitNSxNTrode; % % In the example above, the user will be prompted to select a CCF file % f...
783ad076dd70a518ca57cf8d0ba31dd3f8ace643475c31f6f90bdaa4143c6b19
MATLAB
5,024
158
function session = invivoImport(varargin) % invivoImport(collectionFolder,overwrite,rat_folders,prefixes) % Takes in dacq files and creates a CMBobject out of them. % % base_path is folder containing rat folders % overwrite =1 to overwrite existing files, default is 0 % set "folders" to only look in certain...
2fc43a7160bd4d89c213808e20122985cd06038f109eac75ae4c58eb948839d0
MATLAB
5,025
143
%% Make polar wedge plots for signatures % This example shows how to load several signatures and plot their cosine % similarities with a set of resting-state networks, to interpret the % signatures in terms of networks. % %% General instructions % % Before you start, the CANlab_Core_Tools must be added to your path w...
4aa35efd5d070d8e256d9d692497b2fce4abd869315b57a7e106a102faf0756b
MATLAB
5,029
143
function anonymize_dicm(src, rst, subID) % Replace PatientName in dicom header with an ID without altering ANYTHING else. % % anonymize_dicm('sourceFolder', 'anonymizedFolder', 3) % 'sub003' as ID % % All three input argument are optional: % 1. A dicom file name or a folder containing dicom files to anonymize. % 2...
40caa594ec8323d745f23130f65513391db99a5fa0e86e0dbe3c0b6e7aafe6b0
MATLAB
5,030
121
function varargout = ea_normsettings_schoenecker(varargin) % EA_NORMSETTINGS_SCHOENECKER MATLAB code for ea_normsettings_schoenecker.fig % EA_NORMSETTINGS_SCHOENECKER, by itself, creates a new EA_NORMSETTINGS_SCHOENECKER or raises the existing % singleton*. % % H = EA_NORMSETTINGS_SCHOENECKER returns the...
0cc66e954e766229b104ae6397076bf856185d3351bc1d11ba66c12a4ac67ded
MATLAB
5,035
137
%% Align MINFLUX localisations of PIEZO trimers to a reference PIEZO trimer using the iterative closest point algorithm to generate a superparticle for presentation purposes % – Sep 11th 2024, Stefan G. Lechner (s.lechner@uke.de) – % Uses the 'AllTrimerCoord' array created by AFLA_analysis_finalOPT as the input % The ...
a6939f2319e8bdf8e44801de488f2e7393ed89780f141fca1e12a8342a4b0c5e
MATLAB
5,037
129
%extracts spikes from raw signal %applies band-pass filtering to raw signal before doing so. % %params.nrNoiseTraces: 0 if no noise should be estimated % >0 : # of noise traces to be used to estimate autocorr of % noise, returned in variable autocorr % % %params.detectionMethod: 1 ->...
ca09db2f9590fb1b840f17595ebd0b783ea3e0d5afd95686b4dd05bb22e03e39
MATLAB
5,038
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 informat...
1945783770d2c6df361ba2e4a2b9e794caf9b2b180b6784237e39dea71360456
MATLAB
5,039
170
function CBIG_pMFM_step2_STDFCD_permutation_correlation_desikan() % This function is the second step of the permutation test of SWSTD-FCD % correlation. In this step, 10000 permuted SWSTD FCD correlation will be % generated and store for further use. % % Written by Kong Xiaolu and CBIG under MIT license: https://gith...
ea0faf9b296416a04c7139eecd7cc508b55cada165172d93912adf60c78d1a1a
MATLAB
5,041
164
%%********************************************************************* %% gdcomp: Compute gd = 1/td in Equation (15) 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 Programm...
2b7c84d8256b5943f8f093f937da430803533459d4366f1d88f5e2b837cfb694
MATLAB
5,042
143
% bz_CCH_CONV predictor and p-values for CCH using convolution % % CALL [ PVALS, PRED, QVALS ] = CCH_CONV( CCH, W ) % % GETS CCH vector (a single CCH) or matrix (CCHs in columns) % has to be non-negative integer...
9619f2be6131a293a3e0c3444bbbd86dc21ec0f1e56ed4595e8e4b3536404f23
MATLAB
5,043
136
% eeg_insertbound() - insert boundary event in an EEG event structure. % % Usage: % >> [eventout indnew] = eeg_insertbound( eventin, pnts, ... % abslatency, duration); % Required Inputs: % eventin - EEGLAB event structure (EEG.event) % pnts - data points...
4db5273361b32ca1ab222a59f7fdea3895076fe9734a7159b9de2a7118b0f031
MATLAB
5,044
146
%PCI State Transitions (Comolatti et al, Brain Stimulation 2019) % %function [pci,dNST,parameters]=PCIst(signal_evk,times,parameters) % %Please cite this paper if you use this code: %Comolatti R et al., "A fast and general method to empirically estimate the %complexity of brain responses to transcranial and intracrania...
aa55fde97993d8b1883d672536019268fe792e69f316ef97cfabbe2189393c6e
MATLAB
5,045
134
function varargout = ea_methodsdisp(varargin) % EA_METHODSDISP MATLAB code for ea_methodsdisp.fig % This will show the method window. % Requires a c formatted string (printf) as input, within a cell array % String passed requires to be terminated with '\n' % Text before the 5th character will be ignored % Example: {'\n...
88a9bd0f7f2a7702ca130a101f4ac7645e9358010808bb2da1d076bc45d259d4
MATLAB
5,046
142
%%% Figure 1C: behavior result example ccc; %% Load behavior data temp = dir("..\MAT Data\pre\**\cc20220520\Behavior.mat"); data = load(fullfile(temp.folder, temp.name)); mu.parsestruct(data); %% Plot settings colors = {[35 71 153], [244 179 179], [240 133 25], [233 90 111], [230 33 41]}; colors = cellfun(@(x) x / 2...
2aa8134a19e755d0dbac1f03119cb57f9e3a54850319ddedf02e09709571d91d
MATLAB
5,051
110
function utrackPackPaths = getUtrackPackPaths(qfsmPackPaths) %GETUTRACKPACKPATHS returns the corresponding paths to results of u-track analysis of single-molecules movies for each FSM movie path % %SYNOPSIS: utrackPackPaths = getUtrackPackPaths(qfsmPackPaths) % %INPUT qfsmPackPaths: (n x 1 cell array) containing p...
6f87789a71bfc8918b9c07282e4cee1e8246545c11491dfc3ca0560b548466ae
MATLAB
5,051
141
% Maximize stopband attenuation of a lowpass IIR filter % "Linear Programming Design of IIR Digital Filters with Arbitrary % Magnitude Functions" by L.R. Rabiner, N.Y. Graham, and H.D. Helms % (figures are generated) % % Designs a lowpass IIR filter using spectral factorization method where we: % - minimize maximum st...
14f921b087596876001319ec225ae575907b302091b8a66f829fb8351f39c391
MATLAB
5,052
160
function [tau, curve, info] = ami_histogram(x, L, opts) %AMI_HISTOGRAM Average mutual information versus lag, histogram estimator. % TAU = AMI_HISTOGRAM(X,L) returns the lag of the first local minimum of % the average mutual information of X with itself over lags 0:L, using an % equal-width joint histogram. % % ...
fe62b8581d9d08a39abfbfaec2622f7c3dbda4f28fe16b721ebab3235b086cb3
MATLAB
5,056
156
function draw = draw_funcs draw.maE= @maE; draw.revise=@revise; draw.single = @single; draw.binary = @binary; draw.multi = @multi; draw.xozline=@xozline; draw.hor_ver=@hor_ver; draw.mesh = @mesh; end function [Ex,Ey,Emax] = maE(x1,x2,y1,y2,E) Emax = 0; for i =...
60f39a38002687d949c5f45095113bfb694abe9256c6a59ab4a99b7c7109e77f
MATLAB
5,058
185
% Figures 6.11-6.14: Total variation reconstruction % Section 6.3.3 % Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX Argyris Zymnis - 10/2005 % % Suppose we have a signal x, which is mostly smooth, but has several % rapid variations (or jumps). If we apply quadratic smooth...
f3e2fcbd50656f75a3f1538c6ff81d067dcb4532d08a57e6bc65761cd4e51ea8
MATLAB
5,061
173
function [str,cur_line] = struct2str(s,units,max_width,max_struct_elem, ident_str,total_ident_len,str,cur_line) % % AF 11/6/01 if (exist('units','var') ~= 1) units = struct([]); end if (exist('max_width','var') ~= 1) max_width = Inf; end if (exist('max_struct_elem','var') ~= 1) max_struct_elem =...
98eb13f571d77380f470f5d235d8c0a104f9e64b050c567a2016a07c117519ac
MATLAB
5,062
158
function myOISscr2g(fname,nk,idname) % Usage ... myOISscr2g(fname,nk,idname) % % This function writes masks onto pre-processed mat files to % define ROIs for further analysis % Setting a value of nk furhter defines ROIs using k-clustering % If nk is replaced with fname2, masks are remapped % % Ex. myOISscr2g(''...
0cd6573e847db73eb7fcd38a026222be6cc68befd32f154d736a30b375302100
MATLAB
5,065
175
% FDLA and FMMC solutions for a 50-node, 200-edge graph % S. Boyd, et. al., "Convex Optimization of Graph Laplacian Eigenvalues" % ICM'06 talk examples (www.stanford.edu/~boyd/cvx_opt_graph_lapl_eigs.html) % Written for CVX by Almir Mutapcic 08/29/06 % (figures are generated) % % In this example we consider a graph des...
dd4491fdd02d18f14ec8afb0d302c509e8aac9aff590f5bd4941687c12551c4f
MATLAB
5,066
86
function [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc(data1,data2,win,params) % Multi-taper coherency, cross-spectrum and individual spectra with segmenting - continuous process % computed by segmenting two univariate time series into chunks % % Usage: % [C,phi,S12,S1,S2,f,confC,phistd,Cerr]=coherencysegc...
442286c5337a201848d358d16eeb61ec92d6aed8ce68e2d5f0529febdbdf466f
MATLAB
5,067
170
function CBIG_pMFM_step2_STDFCD_permutation_correlation() % This function is the second step of the permutation test of SWSTD-FCD % correlation. In this step, 10000 permuted SWSTD FCD correlation will be % generated and store for further use. % % Written by Kong Xiaolu and CBIG under MIT license: https://github.com/T...
93d34723e545f18aeb700d935297c4c5dcb92f89bcb05a157579218967c59066
MATLAB
5,069
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 % a ...
367c7c43f0e1b3f4e563de651fcf2eb0ae656e65c4f7c25e843884e666cc9754
MATLAB
5,072
153
function A = catstruct(varargin) % CATSTRUCT Concatenate or merge structures with different fieldnames % X = CATSTRUCT(S1,S2,S3,...) merges the structures S1, S2, S3 ... % into one new structure X. X contains all fields present in the various % structures. An example: % % A.name = 'Me' ; % B.inco...
5af040e8ef24542edd25ece16fe423c5026daaf07e440f2b30b1cec50aa0c39d
MATLAB
5,073
213
%% Batch script to run Constrained NeuroMark ICA on SBM (or PET) % using external template % Enter the values for the variables required for the ICA analysis. % Variables are on the left and the values are on the right. % Characters must be enterd in single quotes % % After entering the parameters, use icatb_batch_fil...
b46a6c79ff6205925399c48f1567170b36a728661de393758e57865488683345
MATLAB
5,074
161
%% New features in MatlabBGL version 3.0 % Although MatlabBGL 3.0 was never officially released, here are some of % it's key features. %% Better performance % We redid the backend interface to the BGL routines. This optimization % gave a considerable performance increase. %% % test_benchmark on MatlabBGL 2.1 % % 20...
fca40f0d71d441baa613420f192d9f4080f7052884f8b1988c5bf06f65f97084
MATLAB
5,076
156
function Ihat=ea_ihat_databaselookup_netmap(obj,vals,connval,patientsel,test,training,usemask) % set up the fingerprint to predict and the variable of interest fp_topredict=connval(patientsel(test),usemask)'; I_test=obj.responsevar(patientsel(test)); vizz=0; % visualisation of sharpening. 0 = turned off, 1 = turned...
56a53999043ad40b09c04bf085a97a858d64219abeca2f0f52a9778b73bfb8aa
MATLAB
5,079
161
classdef GridFlex < uix.GridFlex %uiextras.GridFlex Container with contents arranged in a resizable grid % % obj = uiextras.GridFlex() creates a new new grid layout with % draggable dividers between elements. The number of rows and columns % to use is determined from the number of elements in...
6c1962615adb98496aa681262d247d6a16c02a77208945c2a5b17d1c2324d7b4
MATLAB
5,079
146
% pop_signalstat() - Computes and plots statistical characteristics of a signal, % including the data histogram, a fitted normal distribution, % a normal ditribution fitted on trimmed data, a boxplot, and % the QQ-plot. The estimates value are printed in a panel ...
970df4f66d1be3820fb657c7d442bf82f3c8947c9031359dd48fc145d1635fc0
MATLAB
5,080
145
% written by Yiyuan Han, Essex BCI-NE Lab, 13/12/2019 % binary classification between two specific conditions function perfMat = binaryClassTest(class1,class2,blockTagsAC,features,folderpath,nameTag) %% Extract the data in specific conditions % These two classes should be modified according to each requirement indices...
a4bcbbbaec7128276647b4175cf2252e8abf8cb6db02d58b5a1a17c028ae235d
MATLAB
5,081
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 have ...
eed0465429a929ae7ad7374163f9c834d4023e9ad01c86ba30b8d112852429e7
MATLAB
5,081
135
clear; clc; close all; addpath(genpath('../functions/')); SUBINFO_FILE = '../../subInfo/rid_sex_mDoB_yDoB_mExam_yExam_ageExam_dx_icv_bl.csv'; GMICV_FILE = '../../vbm_810bl/gmVolAndICV/rid_gmVol_icv_bl.csv'; %% Subjects % All these info is baseline info [RID_dx, ~, ~, ~, ~, ~] = get_data(SUBINFO_FILE, GMICV_FILE, 2)...
f6cc8cbf5ccd2d20ac374e792d30766579fb496ce381ba77d1a34171fad57ef9
MATLAB
5,081
129
function ea_fnirt(varargin) % Wrapper for FSL FNIRT nonlinear registration fixedimage = varargin{1}; movingimage = varargin{2}; outputimage = varargin{3}; % Set output dir volumedir = [fileparts(ea_niifileparts(outputimage)), filesep]; % Do linear registration first, generate the affine matrix 'fslaffine*.mat' movPa...
6a008e989b3174d188de51e6b1cf0cff92688b7fff899ed0bf71b8cc2553c305
MATLAB
5,085
134
function data = TDTdigitalfilter(data, STREAM, FC, varargin) %TDTDIGITALFILTER applies a digital filter to continuous data % data = TDTdigitalfilter(DATA, STREAM, FC, 'parameter', 'value', ... ), % where DATA is the output of TDTbin2mat, STREAM is the name of the % stream store to filter, FC is the cutoff fr...
0c15330c15133c116acab3865a465bc702d80dbd66efd757d052bef016f98bb2
MATLAB
5,086
131
function f=readPrairie2(froot,cycle,label,chno,imno) % Usage ... f=readPrairie2(froot,cycle,label,chno,imno) % % PrairieView data reader % This function will read individual images if the froot name includes the % file extension. If froot ends in a slash to indicate a folder, it will % read all images within cycl...
148da6cb60b6f35a4287a8d25348cd3b7853e455abd834cce5c4b49e20140f3f
MATLAB
5,086
151
function [dv, corrval, regdata] = registration_offsets_modified(data, ops, removeMean) % modified by Yiyi Yu %% Parameters [ly, lx, nFrames] = size(data); refImg = ops.mimg; subpixel = getOr(ops, {'subPixel' 'SubPixel'}, 1); % subpixel factor usFac = getOr(ops, 'registrationUpsample', 1); % factor to upsample phaseCor...
49160ad77895d6c0286b00d6c6a1c59b1dcc34170bf233d3ce3ee073dc15b42f
MATLAB
5,088
188
function test_main %% Implement a test suite for matlab_bgl % Call this function to test the MatlabBGL package. %% Setup some parameters msgid = 'matlab_bgl:test_main'; %% fprintf('testing trivial input...\n'); test_trivial %% fprintf('testing code examples...\n'); test_examples %% fprintf('testing old test scrip...
58a844d8d2f83c004a065019a45fc33fc171f1bc63b4dc8795fdc30f0a2f1b78
MATLAB
5,088
134
% eeg_matchchans() - find closest channels in a larger EEGLAB chanlocs structure % to channels in a smaller chanlocs structure % Usage: % >> [selchans,distances,selocs] = eeg_matchchans(BIGlocs,smalllocs,'noplot'); % Inputs: % BIGlocs - larger (or equal-sized) EEG.chanlocs structur...
2a586778fa1f2011f7be596e1634fe2676d8981ec80ee153879e078548a9a68a
MATLAB
5,090
139
function segmentLocMaxWrapper(movieData, varargin) %DETECTMOVIETHRESHLOCMAX compiles detection data from movie frames %% ----------- Input ----------- %% %Check input ip = inputParser; ip.CaseSensitive = false; ip.addRequired('movieData', @(x) isa(x,'MovieData')); ip.addOptional('paramsIn',[], @isstruct); ip.parse(mo...
747bdb31c95f70834f4ef15fe853dd88f9b5cceaac5f8977886bbd11a333e4b7
MATLAB
5,092
144
function [regularizer_global,Theta_global,Theta_mean]=... inf_regularization_based_inference(~,F,t,ID,U,F_prime,X,mesh,... k,o_keep_all_trajectory,o_force_constraint,constraint_algorithm,... o_use_initial_guess,nCores,rep,magnitude) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamica...
5ff9a4bc18966b92133594d0c47c54fb39eb814aaca9347fceeb00afc7f508b4
MATLAB
5,093
121
function PSTH = calc_PSTH(event,spikes,varargin) % This is a generalized way for creating a PSTH for units for various events % % INPUTS % event : event times formatted according to the Cell Explorer's convention % spikes : spikes formatted according to the Cell Explorer's convention % % OUTPUT % psth % % Dependenc...
e4a1af3c902e171c76cb8cb3d93e8e8e1402c2eb89a14ee77a24ee33b0e524b7
MATLAB
5,094
173
% sobi() - Second Order Blind Identification (SOBI) by joint diagonalization of % correlation matrices. THIS CODE ASSUMES TEMPORALLY CORRELATED SIGNALS, % and uses correlations across times in performing the signal separation. % Thus, estimated time delayed covariance matrices must be nonsi...
058c6c88a64a27863247e10e9ff902aa0fb0abb56f2d9e5e50646f0c98510097
MATLAB
5,095
156
function plotCondColocPvalues(savePlot,valueRange,fileToLoad,saveResPath) %PLOTCONDCOLOCPVALUES plots the pvalues from condColocStatTest for each colocalization measure on heatmap % %Synopsis: plotCondColocPvalues(savePlot,valueRange) % Function takes the output of condColocStatTest and plots the biggest % pvalue among...
c994adaa62bb17305094baddd7dc970bbd2ceebf33319fdbb3bda54e3f98b7fa
MATLAB
5,095
135
%% Script to get the variance decomposition for bmrk4 based on overall aversion pattern and modality-specific patterns clear all close all clc load bmrk4_pain_specific_PTV_overall.mat load bmrk4_taste_specific_PTV_overall.mat load bmrk4_vision_specific_PTV_overall.mat % PTV = pain, taste, vision (observed pain). Run...
f9a23f1a4f3d32b64a5f36da7cfaa15db40d6726bab0a2118b739509b85b7901
MATLAB
5,099
132
function [A, strucCorr_score, B, U, V, R, Rp, pVal, Ncca] = CBIG_ASDf_CCA_factorBehavior(ind_scores,... id_keep, reg, PAPset, path_subInfo, path_behav_scores, path_factorLoading, factor_order,... factor_idx) % [A, strucCorr_score, B, U, V, R, Rp, pVal, Ncca] = % CBIG_ASDf_CCA_factorBehavior(ind_scores, id_keep,...
9962fdf47b712910f9bd9c1b3be7ec7073af4d3efcf35f0ee421758645301e82
MATLAB
5,100
176
function Process_ConvertOptitrack2Pos(fbasename,varargin) % USAGE % % Process_ConvertOptitrack2Pos(fbasename,varargin) % % % % fbasename basename of the video file (should be filebasenmae.avi) % <options> optional list of property-value pairs (see table below) % % ==============================...
1ec34d58f1eb5bce2bb5b9d8b66eaff19a68f470b520a58a1cb73d745d0f291b
MATLAB
5,101
113
function [corr_brainMap, corr_factorComp] = CBIG_ASDf_factorHierarchy(k, inputDir, r_k, r_kplus) % [corr_brainMap, corr_factorComp] = CBIG_ASDf_factorHierarchy(k, inputDir, r_k, r_kplus) % % This function quantifies the nested hierarchy of factors in terms of both % E(RSFC patterns|Factor) and Pr(Factor|Participant)....
ee72cbcd75ccba90f640416681e8e8862c36dfcab97331da3c4ebfe68a85d49c
MATLAB
5,101
206
function [mr,b0idx,finames] = ea_build_DTD(bvalue,dirname,dtif,DTDf,HARDIf,bvalf,bvecf) % converts the dti.nii and dti.bval/.bvec files to Freiburg DTD and raw % HARDI-formats. V=spm_vol([dirname,dtif]); for fi=1:length(V) finames{fi}=[dirname,dtif,',',num2str(fi)]; end %% change into mrstruct format mr = ...
3b71e89bae6ee34c38c6f8a9130180c369412bbc6887f3e94d4587a8b9374f06
MATLAB
5,108
146
% acsobiro() - A. Chickocki's robust Second-Order Blind Identification (SOBI) % by joint diagonalization of the time-delayed covariance matrices. % NOTE: THIS CODE ASSUMES TEMPORALLY CORRELATED SIGNALS. % Thus, the estimated time-delayed covariance matrices % for a...
2749bbbb90d1284dafedd91f5b55361babb488671f15d6f48ee1a5d974c14f8a
MATLAB
5,109
127
%% 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('E:/MUSICOM_TinyDanc...
f4836f408b3d2f17a5f92acfb72eaa09004a90fb728349420509eafcccf51096
MATLAB
5,109
142
function [vertices, faces] = freesurfer_read_surf(fname) % freesurfer_read_surf - FreeSurfer I/O function to read a surface file % % [vertices, faces] = freesurfer_read_surf(fname) % % Reads the vertex coordinates (mm) and face lists from a surface file. % % Surface files are stored as either triangulations or quad...
8ebc5a165cbe9531747ecef9e2cc545aba2ae9742ddf376d94efd03cb7ec4f55
MATLAB
5,110
150
function DBAddFigure(f,eid,name,comments,parameters,mfiles,varargin) %DBAddFigure - Save figure in current database. % % Save figure as MATLAB fig and PNG image. Also save code used to generate it % (although not required, installing <a href="http://sites.google.com/site/oliverwoodford/software/export_fig">export_fig<...
79395ea6a72f14cffbec4802d839f2180e0f88e3f5414b6f61c2ba7c20467134
MATLAB
5,113
150
% 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...
34ba92a01a99d33c41b2d3381dedbd618a5a02ebfaaca17e8b0172ea8db104ab
MATLAB
5,114
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 tree into a ...
9afc41eeecaab11297592fdf7b856b3a11d733d267b24d16f84f454d604b04e7
MATLAB
5,118
133
% std_maketrialinfo() - create trial information structure using the % .epoch structure of EEGLAB datasets % % Usage: % >> STUDY = std_maketrialinfo(STUDY, ALLEEG); % % Inputs: % STUDY - EEGLAB STUDY set % ALLEEG - vector of the EEG datasets included in the STUDY structure % % ...
76a29f5ec060d89348a665888f6493c192e72f0fde5521a924421d1b3f9d97a3
MATLAB
5,120
174
% Example 6.9: Bounding consumer preference % Section 6.5.5, Figures 6.25-6.26 % Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX Argyris Zymnis - 11/30/2005 % % We are given a set of consumer preference data for bundles % of two goods x_1 and x_2. These points are generated...
5ff5b0fd6f94e9048e724444cce2f9ca81cd1e165602e4b20bd1ccd68919d86a
MATLAB
5,124
118
function OUT = run_glm_beta_resampling_epoched(E, iter_blocks, n_iter, bad_channels, concat_baseline_sec) %RUN_GLM_BETA_RESAMPLING_EPOCHED Resample GLM betas from pre-epoched Hb. % % OUT = RUN_GLM_BETA_RESAMPLING_EPOCHED(E, iter_blocks, n_iter, bad_channels, concat_baseline_sec) % % Purpose % ------- % Esti...
a90b30236f2a0ecdadb0496e2870c6e547650e1a5081ab53ccbabcb9f906c88e
MATLAB
5,127
125
% Bayesian model used for parameter recovery simulation clear; clc; %% Setup % task data location path_root = getenv('DECIDENET_PATH'); path_beh = fullfile(path_root, 'data/main_fmri_study/sourcedata/behavioral'); path_out = fullfile(path_root, 'data/main_fmri_study/derivatives/jags'); path_resp_artif = fullfile(path_...
7698dd76819192298156122eb0ec88abaf41fc4488b89761b6031a482a74fb22
MATLAB
5,128
148
function T=Mesh2Tetra(V,F,options) % This function MESH2TETRA converts a triangulated surface mesh into a % tetrahedron volume mesh. % % Main advantage above existing constrained 3D Delaunay is that it % will never add new boundary points, (usefull for active appearance models) % Disadvantage, some highly non...
2ac6018ee473d00ffd9e3174d323aa38d13f77b61e83dff8178b2a24a667ba9e
MATLAB
5,130
118
function [likelihood, results, label, params, tau] = CBIG_hMRF_adapt_c(params, label, i, full_corr_mat, lh_mask,... rh_mask, avg_mesh, Smooth_cost, tau, Neighborhood_lh, Neighborhood_rh, Neighborhood_lh_rh) % [likelihood, results, label, params, tau] = CBIG_hMRF_adapt_c(params, label, i, full_corr_mat, lh_mask,.....
4618a83971bfb8bd987dc7653f1a07111cfecca75b5ae0383aa735acf67154f2
MATLAB
5,131
159
%% 1. Create strings listing where the toolbox and the tutoral data directories are and add the toolbox to Matlab's path toolbox_dir = '../../ndt.1.0.0/'; raster_file_directory_name = 'Zhang_Desimone_7objects_raster_data/'; addpath(toolbox_dir) add_ndt_paths_and_init_rand_generator %% 2. Bin the data usi...
a4317108ed5275a1cf7d867f7a3c1704527df8e98127960ef37c74074a55161f
MATLAB
5,131
109
% This version was derived from the original version by Pestilli and Caiafa. % Copyright (2015), Franco Pestilli (Indiana Univ.) - Cesar F. Caiafa (CONICET) % email: pestillifranco@gmail.com and ccaiafa@gmail.com % https://github.com/francopestilli/life available under % https://github.com/francopestilli/life/blob/mast...