sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
0bc45047cf1f1144963651292224732bcf693f5b15e8b734eb1175f151e06539
MATLAB
6,695
172
function append_pdfs(varargin) %APPEND_PDFS Appends/concatenates multiple PDF files % % Usage example: % append_pdfs(outputFilename, inputFilename1, inputFilename2, ...) % append_pdfs(outputFilename, inputFilenames_list{:}) % append_pdfs(outputFilename, inputFilenames_cell_or_string_array) % append_pdfs ...
9bfb3cbf97dd2ff30e29a899fca8bf65bd26d02b361747b52a2cd9b0ef8bd9d3
MATLAB
6,699
178
function homo_with_weight = CBIG_ParcellationHomogeneity_FS_meantimecourse(lh_labels,rh_labels,mesh,... lh_input_filename,rh_input_filename) % This modified version computes per-parcel homogeneity as the mean of % correlation between the parcel's average time course and each vertex's % time course in that parcel...
53e1168e532e3163da88f6f92650bb23268305c88fdc7e22a7d723ab8dafdc79
MATLAB
6,700
173
function varargout = pdftops(cmd) %PDFTOPS Calls a local pdftops executable with the input command % % Example: % [status result] = pdftops(cmd) % % Attempts to locate a pdftops executable, finally asking the user to % specify the directory pdftops was installed into. The resulting path is % stored for futur...
a720bcf81481b6b53e8be989d73062d6c8eec668f4ff1c6fd3eb141c036d5890
MATLAB
6,709
215
%% Prepare data files % BLOCK 1 % --------------------------------------------------------------- % Establish that images are on path % if not, you'll get an empty variable basedir basedir = fileparts(which('con_00810001.img')); % Load behavioral data % "Reappraisal success", one score per person, in our example b...
2ce3f8abfc0e2fec187ea42c0036f93efb2615264df8f790f4dc7c10f7c1e45b
MATLAB
6,712
166
% loadtxt() - load ascii text file into numeric or cell arrays % % Usage: % >> array = loadtxt( filename, 'key', 'val' ...); % % Inputs: % filename - name of the input file % % Optional inputs % 'skipline' - number of lines to skip {default:0}. If this number is % negative the program will only sk...
c9e1ebd69bc41c43c6647fd8572f8b532924eed0384754eac1fcee1ffa8b76c8
MATLAB
6,712
201
% openbdf() - Opens an BDF File (European Data Format for Biosignals) in MATLAB (R) % % Usage: % >> EDF=openedf(FILENAME) % % Note: About EDF -> www.biosemi.com/faq/file_format.htm % % Author: Alois Schloegl, 5.Nov.1998 % % See also: readedf() % Copyright (C) 1997-1998 by Alois Schloegl % a.schloegl@ieee.org % Ver ...
a8ac2629d41d054e73463b6059edc5a878bc26751754c4cee7c721082bd721b5
MATLAB
6,715
162
% Name: Robert Kim % Date: 03-10-2024 % Email: robert.f.kim@gmail.com % S15_16.m % Description: Script to compare number of trials and 1-modality DMS performance % b/w one-layer and two-layer models. Used for Supplementary Figure 15. clear; clc; %% Directories % Put the directory containing helper functions here. co...
079143164b26551f8d80b0be690d453fb87734c38572f8c95ffbe8f3536be292
MATLAB
6,723
171
% eeg_regepochs() - Convert a continuous dataset into consecutive epochs of % a specified regular length by adding dummy events of type % and epoch the data around these events. Alternatively % only insert events for extracting these epochs. % Ma...
bdb2f4efbcdf909f51af578a2794c00270a46e26303de3a4cda82ab9c0ce07cc
MATLAB
6,726
143
%% Efficient subpixel image registration by cross-correlation. % Registers two images (2-D rigid translation) within a fraction % of a pixel specified by the user. Instead of computing a zero-padded FFT % (fast Fourier transform), this code uses selective upsampling by a % matrix-multiply DFT (discrete FT) to d...
5640a67f01270953dfc4d1118e34b36282e42c82687f69329ad874b40f035b9e
MATLAB
6,729
165
function p_behavior = CBIG_ASDf_clusterBehavAssoc_wrapper(outputDir) % p_behavior = CBIG_ASDf_clusterBehavAssoc_wrapper(outputDir) % % Wrapper function to perform 4 sets of behavioral analyses (only those significant in % factor behavioral analyses) on k-means clusters for comparison to behavioral associations in f...
844d83ac863ac729551d326cc92b9c92385091affe5f87f2480ed666b4f7108c
MATLAB
6,730
253
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color addpath('/Users/guofanhua/Desktop/gfh/tools/MatlabTools/BrainConnectivityToolbox/2019_03_03_BCT') addpath('/Users/guofanhua/Desktop/gfh/work/experiment/ASL_Mesoscopic2025/reference/2019PNAS_FCSC/code') addpath('/Users/guofanhua/De...
be16ffdec8745ea65c19591cac6208486b2f20b6e55a27276498c3458e52cf87
MATLAB
6,730
180
function Save_SingleData_bin(handles, f_wait, ifhold) if nargin == 1 f_wait = waitbar(0.2,'Saving'); end if nargin < 3 ifhold = 1; end moviedir = fullfile(handles.filepath, handles.filename); im_norm = handles.im_norm; Feature_parameters = handles.defaultPara; Feature_parameters.BitsPerSample = handles.BitsPerS...
2a3ca9c5f72821cbe0504df62b87edc6be502c8a8393271f797348a12a868dd1
MATLAB
6,732
98
% +IOSR % % Contents file for +IOSR and its subfolders. % % +IOSR % iosr.install - Set search paths, and download and install dependencies % % +IOSR/+ACOUSTICS % iosr.acoustics.irStats - Calculate RT, DRR, Cte, and EDT for impulse response file % iosr.acoustics.r...
7dce0b6d47057ca15f12c938bc125bae5c11192ce325412997b60cd4358fb3c2
MATLAB
6,734
190
function ts = run_absorbing(topology,homparam,hetparam,stim) % RUN with ZERO TRIVIAL CONDITIONS: phi(r,0) = phi_t(r,0) = 0; % Absorbing boundary conditions - by adding absorbing layer over Omega % Layer has width L/2, and has effective gain ranging from nu0 to 0 % Takes in input of model parameters, timesteps and leng...
a848193a196cdf828a0dcfcecea3f454b339089b168499349617cf27457f6403
MATLAB
6,738
149
function [roll_out] = ea_diode_manual_main(options) %% Determine Orientation for BSCI directed leads from postoperative CT % has an unsupervised and a supervised version if strcmp(options.subj.postopModality, 'MRI') % check for electrode type and postoperative imaging msg = sprintf(['Rotation detection works only...
db796af2452e89c07d9bf4ea99277859ccaf142828b7cb5ce44691ab07b5a1bc
MATLAB
6,738
174
%WAVE_SIGNIF Significance testing for the 1D Wavelet transform WAVELET % % [SIGNIF,FFT_THEOR] = ... % wave_signif(Y,DT,SCALE,SIGTEST,LAG1,SIGLVL,DOF,MOTHER,PARAM) % % INPUTS: % % Y = the time series, or, the VARIANCE of the time series. % (If this is a single number, it is assumed to be the va...
c4fd6085f6f920f05edd0445574c07a0865f4d597ef3a8a6c113338673972416
MATLAB
6,741
197
function [fitresult, figtitle, fmodel, xx, value_g] =... FitstampResp_v2(trace_stamp, framestamp, stampsel, stampinfo,... glist_all,varsel,... fmodel_input, fmodel_Independent,fmodel_startpoint,... funcsel, xvalue, handles, ttlabel, figiniID, datatitle) N = size(trace_stamp,2); stampinfo_t = table2arra...
b08fe42830f9a2bad5c5fe6f361d7ec717994c60aa5d591a3464fabb6ebd92f2
MATLAB
6,743
172
%% symbolicdata2states - converts data to states using ranking symbols % Converts raw data to states using rankings of data values, similar to the % symbolic entropy techniques applied in Staniek and Lehnertz, PRL 100, % 2008, 158101. Note, wordstates will reduce the total number of time bins. % Trial based data will b...
a7479c6b4a37134604c238c001a9c82ac500ec59029fb2d1249e7baf14c616af
MATLAB
6,747
237
function [EigenVal, eigVect, M_error, sqErr, kurtParams, kurtTensor] = do_calculation(DEscheme, singleSliceDWI_set, matrix,threshold,kurto) if exist('kurto') ~= 1 kurto = false; end; if length(size(DEscheme)) == 2, for k = 1:size(DEscheme,1), B_tensor(:,:,k) = DEscheme(k,:)'*DEscheme(k,:); end; e...
51771c6cd902634d7c38bbe81e8ff33103ee10c1b47f04d388666e40c7ec303d
MATLAB
6,755
237
function [ cvx_optval, success ] = quad_form( x, Q, v, w ) %QUAD_FORM Internal cvx version. % % Check sizes and types % narginchk(2,4); tol = 16 * eps; tolLDL = 4 * eps; if nargin < 4, w = 0; if nargin < 3, v = 0; end end sx = size( x ); if length( sx ) ~= 2 || all( sx ~= 1 ), error( 'The f...
870a77122a84dce95d8952eda5aa86764a12ae14e2d2bb43599f2eb029e63163
MATLAB
6,766
156
% % This is a calling routine to test & check out the power spectrum & % spectrogram routines for unequal segment lengths. In addition, use it % to compare with Chronux routines when segments are of equal length. % clear all; gram = 0 ; % 0=spectra, 1=coherence chronux = 0; % 1=compare, 0=don't line = 0; ...
1df3a432f83754c4789b6b64b22e3381dc872f3cdc2de948f4819ff141d8fd48
MATLAB
6,767
124
%Single Unit Data Analysis %% Generate Binary Files for Kilosort %See Kilosort Protocol in google drive for info about workflow and how to %install kilosort - some information may be out of date. %LV used Kilosort 2.5 for all analysis, others in the lab may have tested %later versions. %Manually decide what...
099b45388489e844436ff74383fc7186df0ec74276eb05b68d4cb4a094b4f045
MATLAB
6,770
165
function ea_showisovolume(resultfig,elstruct,options) % __________________________________________________________________________________ % Copyright (C) 2015 Charite University Medicine Berlin, Movement Disorders Unit % Andreas Horn set(0,'CurrentFigure',resultfig); isobar=getappdata(resultfig,'isobar'); if isempty...
cf4bafaaacb0a4a7a1e196bb27b6cbeaf8ac2b99a7ba618966469083000c042d
MATLAB
6,771
230
function motionGrid = stepGenerator(sampleNum,sampleStep,mode,dMatrix,orient,holeDepth) % Mode: 1 - cylinder % 2 - Flat circle % 3 - Triangular prism % 4 - Cube % % -- Debug -- % sampleNum = 11; % sampleStep = 0.08; % mode = 3; % dMatrix = [1,1.2,1; % 1,0.2,3; % 1,0.1,...
ae4227e4a744b5be51859b9ba6962ccb407bdf29ee2932fa31bd800f6a7429d4
MATLAB
6,774
195
% anova2rm_cell() - compute F-values in cell array using repeated measure % ANOVA. % % Usage: % >> [FC FR FI dfc dfr dfi] = anova2rm_cell( data ); % % Inputs: % data = data consisting of PAIRED arrays to be compared. The last % dimension of the data array is used to comput...
3d44cd6b25ef28fbe47d97aae29f8654d6ef4132422b0d8c9ae826c565532269
MATLAB
6,778
113
%%Post Processing - LFP Data %Once data is pre-processed for all animals, channel assignments have been %manually checked and input into a spreadsheet, and start and end times of %desired analysis windows have been set (excluding any obvious issues or %artifacts that occurred on recording day) - these next steps...
b9c6216f1c93f1457dfe18f965a2b121f91f0803c8e159060e59305c13d3c154
MATLAB
6,778
195
%% RUN_GLM_STEP (group orchestrator version) % Uses pipeline.run_group_glm (which calls pipeline.run_subject_glm) to: % - preprocess + GLM per subject (HbO/HbR and ΔOD optional) % - collect per-subject arrays % - save the same files your previous script produced % % Outputs to SAVE_DIR: % <DATE>_GLM_Betas...
ef22f313cc1024e2288596f4cdf63d5ac97ae9dbbf59de763ff33c3575e7395c
MATLAB
6,778
260
% Collapse multiple single-scan NIFTI files into a multiple-scan NIFTI file % % Usage: collapse_nii_scan(scan_file_pattern, [collapsed_fileprefix], [scan_file_folder]) % % Here, scan_file_pattern should look like: 'myscan_0*.img' % If collapsed_fileprefix is omit, 'multi_scan' will be used % If scan_file_folder is...
b64c96501513e9bf1f0c54c060cb37e44dcf8b0b293c89bf291cd0880fc88704
MATLAB
6,780
182
function [f, pp] = make_violin_plot(plot_an, plot_aw, colL, colR, markerSize, markerAlpha, violinAlpha, jitterWidth, figure_index) % if nargin < 6 || isempty(markerSize); markerSize = 80; end % if nargin < 7 || isempty(markerAlpha); markerAlpha = 0.7; end % if nargin < 8 || isempty(violinAlpha); viol...
6201c231006d14cdd05e7356250a7d810eb4f009869156d5c2e04b695573e4e6
MATLAB
6,785
154
function [Obj,Dims] = NETCDFload(filename,flags,varargin) %% NETCDFLOAD % Obj = NETCDFload(filename,'all') reads the SOFA object OBJ with all data from % a SOFA file. % % Obj = NETCDFload(filename,'nodata') ignores the Data. variables while % reading. % % Obj = NETCDFload(filename,[START COUNT],partia...
0be6a0b07db6feea627cb5b478c39bf43ca2aa7b7561849ef47474c240a9ef18
MATLAB
6,789
147
%% Overview % A brainpathway object is a CANlab object designed for connectivity and % computational model-based analysis of fMRI data. It holds an atlas (defining % brain regions), voxel-level time series data, and derived node and region % averages. In addition, it contains connectivity matrices and graph metrics % (...
684d3a9cf2da1ca39c23a75ec2a9663e7a19a1083f57b39afc9fd713c2e1bc15
MATLAB
6,799
128
function ClincFreq_AffVolume(INDIR,OutAffVoldir,SetUpPara,Para,AtlasTempU) [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); % Dmaske...
187f3b2cb714054fa5c05b2ed4fc78d2641b166e1b09b5099e51e3d09b15d2b4
MATLAB
6,803
230
% vararg2str() - transform arguments into string for evaluation % using the eval() command % % Usage: % >> strout = vararg2str( allargs ); % >> strout = vararg2str( allargs, inputnames, inputnum, nostrconv ); % % Inputs: % allargs - Cell array containing all arguments % inputnames - Cell arra...
79018b8847156eda34ad22df2adc6ace82aaa6a9b6e1f27353a9874f3342d6e1
MATLAB
6,804
136
% std_movecomp() - Move ICA component(s) from one cluster to another. % % Usage: % >> [STUDY] = std_movecomp(STUDY, ALLEEG, from_cluster, to_cluster, comps); % Inputs: % STUDY - STUDY structure comprising all or some of the EEG datasets in ALLEEG. % ALLEEG - vector of EEG structures in t...
ff30f7e2e84b72eabbcad1fe6c99ff278cc1c05970d1ce67d3f4caf644a612a2
MATLAB
6,807
180
function nptype24_imro % imro files for 24 npix begin with (24, 38) and then (channel ID, shank % ID, bank ID, reference ID, electrode ID), eg (1 0 0 1 1) is electrode 1 on % shank 1 (channel is a n integer that goes from 0 to 384), (2 0 0 2 1) % see https://billkarsh.github.io/SpikeGLX/help/imroTables/ % Build im...
c74b5b54c25ac76ad5253ba510a5263adcc34ad29eac9e2415ca86b2183cd83c
MATLAB
6,810
163
% Example replay and relationship between weighted corr. and % sequence likelihood for all candidates load('result_example_5_cw.mat'); % Example: clockwise direction in the 5th block load('no_replay.mat'); % no. of replays (real and shuffled for cw,ccw directions, for Fig.I) load('result_non_pc.mat'); % results ...
dfe7821b59550d38315dac1d2e150b04b6a3e23ae85c4578d79b1382533314b7
MATLAB
6,810
183
function[fluordata,fluordata_red,fluordata_diff,ROIs,redtemps]= pooldirections3(headpath,fileexpnum,imskip,expskip,deltamode,FrameRate) % point towards wherever the experiment data for matlab %control is and then pool across experiments for all ROIs %then will be able to average across individual ROIs for multiple t...
95901d29bc25105a24fe551e038544a391e6219e71958e20813b3b64a6202ed9
MATLAB
6,811
123
function mris_SD_register(input_surface, atlas_name, output_surface, disp_iter) % mris_SD_register(input_surface, atlas_name, output_surface, disp_iter) % Example call: % <When in the same directory as mris_SD_register.m> % mris_SD_register('../../example_surfaces/OAS1_0001_MR1/surf/lh.sphere', 'lh.DW.Atlas1...
d78050561db007eb50af813951f4e2fba43ea9cfb546632510e30b780b8e8307
MATLAB
6,816
182
%% QUICKMI - quick mutual information calculation % Calculates the mutual information between two variables. The data can be % continuous or discrete. If the data is single trial, the mutual % information is calculated through time. If the data is trial based, the % mutual information is calculated at each time point i...
9a2875be299b4e089c4201cb0b72f3eba7419eeea8cf3e79da5b1e524042d794
MATLAB
6,817
175
function [t,rcdx] = stepdif(d,R,y0,x,y,z,dy0,dx,dy,dz,b,mint,tpmtd) % [t,rcdx] = stepdif(d,R,y0,x,y,z,dy0,dx,dy,dz,b,mint,tpmtd) % % STEPDIF Implements Primal-Dual Step-Differentiation for self-dual model % % ********** INTERNAL FUNCTION OF SEDUMI ********** % % See also sedumi % This file is part of SeDuMi 1.1 by I...
a06d90c026e3ac0413dcae44919ea395dff7b1144e0c19672b4553be65555a66
MATLAB
6,817
151
function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampb(data1,data2,movingwin,params,fscorr) % Multi-taper time-frequency coherence,cross-spectrum and individual spectra - two binned point processes % % Usage: % % [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampb(data1,data2,movingwin,params,fscorr) % ...
34c7aa396cdeeea675c8f76b02cac4f0b232ea1a00012ac354f5dc2fd0739ac1
MATLAB
6,818
189
function [cT, cNull] = colocalMeasureBlob2Blob(refSeg,tarSeg,cellMask,threshold,numRandomizations) %COLOCALMEASUREBLOB2BLOB measures colocalization between two sets of segmented objects % %SYNOPSIS: [cT, cNull] = colocalMeasureBlob2Blob(refSeg,tarSeg,cellMask,threshold,numRandomizations) %Function uses nearest neighbo...
7292ce31aec604896055c6da2848f4ba2029fde84f81c3fbcbe27c3153789983
MATLAB
6,823
137
function settings = ea_get_stimProtocol(options, S, settings, activeSources, source_index) % Get stimulation settings for particular source % By Butenko and Li, konstantinmgtu@gmail.com arguments options % Lead-DBS options for electrode reconstruction and stimulation S % Lead-DBS stimulat...
48374334221a87a08e3a234f047308278d64561c1fae09b69722fe59b70feb21
MATLAB
6,830
159
function [ChannelsPerGroupSuperficialToDeep,SpatialChannelXY,NumChansPerProbe,GroupsPerChannel] =... bz_ReadProbeGeometryFiles(probemaplist,extrachannelgroups) % USAGE % [ChannelsPerGroupSuperficialToDeep,SpatialChannelXY,NumChansPerProbe,GroupsPerChannel] =... % bz_ReadProbeGeometryFiles(probemaplist) % % INP...
b3d19e71ed60ffb4e676f22a2114da6b7e7d0e4c1617c12b43651ee25e2644e0
MATLAB
6,840
226
function ea_computeGM(options,modes,finas,threshs,fs) expfolder=[options.root,options.patientname,filesep,'connectomics',filesep,options.lc.general.parcellation,filesep]; for mode=1:length(modes) load([expfolder,finas{mode},'_CM.mat']); X=eval([modes{mode},'_CM']); % Ensure threshold is a scalar double (GU...
859cebb39a0c0df49889b0d7a25951b53d4f37282417dcf6ca5bb177cedeba60
MATLAB
6,842
224
% mapcorr() - Find matching rows in two matrices and their corrs. % Uses the Hungarian (default), VAM, or maxcorr assignment methods. % (Follow with matperm() to permute and sign x -> y). % % Finds correlation of maximum common subset of channels (using % channel location...
3e503613fe6a40dbab01e884ff0d97164fa4456d86d7c45bf71986b3094e195b
MATLAB
6,846
177
function [p,boundary_plot,BOUNDARY] = plotSurfaceROIBoundary(surface,vertex_id,data,boundary_method,cmap,linewidth,climits) % This script is a wrapper for findROIboundaries and makeFaceVertexCData so % that they smoothly work together and you don't have to spend a lot of % your own time making them work together. ...
3574a12225d4cdcac1f8e34389b204a61d4ab17d4987017be9ad97dbc0cc3361
MATLAB
6,849
256
% Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for % 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t]. % Optional parameters can also be included, such as: voxel_size, % origin, datatype, and description. % % Once the NIfTI structure is made, it can be saved into NIfTI fil...
83e3c289624a52827e2d7c3a874d1cbfc1fd862122f89d422afdd4c09447b8c5
MATLAB
6,850
194
function [ts,phi] = run_init_absorbing(topology,homparam,hetparam,stim,init) % RUN with Initial Conditions, or zero trivial conditions if init = NaN; % Absorbing boundary conditions - by adding absorbing layer over Omega % Layer has width L/2, and has effective gain ranging from nu0 to 0 % Takes in input of model para...
6f4d3bf1860a5e0fca5a3a3e63275f1401d1bf4e52ab420f66c8027c5fd5f2df
MATLAB
6,851
180
%% Check whether contrasts are defined % ------------------------------------------------------------------------ if ~isfield(DAT, 'contrasts') || isempty(DAT.contrasts) % skip disp('No contrasts specified. Skipping contrast estimation'); return end %% Specify which montage to add title to. This is ...
1aa7343895c06b80930af705983f72b59176273687d1586b5f0a8b037a61c210
MATLAB
6,852
256
% Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for % 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t]. % Optional parameters can also be included, such as: voxel_size, % origin, datatype, and description. % % Once the NIfTI structure is made, it can be saved into NIfTI fil...
25bc1f62a26a7f27b574e1592ab427368db7ff3f0a31499ef7a77213f1f8f466
MATLAB
6,856
124
% Help for file Mat2NlxTS % Version 4.1.1 % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is used to ext...
bae9863fdaf30e4657f06246b19dd6a77963ec3972d9eab4c75886fb92a97753
MATLAB
6,862
198
function [pTR,nullTR] = simulateBlob2BlobColoc(segmentation,numTarObj,cellMask,colocFraction,varargin) %SIMULATEBLOB2BLOBCOLOC simulate object positions to be used for blob2blob coloalization % % Function sets up simulated positions and runs blob2blob colocalization analysis. % %INPUT % Required % segmentation: binar...
fccfe5652d52af5828386a91f599c78809bf6099be479db892cb6628935346d6
MATLAB
6,863
178
classdef select_or_exclude_top_k_features_FP % select_or_exclude_top_k_features_FP is a feature preprocessing (FP) object % that uses an ANOVA to find the k features with the lowest p-values using data % from the training set. The algorithm either uses only these features % (i.e., removes all other featur...
0f51eb167df62b1218b1631fcb1c0cf00826e0457185f5f24e1333ccebe9b7ba
MATLAB
6,864
200
function [f_intrins, theta_index, modelstruct] = IntrinsicFrequency2(self, cel, varargin) % Intrinsic frequency of a unit % % ARGUMENTS % % cel [tetrode index, cell index] in Session object root % params (see below) % % RETURNS % % f_intrins scalar, frequency of ...
867d578f0c38e635dcf1233a79ad5799f52c95eadad677f71fe11ca4c5b3ac3e
MATLAB
6,867
169
function [fibsvalBin, fibsvalSum, fibsvalMean, fibsvalPeak, fibsval5Peak, fibcell, connFiberInd, totalFibers] = ea_discfibers_calcvals(vatlist, cfile, thresh) % Calculate fiber connection values based on the VATs and the connectome disp('Load Connectome...'); load(cfile, 'fibers', 'idx'); prefs = ea_prefs; if ~exist(...
c2d93bcd3e07771f12db501656f523da270f4d173a7fb153bfdc52a17f0676a7
MATLAB
6,867
150
function [specific_binned_labels_as_numbers string_to_number_mapping] = convert_label_strings_into_numbers(specific_binned_labels_as_strings, ignore_case_of_strings, string_to_number_mapping) % This function takes specific binned labels (i.e., binned_labels.specific_binned_labels) where labels for each site are cell %...
881d74f4500068fbd465ae4d295663b3df51b54541be0fe5507709da6f2c1abe
MATLAB
6,873
211
function ea_ftr2trk(ftrfile, specs, LPS) % export FTR matrix to TrackVis trk format % % specs can also be the path of the nifti file which defines the space. If % not specified or empty, MNI space T1 will be used as reference. % % If the trk is going to be visualized in Surf-Ice, LPS should be set to 1 % to fix the ori...
0a69b440d3b09a82384cbab3343ea9f256141018adfe8e1569e0d8fd1bdf1d68
MATLAB
6,874
188
function [coherogram,phase,t,f] = bz_MTCoherogram(lfp1,lfp2,varargin) %MTCoherogram - Compute LFP coherogram by multi-taper estimation. % % USAGE % % [coherogram,phase,t,f] = MTCoherogram(lfp1,lfp2,<options>) % % lfp1,lfp2 wide-band LFPs (one channel each). % <options> optional list of property-val...
f3bd807b31cb8f57670def688fb8fe9b3756678993563007bab8bd610e7f7f05
MATLAB
6,874
177
%% ======================= step 01-00 for disposal all data % input all the basic data %% set parameters % input parameters subjs = {'S01','S02','S03','S04','S05','S06','S07','S08','S09','S10',... 'S11','S12','S13','S14','S15','S16','S17','S18','S19','S20',... 'S21','S22','S23','S24','S25','S26','S2...
60d93dc9a459c53852c32ab5cb01dd643bfed4dc3f697d711f6e6d7d97efcfeb
MATLAB
6,877
191
function [map,data] = PhaseMango(spikes,phases,varargin) %PhaseMango - Compute phase as a function of spike rate and acceleration. % % Compute spike phase as a function of spike rate and acceleration, as in % Harris et al. (2002). The name of the function refers to the aspect of % the resulting phase plot. % % USAGE ...
5003184f34de09b992d1c877535d19e3054ef24021976d4cbf1e6a1fffad1785
MATLAB
6,885
189
function condColocGeneralWrapper(MD,paramsIn) %CONDCOLOCGENERALWRAPPER applies conditional colocalization described on condColocGeneral to a MovieData file % movieData = condColocPt2Pt2BlobWrapper(movieData, paramsIn) % % Applies colocalization method described in condColocGeneral to three % channels. All channels can...
ea9f30afa23520be15d7013d87d4c9b2ff7659d9a1ab68cb2cc5bc8a86751699
MATLAB
6,888
197
function ts = run_init_periodic(topology,homparam,hetparam,stim,init) % RUN with Initial Conditions, or zero trivial conditions if init = NaN; % Periodic boundary conditions % Takes in input of model parameters, timesteps and lengthsteps. % Returns timeseries at each point. % List of step-size inputs (topology) ...
343e68ba9b80b8471ca03307ffcc305739f19478a4622f6161e731b996883903
MATLAB
6,890
182
function ea_connectome_filter_downsample_flip(connectome_path, ROI_file, factor, fixed_N, N_threshold, flip) % This function allows to prepare large connnectomes for simulations: % 1) Optionally, filter OUT fibers that do NOT pass the ROI % 2) Optionally, downsample the connectome either by factor (integer, % default o...
5b72d13c016b3903ae251430a3dd7371681940f3ca5d71fda9e2684df597589f
MATLAB
6,890
216
function [f_peak, power_ratio] = IntrinsicFrequency(self, cel, print_to_screen, speed_thresh, varargin) % Intrinsic frequency of a unit % % ARGUMENTS % % cel [tetrode index, cell index] in Session object root % print_to_screen 0 or 1 (0) plots analysis % speed_thresh ...
e4ccec1260caf1a998d40a248af0dcd05fd25bb625758d65970c7860085347a8
MATLAB
6,891
203
function ea_anatomyslices(resultfig,togglestates,options,controlhandles) % input xyz in mm coordinates. % this function plots an anatomical slice to the 3D viewer of lead-dbs. % __________________________________________________________________________________ % Copyright (C) 2015 Charite University Medicine Berlin, Mo...
3287708a033a861c62b6c8d20e54534e4bcfbed2182ec00be41556160848364b
MATLAB
6,894
176
function [spl, f, params] = iso226(phon,fq,sq) %ISO226 ISO 226:2003 Normal equal-loudness-level contours % % [SPL,F] = IOSR.AUDITORY.ISO226(PHON) returns the sound pressure level % (SPL) (dB) of pure tone frequencies F (Hz) at the loudness level(s) % PHON. The values are calculated according to ISO 226:2003 us...
d0fc878358afcf90d9e581fec65f6e7875a9d729026396c843b0db6692bc1304
MATLAB
6,898
234
function y = pow_cvx( x, p, mode ) %POW_CVX Internal cvx version. % % Expression type matrices % persistent remap_pos remap_p remap_abs remap_pwr remap_uniq if isempty( remap_uniq ), remap_x1 = cvx_remap( 'real' ); remap_x1c = cvx_remap( 'complex' ); remap_x2 = cvx_remap( 'log-valid' ) & ~remap_...
0a1ed06c621b2a5ed182e594bc43a9603f704f52df07e819123185d9be303ca0
MATLAB
6,901
199
% Name: Robert Kim % Email: robert.f.kim@gmail.com % svm_decoding.m % Description: Per-neuron SVM decoding of the instruction signal (pro vs. % anti) for the INTACT two-layer one-modality (instr) RNNs. For each unit % and each sliding time window, train a linear SVM to discriminate the two % instruction classes from th...
7100a83823859e910cb3d5e2f9c031cd033f29ed67a6852d2c445306a1d21c40
MATLAB
6,911
148
function outstruct = cifti_read(filename, varargin) %function outstruct = cifti_read(filename, ...) % Read a cifti file. % If wb_command is not on your PATH and you need to read cifti-1 % files, include the extra arguments ", 'wbcmd', '<wb_command with full path>'". % % >> cifti = cifti_...
a29ab898228e2443fcdbe940a5a7c217714c3b7b276c4262e3c3a9415fbb7d57
MATLAB
6,924
190
function [logReg_wMeanStd, num_pVal] = CBIG_ASDf_logReg_compareSex(k, sub_id, ... sub_info_file, factorLoading_file, factor_order, output_name) % [logReg_wMeanStd, num_pVal] = CBIG_ASDf_logReg_compareSex(k, sub_id, % sub_info_file, factorLoading_file, factor_order, output_name) % % This function performs logistic r...
7719f7b8a732eafaed1f8cf5eb55f7c64b81e58a7b933296c1e57dd41bea4d21
MATLAB
6,926
209
%%***************************************************************************** %% checkdepconst: compute AAt to determine if the %% constraint matrices Ak are linearly independent. %% %% [At,b,y,idxB,neardepconstr,feasible,AAt] = checkdepconstr(blk,At,b,y,rmdepconstr); %% %% rmdepconstr = 1, if want to rem...
6b689a9e2c91c23d79b1172c7c0a32cc6fdc635d3de306014e05c4b114b2ebdf
MATLAB
6,928
145
function [refinedTrackSpan, measurementsSpan, numBigSpan] = basicTransientTrackChopBySpan(refinedTrack, measurements, spanRadius) %BASICTRANSIENTTRACKCHOPBYSPAN divide tracklets (from refinedTrack) that span long distance into spatially localized tracklets within an input acceptable span (by max pairwise distance) and ...
29fb8c53d376b491148d3a06d8bc06d0d3f400bbe54960221e463979a0725c8b
MATLAB
6,935
186
function M=SOFAplotHRTF(Obj,type,ch) % SOFAplotHRTF(OBJ, TYPE, CH) plots the CH channel of HRTFs given in OBJ. % The following TYPEs are supported: % 'EtcHorizontal' energy-time curve in the horizontal plane (+/- 5 deg) % 'EtcMedian' energy-time curve in the median plane (+/- 2 deg) % 'MagMedian' m...
1c67ccd792a0c9252cde4e6b9fafa7870efc33ac71cc99e604b6e9f4a7ae137d
MATLAB
6,938
154
function [ data_ica, Cmp_to_remove_all, comp] = RFT_EEG_ICA( data, cmp_nr, range, layout, data_aux, ICs_to_remove_auto ) %% % This script runs ICA on EEG 'data' using the FT's functions. % A number of ICs (='cmp_nr') is computed only for EEG channels (other % channels in the dataset are ignored - although plotted)....
8e2e10f479368cdec615042b1c31227887bdc04d59d1d9819e2cee168f68ce2d
MATLAB
6,938
189
function CBIG_brain2doc(vol4D, concatOrder, mask, refListOrParams, nuisanceVars, outDir, varargin) % CBIG_brain2doc(vol4D, concatOrder, mask, refListOrParams, nuisanceVars, outDir, varargin) % % This function converts registered, modulated GM images into documents % that can be analyzed by LDA. It will first take log1...
e977847a4c9eff59b7e55c015e3380a3fab8a4466f87a30f05135c70988aac3b
MATLAB
6,941
150
function [] = doBayesianLasso(cfg,outputDir,T,intervene_matrix,perturbations,data,species_names,BMD,experimentBlocks) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers dynamical systems models from microbiome time-series datasets, and % predicts biologically ...
bae608bd7936c915ed63c4f1f268618d217c37b69229032bf9ec5599eb34bbd3
MATLAB
6,942
241
function [EigenVal, eigVect, M_error, sqErr, kurtParams, kurtTensor] = do_calculation(DEscheme, singleSliceDWI_set, matrix,threshold,kurto) if exist('kurto') ~= 1 kurto = false; end; if length(size(DEscheme)) == 2, for k = 1:size(DEscheme,1), B_tensor(:,:,k) = DEscheme(k,:)'*DEscheme(k,:); end; e...
6e1e227d2e54c6bbd0b45a19241b6a28faa5597bd3fe4838b4be1a2e30431b62
MATLAB
6,949
279
function bestpp = createModelModelLUT(ten,Pstruc,fixedTissuePrior,fid,verbose) ordermax = Pstruc.ordermax(1); kappa = Pstruc.ordermax(2); alpha = Pstruc.alpha; % get the likelihood norm we are optimiznig for W = createWeightingScheme(ten,Pstruc.b_weighting); % the grid of diffusion values we are optimizing on n ...
aa6e03cd3d2ba486b71ab4f7c9794d6dd30715923201d8ffd9faca1e6512b946
MATLAB
6,949
201
function [Y,maskstruct,Yisvol,Yissrf,Ykindstr,Ytmp] = palm_ready(Yfile,maskstruct,opts,removecte) % An intermediate function to read input data (-i) and % voxelwise EVs (-evperdat). % % Usage: % [Y,maskstruct] = palm_ready(Yfile,maskstruct,opts) % % Inputs: % - Yfile : Filename to be read. % - maskstruct : Mask st...
1512c5aa1217ba261013ce01e59c8d8a29c2ea53e3dc353ab2a0151a3d6e56d8
MATLAB
6,951
208
function segmentBlobsPlusLocMaxMLMD(MLMD,blobChannel,varargin) %SEGMENTBLOBSPLUSLOCMAXMLMD runs segmentation process SegmentBlobsPlusLocMaxSimpleProcess % %Synopsis segmentBlobsPlusLocMaxMLMD(MLMD,varargin) % %INPUT %Mandatory: % MLMD: MovieData or MovieList to be segmented % % blobChannel: scalar or vec...
481518e116269ad6ad22d01a2841ef6b6512566417c1dd1aceb26f032f9c9cb7
MATLAB
6,952
188
function varargout = sleepStatistics(varargin) % SLEEPSTATISTICS MATLAB code for sleepStatistics.fig % SLEEPSTATISTICS, by itself, creates a new SLEEPSTATISTICS or raises the existing % singleton*. % % H = SLEEPSTATISTICS returns the handle to a new SLEEPSTATISTICS or the handle to % the existing si...
b7a6a3d5d02af48fc0dc452bcb6d248512088585ea5f8e5af44c16fefbfd283c
MATLAB
6,952
184
function varargout = palm_metrics(varargin) % Compute some permutation metrics: % - For permutation trees, return the entropies. % - For sets of permutations, return the average Hamming distance. % % Usage: % [lW,lW0,C] = palm_metrics(Ptree,X,stype) % [Hamm,HammX,Eucl,EuclX,Spear] = palm_metrics(Pset,X) % % Inputs: %...
589484582a4703f69e5a0da4997c3a21af3522e0e7bc7eb01bd7694a3769e799
MATLAB
6,955
183
function [ s ] = xml2struct( file ) %Convert xml file into a MATLAB structure % [ s ] = xml2struct( file ) % % A file containing: % <XMLname attrib1="Some value"> % <Element>Some text</Element> % <DifferentElement attrib2="2">Some more text</Element> % <DifferentElement attrib3="2" attrib4="1">Even more t...
01ea81c9dc721ea3acf99c534fd53131c2af342cfe9273e836c5c3ba84bf849d
MATLAB
6,956
157
function [roll_out] = ea_diode_main(options) %% Determine Orientation for BSCI directed leads from postoperative CT % has an unsupervised and a supervised version if strcmp(options.subj.postopModality, 'MRI') % check for electrode type and postoperative imaging msg = sprintf('Automatic rotation detection works on...
359072ef8e6c4ba65b40c6f7210b99dc0f1062855156df32b06b6a49e141568c
MATLAB
6,956
148
function [edgeClass, gridClassInfo, imgErodedMask] = classifyMaskGridByErosion(mask, gridSize, numErosion, se, nBorder, senseCheck) %CLASSIFYMASKGRIDBYEROSION: grid mask into boxes and classify those boxes into edge class and center class based on iterative erosion % %SYNOPSIS: [edgeClass, gridClassInfo, imgErodedMask]...
82e725f6f7dc771be03de6cf2c64c64950eea8e00bc7029eda443d3b8a37dca4
MATLAB
6,963
125
function varargout=ea_normalize_spmshoot(options) % This is a function that normalizes both a copy of transversal and coronal % images into MNI-space. The goal was to make the procedure both robust and % automatic, but still, it must be said that normalization results should % be taken with much care because all recons...
3a774de3a884eaf6a4dc00a4e3d2a977a66db6062921dd69b29d67c73726c972
MATLAB
6,968
151
function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampb(data1,data2,movingwin,params,fscorr) % Multi-taper time-frequency coherence,cross-spectrum and individual spectra - two binned point processes % % Usage: % % [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgrampb(data1,data2,movingwin,params,fscor...
b9c5aca306fca7b2a78e42fe7e8b4ba629cf69b10e2112eefb315cca010cb517
MATLAB
6,971
176
function RATIO = cal_RATIO_dosl_acquired(R1a, R2a, R1b, MPF, R, T2b, T1d,dw, w1, TSL, B1, B0, SNR) % COMPUTE_ACQUIRED_RDOSL Calculates the Rdosl. % Simulates magnetization evolution under ihMT pulse sequences. %% 1. Model Initialization (Two-pool model) M0b = MPF; % Macromolecular pool fraction M0a = 1-...
8034b08052fb1d821253e64752130d129914f61a86ebff4b492868f8c303ee12
MATLAB
6,974
274
function [vol, M, mr_parms, volsz] = load_mgh(fname,slices,frames,headeronly) % [vol, M, mr_parms, volsz] = load_mgh(fname,<slices>,<frames>,<headeronly>) % % fname - path of the mgh file % % slices - list of one-based slice numbers to load. All % slices are loaded if slices is not specified, or % if slices is emp...
8690ca62fad920a8e6a33e01ab58db38a57d978720e068a7d61c7f60bf07b605
MATLAB
6,977
199
function [Theta_samples_lasso] = MDSINELassoMCMC(X,F_hat_prime,growth_mean_p,growth_std_p,self_reg_mean_p,self_reg_std_p,perturb_std_p,numPerturb,node,params) % This file is a part of the MDSINE program. % % MDSINE: Microbial Dynamical Systems INference Engine % Infers dynamical systems models from microbiome time-...
1e5e9f321573c474d31ddc0ae7fae4e7c7e7f6dffe201ef99e8d8563a21674e2
MATLAB
6,983
200
% pop_plotdata() - Plot average of EEG channels or independent components in % a rectangular array. Else, (over)plot single trials. % Usage: % >> avg = pop_plotdata(EEG, typeplot, indices, trials, title, singletrials, ydir, ylimits); % % Inputs: % EEG - Input dataset % typeplot - Type d...
c6f83528c396f887ddb3554be5d9a379bedd2693f9d293d4bf3083f13e4079e6
MATLAB
6,984
190
% THIS SCRIPT RUNS SVMs for WITHIN-PERSON CONTRASTS % Specified in DAT.contrasts % ------------------------------------------------------------------------- % USER OPTIONS % This is a standard block of code that can be used in multiple scripts. % Each script will have its own options needed and default values for % t...
9ea7245c47110c7a9c36bdfe12b4c3d316f403a61e5e91a296c52816dc89f7d3
MATLAB
6,987
188
function [coherogram,phase,t,f] = MTCoherogram(lfp1,lfp2,varargin) %MTCoherogram - Compute LFP coherogram by multi-taper estimation. % % USAGE % % [coherogram,phase,t,f] = MTCoherogram(lfp1,lfp2,<options>) % % lfp1,lfp2 wide-band LFPs (one channel each). % <options> optional list of property-value ...
dff97798abe9c48acaaac83c719460e58796c5712e65c8cbc562a0729db3d7f4
MATLAB
6,987
207
function [result, M] = warp_pnt(input, target, method); % WARP_PNT determine intermediate positions using warping (deformation) % the input cloud of points is warped to match the target. % The strategy is to start with simpelest linear warp, followed by a more % elaborate linear warp, which then is followed by the non...
76997b1bd82667d59814614847f28cf139c09e6ed65b49cff10cb4feca497f1d
MATLAB
6,996
154
function [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpb(data1,data2,movingwin,params,fscorr) % Multi-taper time-frequency coherence,cross-spectrum and individual spectra % continuous process and binned point process % % Usage: % % [C,phi,S12,S1,S2,t,f,zerosp,confC,phistd,Cerr]=cohgramcpb(data1,data2,movingw...
a8033d30ebeb8ea9102349a5ae4f741e1da0b43ad429bcb1205304c252d15f09
MATLAB
7,001
173
% epoch() - Extract epochs time locked to specified events from continuous EEG data. % % Usage: % >> epocheddata = epoch( data, events, timelim); % >> [epocheddata, newtime, indices, rerefevent, rereflatencies ] = ... % epoch( data, events, timelim, 'key1', value1, ... ); % % Inputs: % data ...
9c9cee1ebdba434c7e4b4869c04f4d4f516896e42033dc7c5a6336e91c7a5df7
MATLAB
7,004
165
% 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,ar...
495f267d3ef41aef151e3dcb260a77207aea775922aded7f7131a8b3731b2ca8
MATLAB
7,010
249
% Version 26/06/2026 % Authors: Alessandro Petrini and Davide Pierangeli % ------------------------------------------------------------------------- % This script is provided as a reference implementation of the experimental % procedure described in the manuscript. It documents the acquisition logic % and computation...
5adc0e23b21a2d0d03b016f4571205477b0019748c6111d8b2c73bf80ec814bd
MATLAB
7,010
165
function SOFAcompileConventions(conventions) %SOFAcompileConventions % % Obj = SOFAcompileConventions(sofaconventions) compiles the specified % SOFA conventions. For every convention a CSV file has to exist which % will be compiled to a .mat file used later by SOFAgetConventions(). % % The CSV file must...