sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
6c73116f8f88f9e221f8479a3c47e330d946e794f44ec75a1d9508794ce04b57
MATLAB
3,437
112
function [outputMap, mask] = ea_agreementmap(inputMaps, outputFileName, writeoutMask, mode, zz) % Calculate agreement R-map % mode can be 'mult' or 'sum', 'avg' or 'sum/avg0...x' which creates an average/sum map across pixels that agree in % polarity for 0 to x cases. (avg0 for instance would just be the average % map ...
e2f8559eaa56e79be2e6d8c5d45ab41506f33a3a6118db10cf1f248bbfe4f1c7
MATLAB
3,437
81
function [handles] = callBAPsubtract_master(handles, dataID) if nargin<2 dataID = 1; end f_wait = waitbar(0.5, 'Auto processing Backpropagation removal'); scrsz = handles.scrsz; handles = call_autoBAP(handles); traceplot22(handles) close(f_wait); delete(f_wait); if handles.openGUI==0 comIn = input('Start manual...
631b2ed53f3344d3d1cc0a6a4b5870e0e337ea497bed405cad91ae5401431362
MATLAB
3,441
97
function ClincFreq_CentPointForVolume_pre(INDIR,outdirCent,Para,spmjobdir) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; inum = 1; for isub = 1:length(namelist) Du = reshape(full(D(:,isub)),V(1).dim); Coninf = bwconncomp(Du); nums = Coninf.NumObjects;...
ce42b02616b5f726c77660d18158f231899d3a5850b9d69f6028c2feda9d74a7
MATLAB
3,441
105
function [mask weight]=mesh2vol(node,elem,xi,yi,zi) % % [mask weight]=mesh2vol(node,face,Nxyz) % [mask weight]=mesh2vol(node,face,[Nx,Ny,Nz]) % [mask weight]=mesh2vol(node,face,xi,yi,zi,hf) % or % newval=mesh2vol(node_val,face,...) % % fast rasterization of a 3D mesh to a volume with tetrahedron index labels % % aut...
cfa4c807ea15df41b688138f92c275b168ecf7ede495fe30217b0afca8ecf2c5
MATLAB
3,441
87
function [goodx,goody,goodz]=ea_export_templates(coords,trajectory,patientname,options,side) % this function can export templates based on manual measurements of the % electrode tips and is originaly based on ea_sample_cuboid. % uses map_coords authored by Ged Ridgway switch options.subj.postopModality case 'MRI' ...
ea9e61cf61f996373fcfb2eedac2628820ec3b2f5100d91239a12c6596227617
MATLAB
3,441
77
% 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...
5345ea254213ece13248a73bd8f30d18a364ac15e568b0135443ce5d8ed61ca8
MATLAB
3,444
96
function mStatus = startMotion(idx, grid, stepperHandles, panelHandles) % % Function: % global currentPositionX currentPositionY currentPositionZ global pausePositionX pausePositionY pausePositionZ global useEncoderX useEncoderY useEncoderZ global surgIdx isPause isFinished isStop mStatus = 0;%0-normal 1-...
e52d02cc70ae05f94fe637fd109fda6d4f01521a2b6a86b70d301c2449234f3a
MATLAB
3,446
92
function RMSE = getRmse(X, y, varargin) %GETRMSE Calculate the root-mean-square error between input data % % RMSE = IOSR.STATISTICS.GETRMSE(X, Y) calculates the RMSE of the inputs % data where % % RMSE = sqrt( 1/N-D * SUM(err^2) ) % err = abs(X-Y) % % The input data X and Y can be vectors ...
711a1f6121e7d1d23ae2038bd396263e7779c0542531574709e8fcf54dc70eb5
MATLAB
3,447
71
% 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...
a1172cabf7ff0e0d4ff7685f883c92470c98b5b1c19e418cbaed3001b6d70ca7
MATLAB
3,449
109
% gabor2d() - generate a two-dimensional gabor matrice. % % Usage: % >> [ matrix ] = gabor2d(rows, columns); % >> [ matrix ] = gabor2d( rows, columns, freq, ... % angle, sigmaR, sigmaC, meanR, meanC, dephase, cut) % Example : % >> imagesc(gabor2d( 50, 50)) % % Inputs: % rows - n...
5b838fa0a8467a33f04d77666482248aef3abe105116c4078af0fd615914c263
MATLAB
3,450
80
function [handles] = callBAPsubtract_filt(handles, dataID) if nargin<2 dataID = 1; end f_wait = waitbar(0.5, 'Auto processing Backpropagation removal'); scrsz = handles.scrsz; handles = call_autoBAP_filt(handles); traceplot22(handles) close(f_wait); delete(f_wait); if handles.openGUI==0 comIn = input('Start man...
b21987df0cb6cb2aa3a6f09f80038e9fe4d5fe64874083dcea3188735c0500d6
MATLAB
3,450
109
function [N, wMean, wStdDev, p] = CBIG_MMLDA_characteristics_glm(prob, y, y_type) % [wMean, wStdDev, p] = CBIG_MMLDA_characteristics_glm(prob, y, y_type) % % Analysis about factors effect on characteristics by using glmfit and hypothesis test. % % Input: % - prob : % N x K matrix, factor compositions...
c859f0d683dcfc99023299a3c698fd0c9034e70f42fd1e313abfce423fa19ee5
MATLAB
3,451
91
% varsort() - reorder ICA components, largest to smallest, by % the size of their MEAN projected variance % across all time points % Usage: % >> [windex,meanvar] = varsort(activations,weights,sphere); % % Inputs: % activations = (chans,framestot) the runica() activations % weights = ...
05fb8cfaddd115cde649b367b01c450bc2ddb12e6e38d903614e32923de59096
MATLAB
3,452
105
% Computing a sparse solution of a set of linear inequalities % Section 6.2, Boyd & Vandenberghe "Convex Optimization" % "Just relax: Convex programming methods for subset selection % and sparse approximation" by J. A. Tropp % Written for CVX by Almir Mutapcic - 02/28/06 % % We consider a set of linear inequalities A*...
91c8a3531829f63b42174d793d7bb977cf680b7b0b15d8ec7894ec025870db93
MATLAB
3,452
97
% timewarp() - Given two event marker vectors, computes a matrix % that can be used to warp a time series so that its % evlatencies match newlatencies. Values of the warped % timeserie that falls between two frames in the original % timeserie will be linear ...
9aa55a06cf57348ae402aea2828d5951b7a334eb76631401b8a1813cd1ea00ba
MATLAB
3,452
73
%% Generate mean and 95% CI for group-level ROC Nsub = length(fit.d1); ts = tinv([0.05/2, 1-0.05/2],Nsub-1); if any(isnan(fit.obs_FAR2_rS1(:))) || any(isnan(fit.obs_HR2_rS1(:))) || any(isnan(fit.obs_FAR2_rS2(:))) || any(isnan(fit.obs_HR2_rS2(:))) warning('One or more subjects have NaN entries for observed confid...
6bedf99558e12d46b4631aee95277335d729061caf171f391ae2b295b4812524
MATLAB
3,454
90
function [MI] = MutualInfo(CountsMat) %MutualInfo calculates the mutual information between Y and {X1,...XN}. % [MI] = MutualInfo(CountsMat) is the mutual information between the Y % variable and the X variables considered as one vector valued variable % {X1, ... XN}. % % Inputs % % CountsMat: An array that c...
256635179fd8cf0517aee5f807daba4be87d93ab482eef45b635c3087627239a
MATLAB
3,455
98
for i = 1:length(leftmeansd{11}) if iscell(leftmeansd{11}{i}) figure; for tr = 1:length(leftmeansd{11}{i}) subplot(1,length(leftmeansd{11}{i}),tr); imagesc([leftmeansd{11}{i}{tr} rightmeansd{11}{i}{tr}]); hold on; xline(8.5,'y','linewidth',2) ca...
67c359f0d8742bc098e2d5635413c6bb2b6e3644510567905a1de198c696f3ae
MATLAB
3,457
90
% Runs a two-sample t-test for a set of signature responses, for each % contrast. % Signatures, scaling, etc. are defined below. %% USER OPTIONS % ------------------------------------------------------------------------- mysignature = {'PINES', 'Rejection', 'VPS', 'VPS_nooccip'}; scalenames = {'raw'}; ...
aa128e87033531c22b772b370c632145d567fdb47b377d419e24eb434468455f
MATLAB
3,457
102
function CBIG_pMFM_step6_SWSTD_state_main() % This function is used to conduct the statistical analysis corresponding % to figure 5D and 5E in the paper. % % There is no input for this function as it can automatically get the % output file from previous step. % There is no output for this function as it will generate ...
1d73367d67b07bd448d6a1a608515a7d69ec9699c4c6a982a3208474578b8aed
MATLAB
3,461
85
function corr_array = compute_spont_corr(topology, dx, dt, hetparam_het, homparam, num_parcel_x, tol) % Compute the SCF with reference point p, with given sigma_n % Set tolerance if not given if nargin < 7 || isempty(tol) tol = 1e-7; end parcel_Nx = topology.Nx / num_parcel_x; if mod(...
08861c9f41bbf00ad25c34166fcedfa4878db5b8600bf2c0478eb3225cfdf74d
MATLAB
3,463
106
classdef Panel < uix.Panel %uiextras.Panel Show one element inside a panel % % obj = uiextras.Panel() creates a standard UIPANEL object but with % automatic management of the contained widget or layout. The % properties available are largely the same as the builtin UIPANEL % object. Whe...
e6c877b67226f6c2975d89f942af6bbf894b2df7323cd2a5950acbb5dfb587c1
MATLAB
3,464
129
%filtering script by Kathy Nagel 07/12/22 load('from0deg.mat') plot(Trial') load('from0deg.mat') hold on; plot(Trial') load('from0deg.mat') hold on; plot(Trial') close hold on; plot(Trial') close load('from0deg.mat') plot(Trial') analyzeCalciumExperiment_newThor5D_roishift(pwd,'67A04_apr072022_f2e1',[],[]...
ec0b22b3fb2cb6d2b2f5454e2ec165485b9d9bd510a48a4c6bc081aafa892a37
MATLAB
3,464
93
function varargout=cbiQuaternionToHomogeneous(varargin) % [M,R,T]=cbiQuaternionToHomogeneous( quatern, pixdim, qfac, qoffset ) % - OR - % [M,R,T]=cbiQuaternionToHomogeneous( hdr ) % % Computes the 4x4 homogeneous transformation matrix from quaternion coefficients quatern, % voxel dimensions pixdim, coordinate system o...
21b2fae332fcd1e9cb409c05e28ffdcd7660dc522a352c682b48074fde1b196c
MATLAB
3,465
90
% Runs a two-sample t-test for a set of signature responses, for each % contrast. Also runs NPS subregions. % Signatures, scaling, etc. are defined below. %% USER OPTIONS % ------------------------------------------------------------------------- mysignature = {'FAPS','VIFS','reddan'}; scalenames = {'raw'}; ...
5e234b2372b47ba6b3414da8a618acf589b54cb498bbfdcd5b49f5f06401d2bf
MATLAB
3,465
119
%%********************************************************* %% convertcmpsdp: convert SDP with complex data into one %% with real data by converting %% %% C - sum_{k=1}^m yk*Ak psd %% to %% [CR,-CI] - sum ykR*[AkR,-AkI] psd %% [CI, CR] [AkI, AkR] %% %% ykI = 0 for k = 1:m %% %% [bblk,AAt,C...
ed2481b0341cce598c82f9429ed5d3c95abe68ea2ab1db50d1fa7eb760c6e8b0
MATLAB
3,466
103
%% clear thedata = 'apr2623_f3e4'; trllength = 127; % in frames % First, navigate to the folder containing the folders of data you want to % concatenate. % [a,b]=NDK_Motion_Correction5D_savecat(thedata,1,0); [Xpix,Ypix,FrameRate,Zframes]=findkeyparams_newThor5D(); FrameRate=str2double(FrameRate)/Zframes thepat...
ed84aff9c3db4fdafe2807091c5f053b8cb82ca21991fd51fe5acdef5e5e5784
MATLAB
3,469
84
function obj=geom_point(obj,varargin) % geom_point Display data as points % % This will add a layer that will display data as points p=inputParser; my_addParameter(p,'dodge',0); my_addParameter(p,'alpha',1); parse(p,varargin{:}); obj.geom=vertcat(obj.geom,{@(dobj,dd)my_point(dobj,dd,p.Results)}); obj.results.geom_po...
d92b4ff5693713ffe38316b54477234bf8f559ad0c13a89616e362f74f414dde
MATLAB
3,471
78
function jControl = findjobj_fast(hControl, jContainer) %#ok<*JAVFM,*JAPIMATHWORKS> if double(get(hControl,'Parent'))~=0 % avoid below for figure handles try jControl = hControl.getTable; return, catch, end % fast bail-out for old uitables try jControl = hControl.JavaFrame.getGUIDEView; return,...
54b5ce68d9ba8eca559b04ebd77a2b2174d48bef7932554337fc586e044a265a
MATLAB
3,473
114
function M = mz3_read(filename) % Read MZ3-formatted data from disk % FORMAT M = mz3_read(filename) % % filename - MZ3-formatted file name % M - data structure %__________________________________________________________________________ % % MZ3 Format Specification: % https://github.com/neurolabusc/surf-ice/tree...
93f97bf026c58a7a56ba057fdc9cd08ed2987e7b5c72c5c9285d6b225b51460a
MATLAB
3,475
78
%% function GibbsSamplerAT %% % Runs the AT Gibbs sampler for the Author-Topic model. % % |[ WP , AT, Z, X ] = GibbsSamplerAT( WD,AD,T,N,ALPHA,BETA,SEED,OUTPUT )| % will run the Gibbs sampler for the AT model on a bag of words sparse count % matrix |WD| of size |W| x |D| (|W|=vocabulary size, |D|=number of do...
a391388ad9babe53f1d298e16879c776821a97e88f89ea1c2417820b2060a07a
MATLAB
3,476
78
function [TE_all_xy,TE_all_yx, Phi_all, Syn_all, Red_all, AIS_all, Syn_Red_ratio, MI_all] = calc_PhiID_trial_based2(wave_itrials,target_time,past_tau) [n_trials, n_channels, n_timepoints] = size(wave_itrials); % past_tau = 10; n_time= length(target_time); TE_all_xy = zeros(n_time, n_channels, n_channels); TE_a...
6202c819608ded3cdd735fe471e5cd22ab4738ec3179cd1219fde563a8e1d4c1
MATLAB
3,480
109
function varargout = ea_explorer_stats_1sampleweightedlinreg(varargin) % Function to estimate a certain mass univariate test (see below) as used % in explorer apps. % - Expects valsin as V x N matrix where % V is the number of % voxels/streamlines...
4e53a0b30fc850431e6d603ace1853fa4315ea3db923acde58fb457d20c91eb9
MATLAB
3,481
70
% sleepDanalyzer montage script. % chanList. A list of channel names and (optionally) channel coordinates. % This should be an EEGLAB chanlocs struct. Alternatively you can read in a % .txt file using the readlocs function (EEGLAB). If you wish to % differentiate channel types (e.g. EEG, EOG, etc.) make sure to use t...
8caeb2de76b310a125abd57cfb302ffa7ae77e226c592e4a20d88ffe3bdfc79f
MATLAB
3,482
71
% 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...
12f66d79461ad3073d89791e08a1bfce93852af20174d8730981c03181489386
MATLAB
3,484
113
%ISOLATE_AXES Isolate the specified axes in a figure on their own % % Examples: % fh = isolate_axes(ah) % fh = isolate_axes(ah, vis) % % This function will create a new figure containing the axes/uipanels % specified, and also their associated legends and colorbars. The objects % specified must all be in th...
68ac6ff93e096185cefaecbc0068792fffb1001603aba389be219d95584dd81b
MATLAB
3,484
84
% When you load any ANALYZE or NIfTI file with 'load_nii.m', and view % it with 'view_nii.m', you may find that the image is L-R flipped. % This is because of the confusion of radiological and neurological % convention in the medical image before NIfTI format is adopted. You % can find more details from: % % http...
83931e4db58be25e96f273a72575a5b54a2e6e87867f62a02473075d52d2d449
MATLAB
3,485
74
function newmarkers=ea_correctcoords(oldmarkers,trajectory,command,options) newmarkers=oldmarkers; grone=[0.1,0.5,3]; % step-sizes switch command.Key case 'uparrow' try trajvector=gettraj(trajectory,options.elside); newmarkers(options.elside).head=oldmarkers(options.elside).head+gr...
298be66390295f821afd99c2885d319346a806add3c19b64cec0c41b1c3eeb18
MATLAB
3,486
129
function [tscounts, wfcounts, evcounts] = plx_info(filename, fullread) % plx_info(filename, fullread) -- read and display .plx file info % % [tscounts, wfcounts] = plx_info(filename, fullread) % % INPUT: % filename - if empty string, will use File Open dialog % fullread - if 0, reads only the file header % ...
38b40ea671a70ab24e9470fc4ea8b31b0a25636517a8f32a86d1041e1a9ec410
MATLAB
3,486
77
function obj=set_color_options(obj,varargin) % set_color_options() Set options used to generate colormaps and color % legends % % Parameters: % 'map': Set custom colormap. Available colormaps are: % - 'lch' : default, supports lightness % - 'matlab' : post-2014b default colormap (no lightness support) % - '...
5cd66ec29d92f5bbd639cbb275abf7fb8b36cc6b6e3d04a7df67c30470c513bd
MATLAB
3,486
84
function spike_alignment_batch_Axona(files) % spike_alignment_batch % function for alligning spikes detected outside wave_clus. % INPUT: Matrix of spikes in an ascii file. Spikes must be grouped in a % matrix called 'spikes' with a spike per row. % OUTPUT: matrix of spikes alligned with the maximum in sample set by the...
1e61a0a4bcba0b557f91bc74077c8ba889a1a90665db7e2de6311bd0ad7c52d2
MATLAB
3,487
87
%% electrodePointCloudModelEstimate - extract skeleton points from given pointcloud and subsequently fit a polynomial % % PARAMETERS % varargin{1} = pixelValues list got from reference image of the segmentation. When given used for intensity based % weightig of cenroid calculation. % varargin{2} = rever...
9d64dc401585c74537fea55013c7fe7f5d027a069c404f83c306c7234bea6f2e
MATLAB
3,487
119
function y = poly_env( p, x ) %POLY_ENV Evaluate the convex or concave envelope of a polynomial. % POLY_ENV( P, X ) uses a semidefinite program to compute the value of the % convex or concave envelope of the polynomial represented by the vector % P. The format of the vector P is identical to that required by POL...
b54f8f3948a0a767781d3ea43743fbaa02b70f5cf55798fa5132e846a284d98c
MATLAB
3,488
91
function [OpenedFileName, Version, Freq, Comment, Trodalness, NPW, PreTresh, SpikePeakV, SpikeADResBits, SlowPeakV, SlowADResBits, Duration, DateTime] = plx_information(filename) % plx_information(filename) -- read extended header infromation from a .plx or .pl2 file % % [OpenedFileName, Version, Freq, Comment, Tro...
f9c799ecf83f4bc2cdf78a040502570c95b9f2373a68752c6a23df3a945c28ef
MATLAB
3,488
141
%% Animate geometric model clear; clc; % Load model parameters loadparam; dx = topology.L / topology.Nx; dt = topology.T / topology.Nt; ts = run_periodic(topology,homparam,hetparam_hom,stim); % Create figure f = figure; sgtitle('Evoked Response - Geometric Connectivity') f.Position = [300 100 650 600]; set(gcf, 'co...
07c3f872392a0869f0e0b2ab91bdc7bd2a28341515f744abf60f62170a7d962b
MATLAB
3,489
84
function l = IsFirstAfter(timestamps,list,varargin) %IsFirstAfter - Identify first item after each of a list of timestamps. % % For each element i of a list of test timestamps, find in a list of reference timestamps % the first element j larger than i. Returns a list of logical indices (the elements of the % test list...
81abf5960ef0bcb4d9da2c45e8440135d6727abb92a0e80696435c2f9d0f4ede
MATLAB
3,489
102
function [sessionInfo] = bz_getSessionInfo(basePath,varargin) %[sessionInfo] = bz_getSessionInfo(basePath) loads the sessionInfo metadata %for the recording in basePath. basePath should be in the format: % /whateverPath/baseName/ % a file basePath/baseName.sessionInfo.mat % or basePath/b...
a5a9f98117ba0c9a1eb60593193cbeef14700eecbeb0621e174dfb712dcfce31
MATLAB
3,489
90
function data_out = Trinh_loadConditionData_usingendmarker(filename,eventtype,eventvalue,prestim,poststim) %% load and cut condition data % insert name of the file: filename, e.g., 'MUSICOM_001.vhdr' % eventtype, e.g., 'Stimulus' or 'Trigger' % eventvalue, e.g., 'S 1' in cell % define how much to cut before and a...
288c03ae466061f60c165a0678ab023a2f913ca28e6da1702043b658848626c5
MATLAB
3,491
133
function CBIG_pMFM_step2_generate_FCD_schaefer() % This function is the wrapper to generate parcellated time serises and FCD % for Desikan parcellation % % There is no input for this function as it can automatically get the % output file from previous step. % There is no output for this function as it will generate th...
8f9624114290a6e52eb8e6b4512ea8a593469354a9ca6ead52fc93c945b50c28
MATLAB
3,492
84
function l = IsLastBefore(timestamps,list,varargin) %IsLastBefore - Identify last item before each of a list of timestamps. % % For each element i of a list of test timestamps, find in a list of reference timestamps % the last element j smaller than i. Returns a list of logical indices (the elements of the % test list...
2799796aa7b9e650e7ce7527ceb1570ac707bd1f5ddc72cfcbe5c4802b2decd0
MATLAB
3,493
114
classdef HBox < uix.HBox %uiextras.HBox Arrange elements in a single horizontal row % % obj = uiextras.HBox() creates a new horizontal box layout with % all parameters set to defaults. The output is a new layout object % that can be used as the parent for other user-interface components. ...
b1cd70ace52a3fe0603abcc5443015c34227ed78c66c5393c36b5a0e25a340e2
MATLAB
3,493
99
% eegplot2trial() - convert EEGPLOT rejections into trial and electrode % rejections compatible with EEGLAB format. % % Usage: % >> [trialrej elecrej] = eegplot2trial( eegplotrej, frames, ... % sweeps, colorin, colorout ); % % Inputs: % eegplotrej - EEGPLOT output (TMPREJ; se...
e0639d729097ffb30f534442821a2e01b1661eebace917df658dd560669e087a
MATLAB
3,495
93
function ea_exportb0(options) b0threshold = 10; disp('Export b0...'); bvals=load([options.root,options.patientname,filesep,options.prefs.bval]); idx=find(bvals<b0threshold); if isempty(idx) matlab.desktop.editor.openAndGoToLine(which('ea_exportb0'), 3); error(sprintf(['Exporting b0 image failed: b0 threshold...
b6c41c602d279ba597afa199f4f1ba9fead533e08193b49c2ae22790e8e3b4b4
MATLAB
3,496
131
clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color %% set parameters % input parameters subj = 'S01'; session = 1; % s1 or s2 num_layer = 20; atlasFrom = 2; % 1:MNI152; 2:std141 switch atlasFrom case 1 atlas = 'glasser360'; atlas_readname = ['Data.HCPMMP1.d...
d71a2845f474035243085e257dcc562286106ce854997b1d8d77fed682f9d092
MATLAB
3,496
104
function y = base64decode(x) %BASE64DECODE Perform base64 decoding on a string. % % BASE64DECODE(STR) decodes the given base64 string STR. % % Any character not part of the 65-character base64 subset set is silently % ignored. Characters occuring after a '=' padding character are never % decoded. % % STR doe...
298d1c66522a06041648c1a705f0e6ed5b15abfdd266d199421ed2dcac9bb177
MATLAB
3,498
129
function [scaleFactor vid_ts vid_x vid_y headdir d_epoch] = dacq_pos(fname) %[root.scaleFactor, root.ts, root.x, root.y, root.headdir, root.epoch] = %dacq_pos(dataPath,prefix) % % Finds video file with the prefix "prefix" in folder "dataPath", and % returns relevant spatial information for a CMBobject % Bill 2012.06.2...
8a192012f4698c31bec28470f33aec98262c02eb383730480f6404af5a9bbd9e
MATLAB
3,498
114
classdef VBox < uix.VBox %uiextras.VBox Arrange elements vertically in a single column % % obj = uiextras.VBox() creates a new vertical box layout with all % parameters set to defaults. The output is a new layout object that % can be used as the parent for other user-interface components. ...
634c3503fba7281f748984b16fed8016cfb622c1aa01fc8b49514f64c769ae22
MATLAB
3,499
109
function f=showProj(stk,type,filtparms,scaleparms,wlev,fig_flag) % Usage ... f=showProj(stk,type,filt,scale,wlev) % % filt=[gauss_smooth_wid medfilt_wid] % scale=[x y z] in pixels if ~exist('type','var'), type=[]; end; if ~exist('filtparms','var'), filtparms=[]; end; if ~exist('scaleparms','var'), scaleparms=[...
b79895043eeb33fef6b8f1351ab7af66ffbc4d59bd7c01ab836ab384d540bf94
MATLAB
3,501
115
function [maxsize,clstat,sizes] = palm_clusterd(X,y,thr,opts,plm,varargin) % Compute cluster density statistics, for volume or surface % data (vertexwise or facewise). % % Usage: % [maxsize,clstat,sizes] = palm_clusterd(X,y,thr,opts,plm) % % Inputs: % - X : Statistical map. % - y : Modality index (of those stor...
60ec85c703cd77e0aa9f61cad4516f5e97d8c985526aa3d0609c029038346964
MATLAB
3,502
94
function till_creategridforelectrode(reco,side,space,options) % clearvars -except reco side space % options = ea_getptopts('/media/netstim/E/Till/Testsession/derivatives/leaddbs/sub-BiDirect3'); %% load electrode model try load([ea_getearoot,'templates',filesep,'electrode_models',filesep,options.elspec.matfname,'.m...
23195a6ec42408ceba361b99959f1c23b9b437690e26771a8fce07361795068d
MATLAB
3,503
77
function [J_chrom, J_chrom_brain, pathlength_tot, pathlength_brain, J_chrom_full] = computeJChromBrain(model, epsilon_mm_uM, brain_nodes_idx) % computeJChromBrain Compute normalized spectral Jacobians and pathlengths % % [J_chrom, J_chrom_brain, pathlength_tot, pathlength_brain, J_chrom_full] % = computeJCh...
9d15f262010c60a22debf383143a221ccb09053a52cec215b5a100c83eb5b2d4
MATLAB
3,504
98
function C = convnsep(varargin) %CONVNSEP N-dimensional convolution with separable kernels. % C = CONVNSEP(H1,H2,...,A) performs an N-dimensional convolution of A % with the separable kernel given by the outer product of the H1,H2,... % such that the input vector Hk is convolved along the kth dimension o...
a435b7f0402b2b1d4610be1cc072372deebecb36fc3c3db3d714dc9fdec73c22
MATLAB
3,505
125
function [phasedev3 stddev]=LFPphasedev_running(animal,filtertype, refchannels, numloops) exp_dir=get_exp(animal); load([exp_dir '\LFP\' filtertype '\' animal, '_', filtertype, '_128power.mat']); %LFP128 and PX phasedev=[]; phasedev2=[]; phasedev3=[]; stddev=[]; load([exp_dir '\stimuli\' animal '_VRstatea...
31cc02b8a6986492a3ee765a1f4ba8bf0003eda217c380d92f082529acfe6a99
MATLAB
3,507
111
% Name: Robert Kim % Date: 03-29-2023 % Email: robert.f.kim@gmail.com % fnc_eval_model.m % Description: Run a trained continuous-rate RNN forward on a given input % sequence, optionally with a modified recurrent weight matrix (lesion sweep) % and/or with specific units clamped during a stim epoch (perturbation). % Retu...
5061a1ff36808e1dc0114332eda3d7ca529c63bbc386198c0b5f38b911634bdd
MATLAB
3,507
135
function savejmesh(node,face,elem,fname,varargin) % % savejmesh(node,face,elem,fname,opt) % % export a mesh to the JMesh format % % author: Qianqian Fang, <q.fang at neu.edu> % date: 2011/10/06 % % input: % node: input, node list, dimension (nn,3) % face: input, optional, surface face element list, dimension ...
82287c2545f94c8b1cf7694be3fb566b269c735e7c723eb0ea3c4d90e709a7d6
MATLAB
3,507
108
function Z = palm_gtoz(G,df1,df2) % Convert a G-statistic (or any of its particular cases) % to a z-statistic (normally distributed). % % Usage: % Z = palm_gtoz(G,df1,df2) % % Inputs: % G : G statistic. % df1, df2 : Degrees of freedom (non-infinite). % % Outputs: % Z : Z-score % % If df2 = NaN and df1 = ...
dcc1229a35e2c23c20001a7e16e179db0f3463a1de9af54da8f7fa414fcaaf39
MATLAB
3,508
91
function result = cvglmnetCoef(object, s) %-------------------------------------------------------------------------- % cvglmnetCoef computes coefficients from a "cv.glmnet" object. %-------------------------------------------------------------------------- % % DESCRIPTION: % This function extracts coefficients at ...
9a5570004e186f55178c1e641da672070a849bdc6bd5c2344416281de77a0308
MATLAB
3,509
78
function [trials] = crossValidateCdiff(cfg,T,intervene_matrix,data_counts,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 rel...
b52286d37e1a031bc29e5e4f20f82f6aa4fca5e55603ddb335b576b219b3ac22
MATLAB
3,510
95
function spatial_information = SpatialInformation(self, cel, varargin) % Computes the spatial information of a cell (bits/spike) % % Will return the spatial information score in bits/spike for % tetrode cel(1), cell cel(2). Can return continuized epochs, or vectorizes % multiple epochs. Note that if xdim and ydim are ...
28f83518634c39fc9078f28fa2f61329ea0857d087c69bb272cb689f745864b6
MATLAB
3,512
116
% MAKEFIR design an n-th order fir filter using firls % % H = MAKEFIR( FREQ, FS, N, BAND, TOL, X, FFUNC ) % % FREQ - [ highpass lowpass ] frequencies (Hz) % FS - sampling frequency (Hz); {1000} % % optional: % N - order (number of samples); determined automatically if not specified % BAND - 'low', 'high', 'ba...
956e54c948ccafb1d716f62952c1483a529232ecb0579af34c72cd8a51682df8
MATLAB
3,512
127
function averageOIS(fname,fps,ntr,noff,nper,nfa,zoomdn,basediff) % Usage ... averageOIS(fname,fps,ntrials,offset,trialdur,desiredres,zoomdown,basediff) if (nargin<8), basediff=[]; end; if (nargin<7), zoomdn=[]; end; if isempty(basediff), do_norm=0; else, if abs(basediff)>0, do_norm=1; else, do_norm=0; en...
6932d51677d26d2fb2c1d0eeb3f1b538effda88c5cf2a3d49f1aeff9cab5ffa0
MATLAB
3,517
116
function PETHSpikes = bz_PETH_Spikes(events,varargin) %% input parsing p = inputParser; addParameter(p,'basepath',pwd,@isstr); addParameter(p,'cellnums',[],@isvector); addParameter(p,'eventCategory','timestamps',@isstr); addParameter(p,'eventNumber',1,@isvector); addParameter(p,'secondsBefore',0.5,@isvector); addPara...
97e5302993ea99416bceb920f71d04fc2c8f79a2d88f764c4468794cd4aad201
MATLAB
3,517
82
function [handles, ListOfImageNames] = listselectedfiles(handles) ListOfImageNames = handles.Datalist; if handles.datatype == 1 [filelist, filepath, cCheck] = uigetfile({'*.tif'; '*.tiff'},... 'Select Movies To Be Processed', ... 'MultiSelect', 'on');...
b56653b62133fc3a98ca61913e191d76db9544871ef8aff4ab122d67980b2a8f
MATLAB
3,517
128
function z = plus( x, y, isdiff, cheat ) % Disciplined convex programming information for PLUS: % Both terms in a sum must have the same curvature. Real affine % expressions are both convex and concave, so they can be added to % any nonlinear expressions. Complex affine (or constant) % expression...
b35302c02ae5b4614173b3adfd1f703a2a4245a95dac67ee5d48c4aa69805b10
MATLAB
3,521
72
function dists = pairdist(X,varargin) %PAIRDIST Computes a pairwise Euclidean distance matrix. % DISTS = PAIRDIST(X) returns a symmetric positive definite matrix DISTS % such that the DISTS(i,j) is the Euclidean distance between the vectors % X(i,:) and X(j,:). X must be a real-valued matrix. % % DIST...
c98e868653195329599fa498cb0fb5f90b040e266ce744d054a6df7276b9e5e6
MATLAB
3,521
95
%% ============================================================ % WT Habituation: behavior-conditioned calcium AUC %% ============================================================ clear; clc; outdir = '/Users/rongsong/Library/Mobile Documents/com~apple~CloudDocs/Documents/tex/Simulation_Model_2026/matlab/tracking_data...
34aed8bddb7b3c8e473ce6c6d22554a15f9c759bdef61cf84e335ebce556cb63
MATLAB
3,523
77
grangerspctrm = eval(['grangerspctrm_', sourceArea, '2', targetArea, '_topo', topoArea]); GC_tuning = eval(['GC_tuning_', sourceArea, '2', targetArea, '_topo', topoArea]); chs2Avg = eval(['chs2Avg', topoArea]); %% GC TFR nCh = size(grangerspctrm, 2); figure; plotSize = mu.autoplotsize(nCh); for cIndex = 1:nCh mu....
8f1215df3dfa0f12bd1696f5f54e51b563b84a4df01aa0471dd6ef9651982176
MATLAB
3,523
145
function y=myOISmap1(data,parms,sparms,tparms) % Usage ... y=myOISmap1(data,parms,sparms,tparms_or_mask_apply) % % parms = [ntrials,nimtr,noff] % stim_parms = [nimstim nskp] % tc_parms = [thr mincthr maxcthr smw maskflag] do_figure=1; do_applymask=0; if nargin<4, tparms=[]; end; if nargin<3, sparms=[]; end...
4eff49140f18d6ccef76a1300a8c4e9b49a4dd9841e59cfba9637823cf304e4b
MATLAB
3,524
63
function varargout=ea_normalize_spmnewseg(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 recon...
ac44af6517aad4cb43880114eddebaba2c6227823a18776afa7ed4657407a555
MATLAB
3,525
111
function [bc,E] = betweenness_centrality(A,varargin) % BETWEENNESS_CENTRALITY Compute the betweenness centrality for vertices. % % bc = betweenness_centrality(A) returns the betweenness centrality for % all vertices in A. % % [bc,E] = betweenness_centrality(A) returns the betweenness centrality for % all vertices in ...
daaef91741e0f5cd983ad525d90f853564b6021ad4176f37de6092b268de1782
MATLAB
3,526
96
function newdata=struct2jdata(data,varargin) % % newdata=struct2jdata(data,opt,...) % % convert a JData object (in the form of a struct array) into an array % % authors:Qianqian Fang (q.fang <at> neu.edu) % % input: % data: a struct array. If data contains JData keywords in the first % level children, t...
f30902e24293b53f111699875267fb7ed106ca139fbec058d760c08f48b97bde
MATLAB
3,528
116
% Digital circuit sizing (vectorized) % Boyd, Kim, Vandenberghe, and Hassibi, "A Tutorial on Geometric Programming" % Written for CVX by Almir Mutapcic 02/08/06 % (a figure is generated) % % Solves the problem of choosing gate scale factors x_i to give % minimum ckt delay, subject to limits on the total area and power....
414816919ee9c8e15ac1986184ac644756875c73fe1f7e0b536edc04aab9c98f
MATLAB
3,529
87
function xSE = ent_xsamp(x,y,m,R,norm) % xSE = ent_xsamp(x,y,m,R,norm) % Inputs - x, first data series % - y, second data series % - m, vector length for matching (usually 2 or 3) % - R, R tolerance to find matches (as a proportion of the average % of the SDs of the data sets, usually ...
db0242bbb5d03c55a8af79e741c158821937d95c6d1f83164682e0150545f5ff
MATLAB
3,530
118
function OUTPUT = openNSxHL(fname) % openNSxHL % % Opens and reads an NSx file without the header information and returns % the binary data. This can be used for specific applications that require % this type of data, e.g. Klusters. Works with File Spec 2.1, 2.2 and 2.3. % It does not support pauses at this time. % %...
b75144840cbbf4c84bbec973e37438cbc89b7a3111781e90d8c86feb28cbb8de
MATLAB
3,531
118
function [data,eid,name] = DBGetValues(query,direction) %DBGetValues - Group values for all variables that match given criteria. % % Concatenate individual values for all variables matching the optional query. % Values must be scalars, vectors or matrices. Concatenation can be performed % horizontally or vertically...
0c2fd9d9815520dcad505be0a04e6b1ecd3ce5cb78b05c4b288858073205d55b
MATLAB
3,534
103
function [node,elem,face]=cgalv2m(vol,opt,maxvol) % % [node,elem,face]=cgalv2m(vol,opt,maxvol) % % wrapper for CGAL 3D mesher (CGAL 3.5 or up) % convert a binary (or multi-valued) volume to tetrahedral mesh % % http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Mesh_3/Chapter_main.html % % author: Qianqian Fang (fangq...
22e838f5c0f6b583ad41ae8479f933f44591fa61ad627a9d78588aafbe144ca6
MATLAB
3,534
92
classdef CondColocGeneralProcess < ImageAnalysisProcess %Concrete class definition to run general conditional colocalization %Jesus Vega-Lugo December 2021 % % Copyright (C) 2021, Jaqaman Lab - UTSouthwestern % % This file is part of conditionalColoc. % % conditionalColoc is free software: you can redistribu...
eda7bfdd2208f48f40e3bf77ca1585e3c44376bc87175dfab12bcd85a75d28f1
MATLAB
3,535
93
% std_fileinfo() - Check uniform channel distribution accross datasets % % Usage: % >> [struct filepresent] = std_fileinfo(ALLEEG); % Inputs: % ALLEEG - EEGLAB ALLEEG structure % % Outputs: % struct - structure of the same length as the ALLEEG variable % containing all the fields in...
fe6a63e6d913f4b8b9bfd4263c91a0959eed976ee48bd3a37c5d7b950a707484
MATLAB
3,535
72
% std_pvaf() - Compute 'percent variance accounted for' (pvaf) by specified % ICA component clusters. This function computes eeg_pvaf on each % of the component of the cluster and then average them. See % eeg_pvaf for more information. This function uses the % Usage: % ...
185782716c87bf6647d872142060efa788b58bd0d3e7d2d1b990a2ffa486400b
MATLAB
3,536
139
%%************************************************************************* %% mybicgstab %% %% [xx,resnrm,flag] = mybicgstab(A,b,M1,tol,maxit) %% %% iterate on bb - (M1)*AA*x %% %% r = b-A*xtrue; %% %%************************************************************************* function [xx,resnrm,flag] = mybicgstab(A,b...
4bcb70ef55d6583e15be3179953ba1d486ab24703686745c28201c4d88eb0bc0
MATLAB
3,537
149
%%%%%%%%%%%%%%%%%%% %% Zicheng Yang @CCMU %% %% Version: YZC 2021/5/9 calculate the correct rate %%%%%%%%%%%%%%%%%%% clear all; close all; % load files actfile = 'x'; % parameters Fs = 100; Ts = 1/Fs; correctCue =2; pre_time = 3; trial_time = 15; ntrialpersess = 20; isoneodorcase = false; ...
38b314d9696954901c6648fe8f804dfc5fd13fa2fb47f8cacfab27f0132474fa
MATLAB
3,541
101
function [model, p_lr] = CBIG_ASDf_logReg_clusterBehavAssoc(cluster_idx, id_scoreGrp, ... sub_info_file, behav_score_file, idx_score) % [model, p_lr] = CBIG_ASDf_logReg_clusterBehavAssoc(cluster_idx, id_scoreGrp, % sub_info_file, behav_score_file, idx_score) % % Performs logistic regression to compare ASD participa...
6f95a8f1c281fd7ca532b58e2230b89a58d299210336bb38b5a5340745aab927
MATLAB
3,543
105
% pop_loaddat() - merge a neuroscan DAT file with input dataset % (pop out window if no arguments). % % Usage: % >> OUTEEG = pop_loaddat( INEEG ); % pop-up window mode % >> OUTEEG = pop_loaddat( INEEG, filename, no_rt); % % Graphic interfance: % "Code signifying no event ..." - [edit box] reaction ...
c77c27391714951800e62e3fa74adea6465c2ab567406f943f4b06db8a5f8847
MATLAB
3,544
87
function [X,data] = kamada_kawai_spring_layout(A,varargin) % KAMADA_KAWAI_SPRING_LAYOUT Use springs to compute a graph layout % % X = kamada_kawai_spring_layout(A) computes a layout for an undirected % graph, connected graph by simulating a system of springs. % [X,data] = kamada_kawai_spring_layout(A) returns extra dat...
c1a2e8133a7458065cefc98d174f6859426ccc529dc7faf87dee05683988e94d
MATLAB
3,546
127
function averageOIS2(fname,fps,ntr,noff,nper,nfa,zoomdn,basediff) % Usage ... averageOIS2(fname,fps,ntrials,offset,trialdur,desiredres,zoomdown,basediff) if (nargin<8), basediff=[]; end; if (nargin<7), zoomdn=[]; end; if isempty(basediff), do_norm=0; else, do_norm=1; end; if isempty(zoomdn), zoomdn=...
c2686aa1e1826fa10a5def9f83f115226727d833cb3129e15f36399342e45c2d
MATLAB
3,546
101
function [D,P] = all_shortest_paths(A,varargin) % all_shortest_paths Compute the weighted all pairs shortest path problem. % % D = all_shortest_paths(A) returns the distance matrix D for all vertices % where D(i,j) indicates the shortest path distance between vertex i and % vertex j. % % For the Floyd-Warshall algori...
7d5133dc4c86cdc906fe96f2ba5d8dcbf841b8a1cabe5f49727e8b07a7c45792
MATLAB
3,547
124
function y = sincFilter(x,Wn,N,dim) %SINCFILTER Apply a near-ideal low-pass or band-pass brickwall filter % % Y = IOSR.DSP.SINCFILTER(X,WN) applies a near-ideal low-pass or % band-pass brickwall filter to the array X, operating along the first % non-singleton dimension (e.g. down the columns of a matrix). The % ...
e4657c0ea9cbec2538e4b22fca0a87661392a6a9efc44b0ad5123e628e2a4fe0
MATLAB
3,547
119
function [a, cb] = plot_cortical(data, varargin); % % Usage: % [a, cb] = plot_cortical(data, varargin); % % Description: % Plot cortical surface with lateral and medial views (authors: @MICA-MNI, @saratheriver) % % Inputs: % data (double array) - vector of data, size = [1 x v] % % Name/value pairs: % surface...
ff69f6b81f36f35858ff90b88d4d5647964f4c8f2f84ca4908d529624305e8c9
MATLAB
3,547
106
% Date: 05-10-2026 % export_instr2_task_lesion_anti_to_excel.m % Description: Export two-modality one-layer lesion-result .mat files from % trained_models/one_layer_models/instr2/task_lesion_anti into a single Excel % workbook with one sheet per .mat file. This folder corresponds to the % cue-fixed-to-mod1 analysis and...
0b968a25a3830a37dd8e3cbe4f3d407bea1b0f4ba263e0ab1b41cad3f309ebba
MATLAB
3,548
106
% Date: 05-10-2026 % export_instr2_task_lesion_anti_to_excel.m % Description: Export two-modality one-layer lesion-result .mat files from % trained_models/one_layer_models/instr2/task_lesion_anti into a single Excel % workbook with one sheet per .mat file. This folder corresponds to the % cue-fixed-to-mod1 analysis and...