sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
caac332c430bf70ca4fbe71f2c2b8dd855f3dad9cf0860eeb8d889ad6017ec46
MATLAB
9,281
266
% shifting_key_n = floor(tiling_info.z_pixel./z_truncate); % shifting_key_n = 20; % z_truncate = floor(tiling_info.z_pixel./shifting_key_n); clear stitching_queue tform kk = 0; for ii = 1:size(read_file_name,1)-1 for jj = 1:size(read_file_name,2) kk = kk+1; stitching_queue(kk).tile_1 = ...
7260230b3b063aa9b7a3230c39b118bb6de34b48b25a37be5cab70dd42cd8960
MATLAB
9,289
301
function [x y pos trials map mapping] = getBehavEvents_linearTrack(pos,bins) dbstop if error scatter(pos(:,8),pos(:,10),'.') % axis([-1 1 -1 1]) [x y]=ginput(); cx = x(end-1:end); y = y(end-1:end); dist(:,1)=fastrms(abs(pos(:,8)-x(1))+abs(pos(:,10)-y(1)),120); dist(:,2)=fastrms(abs(pos(:,8)-x(2))+abs(pos(:,10)-y(2)),1...
a4e965787687eb63a454c6cfd9041a02096dd4ef9c49ac8c3660ea4677ec6bcf
MATLAB
9,293
328
function [chansel, trlsel, cfg] = rejectvisual_channel(cfg, data) % SUBFUNCTION for ft_rejectvisual % determine the initial selection of trials ntrl = numel(data.trial); trlsel = true(1, ntrl); % determine the initial selection of channels nchan = numel(data.label); chansel = true(1, nchan); % compute the sampl...
cbee11e016b1f7fa30214bbd572f1c8003405653d3155c9a0c4f69ab6af8d990
MATLAB
9,299
156
function [DegreeCentrality_PositiveWeightedSumBrain_LH, DegreeCentrality_PositiveWeightedSumBrain_RH, DegreeCentrality_PositiveBinarizedSumBrain_LH, DegreeCentrality_PositiveBinarizedSumBrain_RH, GHeader_LH, GHeader_RH] = y_DegreeCentrality_Bilateral_Surf(InFile_LH, InFile_RH, rThreshold, OutputName_LH, OutputName_RH, ...
8de44a684a7df051125a77928f05dd34b64d321699a20734dd66985f1a71c13b
MATLAB
9,314
196
function model = combineModels(modelArray,simType) % arguments % modelArray (1,:) MCmatlab.model % simType (1,:) char % end % Verify that G properties are identical Gprops = {'nx','ny','nz','Lx','Ly','Lz','mediaPropertiesFunc','mediaPropParams','geomFunc','geomFuncParams'}; for iProp = 1:numel(Gprops...
b60c6ecdd560f221e83e0c08d8000d6d2541b2c2121629e835a7817f2e1218cb
MATLAB
9,314
231
function varargout = h_searchForGroupGUI3(varargin) % H_SEARCHFORGROUPGUI3 M-file for h_searchForGroupGUI3.fig % H_SEARCHFORGROUPGUI3, by itself, creates a new H_SEARCHFORGROUPGUI3 or raises the existing % singleton*. % % H = H_SEARCHFORGROUPGUI3 returns the handle to a new H_SEARCHFORGROUPGUI3 or t...
f49f6587e0bf74bf4c2a597666d0980fb90b1c135e79e2a9e9bac7acd6811ee7
MATLAB
9,315
264
function [allRct, allSim, allIc] = kernelTracker( I, prm ) % Kernel Tracker from Comaniciu, Ramesh and Meer PAMI 2003. % % Implements the algorithm described in "Kernel-Based Object Tracking" by % Dorin Comaniciu, Visvanathan Ramesh and Peter Meer, PAMI 25, 564-577, % 2003. This is a fast tracking algorithm that utili...
22cf94bde726d8787cc004adaa424280331cedc6dacd899f62f954c1cfcc6e3c
MATLAB
9,316
279
function hh = errorbar2016(varargin) %ERRORBAR Plot error bars along curve % ERRORBAR(Y,E) plots Y and draws a vertical error bar at each element of % Y. The error bar is a distance of E(i) above and below the curve so % that each bar is symmetric and 2*E(i) long. % % ERRORBAR(X,Y,E) plots Y versus X with s...
303584e1526a1a5af4f813606af3da0f0d02707a3612d76031efc5305663f296
MATLAB
9,326
223
function [cfg] = ft_topoplotIC(cfg, comp) % FT_TOPOPLOTIC plots the topographic distribution of an independent % component that was computed using the FT_COMPONENTANALYSIS function, % as a 2-D circular view (looking down at the top of the head). % % Use as % ft_topoplotIC(cfg, comp) % where the input comp structure ...
cfcc95954be5d4b641365685187959e1242ca812131639c290b30c890a1aea77
MATLAB
9,327
356
% Imbed a file menu to any figure. If file menu exist, it will append % to the existing file menu. This file menu includes: Copy to clipboard, % print, save, close etc. % % Usage: rri_file_menu(fig); % % rri_file_menu(fig,0) means no 'Close' menu. % % - Jimmy Shen (jimmy@rotman-baycrest.on.ca) % ...
bf59ee8c26bb2a04adb701ebe954357ba9b0da16b7b5be3e4d805e3385a3e39c
MATLAB
9,331
288
function varargout = ginput_w(arg1) %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse. Data points are entered by pressing % a mouse button or any key on t...
7f77b3d7d2ec61cb895eeddee547a0c0a4cad63d4e0062e21e436cc3d200c72f
MATLAB
9,336
278
%-------------------------------------------------------------------------- % Pipeline to analyse DF/F activity for GAD67 project %-------------------------------------------------------------------------- % % >>> REQUIRED THIRD-PARTY CODES >>> % - abfload (F. Collman). https://github.com/fcollman/abfload %------...
d66d1c8db023039def67b9ad1079dfea21b453bfd9a9e46f64135e3ab33d5aa2
MATLAB
9,337
288
function [Xbest,vbest,idx,totalcost,poslambda,misscost] = ... ChooseBestTrajectory_MissDetection(X,appearancecost,varargin) % Select trajectory through CPR-generated replicate clouds % % X: [DxTxK] full CPR tracking results % appearancecost: [TxK] scalar cost for each shape % % Xbest: [DxT] selected replicates repre...
20d928055b1688d42ea1ff4f5ddc80261c6dea6620904957fc6e0ca89119457b
MATLAB
9,341
226
function [y_p, y_t, acc, pred_stats] = CBIG_KRR_test_cv( bin_flag, kernel_train, kernel_test, ... y_resid_train, y_resid_test, y_orig_test, with_bias, lambda, threshold, saving_stats ) % [y_p, y_t, acc] = CBIG_KRR_test_cv( bin_flag, kernel_train, kernel_test, ... % y_resid_train, y_resid_test, y_orig_test, lam...
b20d45781ffea08f0b903d5dadcb6ff7d8fa2502ee26dca2e14e92daaa3f2df7
MATLAB
9,358
364
function [info,meas] = fiff_read_meas_info(source,tree) % % [info,meas] = fiff_read_meas_info(source,tree) % % Read the measurement info % % If tree is specified, source is assumed to be an open file id, % otherwise a the name of the file to read. If tree is missing, the % meas output argument should not be specified. ...
a9fe7f0b3d4cf66a3d2ff66eb795cad4f78895cf794012bc309cb2beba137b2b
MATLAB
9,360
331
function [chansel, trlsel, cfg] = rejectvisual_trial(cfg, data) % SUBFUNCTION for ft_rejectvisual % determine the initial selection of trials ntrl = length(data.trial); if isequal(cfg.trials, 'all') % support specification like 'all' cfg.trials = 1:ntrl; end trlsel = false(1,ntrl); trlsel(cfg.trials) = true; % de...
9f14ba4d78102040327c13ed38dd6cf30334cbe596ce358404f76a90017be382
MATLAB
9,363
240
function grad = yokogawa2grad_new(hdr) % YOKOGAWA2GRAD_NEW converts the position and weights of all coils that % compromise a gradiometer system into a structure that can be used % by FieldTrip. This implementation uses the new "yokogawa_meg_reader" % toolbox. % % See also FT_READ_HEADER, CTF2GRAD, BTI2GRAD, FIF2GRAD,...
9d3b733a78eb29b1d1136e7fafc6b39a7c26444a14b95fc41dd3ae60f4105cdd
MATLAB
9,373
260
function [ adjmat ] = meglegacy_calcConn( catdata, srate, varargin ) %MEGLEGACY_CALCCONN Calculate connectivity from a set of virtual sensor % time series, across trials. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % adjmat = meglegacy_calcConn(catdata, srate, ...) % %%%%...
fee98dce8f590ac170e8b292a1a7808d510a0f55684a2e058b8612113d764554
MATLAB
9,373
260
function [hRect,api] = imrectLite( hParent, pos, lims, ar, varargin ) % A 'lite' version of imrect [OBSOLETE: use imrectRot]. % % There are significant problems using imrect in a larger GUI, mostly % due to the fact that imrect is such a heavy object. This creates a % simple, fast, and in some ways nicer version of im...
f9deeb9efeb7012485b3da9dd1c7f4830a677d760118df9585c448e5083bd685
MATLAB
9,376
225
% plot_spotcheck.m % Sarah West % 12/1/21 % Plots a subset of the saved "spotcheck" frames from preprocessing and % saves the plots. Makes a plot for each stack, also a plot for each day. function [] = plot_spotcheck(parameters) dir_in_base = parameters.dir_in_base; % For each mouse for mousei = 1:...
6c7c22d474df388a041f1bcca929cecb7954e67c6e0bc8150a4e1563d15461bb
MATLAB
9,378
343
function [xi,eta,F,out,K_opt] = VBEM_GM(y,K,options) % function [xi,eta,F,theta,K_opt] = VBEM_GM(y,K,options) % This function is a VB scheme for the MoG classifier. % IN: % - y : the pxn data matrix, where n is the number of % 'observations' to be classified, and p is the dimension of each of % these observation...
579132ac0ca9f70426f5aef1baa5681a0c17e500c3216f8986ba316ef351b47f
MATLAB
9,381
179
function ImageArray_CorrAmp_fix = Advanced_Fix_Splitting(ImageArray_CorrAmp,... FramesPerSequence, PersistenceChecker, PersistenceOption, MaxPersistence, TrackingMaskMethod, MinAreaTrackingMask,DisplayOn) warning on all warning off backtrace warning off verbose % PersistenceChecker=1 % MaxPer...
8c0114331469b1d0f3cecfdbccaff9ba4d2967bd03ebc3b5759a487366940803
MATLAB
9,384
352
%% Compare different classification algorithms on a number of data sets % This is similar to classificationShootout, except we (1) pick a gamma for % all methods to use, (2) also compare performance on larger data sets % using linear kernels, (3) cross validate over a sparser range. %% % Based on table 2 of % ""Learn...
79edf697e82f14533a4b1e69af1658475b8e4ee9cce09e7c25d847c7d6e2da47
MATLAB
9,386
271
function [Maxima,MaxPos,Minima,MinPos]=MinimaMaxima3D(Input,Robust,LookInBoundaries,numbermax,numbermin) % V 1.0 Dec 13, 07 % Author Sam Pichardo. % This function finds the local minima and maxima in a 3D Cartesian data. % It's assumed that the data is uniformly distributed. % The minima and maxima are calculated usi...
4392f61c124da53041b48eda62b3fe372b0297e8ac71829574e971604a51b923
MATLAB
9,388
251
%% computeSDO_testStatSig % Having calculated SDO significance w/ computeSDO_performstats, % screen significant combinations for later plotting; % --> We can elementwise recreate these, as necessary %// We use 2 types of stats: Sum-of-squared errors of the SDO (or % derivative values) between the shuffles and unit, o...
76bc97f35b573c939358d42012af09a387c5084dcd29b45247fd3367c2d6a90d
MATLAB
9,388
259
%% for passive touch, finds the onset of the first peak, late wave, and also the peak times clear close all Fs = 2500; %paths to the relevant data sets for Figure 2 dataPaths{1} = '/Users/danielgonzales/Desktop/Grids manuscript/Data/Passive Touch/1-2022-04-19_Baclofen_3-baseline/'; dataPaths{2} = '/Users/danielgonz...
ac66853d879f2db73568f3b8e555f75bf93ad9c501dfe585a953fe8e63ba6933
MATLAB
9,391
298
function [diagnostics,out] = VBA_getDiagnostics(posterior,out) % derives post-hoc diagnostics of VBA's model inversion % function [diagnostics,out] = VBA_getDiagnostics(posterior,out) % Post-hoc diagnostics include: goodness-of-fit metrics, Volterra kernels, % null model evidence, posterior entropies, etc... % IN: % ...
ed7f6e9cd4fd95261fa4c7b75e26a994a2ff573112ecfd9764d01090df513c8d
MATLAB
9,392
281
function params = metamerAnalysis(oim,m,opts) % %----------------------------------------- % params = metamerAnalysis(oim,m,opts) % % computes statistical parameters of an image % within a family of overlapping, tiling % regions defined by windows % (see metamerParams.m and metamerSynthesis.m) % % oim: original image ...
8282976e56abd2c64019fa20f5fd04250deab32aee2d7b8328664b5699b5dac5
MATLAB
9,398
247
function Perm_Mixed_LCS_Figs2(dataOut,IM,B,params) % This function is the same as Perm_Mixed_LCS_Figs except that it does not % plot the block-wise FPR values. Also, it plots the FPR-p-vals for both % Chi-squared and HG to see dynamic range if ~exist('B','var'),B=1;end Pth=0.05./B; PthMcN=0.05; [NNidx,Tidx,TNi...
ae74abc64010f436b03bfc055f0ecb4a700f77d13879781ed6272d30dbb86de9
MATLAB
9,401
234
ti = 0; vs = 40; tauk = 5; %Cambiar también dentro de la funcion de histeresis_model gH = 1.6*10^-6; gL = 0.5*10^-6; Cm = 1*10^-9; Vm = 0.1; V1 = 2; lamda_ini = 0; Rs = 250000; Vs = 0.7; Vr = -0.4; ns = 1; nr = 1; nt = (1/ns + 1/nr)^-1; vt = (Vs/ns + Vr/nr)*nt; I_tot = simulate_histeresis(vs,ti,tauk,gH,...
016021a67ee73c3e78ec393172f64cfd439328168f457d883205afcfc5034963
MATLAB
9,408
263
function [eta, Heta, inner_it, stop_tCG] ... = tCG(problem, x, grad, eta, Delta, options, storedb, key) % tCG - Truncated (Steihaug-Toint) Conjugate-Gradient method % minimize <eta,grad> + .5*<eta,Hess(eta)> % subject to <eta,eta>_[inverse precon] <= Delta^2 % % See also: trustregions % This f...
c23ecc439932ab11dad8ae05eae6ecb80b054cdf2758f86a1bcc8c1f101603b7
MATLAB
9,409
223
function [ acc_corr_train, acc_corr_test, mse_test, y_predict] = ... CBIG_LRR_workflow_1measure( params ) % [ acc_corr_train, acc_corr_test, mse_test, y_predict] = ... % CBIG_LRR_workflow_1measure( params ) % % Inputs: % params is a struct containing the following fields: % % --> Compulsory fields: % - p...
3f45b39bf4135d1a8bcc8825eae37837e2e50365fc1807c239f3cfa7b9f0c412
MATLAB
9,413
301
function [fH,figNames,Pk] = meg_selectChannels(sessionDir,data) % MEG_SELECTCHANNELS(sessionDir) % % INPUTS % sessionDir % data % matrix time x channel x trial % % Karen Tian % January 2020 %% channel selection method selectPeak = 0; % sorts channels by ERF peak selectThreshold = 1; % selects channels that cr...
d9f0f93a9ec0ad62212ef527896ad09c816717da53dfd0d04cbd7bd6e20df263
MATLAB
9,414
271
function [Maxima,MaxPos,Minima,MinPos]=MinimaMaxima3D(Input,Robust,LookInBoundaries,numbermax,numbermin) % V 1.0 Dec 13, 07 % Author Sam Pichardo. % This function finds the local minima and maxima in a 3D Cartesian data. % It's assumed that the data is uniformly distributed. % The minima and maxima are calculated usi...
37dc02a0ccccff0212cc6978f5c6f8d6008582d6a0df590781348948087a06c6
MATLAB
9,415
277
%% prediction Error % Output Class for carrying the error predictions associated with the % output measurement of two pxtDataCells % % Implemented as a class to reduce overhead w/ predictions. %_______________________________________ % Copyright (C) 2024 Trevor S. Smith % Drexel University College of Medicine % % Thi...
5d5bfa7fe12e8ffe33508703844b8f8a2647672e153ce856d11445041ca026c7
MATLAB
9,425
261
function [result] = VBA_susceptibility(posterior,out,ind) % scores the susceptibility of u->y relationships w.r.t. model parameters % [result] = VBA_susceptibility(posterior,out,ind) % IN: % - out/posterior: the output structures of the VBA inversion % - ind: a structure containing the following fields: % .u ...
7c75850cec86bc7adae377a3941a47836c485aff51bd0e4931f7cd9771e6f35b
MATLAB
9,426
173
function shuffled_track = run_shuffles(shuffle_choice,analysis_type,num_shuffles,decoded_replay_events) % computes shuffles on replay events % shuffle_choice- determines what type of shuffles will be performed, entered as a string % % analysis type- vector of 0's and 1's for which replaying % scoring method is used [l...
094488715ececd5617068f60b06b63ecdefb5bd5afcc40c6d6a405b34333a762
MATLAB
9,427
229
% Written by Tianyin Xu % Edited by: Adam Wright % Last modified: 20140711 % This function will create an R2 mean map from 100 randomly sampled % datasets. %Inputs: % fMRI_data -- the fMRI object (created from load_nifti.m) % physio -- the physiology file. % Files created: % R2mean_100trial_wholeBrain.nii.gz -- t...
14f7c9c10182e586c8022a15a41e5a3d9bbd414a1e9ace1671dbf49b2d99363b
MATLAB
9,431
304
%% Gen splits, round1 track trkSet50Tst200 = any(parts50(:,end-3:end),2); nnz(trkSet50Tst200) trkSet50Comp = any(parts50(:,2:end-4),2); nnz(trkSet50Comp) unique(trnSet50+trkSet50Tst200+trkSet50Comp) save trnSplits_20180418T173507.mat -append trkSet50Tst200 trkSet50Comp %% Browse results, round* track load trnDataSH_...
d6521afbc42eb62d4e8dfcc0d9d7c69a428aab982748386f733bb76b3901c552
MATLAB
9,435
246
function [grandavg] = ft_sourcegrandaverage(cfg, varargin) % FT_SOURCEGRANDAVERAGE averages source reconstructions over either multiple % subjects or conditions. It computes the average and variance for all % known source parameters. The output can be used in FT_SOURCESTATISTICS % with the method 'parametric'. % % Alt...
738298ceda42af3d884765981f3e9bd92ded1c57a602b4cf626d1d9fcb852e23
MATLAB
9,436
233
function [spectrum,freqoi,timeoi] = ft_specest_wavelet(dat, time, varargin) % FT_SPECEST_WAVELET performs time-frequency analysis on any time series trial data % using the 'wavelet method' based on Morlet wavelets, doing convolution in the time % domain by multiplication in the frequency domain. % % Use as % [spectr...
b4cc9621f6481b4035215883ae21cc82a64b948922b7ab56f1fb8afc7e160572
MATLAB
9,437
337
%% Compare different classification algorithms on a number of data sets % This is similar to classificationShootout, except we (1) pick a gamma for % all methods to use, (2) also compare performance on larger data sets % using linear kernels, (3) cross validate over a sparser range. %% % Based on table 2 of % ""Learn...
0246812228dc4006e4b75d6f7ae4ae43ad809c12cbe602457573bd202b6d7427
MATLAB
9,441
246
classdef UncertainFramesModel < handle % Holds computed data about bouts of frames with low tracker confidence % for the current movie. properties (Access=private) quantileConfidenceThreshold_ = 0.99 % scalar double, the quantile threshold (0-1) for filtering bouts. end properties (Transient, Acce...
7992935941afc9b553d23e311be8bbeab1dffc3884b3e775acd56d6f3757e007
MATLAB
9,441
186
%% connectivity_and_cytoarchitecture for init_project = 1 % set directories GH = '/Users/cpaquola/Documents/GitHub/'; % github repo location homeDir = [GH '/DMN']; % home directory bbwDir = [GH '/BigBrainWarp']; % BigBrai...
b23d58612b08e498353a0a9d6748eb7037314d3b298c64532a95f0416802b83e
MATLAB
9,443
234
function [data, varargout] = femdata_stnd_FD(mesh, frequency, varargin) % FEMDATA_STND_FD Calculates data (phase and amplitude) for a given standard % mesh at a given frequency (Hz). Outputs phase and amplitude in the % structure DATA. % % SYNTAX: % [DATA] = FEMDATA_STND_FD(MESH, FREQUENCY) % [DATA] = FEMDATA_ST...
fc1b4a113225854d18e7f785e1745112ccfadeca7a3cf4a41aa1f22ab47c93bd
MATLAB
9,443
297
classdef Container < handle %uix.mixin.Container Container mixin % % uix.mixin.Container is a mixin class used by containers to provide % various properties and template methods. % Copyright 2009-2016 The MathWorks, Inc. % $Revision: 1602 $ $Date: 2018-05-01 10:23:15 +0100 (Tue, 01 May...
56dd12826e7e9e20ddc2b611cb9c8ffd6dbc2560175732070d8fd0fce3dcd2ef
MATLAB
9,444
329
% Cleaned-up version of init_calib.m fprintf(1,'\nProcessing image %d...\n',kk); eval(['I = I_' num2str(kk) ';']); if exist(['wintx_' num2str(kk)]), eval(['wintxkk = wintx_' num2str(kk) ';']); if ~isempty(wintxkk) & ~isnan(wintxkk), eval(['wintx = wintx_' num2str(kk) ';']); ...
a9901069f989c68ce5ba7a2910447f0efbfaee94ab116893d2b682fe522d6660
MATLAB
9,446
304
function F = srskelf(A,x,occ,rank_or_tol,pxyfun,opts) % SRSKELF Strong recursive skeletonization factorization (symmetric % positive definite only). % % F = SRSKELF(A,X,OCC,RANK_OR_TOL,PXYFUN) produces a factorization F of % the interaction matrix A on the points X using tree occupancy % paramet...
d5ac9173982b212ed7f7cf26b2f11a2e12ef298f7b1e19f61c83a590fb7486d6
MATLAB
9,446
328
%% Nodes intelligence theories % Scope: Determining nodes corresponding to intelligence theories % Date: 10.03.2023 % Author: Jonas A. Thiele %% Multidemand (MD) Diacheck schaefer_atlas = niftiread('Schaefer2018_100Parcels_17Networks_order_FSLMNI152_2mm.nii.gz'); multidemand_atlas = niftiread('Multiple dema...
9703ac71170f078f59e18e4bb1e5c66e43ce76e92c6db7bce3ca249f3cbd9c39
MATLAB
9,448
183
function PARAMS = initializeParameters( subjectName, subjectID ) % (c) Coraline Rinn Iordan 10/2017, 03/2018 if nargin < 2, error( 'Must provide subject name and ID.' ); end initStartTime = GetSecs; %%%%%%%%%%%%% %%% SETUP %%% %%%%%%%%%%%%% rng( 'shuffle' ); PARAMS.SUBJECTNAME = subjectName; PARAMS.SUBJECTID = su...
9eda699bfeca8fc8b02bf0059e8a0a05230231e28326fefd8260852c1141763c
MATLAB
9,449
320
function [tbls,medmindist,kvals,savename] = ComputePixelPrecisionTable(gtdata,varargin) [kfracs,nets,legendnames,colors,exptype,... conddata,labeltypes,datatypes,... pttypes,annoterrdata,... savedir,savename,dosavefig,... threshmethod,threshprctile,modeli,... kvals] = myparse(varargin,'kfracs',.25:.25:2,... ...
031e0b8e7f41b77e4ebc6c1cbbb65b21915a0ff1081c1a45f86a141c833177d0
MATLAB
9,454
236
function VBA_spm_defaults % Set the defaults which are used by SPM %__________________________________________________________________________ % % If you want to customise some defaults for your installation, do not % modify this file directly, but create a file named spm_my_defaults.m % instead, accessible from MATLAB...
01b84b74832fa1fb308ccf8bbce6243486de9d52f8d94c6477aa7f585f5b95aa
MATLAB
9,455
283
classdef LabelLegendRoi < handle properties(SetAccess=private) xyData; javaLegend; btnCreate; btns; btnLbls; map; asked=false; buildingMultiplePolygons=false; dfltFile; save_output=false; output_folder=[]; ax; ro...
e59359e096f37f363e3542c42824d7799ddc463cba8ee3dab4a2a9a62d0cf55a
MATLAB
9,471
296
function [stat] = ft_networkanalysis(cfg, data) % FT_NETWORKANALYSIS computes various network graph measures from % between-channel or between source-level EEG/MEG signals. This function % acts as a wrapper aroun the network metrics implemented in the brain % connectivity toolbox developed by Olaf Sporns and colleague...
3699db003f83c804575c59eeda62a8750987647e04e54887a36e97ee53e7b531
MATLAB
9,473
190
classdef FlySongDetector < FeaturesDetector properties recording % Multi-spectral analysis properties taperTBP = 12; taperNum = 20; windowLength = 0.1; windowStepSize = 0.01; pValue = 0.05; % Sine song properties sineFreq...
ff1de3e181c67a492f854f890686e6c8e6f8055c970ad2e20dfeda1f0f671383
MATLAB
9,474
448
function [dat] = read_neuralynx_sdma(dataset, begsample, endsample, chanindx) % READ_NEURALYNX_SDMA read specified channels and samples from a Neuralynx splitted DMA dataset % % Use as % [hdr] = read_neuralynx_sdma(dataset) % [dat] = read_neuralynx_sdma(dataset, begsample, endsample, chanindx) % % The splitted D...
a04960d2a96fc5ec557864526f6c90f48ff3dd3042a24781cebdb18c0471fb45
MATLAB
9,478
295
% add dependencies addpath(genpath('C:/Code/wjn_toolbox-master')) addpath(genpath('C:/Code/wjn_toolbox')) addpath(genpath('C:/Code/leaddbs')) addpath(genpath('C:/Code/spm12')) %% Parcellate and export conmaps input_images = {'alpha_functional_network.nii', 'beta_functional_network.nii'}; % parcellation_image = 'Autom...
aa58e9f034abe451f7f2b944d02d005b1dcc0e3297e09150dac7c1a7b9e8d0e6
MATLAB
9,481
178
function plot_rate_remapping(option,varargin) f1= figure('units','normalized','outerposition',[0 0 1 1]); parameters=list_of_parameters; if strcmp(option,'TRACK_PAIRS') if ~isempty(varargin) switch varargin{1} case 'wcorr' load('rate_remapping_analysis_TRACK_PAIRS_wcorr'); ...
fccd5933ab147b5df9a7e237c16664092484bb73b212a2516c708b8656567122
MATLAB
9,488
218
function [exclusion_info, varargout] = detect_bad_data(Dm, varargin) % [out] = detect_bad_data(Dm) % Detect bad rows/cols in matrix Dm. % Detection is based on % - the mode (most common) value along each row/col % - the standard deviation of each row/col % Also flags dataset for exclusion based ...
1761cb8c826c0a521c78828eb60e5ddb30369e03bef168100acd643ab2bda4cb
MATLAB
9,489
226
function [bestpar, bestval, bestat, step, delay, p] = ... fitparam (model, startpar, goalstat, typestat, randiter, optiter, tuneiter, nosession, statweight, parange) % function [bestpar, bestval, bestat, step, delay, p] = ... % fitparam (model, startpar, goalstat, typestat, randiter, optiter, tuneiter, nosession,...
54736f6c9fe8d58700bb880803807e483daa994b0b2b5f7687ac120851cd136d
MATLAB
9,490
213
%% Script to make struct array for ACR1 tracked data % This only works with speicific folder,subfolder arrangement as in % selected_60-30_powdered_ACR1 subFolders = dir(pwd); realSubFolders = subFolders([subFolders.isdir]'); realSubFolders = realSubFolders(3:end); % Initialise video temporal parameters fps = 3...
9d62c66d0c4dcba47e7d01da33eff532981d97fa5c0b8d5d26d2ce2313118c91
MATLAB
9,495
206
%Analyze_Frontloading_Demo.m %This script analyzes alcohol drinking patterns to assess if %alcohol front-loading is present using the following %criteria: %1*. Of three detected change points, the change point with the best fit %is the earliest and/or is within the first half of the session. This %becomes the referenc...
b310f85fffab5b65df7bbb637aaa5c9698d5b60c34dad342a9753160aa5caba8
MATLAB
9,495
240
function [struct_edgevec, func_edgevec, common_ids, Initialization_Parameters] = ... fcn_SFC_Initialization_hl(work_dir, expected_ids, thresh_mode, preserve_percent, results_dir) % FCN_SFC_INITIALIZATION_HL Prepare SC and FC data for the SFC Toolbox. % This function receives all settings from the GUI, verifies SC/F...
627a1e673db83550e2996bb7fbc217a682e70607267af9cf5886878e96c18782
MATLAB
9,504
229
function embedding = optimize_layout3(head_embedding, tail_embedding, ... head, tail, n_epochs, n_vertices, epochs_per_sample, a, b,... gamma, initial_alpha, negative_sample_rate, verbose, min_dist) %OPTIMIZE_LAYOUT2 Another version of optimize_layout.m that slightly % optimizes the speed for MATLAB; in particu...
04b17d26382f57750f86e244dc2df40af606bacd76bb1f74050e82f0605ac824
MATLAB
9,515
163
function st = spm_cfg_st % SPM Configuration file for Slice Timing Correction %__________________________________________________________________________ % Copyright (C) 2005-2016 Wellcome Trust Centre for Neuroimaging % $Id: spm_cfg_st.m 7591 2019-05-15 10:57:38Z john $ %---------------------------------------------...
9d6695fdf97e2feb68c863fe09920b5436335cc81a49492609164ce40b3cc46e
MATLAB
9,519
300
%% tsdata_to_infocrit % % Calculate Akaike and Bayesian information criteria for VAR models from time series % data % % <matlab:open('tsdata_to_infocrit.m') code> % %% Syntax % % [aic,bic,moaic,mobic] = tsdata_to_infocrit(X,morder,regmode,verb) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and ...
ee259565b85fb83f413869454eb97a301b8fe0c7b5cdce02e79d510977330915
MATLAB
9,520
126
function DPABI_Stability_run(Cfg) % FORMAT DPABI_Stability_run(Cfg) % Perform Stability Analysis. Based on Li, L., Lu, B., Yan, C.G., 2019. Stability of dynamic functional architecture differs between brain networks and states. Neuroimage, 116230. % % Input: % Cfg - the parameters for stability analysis. % Output: % ...
c673ceca203d4258442b44de02ee9353b0c55b76e472e1ef351bd227d57c7266
MATLAB
9,521
111
function map = colmap(col,inv) % create colormap % % make colormaps based on pycortex: % https://gallantlab.github.io/colormaps.html % % colorset % {'Paired','viridis','terrain','rainbow','Spectral','Pastel1_r','RdBu_r','coolwarm'} % % inv: if 1 inverse color map; % % % % % Written by horikawa-t 20200225 %% ...
39523a5b9629b0ec63f61acd112f180b261e08f973d82c1bc30ce0805dc5f161
MATLAB
9,522
251
% MAIN SCRIPT % 3rd step of the multivariate moderation model framework: % runs the actual multivariate moderation model presented below % with the selected number of PCs % The idea here is to reduce the fMRI contrast in the chosen voxels to a % number of principal components and use them in a multivariate regressi...
c44d9219eca3d18f21ee1e4a68c8da67848b4279d7fde09d5700cdf5d2bc5d6a
MATLAB
9,524
262
function [distance_errors] = DG_ExSeq_reg_quality_vMS(img1,img2,params) % Originally written by Dan Goodwin, modified by Margaret Schroeder % Last update 12/14/22 (with comments), although original modifications % made far earlier in 2022 XRANGE = params.xrange; YRANGE = params.yrange; %determine...
4ee4962dbd8663aa82b68bf3cef52fd17eb4cf7934a497a0024f8ead84ca6af2
MATLAB
9,525
298
function M = essentialfactory(k, strSigned) % Manifold structure to optimize over the space of essential matrices. % % function M = essentialfactory(k) % function M = essentialfactory(k, 'signed') % function M = essentialfactory(k, 'unsigned') % % % Quotient representation of the essential manifold: deals with ...
a49b1e4846f12ac104e9c91e0299d1f643b569a67fe7973e81035b3a6c60feaf
MATLAB
9,534
336
function Result = Gradient_Calculation( ... InputData, InputFiles, InputType, ... OutDir, AlignmentType, ReferenceUI, ... nIterations, SparsityThreshold,nComp) % ========================================================= % DPABI_Gradient % ========================================================= % Function...
445d02685d1179f01e37ca45285a93d38764b02ec9fce4e970907c9c87e43a4d
MATLAB
9,553
255
function [grandavg] = ft_timelockgrandaverage(cfg, varargin) % FT_TIMELOCKGRANDAVERAGE computes ERF/ERP average and variance % over multiple subjects or over blocks within one subject % % Use as % [grandavg] = ft_timelockgrandaverage(cfg, avg1, avg2, avg3, ...) % % where % avg1..N are the ERF/ERP averages as obtai...
eb9cb8837613d117f4e0444463c34b877b2922cadfc4068604e38e73de6938c9
MATLAB
9,553
255
function [grandavg] = ft_timelockgrandaverage(cfg, varargin) % FT_TIMELOCKGRANDAVERAGE computes ERF/ERP average and variance % over multiple subjects or over blocks within one subject % % Use as % [grandavg] = ft_timelockgrandaverage(cfg, avg1, avg2, avg3, ...) % % where % avg1..N are the ERF/ERP averages as obtai...
78124136a272d07592a8ed96e99f0fcb07e7edd034368dc85632060e3c45f84c
MATLAB
9,558
252
function ft_audiovideobrowser(cfg, data) % FT_AUDIOVIDEOBROWSER reads and vizualizes the audio and/or video data % corresponding to the EEG/MEG data that is passed into this function. % % Use as % ft_audiovideobrowser(cfg) % or as % ft_audiovideobrowser(cfg, data) % where the input data is the result from FT_PREPR...
ba7fa7ec495afb5e7ee59c3715a568786f741ef59fb2837430d96f217c365d5f
MATLAB
9,558
277
function arr = exindex(arr, varargin) %EXINDEX extended array indexing % ARROUT = EXINDEX(ARRIN, S1, S2, ...) indexes a virtual array made by % extending ARRIN with zeros in all directions, using subscripts S1, S2 % etc. % % ARROUT = EXINDEX(ARRIN, S1, R1, S2, R2, ...) extends ARRIN using rule % R1 on the fir...
5dbc12b2a38af76cb26a61c578d9f225a8e1a534f86c14d807250c94051ae76b
MATLAB
9,559
282
loadParameters; params.registeredImagesDir = '/Users/Goody/Neuro/ExSeq/exseq20170524/4_registration-cropped'; params.basecallingResultsDir = '/Users/Goody/Neuro/ExSeq/exseq20170524/6_base-calling'; params.punctaSubvolumeDir = '/Users/Goody/Neuro/ExSeq/exseq20170524/6_base-calling'; % filedir = 'C:\Users\chenf\...
b9bf9ac2d5abe614be636fa5de25f23ea86cda7e7af1e10966035a91efb80a71
MATLAB
9,561
177
function [Data_Corrected, ClusterSize, Header]=y_GRF_Threshold(StatsImgFile,VoxelPThreshold,IsTwoTailed,ClusterPThreshold,OutputName,MaskFile,Flag,Df1,Df2,VoxelSize,Header, dLh) % function [Data_Corrected, ClusterSize, Header]=y_GRF_Threshold(StatsImgFile,VoxelPThreshold,IsTwoTailed,ClusterPThreshold,OutputName,MaskFil...
e056b983181b464c9d7bfce9e38917b896cb416aacbf8f91cf2477568ff4c43e
MATLAB
9,562
237
function [nev] = read_neuralynx_nev(filename, varargin) % READ_NEURALYNX_NEV reads the event information from the *.nev file in a % Neuralynx dataset directory % % Use as % nev = read_neuralynx_hdr(datadir, ...) % nev = read_neuralynx_hdr(eventfile, ...) % % Optional input arguments should be specified in key-valu...
11501ff240a4642acb3565481ac2fa978a994dc6d9265be868594b970c984353
MATLAB
9,563
208
function [] = Twave_personalisation_POMs_ToRORdLand(nb_models,celltype) % Population of models generation for T-wave personalisation % Adapted from scriptDemonstration_2_ParameterComparison.m: % TODO: rename all endo_ variables to not say endo_ %% Setting parameters param.bcl = 800; % basic cycle length in ms param.mod...
5f21ea9df4c890d5f0ed2074592e911fa33b2c57c90f95a4290e7c347e3ef79a
MATLAB
9,564
234
% 431-400 Year Long Project % LA1 - Medical Image Processing 2003 % Supervisor : Dr Lachlan Andrew % Group Members : Alister Fong 78629 a.fong1@ugrad.unimelb.edu.au % Lee Siew Teng 102519 s.lee1@ugrad.unimelb.edu.au % ...
7b4b42d019b6255e521572d70ecc2ae19debd1acff4886ceb7b4adf6aea0ae5f
MATLAB
9,566
275
function [np_marker] = np_readmarker (filename, idx_begin, data_length, option) % % function [np_marker] = np_readmarker (filename, idx_begin, data_length, option) % % np_readmarker reads marker from a NEURO PRAX marker file (*.EE_). % % Syntax: % % [np_marker] = np_readdata(filename,idx_begin,data_length,'samples');...
502dfca17147b25954f027d0eec1334475cc2b83573083745a25d34877995a87
MATLAB
9,568
297
function [stats,st] = lme_mass_fit_Rgw(X,Zcols,Y,ni,Th0,Rgs,Surf,fname,... Dtype,sptm,prs,e) % [stats,st] = lme_mass_fit_Rgw(X,Zcols,Y,ni,Th0,Rgs,Surf,fname,Dtype,sptm,prs,e) % % Region-wise linear mi...
e4278ffa7d802af04bf477e4cdce1b92a2d6bc6604c379226bb14d5411239971
MATLAB
9,569
313
function wlPlot_plotMatrixBurstRates(cfg, ... rate_avg, rate_dev, rate_sem, bg_avg, bg_dev, bg_sem, ... timebins, bandtitles, bandlabels, channelnames, ... figtitle, filelabel, timetitle) % function wlPlot_plotMatrixBurstRates(cfg, ... % rate_avg, rate_dev, rate_sem, bg_avg, bg_dev, bg_sem, ... % timebins, b...
60f995f4ca18c4ef1e4020426c27d89d32258aaddc3fd5472e8e8c7ede6abdda
MATLAB
9,572
215
function write_plexon_nex(filename, nex) % WRITE_PLEXON_NEX writes a Plexon *.nex file, which is a file % containing action-potential (spike) timestamps and waveforms (spike % channels), event timestamps (event channels), and continuous variable % data (continuous A/D channels). % % Use as % write_plexon_nex(filenam...
a9525166fc6b4fc4d2fd69fe2811a8f8b0ef1012bdb64f86a9b9a86c7bd2d6a1
MATLAB
9,576
249
function [timelock] = ft_timelockanalysis(cfg, data) % FT_TIMELOCKANALYSIS computes the timelocked average ERP/ERF and % optionally computes the covariance matrix. % % Use as % [timelock] = ft_timelockanalysis(cfg, data) % % The data should be organised in a structure as obtained from the % FT_PREPROCESSING functio...
3a0d9e27557c37e7acdc2b9c0073511414d82bc972205902ec0294decfca5722
MATLAB
9,580
228
function [X, maxdot] = packing_on_the_sphere(d, n, epsilon, X0) % Return a set of points spread out on the sphere. % % function [X, maxdot] = packing_on_the_sphere(d, n, epsilon, X0) % % Using optimization on the oblique manifold, that is, the product of % spheres, this function returns a set of n points with uni...
4da8264696888f8504936cf5317c0d757a88cc64785ab2cbfdc9464e92f8cbde
MATLAB
9,581
228
% create_mice_all_randomMotorizedTreadmill.m % Sarah West % 11/30/21 % Creates and saves the lists of data you'll use for the given experiement % (mouse names and days of data collected). % Each row of the structure is a different mouse. %% Parameters for directories clear all; experiment_name='Random Motorized ...
47650ed4c0fe76c69f180caa5665fae92ccea1ad2f077859775adc9a3fe87e5b
MATLAB
9,583
266
function CBIG_GraphVis_17network(data, netw_used, hemi, fileout, seed_in) % CBIG_GraphVis_17network(data, netw_used, hemi, fileout, seed_in) % Example usage: % % CBIG_GraphVis_17network(corr_mat, [1 3 4 6 7 9 10 11 12 15 16], 'lh', 'test', 20); % will plot graph with left hemisphere ROIs of networks 1 3 4 6 7...
0c35ca7d23a21ca92a02882524346e8697fd5e20ee2bafabef1ced4d6dd47a60
MATLAB
9,592
299
function [result] = ft_test_run(varargin) % FT_TEST_RUN % Copyright (C) 2017, Robert Oostenveld % % This file is part of FieldTrip, see http://www.fieldtriptoolbox.org % for the documentation and details. % % FieldTrip is free software: you can redistribute it and/or modify % it under the terms of the GNU Gener...
29597da1a1a2fe8b23391c68b6a3c081e05e6eed3d63abd61472f180a1d25cf1
MATLAB
9,598
180
function plot_correlation_sleep_evolution(folders, method, epoch, option) switch option case 'time' bin_edges= 60*[[0:15:60]' [30:15:90]']; case 'events' bin_edges= [[1:70:(300-70)]' [70:70:300]']; end folders= folders(:,1); master_folder= 'X:\BendorLab\Drobo\Neural and Behavioural Data\Rate r...
88c294c9769158fd1ebca7426ca3f8433df969e97a28e9321715396b8c8d6969
MATLAB
9,607
243
%% var_to_autocov % % Return autocovariance sequence for a VAR model % % <matlab:open('var_to_autocov.m') code> % %% Syntax % % [G,info] = var_to_autocov(A,SIG,acmaxlags,acdectol,aitr,maxiters,maxrelerr) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % % _input_ % % A ...
7b6c7655e902df7b1ed78f3d86bd88d5c01581949b653d05e4ac79eb8041bf76
MATLAB
9,608
162
function sPPI_and_gPPI_with_deconv(stat_path,exp_folder,N,N_ROIs,q_level,ground_truth) % ======================================================================== % Ruslan Masharipov, October, 2023 % email: ruslan.s.masharipov@gmail.com % ======================================================================== tic for...
4392eee7bd345796083f3e8943daf09b2848b9697eabb6213c26ba3ab6d52fc2
MATLAB
9,611
285
function [regional_SFC, GSP_SFC_Parameters] = fcn_calculate_GSP_SFC_regional_hl(results_dir, common_ids, roi_signals_dir, opts) % FCN_CALCULATE_GSP_SFC_REGIONAL_HL Regional SFC using Graph Signal Processing. % % This toolbox version receives all inputs from SFC_Toolbox and requires SC % source input to be a folder. It ...
2f6e1f22378ba0d443b3205b5a38d602fa44f27065c4f5f05c9f2c3a584bb5fa
MATLAB
9,617
229
function varargout = seqReaderPlugin( cmd, h, varargin ) % Plugin for seqIo and videoIO to allow reading of seq files. % % Do not call directly, use as plugin for seqIo or videoIO instead. % The following is a list of commands available (srp=seqReaderPlugin): % h = srp('open',h,fName) % Open a seq file for reading ...
38100d0a7a161281c28ae31e71edcda3eb646af76cf364f2d1e3d6f4b4b14b75
MATLAB
9,617
217
function [spectrum,ntaper,freqoi] = ft_specest_irasa(dat, time, varargin) % FT_SPECEST_IRASA estimates the powerspectral arrythmic component of the % time-domain using Irregular-Resampling Auto-Spectral Analysis (IRASA) % % Use as % [spectrum,ntaper,freqoi] = ft_specest_irasa(dat,time...) % where % dat = m...
4762a8dd828a622aa6ce2eff67c5e010c67b8184abf82f19c93de1e59ceb2afa
MATLAB
9,617
281
function get_maze_XY(varargin) % getXY allows user to obtain xy coordinates of maze corners and objects % (center/edge) from a video. Saves csv for each folder.Uses ffmpeg to % generate frame from video (faster than VideoReader). % % ASSUMPTIONS: % Videos must be in format compatible with Video Reader (see matlab...
61e21f733ded32997177c0c97a431140f21a376ac4669a1a90d71a98540a200e
MATLAB
9,620
231
%% Function for CPPopt analysis function [CPPopt] = func_CPPopt(CPP, PRx) % Input: % CPP: CPP time series (optionally filtered to remove noise), % can also be calculated as the difference between synchronized MAP % and ICP time series. Comes with a time axis t. % PRx: PRx as calculated by ...
f696ae36bb3e6894bdc76444b78a38cf93d7ac6cd03e60424fe51459645b5203
MATLAB
9,626
360
function [CMAP,CLIM,WIDTH,REF,LEVELS] = ... cmfit(CMAP,CLIM,WIDTH,REF,CENTER,varargin) %CMFIT Sets the COLORMAP and CAXIS to specific color bands. % % SYNTAX: % cmfit % cmfit(CMAP) % ...
abb2553a8fc8a5f8eb29b14316e6d2f8593ff2f65dfea724412cd0f1487b9f91
MATLAB
9,632
286
% Procedure for processing electrophysiology data in the SNLab % % Dependencies % - schafferlab/github/Kilosort % - schafferlab/github/CellExplorer % - schafferlab/github/neurocode % % Data organization assumptions % - Data should be organized with each recordding session saved within an animal folder i.e. 'an...