sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
e5b7cecac65330be4a86a843ee9009d3c6cb17d8d99d85ea62cf2b4be4362836
MATLAB
4,452
126
a = sqrt(ROIdia(ismember(ROITable(:, 4), celltype) & ROISizepix >= 5 & max(ROIQuality.^2, [], 2) >0.1)); ma = median(a); figure; h = histogram(a, linspace(0, 5, 25)); h.Normalization = 'Probability'; %% Test if larger ROI size induce difference in frequency tuning % split the data of each experiments by ROIs...
9486865e374ae96215b5020b1a3a750f1cd56d3cede6e2e4c00407950e11ad4d
MATLAB
4,467
121
% Abffile bulk conversion script % % Goal: - convert and analyse abf files % - skip certain protocols that are not analyzable at the moment % - only analyse channels with something meaning ful associated to it: so check labbook list to see if channel % was used...
6364161a007e1eed34a0638194b7453b93b4b66e4f2ca68e91208b31038c70d2
MATLAB
4,468
151
function DisplayExcludedTime(handles, hAxes, ml, iCh, chVis, linecolors) global maingui if get(handles.checkboxShowExcludedTimeManual, 'value') mode = 'manual'; elseif get(handles.checkboxShowExcludedTimeAuto, 'value') mode = 'auto'; elseif get(handles.checkboxShowExcludedTimeAutoByChannel, 'value') mode =...
4e22cc006451138a0892b1ef151a8a3d4266becc1576190d6d4c9ee87f6706e0
MATLAB
4,469
129
% %plot PSTH based on spikesToPlot structure that is used to plot rasters %Also has options to deal with multiple-align rasters % %timeRangesToPlot: if set, only plot these ranges (from/to, one per row) %binsize to use for PSTH %triallength in ms %grpRanges till which trial nr is each grp (inclusive), %ie grpRanges=[1...
3988afab0bbfc9645fdc50b7d74b8842daea4d3a2cde2b15431ce4548078d556
MATLAB
4,472
146
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Supp Fig9 CFstimulation" % 3. Using ctrl+enter within each function to run each section %% Section 1: open files % ctrl+enter to run this section clear co=lines; co(6,:)=[.5 .5 .5]; cnum=[6 2 4 5]; legendlist=[]; ...
bdc22bbd62ec2cb6eb0beff066497f35ce5d24d46c498a92939357a0c8a29d96
MATLAB
4,473
126
function this = m10l5Analysis(this) %M10L5ANALYSIS Perform nonparametric M10 and L5 analysis on an ACTI object % % $Author: Peng Li % $Date: Jun 15, 2021 % $Modif.: Jun 25, 2021 % instead of calculating per day, average the days first % see comment where revised % x = ...
e633b70fb2ddd5053c9136bbe698cd25e49549f037a73d0c73b3543143798a53
MATLAB
4,478
142
% Classifier unit test % % Classifier: liblinear % Note: the classifier itself is not being tested since it's external but % rather the MVPA-Light interface. rng(42) %% do not change - might affect the results tol = 10e-10; mf = mfilename; %% first check whether LIBLINEAR is available check = which('train','-all'...
bbd6ea454d2414ba1074a31d20d6c2eca016bf036c4b10ab8bb6eddb0125d8ae
MATLAB
4,479
148
% Script to compute the branching ratio % for running locally, can call 'setSederbergAvaProjPaths' instead of % setting data_dir, print_dir here. % data_dir is the path to the sample data (can be relative path from cwd) data_dir = 'sample_simulation_data/'; % where you want to print outputs print_dir = ''; data_sub_...
239560bc66c2654bb9e694b6793a37743cd904057df6aebce2a26a99deba1535
MATLAB
4,482
157
function net = somtrain(net, options, x) %SOMTRAIN Kohonen training algorithm for SOM. % % Description % NET = SOMTRAIN{NET, OPTIONS, X) uses Kohonen's algorithm to train a % SOM. Both on-line and batch algorithms are implemented. The learning % rate (for on-line) and neighbourhood size decay linearly. There is no % e...
4187cb6d9c50b02333ba6ad64c35b6156abff303ed36b24325bb2b5fcd5a1454
MATLAB
4,486
152
%Wheel data summary and plotting %Chris Mount July 2018 %% Load Data disp('Select Data File') handle = uigetfile('*.mat','Select data file'); %identify data file wheelFile = load(handle); wheelData = wheelFile.rungCounts; %request categorization of each mouse - genotype, gender, age, manip wheelNum = input('How many w...
bf51f9dbb7739d18f61ab95302aa056e522514da1b87a0fa73468e0e9079b2c2
MATLAB
4,490
115
function [update] = symmetric_polynomial_expansion_registration(... moving, fixed, movingDeformed, fixedDeformed, ... multiModal, transformationModel, varargin) % OPTICAL_FLOW_REGISTRATION Estimates a displacement field using optical flow % % [update] = symmetric_optical_flow_registration(... % moving, fixe...
1be5a978191e9b61adb64183979e046583469eb8f9a6c187188f3d6ed56f7799
MATLAB
4,493
125
function [K1_new, K0_new, K2_new] = tuneTargetCancellation(K1, K0, K2, ... B, I, S, mask_learn, head, target, conds, light, sines) % Allow the predictive target signal weights to change % with learning. Don't change anything about K1 (model before learning) % Set to 0 to used close loop calculation (for nonlinear ...
b85ccb15f8ce29721423c7d691700206dd4308c8a396813f5184994bb7f0e82f
MATLAB
4,493
137
%% Bar Plot of d' and LR Bias (Pooled + JK errorbars) load('../data/behavData.mat') close all %% Initialize variables par_all = cell(1,2); par_all_mi = cell(1,2); par_val = cell(1,2); par_jk_ortho_avg = cell(1,2); par_jk_mi = cell(1,2); actual_param = cell(1,2); actual_param_mi = cell(1,2...
c3ce102a505c1340d1961efa5972a45be956c0a33ce2493280ca52ffdd9c6fe4
MATLAB
4,497
180
% plotSpectrogram plot an array of spectrograms on a single fig % % fig = plotSpectrogram( x, y, z, USF, plotmode, zscaling, yscaling, nCycles ) % % x, y, z time/phase; frequency; power (or any other measure) % USF {1}; up-sampling factor % plotmode {'imagesc'} or 'contourf' % zscaling ...
b509b8072f5114a1d153f3d257d553a55ae101cf6f4d1cf9bef70b7fbedc1bc3
MATLAB
4,499
98
% parameters if ~exist('zmat_orig_file','var'), zmat_orig_file = '/cluster/projects/p33/users/alexeas/elleke/data/zmat_orig.dat'; end if ~exist('zmat_perm_file','var'), zmat_perm_file = '/cluster/projects/p33/users/alexeas/elleke/data/zmat_perm.dat'; end if ~exist('num_eigval_to_keep', 'var'), num_eigval_to_keep = 10;...
6bc1c77a07066ca2fce1e85d1a24789710b92fb49c57069e3715e5aa8bd3e919
MATLAB
4,501
141
%{ Copyright (C) 2023 N. Suhas Jagannathan This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed i...
64f2edc5b54a6c3cd70a8a567f0a38ac13e4a267f1a547db0b7e58ff158f9bdb
MATLAB
4,506
119
%This function identifies lines and compute basic alignment (single plane) %% Inputs subjectFolder = s3SubjectPath('14','LC'); slideName = 'Slide04_Section02'; %Leve empty for loading of all slides, otherwise specify 'Slide01_Section01' % How to identify the lines. Can be: % - 'ByLinesRatio' - use lines rat...
f21bf89b83ef91bc1b4e9f3edf21cb2301f83e1db613cafdb69c47d3bd028a8e
MATLAB
4,510
118
%% TRANSIENT COLLECTIVE ANTI-PHASE BEHAVIOR (HFOs, 610 Hz) % SETTING clear rng(19) % seed Path = [pwd, '\IN_sims\']; clrs = ["b","r","g","k","c","y"]; % colors per_clr = [0.9290,0.6940,0.1250]; % periodogram color % TIME T = 800; % time span dt = 0.01; % COUPLING eps1 = 0.05; eps2 = 0.01; epsilo...
67f3a4cfb36f525bfde199d8f99c89ed4956b132fbe15be83c96d084cf0bf24e
MATLAB
4,511
117
load('preprocessed.mat') load('mutations.mat') drugs = {'Erlotinib', 'Lapatinib', 'PD0325901', 'PLX_{4720}', 'CHIR_{265}', 'Selumetinib', 'Vandetanib'}; cell_lines = strrep(cell_lines, 'TUMOR-', ''); conc = [2.5e-3, 8e-3, 2.5e-2, 8e-2, 2.5e-1, 8e-1, 2.53e-0, 8e-0]; concLog = log10(conc * 10^3); %size(data_fit) %size(d...
4446719507836d41e8f27d813e6b7aacb13cea0d9169c48511daa26165e9c28d
MATLAB
4,512
143
function pSVR_plot_bfca_behavior_correlation(p) %% Plot bfca-behavior correaltion for all subjects % Get relevant variables from 'p' delay = p.psvr.delay; p.psvr.label = 'target'; %%% Prepare data %%% % Load results stats_file = dir(fullfile(p.dirs.data, 'analysis', 'all', 'results', ['pSVR_' p.psvr.event '_' p.psv...
0c295b22abb25d203cc254de5a04b82b4a5644f4cb82c02d36491289191f9f10
MATLAB
4,513
124
%LoadBinaryChunk - Load data chunck from an open binary file. % % USAGE % % data = LoadBinaryChunk(fid,<options>) % % fid file id (obtained via fopen) % <options> optional list of property-value pairs (see table below) % % ====================================================================...
85cdace4bf7b49d142f336488c5ef65ad18d2d6fd5bd50a6bee15bab561e7f64
MATLAB
4,513
114
function [pxx,w] = calcWelch(sbjNum,rawDataFN,respData) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; % Conve...
a150dc977e9da1e15ccbdcf4a75e0459f21ae1b93061b3e955b2100baa18b0d5
MATLAB
4,515
106
function mri_reconstruction_grid(p) % Run the pSVR analysis as for a selection of voxel-counts and % feature-space smoothing FWHM values (-> parameter grid-search). As it is % not inherently clear which number of voxels or amount of smoothing yields % the best reconstruction results for a given subject, the optimal va...
cf46ad20c0d4852a30a9fca826b2efb8a4ce3d7e709a35695b89b3741870e17b
MATLAB
4,519
135
%DEMHMC3 Demonstrate Bayesian regression with Hybrid Monte Carlo sampling. % % Description % The problem consists of one input variable X and one target variable % T with data generated by sampling X at equal intervals and then % generating target data by computing SIN(2*PI*X) and adding Gaussian % noise. The model is ...
9007e307dc581f5aea19e8742798b556c57cd36cec0a39b846df3f8348f644b8
MATLAB
4,522
161
clear [task_info,supPath,~,task_DB_path] = loadDBAndSpecifyDataPaths('Vermis'); PLOT_CELL = false; EPOCH = 'cue'; req_params = reqParamsEffectSize("both"); req_params.cell_type = {'PC cs'}; %req_params.ID = 4778; lines = findLinesInDB (task_info, req_params); cells = findPathsToCells (supPath,task_info,lines); ...
1d81d5e1300195c9e66e4b56ec8cef9c413b639b33902d8f31bc4b7046dfa4cc
MATLAB
4,534
176
function [R, il] = Restrict(tsa, varargin) % Restrict TSD to a new timestamp % % USAGE: % R = Restrict(tsa, varargin) % % There are two main ways to invoke this function: in the first an array % of timestamps is specified, and the tsd made out of the points in tsa that % approximated those timestamps is retur...
112d12aae9267c1d59c049a8b4dabd50bce324e6cd314ee2d9e5811edf7fef02
MATLAB
4,538
128
function [subj] = dimred_template(subj,data_patname,selname,new_map_patname,extra_arg) % Template for dimensionality reduction methods % % [SUBJ] = DIMRED_TEMPLATE(SUBJ,DATA_PATNAME,SELNAME,NEW_MAP_PATNAME,EXTRA_ARG) % % Adds the following objects: % - dimensionality-reduced pattern object % - possibly also patterns o...
97d8e02ecbea85e03eb4bdb10cf7049d27a58cec98da91f2413b9dbfa2298168
MATLAB
4,540
106
% function results = decoding_generate_output(cfg,results,decoding_out,i_decoding,curr_decoding,data) % % This function calls all decoding_transform_results for all entries in % cfg.results.output and saves the returning outputs at results.(outname). % % It also handles initialization of output fields if they are...
09f3ba2dca5770eb8e2d187db2fe5620c952f0fc4bef831dfc7e2df469e88afe
MATLAB
4,544
121
function output_filenames = create_sessions_tsv(varargin) % % Create a simple sessions.tsv for each participant of a BIDS dataset. % % USAGE:: % % output_filename = bids.util.create_sessions_tsv(layout_or_path, ... % 'use_schema', true, ... % ...
7b6edfd17879548df517dc0497fba44f9a494c920c1799ddb59583c7edeb1f96
MATLAB
4,544
100
%% Figure S8: Plot Retinotopy/target position RETINO_FILES = {... 'Monkey', 'Chamber', 'File'; ... "Homer", "Left", "Data/M16D20151120R0Retinotopy.mat"; "ThorL", "Left", "Data/M21D20180612R0Retinotopy.mat"; "ThorR", "Right", "Data/M21D20170307R2Retinotopy.mat"; }; TARGET_COORD = ...
b5b401538889c2ebf90f422c425602a331c26c408742534d24817da027a9d001
MATLAB
4,549
91
% This script is a template that can be used for an encoding analysis on % brain image data using cross-validated Mahalanobis distance. It is for % people who have betas available from an SPM.mat (for AFNI, see % decoding_tutorial) and want to automatically extract the relevant images % used for calculation of th...
4f548e3c3398ce92d8daff7d090a3623bb3583beb7c89ccdf759a23310934c20
MATLAB
4,550
92
%%% Add analysis scripts and required toolboxes to the search path %%% % Analysis scripts addpath(genpath('/.../WM_VI_EVC/code/analysis/')); addpath(genpath('/.../WM_VI_EVC/code/revisions/')); % Toolboxes % 1. SPM12 % https://www.fil.ion.ucl.ac.uk/spm/software/download/ addpath('/.../spm12/'); % 2. The Decoding To...
85483fb11cfa405d11ee0354b2c37df65438d91fdaf6b09f6baefed088606dff
MATLAB
4,550
121
% Plot voltage for article figure % Note: SpikeReader returns entries with 1 less index then NeuronReader. % E.g., length(stel_nV.v) vs. length(stel_nS). % Todo: This could be looked into to see if the indices are offset by 1. initOAT; plot_voltage=0; % choose to plot current or voltage % read in voltages stel_nR = Ne...
b8a5a7b72d925e33eecac0ea6358f5a3e46321da801bcce375a93130108c53eb
MATLAB
4,552
142
function [mstruct, param,f] = defineModel(modelname) %build structure mstruct, which contains the hard-coded parameters in this %function according to string input modelname if strcmp(modelname,'jointRL') mstruct.modelname = 'Joint-action RL model with perseveration'; mstruct.modelshort = 'jointRL'; mstru...
26955193ed20109ae1f406f451e1caf94744204ca184b58f80dbd4e6ada39bee
MATLAB
4,554
171
function data = open_rwd(filepath,params) Fluorescence_path = filepath; recording_config = params.recording_config; config = load_rwd_config(Fluorescence_path); sep = strfind(filepath,filesep); dataRoot = filepath(1:sep(end)-1); Fluorescence_unaligned_path = [dataRoot filesep 'Fluorescence-unaligned.csv']; raw_data...
6f3132693c324504aa6c14f2fc9e19c1b1a1b32ed46259c61b3a368cb145df0f
MATLAB
4,554
101
function BarPlotGrouped_PreVPostTSMeanERROR_IndTrials(STRUCT, CONDITION, COLORS, TITLE, YLABEL, XLABEL, ERRORBARS) %BarPlotGrouped_PreVPostTSMeanERROR_IndTrials plots a grouped bar chart with a bar for pre-stim % mean and post-stim mean for each condition % Individual trials will be plotted over the bars +- errorbar...
ada75d9af8c85716b4c4a23bb9d54f1c2d3ada4c5fd4b4bd16735f0296807366
MATLAB
4,554
111
function histologyInstructionsTextToStackConfig(subjectPath) % This function converts histology instructions text file to stack config. % (used by LC and some LD) Written at Jan 10, 2020. %% if ~exist('subjectPath','var') subjectPath = s3SubjectPath('02','LC'); end readFileFromOperational = false; % Set...
ec70507299d70e554435632490edba42139c9f2b4eb3f2a58d22b2227a2d1029
MATLAB
4,554
108
function CV = mv_get_crossvalidation_folds(cv, y, k, stratify, frac, fold, preprocess, preprocess_param) % Defines a cross-validation scheme and returns a cvpartition object with % the definition of the folds. % % Usage: % CV = mv_get_crossvalidation_folds(cv, y, k, stratify, frac, fold) % %Parameters: % cv - ...
2b1be1c7fd21c654c147edebc7baa2d647e0021485570d9046469d55f24cdd46
MATLAB
4,556
118
%% COLLECTIVE ANTI-PHASE SYNCHRONY (transient HFOs, 740 Hz) % SETTING clear rng(17) % seed Path = [pwd, '\DP_sims\']; clrs = ["b","r","g","k","c","y"]; % colors per_clr = [0.9290,0.6940,0.1250]; % periodogram color % TIME T = 500; dt = 0.01; % COUPLING eps1 = 0.25; eps2 = 0.05; epsilon = [ eps1, ep...
e48952bb06288c3654e0b6ceaff4240043c2b21e18378764949d07a18fba570a
MATLAB
4,556
159
clear [task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis'); req_params.grade = 7; req_params.cell_type = {'PC ss','CRB','SNR','BG msn'}; req_params.cell_type = {'SNR'}; req_params.task = 'choice'; req_params.num_trials = 120; req_params.remove_question_marks = 1; req_params.remove_repeats = false; EPOCH = 'cue...
a7acb1c976d395aea25f137d02046f392d73af18605ab78556cecee514668dbe
MATLAB
4,570
90
function [fs_data,skip_feature_selection] = decoding_prepare_feature_selection(cfg,i_train,i_test,i_step,current_data,subindex,previous_fs_data) % Pack feature selection data (subfunction of decoding.m) % Martin 2014/01/12 % TODO: this is still quite dirty and error prone, best move the reading of % external ...
d2701bbf50fdf71141d67510ff3a88174d82c73845a85090449ef00b2623f7d8
MATLAB
4,574
158
function [run_log, full_log, experiment] = load_log(sub_id, p) % function [run_log, full_log, Experiment] = load_log(sub_id, p) % % Load experimental logfiles of all sessions for one subject. Includes % exceptions for each subject according to their specific experiment. % % Input: % - i_sub: ID of the current subjec...
0c24a4fe2f4e892162d2329f8fc052cb7367e18542fef027d23dcdda1a550c46
MATLAB
4,580
140
#import <UnityAds/UADSBanner.h> #import "UnityAdsUtilities.h" typedef void (*UnityAdsBannerShowCallback)(const char* placementId); typedef void (*UnityAdsBannerHideCallback)(const char* placementId); typedef void (*UnityAdsBannerClickCallback)(const char* placementId); typedef void (*UnityAdsBannerUnloadCallback)(cons...
2ad2a0574d411c6ae112957a7710187e746b92ee15a024030f5ab6b9a6efebc0
MATLAB
4,587
120
% for sbj 08 and 10 function [pxx,w] = calcWelch_OldProbe(sbjNum,rawDataFN,respData) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experime...
fcec112eb39b893559192d3120f8a1c789b11590f51b20772973b0de8fbc28b6
MATLAB
4,590
92
% ----------------------------------------------------------------------- % % M U L T I P L E T E S T I N G % % ----------------------------------------------------------------------- % % Function 'mt_fisher' computes the Combined Probability of Fisher for % % multiple c...
59c43a98495f425e0cbf33ecbc909b5386c1b9f641893d4a3bfe3b5635c19efd
MATLAB
4,593
152
%DEMGMM1 Demonstrate density modelling with a Gaussian mixture model. % % Description % The problem consists of modelling data generated by a mixture of % three Gaussians in 2 dimensions. The priors are 0.3, 0.5 and 0.2; % the centres are (2, 3.5), (0, 0) and (0,2); the variances are 0.2, % 0.5 and 1.0. The first figu...
b553ed1e58f1f270b134725daa0a72533f2b123341ff3d8a81ca3ea802bb3644
MATLAB
4,596
136
function this = plot(this, varargin) %PLOT plot error ellipse on a clock axis % % see also: FIT, CI, COSINOR % % $Author: Peng Li % Brigham and Women's Hospital % Harvard Medical School % $Date: Dec 13, 2021 % % only works for one component fit if ~isscalar(this.CycleLeng...
77bd7608f570cb17a3585bb32dbb9d8a396f2b72dcb5c7e1a53a8625c266ea54
MATLAB
4,605
130
clear all load('../data/opt.mat') for pair = 1:length(opt.participant_pair) clear segemented_trial_p segemented_trial_o event_no_error_p event_no_error_o fprintf('Event correction for pair session %d: %s - %s \n',... pair,opt.participant_pair{pair,1},opt.participant_pair{pair,2}) ...
3db9dc2f2a5d34b19546e825077c77837c6661b97d310c468e6b8d2cdd4cb84a
MATLAB
4,612
153
% This demo shows how a simple searchlight decoding runs on simulated 3D % toy data. The toy data are Matlab matrices and no real fMRI or EEG data, % i.e. results do not necessarily generalize to real data. % % The script creates multiple volumes in the shape of an ellipsoid where % all entries are filled with r...
4c2711e444fa72d212f32c14744ae5bcc7440f8f60966e869162c1f53465b5c9
MATLAB
4,612
103
function [update] = symmetric_phase_registration(... moving, fixed, movingDeformed, fixedDeformed, ... movingCertainty, fixedCertainty, ... movingDeformedCertainty, fixedDeformedCertainty, ... transformationModel, currentScale) % PHASE_REGISTRATION Estimates a displacement field using phase-difference %...
0653982ebfad3e5705e792359186976b02a5eb3276770da3e5c4d47586bb6ee7
MATLAB
4,613
156
function EEG_buildGND(dir,fin,model,inprefix,regtype,eeginfix,framewin) % settings % framewin = [-1 0.5]; %time of interest nChan = 64; %number of channels %get input folder filedir = fullfile(dir.dir_eeg, inprefix, regtype); % get behavior from simluations [BEH] = EEG_loadVars(dir,fin,model); nS = length(BEH); %p...
c91fc87add892c6cc1475175ff81395c84e3a72a53d4ef8c3f5a0ed1ef613f0c
MATLAB
4,614
127
function [IS, IV, xPeriod, PercMissingData, PercMissingBin] = isiv(x, epoch, scale, period, varargin) %ISIV inter-daily stability and intra-daily variability for locomotor activity data % % epoch: sampling time (in min) % scale: at what scale IS and IV are estimated (in min) % period: a range (in hr) used for search...
f5002d0ceae299d43cd35aa5dece95f8268d639f2679641b26e3053e7ab512ce
MATLAB
4,614
160
%DEMGP Demonstrate simple regression using a Gaussian Process. % % Description % The problem consists of one input variable X and one target variable % T. The values in X are chosen in two separated clusters and the % target data is generated by computing SIN(2*PI*X) and adding Gaussian % noise. Two Gaussian Processes,...
bc217eddcc534c1810ae54f47cbeed3fc48ba4167e2676e8bd6ed832d4283515
MATLAB
4,615
136
function runHistPreprocess_base(runAutomatic) %This function runs all the preprocessing steps of histology. %1) Importing to aws %2) Aligning H&E slides with Flourecense microscope images %This script is run as stand alone and would propt user with all required %inputs %No need to change any parameter, just ...
e1b95925f88939e95af0c16a798b44470623939a61f8c9c07ab6641e27d6a23d
MATLAB
4,615
147
function outStatus = histSVSImport(histologyFP,subjectFolder,slideSections,isDelayedUpload,tmpFolderSubjectFilePath) %This function imports H&E Images from SVS format %INPUTS: % - histologyFP - file path pointing to .svs % - subjectFolder - pointer to the cloud where the subject is % - slideSections - what slides ...
1dd48dd9303c5152f26b8e4c176277bd6f724e9bcb7ca5eb703186f3433ca0ab
MATLAB
4,616
146
%% Bar Plot of d' and LR Bias (Pooled + JK errorbars) % data_path = 'E:\Adi\Copy_of_V4_FEF_Project\Code_Plotting\data'; % functions_path = 'E:\Adi\Copy_of_V4_FEF_Project\Code_Plotting\functions'; % addpath(functions_path); % addpath(data_path) %% Initialize variables par_all = cell(1,2); par_all_mi = cell...
8d6cfb757e9cf92a52a7047e83887bed2e9e00abaaaee9c58d0cb0e3cbe74a7e
MATLAB
4,618
118
function [clabel, dval, prob] = test_naive_bayes(cf,X) % Applies a Naive Bayes classifier to test data. % % Usage: % clabel = test_naive_bayes(cf, X) % %Parameters: % cf - classifier. See train_naive_bayes % X - [samples x features] matrix of test data or % [samples x ... x ....
9bd77c97fbb4badf4d7fadee0fcc077cb88857efe22cdee1afb7265d3f4dc053
MATLAB
4,622
149
function unittest_optimisation_TrustRegionDoglegGN % Test of optimisation functions % % Function: TrustRegionDoglegGN % % Standard test functions are used to check whether the optimisation % converges to the correct solution. Most test functions are found in % https://en.wikipedia.org/wiki/Test_functions_for_optimizat...
29a2430486275f2d2de8fb1868c7c65ad53ed4223cca27b686e63b60fb54300b
MATLAB
4,623
136
function this = plot(this, varargin) %PLOT plot error ellipse on a clock axis % % see also: FIT, CI, COSINOR % % $Author: Peng Li % Brigham and Women's Hospital % Harvard Medical School % $Date: Dec 13, 2021 % % only works for one component fit if ~isscalar(this.CycleLeng...
19aee647f2e44f37009dea5fe0b136d97f23c7243c1c7b4cd573c2bfc34b0206
MATLAB
4,635
158
% During Reward clear [task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis'); req_params.grade = 7; req_params.ID = 4000:6000; req_params.remove_question_marks = 1; req_params.num_trials = 50; req_params.task = 'saccade_8_dir_75and25|pursuit_8_dir_75and25'; req_params.remove_question_marks = 1; lines = findCspkSs...
24f46e2701e953fbe5dbed31fff6356d215a2533eae169703a237d8d15a9409e
MATLAB
4,651
142
function [corrected_data, sigmas,dn, correctionMatrix] = SOUND_fast_SSP(data, LFM, iter,lambda0,U, inputData, sigmas, estimate_just_noise) % This function performs simultaneous SSP_SIR and SOUND: SSP is performed % withing SOUND iterations without mixing the channels %input: % data: (channels x time points x tr...
795677e688829375225477014a25e33f45878b3872c9512a35cc04c39bb0fb47
MATLAB
4,652
134
function [X,clabel,Y] = simulate_checkerboard_data(nsamples, nchecker, nclasses, prop, scale, do_plot) % Creates checkerboard data in two dimensions. The space is split into an % nchecker x nchecker checkerboard. Each checker contains data from one % single class. % % Note that checkers are filled row-by-row, cycling t...
414256d7a43ea4dca7a8e7936c1db952b70dc6d58ff520d4a347d09d5e026bbc
MATLAB
4,667
170
function [subj] = create_xvalid_oddeven(subj,runs_selname,varargin) % Create split-halves xvalid indices % % [SUBJ] = CREATE_XVALID_ODDEVEN(SUBJ,RUNS_SELNAME,VARARGIN) % % Defines odd runs as training and even runs as testing % for selector 1, and vice versa for selector 2. % % See CREATE_XVALID_INDICES.M for more inf...
47487f502c95bc4314d083ab622802588e8a6590f8688b078db826d0e7766459
MATLAB
4,668
122
% run CircleAnalysis_ResponseScreening072122_MorphSeg.m or % CircleAnalysis_ResponseScreening071222_MorphSeg.m first clear all; clc; GroupData.Days = {... % 1 2 3 4 5 6 7 8 9 10 '092519', '093019', '100319', '100719', '103118', '110318', '110...
99bd0bd4b8ac7e8bd933e63784f33140ccd065502683569e16bb537c8ce5de86
MATLAB
4,673
159
function [pval table] = circ_wwtest(varargin) % [pval, table] = circ_wwtest(alpha, idx, [w]) % [pval, table] = circ_wwtest(alpha1, alpha2, [w1, w2]) % Parametric Watson-Williams multi-sample test for equal means. Can be % used as a one-way ANOVA test for circular data. % % H0: the s populations have equal m...
95937e60930a007b8d69a4400670d484742fbf198c3e85d147bb7cf13f74ab5a
MATLAB
4,674
164
function [err, ErrMessage] = WriteBrikHEAD (FileName, Info) % % [err, ErrMessage] = WriteBrikHEAD (FnameHEAD, Info) % %Purpose: % Create the header file for an AFNI Brik % % %Input Parameters: % FnameHEAD the name of the header file % Info, a structure detailed in function BrikInfo % %Output Parameters...
b3cab8f0900d8badc27499f8b7626f99917eeaf2b4350e02dcaae03e47e8708b
MATLAB
4,679
117
function cf = train_libsvm(param,X,y) % Trains a kernel support vector machine (SVM) or a support vector % regression (SVR) using LIBSVM. The sym_type parameter controls whether % classification or regression is performed, see below. % % For installation details and further information see % https://github.com/cjlin1/l...
ae7a51104d3fee4d944efc0451f3684df91ad028cf53c763bd32ff5fcb0b1886
MATLAB
4,682
132
close all labelIO = true; modelName = 'KEGGnet'; network = IO([modelName '-Model.tsv']); annotation = readtable([modelName '-Annotation.tsv'], 'FileType', 'text'); inputNodes = annotation.code(ismember(annotation.ligand, 'True')); outputNodes = annotation.code(ismember(annotation.TF, 'True')); uniprot2gene = containers...
b11bb5ec23426b124c8e7ea6799cc22b661a7b549b5ea93352bf4d128dec4537
MATLAB
4,694
127
% figure 5D: suffeled vs insertion mirror-symmetric viewpoint tuning index % last update: October 28 2022 % Amirhossein Farzmahdi clear close all clc % fixed random seed for regenerating same result seed = 42; rng(seed) % add path addpath(genpath('functions')) images_dir = 'mat_files/'; % loading data load (images_...
b5f167e7b8b0492f05756b0e9842eea6b8d0b06167733b865ae5cc745a755ca7
MATLAB
4,697
128
%% Compute delay maps from astrocytic in vivo calcium imaging data % Code written by Peter Rupprecht (rupprecht@hifo.uzh.ch) in 2023 % Code is deposited in this repository: https://github.com/HelmchenLabSoftware/Centripetal_propagation_astrocytes % See this repository for an explanation of the code % Please...
f42e6d91687a3ee8e91fc705b3f0b7bb2bb9fb91d95466e93a647164333301fe
MATLAB
4,708
175
function [s,mxy] = isochromat_GRE_MT(theta,phi,B1SqrdTau,TR,T1x,T2a,f,ka,G,Niso) % [F0,Fn,Zn,F] = isochromat_GRE_MT(theta,phi,B1SqrdTau,TR,T1x,T2a,f,ka,G,Niso) % Isochromat based simualtion of Pulsed MT systems w/ gradient echo sequences % % arguments: % theta: vector of flip angles (rad...
a3257ad9081cf1131fbda7efc294d5aeb91b617e965905c75c4fd3eb0c883d65
MATLAB
4,710
110
%% Flow Distribution Data and Plots function FlowDistributionOverTime(fileParams, flowDistParams, flowDistOverTimeParams) %% Make Flow Distribution Data fprintf('\n\n- - - Starting FlowDistributionOverTime - - -\n'); %% Figure Parameters distOption = flowDistParams.distOption; dataBinWidth = flowDistParams.dataBinWidt...
2de5d2032d478824aec1e25f63c8d5d735ec1274bed0c13f73efec30d46fc68b
MATLAB
4,715
168
function [x, options, flog, pointlog] = conjgrad(f, x, options, gradf, ... varargin) %CONJGRAD Conjugate gradients optimization. % % Description % [X, OPTIONS, FLOG, POINTLOG] = CONJGRAD(F, X, OPTIONS, GRADF) uses a % conjugate gradients algorithm to find the minimum of the function ...
312acec68d9c8fc5d318f5c1d3f915fd9e3d085c155ff5f52bea9bf0a4008c2b
MATLAB
4,719
176
folder = fileparts(which('trainLSTM.m')); addpath(genpath(folder)); clear all load('data/ParamsTrain.mat') load('data/DataTrain.mat') computeStatsTrain computeRelevance=0; prm.vx = [0.325 0.325 2]; prm.normVx=prm.vx./min(prm.vx); X=squeeze(blobDataNan(:,:,:)); Y=y; numPos=length(Y(Y>0)); num...
a463fdb2b49dcc65f599fe39e253e6ad92d059db4e219949e77191ec3e866da5
MATLAB
4,728
128
%% Compute delay maps from astrocytic in vivo calcium imaging data % Code written by Peter Rupprecht (rupprecht@hifo.uzh.ch) in 2023 % Code is deposited in this repository: https://github.com/HelmchenLabSoftware/Centripetal_propagation_astrocytes % See this repository for an explanation of the code % Please...
da67d6504ed8380eb56c4f784868fad6992e7f19771580cb2c366a9001c2dd99
MATLAB
4,729
132
function hi_lo_wave_clus_batch_211020(folder_address,electrodes,rec_leng) %low wave clus disp('Getting Low Spikes...') for i=1:length(folder_address) disp(strcat('Getting Low Spikes ',string(i))) cd(folder_address{i}) mkdir lo Get_spikes('Files.txt') end disp('Clustering Low Spikes...') for i=1:lengt...
1620dceeeae0c0ef784e64339175f1ede8a0ce2c6e6f1fbdeaebfb0afb0ba556
MATLAB
4,737
125
function percent_change_210704(table1, table2, table3, table4, subregion) % Creates pre stim post stim dot charts for upreg and down reg for either % ff or fb axons and plots percent change % Table 1/3 correspond to prestim and respectively correlate to table 2/4, % ie table 1 is prestim ff table 2 is post stim ff, ta...
e3e518955ae7d5a4d65c8ab6cf39e128cf9101d99ed4bc1fcf0dcf190853985d
MATLAB
4,750
125
%% load dataset % load('dataset_201.mat', 'df'); % load data of 201 brain regions load('dataset_53.mat', 'df'); % or load data of 53 brain regions % load('dataset_64.mat', 'df'); % or load data of 64 brain regions load('onto.mat', 'onto'); ivol = cat(1, df.Volume{:}); % get volume of each...
fd7e80bea11c101f829ae4bc338aab9f91ad5b6bed6df078c92e450ce039aec6
MATLAB
4,752
134
function batch_SurpriseMinimization % in order to replicate the results from Wurm, Walentowska, Ernst, Severo, % Pourtois, Steinhauser (2021), download the preprocessed EEG data and % regression results via figshare % (https://figshare.com/articles/dataset/2023_Wurm_SurpriseMinimization/23055974). % Unzip and change...
86f169771de7c3d6d8cc95b77b0e73c6d7cddd1b99982a76a060665c58ca8ccb
MATLAB
4,755
125
function percent_change_nopad_210704(table1, table2, table3, table4, subregion) % Creates pre stim post stim dot charts for upreg and down reg for either % ff or fb axons and plots percent change % Table 1/3 correspond to prestim and respectively correlate to table 2/4, % ie table 1 is prestim ff table 2 is post stim ...
5dc3a4e8f330b2a88c5ddfdc1b46fe3023935dabdc80665b5854efb280c7ba5c
MATLAB
4,758
98
% PERMUTATION ANALYSIS TO SEE WHICH BRAIN AREAS SURVIVE DURING NAV > MATH TASK (Nav-Math Experiment) % The permutation have been computed usign the neurosynth mask (https://www.neurosynth.org/) obtained by % searching 'Navigation' as topic %% Set up the environment clc clear restoredefaultpath SPMPath = '/Applicatio...
09cd3c93964a8f2b1ed093d4b799ce0f42fb49e28e6c480be66eeb14d0037339
MATLAB
4,759
110
chdata=load('C:\Users\DBHeyer\Documents\PhD\China\Djai\Recordings\mats\180705_000.mat'); %settings ch='Ch1'; secch='Ch2'; StringCh='Ch31'; CCStepkey='a'; stopkey='s'; sweeplength=4000; %length of each sweep in ms %find beginning and end of CC step protocol CCStepkey=unicode2native(CCStepkey); stopkey=unicode2native(st...
3789bdb0faabaa0c4a9fac96c546903c01026b16fe5f3c3ba6c58ac5e9585ed1
MATLAB
4,765
149
% Add repts and CI. Used for publication % % Each array is channels x time x trial % This use cross-validation where GLM is computed for each training fold % and SS beta coefficients from training folds are used for test fold. % % Used for subset of channels % DiffTLen!!! % baselinePerf is classification accuracy for c...
4d4d1a4bcb1a10d94dd16a9e1d183a22f4aa29f149919aed1b5e968b48187072
MATLAB
4,765
102
% function decoding_out = libsvm_test(labels_test,data_test,cfg,model) % % Wrapper function for libsvm. % % See libsvm_train.m for details. % Adapted to passing kernel as .kernel % Brief explanation of decision values and how they are used to get the % predicted labels: % In two-class classification, there ...
c7a7f4dfe36ad16a7c95fbed18940b0a3c8a259d2a38ba8fe9b87cc189ec37d4
MATLAB
4,769
136
data_location = TFR_Clustered_Data; save_data_location = Stats_data; condition_label = cond_labels; % Channel list Channels = cluster_labels; %% PT vs. Color for chan=1:length(Channels) %% load 1st condition tf_data = []; data_file1 = [data_location condition_label{1} , '_tf_', Channe...
c8912b9c9bc7b2f8f84a148190a7a8b4fad7f4de5a5822933d397a540a71de71
MATLAB
4,770
143
function out=cntrd(im,mx,sz,interactive) % out=cntrd(im,mx,sz,interactive) % % PURPOSE: calculates the centroid of bright spots to sub-pixel accuracy. % Inspired by Grier & Crocker's feature for IDL, but greatly simplified and optimized % for matlab % % INPUT: % im: image to process, particle should be bright spots ...
5d83fb16e27643605cf4b5243cdcf297049895d275d40e88276e5acb8cae6182
MATLAB
4,775
158
function [d, state, num, val, nvox, coeff_v] = analyze_cluster2(clus, sourcemodel, target, sgn) % ANALYZE_CLUSTER analyzes the array of clusters clus and returns for each element % the following quantities: % d = the distances between the centre of gravity of the legs of the 6D cluster % and the target, ...
ceea3b9e9ed6b3640cb5ff5cd0dc3c9ea31a4f0ea95e0dcdb0a47c7273894d4f
MATLAB
4,778
159
function [subj] = statmap_anova(subj,data_patname,regsname,selname,new_map_patname,extra_arg) % Use the anova to select features that vary between conditions % % [SUBJ] = STATMAP_ANOVA(SUBJ,DATA_PATNAME,REGSNAME,NEW_MAP_PATNAME,EXTRA_ARG); % % Adds the following objects: % - statmap pattern object % % Updates...
4962b416512453974d404c16c021fb4d29b9221d7a8a5d20cd57d05954fcc68f
MATLAB
4,792
138
% tsss_rawdata_enm(infile,outfile,r_sphere,t_window,corr_limit,Lin,Lout,badchs) % % Perform tSSS on rawdata file 'infile' acquired with an Elekta Neuromag % 306-channel MEG system. The tSSS-processed data are written into 'outfile'. % The SSS operation is performed in the head coordinate system with the % expansion or...
9421d5410e22b6845a06a60c9344942e8db248ab04fbb572ee32ce251eacbde8
MATLAB
4,798
145
%DEMHMC1 Demonstrate Hybrid Monte Carlo sampling on mixture of two Gaussians. % % Description % The problem consists of generating data from a mixture of two % Gaussians in two dimensions using a hybrid Monte Carlo algorithm with % persistence. A mixture model is then fitted to the sample to compare % it with the true...
96f84947dc24cd19e9677e86c408feef0bd26c2d0b4486a2278f93ee25b7014a
MATLAB
4,805
167
% unwrapPhase into discrete cycles % % receives % phs vector, phases 0-2*pi % t0 center % % uphs unwrapped phases % % does % -looks for the trough (phase pi) closest to t0. defines this as the % trough of cycle0 % -goes forward through the data, define a peak as a 0-phase crossing % preceeded b...
8b250b9303a85b2683b7297af633f5b7ff06f12341fb1198259db9d97767585f
MATLAB
4,806
185
function [K1, K2] = Estimate_Number_of_Clusters_SIMLR(X, NUMC) D_Kernels = multipleK(X); distX = mean(D_Kernels,3); W = max(max(distX)) - distX; W = Network_Diffusion(W,max(ceil(size(X,1)/20),10)); [Quality] = Estimate_Number_of_Clusters_given_graph(W, NUMC); [Quality_plus] = Estimate_Number_of_Clusters_given_graph(...
3510430bc9e253131b51eac313500c4aa6357d0c5e6013c3583e95bdc264d405
MATLAB
4,808
134
% manually load file 'BCtype_augdata_aligned_33023.mat' clc; %close all; addpath('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BasicFunctions'); DistanceType = 'correlation';%'correlation''euclidean' X = Dfull; nP = size(X, 1); BCTypes = [50 51 57 58 6 7 89]; BCTypelabels = {'BC5o', 'BC5i', 'BC5t', 'XB...
f258187e902289de529602df9ed765f213328df7d543ce45e58381ec84b40dcc
MATLAB
4,808
149
classdef SoftmaxLayerClass < nnet.cnn.layer.Layer & nnet.internal.cnn.layer.Externalizable % SoftmaxLayer Softmax layer % % To create a softmax layer, use softmaxLayer. % This layer is useful for classification problems. % % SoftmaxLayer properties: % Name ...
4bb504c4178f33422f23931bd60d326540de8b163c50ad1e2d820532c1c658fb
MATLAB
4,819
123
function refreshSleep(this, actigraphy) % REFRESHSLEEP Update sleep elements from ACTIGRAPHY % % $Author: Peng Li % $Date: Feb 19, 2026 % $Modif.: Feb 20, 2026 % Facilitate lagecy plot (patches only) % Apr 16, 2026 % Added gray-out patches for intermediate partial/abno...
5f0582b9d70fb537dedfbd9ac3daddc6ba2a46747ec7823e60dee0af80bc6814
MATLAB
4,825
131
function [labels] = enforceMinDuration(labels, limits, enforceInOrder, setUndef) % enforceMinDuration Remove sleep stage bouts that are shorter than a threshold % Zeke Barger 040920 % This function replaces bouts of each sleep stage that are shorter than % some limit with the surrounding stage, assuming the l...
d84631b8a1fc419e17b278e26ca9360485bc704aebf81cbf9f7822c18fa90d33
MATLAB
4,840
119
function [results_data] = plot_cue_opp_separate_evokResp_bin_rsc_raw(cue_rsc, opp_rsc, ortho_rsc, evokResp_quad, evokResp, iWindow, iMonkey, yl, trial_type) %% Plots V4 noise corr. raw values (not MI) at cue, opp, and ortho for pairs binned based on the Geometric Mean of their evoked responses. %% windows window_nam...
7e592ebecc0a07a7a62ca9697980f49623e148d412bbd6794bc58f0d88f0ad6b
MATLAB
4,841
120
function [subj2get_11, subj2get_12, subj2get_com,... subj2get_21, subj2get_22, subj2get_com2] = getLongSubj(volThresh,gaFilt,kidoScore) serverDir = '/data/mril/users/all/mrdata/research/processed/CNMC/'; pretermDemo = readtable('/home/sdamera/Documents/DBI/fullPretermDemoSheet.csv'); pretermDemo.Project = regexprep...
08d78c33b4d5d43ae96ce359114c2b2d9220be2aa3c79b31d991ad65d95ad80a
MATLAB
4,843
167
clear all supPath = 'C:\noga\TD complex spike analysis\Data\albert\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); MaestroPath = 'C:\Users\Owner\Desktop\DATA\albert\'; req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:50...
6877f8f701dc47b2afefb76ddf403ed73d6d5f8e2144b3b79b9ee457157923f8
MATLAB
4,844
139
function [output] = ebc_feature_rater(subj, results, inum, subjnum, subfile, ... varargin) % Create EBC Feature_Rater submission file % % [OUTPUT] = EBC_FEATURE_RATER(SUBJ, RESULTS, INUM, ... % SUBJNUM, SUBFILE, VARARGIN) % % SUBJ is the subject that t...