sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5a971ada3da5bd0c8fbf7e10b9a863e03a38a2bcf85bc4923900dcf09b845e70
MATLAB
9,004
280
%% S3 Fig % Jiaxin Gao % Zhejiang University % email: jiaxin_gao@zju.edu.cn %% Experiment 1 % The code for S3 Fig A % 0.8-5 clear clc % close all fs = 100; mm = 1; load('.\FigS3_data.mat') FigA = FigS3_data.A; pp_sum0 = FigA.pp_sum0_band1; pp_sum1 = FigA.pp_sum1_band1; pp_sum2 = FigA.pp_sum2_ban...
54d82c5f84c03943bb2778436067ad32838400b620ea2fb0b2c35b8356298439
MATLAB
9,021
223
function [outputSettings,allValid] = readSettings(fname) % Read Zapit settings YAML file and return as a structure % % function settings = zapit.settings.readSettings() % % Purpose % This function parses SETTINGS/settings.yml and creates it if does not already exist. % % If no settings h...
38da21f4c5467d2c89c45d9e7a6477d5728cc89afba52d3575c9c43b5d56fce9
MATLAB
9,023
292
classdef dotNETwrapper < zapit.hardware.DAQ % Zapit NI DAQ class using the .NET wrapper for NI DAQmx % % zapit.hardware.DAQ.dotNETwrapper % % This class wraps the .NET NI DAQmx wrapper, allowing zapit.pointer to easily % set up clocked and unclocked AO scenarios as well as unclocked AI. No clock...
a3930bea5e510fc49f6d4b0980b273bad608938b04116fe378b5dcd47cc1973a
MATLAB
9,034
299
%% The code to produce Fig4 % Jiaxin Gao % Zhejiang University % email: jiaxin_gao@zju.edu.cn %% Experiment 1 clear clc close all fs = 100; load('.\Fig4_data.mat'); pp_sum0 = Fig4_Data.B.pp_sum0; pp_sum1 = Fig4_Data.B.pp_sum1; pp_sum2 = Fig4_Data.B.pp_sum2; h_sum0 = Fig4_Data.B.h_sum0; h_sum1 = Fi...
2b72a0caef5586c2254325e3579f14cb3e3d609f239c996849213b8b35d544c9
MATLAB
9,040
236
% Classifier unit test % % Classifier: lda rng(42) tol = 10e-8; mf = mfilename; % Random data nfeatures = 100; X = randn(1000, nfeatures); clabel = randi(2, size(X,1),1); %% check "scale" parameter: if scale = 1, training data should be scaled such that mean(class1)=1 and mean(class2)=-1 % Get classifier params par...
0024633a420bde86fd3863be9943c0fed33431465a58437ea1b44e5a9e6803f3
MATLAB
9,103
239
%% Description % % The following script extracts the RR intervals prior, during and after % sound omissions to identify cardiac omission responses from ECG signals % for the cardio audio experiment as described in % https://doi.org/10.1101/2022.03.03.482861 % % % % Requires modification of data paths according...
1bcd7d7bebfe818cceab7435fd6cfeaf9aa95627370ba29884bc25c9ab62283c
MATLAB
9,111
182
% T(strcmp(T.Testing_label,'chevron'),17)=array2table(1); % T(strcmp(T.Testing_label,'complex'),17)=array2table(2); % T(strcmp(T.Testing_label,'down_fm'),17)=array2table(3); % T(strcmp(T.Testing_label,'flat'),17)=array2table(4); % T(strcmp(T.Testing_label,'mult_steps'),17)=array2table(5); % T(strcmp(T.Testing_label,'no...
0b1f2c13a2611891be6c187f2c31f951c7cbf7258217b77e974f5e6a5e41a8df
MATLAB
9,127
232
function hBeanAx = beanPlot(groupData, groupLabels, colors, offsetScale, hAx, varargin) if ~exist('hAx', 'var') hBeanFig = createFullScreenFig; hBeanFig.Position(4) = hBeanFig.Position(3) / 2; hAx = gca; end switch nargin case 6 support = varargin{1}; ...
435be5dd64d9cadba1822dd7f467efc70f41a244c53471794c0fa9e0172ca54c
MATLAB
9,167
199
function val_pareto % Does the Generalised Pareto tail approximation resolve P-values below 1/n_perm? % % Counting exceedances cannot report a P-value smaller than 1/n_perm, and that % floor -- not the FWE-corrected null, which the Gamma fit already handles -- is % what forces a permutation test to run many thousands o...
9800d157ae5cad468b33ee96248ab709bb7a743a19fdd1d1579f8bbfa4943633
MATLAB
9,207
204
classdef ConfigFindROIsFLIKA_3D < ConfigFindROIsFLIKA %ConfigFindROIsFLIKA_3D - Parameters for 3D FLIKA-based ROI identification % % The ConfigFindROIsFLIKA_3D class is a configuration class that contains % the parameters necessary for two-dimensional FLIKA-based region of % interest (ROI) identification. For fur...
261987a16d34264102eba24e98fc88db7ab941dbc55d4fa4f2c32d7cefeb1c60
MATLAB
9,214
293
classdef AOandDO_Synchronized_OO < handle % Demonstration of simultaneous analog output and digital output with DAQmx .NET with a class % This shows how to start and stop the signal playback with different conditions. % For a function that is more basic and just starts up and plays signals see: % vidri...
87578f3bbb185ecb42825794beaa35e5399dd4e4e486580823894c5c2a3f3489
MATLAB
9,232
191
sbxInfo = catInfo(x); [deformCat, deform{x}, affParams, badInd] = GetDeformCat3D( catInfo(x), deformLim, 'show',true, 'overwrite',true); % [deformCat, deform{x}, affParams, badInd] = %plot(deformCat.RS_final, deformCat.CS_final, '.'); % Load ref and current results sbxInputPath = sbxInfo.path; %sbxPath{runs...
5cbcf8ea8d4b9081adb221eb16d7e393f6fba15c81e6cb83fca2157e8fab52f6
MATLAB
9,239
262
% ROT_TREE Rotate a tree. % (trees package) % % tree = rot_tree (intree, DEG, options) % -------------------------------------- % % Rotates a cell's anatomy by multiplying each point in space with a simple % 3by3 (3D) or 2x2 (2D) rotation-matrix. Rotation along principal % components is also possible. It helps to cen...
450ebb72f08eb69593b3d92948ae0136dbee3ab9e804ec96f410ccb87dbbe693
MATLAB
9,243
253
cd 'C:/Work/MatlabCode/projects/BrainMetabolismModeling/BrainMetabolismModeling' ihuman = load('C:/Work/MatlabCode/components/human-GEM/Human-GEM/model/Human-GEM.mat').ihuman; modSimp = simplifyModel(ihuman,false,false,true,true); %remove dead-end reactions %figure out which reactions that can carry flux rxns...
d0479e1fa6c28f4c267913442c8d31fae05baf1bb39aa9e380a7db10d60063a2
MATLAB
9,247
224
load('figures_3_and_5_data.mat'); % plot changes in thalamo-cortical and cortico-thalamic cross-frequency % information transfer in anesthesia, seizure, and 5-meo-dmt states % relative to norma waking baselines colors = {[145 73 1]./255, [35 253 35]./255, [255 109 182]./255}; shapes = {'*', 's','+'}; names={'Human E...
b9a632984597d87ae50ba134867e4d8ac8d76fbeb2fb62d0ba734c0b0d8eb660
MATLAB
9,250
284
function varargout = plot(self, varargin) %plot - Plot a single graph from the data object % % plot(OBJ, X, Y) plots a graph of X vs Y onto the current axis using % default values for all other options. X and Y can be either numeric % arrays, or character arrays corresponding to a valid property name in % the ...
256def3be79a948514cd0ca527f8d6f0af448e1d4fd476a3af0b8f492a4012c3
MATLAB
9,255
245
function displayID = loadDisplayParams(varargin) % load saved parameters for using a display with the VISTADISP tools. % % displayID = loadDisplayParams([property, value, ...]); % % This is a routine for loading display params on a given computer. Uses a % default directory in a default path to load files containing t...
f7bddd4bb72e8db69413c04f855f2418758eb0e451b4904a144b0c479c386c4d
MATLAB
9,255
269
classdef Test_ProcessedImg < matlab.unittest.TestCase % TEST_PROCESSEDIMG Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties (Constant) name = 'test_name'; end % =================...
dc5e28a2bcc98a5c999400a7ccedc133d43f23794ebebd92d48604875e2cc331
MATLAB
9,263
218
function [perf, result, testlabel,cfs] = mv_classify_across_time_BOB(cfg, X, clabel) % Classification across time. A classifier is trained and validate for % different time points in the dataset X. Cross-validation should be used % to get a realistic estimate of classification performance. % % Usage: % [perf, res] = mv...
be436b463763dfe2e8cf044b7dcd7eb806dd09ddf97deec1761262e28b294c36
MATLAB
9,278
194
function InspectPeriOnOff3D(expt, periBout, periStat, showVars, varargin) % Visualize deformation variables associated with locomotion bout onset/offset IP = inputParser; addRequired( IP, 'expt', @isstruct ) addRequired( IP, 'periBout', @isstruct ) addRequired( IP, 'periStat', @isstruct ) addRequired( IP, 'defVar...
f05b02c3b29700b2009d1d13367cff038d8a0e6af8f919d79c690343c98fcb83
MATLAB
9,280
242
classdef DataFindROIsFLIKA_3D < DataFindROIsFLIKA %DataFindROIsFLIKA_3D - Data from FLIKA-based ROI identification % % The DataFindROIsFLIKA_3D class contains the data generated by % CalcFindROIsFLIKA. % % DataFindROIsFLIKA_3D public properties inherited from Data: % mask - A mask combining all of the ...
22a1668f55e6f14fc0b4b6ba892d3f2ca16fe58a4ad8c37f03f4dfc1676fd071
MATLAB
9,310
379
function [ALPHA,LAMBDA,options] = KMA(labeled,unlabeled,options) % Kernel manifold alignment % % Usage : [eigenvectors,eigenvalues] = KMA(Labeled,Unlabeled,NumDomains,options) % % Inputs: % % - Labeled: structure with labeled data [1,NumDomains]. % each cell has X (dim1 x n1) and Y (n1 x 1) fields ...
4aac6020c84d28065f3986f7f6be22ade65788fb2767ad661f3aaeb1e5304c58
MATLAB
9,351
297
function model = rmSearchFit_temporal_v3(model,data, stim, params, wProcess,trainSet,t) % rmSearchFit_temporal - wrapper for 'fine' % 2020/04 KIS: added spatiotemporal %% % searchOptions = params.analysis.fmins.options; % fmin_options = optimoptions('fmincon', 'Display', 'iter', ... % 'UseParallel', false,'MaxIteratio...
571e932a008bc27a87a3db5074dce95b3d1024ffae2bc50835438874ff5d8620
MATLAB
9,355
208
classdef ConfigFindROIsFLIKA_2p5D < ConfigFindROIsFLIKA %ConfigFindROIsFLIKA_2p5D - Parameters for 2.5D FLIKA-based ROI identification % % The ConfigFindROIsFLIKA_2p5D class is a configuration class that contains % the parameters necessary for two-dimensional FLIKA-based region of % interest (ROI) identification....
8d6956cef4158799e97edf0d589de6653257391766950f34be9175764fef0068
MATLAB
9,359
316
%% Exploring NMF on the splintr data img = load3DTif_uint16('/Users/Goody/Neuro/ExSeq/exseq20170524/exseqautoframe7_3_round007_ch02SHIFT_registered.tif'); img_patch = img(101:150, 101:150,:); %% X = zeros(size(img_patch,1)*size(img_patch,2),size(img_patch,3)); for z_idx = 1:size(X,2) X(:,z_idx) = reshape(sq...
7b87f8799284fa0c9233795765461f1f3cf19a3c306adf83ec77029252391970
MATLAB
9,363
313
function model = rmSearchFit_temporal_v3_hrf(model,data, stim, params, wProcess,trainSet,t) % 2020/04 KIS: added spatiotemporal % tic warning('**************[ rmSearchFit_temporal_v3_hrf]wProcess*************') % profile on; % convert to double just in case params.analysis.X = double(params.analysis.X); params.analysi...
4ca1fd178c17d40f7a80b73c096f6eee2842b1ca7c72064ea938c8bb4a34c272
MATLAB
9,373
137
clear; clc; close all; dataDir = 'D:\2photon\Simone\'; %'D:\2photon\'; % 'C:\2photon'; dataSet = 'Macrophage'; % 'Pollen'; %'Afferents'; % 'Vasculature'; % 'Astrocyte'; % 'Anatomy'; % 'Neutrophil_Simone'; % 'NGC'; % 'Neutrophil'; % [regParam, projParam] = DefaultProcessingParams(dataSet); % get default pa...
a730b09b4141131df4b5d407b39ade3553c9c8c28751cf8796b890d21fb98e8e
MATLAB
9,421
249
function [tg, corrp] = taft_postprocess_TF_TFplot(job, dirs, sortBetas, iROI, selChans, thresh, nP, zlim, isSave) % [tg, corrp] = taft_postprocess_TF_TFplot(job, dirs, sortBetas, iROI, selChans, thresh, nP, zlim, isSave) % % For fMRI-EEG regression weights for selected ROI, % select data for given channels/ time ran...
9605393c9f247173fc09418ad23e83a02f3b1d1b26ab3ddf341f4a5863d4fc04
MATLAB
9,429
261
%========================================================================== % This script preprocesses the original macro-electrode iEEG data. % % Preprocessing includes % - selection of usable channels; % - conversion to bipolar montage (adjacent usable channels only); % - line noise removal (optional). % % References...
3dc0101d32adceab23755294f2567e44f4222a4ebd7a7447219fc993d1dc1d10
MATLAB
9,468
289
%% Fig 6 % Jiaxin Gao % Zhejiang University % email: jiaxin_gao@zju.edu.cn %% exp1 % code to produce Fig 6B clear clc close all fs = 100; load('.\Fig6_data.mat'); pp_sum0 = Fig6_Data.B.pp_sum0; pp_sum1 = Fig6_Data.B.pp_sum1; pp_sum2 = Fig6_Data.B.pp_sum2; figure tidu = setdiff(1:306,1:3:306); ...
93ef8dde7482b62aba89e6ad1e8161f84227379ef3a7c4571f9927c79d26ce4b
MATLAB
9,483
149
function neuron = t2n_implicitSpines(neuron,scaleAll,tree) % This function goes through all regions and scales the conductances (and % cm) according to the scaling information in region.spines. % Then it deletes the spines mechanism. % % INPUTS % neuron t2n neuron structure with already defined mechanism...
e257352861fc734ee0358cea507b141e3cd68654dab7d16a04788bce9d70bb03
MATLAB
9,487
325
function sff = sphirefly3d(varargin) %SPHIREFLY3D calibration-free 3D reconstruction of firefly spherical videos % % Raphael Sarfati % raphael.sarfati@aya.yale.edu % % spherifly3d(sff) % spherifly3d(cyber2world) % % % 05/2022 -v0.1 % 07/2022 -v0.9 sff = initsff(varargin); sff = sffTrack(sff); s...
bc35825ec42db1ee305d5f3ca27634342311631af392b7caaf285ae231f72e53
MATLAB
9,490
208
classdef ConfigFindROIsFLIKA_2D < ConfigFindROIsFLIKA %ConfigFindROIsFLIKA_2D - Parameters for 2D FLIKA-based ROI identification % % The ConfigFindROIsFLIKA_2D class is a configuration class that contains % the parameters necessary for two-dimensional FLIKA-based region of % interest (ROI) identification. For fur...
99ff19be5ebc48190166992f80a65bb612204f1ecedb0e43d079b7fdd0d6e0ff
MATLAB
9,509
295
% FigureS17.m % Plots for Supplementary Figure S18. % % EEG/fMRI STUDY, DONDERS INSTITUTE, NIJMEGEN. % J. Algermissen, 2018-2023. % Should work in Matlab 2018b. % we are here: % cd /project/3017042.02/Analyses/FiguresOutcomeLocked % clear all; close all; clc % Set root directory: cd(fileparts(which('figures_set_roo...
9111553daa4a53e621327f39cc9c11237e9ecb1466416bea98b0e9f2a6ff5468
MATLAB
9,519
233
%========================================================================== % This script estimates the raw and relative power spectrum of ripples. % % Lukas Kunz, 2022 %========================================================================== % start clear; clc; close all; % paths paths = []; paths.info ...
0721f3f838ee54bae74882a834166ff4e144e13fc65709c414fdc95169d920b7
MATLAB
9,568
283
%% CellScan % Analyse cellular signals %% Usage % OBJ = CellScan(NAME, RAWIMG, CONFIG, CHANNEL) %% Arguments % * |NAME| is the name for this |CellScan| object. % * |RAWIMG| is the |RawImg| object that will be used to create the % |CellScan| object. % * |CONFIG| contains the configuration parameters needed for the %...
720d24e0a9efdeebb030c9d99a5ece405788a75c4a744a0a62035ded6d7176df
MATLAB
9,596
289
% Batten, Bang, Kopell et al (2024) Dopamine and serotonin in human % substantia nigra track social context and value signals during economic % exchange % % Figure 3 % % Visualization and analysis of overall dopamine/serotonin % % Written in MATLAB 2023a % % Dan Bang danbang@cfin.au.dk & Seth R. Batten srbatten10@vt.ed...
79a620706756869886fa0e980002a279710e9c7df9a0253419b36d2e88e33ada
MATLAB
9,619
187
%% Use GLM to assess contribution of different variables onPostResult = cell(1,Nexpt); figDir = 'D:\MATLAB\LevyLab\Figures\3D\Loco\'; clearvars onPostPred onPostResp onPostResult onPostSumm rLocoPostFit = cell(1,Nexpt); for x = x3Dcsd %xPresent % GLMparallel options onPostOpts(x).show = true; onPost...
1aafb20ad32347106ba9c09199bd7a77ad039d0e383bf8a5c0fc8f3dbcad87da
MATLAB
9,644
157
function evaluate_stat(stat, pCrit) % [p] = evaluate_stat(stat, pCrit) % % Locate clusters above threshold for given p-value threshold. % % INPUTS: % stat = Fieldtrip object, output of ft_timelockstatistics or % ft_freqstatistics. % pCrit = numeric scalar, critical p-value theshold for clusters % (de...
32c55ae600fd64009c38eae6f4a2b6aa009c8a5ce2e1bc33d31ae77710cd4230
MATLAB
9,655
230
classdef LineScanVel < StreakScan %LineScanVel - Class to analyse line scan images of vessel velocities % % The LineScanVel class analyses line scan images of vessel velocities % acquired by scanning along to the vessel axis. Typically, the vessel % plasma will be labelled by a fluorescent marker, like a dextran...
404adeb838f75d9354d91b204be03b8043d911a407cc97163907fb0b09af6f68
MATLAB
9,657
244
function EEGfMRIPav_OutcomeLocked_3_visualICs(rootDir, subVec) % EEGfMRIPav_OutcomeLocked_3_visualICs(rootDir, subVec) % % Plot independent components obtained from ICA. % % INPUTS: % rootDir = string, root directory of project % subVec = vector of integers, numbers of subjects to process % % OU...
f2ab177ec40702ac032d42d4b0d5d0d287a83b3b377c82545f884ed359b0b512
MATLAB
9,661
139
function projParam = GenerateExptProjections(expt, catInfo, Tscan, varargin) % Generate downsampled, possibly z-projected, movies for each run from each requested type of concatenated data if isempty(varargin) projParam.overwrite = false; else projParam = varargin{1}; end projParam.dir = strcat(expt.dir...
a425b75eed9533d9fc4992e4b43164ee4ee2a6ce4696fc1d59232168371e0a7c
MATLAB
9,672
352
function st_prep_stimulus() %% experimental setting % stimulus radius = 9 % trial Dur = 5, blank Dur =10 % Number of Direction 4, number of steps 9 % Stimulus [4 * 9 * 5] = 180 sec % Blank (10) + Stimulus (4 * 9 * 5 = 180) + 2 Blanks (10*2)+ Blank (10) % Total duration = 220 sec => 3.6 min % load predefined shuffled se...
75b991f1e6c36785638bbf293cef700910f754a2f7b1fd92ca2e342d1d5d6806
MATLAB
9,673
253
classdef CalcFindROIsCellSort < CalcFindROIs %CalcFindROIsCellSort - Class for ICA ROI identification (2D) % % The CalcFindROIsCellSort class is a Calc class that implements a % spatio-temporal Independent Component Analysis (stICA) algorithm for % ROI identification, also known as CellSort. For further informat...
91aa4e0df7fad6ca9206cf9c6b38c2c84a482cd97158375353f68f601553fba0
MATLAB
9,678
314
%op_CSISpecReg.m % % USAGE: % [out, freqs, phases]=op_CSISpecReg(in,averagingMode,pointsPerLoop); % % DESCRIPTION: % Takes a CSI FID-A structure and applies frequency and phase drift correction. % Uses spectral registration to align the FIDS acquired from a common % k-space point. Applies the measured frequency and pha...
21580933b1a754a9ee789fe52975505fdb18f531c708ba4f0b5c3dfdf5dd900c
MATLAB
9,684
283
function couple_gui() %% Load mesh and remove unnecessary attributes [meshfile,meshpath] = uigetfile('*.msh', 'Select the mesh file output from SimNIBS simulation'); mesh = mesh_load_gmsh4([meshpath meshfile]); % Only keep the vector E-field for idx = 1:length(mesh.element_data) if strcmp(mesh.element_data{idx}.na...
0d41ba8892e84c4ad34839f08c0b10756df46c84c0f9c6ba04734e1a1de2fcc3
MATLAB
9,715
206
% This code tiles the original CZI images coverslipNumber = '87'; path_to_czi = 'C:\NeuronCzi\TF_coverslips\2019_11_22_87.czi'; imageName = '2019_11_22_87'; % create the folder for tiled neuron images and extracted individual % neurons d = sprintf('D:\\\\Neuron_analysis\\\\tiledNeurons%s',coverslipNumber); m...
a20a61a79e56b78dd71e5d26c56cf2ec98dbe818e1910657c3c7872aa6e7be9f
MATLAB
9,780
220
clear clc spm fmri FolderPath = 'G:\Functional_data'; OutputPath = 'G:\Analysis\First_level_communal_concern_parametric'; cd('G:\Batch\SPM12'); onset_SPM_reciprocity_cost_2levels_53subs NSlice = 62; refSlice = 31; TR = 2.0; SubList = dir(fullfile(FolderPath,'SEMI*')); CondList = {'Outcome_all_nomiss' 'Allocation' '...
4e921fb1d1a243b3139b4009572c21714beca4efbb2e4eb2ce8006229b95e0c3
MATLAB
9,781
220
clear clc spm fmri FolderPath = 'G:\Functional_data'; OutputPath = 'G:\Analysis\First_level_reciprocity_parametric'; cd('G:\Batch\SPM12'); onset_SPM_reciprocity_cost_2levels_53subs NSlice = 62; refSlice = 31; TR = 2.0; SubList = dir(fullfile(FolderPath,'SEMI*')); CondList = {'Outcome_all_nomiss' 'Allocation' 'info_...
74db3f352c5ebe031450bd3c655060768e1b1d43ab244e7df97c9c8d7e9cc9ac
MATLAB
9,835
286
% Batten, Bang, Kopell et al (2024) Dopamine and serotonin in human % substantia nigra track social context and value signals during economic % exchange % % Figure 4 % % Visualization and analysis of relative dopamine/serotonin % % Written in MATLAB 2023a % % Dan Bang danbang@cfin.au.dk & Seth R. Batten srbatten10@vt.e...
9d81242a13fb368fe302dcd7d96dbc658b61bba31f718e518b9c336dd8a7674f
MATLAB
9,903
184
function [stillEpoch, stillBin, stillSumm] = BinStillEpochs(expt, T, loco, fluor, deform, csdBout, varargin) % Parse inputs IP = inputParser; checkData = @(x)(isempty(x) || isstruct(x)); addRequired( IP, 'expt', @isstruct ) addRequired( IP, 'T', @iscell ) addRequired( IP, 'loco', @isstruct ) addRequired( IP, 'fl...
94829c6f67e3dcdadc8b0fe1fac208e242e1136d821b3292a86d61e6fb23445c
MATLAB
9,928
218
function [corrp, tg] = clustertf(c,thresh,nP,teststat) % [corrp, tg] = clustertf(c,thresh,nP,teststat) % % Take 4D input object (subject x regressors x frequency x time), loop over % regressors, perform one-sample t-test across subjects fore each frequency % x time grid point, do cluster-based permutation test for gr...
16110e1fa2c0126e6715c685fe92dc89bad700405ea923bf66a120aca461179e
MATLAB
9,951
211
function segParams = SegmentSbx(sbxInfo, segParams, varargin) % [zproj_interp, mask, trace_raw, trace_hp, segmentation_data, sbxPath] = IP = inputParser; addRequired( IP, 'sbxInfo', @isstruct ) addRequired( IP, 'segParams', @isstruct ) addParameter( IP, 'overwrite', false, @islogical ) parse( IP, sbxInfo, segParam...
dc6f95fb83ad08f207ebbdb9049eb78ee05745fed3f60811886371f5fd7e525e
MATLAB
9,978
264
% io_loadRFwaveform.m % Jamie Near, McGill University 2014. % % USAGE: % [RF_struct]=io_loadRFwaveform(filename,type,off_res); % % DESCRIPTION: % Initialize an RF pulse structure to contain an % RF Pulse waveform as well as its accompanying header % information. This function finds the time-bandwidth % product (tbw)...
7697c51b85bdf8d0d59169107e7aa40fc3c34ca6bb59704a4e7bf1eef1b78e09
MATLAB
10,026
264
function EEGfMRIPav_plot_behavior() % EEGfMRIPav_plot_behavior() % % Reads data by calling EEGfMRIPav_aggr_data(), then creates % 1. Line plot of p(Go) per condition over time. % 2. Bar plot of p(Go) per condition with individual subject means as scattered data points. % 3. Bar plot of RT per condition with individua...
4a54c41c88763ee8d69561d34c41ce47abef5f30d1f8cb1f0cea3afc75aff9fe
MATLAB
10,029
238
function [patterns,pattDistr,patternTrialTD,patterTCurves,trailPTC,allPattLRd,sourceIs] = assemblyDetect(sourceIs) %Detects coactive neurons (assemblies) based on Lopes Dos Santos et al., %2013, J. Neurosci. methods. Used by splitsummarizerFinal.m sessionsV = {'ham21_18-22','ham21_98-100','ham25_35-37','ham25_44-4...
26d776ad96aa408f269d6e07e5d901f991b83a840e247a7684fbee779dc313f0
MATLAB
10,032
197
function [ stimGroup, respGroup, fitResult, fitSumm, sigmFit ] = StimResponse( stim, response, varargin ) %StimResponse Nresponse = size(response,2); IP = inputParser; addRequired( IP, 'stim', @isnumeric ) addRequired( IP, 'response', @isnumeric ) addOptional( IP, 'frameDelay', 0, @isnumeric ) addOptional( IP, ...
3004f851d075305637218a824ca1c2b63451bd8180a005c5dc83b577dc851bc9
MATLAB
10,036
249
classdef CalcFindROIsFLIKA_2p5D < CalcFindROIsFLIKA %CalcFindROIsFLIKA_2p5D - Class for FLIKA-based ROI identification (2.5D) % % The CalcFindROIsFLIKA_2p5D class is a Calc class that implements the % 2.5D FLIKA algorithm for ROI identification. In the 2.5D case, ROIs are % identified in the original 3D mask gene...
5bfb2d3a6da35c21539f97548ee060da7f2cc2aedb206800a6ccb054cefc5a09
MATLAB
10,037
184
% the pattern separation toolbox: analyse spike train ensembles % Copyright (C) 2022 Alexander D Bird function [joint_distribution,delay_distribution]=joint_distribution_TE(binned_inputs,input_code,binned_outputs,binned_delayed_outputs,output_code,wordsize) n_trial_in=size(binned_inputs,1); n_trial_out=s...
69f792fc01606cc8a507bd25fa753ffcd262f0aaa36ce2a40ae97367b66599ad
MATLAB
10,043
227
clear clc spm fmri FolderPath = 'G:\Functional_data'; OutputPath = 'G:\Analysis\First_level_obligation'; cd('G:\Batch\SPM12'); onset_SPM_reciprocity_cost_3levels_53subs NSlice = 62; refSlice = 31; TR = 2.0; SubList = dir(fullfile(FolderPath,'SEMI*')); CondList = {'Outcome_possible_low' 'Outcome_possible_mid' 'Outco...
ab6cc257c72066d5aef73f5c9d60af37a08c146a1215ed423131d3c87fcb5f58
MATLAB
10,049
230
%% Fiber Photometry Epoch Averaging Example % % <html> % This example goes through fiber photometry analysis using techniques <br> % such as data smoothing, bleach detrending, and z-score analysis. <br> % The epoch averaging was done using TDTfilter. <br><br> % Author Contributions: <br> % TDT, David Root, and t...
8a719e58a86fe70b31ad4144ccc5b0e057d643c1f645cb0e2e1b7582646d1654
MATLAB
10,085
277
% 2021 EDIT: This function is now deprecated. The current version of the shaped semiLASER % simulation is run_simSemiLASERShaped_fast.m, which employs coherence selection, % instead of phase cycling, resulting in a 4x simulation speed increase. % run_simSemiLASERShaped_fast_phCyc.m % % Fast version by Muhammad G Sale...
b8a0aaec3c300da69f13fa0d73a308853ccd539e0e6766d86443d9c9a4bceb98
MATLAB
10,088
247
classdef SCIM_Tif < RawImg %SCIM_Tif - Class implementing ScanImage Tif raw image objects % % The SCIM_Tif class implements functionality related to ScanImage Tif % objects and simplifies the process of importing the image data and % metadata. % % This class relies on and includes existing code provided with th...
450726190a77cddedb5b81e485b7871c43739a8c8fe09292db414e5885678d2b
MATLAB
10,133
235
%% Fiber Photometry Epoch Averaging Example % % <html> % This example goes through fiber photometry analysis using techniques <br> % such as data smoothing, bleach detrending, and z-score analysis. <br> % The epoch averaging was done using TDTfilter. <br><br> % Author Contributions: <br> % TDT, David Root, and t...
90ab6ab3e69c7783295f290431e2e509de792f14b556645023ced25c9017b905
MATLAB
10,134
241
function [cfg, clabel, n_classes,n_metrics] = mv_check_inputs(cfg, X, clabel) % Performs some sanity checks and sets some defaults for input parameters % cfg, X, and y. % Also checks whether external toolboxes (LIBSVM and LIBLINEAR) are % available if required. if ~iscell(cfg.metric) cfg.metric = {cfg.metric}; en...
b735ffbc0db90ca992c0564b525109ef55b71262f1c3d3984355d5bb94209bdc
MATLAB
10,153
347
function st_prfRun(sessionDir,roifile,stimfile,analysisoption,prfModel,temporalModel,prefix,wSearch,userData,useGPU) % % Step 4 of the workflow for analyzing stPRF % Runs the spatiotemporal prf model % % Default Input valuesw % % KIS 2020 (adapted from code by RL & JG & DF) %% TODO: % remove: stimseq % now everythin...
8bcdb4581fccf2d23eafb9eb87dc962db43361aad694aa3bcc7f02cb3d1fe1ca
MATLAB
10,162
350
%% CompositeImg % Contain and analyse groups of images from the same RawImg %% Usage % OBJ = CompositeImg(RAWIMG, CONFIG, PROCTYPE) % OBJ = CompositeImg(NAME, ...) %% Arguments % * |RAWIMG| is the |RawImg| object array that will be used to create the % |ProcessedImg| child objects in the |CompositeImg| object. % * ...
91b894fdd7a8bd05e04cb5ea33144c04a2f7f325a7b8ac1b96c4feb5d58cef80
MATLAB
10,170
257
function [montage, cfg] = ft_nirs_prepare_ODtransformation(cfg, data) % FT_NIRS_PREPARE_ODTRANSFORMATION returns the transformation matrix from % optical densities (OD) to chromophore concentrations such as (de-) % oxygenated hemoglobin. % % Use as % [montage] = ft_prepare_ODtransformation(cfg, data) % % It is neces...
cd6c009a9592e669bda0a06bee90880017f5c3e2f12154df2ebfebd1281e3ccf
MATLAB
10,171
246
classdef (Abstract) ConfigMultiple < ConfigHelper & dynamicprops %ConfigMultiple - Superclass for multiple config container objects % % The ConfigMultiple class is an abstract superclass that is designed to % contain more than one Config object for those ProcessedImg objects that % contain more than one Calc obje...
e33f2fc2308464eb24677a2bc1e95379fa77c33ff9d02f42310f1b5fea72a919
MATLAB
10,176
388
%clear close all force warning on imSize = [733, 977]; pix2deg = 34.910; figure(1) set(gcf,'Position', [440 418 555 380]) load('a0_3_1_extractingTheMorphingDataFromAnalyze1', 'imgMorphAllSaved','imgAllSaved'); load('a0_0_bhv2trialStrct.mat'); load('a0_3_0_extractingTheMorphingDataFromAnalyze1.mat','fpMean') ...
23e44b0fa37374d7d654ca00d15ac065afda0b970998d86e9acecd85a047301a
MATLAB
10,180
237
%% In the main analysis, we computed fisher information for each neuron % assuming Poisson statistics, then summed them up because we assumed % statistical independence. In this control analysis, we test how the % results might change if the neurons has statistical dependences. This is % a supplemental script that expl...
a7e9ad8c42e2cfe17e125c4809b774e1d2901323dd7d67dfbaeb7c2fcbae631d
MATLAB
10,189
280
%========================================================================== % This script performs a unit quality assessment of the recorded units. % % Lukas Kunz, 2022 %========================================================================== % start clear; clc; close all; addpath(genpath('E:\WaveClus3\')); % Chaure...
89308a5d977a2fc767371a9226debed6852240a4dbb4fcf54a4897eaf3a5f934
MATLAB
10,199
398
p=pwd; cd ..\ load('foldersAll.mat'); cd(p); errorsCommon={}; for n=1:11; errorsCommon{n}=[]; end meanErrorsCommon=[]; perCommon=[]; for n=1:length(foldersAll); cd(foldersAll{n}); cd('decodingCommonCells'); load('error.mat'); load('meanErrors.mat'); load('perc.mat'); for m=1:...
3907d1ba8b12f684177d0784cb97dca65707934c50e14976497bb583399f1fb5
MATLAB
10,201
313
clc; clear; %% Load all paths here.. loadpath; %% Dataset path here.. S.tdtdataset = ['02_27072018_SponSleep']; % '02_27072018_SponSleep','03_14092018_SponSleep', % '04_17092018_SponSleep','06_30102018_SponSleep', % '07_01112018_S...
8eb1de693aeb1e76b53a26812963b7d71d37215cddf203ee57b6e3e35cb3f14d
MATLAB
10,206
274
function varargout = calibrationgui(varargin) % CALIBRATIONGUI MATLAB code for calibrationgui.fig % CALIBRATIONGUI, by itself, creates a new CALIBRATIONGUI or raises the existing % singleton*. % % H = CALIBRATIONGUI returns the handle to a new CALIBRATIONGUI or the handle to % the existing singleton...
28b8b073d5085bd791a39bc91d45442bada9299adf155bcba1506799d3b86388
MATLAB
10,214
235
function [perf,result] = mv_searchlight(cfg, X, clabel) % Classification using a feature searchlight approach can highlight which % feature(s) are informative. To this end, classification is performed on % each feature separately. However, neighbouring features can enter the % classification together when a matrix of...
a49bfdecb5b6711fb29d218d39b4744a7bc7c0c42df1f72d54c781bb140a6bf8
MATLAB
10,234
205
%% Use GLM to assess contribution of different variables onPreResult = cell(1,Nexpt); figDir = 'D:\MATLAB\LevyLab\Figures\3D\Loco\'; clearvars onPrePred onPreResp onPreResult onPreSumm rLocoPreFit = cell(1,Nexpt); for x = x3Dcsd % GLMparallel options onPreOpts(x).show = true; onPreOpts(x).rShow = []...
3097b41fd8b406fafea06a5861586180694c2eabe2ef6efa89105ccff1466f5d
MATLAB
10,302
243
classdef ConfigVelocityLSPIV < Config %ConfigVelocityLSPIV - Parameters for LSPIV-based velocity calculation % % The ConfigVelocityLSPIV class is a configuration class that contains % the parameters necessary for calculating velocity based on the % Line-Scanning Particle Image Velocimetry (LS-PIV) algorithm. For ...
34c3e326c2e56456fd448c2687cfddd6db56e964bab9035ae84aeeed514da15b
MATLAB
10,335
292
classdef ImgGroup < Processable %ImgGroup - Class to contain groups of processable objects % % The ImgGroup class implements most functionality related to groups of % Processable objects. % % Please see the <a href="matlab:web(fullfile(utils.CHIPS_rootdir, 'doc', 'html', 'ig_ImgGroup.html'))">ImgGroup quick start...
4e02f3b4d5f3039a09186e80b5d4e6f05ef62bdf76764974bc4b5b6801128769
MATLAB
10,340
386
ID='Gi17547' inputname=strcat('SortedData_', ID, '.mat'); load(inputname) disp('===LTA MSD excitatory response during stance==='); temp0=[]; temp1=[]; temp3=[]; temp7=[]; for i=1:length(STANCE_LEFT.EXC(:,1)) if STANCE_LEFT.EXC(i,1)==0 temp0=cat(1,temp0, STANCE_LEFT.EXC(i,6)); elseif STA...
c7f1583d4ce367394e7e4a15503202fcd610321cae58cc7922705d33b230570b
MATLAB
10,367
393
% PP_GENERATOR_TREE Distributes points with given R value. % (trees package) % % [P, numIt, Rvalues] = PP_generator_tree ( ... % N, R, a, alpha, n_mc, level, epsilon, options) % ------------------------------------------------------------- % % Distributes N random points in a 200 x 200 um2 square or in a % 200 x 20...
b5477af3f618a69b05917bc0449fce3cf13a07cb1167bf897a96911e0758c2e4
MATLAB
10,369
261
%% This script analyzes (plots FI distribution and RF centers for) the FI distributions % from each of the cortical areas. We run the basic calculation for Gaussian, Poisson, and Gaussian variable % noise with no correlations clear all; close all; % Set the random seed to a specific value so that bootstrapping result...
a2efb1edb69230b560f79fe664901b0d69b5c6add7510ad9f1c786168f0d8746
MATLAB
10,384
423
%========================================================================== % This script recreates the main figures of the paper "Ripple-locked % coactivity of stimulus-specific neurons and human associative memory". % % Lukas Kunz, 2023. %========================================================================== % s...
b82da53f751e642e3d93a0492149a408c65305e0ace157e1394aded784952166
MATLAB
10,447
282
% run_simSemiLASERShaped_fast.m % Dana Goerzen and Jamie Near, McGill University 2021. % Fast version by Muhammad G Saleh (Johns Hopkins University School of Medicine, 2019) % USAGE: % out=run_simSemiLaserShaped_fast(spinSys); % % DESCRIPTION: % This script simulates a PRESS experiment with fully shaped refocusing %...
022a5cc092df6c6196d24b568d684db7f9681dc53e1a3daf9b6275f1314bd1ba
MATLAB
10,488
257
classdef BioFormats < RawImg %BioFormats - Class implementing BioFormats raw image objects % % The BioFormats class implements functionality related to the % Bio-Formats Java library and simplifies the process of importing the % image data and metadata. This class requires prior installation of the % Bio-Format...
0f0dc60f9a29d5d2755fa98c73b084baab936d4136c05812c04328391879166e
MATLAB
10,502
294
% run_pressproc.m % Jamie Near, McGill University 2014. % % USAGE: % [out,out_w,out_noproc,out_w_noproc]=run_pressproc(filestring,aaDomain,tmaxin,iterin); % % DESCRIPTION: % Processing script for Siemens PRESS MRS data in .dat format (twix raw data). % Includes combination of reciever channels, removal of bad avera...
a207da026cee3cb065b81462d212282e9184ff0b7c26ec91fe314f7e82aa417c
MATLAB
10,517
248
function varargout = myshadow_v16(x,f,active,varargin) % MYSHADOW_V15 Draws a shadow around a curve % MYSHADOW_V15(X,Y,1) draws a shadow below the curve represented by vectors % X and Y. The 3rd argument activates (==1) or deactivates (==0) drawing of the % shadow. % MYSHADOW_V15(...,Name,Value) creates the sha...
7f34efbcced488a340b481aa3dbea19aac6ea93526f22929ce09dd388d7f8637
MATLAB
10,573
224
function cordata = subtract_ERP(cordata, ERPdata, corselTrials, ERPselTrials, mode, subtractTime, ERPdur) % cordata = subtract_ERP(cordata, ERPdata, corselTrials, ERPselTrials,mode, subtractTime, ERPdur) % % Computes the mean ERP given input data ERPdata for selected trials % ERPselTrials, correct input data cordata ...
de4ad3412dede0da64cf5f4b8f8ca92c83e1cf0e6740a3f1d2d5466c8524de3d
MATLAB
10,586
282
function info = convert_open_ephys_to_kwik(varargin) % % Converts Open Ephys data to KWIK format % % by Josh Siegle, November 2013 % % info = convert_open_ephys_to_kwik(input_directory, output_directory) % % input_directory: folder with Open Ephys data % output_directory (optional): folder to save the KWIK files %...
e84aa62fd92564a9a8df7b6a34fbcbd6071df5b472cf4a4c2036a40101f80a0b
MATLAB
10,586
267
function model = stGridSolve(params,data,prediction,trends,ntrends,dcid,slice,nSlices) % remove trends from data so they do not count in the percent variance % explained calculation later. data(isnan(data)) = 0; data = single(data); % % % detrending trendBetas = pinv(trends)*data; % nChan = size(prediction,3); nChan...
c87a84620c1f83afab7dad6ac28c0796cd4beef097d4b68344636787d7255c7b
MATLAB
10,604
331
function [fn,saveName] = st_compareMethods(DT, params,roiList,targetModel,targetVar) %% if targetModel == 2 tms = {'\tau_1', '\itw', '\tau_2', '\itn_D_N', '\sigma_D_N'}; nParam = 5; elseif targetModel == 3 tms = {'\tau', '\tau'}; nParam = 1; end if notDefined('targetVar') targetVar = 'temporal'; en...
d9fb28c174265c2749a57d1c00af72950f2675a45d19fbe71e249335b9fa3374
MATLAB
10,607
178
%% tuningDataPath = 'D:\MATLAB\Dura\tuningAnalysis_corrected.mat'; % _220404 if exist(tuningDataPath, 'file') fprintf('\nLoading %s', tuningDataPath); load(tuningDataPath); else dTheta = pi/6; dPct = 5; testPct = [60,95]; Nboot = 500; minNorm = 0.5; maxWidth = 60; scalePC = cell(1,Nexpt); PCan...
485a5d1b1a1eee0af0bd102320cadbbacffcf500c409cfef0420b4e12143b423
MATLAB
10,698
323
% EEGfMRIPav_cbm_fit.m % This is an interactive script---execute it step-by-step. % It fits a series of computational reinforcement learning models using the % CBM toolbox and evaluates them. % % EXPLANATION OF SETTINGS: % dirs.root = string, root directory of project. % % OUTPUTS: % no outputs, just plo...
1629f31b92e7ee7d976db9c226bb573daa4dc620defd37e4fa91ff62eb58cfdb
MATLAB
10,703
260
classdef CalcVelocityRadon < CalcVelocityStreaks %CalcVelocityRadon - Class for calculating velocity via the Radon transform % % The CalcVelocityRadon class is Calc class that implements all basic % functionality related to calculating the velocity of images using the % Radon transform algorithm. For more informa...
509d23857a2cc56f3b61af9a2a972873fc61d458ce7db2ace75c45add9f705fc
MATLAB
10,706
245
classdef AOandAI_OO_sharedClock < handle % Demonstration of simultaneous analog input and output with a shared clock with the dabs.ni.daqmx wrapper % % vidrio.mixed.AOandAI_OO_sharedClock % % % Description: % This example demonstrates how to use a class to continuously run data acquisitio...
2729727d26b65bd4800209f80ece604a60caeb8f7fd754ee56967f83ffcc58c4
MATLAB
10,718
225
%%%%%%%%%%%%%%%%%%%% %TC0001 - addPenaltiesToModel %%%%%%%%%%%%%%%%%%%% cd 'C:/Work/MatlabCode/projects/BrainMetabolismModeling/BrainMetabolismModeling' ecModel = load('data/MinModel.mat').minModel; %Check that there is no penalty in the no penalty case m = addPenaltiesToModel(ecModel, 1, 1, 1, 1, 1, true); all(m.S(st...
f056adce7d088f03d9506bc0b8271bf1488a74cac39df06051102364fe202f5e
MATLAB
10,736
276
function t2n_plotChannel(neuron,mcondChannel,region,outputFolder,options) % This function plots the activation and inactivation dynamics of an voltage- % dependent ion channel. The fits on the activation and inactivation time are % mono-exponential, hence they should be handled with care in cases the % channel has mor...
277aa2f266d3ae2a6d4016311cb27dc0f1341072280dd7619ee4f9a222402139
MATLAB
10,742
302
% HULL_TREE Isosurface/line at given distance from tree. % (trees package) % % [c, M, HP] = hull_tree (intree, thr, bx, by, bz, options) % --------------------------------------------------------- % % Calculates a space-filling 3D isosurface around the tree with a threshold % distance of thr [in um]. In order to do t...
a85e0b35b3e89bdfbb81149b0a857de06d5a42a436baa189d5efb34499054d74
MATLAB
10,766
278
function ElectodesClassificationMatlabFuncAvgBoutInTest(unifyContextClasses ,... NumTrees,TakeJustTheta,TakeJustGamma,matlabImpute,imputeIters, substractMouseMean, usedMouseId,LeaveOut,balanceClasses) %LeaveOut can be simuli (of a single session) or session rng(0) paramsStr = ['Ntree',num2str(NumTrees),'_Unif...
856b9e98c84ee35501971e94c74dd21ada095abd8f5e4bdb9c1cf49c87bf547a
MATLAB
10,804
418
function st_simulation_plot(gt,pt) % gt: ground-truth table % pt: predicted table (model estimated) mycolor = getmycolors(1); tmp = []; tmp.tmodel = pt.DT.tmodel; tmp.testData = cell2mat(pt.DT.testData); tmp.testPred = cell2mat(pt.DT.testPred); tmp = struct2table(tmp); params = []; % Check model naming conventio...