sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
204dd313bb7a4b5d045e6acade6042dee20dd4aaa311df3b41bcea5a2290dc06
MATLAB
12,933
392
function [bstats,wstats,cstats,sstats]=nt_idxx(fname,p) %nt_idxx(fname,p) - create an index file to summarize large data file % % Usage: % nt_idx(fname): calculate index structs, store in index file % nt_idx(fname,p): override default parameters % [bstats,wstats,cstats,sstats]=nt_idx(fname,...): return index stru...
099b242f034458135fdc300e6194492944eab0078396d048c4d00a87af995844
MATLAB
12,950
367
function outpict = imrecolor(ref,inpict,varargin) % OUTPICT=IMRECOLOR(REFPICT,INPICT,{OPTIONS}) % Use histogram matching to transfer color information from one image to another % without transferring any object content from the reference image, as would otherwise % occur with a simple 'color' type imag...
f699f6836690ca28909136eddad2029a286c07b4b2c5793c3cb2a98039a058bf
MATLAB
12,951
333
function [] = plot_stats_VMstim(results_folder, biom_1, biom_2, cat_disp, particles_no_tot, exp_abs_tot, coloc_tot, ratio_tot, pear_tot, MCC_tot, coloc) %% data to analyse allData = 0; % 0 excludes GF control from the analysis %% compute normalisations normalise_to_ctrl_rep = 0; normalise_to_ctrl = 0; %% analysis m...
29b2fa738b3c3b7067d5b903856db3f8ef7d8267850c64fb8b22879360812bab
MATLAB
13,047
284
function outpict = morphnhood(inpict,varargin) % OUTPICT=MORPHNHOOD(INPICT,MODE,{NHOOD},NUMPASSES) % Perform the selected morphological neighborhood operation on an image. % % This is a passthrough to the IPT functions bwmorph(), bwperim(), and bwlookup(), with internal % fallback implementations to help rem...
c8f4c0d5c2bea6feb6e8c0a8b2bcdd07c31877f1506f42d1ce0df1bb303fed56
MATLAB
13,049
246
function [sampleinfo] = writeSpykingCircus(cfg, MuseStruct, force, varargin) % WRITESPYKINGCIRCUS writes a concatinated data file for SpykingCircus and % sampleinfo is returned for later (cutting results back up) % % use as % writeSpykingCircus(cfg, MuseStruct, force, varargin) % % third argument "force" is to force...
cad2b9c27c4690cbfe003a41e67cd4b780ed7c44d0e567578edca4eb88d67267
MATLAB
13,087
335
%% Main analysis scripts %% Mass-univariate analysis % scripts can be obtained from https://github.com/zhou-feng/matlab_scripts %% Predict on discovery cohort % the discovery dataset is availabe at % some scripts we used were modified based on the code provided by % Kohoutová et al.(2020, Nature Protocols, % ...
21c8d46de689537aeb505f4be226c59dd406261b914a7b1ba34e25d285f28d6a
MATLAB
13,090
335
%% Main analysis scripts %% Mass-univariate analysis % scripts can be obtained from https://github.com/zhou-feng/matlab_scripts %% Predict on discovery cohort % the discovery dataset is availabe at % some scripts we used were modified based on the code provided by % Kohoutová et al.(2020, Nature Protocols, % ...
c855363375db1a4131c993625c576bfe33c3887db87cfdf4fef5a2e5ffcd76c8
MATLAB
13,097
281
function [spike] = ft_spike_maketrials(cfg,spike) % FT_SPIKE_MAKETRIALS converts raw timestamps in a SPIKE structure to spike % times that are relative to an event trigger in an SPIKE structure. This % is a preprocessing step to use functions such as FT_SPIKE_PSTH. % % The main function of FT_SPIKE_MAKETRIALS is to cr...
7f2cc46c8bf965bafe2f188cc4dbce8724f277171cf45d2a8b839fddd38e2544
MATLAB
13,150
326
function result = compareMaps(maps, defineSubarea, f0Thres, varargin) % compareMaps: calculate sparseness and inter-stimulus correlation for a % set of activity maps % % Usage: % compareMaps(maps, defineSubarea, f0Thres, whichChannel) % Inputs: % maps: N x 1 array of activityMap objects % defineSubarea: how to decid...
839b86c6afad2fea8ffa595cdd4db971c0939f61c12ffcc678970a0421d87123
MATLAB
13,164
388
classdef TDEV < handle %TDEV TDevAccX wrapper % obj = TDEV() connects to Workbench server % % obj.TD TDevAccX object % % obj = TDEV('parameter',value,...) % % 'parameter', value pairs % 'SERVER' string, data tank server (default 'Local') % 'VERBOSE' bool,...
ee12fcad92232e854a9563f2a47bc1ee4ab829f0bbf559a3e37fc48319455d93
MATLAB
13,184
339
%% EMG ANALYSIS – MS TAPPING STUDY % % Estrazione e quantificazione dell’EMG (FDI) dai dati grezzi g.Tec (.hdf5) % % Background: % Durante la raccolta dati, in una parte dei soggetti l’ordine dei canali % era diverso a causa di un errore di collegamento (cable mistake) fra il % cappuccio EEG e l’amplificatore. Pe...
7f1641a0fb678e5eb1aca045ab6c502a796c9c44274df1456e9f31ed5a89d564
MATLAB
13,203
285
function [spike] = ft_spike_maketrials(cfg,spike) % FT_SPIKE_MAKETRIALS converts raw timestamps in a SPIKE structure to spike % times that are relative to an event trigger in an SPIKE structure. This % is a preprocessing step to use functions such as FT_SPIKE_PSTH. % % The main function of FT_SPIKE_MAKETRIALS is to cr...
114889be81c7a73ee28ec39a8cdfbb7e9b3c2458e3f0a6858bd15d1cb2cc5b26
MATLAB
13,216
316
% Scripts for recreating Figure 6 in manuscript. For transient inputs; Sustained inputs in another script %each script for each figure %**NOTE: highlight segment you wish to run and push "Run Selection" in Editor tab; if you push "Run", it will run the entire program** %% Figure 6A %Program for varying times of tr...
5f437456e0c335f3c0cb3c5cf96aa965eda0d146899e6cec6c3613d7e1326831
MATLAB
13,291
419
%% test threshold and filtering for analysis %% biomarker paramters function [pixel_thresh,min_size,max_size,do_watershed,correct_brightness, kernel, colormap] = get_biomarker_info(biomarker) % Threshold can be between 0 and 1, with smaller values corresponding % to higher intensity of antibody labelling required [r...
ee37943f34a88f08960ce0d634192094e7df345702881af76e3d98736ca82157
MATLAB
13,342
299
function result=psignifit(data,options) % main function for fitting psychometric functions %function result=psignifit(data,options) % This function is the user interface for fitting psychometric functions to % data. % % pass your data in the n x 3 matrix of the form: % [x-value, number correct, number of trials] ...
96386364696dc341070cdeb25e62510218733f9a8d04bed65681057d929c7f87
MATLAB
13,392
399
function plotdata(cfg,dat_micro,dat_macro,SpikeTrials) % find datafilename corresponding to channel channelindx = []; for ilabel = 1 : size(dat_micro.label,1) if strfind(dat_micro.label{ilabel},cfg.channel) channelindx = ilabel; end end % select channel for plotting cfgtemp = []; cfgte...
4b149172779910f0a013275223c39044e81a68d04011dc974a47a32419e29e24
MATLAB
13,480
348
function simulations_samsrf(REDO, basedir) % Script to perform simulation for retinotopy data. % --------------------------------------------------------------------- % Copyright (C) 2024 Simon R. Steinkamp % This program is free software: you can redistribute it and/or modify % it under the terms o...
64b59f4dcd59f5ee29f13f3eeea93ae2b3bb5f31e8f9825a5ab5ec1d89cde057
MATLAB
13,549
465
% ========================================================================= % Title: Statistical Analysis and Plotting of Spectral Features % % Author: Gabriele Mancini % Date: 2025-12-10 % % Description: % This script loads precomputed spectral and firing-rate features extracted % from simulated LFP or EEG proxy signa...
c328ce50a1cc7bccfef5dc1d3b61c9269a51bd0d3716824a27e321596384af97
MATLAB
13,620
314
function [xml_doc] = serialize( header) %SERIALIZE Summary of this function goes here % Detailed explanation goes here docNode = com.mathworks.xml.XMLUtils.createDocument('ismrmrdHeader'); docRootNode = docNode.getDocumentElement; docRootNode.setAttribute('xmlns','http://www.ismrm.org/ISMRMRD'); docRootNode.setAttrib...
6c4cdadeab1f1e8d7a83cbe8aa2d6c8728dca094d9fc390611dfb55ada40fed2
MATLAB
13,683
329
% function [] = taskRatingR_im(subid,nsession) % MBB motivational battery (version 2.2). % Task RatingR % % Written by Raphael Le Bouc - September 2013 % Triggers and eye_tracker added by Alizee Lopez - October 2015 % modified by Nicolas Clairis - mars 2016 and re-adapted in january 2017 % for NeuroSpin study %%Uncom...
f941cf6fd6e301bf9fa8538aa62963316a9433859d6b517e2bee4e36874966a7
MATLAB
13,747
381
%% FP3002_v060_Howland.m % % Fiber Photometry Analysis % % Written for the lab of John Howland - University of Saskatchewan % % It is recommended that users read through the documentation in full % prior to using this analysis. This applies to each section in the code % % All outpu...
397966ccaff0d261e11bede85117761c86215a7214b30ae4c12d3bdef37a822a
MATLAB
13,807
374
function [output,extras] = urlread2(urlChar,method,body,headersIn,varargin) %urlread2 Makes HTTP requests and processes response % % [output,extras] = urlread2(urlChar, *method, *body, *headersIn, varargin) % % * indicates optional inputs that must be entered in place % % UNDOCUMENTED MATLAB VERSION % % EXAMPL...
2477af0c098cbc1b36f52df1e6b5c9562f105b64b02a79ff28a3e1d2fb850793
MATLAB
13,813
294
function [outpict com] = imdestroyer(inpict,iterations,amt) % IMDESTROYER(INPICT, ITERATIONS,AMOUNT) % feeds INPICT through randomly selected image manipulation functions % selecting bounded random parameters each time, for ITERATIONS % number of times. % % Webdocs: http://mimtdocs.rf.gd/manual/htm...
3e0933118216100b59df0f36dc546aef39bb102c03c9a10950342043f7e80b66
MATLAB
13,824
478
function spm_prf_editor(PRF,mask,posterior) % Tool for exploring the prior and posterior settings of a pRF model % % PRF - the pRF model, which may or may not be estimated % mask - if set, this is a 2D binary stimulus matrix which is overlaid % on the pRF response % posterior - if true, the poste...
ba5edbbeffce1879eec42a33ae7de3560eca79612ad1c750f82c7bdabc8d9b99
MATLAB
13,892
418
% ========================================================================= % % Author: Gabriele Mancini % Date: 2025-12-10 % % Description: % Loads periodic and aperiodic spectral features extracted from simulated % LFP/EEG data (Feature_extraction.m pipeline) together with simulation % parameters. Performs correlatio...
e0229df40d3ff2c15d5d0f7a3e9684f5f14472128f44e4e6b760b3c29054a5fa
MATLAB
13,923
373
function Figure0(cfg, MuseStruct) cfg.plot.units = ft_getopt(cfg.plot, 'units', []); cfg.spike.name = cfg.plot.name; cfg.LFP.name = cfg.plot.name; % ncols = max(3, size(cfg.LFP.name, 2)); ncols = 2; nrows = 6; % get file and samplinfo to recover trials SpikeTrials_timelocked ...
c322b2724477dba8d1fce225eacf042719c178d9467df22ef9e07e30e7bd6ea1
MATLAB
13,933
351
function [SpikeIndex, ChanId, SpikeFV] = mDetectSpike(varargin) % This function detects spikes in the EEG. The input parameters to the function are % (1) DATA = EEG signal of M x N dimension where M = data length and N = # of % channels. % (2) Fs = samping rate % (3) BlockSize = length of data block to be processed in...
761ed447cd323ea588bfd5284c866612af6ea90f82d54c99b61d1ad5cfbd28f6
MATLAB
13,991
449
function [ftData1, ftData2] = P1_TMS_iEEG_preprocessing(dataDir, saveDir, queue, input_parameters) % preprocessing of TMS-iEEG data % Input: % dataDir: directory of the folder, saving all the raw data of all subjects % saveDir: directory of the folder, saving all the preprocessed data of all subjects % queue: a one-co...
44057013e72c0843ab507ddd712e89c7e91bbcd7d2456a6174bad3dfca74cef3
MATLAB
14,031
437
function ButtonName=MFquestdlg(Pos,Question,Title,Btn1,Btn2,Btn3,Default) % MFQUESTDLG Question dialog box. % ----------------------------------------------------------------------- % --------------------- Modified Function Help ---------------------- % ‘MFquestdlg’ is a simple modification of ‘questdlg’ which enabl...
567efcd69e6bd66e15dd0fdb8c4a0cab4cc58613592052d6f3440347d99d17cc
MATLAB
14,077
309
function tufteaxis(mmx, mmy) %TUFTEAXIS changes the coordinate axis in a Tufte style. % % inputs: % mmx [min(x), max(x)], the existing XTick are used, OR % [min(x), t1, t2, t3, max(x)], use exactly these % mmy [min(y), max(y)], the existing YTick are used, OR % [min(y), t1, t2, t3, max(y...
8571a7b3ed04057c49b7e4a3cbbe020fc6288600a4e66f8aa7ea08d7a9dda643
MATLAB
14,162
419
function [data] = SEV2mat(SEV_DIR, varargin) %SEV2MAT TDT SEV file format extraction. % data = SEV2mat(SEV_DIR), where SEV_DIR is a string, retrieves % all sev data from specified directory in struct format. SEV files % are generated by an RS4 Data Streamer, or by enabling the Discrete % Files option in the Sy...
e4af0d946076f05bfd05abb9c3fd8c8eca23aae7a66178514b7b45f4ebcdcb6f
MATLAB
14,177
270
function [MuseStruct_corrected] = dtx_remove_wrong_seizure(cfg, MuseStruct, remove_seizure_between_2_files) cfg.type = ft_getopt(cfg, 'type'); if ~strcmp(cfg.type, 'dtx') MuseStruct_corrected = MuseStruct; return end fname = fullfile(cfg.datasavedir,[cfg.prefix,'MuseStruct_corrected_dtx.mat']); MuseStruct_cor...
7c681c8a41229aa7c41264b22c115180cf78f20cd2bd6e515d95fa5931e15266
MATLAB
14,196
338
function [trialsout] = GenerateBlocks(blocks) %Define block contents. for k = 1:length(blocks) j = blocks(k); switch j case 1 %% block 1 %natural, coherent, upright rep = 4; walkerindex = [1]; %natural 1, mod...
b50434d9c2eee1e6bae67f5a1d790552830a2366207a81e01bc8b485b89ce899
MATLAB
14,252
295
function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % % SPIKERAW reads SpykingCircus results (spike times, templates, amplitudes). % Data must have been converted for Phy GUI, with parameter prelabelling = True % https://spyking-circus.readthedocs.io/en/latest/advan...
cea259579ee288f1651be935e53f9ec86dc9c084dee41c0c25e1048978e05c01
MATLAB
14,259
313
function [dat, stats_all, stats_responsive] = stats_unit_density(cfg, force) set(groot,'defaultAxesTickLabelInterpreter','none'); hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; fname_out = fullfile(cfg{1}.datasavedir, 'stats_unit_density.mat'); %% load data if force == false && exist(fname_out, '...
4eba9024cf91bd51acd9acd69b7deab163fcc18b9c94c31885b70c5aaf4546b4
MATLAB
14,260
302
function [SpikeTrials] = readSpikeTrials_windowed(cfg, MuseStruct, SpikeRaw, force) % [SpikeTrials] = readSpikeTrials_MuseMarkers(cfg, MuseStruct, SpikeRaw, force) % Make a Fieldtrip spike trials structure based on equal overlapping % windows. % % ### Necessary input: % cfg.prefix = prefix to output files %...
a367e1080c86cd95949d17b3a1762fca7f283edc52da09c5ef04958db4a6c91a
MATLAB
14,284
432
function plotGrandAverageTimelocked(cfg, LFP, dat, dat_hyp, trialinfo) hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; % baseline correction clear dat_bl baseline_all = [-0.5 -0.2]; baseline_hyp = [dat{1}.time(1) dat{1}.time(end)]; % extract from dat - max for iunit = 1 : size(dat, 2) fp...
31f6985b2a5409bab347f660912137dd9bc85e8307acf59efcae6dd77584d85f
MATLAB
14,285
432
function plotGrandAverage_timelocked(cfg, LFP, dat, dat_hyp, trialinfo) hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; % baseline correction clear dat_bl baseline_all = [-0.5 -0.2]; baseline_hyp = [dat{1}.time(1) dat{1}.time(end)]; % extract from dat - max for iunit = 1 : size(dat, 2) f...
2c79591f7a2eac1710979cf2c450177c109bb83ed59f8ec4a57c646e4f40926e
MATLAB
14,317
466
function plotGrandAverage_windowed(cfg, LFP, dat, dat_hyp, trialinfo) hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; % baseline correction clear dat_bl baseline_all = [-0.5 -0.2]; baseline_hyp = [dat{1}.time(1) dat{1}.time(end)]; % extract from dat - max for iun...
7e467fbaaed49cc4ae7839a5f030b834f4900f55e2fa278bbb74f4c2993ec693
MATLAB
14,339
534
function ctout = colorpicker(varargin) % COLORTABLE=COLORPICKER(IMAGE, {OPTIONS}) % Opens an interactive GUI for selecting colors from an existing image % % The current image view can be zoomed using the mouse wheel. % Color points may be selected by simply clicking on the image. % % Upon selection of a c...
ac9d7d6c311f1dc5f7f4fd90f15ea744aa15c30dd324cd7e7fb28e378ea5a2e2
MATLAB
14,369
332
function Figure1 restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/git/fieldtrip addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/shared/ addp...
628fb24953e1551c06c9da1da137cdaa3cac0c2383e45e6899cfcbefb338e1a2
MATLAB
14,394
335
function [MuseStruct] = alignMuseMarkersXcorr(cfg, MuseStruct, force) % ALIGNMUSEMARKERSXCORR determines timing shift of MUSE markers according % to crosscorrelation with average % % use as % [MuseStruct] = alignMuseMarkersXcorr(cfg, MuseStruct, force) % % Multiple channels can be used simultaneously. % Results are...
54b1a4090de266ca3e0c34ae431908e0df4a420cb4c1c376a9ace48e49d3e616
MATLAB
14,416
362
function err = fLocAnalysis(session, init_params, glm_params, clip, QA) % % Automated analysis of fMRI data from fLoc funcional localizer experiment % using vistasoft functions (https://github.com/vistalab/vistasoft). % % err = fLocAnalysis(session, [init_params], [glm_params], clip, [QA]) % % INPUTS % 1) session: ...
c3ac4c47116ac430b8b6d0149287621710ac60b73b888ff61ec0aa301a60ac13
MATLAB
14,448
344
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
9f6e2cf4a86822a19399530bc3a5fe0d8505a1be6c57ee77102f96e2be0e65df
MATLAB
14,459
303
function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % % SPIKERAW reads SpykingCircus results (spike times, templates, amplitudes). % Data must have been converted for Phy GUI, with parameter prelabelling = True % https://spyking-circus.readthedocs.io/en/latest/advan...
c4aec4e41d10fb8c891aa18f60a3672d0cd09ec1f27e5db97079a8b9b6da6ddb
MATLAB
14,470
262
function [config] = katia_setparams disp('setting parameters'); if ismac error('Platform not supported') elseif isunix rootpath_analysis = '/network/lustre/iss02/charpier/analyses/vn_pet'; rootpath_data = '/network/lustre/iss02/epimicro/patients/raw'; os = 'unix'; elseif ispc ...
184a77719249c21434b106a7ca363180a03dbbd62bf34cf0c864090d0b63dfe9
MATLAB
14,473
335
function [MuseStruct] = readMuseMarkers(cfg, force) % READMUSEMARKERS crawls and searches through patient directories to % extracts marker timings (time and samples) created by Muse. % % use as % [MuseStruct] = readMuseMarkers(cfg, force) % % The first argument is the configuration struct defined by a _setparams.m...
30a612f0ea1c4f94ea1d6d1d561e55aa41c2108891437ce5d483fea9365c38ff
MATLAB
14,512
370
%% extract all markers addpath('~/fieldtrip'); ft_defaults patient_directory = '/Volumes/epimicro/Donnees-analyses/Stephen/2230 files with markers/'; directory_searchstring = '02230*'; data_searchstring = '*m1*.ncs'; eventtype_start = 'BAD__START__'; eventtype_end = 'BAD__END__'; [bad....
9dc494cabf802a3db9d3bd55ab01515674a7e1c610e4af19ef21c4c16cc232dd
MATLAB
14,557
276
function Figure3(cfg_fig) cfg = pnh_setparams; cfg_fig.plot.name = {'PSW', 'FA', 'ES'}; ipart = 1; for ipatient = 1 : 4 SpikeTrials{ipatient} = readSpikeTrials_MuseMarkers(cfg{ipatient}); SpikeDensity{ipatient} = spikeTrialDensity(cfg{ipatient}); SpikeWaveforms{ipatient} = read...
7853aa975ae78fd06cfbde47e21b869b704854ba8bd062efc2b486680687267a
MATLAB
14,584
301
%% set parameters if ispc addpath (genpath('\\lexport\iss01.charpier\analyses\lgi1\Git-Paul\EpiCode\development')); addpath \\lexport\iss01.charpier\analyses\lgi1\Git-Paul\fieldtrip; ft_defaults addpath (genpath('\\lexport\iss01.charpier\analyses\lgi1\Git-Paul\EpiCode\projects\dtx')); addpath (genp...
f70cb41be7b555b9d4c8ee73f219fe39b56c355bfb0e52f93cbf78877bbd9f82
MATLAB
14,620
311
function [LFP] = readLFPavg(cfg, MuseStruct, force) % READLFP reads data epoched according to markers from MuseStruct. % Use as % [LFP] = readLFP(cfg, MuseStruct, force) % % Will also mark overlap with hypnogram markers % Optionally downsample to same samplerate if data contains multiple % samplerates to allow combi...
b8fb894cd0707f5da862f6516a82cb6b22aadb2f171515ef6abca0057aa90718
MATLAB
14,663
364
function [total_cells_table,cells_table,stats] = get_DCX_figures_new2(save_path,area) % Find mat files for final results dataset cell_categories = {'A', 'B','C', 'D','E', 'F'}; files = dir(fullfile(save_path,'*.mat')); for i = 1:length(files) indx(i,1) = contains(files(i).name,'._'); end files(indx,:) ...
9bcb12ea72a45fdd58d4ebee9e0be12fc825441167448267df579ca3b554b673
MATLAB
14,717
296
function [SpikeTrials] = readSpikeTrials_MuseMarkers(cfg, MuseStruct, SpikeRaw, force) % [SpikeTrials] = readSpikeTrials_MuseMarkers(cfg, MuseStruct, SpikeRaw, force) % Make a Fieldtrip spike trials structure based on a Fieldtrip raw spike % structure and on timings defined by Muse Markers. % Trials separated between ...
e9d71bf80efe8af010e9a1e10342a8514343ae6b193b456235e79b598856cb83
MATLAB
14,746
397
function outpict = textblock(intext,geometry,varargin) % OUTPICT=TEXTBLOCK(INTEXT,SIZE,{OPTIONS}) % Generate an image containing a multi-row block of specified text rendered as % fixed-width white characters on a black background. This tool uses textim(); % as such, the character set is IBM CP437. See t...
204bb4e111fd91f8b3c4a10da6513504ecfbadb907a0c6e6fdd461f4c585b088
MATLAB
14,771
278
function Figure3(cfg_fig) cfg = pnh_setparams; cfg_fig.plot.name = {'PSW', 'FA', 'ES'}; ipart = 1; for ipatient = 1 : 4 SpikeTrials{ipatient} = readSpikeTrials_MuseMarkers(cfg{ipatient}); SpikeDensity{ipatient} = spikeTrialDensity(cfg{ipatient}); SpikeWaveforms{ipatient} = read...
177ef1816c9e931615fe030fd742fa27bf8e1f5d39d5ea7ab9aab8eb8f8aafb5
MATLAB
14,855
457
% % BDP BrainSuite Diffusion Pipeline % % Copyright (C) 2019 The Regents of the University of California and % the University of Southern California % % Created by Chitresh Bhushan, Divya Varadarajan, Justin P. Haldar, Anand A. Joshi, % David W. Shattuck, and Richard M. Leahy % % This program is free sof...
b92961e94e6b6c416f558a74550f668101d3f3d311cccc152ac2a8b8c6cba6a8
MATLAB
14,881
401
function [B,ndx,dbg] = natsort(A,rgx,varargin) % Natural-order / alphanumeric sort the elements of a text array. % % (c) 2012-2024 Stephen Cobeldick % % Sorts text by character code and by number value. By default matches % integer substrings and performs a case-insensitive ascending sort. % Options to select th...
5203dfe2397dc05640cb40f3ff91ce4ffc3464b43bc4b71686930e47230d5aea
MATLAB
14,882
393
function CBIG_ComputeROIs2ROIsCorrelationMatrix(output_file, subj_text_list1, subj_text_list2, ... discard_frames_list, ROIs1, ROIs2, regression_mask1, regression_mask2, all_comb_bool, avg_sub_bool) % CBIG_ComputeROIs2ROIsCorrelationMatrix(output_file, subj_text_list1, subj_text_list2, discard_frames_list, ... % R...
7e6346f2284ea6dc46904266d1ff80f5b86e30e5a0e3676b55d44e17dadd4ba0
MATLAB
14,919
400
function [particles_no_tot, exp_abs_tot, coloc_tot, ratio_tot, pear_tot, MCC_tot] = summarise_VMstim(results_folder, repeat_names, biom_1, biom_2,coloc) %% Create summary plot of results biomarker % @author: speressotti %% Folders % figures fig_folder = fullfile(results_folder, biom_1,'Figures'); if ~exist(fi...
7199e077e1a5b980f8760d2c031a09ed210bbd72764b3146157665022816eb12
MATLAB
15,007
363
function Figure_raster restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/git/fieldtrip addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/shared/ ...
66d6e4c2cc05ee10c67b890749dfdad0a6d6b2fe3be094d1dc6554f63c1d9c1c
MATLAB
15,036
323
function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % function [SpikeRaw] = readSpikeRaw_Phy(cfg, force) % % SPIKERAW reads SpykingCircus results (spike times, templates, amplitudes). % Data must have been converted for Phy GUI, with parameter prelabelling = True % https://spyking-circus.readthedocs.io/en/latest/advan...
54d82dee5623a950fd708e89fc5fb4c8ad5cc922e34f56341e47cac78a35fe1f
MATLAB
15,087
253
function [micromed_markers] = synchronize_micromed2 addpath /network/lustre/iss01/charpier/stephen.whitmarsh/WhitmarshEpilepsy addpath /network/lustre/iss01/charpier/stephen.whitmarsh/WhitmarshEpilepsy/releaseDec2015/ patientdir = '/network/lustre/iss01/charpier/stephen.whitmarsh/data/pat_02614_1073/'; ft_defaults %...
fc6e178f1dca78bab4032711807918222a439ddc341b5cb9b3f8418df43fb071
MATLAB
15,117
356
function [MuseStruct] = readMuseMarkers(cfg, force) % READMUSEMARKERS crawls and searches through patient directories to % extracts marker timings (time and samples) created by Muse. % % use as % [MuseStruct] = readMuseMarkers(cfg, force) % % The first argument is the configuration struct defined by a _setparams.m...
64e199fa97bb03af7d63d29d35abab0e6a27040fe17dcb410a17867447a0c2e9
MATLAB
15,191
412
function varargout = imstats(instack,varargin) % OUTARRAY=IMSTATS(INPICT,METRICS,{OPTIONS}) % [OV1 OV2 ...]=IMSTATS(INPICT,METRICS,{OPTIONS}) % Returns information about image colors. This is mostly a convenience % tool to avoid dealing with reshaping arrays, avoiding NaNs, etc. % % INPICT is a...
364a9876fefe58fc9a570f659157701394883609a9c177e6f29d0f8c2314429d
MATLAB
15,246
521
% main script for vector remapping workdir_d = ["F:\Included miniscope Mice\M119\TrainingD11\" "F:\Included miniscope Mice\M120\TrainingD11\" "F:\Included miniscope Mice\M292\TrainingD6\" "F:\Included miniscope Mice\M319\TrainingD7\" "D:\Grouping First\M231\TrainingD9\" "D:\Grouping First\M314\Training_Separation...
5793011069c92cb50e7d9404aa6077bcadfe84339d8e6cbf34cb6ea456639a9d
MATLAB
15,324
341
clc; clear; stack_colors = {'k','','r','b','m'}; skip_lines = 19; % jrr & tyr sessions = [1968 1973 2026 2031 2035 2037 2041 2689 2699 2788 2796 2803 2835]; % jrr %sessions = [2689 2699 2788 2796 2803 2835]; % tyr %sessions = [1968 1973 2026 2031 2035 2037 2041]; % jrr and tyr 4ch; left_channels = [1 2]; right_ch...
77d410832dc5e7744ba094478e758bdac7487d2456d1047cd72f9585a2a07aa0
MATLAB
15,324
331
clc; clear; stack_colors = {'k','','r','b','m'}; skip_lines = 19; sessions = [1964 1986 1992 1995 1998 2005 2039 2790 2792 2794 2798 2815 2843]; % jrr and tyr 4ch; left_channels = [1 2]; right_channels = [3 4]; peri_all_stack5 = []; peri_all_stack4 = []; peri_all_stack3 = []; peri_all_stack1 = []; low_freq_ind = 1:2...
e29fbc9b4a873bd7ee76125a592dbd6c05d56b7ecb4bbdcf1ceece1e6faa164b
MATLAB
15,329
261
function [micromed_markers] = synchronize_micromed addpath /network/lustre/iss01/charpier/stephen.whitmarsh/WhitmarshEpilepsy addpath /network/lustre/iss01/charpier/stephen.whitmarsh/WhitmarshEpilepsy/releaseDec2015/ patientdir = '/network/lustre/iss01/charpier/stephen.whitmarsh/data/pat_02614_1073/'; patientdir = '...
69571f3b7bdd0994d212b6adc5d5133229ab9a2f9f43de496fb00fe93b0243de
MATLAB
15,370
507
function [] = mc_undist() %% Read parameters from files fid = fopen('./prod.par','rb'); % catch problems with old par files seq=0; fftscale=1.5e9; TE = 19; TR = 2000; % sLine=fgets(fid); count=0; while (sLine>-1) sLine=fgets(fid); eq=findstr(sLine,'='); if(~isempty(eq)) sParameter=deblank(sLin...
3161173ad32a0e726cee625c1c58154696ad6498f5200440197e8928a969a68c
MATLAB
15,393
472
function [final_divided,sz_parameters,feature_list] = extract_data_R(animal_info,path_extract,seizure_duration_list,feature_list,folder_num,drug,second_stim,raw_or_normalized) % On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy % Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano ...
3ab8f96be08877e1266408193ffcdf738753a16c68c47d486459afbe945019f6
MATLAB
15,395
448
function plotdata_corr(cfg,dat_micro,dat_macro) % find datafilename corresponding to channel channelindx = []; for ilabel = 1 : size(dat_micro.label,1) if strfind(dat_micro.label{ilabel},cfg.channel) channelindx = ilabel; end end % select channel for plotting cfgtemp = []; cfgtemp.chan...
cfa22f88dc34019227985bb16c79ac04851be8a3c5db5267ce1c754f90b51357
MATLAB
15,396
393
function tom_localizer(subjID, run) %% Version: September 7, 2011 %__________________________________________________________________________ % % This script will localize theory-of-mind network areas by contrasting % activation during false-belief tasks, in which characters have incorrect % beliefs about the state of ...
097687e07eede9b6d15583a1a8e672f31e24565a9ff6069e8032640a55ceffce
MATLAB
15,399
385
function [emm] = emmeans(fitmodel, varargin) % Estimate marginal means % NOTE: this function only works with models that contain no categorical-continuous interactions. % % Surprisingly, GeneralizedLinearMixedModel class does not store whether % the model was fit using OFFSET. so the user must indicate this. % Same t...
d27479ea530fb20fa904ba445b8f7618b89110967ff0869091572c4f83633623
MATLAB
15,405
450
function plotdata_corr(cfg,dat_micro,dat_macro) % find datafilename corresponding to channel channelindx = []; for ilabel = 1 : size(dat_micro.label,1) if strfind(dat_micro.label{ilabel},cfg.channel) channelindx = ilabel; end end % select channel for plotting cfgtemp = []; cfgtemp.chan...
39667fb9d6c5938d28c480e377b3c4e18e7c955b644d5546b39633005dd7599a
MATLAB
15,440
394
function tom_localizer_ts(subjID, run) %% Version: September 7, 2011 %__________________________________________________________________________ % % This script will localize theory-of-mind network areas by contrasting % activation during false-belief tasks, in which characters have incorrect % beliefs about the state ...
442d53e3b3db44ca2a2711f3b8f31609566756cdbdc0b760552d4261399289fc
MATLAB
15,481
408
function [LFP,Mode,Channels,Units,Sweeps] = LoadHDF5(filename,varargin) % LoadHDF5 - Load HDF5 file (obtained from MultiChannel System recordings). % % USAGE % % [LFP,Mode,Channels,Units,Sweeps] = LoadHDF5(filename,varargin) % % This function calls the McsHDF5 Toolbox and reorganizes data for convenience % % ...
34afe9e30ce2d68b027d62f38b1475b483fc5eddaf5c94ea02e9345459156356
MATLAB
15,535
279
function [config] = PET_setparams disp('setting parameters'); if ismac error('Platform not supported') elseif isunix rootpath_analysis = '/network/lustre/iss02/charpier/analyses/vn_pet'; rootpath_data = '/network/lustre/iss02/epimicro/patients/raw'; os = 'unix'; elseif ispc ...
b057ea6a0f8dc12197012d54a53c8b362ef181e8d8bee6f2434e6fee4e1436fe
MATLAB
15,535
472
% % BDP BrainSuite Diffusion Pipeline % % Copyright (C) 2019 The Regents of the University of California and % the University of Southern California % % Created by Chitresh Bhushan, Divya Varadarajan, Justin P. Haldar, Anand A. Joshi, % David W. Shattuck, and Richard M. Leahy % % This program is free sof...
b0a8a2ad3ea030d0e5a55568e98351eecf0324da2077d7931a00224050b8b004
MATLAB
15,546
410
function outpict = imtweak(inpict,model,cparams,varargin) % IMTWEAK(INPICT,COLORMODEL,CPARAMS,{OPTIONS}) % allows simplified manipulation of RGB images or triplets using a % specified color model. % % INPICT is an RGB/RGBA/RGBAAA image of any numeric image class. Alpha is unmodified. % Multifr...
332b58e0ce621670976398b24a8586bc74f4762e46168bb733e8f39d42ecb518
MATLAB
15,606
440
function [features,norm_features] = calculate_features(path_extract,filter_sz,feature_list, winLen, winDisp, bp_filters) % On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy % Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano % DOI: https://doi.org/10.7554/eLife.101859 % Function...
1ba501fd37a4dc79f3fe77b670292b478631c328cf2b6c63e9375cac581340b1
MATLAB
15,626
422
function fit = fit_meta_d_mcmc_group(nR_S1, nR_S2, mcmc_params, fncdf, fninv, name) % fit = fit_meta_d_mcmc_group(nR_S1, nR_S2, mcmc_params, fncdf, fninv) % % Given data from an experiment where observers discriminate between two % stimulus alternatives on every trial and provides confidence ratings, % fits equal-varia...
f9e601141510a8e1cf199af9e65d975e2d7d31fece3496b756a6fccb0d74437a
MATLAB
15,747
351
function [MuseStruct] = readMuseMarkers_discontinuousMicromed(cfg, force) %In addition to readMuseMarkers.m, this scripts reads the text file %associated with Micromed data and reconstruct real time if the EEG file %was composed of several fragments, from different times. fname = fullfile(cfg.datasavedir, sprintf('%...
4c0e1b8bf1fd274af23fa271d62756cf8f3fd1d99fdaec2331e510a82999c3ba
MATLAB
15,850
460
%% ==================== Figure 4 (Locust) ==================== clear all; close all; clc; % Load data load('data4_locust_PN85.mat'); %% Fig 4b: PCA contrast enhanced clc; close all; pcDim = 1:3; smooth = 10; for oo = 7 %1:2:size(contrastOrg,1) tempName1 = strcat('data.',contrastOrg{oo,1}); temp...
d9303e3ece3fe9aed04f890d24f13e99572c30de6ece6fd029970550d17374b9
MATLAB
15,900
572
function uTest_RenameField(doSpeed) % Automatic test: RenameField % This is a routine for automatic testing. It is not needed for processing and % can be deleted or moved to a folder, where it does not bother. % % uTest_RenameField(doSpeed) % INPUT: % doSpeed: Optional logical flag to trigger time consuming speed tes...
9227df5fc4339cffac11f492f9dd5c20e29f64b8a04d82e090c06ed2267a61cd
MATLAB
15,906
427
%% ==================== Figure 3 (Locust) ==================== clear all; close all; clc; % Load data load('data3_locust_PN66.mat'); %% Fig3a: Correlation between all ON-OFF periods & distribution of corr values clc; maxON = []; maxOFF = []; for oo = 1:nOdors tempData = eval(odors{oo}); maxON = [m...
fc67b6b1d60e1ec34d8027d5e9be624d618bd63970caa7604559695a6b8857de
MATLAB
15,997
498
function varargout = imrectify(rawvec,varargin) % IMRECTIFY(RAWVEC, {OPTIONS}) % This is a tool for recovering an image when it is presented as a vector without knowledge % of its original geometry. This may occur when retrieving data from hardware or custom % software which writes images in nonstan...
9c9327d6d2a8a256db30e00e378754abab0921d2f80799f06ec8fdfb76e22c7a
MATLAB
16,071
286
function [dat_unit, dat_lfp] = plotGrandAverageTimelockedModel(cfg, force) set(groot,'defaultAxesTickLabelInterpreter','none'); hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; fname_out = fullfile(cfg{1}.datasavedir, 'AllDataCombinedTimelocked.mat'); %% load data if force == false && exist(fname_o...
90e4ba4ff004aa8eb71385d9fa003bb431cfb2b76dd9bb0d8c482691b6b18886
MATLAB
16,130
363
function [config] = Figure_template_timing restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/git/fieldtrip addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/EpiCode/projects/hspike/ addpath /network/lustre/iss01/charpier/analyses/stephen.whitmars...
6d2e6af51931288050215681429eb74077be0e932b1d7cb89e549c4ca369a2c1
MATLAB
16,150
413
%% Analysis script for Valerio Frazzini's study on electrophysiology of pathoanatomy % % (c) Stephen Whitmarsh, stephen.whitmarsh@gmail.com % % requires bandpassFilter.m from Mario % requires releaseDec2015 from Neuralynx website %% Add path restoredefaultpath if isunix addpath /network/lustre/iss01/charpier/anal...
73a6e11b315084d8791f2b2a580954abfd12c57f13de02cfb7c7510680875ad4
MATLAB
16,189
339
function [config] = dtx_spikes_setparams(config) disp('setting parameters for probe spike analysis'); if ismac error('Platform not supported') elseif isunix rootpath_analysis = '/network/lustre/iss01/charpier/analyses/lgi1/DTX-spikes/'; rootpath_data = '/network/lustre/iss01/charpier/raw/lgi1/DTX-r...
8af090341749285d4f1f123815640e6f5fc0c15fe4c04008bef7c81915117cf1
MATLAB
16,216
292
function [dat_unit, dat_lfp] = stats_IED_behaviour(cfg, MuseStruct, force) set(groot,'defaultAxesTickLabelInterpreter','none'); hyplabels = ["REM", "AWAKE", "PHASE_1", "PHASE_2", "PHASE_3"]; fname_out = fullfile(cfg{1}.datasavedir, 'stats_IED_behaviour.mat'); %% load data if force == false && exist(fname_out, 'f...
53146f50712b338543385387eae11b2360dc47c1037d9c4d6829ba0618d8db22
MATLAB
16,251
412
classdef icparams % ICPARAMS % Class for image composition parameter (ICP) objects. This is intended for eventual use % in IMCOMPOSE and MERGEDOWN to allow a standardized method of storing composition setups. % % This is all rather half-baked. For sake of convenience in handling the referent image, the % ICP object...
c33ddac00e74c307a2fbb72efe21a45a7ac62fadd5e3a0c075c7e7d252f80f79
MATLAB
16,404
287
function out = PsignifitLegacyOptionsConverter( varargin ) %% function out = PsignifitLegacyOptionsConverter( varargin ) % % Converts the most important options from the bootstrap-based legacy version 2.5 % to new Bayesian psignifit 4. % % FAW 04.2017 v0.5 Conversion of the most important options. % ...
6348b2743b51cada66372139a66ddb1d5b6dcfeca1459c0049179ffacb0851cc
MATLAB
16,548
436
function [seizure_duration,min_thresh,output_array,sz_parameters,to_fix_chart] = predict_seizure_duration(path_extract,sz_model,countdown_sec,to_fix_chart,to_plot,subFolders, max_trial,seizure_input) % On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy % Authors: Yuzhang Chen, Brian Litt, Flavi...
bdd4eb0404014424ec7d5843d9a3ba5bc77733102bc6a99870b02b432e90ec5f
MATLAB
16,601
323
function [Sm,Dm,RESULTS,varargout] = patchGraFT(data,K,patches,corr_kern, params) % RUN_GRAFT_PATCHES - apply GraFT algorithm on overlapping patches in parallel % % [Sm,Dm,RESULTS] = run_GraFT_patches(data,K,patches,corr_kern, params) % % Run the GraFT algorithm on a large dataset by operating on % spatially overlapp...
1c709461f31eb13a9cd7c98cf97ecddeeba188cc187d43ab7197939be5da2a80
MATLAB
16,636
376
function [D,S] = mergeGraFTdictionaries(D,S,options,normalizeSpatial) % function [D,S] = mergeGraFTdictionaries(D,S,options,normalizeSpatial) % % % % 2020 - Gal Mishne & Adam Charles % 2022 - Alex Estrada - getSpatialWeights Update %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Initial...
ab7db9af7de3f091034b92e1d68d28994f614c2c9b5005cb237df73b7ec430fe
MATLAB
16,648
386
% ------------------------------------------------------------------------------------------------- % (c) 2025 Leon F. Heffer, David J. Sly, James B. Fallon, Rick Minter, Rebecca C. Felsheim, % Mathias Dietz and Stephen J. O’Leary. % % This file is part of a repository that contains the data originally recorded by He...
fee9ad69b4e8493c82e8a790d91d0b5473b757dfbf138b8104d543bb11954b33
MATLAB
16,707
370
classdef OcTree < handle % OcTree point decomposition in 3D % OcTree is used to create a tree data structure of bins containing 3D % points. Each bin may be recursively decomposed into 8 child bins. % % OT = OcTree(PTS) creates an OcTree from an N-by-3 matrix of point % coordinates. % % OT = OcTr...
f9d76bbaf74dc0eb22906f070cd1591cc8bc2da29b4d29ad749c6430c5e5f0de
MATLAB
16,741
321
addpath /network/lustre/iss01/home/laurent.bailly/fieldtrip/ ft_defaults addpath /network/lustre/iss01/epimicro/patients/shared/Laurent/Scripts_matlab/ % addpath /network/lustre/iss01/charpier/analyses/stephen.whitmarsh/fieldtrip/ ft_defaults %% Settings vect_pat = [2067, 2098, 2141, 2161, 2222, 2256...
04a766d4ecc5f8a9b057767ff45cc77aab1dc8f47858b8bae8afb05082fe8a05
MATLAB
16,752
349
function [senseMaps, eigenVal] = nullspace_vectors_G_matrix_2D(kCal, N1, N2, G, patchSize, ... varargin) % Function that calculates the nullspace vectors for each G(x) matrix. These % vectors correspond to sensitivity maps at the x location. % % Input parameters: % --kCal: N1_cal x N2_cal x Nc block of c...