sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5737f54939002fceeeed240bbed9becc48082e75d7208636e1b44c66b0909998
MATLAB
5,149
148
function varargout = findSettingsFile % Find the Zapit settings file and return as a string % % function settingsFile = zapit.settings.findSettingsFile() % % Purpose % There are three places the Zapit settings file could be located. This function % Looks through this in the following order: ...
13620791dc4b1ef3ce2a2314fd517981253795885fd148e661d902555f26beb8
MATLAB
5,152
242
clear close all %% 1) read data and prepare them %addpath('../TOY/data') load ellipses2D.mat exp = '4'; options.kernelt = 'rbf'; modif = createModif(exp); modif.additDim = 1; % number of replication of the dimensions %% create data N=20; load ../TOY/data/ellipses2D.mat r = 0.15; % noise in the multidim data %A...
1bbb0ce91da9e817a65707af531fb41d359d1c68094cee6b9d55831742b90dd8
MATLAB
5,163
157
function varargout = denoise(imgSeq, varargin) %denoise - Denoising of an image sequence % % This function implements a block matching 3D (BM3D) algorithm for % improving signal-to-noise ratio in two-photon imaging data. For further % information about BM3D, please refer to <a href="matlab:web('http://doi.org/10....
e4c155c29ccd9fb63e7e4847cfc4eeeff709db41824fe82ffe83b72b927e4226
MATLAB
5,169
184
% op_alignScans.m % Jamie Near, McGill University 2014. % % USAGE: % [out,ph,frq]=op_alignScans(in,in1,tmax,mode); % % DESCRIPTION: % Use spectral registration to align two separate scans (align in to in1); % % INPUTS: % in = input (spectrum to be registered) % in1 = base (spectrum that the input is to ...
63306472c9ee1ceebb4c5d2b732a6821608fc041e806b0f7d8863dc7626412e2
MATLAB
5,183
99
function fig = t2n_IVplot(targetfolder_data,neuron,ostruct) % This function uses the simulation data generated by t2n_voltSteps and % plots the IV relationship at each voltage step. % % INPUTS % targetfolder_data folder which was given to t2n_voltSteps, where the % data of the simulation lies...
dd58d8c77e2c114c49431b03a46c616e4e98b3a55fe53061934bb701150aea0b
MATLAB
5,185
115
classdef ConfigCellScan < ConfigMultiple %ConfigCellScan - Class containing Config objects for CellScan % % The ConfigCellScan class is an abstract superclass that is designed to % contain more than one Config object to simplify construction of % CellScan objects. This ensures that a single Config object can be ...
809a70d084fd2487f7704a00073befcfa6abd5eb976a535cb6d9ec655cc02e51
MATLAB
5,201
147
%% % Reproduces Iso vs. Ortho plot for Compact vs. Diffuse % co-tuned condition (Fig. 4B and 4C) % % Function inputs: % cellTable: structure containing neuron data % cellCondTuned: vector of 1's and 0's that denotes which cells should be % included (e.g., only tuned cells) % cellCondNonVis: vector of 1's a...
72941949b589d33c42d52b1048d85de8095be48259dc515cec1939ba992123f1
MATLAB
5,209
128
function connectClockedAO(obj, varargin) % Set up a clocked AO task % % function zapit.DAQ.dotNETwrapper.connectClockedAO % % Purpose % Create a clocked AO task for opto-stimulus delivery. % The connection options are set by properties in the dotNETwrapper % class. see: .device_ID, .AOc...
af921e62464dfebdf5d1da9de0d3b9462e5f7181359deb51fc22d52cfc00df9b
MATLAB
5,209
177
% SSECAT_TREE Steady-state electrotonic signature of connected trees. % (trees package) % % sse = ssecat_tree (intrees, inodes1, inodes2, gelsyn, I, options) % ----------------------------------------------------------------- % % Concatenates many trees with electrical synapses and calculates the % steady-state matri...
832c77a88814a451bc246c55de1b9c5b8adedfba01fe231dbdfd8f64409248be
MATLAB
5,210
164
%REAL2RGB Converts a real-valued matrix into a truecolor image % % Examples: % B = real2rgb(A, cmap); % B = real2rgb(A, cmap, lims); % [B lims map] = real2rgb(...); % % This function converts a real-valued matrix into a truecolor image (i.e. % double array with values between 0 and 1) using the colormap specifie...
024afb888ee3c4d0b5860f578f2dca2be2ac8810e00b42e56456987dc571255b
MATLAB
5,213
152
%% 2D Fast Reconstruction code for Bio-FlatScopeNHP % Set to working directory protoDir = './Examples/'; psfExt ='.mat'; % '.mat', '.tiff'; capExt ='.tiff'; % '.mat', '.tiff', '.avi'; % For avi, select only one file H = 2048; W = 3072; %Imaging SourceMos binFlag = 0; %% Params gamm_l2 = 5000; % Typica...
bba2358872d196a819891c6b95c8d6aea25d2d4cf0fc638be0b0ff53ac531d02
MATLAB
5,225
153
function [out] = EEGfMRIPav_cbm_mod04_modSim(parameters, subj) % Standard Q-learning model with delta learning rule and Go bias and % Pavlovian learning bias. % ----------------------------------------------------------------------- % %% Retrieve parameters: % 1) Feedback sensitivity: nd_rho = parameters(1); % ...
939fc05407a1199b188b3ae3beb54f26c19638027428353a47bb90fef67e4380
MATLAB
5,240
147
function [P] = snpm_P_FDR(Z,df,STAT,n,Ps) % Returns the corrected FDR P value % FORMAT [P] = snpm_P_FDR(Z,df,STAT,n,Ps) % % Z - height (minimum of n statistics) % If empty, find all FDR P values for Ps vector (in which case % STAT is ignored, as Ps must be P-values already). % df - [df{interest}...
11831b177f0e1b5a8cdc682ae398047fc692802ade640f7602f244e20873911a
MATLAB
5,249
157
% op_peakFit.m % Jamie Near, McGill University 2017. % % USAGE: % [fit,parsFit,residual]=op_peakFit(in,ppmmin,ppmmax,parsGuess); % % DESCRIPTION: % Perform a Voigt lineshape fit to a prominent singlet resonance within the % provided ppm window of a proton MRS dataset. % % INPUTS: % in = input data in matlab stuc...
1f28956e4227d1d9fdd352da551ab47e4f823851a5d2b7f19410b33650f4c7cd
MATLAB
5,252
153
function varargout = plot(self, varargin) %plot - Plot CalibrationPixelSize objects % % plot(OBJ) produces a plot of the CalibrationPixelSize object OBJ. % % plot(OBJ, DOSAVE) specifies whether to save the plot to a file. DOSAVE % must be a scalar value convertible to a logical. The function will % % plot(OB...
34022585926a67e4ac0615ce2e92fab4d5775ffeaeebbc932f23276c2cf51b46
MATLAB
5,256
174
function [offsets, refImgs, doPar] = calculate_offset(chSeq, ... refImg, maxShift, frameRate, varargin) %calculate_offset - Calculate line-by-line offsets % % [offsets, refImgs] = calculate_offset(CHSEQ, REFIMG, MAXSHIFT, FRAMERATE) % calculates the offsets for each line in an image stack based on the % maxim...
bd8cd7aa48c0de387403a8226d6ddaa6b591ac6e91c2b98354062d2e838ad519
MATLAB
5,262
165
function varargout = hardwareContinuousVoltageRampDown(devID,nonInteractive) % Example showing how to ramp down a regenerative signal % % function nidaqmx.AO.hardwareContinuousVoltageBasic(devID) % % Purpose % Shows how to do hardware-timed analog output using the DAQmx .NET interface. % Thi...
73bff7f8c385665eb965b8476ca8eca63ca6627a20922886399ff3bdd79020b0
MATLAB
5,264
122
%Used to copy all data from the complete CA-1 morphology round into h5 %files in an organized folder structure. Specifically, this script must %also create a common field of view numbering structure, which is important %because a microscope glitch created a varying number of tiles per %sequencing round % Written by Dan...
57cbd1891c77d04d7382e810e542880f4b9db5e9c23a8e8d502d578e7bd6a95b
MATLAB
5,283
194
addpath './Tools'; load M28D20220720R11TS.mat fnTS = 'M28D20220720R11TS.mat'; load 'M28D20220720R11FFTAmpS026E100PF0400.mat'; Condition = TS.Header.Conditions; Num_valid = TS.Header.Index.iValidBLKCond; %% Parameters DefaultValues; iCondBlank = 1:TS.Header.NumBlankCond; nCond = TS.Header.NumValidCond; ...
34270c9497b6ee6087fd5a4c5c3eae3d3ec7d2f7a5bca554616b32e3478c4324
MATLAB
5,285
160
function tests(obj) N0 = 128; %% Check adjoint for basic case imN = [N0 N0]; b0 = randn(imN) + rand; imk = [N0 1]; sampTimes = randn(imk)/sqrt(prod(imk)); phs_spha = randn([16, size(sampTimes)]); phs_coco = randn([4, size(sampTimes)]); phs_grid.x = randn(size(b0)); phs_grid.y = randn(size(b0)); phs_grid.z = randn(siz...
b1fd213dab0fd335d8bbefd9a7a08e1bb66a915a4c74556728eddf66d9682742
MATLAB
5,286
129
classdef (Abstract) CalcDiameterXSect < CalcDiameter %CalcDiameterXSect - Superclass for CalcDiameterXSect classes % % CalcDiameterXSect is an abstract superclass that implements (or % requires implementation in its subclasses via abstract methods or % properties) most functionality related to CalcDiameterXSect o...
992e351092a2305e0a789abe73b1c4ad91cf68200ba6956a6134f0d503b2d9d1
MATLAB
5,289
133
classdef CalcDiameterFWHM < CalcDiameterLong %CalcDiameterFWHM - Class to calculate diameter using the FWHM approach % % The CalcDiameterFWHM class is Calc class that implements all basic % functionality related to calculating the diameter of images using the % full width at half maximum (FWHM) approach. % % Ca...
889d051393f2891c0f6a659f72e5ce6bd14e67c43f8c76525a2c57eeaa5303cd
MATLAB
5,292
134
% run_simSteamShaped.m % Jamie Near, Sunnybrook Research Institute 2022. % % USAGE: % [out,out_posxy]=run_simSteamShaped(spinSys); % % DESCRIPTION: % This script simulates a STEAM experiment with fully shaped RF % pulses. Coherence order filtering is employed to remove unwanted % coherences. Simulations are run at ...
95e46029fae4c6930e05cd8116c56a5a166249ff9f4d189c758c012b7625843f
MATLAB
5,304
138
classdef Test_ZZZ_Make < matlab.unittest.TestCase %Test_ZZZ_Make Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) % function testMakeTlbx(self) % % ...
2981c4a1cba65167e02ba63d99715e6beab6c93001e1a7df11f57ea78777b254
MATLAB
5,309
141
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % function H=shadedErrorBar(x,y,errBar, ...) % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % Inputs (required) % x - vect...
3a09ba8d09b403b10444309840e7d4e757bb33ef07c99a2901fe2f9b6e1506fd
MATLAB
5,312
142
% 2021 EDIT: This function is now deprecated. The current version of the % shaped PRESS simulation is sim_press_shaped.m, which employs % coherence selection rather than phase cycling to null undesired signal. % sim_press_shaped_phCyc.m % Robin Simpson and Jamie Near, 2014. % % USAGE: % out = sim_press_shape...
bc1269c0b68dd5e85d465a3a262a89e241727ec70f36d6db65b6e255bf722394
MATLAB
5,313
127
function [maxdv,fig] = t2n_plotdV(targetfolder_data,neuron,ostruct,targetfolder_results) % This function creates a phase plot (dV/dt) of the current steps that were % simulated with t2n_currSteps. % % INPUTS % targetfolder_data folder which was given to t2n_currSteps, where the data % of the ...
aadedfda3003036427765c1351532de5d5b3d20db9f5f2cde80fb48399669912
MATLAB
5,320
131
% run_simSemiLASERShaped_phCyc.m % Dana Goerzen (McGill University, 2019). % % USAGE: % This script runs a spatially resolved, shaped simulation of the sLASER % experiment, using the sim_sLASER_shaped_phCyc.m function. % Adjust all parameters as desired and click "Run" % % DESCRIPTION: % Simulates CMRR semi-LASER ex...
66601408b15507cd5219949ac18cd752510de593269c8155db6407ce49b3f960
MATLAB
5,324
162
% FigureS09.m % Plots for Supplementary Figure S09. % Will call taft_save_PEs() to load PEs for selected subject (sub 07). % % 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; cl...
62f239256671974bea9991d88de83fb340dfc00f94a6be52d31035070e7f0618
MATLAB
5,325
176
function tree = myelinate_axon(tree) %Adds simple myelin to an existing axon, with nodes at every axon %bifurcation as well as between internodal myelin segments. %Terminal branches below 20um are left unmyelinated; diameters are set to %uniform 1um for myelin segments, 0.8um for unmyelinated. %Note: Regions must...
c19a3cf39215a4ea42b11bbfd9faa5039fb7a49996cc23872e303cc9ef42515b
MATLAB
5,327
136
function [sortBetas, Tvalues] = taft_postprocess_time_selectData(job, betas, iROI) % Extracts time-domain data for selected ROI, % sort channels across subjects, selects valid subjects, % combine subjects into 3D data, perform one-sample t-test for each % time-channel bin across subjects. % % Use as % [sortBetas, ...
4a0d531ef2772669553d253268ccbaee6f32c1cd42c7c8b9e550e45a4f584e99
MATLAB
5,331
145
function [par] = set_par() % Set parameters for EEG pre-processing and analyses. % % INPUT: % None % % OUTPUT: % par - structure with settings for pre-processing % % EEG/fMRI STUDY, DONDERS INSTITUTE, NIJMEGEN. % J. Algermissen, 2018-2023. % Should work in Matlab 2018b. % ---------------------------------------...
3a80db803820c5cdf4d9c25e930e6ff99ed2efc607d712e665375a4e15907a8d
MATLAB
5,343
125
function [neuron] = t2n_blockchannel(neuron,channels,amount,regions,specify) % This function manipulates the neuron structure to reduce specific channel % conductances defined by "channels" in specific regions of the cell(s) % defined by "regions" by a certain amount defined by "amount" % % INPUTS % neuron ...
6a6c352be37bc05ad6d9978b886c449dbea918607b2c4e042c7f62de6ed6f484
MATLAB
5,357
156
function [out] = EEGfMRIPav_cbm_mod05_modSim(parameters, subj) % Standard Q-learning model with delta learning rule and Go bias and % Pavlovian response bias and Pavlovian learning bias. % ----------------------------------------------------------------------- % %% Retrieve parameters: % 1) Feedback sensitivity: nd_...
cb32bcc6bae1b458cbc3e5f1a0379741f1b4db5a4e7b0eb0f72bc43c1ffe90b8
MATLAB
5,359
161
% QUADDIAMETER_TREE Map quadratic diameter tapering to tree. % (trees package) % % tree = quaddiameter_tree (intree, scale, offset, options, P, ldend) % ------------------------------------------------------------------- % % Applies a quadratic decaying diameter on a given tree structure. P % and ldend are derived pr...
1de69bebc1af1411b2ec6f2955b53e80c888a0bafcd266022eddcecc540a978b
MATLAB
5,365
171
% SMOOTH_TREE Smoothes a tree along its longest paths. % (trees package) % % tree = smooth_tree (intree, pwchild, p, n, options) % --------------------------------------------------- % % Smoothns a tree along its longest paths. This changes (shortens) the % total length of the branch significantly. First finds the he...
0d924b124da85708b193fdad864399b430d9b4250fe767432dc25c49a889b812
MATLAB
5,367
175
% POINTER_TREE Draws pointers (electrodes) to nodes on a tree. % (trees package) % % HP = pointer_tree (intree, inodes, llen, color, DD, options) % ------------------------------------------------------------ % % Draws pointers to nodes inodes. Several options exist, some look a bit % like electrodes. % % Input % -----...
66f25656b707c86d243b7382ea17d23160be82f50ea9cc8dca41cc5b37fc906d
MATLAB
5,377
137
%% Ripple detection clearvars -except subnum sub Summary addpath \\mycloudpr4100\ivan\Ivan_analysis\Ivan\human-20190516T170723Z-001\human\FMAToolbox\Helpers addpath \\mycloudpr4100\ivan\Ivan_analysis\Ivan\human-20190516T170723Z-001\human\FMAToolbox\Analyses addpath \\mycloudpr4100\ivan\single_unit\human\wcst\awak...
67fb0d67ff58d2841778ea4b02752d4301e481e4f2e3f0a584669e3d9f5d25d2
MATLAB
5,377
132
% run_simPressShaped.m % Dana Goerzen and Jamie Near, McGill University 2021. % % USAGE: % This script is run simply by editing the input parameters and then % clicking "Run". % % DESCRIPTION: % This script simulates a PRESS experiment with fully shaped refocusing % pulses. Coherence order filtering is employed to o...
8b76aeecdc47702f8c9666b74876941455eda2f10fab2129d185523022208280
MATLAB
5,378
245
close all force % clear load('a0_0_bhv2trialStrct.mat'); load('a19_2_distWithinAndBetweenEachTrial.mat', 'distToMeanSameCondition', 'distToGrandMean') load("a22_1_NewVarDistance.mat",'distT','distW') distToMeanSameCondition = distW'.^2; distToGrandMean = distT'.^2; %load("a22_2_NewVarDistancePermute.mat", "distT",...
e92c25b1a8c86c3f47c3987f5e108bf75f90749a029eba9a166f8df7400337ec
MATLAB
5,379
312
%first column = channel number on probe. Convention is ch. 1 is at top left of PCB %and number wrap around in counter-clockwise fashion. %second column = x coordinate, horizontal distance to reference electrode in microns. Convention is %for reference electrode to be at bottom left corner of array when array %points...
e983bca3a64b2d7ab68247a561d3dd2bf0b479ccad7ef360851a11697204f3f1
MATLAB
5,382
197
% FigureS10.m % Plots for Supplementary Figure S10. % Will call taft_save_PEs() to load PEs for selected subject (sub 07). % % 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; cl...
c17f21fd84f202fc3229a4bc52d6a747c9c38de6954979836f853515c500ed32
MATLAB
5,383
172
clear close all %save(mfilename); imSize = [733, 977]; %hmSize = [210, 280]; hmSize = [733, 977]; hmScale = mean(hmSize./imSize); pix2deg = 34.910; filesAll = dir('../../Images_Movies_Functions/analyze1/data0_Image/image_*'); I = arrayfun(@(x) x.isdir, filesAll); filesAll = filesAll(I); nFile = numel(filesAll); i...
0d7255f2d7044ef0c4c84bea840a1210969615dd1d3d84ca5e3faa47bec87585
MATLAB
5,385
112
function ViewROI3D(expt, ROI, fluor, loco, varargin) % IP = inputParser; addRequired( IP, 'expt', @isstruct ) addRequired( IP, 'ROI', @isstruct ) addRequired( IP, 'fluor', @isstruct ) addRequired( IP, 'loco', @isstruct ) addParameter( IP, 'minInt', 2000, @isnumeric ) % addParameter( IP, 'setROI', 1:expt.Nroi, @...
e8333711538584520e47f6774e4390b057f498e4587dcf9e46e8f73a2f243909
MATLAB
5,386
188
% CHULL_TREE Convex hull around whole or part of a tree. % (trees package) % % [HP hull] = chull_tree (intree, ipart, color, DD, alpha, options) % ----------------------------------------------------------------- % % Plots a convex hull around indexed nodes (ipart) of a tree. If tree is % 100% flat 3D convex hull doe...
3fe4985ed8376650977e861a50c99a60d6af5778d6018009a11a9838dec2d153
MATLAB
5,388
161
function [theta, estSNR, flux, thetaRangeMid, linearDensity, rbcSpacingT] = ... calc_angles_radon(self, windows, isDarkStreaks, pixelSize, ... lineTime, pixelTime, isOldToolbox) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute ...
f1852743e3857fcdb342a506d9180457e1b55cc8a0b220054eeac41729a338e9
MATLAB
5,388
166
function [rphase, fh] = tapas_physio_get_respiratory_phase(pulset, rsampint,... verbose, thresh) % get_respiratory_phase is a function for creating respiratory phase regressor. % from physiological monitoring files acquired using spike, that % can be included in SPM5 design matrices. % % FORMAT [rphase] = tapas_ph...
8ae6b0c4e83bb9300ffbf632514cbc77de5ad4055b18277c70602bf4525eab94
MATLAB
5,390
141
%% % Reproduces Compact vs. Diffuse co-tuned plots (Fig. 4A) % % Function inputs: % cellTable: structure containing neuron data % cellConn: vector of 1's and 0's that denotes which cells should be % included (e.g., only non-offTarget cells) % %% function Fig4A(cellTable,cellCond) %% We must average the resul...
9694164f5c10f7db8fb785e21702e6a9ec52250075e9eed5f33101d83236bab8
MATLAB
5,394
98
Ntop = 5; minDur = 10; minIso = 10; fitWindow = [10,10]; waveType = 'spont'; modelStep = @(b,x)( b(1)./(1+exp(-(x-b(3))/b(2))) + b(4)./(1+exp((x-b(6))/b(5))) + b(7)); % betaInit(1) = 1; % Saturation response betaInit(2) = 0.1; % onset time constant betaInit(3) = 0; % Onset time betaInit(4) = 1; % offset sa...
308566709ac0f5e8649a781ae24949fd3781299f683be3bdf1ac3dd6049ac47b
MATLAB
5,396
312
%first column = channel number on probe. Convention is ch. 1 is at top left of PCB %and number wrap around in counter-clockwise fashion. %second column = x coordinate, horizontal distance to reference electrode in microns. Convention is %for reference electrode to be at bottom left corner of array when array %points...
d20bd00edd4c2703355ffbd82f66aa2e46967d75e92877ab5a3bfd5667162d9f
MATLAB
5,399
312
%first column = channel number on probe. Convention is ch. 1 is at top left of PCB %and number wrap around in counter-clockwise fashion. %second column = x coordinate, horizontal distance to reference electrode in microns. Convention is %for reference electrode to be at bottom left corner of array when array %points...
e0b38d0780f5ddebd051baad9bb95dc2e88ca7de05c2005b2d6b3934940c1bd9
MATLAB
5,408
155
%decc_plotFig7 % Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024 % PV 2024 load('DECCdataFig7.mat') % Figure parameters lcolor = [0.0 0.4 0.5; 0.6 0.3 0.0; 0.1 0 0.5; 0.0 0.6 0.0]; dotcolor = [0 0.3 0; 0 0.5 0; 0 0.7 0]; dur = 3700; kern = 50; alpct = 99; x1 = kern:kern:dur; lpos = [500 1000 2000 2500 3500]./...
259d88acca80ab68fc676c27610a4293415f066080bef6ca05ef9fef2b059961
MATLAB
5,409
139
function hardwareContinuousVoltageWithCallBack % A simple example showing hardware-timed continuous analog input using the Vidrio dabs.ni.daqmx wrapper % % function vidrio.AI.hardwareContinuousVoltageWithCallBack % % Purpose % Demonstrates how to do hardware-timed continuous analog input using V...
d912fa8c31060bc27c39e28cb14d3098bee155c2d7ff1669ac9467dfff2fb189
MATLAB
5,413
127
%Split up a directory of registered images into _1, _2, etc. loadParameters; params.registeredImagesDir = '/mp/nas0/ExSeq/AutoSeqHippocampus_results/20170904/4_registration'; params.FILE_BASENAME= 'exseqautoframe7'; %how many subsections to calculate the descriptors? params.ROWS_DESC = 3; params.COLS_DESC = 3; params....
65038a2358088f1f227b83d170e1d21abda92f646a79f3fc126fe76eea14c010
MATLAB
5,421
128
% sim_megapress_shapedRefoc.m % Jamie Near, McGill University 2014. % % USAGE: % sim_megapress_shapedRefoc(n,sw,Bfield,linewidth,taus,sys,editFlip,refPulse,refTp,Gx,Gy,dx,dy,refPh1,refPh2) % % DESCRIPTION: % This function simulates the MEGA-PRESS sequence with shaped % localization pulses and instantaneous editing pu...
1f927d73fc1e0a068e9fef5885a733b6a26507630a198914314a54ef7a6917f1
MATLAB
5,429
125
function hardwareFiniteVoltage % Example showing hardware-timed analog output of a finite number of samples using the Vidrio dabs.ni.daqmx wrapper % % function vidrio.AO.hardwareFiniteVoltage % % Purpose % Shows how to do hardware-timed analog output using Vidrio's dabs.ni.daqmx wrapper. % ...
937180563565b3b6d25199d8d33bf6ce20c927a4af39a02db17e7d241c6ae034
MATLAB
5,442
119
% ---------------------------------------------------------------------------------------------- % -- Title : VocalMat % -- Project : VocalMat - A Tool for Automated Mouse Vocalization Detection and Classification % ----------------------------------------------------------------------------------------------...
e2f57895f6916932d936c57eba49aa0d1a44e2f65afb40802e84d74352179945
MATLAB
5,453
148
loadParameters; for roundnum = 1:params.NUM_ROUNDS try summed_norm = load3DImage_uint16(fullfile(params.registeredImagesDir,sprintf('%s_round%.03i_%s_%s.%s',params.FILE_BASENAME,roundnum,'summedNorm',regparams.REGISTRATION_TYPE,params.IMAGE_EXT))); catch fprintf('Failed to load round %i\n',roundnum) ...
7e13da13213510b15394b171da52d3629222b5f4858417acd055848aa52d3aed
MATLAB
5,458
136
function taft_runonce_select_trials() % taft_runonce_select_trials() % % Load behavior, retrieves indices of trials on which certain relevant % behaviors/ conditions happen (Go/ NoGo, Win/ Avoid, congruent/ % incongruent), save indices as separate files under TAfT_Betas/selTrials. % Mind setting the root directory in ...
aa0aa9ff7b76bb40b3cfd2a08de58f4e6c2d3e7dc34ab33ce8afd279d6c82b9d
MATLAB
5,460
185
function [traces, tracesExist] = measure_ROIs(self, objPI) %measure_ROIs - Measure the ROIs and return the traces % % [TRACES, TRACES_EXIST] = measure_ROIs(OBJ, OBJ_PI) measure the ROIS % contained in the CalcFindROIs object OBJ using the CellScan object % OBJ_PI and returns an array of TRACES, as well as a mask ...
3803d3e8bdea13ab6be798a24dcb2939da89cbbee213cbe9ce7894cfe8c78a93
MATLAB
5,464
199
function [tStats] = ttestEffectSize(data1,data2,testName,nUnits,pair,MC,limitP,testType) % Performs two-tailed Student's t-test. Outputs all statistics in a cell % array. Can be used to manually generate correlation information for % compliance with journal manuscript requirements. Can perform paired or % unparied ...
70a984e049ffda3090857399b68f7e6daefff5e3d438decd8a2db4e0c5809066
MATLAB
5,464
156
classdef Test_RawImgComposite < matlab.unittest.TestCase %TEST_RawImgComposite Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) function testConstructor(self) ...
55554abcc6a6575b4c2a71f89023e8d5b9615888279a6d7fc310e68258419ad9
MATLAB
5,469
136
classdef DataFindROIsFLIKA_2D < DataFindROIsFLIKA %DataFindROIsFLIKA - Data from FLIKA-based ROI identification % % The DataFindROIsFLIKA class contains the data generated by % CalcFindROIsFLIKA. % % DataFindROIsFLIKA_2D public properties inherited from Data: % mask - A mask combining all of the other ...
72c60dda121067470fea29a3603d35e264fec58a4c82b3c85ae5c5c05916eb43
MATLAB
5,480
123
%loadSimParams; %% Generate number of puncta, positions and the transcripts load('groundtruth_dictionary.mat') volume_microns = (simparams.IMAGE_FOVSIZE_XY*simparams.IMAGE_RESOLUTION_XY)^2 *... (simparams.IMAGE_FOVSIZE_Z*simparams.IMAGE_RESOLUTION_Z); if strcmp(simparams.puncta_placement_method,'random') n...
ba8df047036cb9d1fc571a4ca4ce53a25d71b8403fb84250cd4c15aa84cf97ae
MATLAB
5,486
190
%op_removeWater.m %Jay Hennessy, McGill University 2017. % % USAGE: % [out, K, wppm, amp, alpha, ph, model]=op_removeWater(in,wlim,Kinit,M,plot_bool); % % DESCRIPTION: % This function removes the water signal from MRS data using HSVD method % described by H. BARKHUIJSEN et al. 1987. % % INPUTS: % in = MRS dat...
e1dd151640bfc7eb57d5b5f927e45a3c4a26ad1b47dc868f415b02fa715f4498
MATLAB
5,486
178
% mv_classify_timextime unit test % rng(42) tol = 10e-10; mf = mfilename; %% Create a dataset where classes can be perfectly discriminated for only some time points [two-class] nsamples = 100; ntime = 300; nfeatures = 10; nclasses = 2; prop = []; scale = 0.0001; do_plot = 0; can_discriminate = 50:100; cannot_discrimi...
75ceaa78cd9bc6b9690fd47e8fc8e5bd38b80cd0b6d9b0fdaa2ab28e1af0aca9
MATLAB
5,490
169
function make_tlbx(varargin) %make_tlbx - Create a MATLAB toolbox % % make_tlbx() creates a MATLAB toolbox file, in the root directory, based % on the current master branch of the repository. % % make_tlbx('branch', BRANCHNAME) creates the toolbox file based on the % BRANCHNAME branch in the repository. % % m...
2b4e724c3b1402da838f064095689ece5668645fb9e91361093286bbc8d7ba3b
MATLAB
5,499
139
function varargout = plot(self, objPI, varargin) %plot - Plot a figure % % plot(OBJ, OBJ_PI) plots the default figure for the CalcDetectSigs % object OBJ using the ProcessedImg object OBJ_PI. % % plot(OBJ, OBJ_PI, AX, FIG_NAME) plots the figure on the specified axes % handles AX, and the particular figure speci...
f0cebd357ac1850b1d37bdb5da86550b800b41dd68f409b1d4dac6b88a23cf85
MATLAB
5,505
123
function CorrectData3D(sbxPath, sbxInfo, shiftPath, varargin) % , tforms_optotune , Nchunks IP = inputParser; addRequired(IP, 'sbxPath', @ischar ) addRequired(IP, 'sbxInfo', @isstruct ) addRequired(IP, 'shiftPath', @ischar ) addOptional(IP, 'refChan', 'green', @ischar ) % for scanbox, PMT1 = green, 2 = red. -1 = b...
01eade5bf24df0f9ef0f26673a9e52d8d4e59993cd08fc9da879665e8496ed50
MATLAB
5,509
310
%first column = channel number on probe. Convention is ch. 1 is at top left of PCB %and number wrap around in counter-clockwise fashion. %second column = x coordinate, horizontal distance to reference electrode in microns. Convention is %for reference electrode to be at bottom left corner of array when array %points...
ed7fa9c443af4f858511f01f833f83442a61c1cfe010fd657aa8e4af3ac9afee
MATLAB
5,509
251
close all force % clear load('a0_0_bhv2trialStrct.mat'); load('a19_2_distWithinAndBetweenEachTrial.mat', 'distToMeanSameCondition', 'distToGrandMean') %load("a22_3_NewVarDistanceBootStrp.mat",'distT','distW') %distToMeanSameConditionBt = distW.^2; %distToGrandMeanBt = distT.^2; %load("a22_2_NewVarDistancePermute.ma...
9f266906365ccea07c2c8ef082309db81ffdd7ff7488f8ac8e9065e55f68d71f
MATLAB
5,511
147
function ridObj = downsample(self, dsamp, varargin) %downsample - Downsample the images in space and/or time % % OBJ_DS = downsample(OBJ, DSAMP) downsamples the raw image data of the % RawImg object OBJ, in space and/or time, using the utility function. % % DSAMP, the downsampling factor, can be a numeric scalar ...
d439c0eee4273ad7cac05cbe4adf40f3ec6fdcc21ee0752c90e3f437427ed575
MATLAB
5,511
149
function varargout = process(self, useParallel, varargin) %process - Process the elements of the ProcessedImg object % % process(OBJ) processes the relevant ProcessedImg concrete subclass % according to its specific requirements. % % process(OBJ, USEPARALLEL) explicitly specifies whether to process the % Proces...
a8ec3acd2e05f49ab52d2fcd7da95f4dfcecfe16ef2ffd4b33788620fe1d6b47
MATLAB
5,512
310
%first column = channel number on probe. Convention is ch. 1 is at top left of PCB %and number wrap around in counter-clockwise fashion. %second column = x coordinate, horizontal distance to reference electrode in microns. Convention is %for reference electrode to be at bottom left corner of array when array %points...
b1c16130a4a64db684eccfab9a0acb452a22721041c83812bdadf3612281f52c
MATLAB
5,521
175
function [pacmat, freqvec_ph, freqvec_amp] = find_pac_nofilt (sig_pac, Fs,... measure, sig_mod, ph_freq_vec, amp_freq_vec, plt, waitbar, width, nfft,... dataname, sig_pac_name, sig_mod_name) %function [pacmat, freqvec_ph, freqvec_amp] = find_pac_nofilt (sig_pac, Fs,... % measure, sig_mod, ph_freq_vec, amp...
7e839371711e50de9067e6402d1be063c5b4b912e25b84d15717d05af8e11fcb
MATLAB
5,523
122
function [job, data, data_ups, i_ons] = taft_preprocess_filter_upsample_epoch(job, iROI, iBlock) % [job, data, data_ups, i_ons] = taft_preprocess_filter_upsample_epoch(job, iROI, iBlock) % % For given ROI, for given block, upsample volume-by-volume time series, % epoch it into trials. % % INPUTS: % job = ...
286803be7c88fb8d45e92fac466757f8f4137ffbc4a37081468e5ec17788ec1e
MATLAB
5,526
157
close all; path = fileparts(mfilename('fullpath')); addpath(sprintf('%s/common', path)); [filenames, path] = uigetfile({'*.abf'}, 'Select file(s)', 'MultiSelect', 'on'); if ~iscell(filenames) % if filenames is not an array filenames = {filenames};%make it into one element array end number_of_files = length(filen...
6f1b85751c4dff1f0e6a98ce37f4cf6c02562967787aab908aae0b41dd1e1264
MATLAB
5,536
196
function data = st_plot_EccTemporal(df,binsize) % rmPlotEccSigma - plot sigma versus eccentricity in selected ROI % % data = rmPlotEccSigma(v, lr, [fwhm=0], [plot_position_variance], [plotFlag=1]); % % INPUT % v: view % lr: left (1) or right (2) if FLAT view is used % fwhm: plot sigma (0) or fwhm (1) % plot_pv...
90f46ed0334529a0bc1500c8319c7a1184489092d248d2356a2cc73bf23eda45
MATLAB
5,543
163
function [type1,type2,typem,types,types_pvals] = abcd_statisticalerrors(Corrs,Pvals,fscorrs,fspvals,iter) % Generate Fig 2 of MP % Calculates error rates for a given brain-phenotype correlation % type1 = 0; % type2 = 0; % iter; %% Type 1 error rate % Should in theory be whatever your pvalue is thr = [.0000001]; type...
88356c997ea98768658e10187eaf70ab9e34b2719c094a24386a9d87ae78b087
MATLAB
5,545
155
function [traj, otherChs] = calc_traj(refImg, trajImg, varargin) %calc_traj - Calculate a single trajectory % 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 publi...
c4c740ac0f8c6bf18a7f84d9a153d723bf09e58657f2cc37364b734d36c714ba
MATLAB
5,545
177
function EEGfMRIPav_OutcomeLocked_5_TR(rootDir, iSub) % EEGfMRIPav_OutcomeLocked_5_TR(rootDir, iSub) % % Interactive script. % Visualize trials with EEGlab, identify trials to reject via visual % inspection. % Mind setting your own EEGlab directory! % % INPUTS: % rootDir = string, root directory of projec...
a362defdb324bfae82829949c6b6758be4a588eceda0744847e827781038f768
MATLAB
5,546
168
load(fullfile(dataFolder,'EEG_data','data_time_information.mat')); t0 = timeInfo.infusion_onset-timeInfo.object_drop; load(fullfile(dataFolder,'EEG_data','electrode2_Cz.mat'),'psd','freq','time'); % Compute Baseline spectrum for i = 1:14 preInfusion(:,i) = nanmedian(psd(:,and(time>=t0(i)-10,time<t0(i)),i),2); ...
d012faadfa9b9b98cd0ea6587ec31200951c5f7064b5bc3d97275dd955a7e256
MATLAB
5,552
115
function prepareWindow(obj) % Prepare the window % % zapit.gui.main.controller.prepareWindow % % Purpose % Set up the figure window, attach callbacks and listeners, etc. % % % Rob Campbell - SWC 2023 % Insert and empty image into axes. obj.refreshImage % Set the image c...
ff691d47e209a61be58bb76809bd17907ccf00c786d24d8ad9eb024ef3cf2166
MATLAB
5,554
110
function refShift = CorrectData2D(sbxPath, sbxInfo, regParams, shiftPath, sbxDftPath, varargin) IP = inputParser; addRequired(IP, 'sbxPath', @ischar ) addRequired(IP, 'sbxInfo', @isstruct ) addRequired(IP, 'regParams', @isstruct ) addRequired(IP, 'shiftPath', @ischar ) addRequired(IP, 'sbxDftPath', @ischar ) add...
a37919b7fdc151c43db7ef5090f2df44700e8e480360dec2d4d2d312e3915052
MATLAB
5,565
142
function [sortBetas, Tvalues] = taft_postprocess_TF_selectData(job, betas, iROI) % Extracts time-frequency data for selected ROI, % sort channels across subjects, selects valid subjects, % combine subjects into 4D data, perform one-sample t-test for each % time-frequency-channel bin across subjects. % % Use as % [s...
ae9d09de42b423159235d61ab8a8b5aed4f2226aa062dc41605c312a7e6511dd
MATLAB
5,565
176
function [pacmat, freqvec_ph, freqvec_amp] = find_pac_nofilt_win(sig_pac, Fs,... measure, win_length, overlap, sig_mod, ph_freq_vec, amp_freq_vec, plt, waitbar, width, nfft,... dataname, sig_pac_name, sig_mod_name) %function [pacmat, freqvec_ph, freqvec_amp] = find_pac_nofilt_win(sig_pac, Fs,... % measure...
123c6a3cd4c508a5a66fde196e12c0b67447b41db06ba53d4dbace9b936937b3
MATLAB
5,572
168
% ELIMT_TREE Replace multifurcations by multiple bifurcations in a tree. % (trees package) % % [tree, ntrif] = elimt_tree (intree, options) % -------------------------------------------- % % Eliminates the trifurcations/multifurcations present in the tree's % adjacency matrix by adding tiny (x-deflected) compartments...
098a7eaa552de59e22b0438c6bd60e09826deca2058abd8ec681a1ea37f04338
MATLAB
5,575
145
function performAffineTransforms(moving_run,do_downsample) loadParameters; if do_downsample filename_root = sprintf('%s-downsample',params.FILE_BASENAME); image_type = 'DOWNSAMPLE'; else filename_root = sprintf('%s',params.FILE_BASENAME); image_type = 'ORIGIMAL'; end %params.MOVING_RUN = moving_run; ...
3b9bae5a8e9d644114fecfba69e01b138b1908a14a6f89adfcd8d8d42a2e4efa
MATLAB
5,577
174
function self = calc_diameter(self, imgSeq, frameRate, doInvert, t0) % 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 Software Foundatio...
7effe3437d8f6787d9a367c628f59cf1f98cd4dc8058896a16bda2fcfd235689
MATLAB
5,583
149
function Combine_Confound_EVs_Subject(iGLM) % Combine_Confound_EVs_Subject(iGLM). % % Will take % - 6 realignment parameters % - cerebrospinal fluid (CSF) signal % - out-of-brain (OOB) signal % - spikes in relative displacement % and combine those into a single matrix. % Will concatenate blocks to yield single matri...
40b3ea3a6cc7ed327d5db7c1bfa78fdd2c15466d773c51ac593f369bca3b59c0
MATLAB
5,589
128
function minterf = t2n_makeNseg(tree,minterf,par,mech) % This function calculates at which position of each cell there will be a % segment node in NEURON. This is necessary for T2N to correctly translate % TREES toolbox node information into NEURON section and segment information. % % INPUTS % tree single TREES t...
a88f91abf2a677c532964627335772c4f579bef8e4cbcd06d4a930539911f950
MATLAB
5,594
229
function result = WriteYaml(filename, data, flowstyle) import zapit.yaml.* if ~exist('flowstyle','var') flowstyle = 0; end if ~ismember(flowstyle, [0,1]) error('Flowstyle must be 0,1 or empty.'); end result = []; [pth,~,~] = fileparts(mfilename('fullpath')); ...
f4368f18260d2325935f7d03f0cb94f06ef707cce79798f3df8b3d89aa5de03a
MATLAB
5,594
195
function varargout = import_image(self, channels, calibration, downsamp) %import_image - Class method to import/create the BioFormats % 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 Gener...
6682e2026442e3afab1d5079c56886e2cf7a9d3f20c1f3bbaebd1ebd21811c54
MATLAB
5,601
131
function [bandwidth,density,xmesh,cdf]=kde(data,n,MIN,MAX) % Reliable and extremely fast kernel density estimator for one-dimensional data; % Gaussian kernel is assumed and the bandwidth is chosen automatically; % Unlike many other implementations, this one is immune to problems % caused by mul...
48a0b45f977ccda5fdd67973414235fae34c610b5a3103a03d00efed9d269160
MATLAB
5,612
111
function loco = GetLocoState(expt, loco, varargin) % Determine locomotive state using a Hidden Markov Model IP = inputParser; addRequired( IP, 'expt', @isstruct ) addRequired( IP, 'loco', @isstruct ) addParameter( IP, 'var', 'velocity', @ischar ) addParameter( IP, 'Nstate', 2, @isnumeric ) % Nstate = 2; % still/m...
f202b1d50a9249f13db9359a3a0d00fc39102b6b61f85e0e123ecf0458642fd2
MATLAB
5,612
186
% op_alignScans_fd.m % Jamie Near, McGill University 2014. % % USAGE: % [out,ph,frq]=op_alignScans_fd(in,in1,fmin,fmax,tmax,mode); % % DESCRIPTION: % Use spectral registration on a limited frequnecy range to align two % separate MRS datasets (align in to in1); % % INPUTS: % in = input (spectrum to be registered to ...
1b63e508965d08ba9654e76f55dc7f2e93085d48d4ce794111002514e151a064
MATLAB
5,614
173
[full_model,synFun] = fittingmodel('eq1'); load(fullfile(dataFolder,'simulations','trend_peak_interactions','mixed_dynamics')); psd_baseline = mean(psd_baseline,2); psd_high_oscillation = mean(psd_high_oscillation,2); psd_high_aperiodic = mean(psd_high_aperiodic,2); psd_high_both = mean(psd_high_both,2); psd_asynch =...
960d913dabd3fb9829489920854ab61133b057c898222eb73430ddd790ea63d0
MATLAB
5,622
133
function laserFit = fitLaserPowerCurve(controlValues, sensorValues, doPlot) % Fit the measured laser power curve and (optionally) plot it % % function laserFit = zapit.utils.fitLaserPowerCurve(controlValues, sensorValues, doPlot) % % Purpose % Fit the relationship between laser control voltage a...
5b4046621c3b211ee9a60972f7d3abfd61828dcbb99f01b933d4e8336a911ac0
MATLAB
5,627
174
%use aligned common cells to register all FOVS load('E:\learningAnalysis\summaryManyMice_includingOldEnvBadMoreMice\foldersAll.mat'); % foldersAll{3}='E:\ID20210206\findCells\loc2\subsetFOVsWithOldNo11\analyzeCells'; %above: fix one mismatch between fodlersAll and foldersAllN load('E:\learningAnalysis\summaryManyMi...
3db0c12e0ba5a169b63409e374396f829f7754ccf959ccf8bbfcd08c099b598d
MATLAB
5,630
141
classdef (Abstract) CalcDiameterLong < CalcDiameter %CalcDiameterLong - Superclass for CalcDiameterLong classes % % CalcDiameterLong is an abstract superclass that implements (or requires % implementation in its subclasses via abstract methods or properties) % most functionality related to CalcDiameterLong object...