sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5f0a5d8291d3f28508d43774dd477da562dec0a0896b4948a8e1e0d65b4eaba1
MATLAB
10,559
274
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NOTE: This script is dependent on graphtest...
b4bde0885710ada0aca810cbf1d1212daa56e8fdd50f1338f93eca68ec9fa549
MATLAB
10,559
314
function [pred,stats] = mTRFpredict(stim,resp,model,varargin) %MTRFPREDICT Predict and evaluate the output of a model. % PRED = MTRFPREDICT(STIM,RESP,MODEL) predicts the output of a forward % encoding model (stimulus to neural response) or a backward decoding % model (neural response to stimulus) using time-lagg...
2c0b058e4d1eea5942e043660c11f7b5f80bdbd27a0d08422a29fc220a14e469
MATLAB
10,564
304
function ALAN_Evaluate_PSNR_SSIM() clear all; close all; clc %% set path degradation = 'BI'; % BI, BD methods = {'alanv1_t', 'alanv1_s', 'alanv1_b'}; %methods = {'LatticeNet'}; dataset = {'Set5', 'Set14', 'B100', 'Urban100', 'Manga109'}; ext = {'*.jpg', '*.png', '*.bmp'}; num_method = length(methods); num_set = lengt...
b221e7b6aafbef4e1f8e2166cf40de0b10e8ee5d512afce6ec811cc8dcad734f
MATLAB
10,572
324
function [Y,xY] = spm_regions(xSPM,SPM,hReg,xY) % VOI time-series extraction of adjusted data (& local eigenimage analysis) % FORMAT [Y,xY] = spm_regions(xSPM,SPM,hReg,[xY]) % % xSPM - structure containing specific SPM, distribution & filtering details % SPM - structure containing generic analysis details % hReg ...
6f0c2cbab1797d86d40c19e4df8f733890af60cfdf48cc8ede401fd3adf83398
MATLAB
10,575
288
%% Script to create output for Fig. 5 - receiver operating characteristic curve for each GLAMPI parameter % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Using support vector machine (SVM) to classify two groups based on their % fitted parameters using an holdout strategy (60% training set 40% testing % s...
a5b2a3f2d9c82ba627ebbe9b9babb3a0dd1f9de9ba7d6a4b97364074970062db
MATLAB
10,577
482
function ob = block_fatrix(blocks, varargin) %|function ob = block_fatrix(blocks, options) %| %| Construct block_fatrix object, a meta-Fatrix composed of Fatrix blocks, %| such as block_diag(A_1, A_2, ..., A_M) %| See block_fatrix_test.m for example usage. %| %| in %| blocks {cell} cell array of the blocks %| %| opti...
3b97cdf8fe9a5b92e0f5853d49bc1bbb57ce5f067a27fb2b57727a8ce9bf1278
MATLAB
10,578
429
function [Dnew,meshsourceind]=spm_eeg_simulate(D,prefix,patchmni,simsignal,ormni,woi,whitenoise,SNRdB,trialind,mnimesh,dipfwhm,nAmdipmom); %function [Dnew,meshsourceind]=spm_eeg_simulate(D,prefix,patchmni,simsignal,woi,whitenoise,SNRdB,trialind,mnimesh,dipfwhm); %% Simulate a number of MSP patches at specified location...
46d6c101994c44bbb0c1dc5aa2651e6d9e5469c78d939c5da4dada19414a0e70
MATLAB
10,578
305
function Evaluate_PSNR_SSIM_SRACN() clear all; close all; clc %% set path degradation = 'BI'; % BI, BD methods = {'v5fs_plus', 'v5fs'}; %methods = {'LatticeNet'}; dataset = {'Set5', 'Set14', 'B100', 'Urban100', 'Manga109'}; ext = {'*.jpg', '*.png', '*.bmp'}; num_method = length(methods); num_set = length(dataset); %r...
b012b192260296008afb3de06010b0d742cf4d7148f40df2c02b0a8ee6b5c8b5
MATLAB
10,589
305
function Evaluate_PSNR_SSIM_RepECN() clear all; close all; clc %% set path degradation = 'BI'; % BI, BD methods = {'v9fs', 'v9fblt', 'v9fbxt'}; %methods = {'LatticeNet'}; dataset = {'Set5', 'Set14', 'B100', 'Urban100', 'Manga109'}; ext = {'*.jpg', '*.png', '*.bmp'}; num_method = length(methods); num_set = length(data...
b6d8e447a9cfd4a320d246a9c41b923e4fd9c9c8ee5e7a6e95a0ca1303d44a6b
MATLAB
10,589
265
function plot_dth_both_tasks(subjects,with_cross_task,with_stats,with_error_bars,varargin) %distance art, distance nat, RT %PLOT_DTH_BOTH_TASKS Plot the fixed effects distance-to-hyperplane results for both %tasks. Assumes that the correlations & stats have already been computed. % %Input: subjects' ID (e.g., 1:13), ad...
d322a711d5e5104c55d623a12b09dfbf51cc5597a8be2079c677e562db71b083
MATLAB
10,607
221
function gap_linking_str = fun_graph_get_linker_ep2skl_same_cc(vessel_image, vessel_mask, vessel_skl, ep_sub, ep_all_sub) % fun_graph_get_linker_ep2skl use threshold relaxation and shortest path on % designed metric to find a 3D line segment that connect the inut endpoint % to a skeleton voxel in the nearby connecte...
97bba3538987a9f892cfd5f47f0e8da1b2058211a6b6e3e6952052eff21f184e
MATLAB
10,637
229
%% Thomas_Yang_et al, 2023 @Nuo Li lab %% Fig. 6a norm. FR, early delay SC photoinhibition, SC record clear all close all addpath('../func') load Figure_6_a_data %% plot the selectivity in a user defined region sig_selective_p(isnan(sig_selective_p))=1; sig_selective = (sig_selective_p<0.01); %<--...
85848376f16b657c6e86c0c115720e5779721ab596ca6c3f8e1586f98df8f8a8
MATLAB
10,668
340
% Analyze the network results after scanning parameters. % Before using this code, run simNet_ScanPars.m to collect the network outputs % under different parameter settings. % Note: Please assign correct fileName on line 17!! % Wen-Hao Zhang, % University of Pittsburgh % Feb. 3, 2020 % Load data setWorkPath; addpat...
e4aa5e450fed1e055eb3fa8841390c0a2cd8c3c9f248dcfbf737bb1ca53cdb55
MATLAB
10,704
289
function [xVi, mask] = spm_est_non_sphericity(SPM) % Non-sphericity estimation using ReML % FORMAT [xVi, mask] = spm_est_non_sphericity(SPM) % % Required fields of SPM structure (see spm_spm): % SPM.xY.VY - nScan x 1 struct array of file handles % SPM.xX - structure containing design matrix information % SPM.xX.W...
e71b29821308fa08ff8fe34f2a1952277fca2caf10714ce6a1140000135a8496
MATLAB
10,718
257
function epsilon = exclude_rep_by_epsilon(results_folder) % 20230808 Calculate epsilon for repetitions load([results_folder, filesep, 'varforrep.mat']); %% Realign across repetitions % repetition exclusion based on epsilon Image_coil_ori = Image_coil; % save a copy of original images before registration % use e...
74c4a9832a69c8943f89cb54da420ac50babce52933f64640b518c3bd6461f7a
MATLAB
10,724
267
%% Basic analysis script that plots cosine tuning curves for each electrode channel %% Set up directory system % set direct path to data folder dataPath = './Data'; addpath(genpath(dataPath)); % designate the data to be analyzed dataName = 't5_06_02_2021'; %% Load data dat = load([dataPath filesep dataName '.mat']);...
55736eb25a82712685298ef39fa59b08abcdc1f3aab2de1be04aa372ea13f193
MATLAB
10,731
231
folder = '/projectnb2/npbssmic/ns/Ann_Mckee_samples_20T/NC_8095/'; cd(folder) % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbssmic/s/Matlab_code/P...
e365efd6e7bb753dd06e56a1cdc79f4a1890a963554b504729e0fea96977a857
MATLAB
10,731
300
function SBJ08e_HFA_plot_recon_venn_ROI(SBJ_id, proc_id, stat_id, an_id, reg_type, show_labels,... hemi, atlas_id, roi_id, plot_roi, mirror, varargin) %% Plot a reconstruction with electrodes colored according to statistics % INPUTS: % SBJ [str] - subject ID to plot % proc_id [str] - nam...
cc659498bd908276394339bff230bc1a66af51975ec8935b59e13ac1ab11106b
MATLAB
10,734
277
function SBJ11b_HFA_conn_mLME(SBJs, proc_id, an_id, model_id, conn_id, lme_formula) %% 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 'PRJ_Err...
4fd06dab5e6ccfc61b1ddc83d45aec5c42128bcdcaff4bb0f7341bf9cac1c2c9
MATLAB
10,735
300
function fn_view_recon_atlas_grp_stat_ROI(SBJs, proc_id, stat_id, an_id, reg_type, show_labels,... hemi, atlas_id, roi_id, plot_roi, mirror, varargin) %% Plot a reconstruction with electrodes colored according to statistics % INPUTS: % SBJ [str] - subject ID to plot % proc_id [str] - nam...
dbe3c2e18e41a74e2a952b9423986f9f72507f12f4d33ddc2f27c5dc020af166
MATLAB
10,743
179
function POKE_STRUCT = get_HP_during_interval2( POKE_STRUCT, NUMWORMS, FRAMES_IN_LAWN, stat_int ) %PLOT_HP_OVERTIME.m This function takes in a list of head poke events (track %number, frame number pairs) and plots a head-poking rate per worm per %minute for 40 minutes after transfer to the assay plate. Also generates ...
bc347daaa735c00961ff854ef4739892757aebdb1e632a0313dba210febe1b81
MATLAB
10,745
205
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 10000) Hoechst %vol(ch2, 0, 8000) 647 TH %vol(ch3, 0, 8000) 568 TUJ1 %vol(ch4, 0, 5000) 488 FOXA2 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[]...
4257317af1dfc1a44641af41eae3efa07bdd6d1e1c1e884b1b4410ebe538ac67
MATLAB
10,754
372
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Plotting representative data - RGC axons / SC somata % % % This script generates Figures 2 and 3 and Supplemental Figures 2 and 3 % of the following paper: % % Molotkov D., Ferrarese L., Boissonnet T. and Asari H. (2023) % Topographic axonal...
c28a5c446e27283d80f5ef981956068eb2ee8818e47c0e68d16bd5421db067a0
MATLAB
10,757
175
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 HPIg %vol(ch3, 0, 5000) 568 Sox2 (270 Mouse) %vol(ch4, 0, 5000) 488 FOXA2 ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imt...
8474834362d7dfbf9972079689026d0828327de675b8fcf96572802c3f71ec83
MATLAB
10,759
283
function Optical_fitting(co, cross, s_seg, z_seg, datapath, threshold, mus_depth, bfg_depth) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts =...
e3e716caaa56f5b6e8eeb280449634f3467bc1868e816e7dc185efd29e58d54e
MATLAB
10,759
275
function Ori_stitch_Ann(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'orientation/vol',num2str(islice),'/'); cd(fi...
9a76972096a7ec50af3f2587f0d0c3a119cffbc1d906d5771d581b1b556bf321
MATLAB
10,765
258
function fn_view_recon_atlas_grp_stat(SBJs, proc_id, stat_id, an_id, reg_type, show_labels,... hemi, atlas_id, roi_id, plot_out, varargin) %% Plot a reconstruction with electrodes % INPUTS: % SBJs [cell array str] - subject IDs to plot % proc_id [str] - name of analysis pipeline, us...
4058a6e40c2fe9470210b0144ac05c29abad60dfb6eb8c4666ccf49336b3e2b9
MATLAB
10,771
293
%% Script to check the out-of-bound ratio in different groups of data % Zilong Ji, UCL, 2022 zilong.ji@ucl.ac.uk % Preparing the data GLAMPI_PrepareBaseConfig % Preprocessing the data GLAMPI_PreprocessData %% %get the out-of-bound ratio for each participant under each condition OoBratioYoung = getOoBRatio(YoungCont...
23cb3e85c7a11308354aeb42842ad9b336dd618e2eb02414fc94a7849afdcf02
MATLAB
10,774
273
function SBJ08c_HFA_grp_errbar_ROI_mGLM(SBJ_id,proc_id,an_id,model_id,stat_id,roi_id,... plot_scat,save_fig,varargin) %% Plot bar graph of proportion of significant electrodes for mass GLM % Future: may also plot activation and RT correlations % INPUTS: % SBJ [str] - ID of ...
709ddd16f7517c244a9d9eae1c4ff22691408199750fa5817240d1984435ded2
MATLAB
10,780
425
function [phantom, params] = ellipse_im(ig, params, varargin) %| Generate ellipse phantom image from parameters. %function [phantom, params] = ellipse_im(ig, params, options) %| %| Parameters: [x_center y_center x_radius y_radius angle_degrees amplitude] %| %| in %| ig strum image_geom() object %| params [ne 6] elli...
7bf9cb228abb818dd00d5309e81c724e1bae6846ffcb6e3ea810a71670d6be38
MATLAB
10,803
122
function x0 = setModelInitialConditions(data,modelParameters,model,environment) % function setModelInitialConditions(data,modelParameters,model,environment) % Compute the glycemic profile obtained with the ReplayBG physiological % model using the given inputs and model parameters. % % Inputs: % - data: a timetable w...
ffdbd42762ef80c89567a57e171ba1148d67684eb737a2071c5386905250b7e5
MATLAB
10,803
346
% Script to plot Supplementary Figure 5, calculate statistics reported, and % save data to Excel spreadsheets that are then imported into the Source % Data file. % Kit Longden 2023. addpath ../Shared_functions/ % Thresholds used % --------------- L1.thr_used = 0.06; L2.thr_used = 0.06; L3.thr_used = 0.06; % 0.03 ...
4c8f6a33b42b79e4c45ca7aad481a7621390aaae34d136440d7121e4008b80a3
MATLAB
10,836
270
function N = spm_dicom_metadata(N,hdr) % Export image metadata as side-car JSON file % FORMAT N = spm_dicom_metadata(N,hdr) % N(input) - nifti object % hdr - a single header from spm_dicom_headers % N(output) - unchanged nifti object (for potential future use) % % This function creates JSON-encoded metadata duri...
28730cb7cb19fdfb2022378968e47f9fd327827991ddf2739280c0e1d63070ae
MATLAB
10,846
219
% Compare real to control data and quantify number of replay events in T1 and T2 function comparison_to_control_replay(control_type) %control_type: 'Short_exposures' or 'Stability' cd(['X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\' control_type '_control_FIRST_laps\']) load extrac...
1c7027a813b1dff94ce3b0d259c78f341cf6bd6b05a6668cf0ca40d634e6d084
MATLAB
10,854
364
function ob = Gtomo_nufft_3d_par(mask, dim_data, varargin) %function ob = Gtomo_nufft_3d_par(mask, dim_data, options) % % Construct Gtomo_nufft_3d_par object. Currently only handle Fourier-based % forward projection for 3D parallel beam case. % % See Gtomo_nufft_3d_par_test.m for example usage. % % Basically, you cr...
f6169df6a5ce165330f9652a4b8671bf76969f58b3c676a109531ccde2cf6b90
MATLAB
10,863
309
% use GLKF to estimate TV-MVAR model clear all;close all;clc % develop for 1 subj subj = '39'; cd(['/tmp/yassamri/iEEG/sandra/subj_' subj]) load(['trial_data_subj_onset_' subj '_ref__select_chan_3.mat']) trial_data = trial_data(:,:, 8:10); % % eamine data % figure % for trl = elec3trl%size(trial_data,1) % % plo...
8e782bd163ba4598abd7617d7a2e84b1e437224ec5f75d3912dc9fa7af2682c1
MATLAB
10,865
293
function [cleaned_trace, trend, var_params, v_elbos] = fit_ast_model(traces, n_sectors, varargin) % FIT_AST_MODEL fit an Asymmetric Student-t model to remove neuropil data % % [cleaned_trace, trend, var_params, v_elbos] = fit_ast_model(traces, n_sectors, ...) % % INPUTS % traces - signals from...
51b41da36bcc530a6ac2fa48199f0ae4e1229dbd82494329543ef457c8ba6148
MATLAB
10,875
196
%% Run this files to compute the network-human main effect and interactions for all for the VISION experiments %% Must specify the paths to the required network data mat files. function run_anova_stats_matlab_compare_human_responses(EXP_NUM, NUM_BOOTSTRAPS) rng(517) addpath('../matlab_statistics_functions') %% NO AN...
afa85a2a46d8cdb9d566aeedc90784c5cbb59e65cd6f71f7faf9ec90a44e3cc8
MATLAB
10,879
369
function [out,cost,time] = fmap_est_pcg_ls(w, y, delta, smap, varargin) %function [out,cost,time] = fmap_est_pcg_ls(w, y, delta, smap, varargin) %| %| Phase unwrapping of multiple data sets (w denotes frequency) %| using a NCG with monotonic line search %| 3D, multi-coil version %| %| cost(w) = sum(i=0 to n-1) sum(j=0...
f518316b7d0064b18e59f25ea58638f5fce2fd752d33e10f987e8d1580066b4b
MATLAB
10,879
168
% UTILITIES % % Files % arg_get - function [arg, ii] = arg_get(list, what, default) % arg_pair - |function arg = arg_pair(varargin) % beeper - make beeping noise to alert that a job is done. % bspline_1d_coef - function coef = bspline_1d_coef(fn, varargin) % ...
3adca6a8b84fe8cfc164552a3ad8c70f57698aeefb5655e000812ad56e903ef2
MATLAB
10,906
261
function bhv_cln = SBJ04_compile_clean_behavior(SBJ, proc_id, save_it) % Reject all bad trials based on behavior and visual cleaning, then combine % data from multiple runs % Also checks prdm_vars are consistent across blocks and saves combined version % Criteria: % 1. Bob bad epoch % 2. Bad trial (interruption...
fae80ba60c1117089e370cc9e35c9ba9e5dcb3b01c8a077f6188b2cf372c0bc0
MATLAB
10,927
284
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); listname= 'targetLeft' ; cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{1}],[cn1{2}]}; condnames=lis...
c1b4b17de5c097d14b33dc966546e9c8741c4cda62c1fccaa7055569e812fdac
MATLAB
10,933
156
% The script is used to preprocess fMRI data % To run this script, please first download the raw data from https://osf.io/57ryb/, % and put the data in /mri_data/preproc_data/ folder. % add spm toolbox addpath(genpath('spm12/')); % set data path data_path = '../../mri_data/preproc_data/'; % set parameters nSubjs = ...
d3b4aee85cd1172735662ed854c62be7e8c29c3cdf013413d8eb316a6be03cdf
MATLAB
10,938
205
function [Objects] = f_imageAnalysis(Label, ch1, ch2, ch3, ch4, PreviewPath, MetaTable) %vol(ch1, 0, 5000) Hoechst %vol(ch2, 0, 4000) 647 MAP2 %vol(ch3, 0, 5000) 568 Sox2 %vol(ch4, 0, 5000) 488 TH ObjectsThisOrganoid = table(); %% Max projections %NucMax = max(ch1, [],3); imtool(NucMax,[]) ...
0547a9b7d9d306282f59fe7ec5ca9a0fcb1851359957b897e304b61d41f7afc0
MATLAB
10,954
287
%% Script to create output for Fig. 5 - receiver operating characteristic curve for each GLAMPI parameter % Andrea Castegnaro, UCL, 2022 andrea.castegnaro@ucl.ac.uk % Using support vector machine (SVM) to classify two groups based on their % fitted parameters using an holdout strategy (60% training set 40% testing % s...
ef96c9ffd3a8cebdeb90444daf21d994fa7ff150e1fd488a530b19683fb905f1
MATLAB
10,957
347
function [M,ll,h] = spm_maff8(varargin) % Affine registration to MNI space using mutual information % FORMAT [M,ll,h] = spm_maff8(P,samp,fwhm,tpm,M0,regtyp) % P - filename or structure handle of image % samp - distance between sample points (mm). Small values are % better, but things run more slowly...
55a376ee9c37dfbd76274e651299fa14978316f7fd5046402f86d0a125ca3aba
MATLAB
10,965
288
classdef MlpGui < handle % AUTHORSHIP % 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(Constant) PROP_ROOT='Mlp.Root'; PROP_PARAMS='Mlp.fcsIdxs'; ...
91b27c1e01295b79ab4372158f76a43956906575316368dcacd928ab80f68393
MATLAB
10,971
284
function SBJ07c_HFA_plot_stack_mean(SBJ, conditions, proc_id, an_id, actv_win,... plt_id, save_fig, varargin) %% Plots single trial stack and condition averaged HFA per electrode with activation vs. baseline % sorts by condition, then by RT; scatter for events to show condition...
cd0c15896e41e52c4eebc4c0c2786eb4faff1584b7688ab522b5931f0f1f3358
MATLAB
10,977
259
function export_kinematic_data(study_info) subject={}; condition={}; trial=[]; reach_dur=[]; grasp_dur=[]; end_dur=[]; % behavior exe_df=readtable(fullfile(study_info.data_dir,'behavior_exe.csv')); obs_df=readtable(fullfile(study_info.data_dir,'behavior_obs.csv')); %% Loop over all data files for s_idx=1:size(study_...
47d5d88b12d181a4542895617952f29637fe8e3029d0e0e06753679b6a64f2f4
MATLAB
10,983
392
function [dMapPair,dMapInd] = normalizationSingleTrialInference(spikes,parameters) %% normalizationSingleTrialInference Finds the Maximum a Priori estimates for the normalization signal in a Ratio of Gaussians model % INPUT % spikes (2,number of stimuli, number of trials) - the spike responses % parameter...
bc73a64a49b7e36b45607ad99aae35323e846aae6e56df38a40db96140af98a0
MATLAB
10,986
434
function fig = plotAxisProjection(obj,showAxis,useAll,reuseFigFlag,plotType,saveFigFlag,weightScale,markerAlpha,showExpFlag) if(~exist('showAxis') | isempty(showAxis)) showAxis = 'NT'; end if(~exist('useAll') | isempty(useAll)) useAll = true; end if(~exist('reuseFigFlag') | isempty(reuseFigFlag...
f698f7e8f2480a0bb40701c60055bd81b58bef72e6a85a13d5d8eaa50b6eeb61
MATLAB
10,998
365
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %import the dataset all_infered_results.mat from folder 20211205_ai148_visual_stimulation_2 %brain_region 1*5540 each cell is the name of brain area %valid_C a matrix of 5540cells*10012 time points %download circularGraph function if required https://git...
67ffec0210930c239eade2f43022ee24cfa12502d996db540f6d7e358a04e88f
MATLAB
11,025
374
function [out] = spm_eeg_render(m,options) % Visualisation routine for the cortical surface % FORMAT [out] = spm_eeg_render(m,options) % % INPUT: % m - patch structure (with fields .faces et .vertices) % or GIFTI format filename % options - structure with optional fields: % .texture - tex...
7cf97e437eab37758075003cec7ad92b41b0acff8d0d62d94d233e494810584c
MATLAB
11,026
355
function out = spm_dartel_import(job) % Import subjects' data for use with Dartel % FORMAT spm_dartel_import(job) % job.matnames - Names of *_seg_sn.mat files to use % job.odir - Output directory % job.bb - Bounding box % job.vox - Voxel sizes % job.GM/WM/CSF - Options fo different tissue classes % j...
b9dcd8f6ee7874c15d577f7ca9f0c50424f17e033844df009e88d08a6f51e213
MATLAB
11,038
270
function rnn_dth_all_distances_median_RT(subjects,with_stats,with_error_bars,model_type,varargin) %distance art, distance nat, RT %RNN_DTH_ALL_DISTANCES_MEDIAN_RT Performs the cross-modal distance-to-hyperplane analysis using %the distances-to-hyperplane from each subject and the RTs from the RNN. % %Input: subjects' I...
bfd0ec6bbf42eef1ee3bed8d6c701b7046a01f334eafe6584be62dea765ec658
MATLAB
11,082
399
function plot_niceSingleCellFig(allCells, i) addpath(genpath('./plottingFxns')) %% if isempty(i) i = randi(size(allCells.spatialFR4,1)); end % i = 1148 % G4, WT % i = 300 % G2, WT % i = 3213% HCNd1, WT % i = 3484 % HCNd2, KO i = 545; % G3, WT THIS IS WHAT IS USED IN FIG 3 % i = 285 % G2, WT % i = 297 % G2, W...
e7c20c3d8645c2f5728b46cbe97cf9a285830ead580020cf7c91eb933a8c1bb2
MATLAB
11,082
311
function varargout = spm_select(varargin) % File selector % FORMAT [t,sts] = spm_select(n,typ,mesg,sel,wd,filt,frames) % n - number of files [Default: Inf] % A single value or a range. e.g. % 1 - select one file % Inf - select any number of files % [1 Inf] - select 1 ...
f637bd87f02894466d00cb3d1c0090b5c199a8507389b93ec4850662f0205cac
MATLAB
11,095
249
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION % Script to analyse data for: % Grieves et al. (2020) % Quantification of firing rate map procedures % % This script % NOTE: This script is dependent on graphtest...
e597f7229eae0d5327312c256a8215672107149936b6839722b6c47326c6a50f
MATLAB
11,098
304
%% read data from csv clear all; close all; clc; summary_file = 'D:\Anna\Myelin paper Spring 2022\origin_files\OCT_summary_del_NC.xlsx'; [mus_gm_AD, mus_gm_CTE, mus_gm_NC,... mus_wm_AD, mus_wm_CTE, mus_wm_NC,... ratio_gm_AD, ratio_gm_CTE, ratio_gm_NC,... ratio_wm_AD, ratio_wm_C...
8ed8df557df399446eaf2b081472f47b27b290cde1ffd3a76ace31121a9ae352
MATLAB
11,103
188
function firing_rate_shuffle_population_vector_analysis(computer,bayesian_option,num_shuffles,save_option) % Marta Huelin_February 2020 % Computes a variation of population vector analysis between shuffled matrices for the same type of comparisons used in the population_vector_analysis.m code (meaning, % between same t...
5f87449fbe1df7df1bf3443f3c45836a6c95cb6ec9a228b2d9e25d116d20ecb8
MATLAB
11,109
257
function data_out = load_doppler_data(varargin) % LOAD_DOPPLER_DATA Load specified dataset % % INPUTS: % varargin: % gui_title: string; Title for GUI % session_run_list: (1 x 2) double; [session run]' If specified, % skips selection GUI. Should match ses...
384db5fb7e067d13fcbc06b18a462ab240d1b002b22cab145cf4d3c6dbe5cf9e
MATLAB
11,124
373
function c_EEG_plotEpochs(varargin) p = inputParser(); p.addRequired('EEG',@isstruct); p.addParameter('data','data',@(x) ischar(x) || isnumeric(x)); % name of field in EEG struct or raw data p.addParameter('COI',[],@(x) iscell(x) || isnumeric(x)); % channel(s) of interest (channel labels if cell array), or % indices i...
2d296c20f9e21d50da0deeac3737472424433a74a190d8c7a9afae37da513f1b
MATLAB
11,132
304
%% Manually scoring the participants trajectory % In order to the model to fit the data the participant had to demonstrate % a clear intention of completing the triangle. % This did not happen all of the time and therefore we had to exclude some % data. Also we noticed by looking at the tracking data that participants ...
7874176e174fa5cc1317e4a9f19b3fc84cebe29545d3c608bada627cf1ebf097
MATLAB
11,160
283
function SBJ08a_crRT_nANOVA(SBJ,an_id,stat_id) %% function SBJ08a_crRT_mANOVA(SBJ,an_id,stat_id) % Run ANOVA with sliding windows for given time-frequency analysis % Correlation with RT and regression of RT as confound supported % INPUTS: % SBJ [str] - subject ID % an_id [str] - HFA analysis to run stats % st...
24c0a2b7df83f7b1b4db1fc04fbbb91e13a7c6dd6438b7f1c5b23640fcdad6be
MATLAB
11,165
415
function ftab = de_ftab_build(s_arg, varargin) %function ftab = de_ftab_build(s_arg, [options]) %| %| For multiple-kVp X-ray imaging, we must evaluate functions f_m(s_1, ..., s_L) %| for m=1,..,M, where M is the number of kVp settings, %| and L is the number of material components. %| f_m(s1, s2) = -log( \int exp(- (m...
a472402b108b29f6bd722079bd01279923848e3807e7c3e3eb292319c39eb9ce
MATLAB
11,172
298
function out = spm_shoot_norm(job) % Spatially normalise and smooth fMRI/PET data to MNI space, using Shoot deformation fields % FORMAT out = spm_shoot_norm(job) % job - a structure generated by the configuration file % job.template - Shoot template for aligning to MNI space. Aligns to population % a...
5cbee7be30fb509d1897aaa9d7fee7a0e84004d069cf98e52a9b49cba2c99895
MATLAB
11,186
269
classdef FMeasureMerger < 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(Constant) USE_ORIGINAL_IDEA=false; end metho...
15a66daccad33b44fd8c40dec7729817fb591ce2dfeec8ea5b7b02c697a9ddcb
MATLAB
11,211
267
function [fitFun,pHat,XX,YY,pHatBase,CorrMat1,CorrMat2,qBounds1,qBounds2,... baselineDat,allDat,allSpk,alldSpk,allTime,allTime2,allFly,allFlyBaseline,turnOpt_during] = plotKNNMesh3D_Fit(f_orco, s, keyNdx, xGrid, yGrid, ... zGrid, ratio, Thresh, K, state, kin, genotype, plotFig)%f_orco, condNdx fe = f_orco....
63354a0cd2239f4901a684cd2fe57b0c4500df415cbac8a33358671be727c412
MATLAB
11,211
279
%Version 1 with fixed window length 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\Flavio2\Waves\Sortin...
ce1289d3d7024594a33d4813cfdb2c3905bcfde51cd7da81e4a1ffaa5c66a20c
MATLAB
11,235
262
function [TRACKS, EXIT_STRUCT, POKE_STRUCT, SUMMARY_STRUCT] = tracks_postprocessing6( allTracks, ev_ho_dict, bg_struct, pixpermm, titlestr) %TRACKS_POSTPROCESSING.m This function takes in the current tracks and the %tracks that finished throughout the video and extracts a few more %behavioral parameters from them. %RO...
cfd430813db18b386155187612c90efdf30cfecae3882cb4b0eb38d6b43748a6
MATLAB
11,235
401
function back = cbct_back(proj, cg, ig, varargin) %function back = cbct_back(proj, cg, ig, varargin) %| %| cone-beam backprojector for feldkamp.m %| %| in %| proj [ns nt na] cone-beam projection views %| cg strum ct_geom %| ig strum image_geom %| %| option %| 'use_mex' 0|1|2|3 1 mex with loop in mex (default) %| ...
02196e02ea0913c73f7d0659dba7bfa50bb12e07232cdef12d5eacb48ffd462b
MATLAB
11,246
287
function disconnectFromHost(h, varargin) % Closes the connection from the control computer to experimental % computers/Raspberrys, and reboots or shuts them down on request. % connect2ControlComputer keeps running on the experimental computer and % waits for the next control computer, so connect2Host works again withou...
8c87e150a619496a289166cb1e87c7aa25aca60bd3ceca5788110b6c5ce6ffff
MATLAB
11,255
350
function [imvol_out, M_out] = unwarp_resample(imvol,M,imvol_out_size,M_out,Mdc,unwarpflag,Jacobianflag,plotflag,interp_method,inflag,thruflag,gradfilename) % % In this file: % % unwarp_resample - from AD's unwarp_and_resample_vol % proj, jdproj - for projecting out e.g. throughplane component of % displ...
4659a2363f8258b609aa42ac2efb37880b9ba518773561c46c3eb5fd2a434bc9
MATLAB
11,257
253
function num = connect2Host(singleHosts) % Connects the control computer to one or more experimental computers, on % which connect2ControlComputer runs and waits. It returns a handle for % each of them; sendCommand2Host, getKeyBufferResult, disconnectFromHost % and the other network functions address an experimental co...
4847e547e250a47faf4b66afe5c2fec08b47ea20c0f95e1d22f7ebbdf97a92bc
MATLAB
11,274
292
function [seg_spktimes,seg_spikes,current,main_frontbuffer,main_residual,main_restime]= Spike_detector(bigdata,chans,thresh,filt_para,current,main_frontbuffer,main_residual,main_restime,sr,pre_seg,post_seg1) %function [seg_spktimes,seg_spikes,current,main_frontbuffer,main_residual,main_restime]= Spike_detector(bigdat...
40ec4d7683e9abb8cbb9fc4313610303d4f2b256edb019ebbda16e02c06d562c
MATLAB
11,280
319
function N = spm_parrec2nifti(parfile,opts) % Import PAR/REC images from Philips scanners into NIfTI % FORMAT N = spm_parrec2nifti(parfile,opts) % parfile - name of PAR file % opts - options structure % .ext - NIfTI file extension {'img','nii'} [default: spm_file_ext] % .outdir - output directory [def...
577d645fe864d6e9734bddc61acf0241966772af03222378a6aa4ca955d3a1fc
MATLAB
11,285
260
function [tbl,rm] = simple_mixed_anova_partialeta(datamat, varargin) % tbl = simple_mixed_anova(datamat, between_factors, within_factor_names, % between_factor_names) % % Repeated-measures or mixed ANOVA with any number of factors. % % Function built on top of existing MATLAB functions in an attempt to % simplify user...
17d43c08059733bd0262d6dd9f5c2f0a9b9b3a311f1214c645dc8022fddc83a0
MATLAB
11,294
230
% GET PLACE FIELDS OF A TRACK EXCLUDING 1 OR MORE LAPS % loads list_of_parameters.m, extracted_clusters.mat,extracted_position.mat, extracted_waveform.mat % uses function extract_laps.m, skaggs_information.m % INPUTS: % track_id: track being analysed % chunk1: start lap ID and end lap ID in chunk before excluded lap. E...
023da1cccf2cc9927603cd538029f9d29f2760f5b3c726101785256aac3d7c28
MATLAB
11,303
254
clear all;close all; clc; tic disp('CFC') subj = '39' addpath('/mnt/yassamri/iEEG/sandra/analysis_pipeline_final') [fro_chan_idx,MTL_chan_idx,temp_chan_idx,insula_chan_idx,cingulate_chan_idx,OFC_chan_idx,CA3_chan_idx,CA1_chan_idx,HC_chan_idx] = get_elecs(subj); cd(['/mnt/yassamri/iEEG/sandra/subj_' subj]) load('cond_...
efdffdb9d8a9141336437c4d0ca093a7ab5caede0363955aca7af9eec3702872
MATLAB
11,312
364
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\Flavio2\Waves\Sorting\'; dpath='C:\Users\xscogno\MATLAB\F...
43eb80c2c82eab1bb8bfe48ee5307c8c95af63465554cc8e6939919daaf2dcb6
MATLAB
11,334
270
function dth_all_distances_median_RT(subjects,task_distance,task_RT,with_stats,with_error_bars,varargin) %distance art, distance nat, RT %DTH_ALL_DISTANCES_MEDIAN_RT Performs the distance-to-hyperplane analysis using %the distances-to-hyperplane for each subject and the median RT across subjects. % %Input: subjects' ID...
d765c04c05447e77922c2475b612a0cf018051d4dbe29fdf2b7a8f8d9e739658
MATLAB
11,335
424
function R = Rmem(kappa, varargin) %function R = Rmem(kappa, [options]) % % Build roughness penalty regularization "object" based on C = Cdiff() object, % for regularized solutions to inverse problems. % This version is somewhat less flexible than Robject() but uses less memory. % % General form of nonquadratic penalt...
3d2e5f10a661b044a5f51bd8a95156032e9bc5de7d7fe3d5a78608b4eb2922b4
MATLAB
11,353
314
function fn_view_recon_atlas_grp_stat_ROI_LME_cat(SBJ_id, proc_id, an_id, model_id, stat_id, cat_id, reg_type, show_labels,... hemi, atlas_id, roi_id, plot_roi, mirror, varargin) %% Plot a reconstruction with electrodes colored according to statistics % This version uses categories based o...
5fc8462a2457bae5766e95e98bc7c2678f2ef80f387f2eae0aea0c62f720d99c
MATLAB
11,362
399
%| spect_3d_example.m %| %| Illustrate 3D SPECT image reconstruction with compensation %| for depth-dependent detector response and nonuniform attenuation. %| %| For simplicity, there is no "model mismatch" in this example: %| we use a discrete object and we simulate the projection views %| with exactly the same system...
bc9771145c9e02a15af853e1988901d2c2159e3cfa645cb9cb244339d57fcd15
MATLAB
11,375
419
%%% % Morelet wavelet FWHM definition % % This code accompanies the paper: % "A better way to define and describe Morlet wavelets for time-frequency analysis" % by MX Cohen (NeuroImage, 2019) % % Questions? -> mikexcohen@gmail.com %%% %% Figure 1: The happy time-frequency ma...
344c9d9dad08521e544f7f7c08d3659af50856345db1434f1cda268366032728
MATLAB
11,376
259
%% NWB_SB_import_main % A sample import script that computes the following: % - Behavioral metrics % - Spike sorting metrics % - SU selectivity metrics (SB) % - SU selectivity metrics (SC) % % SB refers to sternberg main task, and SC to sternberg screen task % throughout. % % % Michael Kyzar 6/30/23 clea...
dfe6734c1d3c55bb4ea725db7bc38b57b2e1bbe1d9ca5b8adf6b205b3dbdac85
MATLAB
11,381
306
function triggerCounter3 % Standalone application that counts the MRI triggers and saves the number % of triggers and the time into a memory mapped file. % The presenting application is then able to read out these values. % This version uses a virtual or real keyboard! % The keys that are counted as a trigger are ´, t ...
dd0b4158553f663ad76418cb06360b637dadfe99fb5a54de3fed179cd8c7ea12
MATLAB
11,392
319
function DCM = spm_dcm_fmri_csd(P) % Estimates parameters of a DCM using cross spectral fMRI densities % FORMAT DCM = spm_dcm_fmri_csd(DCM) % DCM - DCM structure % % Expects %-------------------------------------------------------------------------- % DCM.a % switch on endogenous connecti...
1732c1bd96bdcab64c5dad1ce593f8f6ecea7064cde6f3c4d23b186a8500004a
MATLAB
11,401
271
function derivedPic = standalone_segmentImage( varargin ) %%%%% Start: Process the Input Arguments if isequal(length(varargin),1) % Only an input image is given; default arguments handles.basePic.data = varargin{1} ; handles.basePic.ySize = 1024 ; handles.basePic.xSize = 1024 ; if size(handles.basePic.data,3)==...
dba93f9eaa14e618f612311e2be2a20d7318ce997981444019d321f4d150614b
MATLAB
11,406
322
clear all close all [big_table, waves] = get_big_table(); %% Calculates the COM for different temporal resolutions and without shuffling N_sh=100; count=0; for w=1:length(waves) row_w=waves(w); disp(w); count=count+1; mouse=['L',num2str(big_table(waves(w),1)),'M',num2str(big_table(waves(w),2))]...
02b8354aa706002d0c83689fa5f6cbb66b9b1e1588b878bc17eecf36f994b1f3
MATLAB
11,421
263
function [TRACKS, EXIT_STRUCT] = get_enter_exit_events_SPLINEMETHOD2( TRACKS, stat_int, before_sec, after_sec , bg_struct) %GET_ENTER_EXIT_EVENTS_SPLINEMETHOD.M This function takes in a set of tracks and %identifies the indices of lawn exits and entries . % Also returns a set of durations outside the lawn on a per tr...
1e7d4349a68f9262de522551c7c1a4d0866ba6268318e86009f994985b726153
MATLAB
11,429
283
%this plots all the flightORI_data from flight_orientation.m from individuals in the same %condition (or at least conditions that CAN be pooled) clear all close all %load data: rotated data [filenames, path]=uigetfile('flightORI*.mat','multiselect','on'); %if only one selected turn filenames into cell if i...
1a0180ac41053838a1dcf09ea972d4cfe8943aa6758b7b54f63553cdd6f7fe4b
MATLAB
11,434
360
%% Figure 5b % this script rungs additional analysis required for the plots of figure % 5b. %% - HOUSE KEEPING - %% clear close all; ft_defaults; %% -SUBJECTS - %% % ID 18 missing because of LP at 50Hz subjects = {'OSL13', 'OSL14', 'OSL17', 'OSL21', 'OSL24', 'OSL26', 'OSL27', 'OSL28', ... 'OSL29', 'OSL30', 'OS...
53dd791e9c3f9a40e1b814f1cc4273c8c37ac21c435722142dd1a18eb47d0129
MATLAB
11,435
307
function [embedding, method] = choose_optimize_layout(head_embedding,... tail_embedding, head, tail, n_epochs, n_vertices,epochs_per_sample,... a, b, gamma, initial_alpha, negative_sample_rate, verbose, method,... progress_callback, epoch_reports, random_state, min_dist, ... move_point, dataDims, sgd_ta...
74b3eb84dc79959dc9e41d6d773f67de93508d88a7249c825b26a9150c87e405
MATLAB
11,447
358
% % Phenotype can be WT,Isl2heterozygous,Isl2homozygous,ephrinA2mm, % ephrinA5mm, ephrinA2mmA5mm, TKO % % Action can be: run, analyse % % expNum is used if you want to run multiple runs with same % parameter from another script to do statistics. This allows you % to separate the runs. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
fb9be9c536b4384a72e7c568634df90d30aff86fa90a87df859158a96e7d8e95
MATLAB
11,451
399
function loadGradients(obj,phenoType) % This loads the table that David Sterrat had prepared % Added the B-system % infoFile = 'gradients/Eph-ephrins-both-axis-JH.csv'; fid = fopen(obj.gradientInfoFile,'r'); fprintf('Reading gradient info file: %s\n', obj.gradientInfoFile) header = fgets(fid); if(...
f26af70dc45328681b7c520f201cd51123b0b2562688d304c04e0651ddab92af
MATLAB
11,456
274
function [text2display, escape] = inputTextBox(varargin) % This function creates a box that allows the user to type a freely defined % text - only the letters a to z (lower case) and space, other keys are ignored! % The input is terminated by pressing enter. % The text is returned as a char array. Use the ESC key to ex...
6e98189590c958b384cd5e9d51a06c09af4f5230416c97e1cec83f2d684b7631
MATLAB
11,468
243
function POKE_STRUCT = get_head_pokes_from_summary( bgvidindex, pixpermm, IN_OR_OUT, Lawn_Boundary_Pts_x, Lawn_Boundary_Pts_y, Lawn_Boundary_Dist, Head_cent, Midbody_cent, forward, reverse, speed ) %GET_HEAD_POKES_FROM_SUMMARY.m This function identifies times that the worm pokes its %head out of the lawn while the rest...
522378a061889a1f3a7d26196ab32430e4174e3544a97d8bcfc579fe5e4e7072
MATLAB
11,470
369
function [MDP] = spm_MDP_check(MDP) % MDP structure checking % FORMAT [MDP] = spm_MDP_check(MDP) % % MDP.V(T - 1,P,F) - P allowable policies of T moves over F factors % or % MDP.U(1,P,F) - P allowable actions at each move % MDP.T - number of outcomes % % MDP.A{G}(O,N1,...,NF) - likelihood ...
b8a14918a0611caac30866d242b8e5b1bb363cdf3c0a974c13deefda9338cd30
MATLAB
11,483
370
function [C,P,F] = spm_PEB(y,P,HP,OPT) % parametric empirical Bayes (PEB) for hierarchical linear models % FORMAT [C,P,F] = spm_PEB(y,P,[hP],OPT)) % % y - (n x 1) response variable % % MODEL SPECIFICATION % % P{i}.X - (n x m) ith level design matrix i.e: constraints on <Eb{i - 1}> % P{i}.C - {q}(n x n) ...