sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
9cc7d29f06d2fa93fdb66c348413766a9627ff0bc12ddbba73d8f20b6d9525ec
MATLAB
16,744
428
function [data, powindx, hasrpt] = univariate2bivariate(data, inparam, outparam, dtype, varargin) % UNIVARIATE2BIVARIATE is a helper function for FT_CONNECTIVITYANALYSIS % % Use as % [data, powindx, hasrpt] = univariate2bivariate(data, inparam, outparam, dtype, ...) % where % data = FieldTrip structure acco...
797daabb2db6287276da6cd265ce938e2b0c70d32364535249659c180ad6a495
MATLAB
16,747
428
function [data, powindx, hasrpt] = univariate2bivariate(data, inparam, outparam, dtype, varargin) % UNIVARIATE2BIVARIATE is a helper function for FT_CONNECTIVITYANALYSIS % % Use as % [data, powindx, hasrpt] = univariate2bivariate(data, inparam, outparam, dtype, ...) % where % data = FieldTrip structure acco...
10b6caa6a5885c27982cceaf0ed2cfd72e5b28a795f533062d3a41ebef9f4f90
MATLAB
16,787
542
function [y,O,X,S] = filterAdjust(O) % :Usage: % :: % % [y,O,X,S] = filterAdjust(OPTIONS) % % :O: % % **O.y:** % signal % % **O.HP:** % high pass freq. cutoff % % **O.TR:** % sampling rate in s % % **O.doHP:** % [0 or 1] - do HP filter (spm), default is 0 % % **O.doLP:** % ...
23a5d59d98f501b6838c3edbeb598744614025c099191ea0119b947939ae32e5
MATLAB
16,806
346
function colocalization_statistics_module() figure() set(gcf,'name','Colocalization Statistics Module','NumberTitle','off','color','k','units','normalized','position',[0.25 0.2 0.5 0.6],'menubar','none','toolbar','figure') global data listbox uicontrol('style','pushbutton','units','normalized','position',[0,0.95,0....
3deb860ab13035734835c5aaf2ee1454d1f01e291f8c9059d4d2eaee934cf08a
MATLAB
16,818
386
function ps2pdf(varargin) %PS2PDF Function to convert a PostScript(R) file to PDF using GhostScript(R) % % Converts a PostScript file into PDF. The resulting PDF file will contain % one page for each page defined in the PostScript files, so a multi-page % PostScript file, like those generated by using the '-append' ...
5d8aa1ec3b295175f59c80f82cd518cc3e4f3b7ceaeb277affd40de0f49a11f1
MATLAB
16,821
410
function [data] = femdata_stnd_TR(mesh,t,dt,varargin) % FEMDATA_STND_TR Returns time-resolved photon fluence rate for the % 'standard' FEM mesh in NIRFAST format. % This function generates sparse matrices representing the FEM problem % (the time-resolved 'mass' mastrices and sparse sources vectors). Then, % it ...
7bf69d0ca4e09ea15067289bdd17f53d9cb5dd63d5cdae076064434d20446b59
MATLAB
16,831
508
function [pv,stat,df,all] = GLM_contrast(X,y,c,type,verbose,Xnames,Ynames,notest) % computes classical p-values for any contrast applied onto GLM effects % function [pv,stat,df] = GLM_contrast(X,y,c,type,verbose,Xnames,Ynames) % In brief, this function uses classical tests of linear mixtures of % effects, under the gen...
016f965230521286d2cc108f0f2fc35ab6952c340067b4e1ec5ecb3b91861a15
MATLAB
16,850
191
% This file is from pmtk3.googlecode.com % # This file contains reasonable default settings for various inference % # algorithms in libDAI. Each non-empty line should either be a comment % # (starting with #) or contain an alias definition in the format % # % # alias: name[key1=val1,key2=val2,...,keyn=valn] % # % ...
0114c113b3b08fd9b2b0cf1b3ab06480b5e56242f3e87227b3988ee040280a2f
MATLAB
16,889
470
function split_dat(data_path,save_path, subject_order,varargin) % split_dat for recordings of multiple animals from Intan RHX USB % acquisition system. Assumes intan one data per data type format. Will % split amplifer and aux by available ports by default. % input: % data_path: path to file location with intan dat...
a4adb5b727a39cc87698511c46bd6bccbd872476237e59f0538055ae85ea14e5
MATLAB
16,930
435
function [data] = ft_channelrepair(cfg, data) % FT_CHANNELREPAIR repairs bad or missing channels in the data by replacing them with the % plain average of of all neighbours, by a weighted average of all neighbours, by an % interpolation based on a surface Laplacian, or by spherical spline interpolating (see % Perrin e...
1e5ee324696a2ce51b0064c9d3f880a4de88e46e43d050206e0749c02191cef1
MATLAB
16,931
465
% HIFDE3X Hierarchical interpolative factorization for differential equations % in 3D. % % This is essentially the same as HIFDE2X but extended to 3D, reducing first % cells to faces by elimination, then faces to edges and, optionally, edges % to points by skeletonization. Note that edge skeletonizat...
a3c43a0d249031c633439c11ff8e22ccfad37d090c26fefd8ffe4c3c7459691e
MATLAB
16,950
553
function [ss,p,pwmd]=FscatJit2(identifiers, data, p, pwmd, varargin) % Plots data as both jittered points and an error bar, in the % order the identifiers are passed to it. It preserves whatever order % was in the fbmm structure. Also includes the option to define the circle % size or use a default. Also allows someo...
6ce5470d374266b7e25b2bede945d8976ca880cc8a137e21ef336c9b72df40cb
MATLAB
16,955
467
function [hs] = ft_plot_mesh(mesh, varargin) % FT_PLOT_MESH visualizes a surface or volumetric mesh, for example describing the % realistic shape of the head. Surface meshes should be described by triangles and % contain the fields "pos" and "tri". Volumetric meshes should be described with % tetraheders or hexaheders...
229d732367f8463c93fc5e1e43bcac1905344344f56634f1552549cc90acddc9
MATLAB
16,983
554
function [ss,p,pwmd]=FscatJit2(identifiers, data, p, pwmd, varargin) % Plots data as both jittered points and an error bar, in the % order the identifiers are passed to it. It preserves whatever order % was in the fbmm structure. Also includes the option to define the circle % size or use a default. Also allows someo...
3db213778be053c2d81b6b8ab48e7c21846dd55c3117c9dc6dbbbdd0945c59ed
MATLAB
16,997
284
%% muscle GCaMP 1P imaging % This works with folder arrangement as in glue muscle imaging subFolders = dir(pwd); realSubFolders = subFolders([subFolders.isdir]'); realSubFolders = realSubFolders(3:end); % remove unwanted folders like those containing movies or plots from the % list of real data-containing subfo...
0ee4b34cca2a29dff88fb155d429a69e123815d01fd80469fb1db545da4cd1b1
MATLAB
17,018
560
//======================================================================== // GLFW 3.4 macOS - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org> // // This software is provided ...
302aee940987feb646aa8a1120cfda43eaccc9daf4cb105eb91779215f950278
MATLAB
17,019
448
function out = seqIo( fName, action, varargin ) % Utilities for reading and writing seq files. % % A seq file is a series of concatentated image frames with a fixed size % header. It is essentially the same as merging a directory of images into % a single file. seq files are convenient for storing videos because: (1) %...
62e0b615a58f501fcfca23ceb52f097994e3cc5242a334281b70f15cb87c30e5
MATLAB
17,025
520
function varargout = w_Montage(varargin) % W_MONTAGE MATLAB code for w_Montage.fig % W_MONTAGE, by itself, creates a new W_MONTAGE or raises the existing % singleton*. % % H = W_MONTAGE returns the handle to a new W_MONTAGE or the handle to % the existing singleton*. % % W_MONTAGE('CALLBACK',hO...
cc800bfff6034f8732b8cf04e84023fa1d9ae0cdbfd41f61396400e55857a5cf
MATLAB
17,025
461
clear; clc; doSaveFig= 0; doSaveGrandAvg= 0; CodeDir= '..\'; addpath(CodeDir); %% load estimate AM trajectory fig_TF= 4; nSProws= 5; nSPcols= 5; sp_ax_TF = get_axes(fig_TF, nSProws, nSPcols); %% human plots: first column verboseAxis= 1; [dam_traj_Hz_human_NFvalid, all_pow_am_human, all_pow_am_human_NF, mu_pow_am_...
e57745ee90c1988312288ab253b3476a2a1fa572daad9c648d32ce232f16f917
MATLAB
17,072
353
function [log_odd] = extract_ground_truth_info_back_up_15_06(folders,option,method,shuffles,ripple_zscore_threshold,p_val_threshold) % Input: % Folders: Each Folder is data for a session % method = 'linear' or 'wcorr' or 'spearman' or % Output: % log_odd: save the log odd - log(sum(probability of T1)/sum(probability ...
acaf0f58bf07eb83369a3be7d90e4f6bf2ed1b49f3f61bfa36ee6e30f2320ddd
MATLAB
17,076
512
%% Josh Tenenbaum's Number Game % %% % This file is from pmtk3.googlecode.com function numbersGame %% first = 1; last = 100; %Range for the hypothesis space hypFn = @mathHypothesesSmall; priorFn = @mathPriorSmall; likelihoodFn = @likelihood; posteriorFn = @posterior; postPredFn = ...
6deb2c9db5e9e3079841a86313173f43b066ecf8b31296d16a99bb7718db8d98
MATLAB
17,088
469
function [fH,figNames,Pk] = meg_channelsPeakSort(sessionDir,data,nChOI,p,passCh) % MEG_SELECTCHANNELS(sessionDir) % % INPUTS % sessionDir % data % matrix time x channel x trial % channel selection method % 1. ampMax: max(abs(amp)) % 2. promAvg: max prominence across two peaks % 3. promMax: max prominence...
253fee888d89c3df1643fdb266127fecfbd5c1562a00cae163e8d7abe64985dd
MATLAB
17,103
506
function [cfg] = ft_movieplotTFR(cfg, data) % FT_MOVIEPLOTTFR makes a movie of the time-frequency representation of power or % coherence. % % Use as % ft_movieplotTFR(cfg, data) % where the input data comes from FT_FREQANALYSIS or FT_FREQDESCRIPTIVES and the % configuration is a structure that can contain % cfg.pa...
50385867d7184cf98fcc5bee1591fd7e6c6add7b7d30882ea61d1ff1ecc4bcf3
MATLAB
17,103
399
function data = h_frameAnalysisPlot3(handles) % global FV_img [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); fig = findobj('Tag','h_imstack3Plot','Selected','on'); if isempty(fig) fig = figure('Tag','h_imstack3Plot','ButtonDownFcn','h_selectCurrentPlot3','Selected','...
434b06fc6b4bec3526e047da957818f66a77923df636b5abe18e07e49e748f33
MATLAB
17,111
499
function [mri] = ft_read_mri(filename, varargin) % FT_READ_MRI reads anatomical and functional MRI data from different file formats. % The output data is structured in such a way that it is compatible with % FT_DATATYPE_VOLUME. % % Use as % [mri] = ft_read_mri(filename) % % Additional options should be specified in ...
dbe611538aad462debbcf2aff3d48a202e573b19a323d6b45694db720ad57a3a
MATLAB
17,112
322
function plot_correlation_RUN_evolution(folders, method, option) %methods: wcorr or spearman switch option case 'time' bin_edges= 60*[[0:1:24-1]' [1:1:24]']; num_bins = size(bin_edges,1); case {'laps','cumulative_laps'} num_laps = 20; jump_laps = 1; num_bins = floor(20/j...
326ee9a021eddba4f0feb18b657a0b46f6bfbe73a01fc412c9fd237c4e31b784
MATLAB
17,117
472
function [sens] = ft_read_sens(filename, varargin) % FT_READ_SENS read sensor positions from various manufacturer specific files. See % further down for the list of file types that are supported. % % Use as % grad = ft_read_sens(filename, ...) % for gradiometers % elec = ft_read_sens(filename, ...) % for electro...
01da6f88d8c3686306c97491846b15c7c2f4b91369db9f1b477908fc01ccd0cf
MATLAB
17,142
434
function varargout = h_spineAnalysisGUI3(varargin) % H_SPINEANALYSISGUI3 M-file for h_spineAnalysisGUI3.fig % H_SPINEANALYSISGUI3, by itself, creates a new H_SPINEANALYSISGUI3 or raises the existing % singleton*. % % H = H_SPINEANALYSISGUI3 returns the handle to a new H_SPINEANALYSISGUI3 or the hand...
8258501d67e83fd9164960c423cc7ca9d92a6df2090c86f60d057ffecea730f9
MATLAB
17,155
393
function [qrs_amp_raw,qrs_i_raw,delay]=pan_tompkin(ecg,fs,gr) %% function [qrs_amp_raw,qrs_i_raw,delay]=pan_tompkin(ecg,fs) % Complete implementation of Pan-Tompkins algorithm %% Inputs % ecg : raw ecg vector signal 1d signal % fs : sampling frequency e.g. 200Hz, 400Hz and etc % gr : flag to plot or not plot (set it ...
6af7b96fb5d2dac040c2dedd8b92055801eca6c15e8c5ffaaf2c9e8c1674482b
MATLAB
17,156
395
function [h_f,h_a] = NdimSliderPlot(data,varargin) % arguments % data % An N-dimensional array of the values of the dependent variable. % end % arguments (Repeating) % varargin % See parameters below. % end %% Parse optional Name,Value...
8026e2cd67dfdc4a2b0b09a81572b6f2e7259c68194fb53dba2517953934057d
MATLAB
17,183
458
function varargout = Linear_settings(varargin) % LINEAR_SETTINGS MATLAB code for Linear_settings.fig % LINEAR_SETTINGS, by itself, creates a new LINEAR_SETTINGS or raises the existing % singleton*. % % H = LINEAR_SETTINGS returns the handle to a new LINEAR_SETTINGS or the handle to % the existing si...
f7a07fd733b4a530638b10fabfca94851085e07c530bac15cd20a5d2a3c19ba4
MATLAB
17,190
444
function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank) % Manifold of fixed multilinear rank tensors in Tucker format. % % function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank) % % n1 = tensor_size(1); % n2 = tensor_size(2); % n3 = tensor_size(3); % r1 = tensor_rank...
9573c833d06f372a91cb95ab98d87258632bcd52f783db02ae4794225e2d48aa
MATLAB
17,204
386
function ps2pdf(varargin) %PS2PDF Function to convert a PostScript(R) file to PDF using GhostScript(R) % % Converts a PostScript file into PDF. The resulting PDF file will contain % one page for each page defined in the PostScript files, so a multi-page % PostScript file, like those generated by using the '-app...
644c040fe09af197a7b7898fff9b6994254395af8757c10b39cc2824f4292a61
MATLAB
17,205
435
classdef tpsFitter < surfaceFitting.surfaceFitter % Generate surface from a point cloud using thin plate spline fit % % The thin plate spline method fits a surface that behaves like a plate % with some bending stiffness. This surface remains parametrized by % coordinates xy on a plane, which we are ...
60b9d8a9c32f9d69aab8cdc9ac15e499f7d9af331acf10448b37530026aa444d
MATLAB
17,206
382
function [obj] = TLgetROIs(obj, ... left_AC_search_region_mask,right_AC_search_region_mask, ... left_VC_search_region_mask,right_VC_search_region_mask, ... Y_grayMatter_mask,Y_whiteMatter_mask,Y_CSF_mask,... grayMatterMask_eroded,whiteMatterMask_eroded,csfMask_eroded, ... interme...
1478b1356f336b115322c44e076d973e20cca04654c878ea55ff2a6a5840a20e
MATLAB
17,231
422
function varargout = y_PALMSetting(varargin) % Y_PALMSETTING MATLAB code for y_PALMSetting.fig % Y_PALMSETTING, by itself, creates a new Y_PALMSETTING or raises the existing % singleton*. % % H = Y_PALMSETTING returns the handle to a new Y_PALMSETTING or the handle to % the existing singleton*. % % ...
365f345f2ab6882177d134b4322a1f3ba0b5b6640526aea10d0611dd092a0b99
MATLAB
17,231
536
function Answer=inputdlgcol(Prompt, Title, NumLines, DefAns,Resize,NumCols) %INPUTDLGCOL Input dialog box. % Answer = INPUTDLGCOL(Prompt) creates a modal dialog box that returns % user input for multiple prompts in the cell array Answer. Prompt % is a cell array containing the Prompt strings % % INPUTDLGCOL...
838b386bc0cbab8d115299d2ee42c96394f4f9e8fa15f53c6dc07a2bd8912e23
MATLAB
17,246
513
function TrioEEGBehMicrosaccades(fixResult, cuesToAnalyse) % analyse microsaccades in the ready period and early target period. % microsaccade density, ocular drift speed, FFT of movements in early and % late period between ready cue and target onset. % % requires edft %% load up if ~exist('cuesToAnalyse','var') || ...
4d437f6046a33b2c2e185a8f6148d463efb5a9f6ce8c54eedd5b8331deef482e
MATLAB
17,247
426
function [ ISIstats ] = bz_ISIStats( spikes,varargin ) %ISIstats = bz_ISIStats(spikes,varargin) calculates the statistics %inter-spike intervals for the spiketimes in spikes. % % INPUTS % spikes Structure with spikes.times and spikes.UID % % (options) % 'ints' A structure with intervals...
2ad24e216beeca644f2ece6eafafedd0f5abb711b20646d291d4eba8b4ca0dfb
MATLAB
17,254
539
function Answer=inputdlgcolZN(Prompt, Title, NumLines, DefAns,Resize,NumCols) %INPUTDLGCOL Input dialog box. % Answer = INPUTDLGCOL(Prompt) creates a modal dialog box that returns % user input for multiple prompts in the cell array Answer. Prompt % is a cell array containing the Prompt strings % % INPUTDLGC...
d1fb7d864876f898e9ae819dad5e49da24ed5d7bc88fdcdf3403755fda3bcc32
MATLAB
17,257
438
function [output] = ft_volumelookup(cfg, volume) % FT_VOLUMELOOKUP can be used in to combine an anatomical or functional % atlas with the source reconstruction results. You can use it for forward % and reverse lookup. % % Given the region of interest (ROI) as anatomical or functional label, it % looks up the locations...
21e48ef52bf30257ad0ce2a3e88a0b77cf15ffc7c8bbcf1b96e5330ac49c14f9
MATLAB
17,294
433
function [dipout] = beamformer_lcmv(dip, grad, headmodel, dat, Cy, varargin) % BEAMFORMER_LCMV scans on pre-defined dipole locations with a single dipole % and returns the beamformer spatial filter output for a dipole on every % location. Dipole locations that are outside the head will return a % NaN value. % % Use as...
e7c47281221d73add38fb6d379de3548b1adbd509d54ed36c12cb50c81926cd0
MATLAB
17,298
372
%% Before running this script - manual stages: % 1. Compute ANOVA across all subjects with the five social scales conditions, % to identify regions with scale sensitivity ("ANCOVA random effects analysis" dialog); % Change threshold to q=0.01 (FDR-corrected); Save the results to a VMP file - "anova_results.vmp" ...
c65b23890ee04e8cbccaac9970e95796b1adf0ca454738b5d16c4bb086e60d97
MATLAB
17,300
450
%% Hub disruption cmap = BrBG_cmap(8);cmap = cmap([6:8,3:-1:1],:); refgroup = bins==4; refgroupstr = 'YoungNC'; S = Scorr; Pc = Pccorr; Z = Zcorr; S_ref = mean(S(refgroup,:)); Pc_ref = mean(Pc(refgroup,:)); Z_ref = mean(Z(refgroup,:)); %% Plot [p_MC,HDI.slope,HDI.intercept,HDI.p,HDI.R2,HDI.slopeupper,HDI.slopelowe...
9cb202711aa2e4f244c72b2289244b59698464801e919baf1ffbf47dda4e71ee
MATLAB
17,304
401
%% Sleep decode analysis of Shin et al., 2019 % exptSleepDecodePlotting.m % % Statistical analysis of the decoded events from the first sleep session % of Shin et al., 2019 %% Set up % Get data directory userDir = char(java.lang.System.getProperty('user.home')); if ispc; boxDir = 'Box'; elseif ismac; boxDir = ['Libr...
314e92886555ff3a4d1e3a5e3365e871417633e516fa048258220a3f6f4fe1d5
MATLAB
17,320
435
function linescanDiamAnalysis(fname,prefs) % %function to find the diameter of a vessel from a linescan %this is less complex then for xyFWHM as the vessel is scanned in a %straight (vertical) line, and there will be no branches %will step through in 40ms windows and find mean intensity, then FWHM %written Dec 20...
aa3578c46bab8d662a5fecfbfaaa1d45e9a7cf20b4393a2f501e309252e70485
MATLAB
17,332
390
function ensemble(segmentFilename, dataFilename, experimentName) if isempty(dataFilename) quit(2); end data = load(dataFilename); shuffleRuns = 10000; suffixes = [""]; if experimentName == "SDT" suffixes = ["_A", "_N"]; end for k=1:length(suffixes) clear ensb_...
33a8dc83e43005fbacfb4ecdb8edd1bd007ec52fb44af7e9ef19aea1c4854bf3
MATLAB
17,338
396
% SYNTAX: % EEG = RA_equaltrials_Beta001GH(EEG, eventCodeArray, minNumEp); % % INPUT: % % EEG - bin-based epoched dataset (artifact detection/correction already done) % eventCodeArray - It's a 1xN cell array of event codes, where N is the number of % "Confidence" responses (e.g. 5 respons...
4bdc7869f1bbd3ff188b1a5d4e046e6933c22bb5f7171a232d720dd660ce7129
MATLAB
17,338
453
%% OBSOLETE SEE HPOptim.m %% Compile xv results over rounds nE = 3135; nH = 3252; nPch = 39; npts = 17; xverrE = nan(nE,npts,nPch,0); xverrH = nan(nH,npts,nPch,0); pchsE = cell(0,nPch); pchsH = cell(0,nPch); xvresE = cell(nPch,0); xvresH = cell(nPch,0); [xverrE(:,:,:,end+1),pchsE(end+1,:),xvresE(:,end+1)] = HPOptim.l...
95cce59a620be935a061cf4e47bb27b03ef8e8724a7d2195f9fb4931e5551542
MATLAB
17,348
362
% Correlation script for nchannels vs DOPA %% Generate csv files from PET data % addpath C:\Code\wjn_toolbox-master % addpath C:\Code\spm12 addpath(genpath('C:\Code\spm12')) addpath(genpath('C:\Code\wjn_toolbox')) addpath(genpath('C:\Code\leaddbs\leaddbs')) % Read atlas parcellation region_info = readtable('HCPex (Hu...
a889728cf96c87a8ba865c022513477981cb64116f40e9badd02c1c7bacdfe85
MATLAB
17,395
457
function CrossDecodeAnalysisActionBaseline(AllTrialData,Labels,TimeWindow,OutDir,Tag,varargin) % Train on dim 1 to classify dim 2, test on how well it generalizes. % e.g. train on nancy to diff bp, test how well bp diff'd in Tyson. [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh','fdr'); % [~,NIter] = Uti...
9431ae26ca829bb78729b00fa6c7dc5cce7e874ee4ca63b8195e0a68643b73c0
MATLAB
17,407
443
function [Xloadings,Yloadings,Xscores,Yscores, ... beta,pctVar,mse,stats, mse_byvar, Tnotnormal, pctVar_byVar] = plsregress_fullcode(X,Y,ncomp,varargin) %PLSREGRESS Partial least squares regression. % [XLOADINGS,YLOADINGS] = PLSREGRESS(X,Y,NCOMP) computes a partial least % squares regression of ...
ec6c3e69243caccab6c0ddf24d3a0083ad5d19c7b5f8ced9de39f8b9c17b40cd
MATLAB
17,416
556
function [mdlparams, xerr, errall] = gfFitSubunitGridModel(mdlparams, xvals, yy, opts,initialize) %UNTITLED2 Summary of this function goes here % Detailed explanation goes here %========================================================================== if nargin < 4 batchsize = 1000; eta = 0.01; beta1 = ....
0a7f9b84dea41f8e965d71c97ca7a9af1bb0d77ea37762e329a1624653b6c5bf
MATLAB
17,429
593
function [R,Q,S,T,P_w] = MTEO_qrst(ecg,fs,gr) %% ======== Delineates ECG based on MTEO Algorithm ============== %% % Employs Multilevel Teager Energy Operator to delineate ECG. To see how % MTEO is computed please see my paper and cite it if you are interested % in using this code. %%%%% % Ref : H. Sedghamiz and D. San...
7688f55762507a4e7169cc7fa3091fcfc8e9325f964966d1d908722d41eb8fe3
MATLAB
17,434
500
function TSplotcdfs(varargin) % Graphics helper function for TSapplystat. % Plots cumulative distribution functions and labels them with subject % and/or session, Trial and/or phase. Will plot multiple cdfs on single % panels and multiple panels per figure. MUST BE CALLED BY TSAPPLYSTAT!! % % Syntax: TSapplystat('',...
57c1d8e0ff31546f53eaf5c663db48a7a3deb3b12fc22bae3bad0204a961341c
MATLAB
17,435
438
function [ titlestr, settings, results] = computeMixingMatrix( dataview, settings ) % Computes and plots a mixing matrix based on a (k-NN) graph and a level % and target variable. Both level and target variable should be categorical. % % % %<PRE> % This file is part of dspace-core. ...
f63a98085ae2924eeea287cabaf86d0bc7af3ac87ac4b10b49098ead6a20950a
MATLAB
17,435
529
function [stack, img_read] = tiffread2(filename, img_first, img_last) % tiffread, version 2.4 % % [stack, nbImages] = tiffread; % [stack, nbImages] = tiffread(filename); % [stack, nbImages] = tiffread(filename, imageIndex); % [stack, nbImages] = tiffread(filename, firstImageIndex, lastImageIndex); % % Reads 8,16,32 bit...
1173274e6927de020f01bde111a758e9ef683f7a3f51315ffb4f9fc636f5b79a
MATLAB
17,462
475
function json=savejson(rootname,obj,varargin) % % json=savejson(rootname,obj,filename) % or % json=savejson(rootname,obj,opt) % json=savejson(rootname,obj,'param1',value1,'param2',value2,...) % % convert a MATLAB object (cell, struct or array) into a JSON (JavaScript % Object Notation) string % % author: Qianqian Fa...
05347fcfec81424b7e7a93d192d449399e85d2851b94121d9fe575625c6f489e
MATLAB
17,490
518
% [readframe,nframes,fid,headerinfo] = get_readframe_fcn(filename) % get_readframe_fcn inputs the name of a video, opens this video, and creates a % function that can be used for random access to frames in the video. it can % input files of type fmf, sbfmf, and avi. if videoio is installed on your % machine, then get_r...
8ce429943386e94eccf9f6eae74e1d9ddeb4875f2f84f0bb1366834b86ddd5a7
MATLAB
17,500
541
function Answer=inputdlgcol(Prompt, Title, NumLines, DefAns,Resize,NumCols) %INPUTDLGCOL Input dialog box. % Answer = INPUTDLGCOL(Prompt) creates a modal dialog box that returns % user input for multiple prompts in the cell array Answer. Prompt % is a cell array containing the Prompt strings. % % INPUTDLGCOL...
c474aa83be0eaed058892eca960aa4918694f0517c6f8ff6a8b8564f9cc0d322
MATLAB
17,506
397
function [data] = ft_steadystatesimulation(cfg) % FT_STEADYSTATESIMULATION creates a simulated EEG/MEG dataset. This function % allows to simulate the effect of several independent stimulus trains. These can % be presented as a periodic sequence, or as single (or few) transient stimuli. % This function creates a singl...
2ecad3cdd665ff7b5f87aa5fa6a96ac07cdc292a4765786fbba7ff6c7c691bef
MATLAB
17,507
397
function [data] = ft_steadystatesimulation(cfg) % FT_STEADYSTATESIMULATION creates a simulated EEG/MEG dataset. This function % allows to simulate the effect of several independent stimulus trains. These can % be presented as a periodic sequence, or as single (or few) transient stimuli. % This function creates a singl...
ecd72899f8b4a790074c5e6bea2f4fdf7be76363e2ef9198d503992cb367df43
MATLAB
17,520
449
% fmrib_pas() - Remove pulse % artifacts from EEG data collected inside an MRI machine. % % This program removes pulse artifacts from EEG data collected % collected inside the MRI scanner. A choice of methods is available. % % The first choice is Optimal Basis Set [Niazy06]. % This method aligns all the pulse...
7726cb858d636fe9106f06cc5b2b68fe8bbbf12dd67243825ba13b03c8ed1868
MATLAB
17,523
358
classdef SuhMatch < handle %%SuhMatch.Run is a wrapper for run_HiD_match and % run_QfTree. It preprocesses csv input files % to marshall the data and label arguments for both. % % The publication that introduces QfMatch is % https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5818510/ % ...
7c5da2ac8daed3ffb652e5ac7accee6681fa0a1ebc638c4bde3e6ef284b81f90
MATLAB
17,544
423
%% computeSDO_populateSDOArray % Given supplied point-process and time series data sets, compute the % stochastic dynamic operator for every supplied combination. % % Hardfork update to actually pass in the xtDataCell and ppDataCell classes % directly; making the evaluation more straightforward and function-calls % cl...
227a984abae5ebc23ebb7f1434de409936d90ebb7f3326ac775d0f5f0b493f81
MATLAB
17,566
442
function mysavefig(fname, varargin) % Usage: savefig(filename, fighdl, format, options) % % Saves a pdf, eps, png, jpeg, and/or tiff of the contents of the fighandle's (or current) figure. % It saves an eps of the figure and the uses Ghostscript to convert to the other formats. % The result is a cropped, clean pictur...
8163d6f6972024b4f4c2f6a8687e89618f378fab4cc3c4326479217ec797fd26
MATLAB
17,577
523
function data = loadjson(filename,varargin) % % data=loadjson(fname,opt) % or % data=loadjson(fname,'param1',value1,'param2',value2,...) % % parse a JSON (JavaScript Object Notation) file or string % % authors:Qianqian Fang (q.fang <at> neu.edu) % created on 2011/09/09, including previous works from % % Ned...
1854bc1606585f778ff4a3b2a7fb89d440602812e728eb5118460dd533925370
MATLAB
17,583
429
function [out,fmethod,pmethod] = boney_segment_filenames(P,job) %bonefilenames(P). Prepare output filenames and directories. % % [out,fmethod,pmethod] = boney_segment_filenames(P,job) % % P .. list of m-files % job .. main job structure to include some parameters in the filename etc. % out .. main output structur...
2a357daef58a96235bec6047ddfacaa6e3fede1e8fbb18b499a89171e30d834b
MATLAB
17,587
361
% pipeline_PLSR_variability.m % Sarah West % 10/3/23 %% Initial Setup % Put all needed paramters in a structure called "parameters", which you % can then easily feed into your functions. % Use correlations, Fisher transformed, mean removed within mice (mean % removed for at least the cases when you aren't using mic...
b54d601d713a8f977ebb8c77e238aa0f20c1d368fe4a72dc970ea6c75c40ba5a
MATLAB
17,602
725
%% dfof range %need to load data: contact lead author for data %% %dfof % randChance=40/700;%0.571, 10% % rate=nRuns(:,1)./nRuns(:,2) %remove the one that the sccess rate is i=find(nRuns(:,1)>1); fields = cat(1, allDfofs{i}); for n=1:size(fields,1); fields(n,:)=naninterp(fields(n,:)); end % iUs...
2f73088d29ede9f1af52bd34607a90b7b1c110c561b16f0680a3a73bf657b55e
MATLAB
17,614
437
function data_analysis_software() clear global;clear;clc; warning off addpath(strcat(pwd,'\load_files')) addpath(strcat(pwd,'\load_files\tiff')) addpath(strcat(pwd,'\load_files\storm')) addpath(strcat(pwd,'\load_files\tracks')) addpath(strcat(pwd,'\load_files\image')) addpath(strcat(pwd,'\loc_analysis')) addpa...
201eff679e3cd6454998e5d4d84da045b928baad1a5812c558d8a90ed1499e20
MATLAB
17,633
398
function noise=FindNoise(data,posspikes,negspikes,fs,Settings,DoDisplay) %Look through the data, using the parameters set in 'Settings', and return all noise indices. %1. Use a sliding window to determine various metrics of the signal %2. Compare metrics of interest to thresholds, and flag as noise if they exceed se...
0c306a6c3193f669eeb447ccebef2cbbaad73affd2e1b148db295a531aea12a8
MATLAB
17,638
362
function [QuaSOR_Image,QuaSOR_Image_TemporalColors,myPool]=QuaSOR_Map_Maker(myPool,GPU_Accelerate,... QuaSOR_UpScaleFactor,QuaSOR_ImageHeight,QuaSOR_ImageWidth,... All_Location_Coords,QuaSOR_Gaussian_Filter_Size,QuaSOR_Gaussian_Filter_Sigma,... SpotNormalization,TemporalColorization,QuaSOR_Colormap,Verbo...
a055316e56f9d6c76f7499a692e97100ce310180e4482f7f064dd272d6f7f4cf
MATLAB
17,652
281
clear EpisodeStruct EpisodeStructCurves if ImagingInfo.FramesPerEpisode>500&&ImagingInfo.NumEpisodes>3 warning('I am going to save each episode sepearately to make loading easier...') SplitEpisodeFiles=1; fprintf('Processing Episodes...Separate, Bleach Corr, DeltaF....\n') else ...
3da6888939a6f7927fd584f775743b7464c7d962a080e05d372f1082e1082a64
MATLAB
17,662
369
function ft_defaults % FT_DEFAULTS (ending with "s") sets some general settings in the global variable % ft_default (without the "s") and takes care of the required path settings. You can % call this function in your startup.m script. This function is also called at the % begin of all FieldTrip functions. % % The glob...
c5786862c72a8f86363430e77aa71ee8388e04a2d865e72131112c0961a21856
MATLAB
17,675
438
function [dipout] = beamformer_lcmv(dip, grad, headmodel, dat, Cy, varargin) % BEAMFORMER_LCMV scans on pre-defined dipole locations with a single dipole % and returns the beamformer spatial filter output for a dipole on every % location. Dipole locations that are outside the head will return a % NaN value. % % Use as...
78861a7eda64520012017cdb820a5ae8af41111c5170857587a3da76199a0fac
MATLAB
17,697
410
function CBIG_MMLDA_visualize_factors(in_dir, out_dir, k, min_thresh, max_thresh, ... mask, behavior_name, behavior_domain, mni_space) % CBIG_MMLDA_visualize_factors(in_dir, out_dir, k, min_thresh, max_thresh, mask) % % This function will visualize atrophy maps and cognitive deficits of estimated factors. % The at...
c1f9296234a48c65ffb4664337e2eee2365bc8bb791a5fa8a4d064557e38ae70
MATLAB
17,724
685
%% load trnDataSH_Apr18.mat %% ci = load('cropInfo20180426.mat'); %% normalized shapes mdl = struct('D',10,'d',2,'nfids',5); n = height(tFinalReconciled); nGT = height(tGT); pLbl = nan(n,10,2); % n,coords,ivw pLblN = nan(n,10,2); pLblGT = nan(nGT,10,2); pLblGTN = nan(nGT,10,2); for ivw=1:2 bbvw = makeBBoxes(IFin...
b7607d20f89f13fd41576d7510062310aa4cc1218e7d310950b864d344643820
MATLAB
17,729
370
function [] = Twave_personalisation_POMs_ToRORd_IKs_not_converged(nb_models, celltype, stimAmp, stimulus_function_str, result_dir) % Population of models generation for T-wave personalisation % Adapted from scriptDemonstration_2_ParameterComparison.m: %% Setting parameters param_baseline.bcl = 8...
5221959b6bb33df09b54c17207409cf1e34c0a0110ffff577583be21bbfbe823
MATLAB
17,739
512
function img = meg_plotTime(sqdfile, analStr, rejectTrials, rejectChannels, p) % MEG_PLOTTIME Plots: (1) concatenated trial time series, (2) trial time % series averaged by channel, (3) fft % % MEG_PLOTTIME(sqdfile, analStr, rejectTrials, rejectChannels) % % sqdfile = 'datafile.sqd' % analStr = 'string of analysis ...
efb160b9aed0f93958ef1bbda383efddf7df0ef00c040c9b32ee3cca4067acd0
MATLAB
17,761
437
% meg_fitAnticipatory1_freeFreq % all trials (or single precue condition), free frequency % November 2023 Karen %% Settings saveFigs = 1; user = 'kantian'; % kantian (persona), karen (lab) workingDir = sprintf('/Users/%s/Dropbox/github/ta-meg-analysis-model/model_anticipatory',user); addpath(genpath(workingDir)) %...
95bc105f2a32a8638abdbf297e37838e3156208a2818aba257b1d5c281b73c90
MATLAB
17,776
362
function [] = ObservableAnalysis_3D(processedDataFName,meta) warning('off','MATLAB:dispatcher:UnresolvedFunctionHandle') warning('off','MATLAB:table:ModifiedAndSavedVarnames') behaviorPath = meta.behaviorPath; stimulusPath = meta.stimulusPath; DLC_modelext = meta.DLC.model; DLC_dataSubFold = meta.DLC.subFold; ...
7b18430a5057be17523802dbc5012c31c0e34ffc0918043a6cacd7259c02dca6
MATLAB
17,783
363
% pipeline_duration_place_concatenation.m % Sarah West % 6/12/23 %% Initial setup % Put all needed paramters in a structure called "parameters", which you % can then easily feed into your functions. clear all; % Output Directories % Create the experiment name. This is used to name the output folder. parameters.e...
396b3d6427c41e11e31e4c6eb54556162ca71ece9debb8c4869c277b5fc9e1d9
MATLAB
17,791
496
function [freq] = freq_wltconvol_lan(cfg,LAN, texto); % % Funcion de Fieldtrip 2009 adapatada para LAN % FIX CEIL 04.04.2013 % % FREQANALYSIS_WLTCONVOL performs time-frequency analysis on any time series trial data % using the 'wavelet method' based on Morlet wavelets. % % Use as % [freq] = freqanalysis(cf...
4b7150a6fd04cb7f8502e221e1d10baa8f0277361ee2a8d7c4ae9bee6a9c8528
MATLAB
17,795
375
function ft_defaults % FT_DEFAULTS (ending with "s") sets some general settings in the global variable % ft_default (without the "s") and takes care of the required path settings. You can % call this function in your startup.m script. This function is also called at the % begin of all FieldTrip functions. % % The glob...
c961973a66681779807ac0cc9ae29078f6575ef4e05275a9e3b0655223797d06
MATLAB
17,800
612
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.G...
e8f4c191580e21153a703b072b6fcdbbf77878c64771ce61a5797db883349137
MATLAB
17,818
474
function mesh = prepare_mesh_hexahedral(cfg, mri) % PREPARE_MESH_HEXAHEDRAL % % Configuration options for generating a regular 3-D grid % cfg.tissue = cell with the names of the compartments that should be meshed % cfg.resolution = desired resolution of the mesh (default = 1) % cfg.shift % cfg.background %...
d2273136633d6fdf8a1c544319d70b755ef22de32b3119cb5103c3be054b8ac6
MATLAB
17,855
417
function varargout = h_frameAnalysisGUI3(varargin) % H_FRAMEANALYSISGUI3 MATLAB code for h_frameAnalysisGUI3.fig % H_FRAMEANALYSISGUI3, by itself, creates a new H_FRAMEANALYSISGUI3 or raises the existing % singleton*. % % H = H_FRAMEANALYSISGUI3 returns the handle to a new H_FRAMEANALYSISGUI3 or the hand...
3637d92e80bd72b6d06e77acf4ac778c61e26a7177305743a3e371f082a6dc04
MATLAB
17,864
616
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
6a80ec42ed18eda6afff3317d49c57f5b701698051cb3128dd4f01eca3abb613
MATLAB
17,866
446
%% SDO Matrix % Data Class for dealing with the SDO matrices. For use with the SDO % Analysis Toolkit. % % 1) sdoMat may be generated from 2 'pxtDataCell' classes % 2) sdoMat may be generated fom the 'sdo' common data structure % 3) sdoMat may be extracted from an 'sdoMultiMat' Class % TODO: Further optimization, par...
d3e93900f58849f6500838ea501be61c12a913fb3778ce35a786d166b9a6539f
MATLAB
17,886
462
function GLCM_TOP(varargin) % GLCM on Three Orthogonal Planes (TOP) [fileList,maskFiles,OPT,SPACE] = ParseParams(varargin); tlboxDir = fileparts(mfilename('fullpath')); currentDir = pwd; MNIMaskVol = load_untouch_nii([tlboxDir '/data/T1_Mask.nii']); maskMNI = MNIMaskVol.img>0; % MaskVol = load_untouch_nii(maskFi...
b2f5c1ab98f9a1e5e9a13f351c011320d56b69ee5049f48b03766baec0b0d6ef
MATLAB
17,890
401
function [channel] = channelselection_lan(channel, datachannel) % CHANNELSELECTION for EEG and MEG labels % % This function translates the user-specified list of channels into channel % labels as they occur in the data. This channel selection procedure can % be used throughout fieldtrip. % % You can specify a mixture ...
0eeee90eb9a1c998f208bcb636482e81c7517dd15f56e23e431ac5734dc626df
MATLAB
17,894
269
function get_distributions_tracks_replay(varargin) available_controls= {'fixed_rate','fixed_spike_count','global_remapped','rate_remapped'}; available_scoring= {'wcorr','spearman'}; available_methods= {'TRACK_PAIRS','ONE_TRACK'}; p= inputParser; addParameter(p,'scoring','wcorr',@(x) ismember(available_scoring,x)); ad...
8c2fa3c3fa9491d1f1b1704935146a5ca54fbd341d98d1fd40b90e14e6cf0053
MATLAB
17,907
460
function varargout = w_TransMat(varargin) % W_TRANSMAT MATLAB code for w_TransMat.fig % W_TRANSMAT, by itself, creates a new W_TRANSMAT or raises the existing % singleton*. % % H = W_TRANSMAT returns the handle to a new W_TRANSMAT or the handle to % the existing singleton*. % % W_TRANSMAT('CALL...
e97d56c13ae568b16ac4ea32b5add7d056f8aeec7faa3138578d5fbd625fe2d9
MATLAB
17,917
382
function [Error, Cfg]=DPABI_BIDS_Converter_run(Cfg,WorkingDir,SubjectListFile) % FORMAT [Error, Cfg]=DPABI_BIDS_Converter_run(Cfg,WorkingDir,SubjectListFile) % Cfg - the parameters for auto data processing. % WorkingDir - Define the working directory to replace the one defined in Cfg % SubjectListFile - Defi...
f646f5f160321d93a2bcbdcb1fe45bad2c421e6500d98753231952c82bab5634
MATLAB
17,917
395
function CBIG_gwMRF_regenerate_Schaefer2018_parcellations(output_dir) % CBIG_gwMRF_regenerate_Schaefer2018_parcellations(output_dir) % % This function uses current Schaefer2018 parcellation to regenerate new % version of Schaefer2018 parcellation under given folder. % % In our previous versions (v0.8.1-Schaefer2018_...
62b05111ee834d0eedc91adaeacace464ebafd0209287f1cb9895415c0641594
MATLAB
17,923
441
function varargout = print( varargin ) %PRINT Print figure or model. Save to disk as image or MATLAB file. % SYNTAX: % print % PRINT alone sends the current figure to your current printer. % The size and position of the printed output depends on the figure's % PaperPositi...
895a52dee8e503be4bcf7d38255a77efd47f7f029ad3bfd8d498abd88ef38a14
MATLAB
17,928
614
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.Ge...
a3782e3f5d4ab74b23d25ef6bdcd201cd19dbc4d974b519dd5320fe29ae46498
MATLAB
17,965
623
clear clc % f = gcf; % exportgraphics(f,'Fig1_Original.png','Resolution',600) MotionData = load('MotionData.mat'); MusculoskeletalData = load('MusculoskeletalData.mat'); %% Motion Data MotionData = MotionData.MotionData; % Joint Angles SHLa = MotionData.GenericCat.Angles.AngShou.Total*(pi/180); ELBa = MotionData.G...
024b438f7c5c967d369c91fea98e667ac8108fd636ed41c67287a568f8afea6e
MATLAB
17,972
512
function [p_sub,o_sub,p_group,o_group] = VBA_MFX(y,u,f_fname,g_fname,dim,options,priors_group, options_group) % VB treatment of mixed-effects analysis % function [posterior,out] = VBA_MFX(y,u,f_fname,g_fname,dim,options) % This function approaches model inversion from an empirical Bayes % perspective, whereby within-su...