sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
17367bb237bdc0330c5250465da3ace968dc02ba706013350e76db6dc30276f5
MATLAB
5,381
198
function plot_fig_2ab_PeakMetrics_HFA(path) % grand average structure ga_0 = struct(); ga_25 = struct(); ga_75 = struct(); % colors cb = {'#008450', '#EFB700', '#B81D13'}; %% Plot peak latency frontal % load data tbl = readtable(fullfile(path.data, 'SourceData.xlsx'), 'sheet', 'Fig_2a upper left'); ga_0.pfc.late...
7d1b5793c8c7534683cdc21b102c1a7c6144e7214bb060308c35e1b754c3a5d5
MATLAB
5,389
149
clear all close all clc repo_home = ''; addpath(genpath(repo_home)) winning_model = '4P_SM_WSecdf_LEX_meanLevenshtein___SEM_mean.mat'; numP = 4; % 4P, wins on AIC mdl = load(winning_model) clear conId patId %------------------------------------------------------------------------- % subject inclusion iSja = [101,...
10e06b2d28ce5b3d969ae151edebef0625e7a97f53b5dc0d6537ce5a39de484d
MATLAB
5,394
144
% SENSE_homodyne_recon_demo.m % demos use of SENSE_homodyne_recon.m, which combines % SENSE and partial Fourier reconstruction. Input image can be rectangular, % but both dimensions should be even % % resulting figure shows the improvement from demodulating with the % reference image and compares MSE to reconstru...
a5126e9b284edcb37209b05572af53fafe89253b057689fd2d9d09d950c6de47
MATLAB
5,397
149
function rename_dicm(files, fmt) % rename_dicm(files, outputNameFormat) % % Rename dicom files so the names will be human readable. % % The first input is the dicom file(s) or a folder containing dicom files. % The second input is the format for the result file names. Support format % include: % % 1: Protoc...
61e9f203a72fd621328684aeb7ae5736ddf865169e348fc4d5408998e3a8c3ab
MATLAB
5,405
132
function SBJ10a_conn_lag0(SBJ, method, proc_id, an_id, roi_id, atlas_id, Nbins, chansel) %% Set up paths if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else; root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end addpath([root_dir 'P...
8fc2ae3c6a7257e533dce64a0a740176bb8e7434f82cadd750fb76d5ded93e15
MATLAB
5,405
151
%% Thomas_Yang_et al, 2023 @Nuo Li lab %% Fig. 3a ALM selectivity map clear all close all addpath('../func/'); load Figure_3_a_data im_CCF = imread(['..\CCF_alignment\ARA_template\AllenRefVolCoronal_100275.tif']); im_CCF_anatomy = imread(['.\ALM2x_mergedRGB_slice300_cltr1247_P55_NL09.tif']); im_CCF_an...
1525ebbfa54c5960fef49e239be3bbb56f63cbf4d4dc7b6ba0ef1b683839c808
MATLAB
5,413
103
%% Set Directories wpms.plugins = 'Insert EEGLAB and FieldTrip Directory' wpms.chanlocs = 'Insert channel locations directory' wpms.data = 'Insert data directory with each subject ID identifier starting with 0' %% Add all plugins addpath([wpms.plugins filesep 'EEGLAB_FieldTrip\eeglab_current\eeglab2019_1']) add...
943135b5eacf8724fdc4ffd1a89808b2c48c94d66e0a8afe1235975d8e0f5a8e
MATLAB
5,417
148
function plot_timeWarpedCorrelationScoreCurves(cells) % Load Params if ~exist('paramsPath','var') params = readtable('./UniversalParams.xlsx'); else params = readtable(paramsPath); end samplingRate = params.TimeBin; ds_factor = params.ds_factor; secsInMin = 60; conversionFactor = secsInMin/(ds_factor*samplin...
e45f19550a2450e904ee5d10393a5ca4a5b35a3493bc58632da3ec1c42931b75
MATLAB
5,417
150
function BHV02b_RL_model_plot(SBJ,proc_id,model_id,varargin) %% Plot single SBJ behavior with RL model fit % Scatter of single trial tolerance and outcomes % Scatter of block accuracy and average tolerance % Sigmoid from logistic regression fit on top % INPUTS: % SBJ [str] - ID of subject to run % proc_id [st...
ae3e9e2985179b68a8ea6ff535d1e750ec08871eac58f4e5a980a88d5d63571f
MATLAB
5,420
144
%% Run scripts for RL GLM analyses if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/'; ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end %% addpath([root_dir 'PRJ_Error/scripts/']); addpath(genpath([root_dir 'PRJ_Error/scripts...
ee7c7a47dd81d3edad0e6c03a5fe3219e1a6fc0fed459b021bee102f997ed393
MATLAB
5,422
227
function mas = xray_read_mac(mtype, varargin) %function mas = xray_read_mac(mtype, [options]) %| %| Read mass attenuation coefficients for a given material type. %| Returns a strum that can interpolate onto desired energies. %| %| in %| mtype 'aluminum', 'copper', 2, '2', '02-helium', ... %| See xray_material_file...
bec04449c8b4bcde6d332f9512435df2230bcfcf307be9983891cfcbcda5ddc5
MATLAB
5,428
160
function plot_autocorrelation_before_and_after_dchPeriod(cells) % function constants plotWidth = 500; plotHeight = 1000; spatialBinNum = 200; MPP = 0.125; %Minimum Peak Prominence numCells = size(cells.metadata,1); drawFig = true; % declare global vaariables all_pcntrl = NaN(numCells,1); all_pdch = NaN(numCells,1)...
51bf2a0bdee14451bc137874f8b0516c1cef76f750eb8731c0bd3a666484985a
MATLAB
5,430
136
function SBJ10a_corrRT_regressRT_ANOVA(SBJ,an_id,stat_id) %% Run ANOVA with potential RT regression before % Set up paths addpath('/home/knight/hoycw/PRJ_Error/scripts/'); addpath('/home/knight/hoycw/PRJ_Error/scripts/utils/'); addpath('/home/knight/hoycw/Apps/fieldtrip/'); ft_defaults rng('shuffle'); % seed randi wit...
b33c01ff23fdb18c01d02d5d98be43e0ec371818eeba3060988757804a471e69
MATLAB
5,433
194
function fig = nyu_plot(surf_brain,sph,elec,elecname,color,label,aparc_annot,radius,alpha,add_figure,pointalpha,braincolors) if ~exist('color','var') color = 'w'; end if ~exist('label','var') label = 0; end if ~exist('alpha','var') alpha = 1; end if ~exist('radius','var') radius = 1; end if ~exist('apa...
d060d356f3928c3c4c2c445b25863e107a631a43001faa5eb81c8ac7fec13dad
MATLAB
5,433
89
% fitting scattering and birefringence of brain tissue % run this after OCT_recon.m is finished folder = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_10T/CTE_8572/'; % OCT file path ADJUST FOR EACH SAMPLE!!! P2path = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_10T/CTE_8572_2P/'; % 2P file...
a9966d99427049f8849e42e32961fa9a33a56189ea5dd394e182d83a25de762b
MATLAB
5,439
136
function [estimationSuccess] = getParams(f_orco, s, keyNdx, xGrid, yGrid, zGrid, ratio, ... state, kin, Thresh, K, border, figN,sbpltN) % getParams does a grid search to determine model params. Note that this % does not automaticaly look for the elbow point. The user should look at % the cost function to m...
969a92e6ef0764bf1fe6510d44ee447b8b1df038088293328d0cffdcc7346500
MATLAB
5,442
142
function [outBestPeriodIndices,outSampleFreq] = IPEMMECFindBestPeriods(varargin) % Usage: % [outBestPeriodIndices,outSampleFreq] = ... % IPEMMECAnalysis(inValues,inValuesFreq,inPeriods,inPlotFlag,... % inMergeType,inDecisionType) % % Description: % Finds the best matching periods corr...
96588f70ebd5760681db4ecde7bd0717a14c7da982a12fafd6d75d8587eecb7d
MATLAB
5,446
124
% Dumps all the paramters to a figure function fig = plotParameters(obj,fontsize) if(obj.plotFigures == 0) disp('plotParameters: plotFigures = 0, hiding figures!') visFlag = 'off'; else visFlag = 'on'; end fig = figure('visible',visFlag); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
bb568811926144f56f49b8c0bcc18c2f7f972cde7077d5583c6c0fccc2d461fc
MATLAB
5,448
191
function [] = Faber_Extract2(savedata,savefigs,blockname1,tankdir,filename1,filename2,trimstart,trimend) clearvars -except blockname1 filename1 filename2 savedata savefigs tankdir trimstart trimend; close all; warning('off','all') warning blockname = blockname1; tankname = tankdir; sd=savedata; sf=s...
705667c133e7df79bbd9efff818ce45b2b7e657a6a2fbedf37632daabe4a8bac
MATLAB
5,452
114
folder= '/projectnb2/npbssmic/ns/BA4445_4/'; datapath=strcat(folder,'dist_corrected/'); P2path = '/projectnb2/npbssmic/ns/BA4445_4_2P/'; % 2P file path % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/...
50ff1739d72baad1cb4ef9977c161239fdefc91a59a53fd956cb8f74d2836a4b
MATLAB
5,464
153
%% State Space Model for i = 1:2 tic dataToFit = useData(1e4+1:2e4,i); [omega, ampEst, allQ, R, stateVec, stateCov] = fit_MKModel_multSines(zscore(dataToFit),[.5,2.4,20], Fs,[.99,.99,.99],... [.1,.1,.1],.01); rhythmLoc = find(omega > .1 & ome...
970274c759d114598cfe1454e63906323d022f660b210e412e0f2dd84ad94233
MATLAB
5,466
185
%% Calculate and plot PSD % % For information about NatMEG-PD please refer to the data descriptor: % % Vinding, M. C., Eriksson, A., Comarovschii, I., Waldthaler, J., Manting, C. L., % Oostenveld, R., Ingvar, M., Svenningsson, P., & Lundqvist, D. (2024). The % Swedish National Facility for Magnetoencephalography ...
59eaf16f78c5e8ed09aee0da9dedc6435273457c92938473f5e57996d9dd36ec
MATLAB
5,470
147
function save2ExcelFile(filename, mat, varargin) % This is a wrapper function that allows OTBR Toolbox users to create % Excel files either in MATLAB or in Octave on a Raspberry Pi! % To create Excel files on the Raspberry Pi the package IO has to be % installed. % % Usage: save2ExcelFile(fullFilename, dataAsCell, vara...
d32ab63107b6f18db32ea1764aea746c4938f15e41555c1e2c2882b5493d7694
MATLAB
5,471
142
function fix_lines(fname, fname2) %FIX_LINES Improves the line style of eps files generated by print % % Examples: % fix_lines fname % fix_lines fname fname2 % % This function improves the style of lines in eps files generated by % MATLAB's print function, making them more similar to those seen on % screen. Grid l...
fa65d97ac551ac2ae2e02d7b36f12b0d32a7ad2b3c733cbfc784233ddea5482c
MATLAB
5,472
186
function [dyn_obj dce] = ir_mri_dce_obj1(varargin) %function [dyn_obj dce] = ir_mri_dce_obj1(varargin) %| %| Generate dynamic object for DCE MRI simulations of GRE sequence. %| %| option %| 'TR' [s] repetition time (default: 5e-3) %| 'TE' [s] echo time (default: 0) %| 'flip' [rad] flip angle (default: pi/6) %| '...
06cacfb95a996ed85723a8a838dff695bec0e61a4d344b3eb11a5a771de855d6
MATLAB
5,474
100
load('region_value_f0_percept.mat'); region_value_f0_percept=region_value; load('regions4barplot_f0_percept.mat'); regions4barplot_f0_percept=regions4barplot; load('region_value_fdiff_percept.mat'); region_value_fdiff_percept=region_value; load('regions4barplot_fdiff_percept.mat'); regions4barplot_fdiff_percept=regions...
1c4b1645ac5f7d4633cbe51408fae1120bf18b0b51e61c2062cc588912cb8684
MATLAB
5,475
139
%% Produce a figure of Stimulator Output required per individual to fix intensity at cortical target % (c) Carys Evans, UCL % carys.evans@ucl.ac.uk % October 2019 %This script produces one figure showing the distribution of Stimulator %Output across the sample when dose-controlling to fix E-field intensity in %the cor...
552c88b574fb292ed4c032ffde43ff0fea7296e9f6e0328cc2364b39825d59e9
MATLAB
5,475
181
% clear all; Xsize=40; Ysize=40; Xoverlap=0.5; Yoverlap=0.5; %% get FIJI stitching info filename = strcat('E:\Jiarui\Data\200714TDE60\fitting\'); f=strcat(filename,'TileConfiguration.registered.txt'); coord = read_Fiji_coord(f,'us'); %% coordinates correction % use median corrdinates for all slices % coord=squeeze...
093e4a35c9ba18ca2fba72d58d32f38de7e85dd6e8a0a4cca1ceb0365d791a85
MATLAB
5,479
144
% Make allTrialsAllCellsMatrix % sessions = dir('/Volumes/groups/giocomo/export/data/Projects/JohnKei_NPH3/fkm_analysis/fr_corr_matrices/*.mat'); sessions = dir('/Users/KeiMasuda/Desktop/fkm_analysis/fr_corr_matrices_noSpeedFilter/*.mat'); filter = 'mec'; sessions = filterSessions(sessions, filter); % load(sprin...
8b3165cf9ad0392cd1b8a97274c1ad64f959998f8d0b16771455d6b8e0908e87
MATLAB
5,480
155
function [] = fun_calcROIsegs(handles, mode, filename, filepath) %FUN_CALCROISEGS Summary of this function goes here % Detailed explanation goes here I_stack = handles.imageI; G_stack = handles.imageG; S_stack = handles.imageS; [~, ~, n_z] = size(I_stack); if get(handles.Check_AutoI, 'Value') Im...
9d8f54057c84c58e98d1c88c4ced4358ee72a1fde09992ce94f2443b2a56b6fc
MATLAB
5,481
108
% LEARN_STRUCTURES_BY_DENSITY % % Input % samples: logical matrix where each row is a sample and each column a node % relative_lambda: relative regularization factor (relative to the lambda % that drives all coefficients to zero. % densities: vector of densities to be tried. % option variable_groups: arra...
58b3ac6419b7c972ce46f7c75961cd2989d343e37114b1a0017d785cd4dce4f7
MATLAB
5,483
296
% Code responsible for generated the heatmap and mean trace plot of % heterozygous and homozygous valopa knock-out fish found in Fig S7D in "Ciliary % localization of a light activated neuronal GPCR shapes behavior", PNAS, % 2023 % Written by Amy Winans close all clear all load valopaKOworkspace %% Calculate...
5639e6d909fa946e597bf7ba07321204a8c5f01a0e4628a0da9d0b095be26d07
MATLAB
5,486
170
% Estimate the Fisher information of stimulus in the neuronal responses of a single % recurrent network % Some simplifications is used in this Hawkess process: % 1). No temporal kernel % Wen-Hao Zhang % July 22, 2021 % University of Chicago if ~exist('Path_RootDir', 'var') setWorkPath; end addpath(fullfile(Path_...
988779cb57b9defaba9019bec86d0e29442d6952bd5d322e79d5fd6ac89ca0c7
MATLAB
5,486
156
function startVideo(vid, varargin) % Start the playback engine of a video that was loaded with loadVideo. % % After calling this function the video is not presented on the screen! Use % showVideo in a loop to get each frame and to present it! % % Usage: startVideo(vid) % startVideo(vid, varargin) % % INPUTS % ...
6d16046cbece7449175df395ea8606691dfb84f658e073ebf26e8873f63c66b1
MATLAB
5,492
142
function out = wait4NetworkResponse(time2wait) % Waits until one of the connected experimental computers sends its % network ID, or until time2wait has passed. An experimental computer % sends its ID when keyBuffer, started there with the option 'sendNetID', % ends after a response. With several experimental computers ...
2f5d82a73616155c9c3e6f923dbd7e686d4d986e52ddbb62dbd95037bf411316
MATLAB
5,493
176
% description: % 1) plot ERP for both conditions in a desired region, % 2) plot region specific spectrograms w/ or w/o ERP removal % 3) plot ERP for a given chan, and mean(trials-ERP) in the same chan % 4) plot idividual trials and trials-erp % 5) individual channel PSD close all; reg = 'CA3' cue_responsive = 'yes' s...
e9447770a4d9fa69fdf1fdf34fa187bab436f7527404de6cd917debed32387c2
MATLAB
5,493
128
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % MAIN - PWelch analysis - 20 subjects - MEG - Desikan-Killiany % Authors: MCC % Date: 25/10/2022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; clear; clc; %% to be updated root_path='/Use...
17a2c5c55c64f0a55fe332bcc2dc515a0000209703682f414720f5da227449a4
MATLAB
5,496
111
function [bestDprimeSVM,bestRR,score] = diliCCAnested(stim,eeg,nCompStimAll,nCompEEGAll,shifts,prefixTmpFile) if ~exist('prefixTmpFile') prefixTmpFile = ''; end % Tuning % Outer cross-validation loop if length(nCompEEGAll) == 1 && length(nCompStimAll) == 1 autoTuning = 0...
26b25372e2565e812041a538e6af47b6b64e516733e31e6286ea3af073df061b
MATLAB
5,497
146
% Method: 1 for WeightedCorr or 2 for QuadrantRatio function plot_individual_lap_thetaseq_scores(method) load('X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 3\Theta sequence scores\thetaseq_scores_individual_laps.mat') if method == 1 data = lap_WeightedCorr; quant = 'Weighted Correlation'; else ...
507079d0087292d2d53b4d0819d403ce68ccc71a1b6829933fac6d9e543a6f94
MATLAB
5,497
138
function Optical_fitting_MGH(I, s_seg, z_seg, datapath, zf) % Fitting code for the data shared by Hui. % I: volume data for 1 tile % s_seg: slice number,for initial test, just use arbitrary number like 1 % Z_seg: tile numberfor initial test, just use arbitrary number like 1 % datapath: datapath for original data % zf:...
199dc2b2723ee934f45fe378a5db7fd94f796f904372d348ad58b76c54530b92
MATLAB
5,504
109
%% IR57 Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if ~contains(path,'fieldtrip'); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = 'IR57'; SBJ_vars.raw_file = {'2017032...
8c1990d92ddea7e2b7268b357e11b5b23eee1a434384fc68c93ddb1f39fdf611
MATLAB
5,519
171
function [new_trigger_list] = relabel_EEG_button_press_triggers(recorded_trigger_list, new_response_matrix) % make a copy of the old trigger list new_trigger_list = recorded_trigger_list; % trigger labels fa_left = 206; fa_right = 202; trial_left = 205; trial_right = 201; % select false alarm and trial frames be...
90f59dcc9c5156f87b026d97e47958a9a81bd5e2ce2d781f910c806a05b42d34
MATLAB
5,520
218
%% master_startup; datapath = fullfile(path.data_save,'pbupsRT/'); filenames = get_reaction_time_filenames(datapath); saving = 1; example_rat = 'X018'; %% load(path.mat_save + "RT_bootstrap_cond_pych_params.mat"); [ci_bias, ci_lapse, ci_fitbias, ci_fitlapse] = deal(nan(length(filenames),2)); [mean_bias, mean_lapse...
b0c80e8edaaca5b13e375be28be912476a84100e0a92ed9e7d80cf3b0a37e2c8
MATLAB
5,521
143
classdef StackView < handle properties stack % stack containing image data ax % handle of axes object to display image im % handle of image object overlay % handle of overlay plot sliderFrame % slider selecting frame to dis...
a73cbac7c6cdff61d33f9dbb874f4d44aa90040193015ff6bb7201e12e7ffad5
MATLAB
5,522
175
%% Example Script to Plot Data %% Cut in time t_f = 40; % Change this to plot till t_f [~, i_f] = min(abs(time-t_f)); [~, i_f_i] = min(abs(time_i-t_f)); [~, i_f_b] = min(abs(time_battery-t_f)); %% 1) Robot Position and Orientation figure hold on plot(time(1:i_f),pos_base(1:i_f,1),... ...
974b0105ed1ea3ec0ecb1d03c09c508ecadd7ab03c9a16c81fc7c7ad22359e67
MATLAB
5,525
164
function y = convolve2(x, m, shape, tol) %CONVOLVE2 Two dimensional convolution. % Y = CONVOLVE2(X, M) performs the 2-D convolution of matrices X and % M. If [mx,nx] = size(X) and [mm,nm] = size(M), then size(Y) = % [mx+mm-1,nx+nm-1]. Values near the boundaries of the output array are % calculated as if X was s...
12b7d142b7a259316d94880d5b3b17e43d391b1138122bca517626d9a0ef3ab9
MATLAB
5,541
137
%% Produce a figure of E-field in target ROI containing four histograms with fitted normal probability density functions % (c) Carys Evans, UCL % carys.evans@ucl.ac.uk % October 2019 %This script produces one figure showing the distribution of E-field %intensity across the sample in the target ROI. Using each %[simtag...
c8a04764fe9fd9fc8dcda6c75c111c6e14e0e1320aed8e9f4eeecdccc4a70293
MATLAB
5,542
195
function [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist) % [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist) % % Loads a volume from the dicom files in flist. % % The volume dimensions are arranged such that the % readout dimension is first, followed by the phase-encode, % followed by the slices (this is not implem...
1bda884f7e95399da3c21e135afde42837c2f78f1f0bd60aae2e0d8838328bda
MATLAB
5,549
175
function[]=ret_diff_vol_stitch(id,datapath) % mosaic parameters % mkdir(strcat(datapath,'dist_corrected/volume_tmp')); Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/ThorOCT_code'); addpat...
36df2e2f065589147286e8e351a6197b01025c45494eb1716fd642e376a9dfb6
MATLAB
5,549
175
% This function calculates the effective available gradients, % assuming there is simple masking due to cis interaction. % % [R] + [L] <-> [RL], here we assume k = 1 for the reaction % % TODO: See DS concern raised March 29, 2012. However, the cis % interaction takes place over a larger area than the trans % interactio...
64a904876e8fb8b9778062efd55ab01b5530b959acde264f91de18a6536ff3f4
MATLAB
5,549
183
clear all close all rng(6) %% initialization of parameters/matrices run('param_init2.m') %% creation of presynaptic inputs run('input_init.m') %% trial loop for l = 1:num_trials %choose a cue cue_given = cues{l}; u_k = PF_map; [~,ind_t] = max(u_k,[],2,'linear'); [row,col] = ind...
4f0c8779c52799efe60e301c8972af314354a4989dddb3969eb8ca91a2addd00
MATLAB
5,552
168
%% --- Generate functional connectivity profiles and estimate clusters % Adapted by M.-Y. Wang, 16-Jul-2023 %% 1.initial parameters clear all clc project_dir ='/Users/wang/Desktop/Research_projects/BBSC/Functional/Parcellation/1_generate_profiles_and_ini_params'; cd (project_dir) addpath(genpath('/Users/wang/CBI...
790277e6ba1913d723c93d56c1f4c4e2002c61f3486d6af867aad7d36fa7c56c
MATLAB
5,563
151
clc; clear; addpath('/data/hu_esraal/Documents/eeglab2019_0/') addpath('/data/hu_esraal/Documents/TMSEEG-4.0') eeglab % EEGpath= '/data/p_02186/TMS_ECG2/analyses/EEGsham/'; eegfolder = [EEGpath 'merge/']; cd(eegfolder); subj_names = {'VP01', 'VP02', 'VP03', 'VP04', 'VP05','VP06', 'VP07', 'VP08', 'VP09', 'VP10', 'VP11'...
359873d198bff5913f10c6b9ed00d6188ea50dfa8916f10077b66a72a58bcffb
MATLAB
5,567
148
function SBJ10b_conn_Xcorr(SBJ, proc_id, an_id, roi_id, atlas_id, maxlag, stepsize, chansel) %% Set up paths if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else; root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end addpath([root_di...
d53d77956f6f62aa4b25e51e174aa514740cbf7b80c625370d88f9a7cfc57ef3
MATLAB
5,568
183
% Demo of a linear Hawkes process where the E neurons are organized on a % ring % Wen-Hao Zhang, July 2, 2019 % University of Pittsburgh %% Parameters of the model parsCoupledHawkesNet; parsMdl.dt = 0.1; parsMdl.tBin = 20; % length of a trial. Unit: ms parsMdl.bSample_ufwd = 0; parsMdl.jxe = 1e-2; parsMdl.ratiojie ...
ec68380fa2ee9a32d8ed98a7453c70a1273b23e2d7a92d055cb0cccd05b6a5a5
MATLAB
5,569
161
%% --- Generate brain networks for long days or nights % 1. compute the average profiles % 2. clustering the networks using the yeo2011 method % Adapted by M.-Y. Wang, 16-Jul-2023 %% 0.initial parameters clear all clc project_dir ='/Users/wang/Desktop/Research_projects/BBSC/Functional/Parcellation/1_generate_prof...
d179641de5edd378364c7f675773be9069b807c78969d610c7ea7c1451c8b692
MATLAB
5,572
131
function [] = network_params_RMonly(binsize, maxlag) addpath(genpath('D:\kate_dropbox\Dropbox\Rutgers\Matlab - Rutgers\Firestein Lab\BCT\')); %parameters totaltime = 300; %options raster = 0; plotme = 0; extracalcs = 1; % ************************************************ totalNumExp = 3; count.cond0B...
dff253745ceb806f2573b5c42fc2bbdfb3f8298d9c9b68f8fb0a4f74430905e7
MATLAB
5,575
141
function tSC_ratio_oscstate(mainPath, animal, session, ch, isstim, exp) %TSC_RATIO_OSCSTATE calculates the ratio of different theta cycles during %different oscillation states. % TSC_RATIO_OSCSTATE(MAINPATH, ANIMAL, SESSION, CH, ISSTIM, EXP) detects % oscillation states in the hippocampal LFP (long and short th...
50df36defe31d61d57572f3e78d52850b6433f8214197c59ee99c469e47390a7
MATLAB
5,581
178
function[]=ret_vol_stitch_from_AB(id,datapath) % mosaic parameters Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/ThorOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/NIfTI_20140122...
77cb564ff093c9fcb002d15d879a9ae86ef6e7c63a4a02b611e39020ac7f9246
MATLAB
5,592
186
function [fNum] = plotROISpatialProb(f_orcoAll,dxy,lab,border,fNum) if isempty(lab) lab = ''; end T_df = [-20,20]; T_f = 15; ROI_func{6} = @(f,df,baseline) (f-baseline)<0.1 & (df)<0.1;% baseline ROI_func{1} = @(f,df,baseline) df<T_df(1) & ~ROI_func{6}(f,df,baseline);% negative df ROI_func{2} = @(f,df,ba...
1b1ff9e154fe477c3453470a3580d7384eb68c57cd06c00e8261739ef52c73b2
MATLAB
5,593
164
function P = spm_eeg_inv_vbecd(P) % Model inversion routine for ECDs using variational Bayesian approach % % FORMAT P = spm_eeg_inv_vbecd(P) % % Input: % structure P with fields: % forward - structure containing the forward model, i.e. the "vol" % and "sens" structure in a FT compatible format % ...
78e271ca47a225a55e52fff0bc2d6ac9681775119f4f338efa4e514c0a10a84c
MATLAB
5,594
224
function [xs, info] = ir_diag_majorize_admm1(H, varargin) %function [xs, info] = ir_diag_majorize_admm1(H, varargin) %| %| Use ADMM to find a diagonal matrix D = diag(x) of minimum Frobenious norm %| that majorizes a given square matrix H, i.e., min_D || D || s.t. H <= D. %| Assumes that H is positive semidefinite (so...
8066bda0400a1815df65c30c82886f5350ef534923c96aa4ad6a0b528d1d291c
MATLAB
5,599
173
function [lm, r, pval] = two_group_scatter(xx, yy, conId, patId, xl, yl, input_options) % Plots both groups on the same axis, adds trend line, performs a multiple regression % [lm, r, pval] = two_group_scatter(xx, yy, conId, patId, xl, yl, input_options) % % xx x variable, vector % yy y variable, vector %...
2ce7ca36874de3e11aae3381d8ba0a9e5c2698d530e91314e450f1fbfefd36ea
MATLAB
5,604
185
%% Dipole source analysis % % Vinding, M. C., & Oostenveld, R. (2022). Sharing individualised template MRI data for MEG source reconstruction: A solution for open data while keeping subject confidentiality. NeuroImage, 119165. https://doi.org/10.1016/j.neuroimage.2022.119165 % % Do dipole fits to evoked componet. Sing...
3fb5c383bffa25f349f1fd237f13e95874c15e4b8f546ed279d8f6a9e62e47b1
MATLAB
5,604
90
%% Example script using Fieldtrip function data2bids() % https://www.fieldtriptoolbox.org/workshop/madrid2019/bids_sedation/ sourcedata = '/Volumes/Samsung T3/data/eeg-sedation/sourcedata'; bidsroot = '/Volumes/Samsung T3/data/eeg-sedation/bids'; cd(sourcedata) load datainfo % For each dataset, there is an entry ...
d0ef465d06bcdc261975f4a932671b8054418440fde101c79133592fc808a37b
MATLAB
5,607
118
function outResult = IPEMProcessAuditoryModel (varargin) % % NOTE: % This is a modified version of IPEMProcessAuditoryModel.m % Normally, this is compiled into the Mex interface for the ANI algorithm % However, due to difficulties with generating mex wrapper code in % Matlab 7(MCC 4.0), this was bypassed. Inste...
e055ff3fae80d82adfde204aa9ca0df961ac0103179533c7a67ec27b97a5833a
MATLAB
5,607
157
close all clear variables clc %Varun Mannam %date: taken from 29th Sep 2019 %date: 27th July 2020 %DnCNN model with diff lr in keras %calculate the PSNR on test-mix data raw nbn format long font = 14; %data addpath('/Users/varunmannam/Desktop/Summer20/Research_SU20/May20/2505/dncnn_keras/dataset/'); %lr files %addpat...
f811a916f02a2ff4cc7f97390ce79675a7920aa879665bfa563ec03b980a07b8
MATLAB
5,610
109
% PlotPlotBinFirRateBatchResult.m % This is for Fig5D and E. % Change the line ste_ave_both(T, pct(1), pct(2), n_baseline, n_poi_stat, p_color) in PlotBinFirRate.m to plot D vs E. close all; f_data_type = 2; %1: 1s POI, 2:25sec POI f_plot_type = 5; %1:bar, 2:violin, 3: box plot , 4:connected lines with ave ...
6d73db866c8177b74631c550e218dba551a69366ab99c7159a2962bee6b413d1
MATLAB
5,612
180
clear all; Xsize=40; Ysize=40; Xoverlap=0.5; Yoverlap=0.5; %% get FIJI stitching info filename = strcat('/projectnb2/npbssmic/ns/190619_Thorlabs/aip/vol10/'); f=strcat(filename,'TileConfiguration.registered.txt'); coord = read_Fiji_coord(f,'aip'); %% coordinates correction % use median corrdinates ...
b5c79b362a33b91525335f4ffae21df5ff5b234fe01aa82aa113da1e71edd5f5
MATLAB
5,623
115
figX.fig = figure('Name', 'Figure X: Anti vs Ortho'); set(figX.fig, 'Units', 'pixels', 'Position', OSScreenSize([15 8]), 'NumberTitle', 'off'); figX.unsorted(1) = axes('Position', [.05 .55 .275 .4]); figX.sorted(1) = axes('Position', [.05 .075 .275 .4]); figX.unsorted(2) = axes('Position', [.375 .55 .275 .4]); figX.so...
74d1b86f94051d6db6b3a714d0dac6f4e3b7fc65ade23f4b2dd63d7cbc2f7870
MATLAB
5,626
179
function [TargetSound, NoTargetSound,TSquintOnset] = CreateStimuli(currCon, JND,TS) % include variable length of sequence fs = 44100; rhythm = 2; ISI= 1000/rhythm; %in ms ISIsamp = zeros(1,ceil((ISI/1000)*fs)); f = 1100; TSinS = JND; stimLength = 6; %length in s TS = TS*rhythm; % quick and dirty ...
9be7b08823aea6791f3bed0298f4fa76ac9212bfb8919042be7ed017a0f5886f
MATLAB
5,627
156
clc; clear; addpath('/data/hu_esraal/Documents/eeglab2019_0/') addpath('/data/pt_02333/esra_codes/') eeglab %% ts=[-1000 4000]; eegpath= '/data/p_02186/TMS_ECG2/analyses/EEGmotor/'; motorpath='/data/p_02186/TMS_ECG2/analyses/EEGmotor/FDIdata/events/'; save2folder= '/data/p_02186/TMS_ECG2/analyses/EEGmotor/merge/motor_o...
f93ed99a00247235de91f859d9c8a234067d5354003ea339699cc6e74ff8830c
MATLAB
5,627
156
classdef SuhLeafRaker < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior University; Herzenberg Lab % License: BSD 3 clause properties(SetAccess=private) epp; topKey; leafKeys; ...
9eab65bc6cc982392076a393550dd795fe90702b403f824d39bee87e84fb83bf
MATLAB
5,630
161
function AssembliesDynamicsVisualization(); [filename,pathname] = uigetfile({'*_CLUSTERS.mat';'*_CLUSTERS.MAT'},'Open file with assemblies data', 'MultiSelect', 'off'); filenameCLUSTER=fullfile(pathname,filename); temp=load(filenameCLUSTER); assembliesCells=temp.assembliesCells; matchIndexTimeSeriesSignificant=temp.ma...
4358faace2c004d603311b93c52b39a34fe3c94dc3fb7ff6ae11bcfc95ed5638
MATLAB
5,633
136
function Figure_7D_plot % % Written by Ayaka Matsumoto, October 2023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Output: Figures 7D %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% equi_t...
83e41cb2bd8cdd264e68ce4405094c7ac0c72dfe676283dc8beeb8ad69e5ed9a
MATLAB
5,640
145
function listSound % List all sound systems of this computer with their device indices. % % The listing is grouped by sound system and sorted from low to high % latency, so the first entries are the ones worth using. Sound systems % without a usable output device are reported as not available. A closing % section lists...
af7fe973afbfc86f1b1dd5f1d3b62d08e78f1db17277052b2363998065cf27f3
MATLAB
5,640
157
%% --- Generate functional connectivity profiles and estimate initialization parameters % Adapted by M.-Y. Wang, 16-Nov.-2022 %% 1.initial parameters clear all clc project_dir ='/Users/wang/Desktop/Research_projects/BBSC/Functional/Parcellation/1_generate_profiles_and_ini_params'; cd (project_dir) addpath(genpat...
fcea596444f92183b797c9830181d25da73ec229384c5abd90ade9116e876325
MATLAB
5,643
147
function varargout = spm_shoot3d(v0,prm,args, F) % Geodesic shooting % FORMAT [phi,Jphi,v1,theta,Jtheta] = spm_shoot3d(v0,prm,args, F) % v0 - Initial velocity field n1*n2*n3*3 (single prec. float) % prm - Differential operator parameters % prm - 8 settings % - [1][2][3] Voxel sizes % - [4][5][6][7][8]...
ddcbc2a079156ceb138141604348e6eaa3be6be5caaa37c256482d8733c3a9e7
MATLAB
5,645
189
%% PANEL FIGURE 3 %Figure description: IC medial prefrontl maps and ERPs from SS v US and %TFUS (none) 1st row and TFUS (STOP) 2nd row. %ERP PLOT: Columns are groups (rIFG, S1, and control); Rows are TFUS %conditions; Color: blue is SS and orange is US %% Gather IC MAPS and plot central IC addpath '/Users/user/Library...
2cbd9e3eee29a6940612256bde5214d21a8c1df2f221b8f048cb9fc555f548df
MATLAB
5,646
138
%% add path and load file clear all addpath('E:\Jiarui\Data\code\'); addpath('E:\Jiarui\Data\code\cortical_thickness'); subject_ID = 'NC_21499'; filepath = ['E:\Jiarui\Data\220401_Ann_15_samples\', subject_ID, '\']; cd(filepath); infra = TIFF2MAT('thickness_skel_infra.tif'); supra = TIFF2MAT('thickness_skel_supra.tif')...
0b10c1796835e2dbecade24aea07b9b71dc50de36c6ee9d9b5590d0bd810b8e6
MATLAB
5,654
166
%%%%%%%%%%% BATCH_simulation %%%%%%%%%%% % - run it section by section % - results are NOT saved automatically % - numeric (BM) solution is calculated in NUMERIC_SIM % it supports 1 water (A), 1 MT (C) and up to 5 CEST/NOE pools (B,D,E,F,G) % - analytic solution is calculated in ANALYTIC_SIM % it supports 1 water (...
61bd27139117b8443108ceae4852c4ea547c20b1b2093ae12e35481337b37c4a
MATLAB
5,654
190
function err = save_nifti(hdr,niftifile) % err = save_nifti(hdr,niftifile) % % Pixel data should be in hdr.vol % % Handles data structures with more than 32k cols by setting % hdr.dim(2) = -1 and hdr.glmin = ncols. This is FreeSurfer specific, % for handling surfaces. The exception to this is when the total % number of...
3138ee7004742e48a99c0a62fef7ffc02e13c57676f2eb5b42d5dd46f993d1b4
MATLAB
5,656
152
function [roiData, EEG, ROISrc] = c_EEG_calculateROIData(varargin) p = inputParser(); p.addRequired('EEG',@isstruct); p.addParameter('srcKernel', [], @ismatrix); % if empty, try to pull from EEG.src.kernel p.addParameter('srcSurf', [], @c_mesh_isValid); % if empty, try to pull from EEG.src.meshCortex p.addParamete...
a8b22beafeaf50f345c556f28e32f647d8b24ed88ee569005d30300aedcb038f
MATLAB
5,660
224
function [C, B, spectrum, R] = ir_reg_diff_zeroed(idim, varargin) %function [C, B, spectrum, R] = ir_reg_diff_zeroed(idim, varargin) %| %| Regularizing finite-differences R = diag(B)*C where C'C is circulant %| and B is a binary "mask" array that eliminates undesired boundary diffs. %| (Useful in variable splitting me...
3939e0fd9dc2d9f46a69fd46a28cda6ef36bf948eec6d5c4054a3c36390b8da0
MATLAB
5,662
125
function [CD_correct, dphi_correct, phi_fit, cc_fit, mask_static_refined] = CDPhaCor_Iter_2D_V2(mag1, mag2, dphi, Z1Z2product, mask_static, mask_brain, deg, Niter, bBatch) % this function correct the phase errors in complex difference iteratively, % based on user input initial static tissue mask, and do the correctio...
da271a4dab05e73353267df4277d66b6fb3687f3698cda5788bedae7d48c6409
MATLAB
5,663
139
function [cond1,cond2,cond3,cond4] = get_power_subj(subj_list,exp_type,reg, ref, lock) % Function output: mean spectrogram power for a given region, using a % single matrix per subj for all conds cd(['/mnt/yassamri/iEEG/sandra/group_data/groupdata_spectrograms/' ref '_reref/' exp_type '_' lock ]) for iSubj = 1:length(...
e7fbc9626b4326a48584c6337e087e96d61d05c099831623e6034116d399de80
MATLAB
5,663
177
function [psctc, pscf] = psctrans(tc, dim, tp) %PSCTRANS Perform percent signal change (PSC) transformation. % P = PSCTRANS(S) transforms the signal S to percentage change (with a % mean value of 100) along the first non-singleton dimension. This is a % typical application in functional magnetic resonance imagin...
57ea0782e5acbe1b3783b361abbb5b98da15e4f32dfbc91b0e7a91607b7e4a4d
MATLAB
5,664
149
function [outValues,outValuesFreq,outPeriods] = IPEMMECAnalysis(varargin) % Usage: % [outValues,outValuesFreq,outPeriods] = ... % IPEMMECAnalysis(inSignal,inSampleFreq,inMinPeriod,inMaxPeriod,... % inStepSize,inHalfDecayTime,inPlotFlag) % % Description: % Performs a periodicity analys...
4f5a5cac1351a6db329284127bbd884022f4244b4c582fa4f6796619477b9842
MATLAB
5,666
180
function V4 = spm_file_merge(V,fname,dt,RT) % Concatenate 3D volumes into a single 4D volume % FUNCTION V4 = spm_file_merge(V,fname,dt) % V - images to concatenate (char array or spm_vol struct) % fname - filename for output 4D volume [defaults: '4D.nii'] % Unless explicit, output folder is the one conta...
ab3a62d2a6b0a7525efa55d30289d4c62cd2d773e919d852ad2e7536c07c19aa
MATLAB
5,671
125
% This script can be used to reproduce the figure 3 of the manuscript % Barbieri, Toepfer et al., 2023. The plot displays GPR-based tuning % response profiles of 16 voxels of subject 318. The following script is % divided in 3 parts. The first shows the procedure for selecting the % searchlight to from which to extra...
12b16700db5b83b51f5fbd714fd82e05a2c3daccbb3844f3a13a15273e3cc803
MATLAB
5,675
174
% mosaic parameters % mkdir(strcat(datapath,'dist_corrected/volume_tmp')); id=1; datapath='/projectnb2/npbssmic/ns/210310_4x4x2cm_milestone/'; Xsize=1000; Ysize=1000; Xoverlap=0.15; Yoverlap=0.15; % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_cod...
bcc52c377176557c6ada5d273dc6643184c3764ac3bbbac9a62857f895b37870
MATLAB
5,679
145
function tSC_thetaprop(mainPath, animal, session, ch, isstim, isrun) %TSC_THETAPROP Calculates theta properties during tSC presence % TSC_THETAPROP(MAINPATH, ANIMAL, SESSION, CH, ISSTIM, ISRUN) is detecting % theta cycles expressing different tSCs and calcultes the properties of % these cycles including the n...
1a23a0c945ce4b265f9203d4da0505d6293f3dfb47601b7f0c3a11c6ded33b5d
MATLAB
5,686
214
%% Figure 2c & d %% clear ft_defaults %% rng('default'); addpath /Users/'Janweber 1'/Documents/MATLAB/general_functions/ % add functions %% - LOAD EXAMPLE DATA - %% path_data = '/Volumes/IMPECOG/iEEG_Data_JW/SingleSubjects/OSL24/Data/HFA/PCA/PCA_ROI_Data/'; load(fullfile(path_data, 'OSL24_activedata_ROI_pc...
a51c7503b37e117921bafd8ca347613a38430d6edd07f3f487032e7c0823b3c1
MATLAB
5,686
113
function sleep_replay_sum_histogram(epoch) % Plots distribution of replay events over post sleep 2 & 3 for each track and protocol. % Histogram is calculated as the sum of replay events for each track & for each experiment (always within a protcol), % and averaged (divided) by number of active sessions at each time b...
c88ca887362aebecc2ff61329278fca2dfce38a7dbd8f022f4d9a6cae34be4c4
MATLAB
5,690
166
%%%%%%%%%%% BATCH_simulation %%%%%%%%%%% % - run it section by section % - results are NOT saved automatically % - numeric (BM) solution is calculated in NUMERIC_SIM % it supports 1 water (A), 1 MT (C) and up to 5 CEST/NOE pools (B,D,E,F,G) % - analytic solution is calculated in ANALYTIC_SIM % it supports 1 water (...
f35fe59b7e8c562643cbe9465399650376c6fbc9fee5e2065e515337dd664f58
MATLAB
5,690
94
% THETA SEQUENCES QUANTIFICATION : QUADRANT RATIO % MH 2020 % From Feng et al (2015,J Neuro).Decoded probabilities +-50 cm around the animal’s location, and 1/4 theta cycle around the mid-time % point of the theta sequence, were divided equally into four quadrants: % Quadrant I & III: summed decoded probabilities oppo...
029859bcc7de80df33a34ebdb9e9aa9b77e0b4dd0beee6724cbef3bb5586c693
MATLAB
5,692
112
function [Im_MIP, Im_SWI4MIP_resliced, ind_SWI4MIP_surround_aTRUPC, Im_minIP] = calc_SWI_MIP(varargin) % Input: % dicom_path_aTRUPC: dicom folder of aTRUPC flow-comp images (the first series) % dicom_path_SWI: dicom folder of SWI % bCoreg: boolean flag, if bCoreg=1, do inplane coregistration between SWI and aTRUPC ...
a5557d775114b1ea3b6b299d3133424099a3dc66b56140e62d59260f119e470f
MATLAB
5,693
161
%% Frequency of single cell oscillations - All sessions clear all close all dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\...
1beb17ce26e8a7299318b82508f88d13a1c46aa3cc25ca805dea201876447b73
MATLAB
5,695
113
function [csc_ts, csc, sFreq] = ReadCSC_ag(fname, Trange, output_sFreq) % % function [csc_ts, csc] = ReadCSC_ag(fname, Trange, out_sFreq) % % note: the main difference from 'ReadCR.m' is that the time is in micros. % This function allows for downsampling. This is based on % ReadCR_tsd, but is not stru...
14b148842846bc6df3ce3fbfa28af9223426ae89d3a0fee6fa46672f640410ee
MATLAB
5,697
176
function [meta] = Initialize_Params() % clc % clear all; % close all; % Dataset = 'Dataset' % if ~exist(Dataset, 'dir') % mkdir(Dataset); % end %fin = fopen('Test.xlsx'); %disp(data) %A = csvread('Test.csv') %, 'columns', {'X, 'Y', 'Z'}); %disp(A) A = readcell(['...