sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fe3840bfaeef3af6dea963228190efe9515d2c70bd0b6e2b5bc9ef7891f39307
MATLAB
7,687
184
%========================================================================== % This script identifies the trial halves that lead to the largest % difference in memory performance between the early and the late data % half. % % Lukas Kunz, 2022 %========================================================================== ...
8a66ba2d84b9936411278ef99fc97be840253cd17ed2c467a98b74be19c5dc00
MATLAB
7,703
165
% clear all % working_folder = 'Z:\test' ; % prefix = 'AJ_AJ'; % cd(working_folder) % raiz = pwd; % list = dir; % isdir = [list.isdir].'; % list_dir = list(isdir,:); list_dir(1:2)=[]; % Converting labels to number (easier to handle in Diff maps) T_classProb_orig = T_classProb; T_classProb(strcmp(T_classProb.DL_out,'noi...
bfea2a6c92365ace905ed11268573c91ce6a316b48bb5d7252b63360614e5490
MATLAB
7,708
252
clear;clc; close all %% Figure 5a colors={[51 103 161],[150 68 71]};legend_name={'Low-Depth','High-Depth'}; frequency=[8 24 40]; condition=2; count1=1; RefreshRate=240; displayTime=1; while(count1 <= RefreshRate*displayTime) for fre=1:length(frequency) freq=frequency(fre) alti(1,fre,coun...
7b42e466d47120c9450bf4fa544365a19be94b4d1d0e43a7034ed5aa240cb37b
MATLAB
7,710
138
% Help for file Mat2NlxTT % Version 4.1.1 % % Purpsose % The purpose of this program is to take extracted Neuralynx data from the matlab environment and create the appropriate Neuralynx file. % % Composition % This program is a matlab mex file compilation of matlab and C++ source code. % C++ source code is use...
8dfbce5e9fd779d9748101f980e1eb15686d43c2bfb6a1f19c162ed87c2fe96e
MATLAB
7,715
149
load('dualstate_freqPowerPart.mat') n_theta = 5:6; Fs=2000; ripple_tmp_rate_ecd = squeeze(group_level_stat_input.tmp_re_ecd(1,:,:)) ; ripple_tmp_rate_ecd=ripple_tmp_rate_ecd(1:2*Fs,:); avg_theta_power = squeeze(mean(TFR_theta(n_theta,:,1:7),[1],'omitnan') ); avg_theta_power = avg_theta_power(Fs+1:(3*Fs),:) ; ...
ee301373188996fc1375647105feae5a4bbf6b058726b04aee59e06595791219
MATLAB
7,734
198
function out = LK_3DPermutationTest_TwoConnectedSamples_20220901(dat) % % LK_3DPermutationTest_TwoConnectedSamples_20220901 performs cluster-based % permutation testing between two connected 3D datasets (e.g., time x % frequency x channels). % % Note that the statistics are calculated across the third dimension of the ...
3902745a98210b59a72f183c69bc5b91cbb1f06939ff2d40d0ea523681f8d00f
MATLAB
7,737
148
loadParameters; filename_centroids = fullfile(params.punctaSubvolumeDir,sprintf('%s_centroids+pixels.mat',params.FILE_BASENAME)); load(filename_centroids,'puncta_centroids','puncta_voxels') %% Collect the subvolumes we started this with, but now only with the pixels from the puncta! num_insitu_transcripts = size(punc...
86ff79f5ec952f76c52e14a826b7428cbe0db3f1ff9179c2c86ee8a9222cb9e9
MATLAB
7,737
255
% io_CSIload_GErosette.m % Jamie Near, Sunnybrook 2023. % Louis Lauzon, University of Calgary 2023. % % USAGE: % out = io_CSIload_GErosette('filename'); % % DESCRIPTION: % Reads in a GE Rosette MRSI dataset using the GELoad.m function. % % As input, this script accepts both .h5 files (for with GE systems with % Ver...
59c4a7bc66e325f86abf09d7a680a87890dc0f4ccc8da0affa8b4df36ccf31a9
MATLAB
7,741
166
% clear all % working_folder = 'Z:\test' ; % prefix = 'AJ_AJ'; % cd(working_folder) % raiz = pwd; % list = dir; % isdir = [list.isdir].'; % list_dir = list(isdir,:); list_dir(1:2)=[]; % Converting labels to number (easier to handle in Diff maps) T_classProb_orig = T_classProb; T_classProb(strcmp(T_classProb.DL_out,'noi...
3c479b50e0d9d020be902b05aff5918680cef5d6e978646ee8c7d8fb419f21e6
MATLAB
7,744
187
%Converts electrophisiology data to excel file. %Params: % baseDir - a directory which contains sub directories named: ESP data, % SP data, SxP data. each of them contains mat files with names: % CoherencePerBoutForFileNum??.mat where ?? stands for the session % number(must be two digits). each...
6f25bb77907ef2f00099391700788da8bb3ab6a6148e20e10d47b3897c23809c
MATLAB
7,775
300
load("ChR2_6P7G-5CM2MS-PS.mat"); poor=[1 4 6 7 10 11 14 16];%28, 34, 37, 38, 35, 33, 45, 44 poorChR2=CHR2(poor); C=CHR2(poor); C1=cell2mat(C);% all mice together M=nanmean(C1,1); S=nansem(C1,1); figure, subplot(2,6,1) %per sample CS bar([1:1:3],M(1:3),'FaceColor','w'); hold on errorbar([1:1:3],M(1:3),S(1:3...
e5eeda618611eb130b9572aadf3649d069c36b56f44b0d71c4d910430c8d30d3
MATLAB
7,786
194
function varargout = plot(self, varargin) %plot - Plot a figure % % plot(OBJ) plots the default figure for each element of OBJ. % % plot(OBJ, H_FIG, FIG_NAME) plots the figure on the specified figure % handle(s) H_FIG, and the particular figure specified by FIG_NAME. % FIG_NAME must be one of the following: % %...
859bddae561d4784ec9d649a712894e3d7b25de0f49941ad8d10f3b0c97dbd0f
MATLAB
7,794
261
function varargout = plot_ICAtraces(self, objPI, hAx, varargin) % CellsortICAplot(mode, ica_filters, ica_sig, f0, tlims, dt, ratebin, % plottype, ICuse, spt, spc) % % Display the results of ICA analysis in the form of paired spatial filters % and signal time courses. This function implements only fract...
2d170e7b61289a1683292e57747f8e8aa015e9e1b29b758b9bcb2b546b1f8028
MATLAB
7,797
191
%========================================================================== % This script illustrates the procedure for identifying ripples in the % macro LFP data. % % Lukas Kunz, 2022 %========================================================================== % start clear; close all; clc; addpath(genpath('E:\OpenFi...
6e89cbc89f23b5925b76a1c44762399589bc5163eee5bcef56f92923e1b86507
MATLAB
7,802
125
%% Use GLM to assess contribution of different variables locoDeform_pred = cell(1,Nexpt); locoDeform_resp = cell(1,Nexpt); locoDeform_opts = cell(1,Nexpt); locoDeform_result = cell(1,Nexpt); locoDeform_summary = cell(1,Nexpt); figDir = 'D:\MATLAB\LevyLab\Figures\3D\GLM\'; mkdir( figDir ) %rLocoPreFit = cell(1,Nexpt)...
625d16365d4f11006db13b87cbcc33d9f70e73a932f7b1fc059ad105cbd33069
MATLAB
7,814
209
% EEGfMRIPav_OutcomeLocked_9_TF_grouplevel_plot % This is an interactive script---execute it step-by-step. % Set the appropriate job settings for loading TF data aggregated across % subjects, then create plots. % - two-line plot contrasting two conditions of cotnrast % - multi-line plot contrasting all conditions with...
83be8cc88f8bec565fe76ad14d8f86d517c90f4cf051a86099225cb3bcab9d36
MATLAB
7,822
190
%% % Analyzes the experimental data to produce cellTable, which has the core % statistics we are interested in (e.g., dF/F, OSI) % % This code accompanies the paper: % IA Oldenburg, WD Hendricks, G Handy, K Shamardani, HA Bounds, B Doiron, % H Adesnik. The logic of recurrent circuits in the primary visual % cor...
13d5c6b81fe61665991407e08d41a9ca579666776b514c1a44be90d1453f2b6d
MATLAB
7,823
217
% EEGfMRIPav_sliceDisplay_run.m % Directories: dirs = []; dirs.root = '/project/3017042.02'; % root directory--needs to be adapted to users' folder structure addpath(fullfile(dirs.root, 'Analyses/fMRI_Scripts/Display_Results')); % ----------------------------------------------------------------------- % %...
a44452b0324cbfa154de638c48234138f0a6f94ff1cdc423e6e0c454c51e84bb
MATLAB
7,838
192
% FigureS12.m % Create source data files for Supplementary Figure S12. % Plots were created as screenshots from FSLeyes. % % 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; clos...
bc061ab1edf1ca6f3e10c69fc48d8807014bc018737bcbd840fcb5a88bb71471
MATLAB
7,842
158
function hardwareContinuousVoltageNoRegen % Example showing hardware-timed continuous analog output without regeneration using the Vidrio dabs.ni.daqmx wrapper % % function vidrio.AO.hardwareContinuousVoltageNoRegen % % Purpose % Demonstrates how to do hardware-timed continuous analog output usi...
1bf942777ded0f5d539e6ac1f2678fde2d4e5528a595654dd0b2a3304d2df94b
MATLAB
7,854
228
%% Pipeline for processing fMRI phase and magnitude data for QSM using the QSM toolbox % % fMRI presents the possibility of saving phase data, which can be used for % QSM or as input to other phase-sensitive MR imaging pipelines % 29 Nov 2022 % Editors (alphabetical order): % Alexander Jaffray: ajaffray@physics.ubc.ca...
72efdc0515871fb7cf11450322a3451a34aa2e467a399e43bf10ba3265847fbf
MATLAB
7,857
162
function segmentation_data = MakeMask3D(sbxPath, sbxInfo, mask, trace_hp, trace_raw, segParams, zProj, varargin) IP = inputParser; addRequired( IP, 'sbxPath', @ischar ) % path to the .sbx+ file to be projected addRequired( IP, 'sbxInfo', @isstruct ) % @isstruct addRequired( IP, 'mask', @iscell ) addRequired( IP, '...
22a9beae200b17f303f5d73636c4d42e2abfaf02f04050e6a70703a76f85ae17
MATLAB
7,864
229
function h=subaxis(varargin) %SUBAXIS Create axes in tiled positions. (just like subplot) % Usage: % h=subaxis(rows,cols,cellno[,settings]) % h=subaxis(rows,cols,cellx,celly[,settings]) % h=subaxis(rows,cols,cellx,celly,spanx,spany[,settings]) % % SETTINGS: Spacing,SpacingHoriz,SpacingVert % ...
66582a5b6ce1f07a0cc11d1054ab6436f3831128c7e2b65eac790cec28927256
MATLAB
7,890
321
clear all; close all; %% Figure 1 %% 1A (bottom) fig1A = figure; fig1A.Position = [100 100 650 600]; hold on; x = linspace(-2,2,100); tcMus = linspace(-1.65,1.65,5); sig = 0.4; % Plot 5 example Gaussian tuning functions for ii = 1:5 tcTint = [1 1 1]*0.75*(ii-1)/5; tc = normpdf(x,tcMus(ii),sig); ...
f3e3cf25418d1de5599b545e0d5e1688ef092569fe6a20dd353f0041404ece40
MATLAB
7,890
202
classdef DataFindROIsFLIKA_2p5D < DataFindROIsFLIKA %DataFindROIsFLIKA - Data from FLIKA-based ROI identification % % The DataFindROIsFLIKA class contains the data generated by % CalcFindROIsFLIKA. % % DataFindROIsFLIKA_2p5D public properties inherited from Data: % mask - A mask combining all of the ot...
811eec8d8ff891701e7de355b3934ac0f0a57fff35d03173bc831742bc7431a5
MATLAB
7,892
187
%========================================================================== % This script aligns macrodata triggers and microwire triggers to get the % spike times in macrotime. % % Lukas Kunz, 2021 %========================================================================== % start clear; clc; close all; % paths path...
af1ab0abf4e671e933e37d9478e7715ecdda6e53f37bed4d47ea52375e1017b9
MATLAB
7,946
250
function AOandDO_Synchronized % Demonstration of simultaneous analog output and digital output with DAQmx .NET % % function vidrio.mixed.AOandDO_Synchronized % % Description: % This example demonstrates how to continuously run analog signal generation (AO) % and hardware-timed digital signal generation (DO) at th...
73848f1f1582e9b85d2dc9b0ddd0030833c087c2a2e2b5c85695a553d1a6b08e
MATLAB
7,962
247
function [estMI_obj] = estimate_MI(input,output,options,max_time) %ESTIMATE_RR Estimates the mutual information between the input and output ensembles. if nargin<3 || isempty(options) options='-par'; end if contains(options,'-par') % Establish number of estimates to use in each step p=gcp(); num_...
cb62f160261b8ca116d51f964688383dd33b0bee2d6ff33691ca47af32c80c3c
MATLAB
7,970
181
function params = AlignPlanes(sbxInputPath, sbxInfo, params, varargin) % Use TurboReg to affine register each plane of a volume scan movie IP = inputParser; addRequired( IP, 'sbxPath', @ischar ) addRequired( IP, 'sbxInfo', @isstruct ) addRequired( IP, 'params', @isstruct ) addOptional( IP, 'refVol', [], @isnumeri...
fc2a3cc9e606499c8cb158b2f3719534f67d6246c88c9f6d9a3666cfc1a71338
MATLAB
7,980
204
classdef CalcFindROIsFLIKA_2D < CalcFindROIsFLIKA %CalcFindROIsFLIKA_2D - Class for FLIKA-based ROI identification (2D) % % The CalcFindROIsFLIKA_2D class is a Calc class that implements the 2D % FLIKA algorithm for ROI identification. In the 2D case, the original 3D % mask generated by FLIKA is collapsed to 2D u...
99f15aaf3e302c1285e7bdc05c7196e8ca8f7701a3037ec902d74ee8cbbe5189
MATLAB
8,004
120
%% Fit a master HMM using all available data trainMouse = 'DL89'; xMouse = strcmpi(expt.mouse, trainMouse) [transEst, emitEst, speedDiscreteExpt] = TrainLocoHMM(loco, 'dir',sprintf('%s%s', mainDir, ); %% Find locomotive and CSD bouts sigThresh = 0.01; boutSumm = repmat( struct('totBout',NaN), 1, Nexpt ); onStru...
91a5056725bf24190540721f74aa6f69b9a5d15c181df8e658d94878828398fb
MATLAB
8,025
224
function add(self, varargin) %add - Add children to the object % % add(OBJ) prompts for all required information to load/create RawImg % objects, create Processable objects, and add them to the ImgGroup % object OBJ. % % add(OBJ, RAWIMG, CONFIG, PROCTYPE) creates Processable objects of the % type specified by...
7ec8b24a547686bb4101c85150d16c420e0c0c5744962f5efadf0c05ec4c93f1
MATLAB
8,053
197
% EEGfMRIPav_cbm_prepareData.m % % Execute this script to prepare the behavioral data for an appropriate format for the CBM toolbox. % Mind adjusting the root directory. % % INPUTS: % none. % % OUTPUTS: % Saves all data as EEGfMRIPav_cbm_inputData.mat to indicated directory. % % EEG/fMRI STUDY, DONDERS INSTITUTE, NIJM...
1545463459304de1aaa7ad5f37083a345ee08a4f4c5128cbefd6ea81d62f764e
MATLAB
8,055
183
function [projData, binLims, projPaths] = WriteSbxZproj(sbxPath, sbxInfo, varargin) % projPath, firstScan, Nscan, pmt, checkInfo = @(x)(isstruct(x) || isempty(x)); IP = inputParser; addRequired( IP, 'sbxPath', @ischar ) % path to the .sbx+ file to be projected addRequired( IP, 'sbxInfo', checkInfo ) % @isstruct ...
361d6d44f5ace77d30489db6f0df5de5e8eaf52c29f9bebae67fe2a3127be738
MATLAB
8,104
209
classdef DateTime Copyright (c) 2011 This program is a result of a joined cooperation of Energocentrum PLUS, s.r.o. and Czech Technical University (CTU) in Prague. The program is maintained by Energocentrum PLUS, s.r.o. and licensed under the terms of MIT license. Full text of t...
681e820936c7aa3c32a62cc9f47b69f65c34530fa12a851b3fde664225125238
MATLAB
8,111
207
%========================================================================== % This script: % - computes an average MRI scan from all subject-specific MRIs. % - creates a probability map of channels from a specific region. % - creates Pylocator marker files to display the elctrode positions of % select electrodes in P...
523730b50dcd24ab05d7d6bf023e073582d118d950426bf45070f4c06f86cac4
MATLAB
8,115
252
% op_addrcvrs.m % Jamie Near, McGill University 2014. % % USAGE: % [out,fids_presum,specs_presum,coilcombos]=op_addrcvrs(in,point,mode,coilcombos); % % DESCRIPTION: % Perform weighted coil recombination for MRS data acquired with a reciever % coil array. % % INPUTS: % in = input spectrum in matlab structu...
b2bdcb20c65360073fff6aaa45c4d8e0e6087d0d82e647849733f39b85b39e90
MATLAB
8,119
242
function varargout = unmix_chs(self, useParallel, varargin) %unmix_chs - Unmix image channels % % unmix_chs(OBJ) interactively unmixes image channels in OBJ using the % utility function with the default method. % % unmix_chs(OBJ, USEPARALLEL) explicitly specifies whether to unmix the % RawImg object in parallel...
b442863a5d1e0b886c472b1695a156d544848479b3a2b45409465ffa81491c6c
MATLAB
8,119
308
load("ChR2_6P7G-5cm2ms-PS.mat"); good=[2 3 5 8 9 12 13 15];%29, 33, 35, 39, 34, 46, 47, 45 goodChR2=CHR2(good); C=CHR2(good); C1=cell2mat(C);% all mice together M=nanmean(C1,1); S=nansem(C1,1); figure, subplot(2,6,1) %per sample CS bar([1:1:3],M(1:3),'FaceColor','w'); hold on errorbar([1:1:3],M(1:3),S(1:3)...
101c941b5cdeef6a3484702ee348eeff8b34241c218ac266e1cc34d51238ea55
MATLAB
8,136
195
function [data, timestamps, info] = load_open_ephys_data_faster(filename, varargin) % % [data, timestamps, info] = load_open_ephys_data(filename, [outputFormat]) % % Loads continuous, event, or spike data files into MATLAB. % % Inputs: % % filename: path to file % outputFormat: (optional) If omitted, contin...
04b22e6cfda4f40ababb785752ca1866780eff0958e852d88ef638757a8754eb
MATLAB
8,147
210
function EEGfMRIPav_plot_pstay(datatype) % EEGfMRIPav_plot_pstay() % % Reads data by calling EEGfMRIPav_aggr_data(), then creates bar plot of % p(Stay) as function of condition specified under datatype input. % % Mind setting root directory and target directory for saving. % % INPUT: % datatype = string, ei...
e0e4527fed062978edcde3531c6dc4ec74900c3512cd75b7911194da4e32b603
MATLAB
8,155
182
function val_sequential % Does sequential stopping reach the same answer as running every permutation? % % Instead of always running n_perm permutations, the loop stops once the observed % GLOBAL maximum has been exceeded n_exceed_stop times by the permutation maxima % (Besag & Clifford, 1991; the negative binomial met...
22b5ddbd6d577174028dc512ab53015f14f9c12cab1331ddc3f423f85db2360f
MATLAB
8,159
232
function self = find_ROIs(self, objPI) %find_ROIs - Identify regions of interest % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 Softwa...
e180001ef887a80314f3af29db357d8114df40b27be1492429dcc3afca3ef6a9
MATLAB
8,160
156
function f = LK_PlotRipplesMacroAnalysisIllustration_20231030(dt) % % LK_PlotRipplesMacroAnalysisIllustration_20231030 plots an illustration of % the ripple detection in macro LFP (iEEG) data. % % Input is a structure with multiple fields. % % Output is a figure handle. % % Lukas Kunz, 2023 % spike colors spikeColors ...
be93556128c32001e6663e81cf9f6db79b0b6bc009fb5cabcd54f0aaec1cbc41
MATLAB
8,171
195
function [skelInt1 skelIntTubulin] = extractSkelInt(data,imgMarker1,imgMarkerTubulin) label = data(:,1)'; type = data(:,2)'; data_xyz = data(:,3:5); radius = data(:,6)'; connct = data(:,7)'; dim = length(label); D= ones(dim,1); normVecList = zeros(dim,3,3); % normalized direction vector list. Dimension1: label;...
bf650c2b036881ca88ab1cb4deaf205a972db060da5570cd057bfcfed534b44e
MATLAB
8,176
204
function twoLinePlot(job, data, errorbar, within) % twoLinePlot(job, data, errorbar, within) % % Creates lineplot for two conditions specified as contrast in job. % Works for both ERP and TFR data. % % INPUTS: % job = cell with relevant fields for plotting settings, % required fields: % .validSubs...
b0e1c184dd769ff19d8cc3849758956e117b18746c6955b9ab1798cf7053fd0d
MATLAB
8,187
228
% SKEL_STACK Skeletonize a 3D image matrix. % (trees package) % % [i1 i2 i3] = skel_stack (iM, thr, options) % ------------------------------------------ % % Inspired by algorithms described by Palagyi and Kuba. Nice piece of % code, hopefully correctly interpreted from their papers. It involves % numerous permutatio...
8a51a3d7d067a573d96d12650808cd49c4ab48162382f3430385df7848aeb1b4
MATLAB
8,203
202
classdef CalcVelocityLSPIV < CalcVelocityStreaks %CalcVelocityLSPIV - Class for calculating velocity using LSPIV % % The CalcVelocityLSPIV class is Calc class that implements all basic % functionality related to calculating the velocity of images using the % line scanning particle imaging velocimetry (LSPIV) algo...
b58f6639b6fe0b2f4683613ae62fe00e32951a609b37696f9cf2084218010ad7
MATLAB
8,266
252
% SHOLL_TREE Real sholl analysis. % (trees package) % % [s, dd, sd, XP, YP, ZP, iD] = sholl_tree (intree, dd, options) % -------------------------------------------------------------- % % Calculates a sholl analysis counting the number of intersections of the % tree with concentric circles of increasing diameters. Di...
22b35b6bab09016263212b1157a0b6ba45d7123f68556a275507e93d72bbcf03
MATLAB
8,281
218
function ElectodesClassificationMatlabFunc(unifyContextClasses ,averageAllBoutsFromSession ,... NumTrees,TakeJustTheta,TakeJustGamma,matlabImpute,imputeIters, substractMouseMean, usedMouseId) rng(0) paramsStr = ['Ntree',num2str(NumTrees),'_Unify',num2str(unifyContextClasses),'_JustT',num2str(TakeJustTheta),'_J...
42cab5c87d56913269663c7abe07c4747c3620a05bb0aa5aa6dc0de023dad7ba
MATLAB
8,284
254
% read in captured PSFs at a single depth % Calibration should be done in 'S' shape % the point position moves opposite as PSF pattern % the gap between each PSF capture is 1 mm clear; %% Read in psfs at each row n = 1; downsample = 1; for folder_num = 1 foldername = ['Z',num2str(folder_num)]; p...
238355973b98275284406f3fe1f636b09779908794f81bba8de412845ecf6f55
MATLAB
8,315
216
%========================================================================== % Double-check which units to use for the analyses. % % Lukas Kunz, 2021 %========================================================================== % start clear; clc; close all; % paths paths = []; paths.data = 'C:\OpenField\...
e45edcbd845ba1aa24441564d5936e8fa6574e239eada0b43d35b9d6454b7634
MATLAB
8,358
262
function [freq_mat1, freq_mat2, maxfreq_store1, maxfreq_store2] = find_peak_freq_tf (sig_struct1, ... sig_struct2, Fs, win_length, overlap, ylim, filt_freq, plt, waitbar, width,... dataname, struct1_name, struct2_name) % This function calculates the peak frequency of two signals over the course % of several tim...
fb84178e40a7c7204a8545e626a083b71e18c8e6b8e884d3b347423ecc60ebe8
MATLAB
8,365
272
function varargout = peakClassMeasure(self, traceNorm, frameRate, fBand, ... roiName, doPlot, flagVersion) %peakClassMeasure - Measure and classify peaks % % [PEAKS] = peakClassMeasure(OBJ, TRACE, FRAMERATE) requires % passing of a CalcMeasureROIsClsfy object (OBJ), the raw ROI signal % trace (TRACE) and the ...
c6c5275dd477e81521cad31712ba7c8b4aad18d113ce986831e0ace6ff7d63ba
MATLAB
8,371
235
classdef Test_XSectScan < matlab.unittest.TestCase %TEST_XSECTSCAN Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) function testConstructor(self) % Var...
793819f52e4360ceaa7bcd17a308691f21bcfc38121a704a9739b0e97de2dd03
MATLAB
8,379
191
function [Rin, tau, cap, Vrest] = t2n_passTests(neuron,tree,targetfolder_results,ostruct) % This function applies protocols to extract passive properties (input % resistance, membrane time constant, capacitance and resting membrane % potential) from each cell. % % INPUTS % neuron t2n neuron structure (se...
c470585de87ec8e4c0242dcd4b9a87cb92eae59dded0b0a11db0ec83f0dab5c4
MATLAB
8,395
274
classdef camera < handle % zapit.hardware.camera % % Purpose % This class acts as an interface between the zapit.pointer class and the MATLAB % image acquisition toolbox. This is necessary to provide consistent behavior across % different camera drivers. % % Rob Campbell - 2018 SWC %...
451117d3f1633556bfb865916757e504ce1a9cc88c05ea8f600a6531d88239e5
MATLAB
8,417
222
classdef (Abstract) DataMeasureROIs < Data %DataMeasureROIs - Superclass for DataMeasureROIs classes % % The DataMeasureROIs class is an abstract superclass that implements (or % requires implementation in its subclasses via abstract methods or % properties) all basic functionality related to storing data from RO...
1faac06fb71a2273f33bdea2c0f6dff8b5dde07e28b850c3b94f501e5ba2fd61
MATLAB
8,422
212
classdef DataVelocityLSPIV < DataVelocityStreaks %DataVelocityLSPIV - Data from LSPIV-based velocity calculation % % The DataVelocityLSPIV class is a data class that is designed to % contain all the basic data output from CalcVelocityLSPIV. % % DataVelocityLSPIV public properties inherited from Data: % mask ...
723f48065ae25eee5480db3853a670f9c5c731f502a101fbed4ce2825e0111cb
MATLAB
8,452
354
%% dfof_byLoc % Plots rolling average of dfof by track location for a batch of mice clear all; close all; clc %% Calculate spatial dfof rolling average for all FOV base = 'D:\4m_imaging_analysis'; cd(base) N=1; %rolling average type = 'dfofaveragesmooth'; % suff = ''; suff = '_sig'; svName ...
569dc8734055dc37cbba4967b7239e3e50f7b84f424c87bdb0c11768ed5caf91
MATLAB
8,455
261
%% FrameScan % Analyse frame scan images of vessels %% Usage % OBJ = FrameScan(NAME, RAWIMG, CONFIG, ISDS, COLS_V, ROWS_V, COLS_D) %% Arguments % * |NAME| is the name for this |FrameScan| object. % * |RAWIMG| is the |RawImg| object that will be used to create the % |FrameScan| object. % * |CONFIG| contains the conf...
ed1b522ec0c37db12f5d7c1528a2db248a2b801dbd6e00684628bc85d646a3b3
MATLAB
8,470
201
% Voxel.m % Brenden Kadota, SunnyBrook Hosptial 2021. % % USAGE: % Voxel(position, voxelSize, rotationMatrix, fid_aIndex) % % DESCRIPTION: % Class to hold voxel spatial information to plot onto mri. Could use % refractoring to make seperate classes for edges, vertecies, and data. % % INPUT: % position = po...
b7303103fa7873bf8e373f3b17784eae22f560befe294ea1987f702724615371
MATLAB
8,510
215
function val_tfce_exactness % Is the max-tree TFCE the exact value of the TFCE integral? % % The mex-file is compared against an INDEPENDENT reference implementation % written in plain MATLAB, which approximates % % TFCE(v) = int_0^{t_v} e_v(h)^E h^H dh % % by stepping through n thresholds and labelling connected com...
0f3ffe76ec59a7204aefb9eb59a618a6f56cf1c1cfaeb64e1d58456ae7bccbc7
MATLAB
8,519
189
classdef stimConfig_tests < matlab.unittest.TestCase % Tests for load-time checks performed by zapit.stimConfig % % Currently focuses on checkLaserPower, which populates the observable property % conditionsExceedingLaserPower when a config is loaded. % % The fixtures assume the test settings fil...
f779c4bbf69e4d4491e1efb082b9199fe808c850bd8427d911e6151bd6865af6
MATLAB
8,530
217
%% Snippet Plot Example % % <html> % Import snippet data into Matlab using TDTbin2mat <br> % Sort snippets based on channel number and sort code for any number of channels and sort codes <br> % Plot the average waveform shape and standard deviation for 16 channels and three sort codes <br> % Good for spike sortin...
a4f188e5f128e79feead40b4da73c8c03d0f805dd381d43d6321888d73a57be7
MATLAB
8,531
312
function [U,S,V] = pca(A,k,its,l) %PCA Low-rank approximation in SVD form. % % % [U,S,V] = PCA(A) constructs a nearly optimal rank-6 approximation % USV' to A, using 2 full iterations of a block Lanczos method % of block size 6+2=8, started with an n x 8 random matrix, % w...
033a9f265599e22967c8b647193866ce0b6a15070a5b0abe728ba2cfc98d8ffc
MATLAB
8,549
229
classdef Test_LineScanDiam < matlab.unittest.TestCase %TEST_LINESCAN Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) function testConstructor(self) % V...
16ab10bfaeb56fe0efb692957aa0c9de34ee8f3684cdf0f8269bb5e2aec3de65
MATLAB
8,575
262
function [pacmat, freqvec_ph, freqvec_amp] = find_pac_shf_tf (sig_pac, Fs, measure, ... win_length, overlap, ph_freq, sig_mod, ph_freq_bw, amp_freq_vec, plt, waitbar, width, nfft, num_shf, alpha,... dataname, sig_pac_name, sig_mod_name) % This function calculates a matrix of PAC values using either the ESC, MI ...
f3e65a08c9c0e03aea2e7dda69e4ef03d2388411441b57d14ea166b2708b8517
MATLAB
8,586
267
function varargout = plot_graphs(self, varargin) %plot_graphs - Plot multiple graphs from the data object % % plot_graphs(OBJ, X) plots graphs of X vs the default variables for the % appropriate Data subclass Y onto the current figure. X must be either % a numeric array, or a character array corresponding to a v...
daf0e33176bff23c95ad2193e877cb36de849248eb4f190a4d05a6908a5c3257
MATLAB
8,633
342
clear close all force load('a0_0_bhv2trialStrct.mat'); %% %individual NIImage_Individual = [7 9 11 22 25 27 28 38 39 40 41 42 43 44 47 49 52 53 55 56 57 59 60 ]'; %group % NIImage_Group = [ 36 37 45 51 5...
0a7a9c7bc45e0e6405e38d9c27adab152a684d29d6171fa182b1a4216466c9e8
MATLAB
8,652
251
function varargout = opt_config(self, objPI, calcName, varargin) %opt_config - Optimise parameters using a GUI % % opt_config(OBJ, OBJ_PI, 'calc') opens a GUI that allows interactive % adjustment of the parameters in a Config object, using the ProcessedImg % object OBJ_PI and the property name of the relevant Cal...
5147c02621a9fd8f000bf9991a06425e31c5b72d68176be0b936caadd4e3ba94
MATLAB
8,653
391
%mice are in this order: %(different from here: Z:\SNM\labMembers\LC\Lian %Cui\behavioralParamsByYG_NT\summary.mat') %same as here: Z:\SNM\labMembers\LC\Lian Cui\IHC\IHC Matlab\data statistic graph %rearranged the order in "summary" so that the order can be identical to %the histology data % %mouse order %...
2ca1d3ce27199d4fd676c5cb0cbed148019704eeabdbbe7cd59a72252b774534
MATLAB
8,674
245
% SPREAD_TREE Extracts coordinates to display trees separately. % (trees package) % % [DD, outtrees] = spread_tree (intrees, dX, dY, options) % ------------------------------------------------------- % % Creates a cell array DD same organization as intrees which gives X, Y and % Z coordinates to display trees spread ...
5d258a4b04017bb8c3aa7f17769497df611c4edce91bf1bcb01e4245ba16822f
MATLAB
8,680
251
clear all close all rng(0) unifyContextClasses = false; averageAllBoutsFromSession = true; NumTrees = 80; TakeJustTheta = false; TakeJustGamma = false; matlabImpute = true; imputeIters = 80; paramsStr = ['Ntree',num2str(NumTrees),'_Unify',num2str(unifyContextClasses),'_JustT',num2str(TakeJustTheta),'_Ju...
c0884df68c6869e2318d2047d8028c273b2dcf79e195ce30157150d47146d642
MATLAB
8,686
233
classdef CalcFindROIsDummy < CalcFindROIs %CalcFindROIsDummy - Class for dummy ROI identification % % The CalcFindROIsDummy class is a Calc class that performs dummy ROI % finding. That is, it simply 'finds' previously identified ROIs, or % uses the whole frame as a ROI. % % CalcFindROIsDummy is a subclass of ...
cd4057852568964da860eca2fc195ec6e23ff938336ec3af5db4861ec7d93a6f
MATLAB
8,692
210
function betas = taft_preprocess_combine_EEG_fMRI(job, X, Y) % betas = taft_preprocess_combine_EEG_fMRI(job, X, Y) % % Take a design matrix X of trial-by-trial BOLD HRF estimates and a % matrix Y including trial-by-trial EEG data, % add behavioral (nuisance) regressors to X, compute the pseudo-inverse, % perform a m...
3193dc41b0998dcdae1b241bbb1435f581708a4d8b90e0a207611dda49725aeb
MATLAB
8,707
334
%io_loadspec_bruk_old.m %Chathura Kumaragamage, McGill University 2016. %Jamie Near, McGill University 2016. % % USAGE: % [out,ref]=io_loadspec_bruk_old(filename); % % DESCRIPTION: % Reads in Bruker MRS data (fid.raw, fid.ref). % % op_loadspec_bruk outputs the data in structure format, with fields corresponding to tim...
fff6e39f86412c957ad7aaa14e4196437a5ccdb0104180faa848bbd78c5d72f0
MATLAB
8,723
188
function AOandAI % Demonstration of simultaneous analog input and output with the dabs.ni.daqmx wrapper % % function vidrio.mixed.AOandAI % % Description: % This example demonstrates how to continuously run data acquisition (AI) % and signal generation (AO) at the same time and have t...
7dafc52eb1167e6cb2bf5fa6083f338f0d2af4dd82bfd0754cfa8259bcfac8cd
MATLAB
8,769
241
%% Clear previous data clc; close; clear %% Select targetlocation Manually from one file [file, ~] = uigetfile('*.mat'); file=file'; load(file) imshow(BackgroundCropped) hold on targetlocation = drawpoint('Color','g'); mask=false(size(ClearOutsideMaskCropped)); targetlocation = (targetlocation.Position(1,:)) ...
28cb65c8d54fb4a9ce1b11f1d0df83c6a10ec65b0aba6a59d1dc52f7fb958d97
MATLAB
8,784
186
function EEGfMRIPav_OutcomeLocked_4_rejICs(rootDir, subVec) % EEGfMRIPav_OutcomeLocked_4_rejICs(rootDir, subVec) % % Reject identified components (after ICA and visual inspection of plots), % save data. % % INPUTS: % rootDir = string, root directory of project % subVec = vector of integers, numb...
4121272ac0c2d3165d82232341494f5be2a4456f1236d804c656e7f6cb753b46
MATLAB
8,849
390
%io_loadspec_dicom_siemens.m %Jamie Near, Sunnybrook Research Institute, 2026. % % USAGE: % [out,info]=io_loadspec_dicom_siemens(dicomFolder); % % DESCRIPTION: % Reads in an MRS dataset in Siemens dicom format. The input is a folder % of Siemens dicom files, and the output is a single FID-A structure. The % resultin...
50dec1209e49d7233a632481085e51ac4175a2af32770974e9729400dae029da
MATLAB
8,861
224
classdef CalcDetectSigsClsfy < CalcDetectSigs %CalcDetectSigsClsfy - Class for detecting and classifying signals % % The CalcDetectSigsClsfy class is a Calc class that detects and % classifies signals in previously identified ROIs. The signals are % classified into up to three main categories: single peaks, plat...
31c855e4c1711d47936dcca6b350998c5724fb55ad709c8c3282a36c42cd59b5
MATLAB
8,869
168
function [DLCBodyPartsSpeed,DLCBodyPartsDistanceFromChambers,DLCBodyPartsCoordinatesFinal,DLCBodyPartsNames,DLCModelName]=Analyze_DLC_Video_Results_09052022(filenameBehavioralDLCData,filenameBehavioralVideoData,FramesTimesInSec,app) %TRACKMICEPOPULATIONSUMMARY Summary of this function goes here % The aim of this func...
7b82c26424b35fa411cf33ab427ea3a6e77ab212b5fd44af5fc57477455d12e9
MATLAB
8,894
223
function ExtractTrace3D(path,varargin) p = inputParser; addOptional(p,'hp_cutoff',51); %rolling hp filter cutoff addOptional(p,'prctile_cutoff',10); %rolling hp filter prctile cutoff addOptional(p,'t_max',20); %# timeframes to make mask-images addOptional(p,'z_max',5); %# zplanes to make mask-i...
73bf73aac3fa5b33484513908a7f0c28930e1883f0ba10b3aadf5ec84d508c33
MATLAB
8,895
253
%% Fig 5 % Jiaxin Gao % Zhejiang University % email: jiaxin_gao@zju.edu.cn %% exp3 clear clc fs = 100; load('.\Fig5_data.mat') pp_sum0(:,1,:) = Fig5_Data.A.pp_sum0_con1; pp_sum1(:,1,:) = Fig5_Data.A.pp_sum1_con1; pp_sum2(:,1,:) = Fig5_Data.A.pp_sum2_con1; hh_sum0(:,1,:,1,:) = Fig5_Data.A.hh_sum0_con1...
4b867c563f6d504f15578380c65aaf94e1cd03f5454612ae6a00162cbe12f7c3
MATLAB
8,910
192
% EEGfMRIPav_OutcomeLocked_9_time_grouplevel_test % This is an interactive script---execute it step-by-step. % Set the appropriate job settings for loading TF data aggregated across % subjects, then perform tests. % - cluster-based permutation test with Fieldtrip. % - evaluate stat output object. % - perform t-test pe...
ae3222b3f19faffd4f001ef6b2d7c43852d77fe89facf03dedb47cc7fb02d436
MATLAB
8,914
242
classdef (Abstract) CalcFindROIs < Calc & IMeasureROIs %CalcFindROIs - Superclass for CalcFindROIs classes % % CalcFindROIs is an abstract superclass that implements (or requires % implementation in its subclasses via abstract methods or properties) % most functionality related to CalcFindROIs objects. Typically...
12dbd1497872295c863eab76931c4f4c1e6169acba315b3d5ad10be5d99aeb2d
MATLAB
8,927
196
% TIME_TF.m % % Setup and time-frequency decomposition. Run this once, then Analysis.m. % % The two are separate because this script needs a parallel pool and reads % every subject's raw data, while Analysis.m works entirely from what this % one writes. Re-run this only when something upstream changes: the % frequencie...
eff491ac51f4b17b900a1a4f4dc4e88cdd91bce6046098e120c040d575a5446b
MATLAB
8,932
230
function out = LK_ArtifactDetection_20220319(mycfg, myeeg) % % LK_ArtifactDetection_20220319 detects timepoint-specific artifacts based % on several criteria. % % Use as: out = LK_ArtifactDetection_20220319(mycfg, myeeg); % % Input #1 is a structure with optional analysis settings: % time2exclude --> time to exclu...
d9a236536232561e44c6424061a8edfbb4c85763a5d1a2c0d94495587bfdd280
MATLAB
8,935
278
% This script generates KSDs from the V1, V2, and MT neuronal datasets, % samples from the true and bootstrapped BORIS image sets, clear all; close all; % load neuronal data for plotting RF location KSDs load('./analysisFiles/physio/fittingResults_processed.mat'); % sampling rate numSamps = 100; % number of times to...
82f0e632eeabe09f0e8294aa39f55c86ddf68b324ae23bdd46aea024b97489ed
MATLAB
8,948
195
function [projData, binLims, projPaths, rgbData] = WriteSbxZproj(sbxPath, sbxInfo, varargin) % projPath, firstScan, Nscan, pmt, checkInfo = @(x)(isstruct(x) || isempty(x)); checkz = @(z)(isnumeric(z) || iscell(z)); IP = inputParser; addRequired( IP, 'sbxPath', @ischar ) % path to the .sbx+ file to be projected a...
019075f75453ab405e0ba9240c47f0d0c069952e1a75c11ba94f6d688bc05567
MATLAB
8,962
306
function Message = gaFFT(fnTS,TS,DAVersion) %% function Message = gaFFT(fnTS,TS,DAVersion) % % FFT BLK data over time for each trial % % STEPS: % - Normalize BLK data % - FFT data over time for each trial % - Take data at peak frequency % % Input: % - fnTS is the TS.mat filename, including pathname and extenti...
56e30ec927e8412860d8431d4caab724387d5033f77bb73380bd6a88d2e9150a
MATLAB
8,969
230
%function ElectodesClassificationMatlabFunc( % clear all % unifyContextClasses =true % averageAllBoutsFromSession=true % NumTrees = 80 % TakeJustTheta = false % TakeJustGamma = false % matlabImpute=true % imputeIters=80 function BalancedElectrodesClassification(unifyContextClasses,averageAllBoutsFromSession,.....
76ad6a242c9dd64af2b04cda3fd4a927afd41eb362330705709dda3604996ca5
MATLAB
8,970
232
classdef Test_FrameScan < matlab.unittest.TestCase %TEST_FRAMESCAN Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) function testConstructor(self) % Var...
c090fa07dbf39b1a2292b9a7a26a2b4c51d96cde9becccf46add59a8bfe9e0ab
MATLAB
8,971
215
function [perf, result, testlabel] = mv_classify_across_time(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_classif...
3259f75816eba1071547f63bbbc6027090cdb69b49d369f4f3cfc39de14e0931
MATLAB
8,974
256
% UNDERSTANDING TRAIN AND TEST FUNCTIONS % % The backbone of MVPA Light's high-level functions such as mv_classify and % mv_regress are the train and test functions of the models. They are found % in the model subfolder. Many standard MVPA problems can be solved using % the high-level functions, but for some advanced a...
1be44976a7c312254e27619b3f10065a708deeeacde38554c0705c3c58d4885a
MATLAB
8,975
259
classdef (Abstract) Calc < matlab.mixin.Copyable %Calc - Superclass for Calc classes % % Calc is an abstract superclass that implements (or requires % implementation in its subclasses via abstract methods or properties) % most functionality related to Calc objects. Typically there is one % concrete subclass of...
11919959fcb8e26991d1720ffbc820abf1f1bf07a9d11de9cbdd8266093be07f
MATLAB
8,985
246
function h = mv_plot_2D(varargin) %Plots 2D results, e.g. a time x time generalisation. Plots the results as %a color matrix. If a 3D matrix is given several subplots are created. % %%Usage: Two possible usages, either giving additional parameters in a cfg % struct (with cfg.key1 = value1) or directly giving the ...
bea741fd1c5a84b493f99fca177e78c4f471e76fc28e857c1c4f8a876ee058fd
MATLAB
8,991
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 rxnsToKeepO...
f3d4b3fbff2d60d791aae41da415a405a2cf0461f88b01fbca927394e39901c0
MATLAB
8,999
333
%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') ...