sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
560b1ae472aa6977de9e76156f3aaf51267b3a63ec6f5f7e6417950fc18a5642
MATLAB
25,661
696
function [ subject ] = nmri_processing(subject, data, params) %[ subject ] = nmri_processing(subject, data, params) % % This function will do the source space processing including % power @sensor level (for QC) % source recon % power @source % connectivity @source % % subject = subject structure, see nmri_read_s...
7844488624a353508b798c1b5be811d6e4cc35850f16a9f88373a8aa3af1469d
MATLAB
25,672
824
function PlotEphysStats(ExpName, Params, HomeDir, oneFigureHandle) % plot ephys statistics for MEA data % Parameters % ----------- % ExpName : str % Params : structure % The following fields are used % groupColors : (nGroup x 3 matrix) % the RGB colors to use for each group during plotting % % Hom...
3f481dc5dbe452a8c67cbb09567e7de6dfbdf8d73852b98d323e057c0b106665
MATLAB
25,736
565
classdef SingleCapillaryReporter < handle % SingleCapillaryReporter - Class for detecting and analyzing capillary segments in ultrasound tracks % % This class uses Hidden Markov Models (HMM) to identify capillary segments % based on velocity and spectral features extracted from particle tracks. ...
28483a1724e83cbf41947cba44c7934a9017d561b7ef8deb1dab942ac02d65eb
MATLAB
25,742
658
function Figure5(datapath,codepath, savedir) % datapath = 'C:\Users\mld9131\Documents\GitHub\Papers\MLD\Figure5\Data'; % codepath = 'C:\Users\mld9131\Documents\GitHub\Papers\MLD\Figure5\Code' % savepath = Z:\david\maggie\data\ %% A. Schematic of the simplex % add path and load DS projection data %location of analysi...
cbd51f4dca66d6c31df9f28c8fe53205c7e0ae3eda73c313aa463d91d3f8d8b4
MATLAB
25,831
770
function varargout = legendflex(varargin) %LEGENDFLEX Creates a more flexible legend % % legendflex(M, param1, val1, ...) % legendflex(h, M, param1, val1, ...) % [legend_h,object_h,plot_h,text_str] = legendflex(...) % % This offers a more flexible version of the legend command. It offers a % different method of posit...
f9369e0243b03286a53a2b60a9655649ec14af80b05839afba4d9877705f5976
MATLAB
25,840
598
% POP_SELECTEVENT - Find events in an EEG dataset. If the dataset % is the only input, a window pops up to % ask for the relevant parameter values. % % Usage: >> [EEGOUT,event_indices] = pop_selectevent( EEG, 'key1', value1, ... % ...
506cc525b4f3210b94e62a3c02c318869681a0ed7ef9558ca09d89397285c7e9
MATLAB
25,888
672
function [NetMet] = ExtractNetMet(adjMs, activityMatrix, lagval, Info, Params, originalCoords, channels, oneFigureHandle) % EXTRACTNETMET Extract network metrics from adjacency matrices % % Parameters % ---------- % adjMs : N x N matrix % lagval : int % lag for use in STTC calculation (in ms) % Info : structure ...
d671044dde8b8fe022c1b5413124f9736f8e5d6622e33f4290eff9da31d2cbc1
MATLAB
25,896
492
function plot_trial_by_trial_correlation close all clear all clc % Plot trial-by-trial pairwise activity correlation. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) % Control. load('behavior_control.mat') load('activity_control.mat') load('activity_iti_control.mat') behavior = behavior_co...
a86077f2f74d53e6ee648005cc4352a0cc5e4a0debce26a087918889e5482377
MATLAB
26,018
499
% STD_PRECLUST - select measures to be included in computation of a preclustering array. % This array is used by POP_CLUST to find component clusters from a % specified parent cluster. % Selected measures (dipole location, ERPs, spectra, scalp maps, ERSPs, % ...
d8d923df105ae10a6b03e0d651396e63573e46c3e9d3ad26d7756a77bc58709e
MATLAB
26,032
669
% POP_EDITEVENTVALS - Edit events contained in an EEG dataset structure. % If the dataset is the only input, a window pops up % allowing the user to insert the relevant parameter values. % % Usage: >> EEGOUT = pop_editeventvals( EEG, 'key1', value1, ... % ...
f24638fd45939dd4b5cc56150eb590b18ea581c9f412c90732416531cd5b25e8
MATLAB
26,158
544
classdef McsAverageSegment < McsHDF5.McsSegmentStream % Holds the contents of a SegmentStream with spike data % % Important fields: % AverageDataMean - (1xn) cell array, each cell holding arrays of % (samples x averages) values, where 'samples' is % the ...
7a22e1af13007d279a419ee8e99255155cceef01bee1747023ca11c3512ae8ef
MATLAB
26,231
697
function [FourModelsigthre]=arrange_nodal_Slope2(Nodal_metrics,indminNodalStrmdall,indminNodalindre,notenoughNodalStr,Pathnew,opt,scale,Pathnewplot,pthretype,result_name) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
354bf60880658d89cf04687f4deb8433ecdc5a7d120d36246b8270cbd59a0a5a
MATLAB
26,243
777
function [sS, ok, msgs] = som_set(sS, varargin) %SOM_SET Create and check SOM Toolbox structs, give values to their fields. % % [sS, ok, msgs] = som_set(sS, [field, contents, ...]) % % sM = som_set(sM,'name','SOM#1.1'); % [dummy,ok,msgs] = som_set(sData); % sT = som_set('som_topol','...
3e2a7d255c5ffaf6bd4f7acf6c04547a167fb56ee3aeccc513ca3734eb4d2379
MATLAB
26,243
550
% POP_HEADPLOT - plot one or more spherically-splined EEG field maps % using a semi-realistic 3-D head model. Requires a % spline file, which is created first if not found. % This may take some time, but does not need to be % done again for this chan...
386a38acac572c5fa7ded45f9d1de5f1f40f260e5126fa4e96b3e1110f336b82
MATLAB
26,287
634
clear; cd(fileparts(matlab.desktop.editor.getActiveFilename)); %% Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % IMPORTANT: This script is designed for Windows system + WSL % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 1: have a GPU parallel.gpu.enableCUDAF...
77f2bfad9b6a7e4757a7723be4a6025b539c96a9f0ce79a61a71580702c6a779
MATLAB
26,319
660
classdef ImageEditor < handle % ImageEditor - Simple tool for editing grayscale segmentation masks % Sets values to any specified value while preserving other grayscale values % Supports three orthogonal views (View 1, 2, 3) % Usage: % editor = ImageEditor(segmentation) % From matrix % edi...
4b1a1a7ff96caf0a9b401ff3109197d0dc6037fde4bf2aca306c08c2a1a08ffe
MATLAB
26,434
533
function [header] = read_4d_hdr(datafile, configfile) % hdr=READ_4D_HDR(datafile, configfile) % Collects the required Fieldtrip header data from the data file 'filename' % and the associated 'config' file for that data. % % Adapted from the MSI>>Matlab code written by Eugene Kronberg % Copyright (C) 2008-2009, Centre...
2e1343bb556dc769848ac68863a4bcc3e79ae93f468ed693a6a320178546e004
MATLAB
26,446
588
function plot_communication_subspace_similarity_across_time close all clear all clc % Plot communication subspace similarity across time during delay. % Select a folder containing data. folder_name = uigetdir; cd(folder_name) q = 3; % Control. load('behavior_control.mat') behavior = behavior_control; load('populat...
8033c1f41c9446f3fc9b89a644d7378c68d83aa30153bafe968c1bc6579c0375
MATLAB
26,454
896
function coactPaper_figureS07() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',11+2,'font','Arial','fontsize',fontsize); x=15;y=5; panel_01(x,y,fontsize); panelLetter2(x-letGapX-4,y-letGapY+3,alphabet(1,labelCase),'fontSize',labelSize,'isBo...
02171f6254769b8429861567afacc3e1d4c27ca44e08d7029ad03fb4e3376321
MATLAB
26,488
666
% validate_pSFT % % This script validates the pSFT estimation pipeline by simulating stimulus and BOLD time series from pre-defined pSFT parameters. % It then estimates the pSFT parameters and compares the estimates to the ground truth. % Results are saved under `validate-pSFT/estimates/validation_pSFT_n<num_subjs>_yyy...
c40bec4a2531c6751295962fde6a4966caaac572a6d5e1d3c074a7b97c881359
MATLAB
26,694
571
% This script is used to analyze the in vivo data for the manuscript. % USAGE: % InVivo_Script_BiExp_Relax_Manuscript % % OUTPUTS: % IVIM parameter maps for different models % % % AUTHOR: % Dr. Helge Zoellner (Johns Hopkins University, 2025-06-12) % hzoelln2@jhmi.edu % Dr. Julia Stab...
156ee395b060f9da8e9edb822d5f471944cfda4f430beb288bda077021710445
MATLAB
26,800
610
% STD_PRECOMP - Precompute measures (ERP, spectrum, ERSP, ITC) for channels or % components in a study. If channels are interpolated before % computing the measures, the updated EEG datasets are also saved % to disk. Called by POP_PRECOMP. Follow with POP_PLOTSTUDY. % ...
907ce4910b3498315f9f68ec64dd7fb75da76d0b9df9d3abc9bcb7c637d9dff7
MATLAB
26,845
680
% TFTOPO - Generate a figure showing a selected or representative image (e.g., % an ERSP, ITC or ERP-image) from a supplied set of images, one for each % scalp channel. Then, plot TOPOPLOT scalp maps of value distributions % at specified (time, frequency) image points. Else, imag...
b381a80cd893dcfe4782234c635526e26042d85a0e79302db1ed1ef8b3619829
MATLAB
27,085
647
classdef Reservoir % Recurrent neural network reservoir class properties (Constant) ResultNames = {'psi', 'vmi', 'xmi', ... % emergence measures 'loss', 'tstar', ... % performance measures 'ps', 'pe', 'pse'}; % probability measures ...
1e1398fbd8c68375d5e401867bd6f4bd9f27f05cb18dafc11a501eb19395a779
MATLAB
27,113
846
function varargout = mri_view(varargin) % MRI_VIEW MATLAB code for mri_view.fig % MRI_VIEW, by itself, creates a new MRI_VIEW or raises the existing % singleton*. % % H = MRI_VIEW returns the handle to a new MRI_VIEW or the handle to % the existing singleton*. % % MRI_VIEW('CALLBACK',hObject,ev...
6f3daedf080bfbefeeda21721a4b9d545a34852b47daf9201f1ad6cc4011eaf2
MATLAB
27,113
640
%% Script to run pipeline app and propagate settings back to Params clear app app = MEANAPApp; app.MEANAPStatusTextArea.Value = {'Welcome! The MEA-NAP GUI is launched.'}; % GUI resizing % app.UIFigure.SizeChangedFcn = createCallbackFcn(app, @updateAppLayout, true); % Default home directory app.MEANAPFolderEditField...
4dc3696c237d9e82287333f0361ec18b59d18a12dc8a288e16cada645e5b31e5
MATLAB
27,199
813
function varargout = meta_SOMclusters(meth,SOMResults,varargin) % varargout = meta_SOMclusters(meth,SOMResults,varargin) % % Multi-function toolbox for working with sets of clusters, % particularly those extracted from SOM parcellation % % [cl,anyStudy,studyByCluster] = meta_SOMclusters(SOMResul...
0747855b328f012f9901df6b674ebe63944c148c8aac8c66334c957e57eda502
MATLAB
27,680
585
% POP_NEWSET - Edit/save EEG dataset structure information. % % Usage: % >> [ALLEEG EEG CURRENTSET] = pop_newset( ALLEEG, EEG, CURRENTSET,... % 'key', val,...); % Inputs and outputs: % ALLEEG - array of EEG dataset structures % EEG - current dataset structure ...
7fb5bf61127e9315bf4436b6e13bfdebc6bc8cb33fcae2ba199505b23708e5f5
MATLAB
27,723
730
function fieldtrip2fiff(filename, data, varargin) % FIELDTRIP2FIFF saves a FieldTrip raw data structure as a fiff-file, allowing it % to be further analyzed by the Neuromag/Elekta/Megin software, or in MNE-python. % % Use as % fieldtrip2fiff(filename, data) % where filename is the name of the output file, and data i...
bb69e06db65cbb67a16a32e7852633875297c56a175c3367d0aa447e11470066
MATLAB
27,745
807
% spots2pos - Extract position samples from spots files. % % Extract position samples from one or more spots files, separate or merge % multiple LEDs, interpolate missing samples, synchronize, resample, save to % .pos file(s) and concatenate. % % Spots files can be generated by DeepLabCut (in csv format) or by % p...
433688a4f01116f3c4337c5bcdf7a12ab2a480e5b99d8f6a6f8e5d8d0ca62c0f
MATLAB
27,904
588
% pop_dipfit_settings() - select global settings for dipole fitting through a pop up window % % Usage: % >> OUTEEG = pop_dipfit_settings ( INEEG ); % pop up window % >> OUTEEG = pop_dipfit_settings ( INEEG, 'key1', 'val1', 'key2', 'val2' ... ) % % Inputs: % INEEG input dataset % % Optional inputs: % 'hdmfile' ...
c140244e7a905be53d271ff021aeb27b06624b1cac74d7e38b1def40dc33ba47
MATLAB
27,905
686
%Axon analysis and quantification code associated with Gutman-Wei et al., %2025 - main script %Originally written in MATLAB 2019a %Updated version of tracing analysis, which can be used for all tracing %comparisons of axons and dendrites. This main script reads tracing files %formatted in SWC file format and saved as ...
6b5eb40f9b4aedf6a71d471aa48f4cb09f1ec5c1d08585beace47616518cfb72
MATLAB
27,915
704
%% [totalField,fieldmapSD,mask]=UnwrapPhaseMacroIOWrapper(input,output,maskFullName,algorParam) % % Input % -------------- % input : input directory contains NIfTI (*mag* and *ph*) files or structure containing filenames % output : output directory that stores the output (Unwrapped total field and field...
ce30f81e889d6e800c521487dfee49350ae0102bcf0894e728ff0c92f2719525
MATLAB
27,951
901
function coactPaper_figureS17() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=5; fontsize=6; close all fh=initFig('width',18.6,'height',22,'font','Arial','fontsize',fontsize); x=11;y=5; panel_01(x,y,fontsize) panelLetter2(x-letGapX-2,y-letGapY,alphabet(1,labelCase),'fontSize',labelSize,'isBold',...
bf361eb781e8a196effe97003fab7319627339802e46184cbce8049a6e8b8ed0
MATLAB
28,024
728
%% sepia % % Description: This is a GUI of sepia, which is a pipeline control tool % for standard QSM processing. It supports the following processing steps: % (1) phase unwrapping % (2) background field removal % (3) QSM % All these processing steps can be performed in one go or worked as % standalones. % % After perf...
614bf2ec691ba7fa0ed9df11d709d66d3fa5aaae8aacede320e3a9e9624df48b
MATLAB
28,123
492
% parameters file for iEEG experiments % previous: paramsEcog.m % (c) Jiri, Dec10 - now! :o) params = struct; %% set paths localComputerSettings; addpath(genpath(params.storage.dir_neuroHammer)); dbstop if error; %% paradigm information params.paradigm = struct(... 'usedParadigm', 'carDriving', ... % optio...
b480b13b6a641541779f251b1df1dfde1ab0c01c13c13a78d1a8920f01431814
MATLAB
28,198
715
function tests = tapas_physio_examples_test() % Tests all PhysIO examples both as matlab scripts and via batch editor and % compares relevant parts of physio-output structure and % multiple_regressors file to reference results, saved by % physio_update_examples when deploying % % tests = tapas_physio_examples_test()...
da1867288f6f79d43026426ed88a517154c6589e35810957cbe583e7e69d0ff8
MATLAB
28,214
601
function res = woe_corrV76(res,i) % ========================================================================= % woe_corr V7 : V5 cascade with a probabilistic tie resolver at the bottom. % % Identical to V5 (woe_corr_full) for: % §1-§6 matrix construction (votes, weights, AD, ADi, Cfi) % §7-overrides (extreme, cat2...
15f18e68c62a208522c8161bc3b502d65153c3a26aa5f69629c2853b17ec8da9
MATLAB
28,221
115
function [omega_1, crush_counter_init, crush_counter_max, step_size] = get_RF_pulse(B1, numStep) % B1 = input.paramStruct.B1; % gyr = input.paramStruct.gyr; % isGaussWave = input.paramStruct.isGaussWave; gyr = 42.576; isGaussWave = 1; numPulse = 10; % number of ...
e463207757348a49fdfed1405c67658f7d377e35e086c08406b5a99caa60e86e
MATLAB
28,225
836
function dimord = getdimord(data, field, varargin) % GETDIMORD determine the dimensions and order of a data field in a FieldTrip % structure. % % Use as % dimord = getdimord(data, field) % % See also GETDIMSIZ, GETDATFIELD, FIXDIMORD % Copyright (C) 2014-2022, Robert Oostenveld % % This file is part of FieldTrip, s...
98eb6160cc72a9375c1d3b7a9f4cae72248f9ec0c150e994a3138fd1b923afe5
MATLAB
28,253
620
function TS_Combine(HCTSA_1,HCTSA_2,compare_tsids,merge_features,outputFileName,forceWrite) % TS_Combine Combine hctsa .mat datasets % % Writes the new combined dataset to a new .mat file % Any data matrices are combined, and the TimeSeries and Operations tables are % updated to reflect the concatenation. % % Note th...
1b3ac1a8b63bdc80c21792728e3c37cc5caa835e22feea197a28b237dfcf698e
MATLAB
28,276
719
function varargout = view_NBSPredict(varargin) % VIEW_NBSPREDICT MATLAB code for view_NBSPredict.fig % VIEW_NBSPREDICT, by itself, creates a new VIEW_NBSPREDICT or raises the existing % singleton*. % % H = VIEW_NBSPREDICT returns the handle to a new VIEW_NBSPREDICT or the handle to % the existing si...
f675ae1f10fc59e9c5a7d662f4d75eddfb9d8ef57844753273c93ee8666f3f53
MATLAB
28,348
834
function coactPaper_figureS22() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',21.5,'font','Arial','fontsize',fontsize); x=9;y=7; panel_01(x,y,fontsize); panelLetter2(x-letGapX-1,y-letGapY,alphabet(1,labelCase),'fontSize',labelSize,'isBold'...
4a07496057f811247acc85e8b4b3730ce43217dc0480260dcabe0adae9113e31
MATLAB
28,453
756
function coactAnalysesPipeline(rootDir, sessionName,chName,detectionintervals,varargin) if mod(length(varargin),2)~=0 warning('options should be given as pair(s) of name and value') return end verbose=false; ttlCh=[]; accelerometerCh=[]; videofile={}; reAnalyses=false; detectionCh={}; for idx=1:length(vararg...
aa49ad59eb6cd0e667d7a275c5fb0a1455980760986bab8e883cf86c78ec6a7b
MATLAB
28,515
614
function varargout = eBridge(varargin) %eBridge.m %Identify channels within an EEG montage forming a low-impedance %electrical bridge. % % Website : https://psychophysiology.cpmc.columbia.edu/software/eBridge/index.html % %Please cite as: Alschuler DM, Tenke CE, Bruder GE, Kayser J. (2014). Identifying electrode bridgi...
108aa45266824297fb21404a566da974b11b8b2d87183f10a54b9a1612bb159a
MATLAB
28,517
663
classdef BioformatsImage % BIOFORMATSIMAGE MATLAB implementation of the BioformatsImage package % % OBJ = BIOFORMATSIMAGE(FILENAME) creates a new BioformatsImage % object to read an image file. This class uses the Bioformats % toolbox, a standalone Java library for reading and writing life ...
b69063b8567bf8d530d423d2d359f4b68628378b5bb3cd06ece2c1d7469af9d0
MATLAB
28,595
908
function coactPaper_figure02() labelWeight=true; labelCase=false; labelSize=9; letGapX=5; letGapY=6; fontsize=6; close all fh=initFig('width',18.6,'height',21,'font','Arial','fontsize',fontsize); x=13;y=3; panel_01(x,y,fontsize); panelLetter2(x-letGapX-5,y-letGapY+5,alphabet(1,labelCase),'fontSize',labelSize,'isBold'...
d06668a6236f1ba7bfff75482390d5af1a7d9a3a6d2797701c8d64e74724d961
MATLAB
28,601
623
% STD_READDATA - load measures for data channels or % for all components of a specified cluster. % Called by plotting functions % STD_ENVTOPO, STD_ERPPLOT, STD_ERSPPLOT, ... % Usage: % >> [STUDY, datavals, xvals, yvals, events, params] = ... % ...
8813e07833b763bfa423fc24b0a3e698f8c2c1f604556d1d68a5a8ed0b71101e
MATLAB
28,656
687
%% Reference script: Intrinsic Properties % This script reproduces the analysis pipeline used in the associated % manuscript but requires raw data that are not provided. Users should adapt % as needed for their own data. %% Description of analysis: % Date: 2024.10.03 % Title of analysis: Kcng4 Active Properties...
5c067f99a02af334e67bebfae677fdbeb1240820355ef3af4c48080ebae326f8
MATLAB
28,689
726
function [CBF_nocalib, ATT_map, ABV_map, Tex_map, ITT_map, resultExternal] = xASL_quant_External(path_PWI4D, x) %xASL_quant_External Perform quantification using FSL BASIL/FABBER/VABY % % FORMAT: [CBF_nocalib, ATT_map, ABV_map, Tex_map, ITT_map, resultExternal] = xASL_quant_External(path_PWI4D, x) % % INPUT: % path_...
20c92a4cb906542dc7503c1572a24a47e5242f4b2178dbec681300e97d0fa55d
MATLAB
28,723
623
function [sens] = ft_datatype_sens(sens, varargin) % FT_DATATYPE_SENS describes the FieldTrip structure that represents an MEG, EEG, % sEEG, ECoG, or NIRS sensor array. This structure is commonly called "grad" for MEG, % "elec" for EEG and intranial EEG, "opto" for NIRS, or in general "sens" if it could % be any one. ...
a3407e540eb7ee1493c5a74571ce22c9ce42910fb7dcf147736ca0cbbc70b1f6
MATLAB
28,736
690
function [ avw, machine ] = avw_img_read(fileprefix,IMGorient,machine,verbose) % avw_img_read - read Analyze format data image (*.img) % % [ avw, machine ] = avw_img_read(fileprefix,[orient],[machine],[verbose]) % % fileprefix - a string, the filename without the .img extension % % orient - read a specified orientatio...
3dd3dd5708a2a0fe3d7cdc516515b848571b3e6a1e2ff3c4f5057e7a8d2631a8
MATLAB
28,750
558
% STD_ERSPPLOT - plot STUDY cluster ERSPs. Displays either mean cluster ERSPs, % or else all cluster component ERSPs plus the mean cluster % ERSP in one figure per condition. The ERSPs can be plotted % only if component ERSPs were computed and saved in the % ...
15348d2258a5d939ffc59d822b25080a608e40a7655eb557a179539cefc2f1a8
MATLAB
28,782
772
function out = NL_d2(y, tau, maxm, theilerWin) % NL_d2 d2 routine from the TISEAN package. % % The function estimates the correlation sum, the correlation dimension and % the correlation entropy of a given time series, y. Our code uses the outputs % from this algorithm to return a set of informative features about the...
98f2fb3ccfa084e20b51bccdccbccc45a680a059bdc6f139ea65a3e0b8c0c5ca
MATLAB
28,814
635
%% SPM12 FFX batch code for Responsibility project. Can run "main" (conventional) and "comp" (computational) models. % % J Schultz 2019-2024 clear, %close all warning('off','MATLAB:dispatcher:nameConflict') spm12 %% ----------- Main settings ---------------------------------------------- % ----- Determine task(s) % ...
b0a8a859e402db83f0ae03939358458908cc34891672d95287b3078fc5300167
MATLAB
28,828
615
function outstruct = cifti_parse_xml(bytes, filename) outstruct = struct(); %truncate at null terminator to remove extension padding nulls = bytes == 0; if any(nulls) bytes = bytes(1:(find(nulls, 1) - 1)); end tree = xmltreemod(bytes); setfilename(tree, filename);%probably helps with...
075d32ffbd37498ca9b6565c77feda5dae91dee1b1a168ad9f6d874b7eda1d95
MATLAB
28,830
576
%% Script to plot brain maps of cortical hierarchy and SCZ epicenters, and their %% correlation with MIND associations. % Copyright (C) 2026 University of Seville % Written by Natalia García San Martín (ngarcia1@us.es) % This file is part of Hierarchy Longitudinal MIND Gradients Psychosis toolkit. % % Hiera...
b4540fa2e66dbbdeddb2d163c32249251bb458a6dadb2c2cf22a9b6d27d6317c
MATLAB
28,847
67
%% 400 EXAMPLES OF ASSEMBLY CONFIGURATIONS WITH 10 ASSEMBLIES IN A HONEYCOMB STRUCTURED TECTUM % THERE ARE 40 CONFIGURATIONS WHICH ARE EMBEDDED IN TECTA OF INCREASING % DEGREE v = 8 , ... 17 % % THE ASSEMBLIES WERE CREATED IN HONEYCOMB STRUCTURED TECTUM OF DEGREE 8 % FROM n = 26 POINTS DRAWN FROM A 2D-NORMAL DISTRIBUTI...
0e025280e4d3581ce654d901f27262b825406673154c20bc75dad56fb12a516e
MATLAB
28,888
624
function res = arg_define(vals,varargin) % Declare function arguments with optional defaults and built-in GUI support. % Struct = arg_define(Values, Specification...) % Struct = arg_define(Format, Values, Specification...) % % This is essentially an improved replacement for the parameter declaration line of a function....
2384e0ba76f1a1d3567f2f05775fdceb38ce21ae07a5270d75008cc73e986f05
MATLAB
28,932
970
function mwizard(file) %MWIZARD - M2HTML Graphical User Interface % MWIZARD launches a Matlab GUI front-end to edit parameters % that are then used by M2HTML to generate HTML documentation. % MWIZARD(FILE) allows to specify a mat-file FILE from which % default parameters are extracted and can be updated. % % For...
97961e0dfef40b8882418c571d3f3cd89d7c9d096ee07ee3bc00317af5804e11
MATLAB
29,084
533
% POP_CHANPLOT - graphic user interface (GUI)-based function with plotting % options for visualizing. Only channel measures (e.g., spectra, % ERPs, ERSPs, ITCs) that have been computed and saved in the study EEG % datasets can be visualized. These can be computed using th...
a8b91e8a9f55d82ce90937bef69c7817160883630558b66f4e801849e1ca063f
MATLAB
29,107
678
% EEG_CONTEXT - returns (in output 'delays') a matrix giving, for each event of specified % ("target") type(s), the latency (in ms) to the Nth preceding and/or following % urevents (if any) of specified ("neighbor") type(s). Return the target event % and urevent numbers...
1317b78700a75bbc2ce83845afe82be3bb2ebcf32bab33ee81e0f0bea46fb8d1
MATLAB
29,131
641
% STATCOND - compare two or more data conditions statistically using % standard parametric or nonparametric permutation-based ANOVA % (1-way or 2-way) or t-test methods. Parametric testing uses % FCDF from the Matlab Statistical Toolbox. % Usage: % >> [stats, df, p...
590cf30c4698d24dc29917a37adc7b3c20ff3cb582048b42b98257faaaf5a509
MATLAB
29,213
574
%% simple sessions summary % run 'manual_timestamps_analysis' to process TDT matfilese first; % this script will load the sta traces and make plots for individual % sessions and animal average excel_file = 'C:\Users\zzhang21\Dropbox\Matlab\Aggression\2023_NAcGRAB_Aggression.xlsx'; % sessions to process sheet_name ...
3da2a193c72229b7933348d8a077bfe9ab863c3fa6ae58379072eef59e3082e3
MATLAB
29,362
505
function [EEG, Sorig, Sclean, f, amps, freqs, g] = cleanline(EEG, varargin) % Mandatory Information % -------------------------------------------------------------------------------------------------- % EEG EEGLAB data structure % ----------------------------------------------------------...
1330d7b9dd5cbf44f1ab4dbce8f078924e59f6d49241b975b2beeaa7bbef684a
MATLAB
29,466
708
function [xCurrent,Resnorm,fval,exitflag,extra_arguments,output,lambda,Jx] =LevenbergMarquardt(obj,xGuess,lb,ub,opt) %% LEVENBERG-MARQUARD ALGORITHM WITH BROYDEN UPDATES FOR THE JACOBIAN % % LevenbergMarquardt is similar to lsqnonlin with the levenberg-marquardt % algorithm with the three main advantages: % ...
508281f2f72c0a9919389d243ff2c07ee111d6a9eab42c2082e364a0699d8053
MATLAB
29,527
838
function avw_img_write(avw, fileprefix, IMGorient, machine, verbose) % avw_img_write - write Analyze image files (*.img) % % avw_img_write(avw,fileprefix,[IMGorient],[machine],[verbose]) % % avw.img - a 3D matrix of image data (double precision). % avw.hdr - a struct with image data parameters. If % ...
f599fc4d61de5dd52aef7d229f141c27effc97057169d77456b5f965e4863ec1
MATLAB
29,662
593
% POP_PRECOMP - precompute measures (spectrum, ERP, ERSP) for a collection of data % channels. Calls STD_PRECOMP. % Usage: % >> [STUDY, ALLEEG] = pop_precomp(STUDY, ALLEEG); % pop up interactive window % Inputs: % STUDY - STUDY set structure containing (loaded) EEG dataset s...
7d3a3249b02a7d02fccbdab06adf8195cf604c9bd7a1585db0a62b564e06d349
MATLAB
29,811
542
function plot_pairs(groups, group_1, group_2, group_1_n, group_2_n, total_n, stats, saveLocation) % Colors color_black = [0 0 0]; color_dark_blue = [0 0.3373 0.5608]; color_light_blue = [0.3804 0.7529 1.0000]; color_light_gray = [.7 .7 .7]; color_dark_gray = [0.4196 0.4196 0.4196]; plotColor...
d51f9591bae36d23abe0cd8515f8c6731fc526b799b0a2e1e3185d9d5e3749f6
MATLAB
30,050
743
function vl_compilenn(varargin) %VL_COMPILENN Compile the MatConvNet toolbox. % The `vl_compilenn()` function compiles the MEX files in the % MatConvNet toolbox. See below for the requirements for compiling % CPU and GPU code, respectively. % % `vl_compilenn('OPTION', ARG, ...)` accepts the following options: %...
71cd3c7c23004b9b7d47e1b294cdc191b6ae2c94299a84d26759b6652cf6c02d
MATLAB
30,101
946
function varargout = eigenb(varargin) %EIGS Find a few eigenvalues and eigenvectors of a matrix using ARPACK. % D = EIGS(A) returns a vector of A's 6 largest magnitude eigenvalues. % A must be square and should be large and sparse. % % [V,D] = EIGS(A) returns a diagonal matrix D of A's 6 largest magnitude % e...
de3627433401e90177c804f0c836762ab038b278c2777c291885905f5fc8dc93
MATLAB
30,160
747
function [figureHandle, cb] = StandardisedNetworkPlotNodeColourMap(adjM, coords, edge_thresh, z, zname, z2, z2name, plotType, ... FN, pNum, Params, lagval, e, figFolder, figureHandle, saveFigure, cellTypeMatrix, cellTypeNames) % Plots graph network with node size pro...
374553cc6c6119d8688b05117f72152efd92209e6259c88316ab3d03f97d004e
MATLAB
30,512
605
function print2eps(name, fig, export_options, varargin) %PRINT2EPS Prints figures to eps with improved line styles % % Examples: % print2eps filename % print2eps(filename, fig_handle) % print2eps(filename, fig_handle, export_options) % print2eps(filename, fig_handle, export_options, print_options) % % This fun...
462b17dd2cba61a890649130f7abaede732a9cecd722fbb01a39191a4bd85439
MATLAB
30,661
751
function [fh, EEG, com] = pop_prop_extended(EEG, typecomp, chanorcomp, winhandle, spec_opt, erp_opt, scroll_event, classifier_name, varargin) % POP_PROP_EXTENDED See various common properties of an EEG channel or component % Creates a figure containing a scalp topography or channel location, % erpimage of the data,...
90bd0b2dfd678770960ebd26b5360260b91e30ad60cd3587a5a1836bfaaf2243
MATLAB
30,754
832
%EXPORT_FIG Exports figures suitable for publication % % Examples: % im = export_fig % [im alpha] = export_fig % export_fig filename % export_fig filename -format1 -format2 % export_fig ... -nocrop % export_fig ... -transparent % export_fig ... -native % export_fig ... -m<val> % export_fig ... -r<va...
3200f462d86d8419a163aabb3f294a7a3da216cd6d385200307e3c3cdee45fb0
MATLAB
30,867
522
% POP_EDITSET - Edit EEG dataset structure fields. % % Usage: % >> EEGOUT = pop_editset( EEG ); % pops-up a data entry window % >> EEGOUT = pop_editset( EEG, 'key', val,...); % no pop-up window % % Graphic interface: % "Dataset name" - [Edit box] Name for the new dataset. % In the right column o...
f73140ca1d4554beafb5f0870686359bf8ec04d37fe2f9449cc87481e0beb85f
MATLAB
31,020
1,043
function mwizard(file) %MWIZARD - M2HTML Graphical User Interface % MWIZARD launches a Matlab GUI front-end to edit parameters % that are then used by M2HTML to generate HTML documentation. % MWIZARD(FILE) allows to specify a mat-file FILE from which % default parameters are extracted and can be updated. % % For...
7a5170323cfeb335af6b1810932ae55528d1933cd870a0d52c3f09c861714a90
MATLAB
31,077
838
function [err, V, Info, ErrMessage] = BrikLoad (BrikName, param1, param2) % % OLD USAGE for backward compatibility, see New Usage % % [err, V, Info, ErrMessage] = BrikLoad (BrikName, [form], [MachineFormat]) % or % [V,Info] = BrikLoad (BrikName, [form], [MachineFormat]) % or % [V] = BrikLoad (BrikName, [form], [Ma...
c77ee51ce6890e0861038336933100d2e881d5e75ed72ee0c4b7eb838b602bf7
MATLAB
31,109
768
function [fitParamsStep3] = fit_OspreyPrelimStep3(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep2,GAP) %% [fitParamsStep2] = fit_OspreyPrelimStep3(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) % Performs the second step of the LCModel preliminary analysis % ...
50251af13c6c17cc410871ea828be049b725f0f2570a5f40ad1f1a0f81db9d23
MATLAB
31,151
715
function varargout = TMSfunseg(varargin) % TMSFUNSEG M-file for TMSfunseg.fig % TMSFUNSEG, by itself, creates a new TMSFUNSEG or raises the existing % singleton*. % % H = TMSFUNSEG returns the handle to a new TMSFUNSEG or the handle to % the existing singleton*. % % TMSFUNSEG('CALLBACK',hObject...
546cf7638492e2b90aae4c382ba4062b75646a02f42c1ee9d8eb6558f390365e
MATLAB
31,165
767
function SPM = spm_spm_lqc(SPM) % [Re]ML Estimation of a General Linear Model % FORMAT SPM = spm_spm(SPM) % % Required fields of SPM: % % xY.VY - nScan x 1 struct array of image handles (see spm_vol) % Images must have the same orientation, voxel size and data type % - Any scaling should have already been...
54b6b8542a663b02024654cd6cd14d492cda978618ce4fc266dd01fb6cfd092c
MATLAB
31,215
707
classdef Violin < handle % Violin creates violin plots for some data % A violin plot is an easy to read substitute for a box plot % that replaces the box shape with a kernel density estimate of % the data, and optionally overlays the data points itself. % It is also possible to provide two s...
a77f913133ec8ff705c4622d791c98e1377c12ec466e25316251054383171348
MATLAB
31,266
1,030
function atlas = ft_read_atlas(filename, varargin) % FT_READ_ATLAS reads an template/individual segmentation or parcellation from disk. % % The volumetric segmentation or the surface-based parcellation can either represent % a template atlas (for example AAL or the Talairach Daemon), it can represent an % individualiz...
7ff684d6fb0bf8c12f09d0a8a4e7d0b59c33d87bb008b94eb7f61c16f817df16
MATLAB
31,291
871
%% Figure 1 %% 1.1 IRI subscales & PCL-R factors clc; clear; close all load data figure('units', 'normalized', 'outerposition', [0 0 1 1]) T = tiledlayout(2, 4); % 1. IRI-PT nexttile H_IRI_PT = histogram(data.IRI_PT, 'BinWidth', 1, 'FaceColor', [0.5 0.5 0.5], 'EdgeColor', 'white'); H_IRI_PT.LineWidth = 1.5; hold ...
64716aa690c2343efe1dbdc83ca3bfc16ba047a788828a387799b889c04d960a
MATLAB
31,300
785
function [fitParamsStep2] = fit_OspreyPrelimStep2(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM,GAP) %% [fitParamsStep2] = fit_OspreyPrelimStep2(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) % Performs the second step of the LCModel preliminary anal...
e05b8348477e3317b54f6d13deddb43083743a5aa2df20daa947f979f94d1600
MATLAB
31,317
891
%% example streamlined analysis % go to analysis dir cd('/home/uni10/nmri/projects/GoeEpiLongterm/nfocke/AllGGE_redux') % this needs to me modified for your needs if ~exist('nmri_all_subjects','file') % add scripts paths, if not yet present addpath(genpath('scripts')) end % call the params include nmri_include_re...
8051b484ccf64b7c6a18717b4ce4783b0930461b7d3be746ae17c6a3b20cef96
MATLAB
31,345
381
function osp_iniQuantifyWindow(gui) %% osp_iniQuantifyWindow % This function creates the initial quantify window in the gui. % % % USAGE: % osp_iniQuantifyWindow(gui); % % INPUT: gui = gui class containing all handles and the MRSCont % % OUTPUT: Changes in gui parameters and MRSCont are wri...
fc1913cd83ba49a7e3555d8feef0154aee9a51097c8b5891d93071a31a1efe7c
MATLAB
31,396
752
%% ======================================================================== % NEURAL REJUVENATION HYPOTHESIS - COMPLETE MANUSCRIPT CODE (REVISED R4) % ======================================================================== % Population-Level Neural Rejuvenation Dynamics in Addiction: % A Computational Framework for Un...
413e3c2763f26cf97615bc24b9083f693f462afd31a9449ae18a34736a9aecd4
MATLAB
31,462
778
% PLOTTOPO - plot concatenated multichannel data epochs in a topographic % or % rectangular array. Uses a channel location file with the same % format as TOPOPLOT, or else plots data on a rectangular grid. % If data are all positive, they are assumed to be spectra. % Usage: % ...
6d11df941c360fce66366174e1f5365acaf6e32da58647782d5982ca48721f88
MATLAB
31,659
795
function [fitParamsStep2] = fit_OspreyPrelimStep2coMM3(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM, soft,constTarget) %% [fitParamsStep2] = fit_OspreyPrelimStep2(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) % Performs the second step of the LCMod...
6137eb4aabf41a48c3206b9421f1cff7c67c8e50d8217829d09e440322d5dbb1
MATLAB
31,698
537
% Downloaded from https://www.mathworks.com/matlabcentral/fileexchange/20846-weighted-correlation-matrix % % =============== start of license.txt ======================= % % Copyright (c) 2008, Liber Eleutherios % All rights reserved. % % Redistribution and use in source and binary forms, with or without % m...
ef756f5b88249dffe2862003e640afa9edb96831532366da3bd8bb96699a7f3d
MATLAB
31,698
777
%%read cpx function data = read_cpx(file, border, flip_img, kspace, read_params, compression_parameter) %-------------------------------------------------------------------------- % data = read_cpx(file, border, flip_img) % % read_cpx: Function for reading the whole cpx-file and writes the data in % a predef...
7cbdade6bd45e486ad7729ccb4b14a050e36a1ea3e3706c7ee6176b653fd5eae
MATLAB
31,826
862
function ft_write_cifti(filename, source, varargin) % FT_WRITE_CIFTI writes functional data or functional connectivity to a cifti-2 % file. The geometrical description of the brainordinates can consist of % triangulated surfaces or voxels in a regular 3-D volumetric grid. The functional % data can consist of a dense o...
50b139f20b1b470620e1a3c3cec128886e37a3a069ef428fac2689d146dbf2bd
MATLAB
32,142
864
%% In Vivo Imaging Analysis Pipeline for James, Oswell, McCall, Hsu et al., 2024 % % Code here will produce the data for Fig. 2E-Q and all associated % supplemental figures % % For aesthetic purposes, most data was exported from these sections in csv % and txt files and imported in Prism, where most statistical tests w...
7f6ac48e9f8adb59232f5a7575ee7ccdab363300e856615554ea101c3034f6fe
MATLAB
32,172
799
function [fitParamsStep2] = fit_OspreyPrelimStep2MMExp(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM,GAP) %% [fitParamsStep2] = fit_OspreyPrelimStep2(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) % Performs the second step of the LCModel preliminary...
bbb01d712f4bba3e111916b69cffc55522f54b59c9ca7847147b601bdde300d7
MATLAB
32,254
802
function [fitParamsStep2] = fit_OspreyPrelimStep2freeGauss(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) %% [fitParamsStep2] = fit_OspreyPrelimStep2freeGauss(dataToFit, resBasisSet, minKnotSpacingPPM, fitRangePPM, fitParamsStep1, refFWHM) % Performs the second step of the LCModel pr...
58a40c16db1aee50ced856a7283050c9d59ec80763c43e0f877f8c8b63d3bb5e
MATLAB
32,329
712
classdef Violin < handle % Violin creates violin plots for some data % A violin plot is an easy to read substitute for a box plot % that replaces the box shape with a kernel density estimate of % the data, and optionally overlays the data points itself. % It is also possible to provide ...
0f9de73e4bf14c7493b4d109a10081736e91019d193c95b0404fd1758a13268e
MATLAB
32,450
785
function varargout = run_NBSPredictGUI(varargin) %RUN_NBSPREDICTGUI MATLAB code file for run_NBSPredictGUI.fig % RUN_NBSPREDICTGUI, by itself, creates a new RUN_NBSPREDICTGUI or raises the existing % singleton*. % % H = RUN_NBSPREDICTGUI returns the handle to a new RUN_NBSPREDICTGUI or the handle to % ...
b5368aa478cf80c360193c4b1588db16039433a2af7ac66fad35c900b850e86e
MATLAB
32,472
810
function vl_compilenn(varargin) %VL_COMPILENN Compile the MatConvNet toolbox. % The `vl_compilenn()` function compiles the MEX files in the % MatConvNet toolbox. See below for the requirements for compiling % CPU and GPU code, respectively. % % `vl_compilenn('OPTION', ARG, ...)` accepts the following options: %...
0bd8d4655660ba61d0bad43cba1dfd5ffb5f9e2b8284f0fe4d582185914c6551
MATLAB
32,593
1,051
% figure3_tf_itemdistance_plot.m - Plot beta power scaling with item distance % % This script loads pre-calculated TF power data organized by item distance % (angular distance between memory items) and creates Figure 3 from the paper. % % KEY FINDING: % Beta power (15-25Hz) at central channels scales with item distan...