sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2dc5fea6ec34b10acf7b34b886bfd5cfb515348084342dae5dd18525434fb363
MATLAB
3,279
97
function calibrateScanners_Callback(obj,~,~) % Initiate the proces of calibrating the scanners with the camera % % zapit.gui.main.controller.calibrateScanners_Callback % % Purpose % The scanners and camera must be calibrated with respect to each other. This % method does this. if nargi...
dd5de6ec0ab9e3c8d35ddf16c3a5a6869dc3951a65fe15b3659280df121882c0
MATLAB
3,284
87
function varargout = plot(self, objPI, varargin) %plot - Plot a figure % % plot(OBJ, OBJ_PI) plots the default figure for the CalcMeasureROIs % 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 spec...
6f90524f5d8349cabbf22141bbebb7385689f0908d87ea827f0c4bcd05f4ae40
MATLAB
3,289
128
cd ..\ load('foldersAllIndvFOV.mat'); cd('dfofTrack'); %% p=pwd; folders=foldersAllIndvFOV; folders=folders([1 2 3 4 5 6 7 8 9]); allCellsDfof={}; allCellsDfof_sig={}; for n=1:11; allCellsDfof{n}=[]; allCellsDfof_sig{n}=[]; end % M=[]; for n=1:length(folders); disp(n) for ...
433798166ef4751fbdab3696448e91d50977900c539e7eb389449f56ce0decfe
MATLAB
3,295
109
% op_getLW.m % Jamie Near, McGill University 2014. % % USAGE: % [FWHM]=op_getLW(in,Refppmmin,Refppmmax,zpfactor,suppressPlots); % % DESCRIPTION: % Estimates the linewidth of a reference peak in the spectrum. By default, % the reference peak is water, between 4.4 and 5.0 ppm. Two methods are % used to estimate the ...
8ac235dfdb26b1990e34dda78c6794026a4beeabd80270b23950b85fdd318b7b
MATLAB
3,302
288
%new version (fixed by Shinya Ito): %first column = numbering of channels on probe PCB connectors looking from %the top. %second column = numbering of channels on head stage amplifiers. headstagewiring = zeros(256,2); headstagewiring(1:256,1) = 1:256; headstagewiring(1:32,2) = 32:-1:1; headstagewiring(33:64,2) = 64...
7673fa70e9c9d5854f6673e4e7aa876645665a7d41d84f5d63115afba5fb42b7
MATLAB
3,306
91
function make_mex() %make_mex - Compile relevant C, C++, and MATLAB functions into MEX files % % make_mex() compiles relevant C, C++, and MATLAB functions included with % this package into MEX files using the InstallMex utility function (for % C and C++ files) and the MATLAB coder (for MATLAB functions). % % Be...
3d7fbd16d6c85e43ae801e7fd806ab3f0f6b9f54375e2a8abe483b35e0cef1a2
MATLAB
3,307
104
% this code will read all the gaze files from the trials and covernt them % to the image coordinate. clear close all force imSize = [733, 977]; pix2deg = 34.910; hWB = waitbar(0,'checking the trials ...'); load a0_3_0_extractingTheMorphingDataFromAnalyze1 %load tirals info load('a0_0_bhv2trialStrct.mat'); I = arra...
d1881565ffe21b12bd2a38f73cc40d6128ca4f45c66bbcbf462d4e6c5823de36
MATLAB
3,310
131
% SYN_TREE Steady-state synaptic electrotonic signature of a tree. % (trees package) % % syn = syn_tree (intree, ge, gi, Ee, Ei, I, options) % --------------------------------------------------- % % Calculates the steady state potentials with a given synaptic input. % % Input % ----- % - intree ::integer: inde...
8afa581201a5d7bbeb612c9825ff131bf76e9652b96fa40dc45498dd9df2706c
MATLAB
3,311
140
%% clear; close all; clc good = 1; bad = 0; use = bad; if use cd('Z:\SNM\labMembers\YG\data\learningAnalysis\summaryManyMice_includingOldEnvGoodMoreMice\commonUniqueCells') outFolder = 'Z:\SNM\labMembers\TM\Novelty_Analysis\clusterMan\good'; else cd('Z:\SNM\labMembers\YG\data\learningAnalys...
a84558972bc64d1bbfb91ef29bd9adc6ac2d40239b813ccf6eadbd8188596645
MATLAB
3,316
180
%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...
b817285f69c9adb2c36843a17a11d63a6c66916df4a2a6631cc2030f880637b0
MATLAB
3,318
133
%rf_hs.m %Jamie Near, McGill University 2020. Based on old code from 2007. % % USAGE: % [RF,FM,mv,sc]=rf_hs(N,n,tbw,Tp,trunc,thk) % % DESCRIPTION: % this funciton creates a GOIA gradient modulated adiabatic pulse, using % the method of gradient modulated offset-independent adiabaticity as first % described by Tannus...
484f87a7fe1fc60c0fe37c172d16b4988fad4b5f49b16776dd7eb6276fdc954d
MATLAB
3,321
123
dblist=dir('*_data_*.mat') minrelaxdur=0.03; %minimal duration of the relaxed/silent phase_MU twin=0.5; %timewindow in second BurstTiming_CTL=[]; BurstTiming_WK7=[]; %temporary for k=1:length(dblist) load(dblist(k).name) %%EXTRACTING DATA %stim timebase sttemp=[]; c_st=1; for s=1:50:length(stim.time...
32b28915d63077c82cf3756a2d9d8041b04c9cd341d37c3c313d60da8997e2b6
MATLAB
3,331
181
%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...
4b4dcd7e377c0faa448969ffa79f7f6b8dd0ec7bcd97e9033898295eedbc1218
MATLAB
3,331
181
%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...
51db3aa681fbc84f1e01d4966a18e69cd80f7ed56cb48a1f76c046bb66a20c40
MATLAB
3,331
181
%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...
e2f7915dcac4aec425608db31f2d177c4a0abc61c6e62aba37be08483cc50e55
MATLAB
3,331
100
function softwareTimedVoltage % Example showing software-timed analog input using the Vidrio dabs.ni.daqmx wrapper % % function vidrio.AI.softwareTimedVoltage % % Purpose % Describes how to do software-timed analog input using Vidrio's dabs.ni.daqmx wrapper % This is unbuffered or "on demand...
02e2d7a125c842d5d96175d59fe73617adb493526b2d1f202b16933116a2c3f7
MATLAB
3,332
181
%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...
dcc7cd85a53e01a493af54c74bf8271ab8c46e42326a0670b10f98c91b7a2bb1
MATLAB
3,332
105
% SWC_TREE Export tree to swc-format. % (trees package) % % [name path] = swc_tree (intree, name) % ------------------------------------- % % Exports a tree to the swc-format, a matrix with 7 columns: % [inode R X Y Z D/2 idpar] % node index inode is usually from 1..N and idpar is the direct parent % index. The root...
11085964177aa25275893259ac922b3dbec358f1c718a3e2fc5bf309b48cee61
MATLAB
3,334
181
%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...
17769346262d9d7aadbd3df82a51a6f2fb1669b5847ac9b8b8c2a5f8fd23d29e
MATLAB
3,334
181
%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...
5a306863576206f962904e1a916afdd65fed306f472b0ebaea854c7ef56864f6
MATLAB
3,335
92
clearvars clc close all %% parameters allNeurons=[1]; %Add neuron number here amplitudes=[0 20 50 100 200]; conditions = {'ACSF','BQCA', 'TD'}; preStimDuration = .1; postStimDuration = .1; %% loading And Filtering Data cd '\\researchdata.anu.edu.au\\...' %specify the directory to load files window=0.05; ...
9c31c7d4789274824e77d98431da063089691c59060c974ffc8694bddfb1f8be
MATLAB
3,335
181
%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...
77756dac1e4ccd5d7da2a2072e29c29d4aac3a9738d604274e16ce3d88d532c0
MATLAB
3,337
182
%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...
450303648803204bc1349e4e7ff6693cb6c0b30863a668496a744abcacfb3b36
MATLAB
3,338
89
function mv_print_classification_info(cfg, X, clabel, X2, clabel2) % Prints information regarding the classification procedure, including the % cross-validation procedure and the dimensions of the input data. This % function is called by mv_crossvalidate, mv_classify_across_time, and % mv_classify_timextime. % % Usage:...
791d99a7a3276caf94991a1e99c8bb2aa55e3f6c4294c161b56e919ced1b1fe8
MATLAB
3,340
82
function [job, data] = TF_prepare_generic_data(job, data) % [job, data] = TF_prepare_generic_data(job, data) % % Add aggregated TF-domain data sets per subject across conditions, per % condition across subjects, and both. % Creates data sets that are only dependent on the conditions used for % aggregation; NOT on con...
d4e6e4775c443edd3dcc196802c4f9f31f4c58df9b0258f210f0980fd0020427
MATLAB
3,340
182
%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...
98f5a9fe5aa285a5d431c82420c62d52552d0a90ce43971df08ec2767ff7c02c
MATLAB
3,347
76
function [final_tform, align_vol] = OptoAlign_rigid(ref_vol, z_ref) % Nz = size(ref_vol,3); if nargin == 1, z_ref = round(Nz/2); end %temp_ref = ref_vol(:,:,z); figure; %temp_trim = [0,0]; % y, x metric = registration.metric.MeanSquares; optimizer = registration.optimizer.RegularStepGradientDescent; imVi...
070a679df38d495dd1a96f5cdb7577a91f44259b9e8719788aca51120c5f914d
MATLAB
3,350
100
%sim_megapress.m %Jamie Near, McGill University 2014. % % USAGE: % out=sim_megapress(n,sw,Bfield,linewidth,sys,taus,refoc1Flip,refoc2Flip,editFlip) % % DESCRIPTION: % Simulate the MEGA-PRESS sequence with instantaneous localization and % editing pulses. Provides the ability to specify the flip angle of each ...
1fb76e0929944f3fb09ddb092d12fc888d5d12cddfe664f453851b9525f433d3
MATLAB
3,353
94
function data = edf2fieldtrip(filename) % EDF2FIELDTRIP reads data from a EDF file with channels that have a different % sampling rates. It upsamples all data to the highest sampling rate and % concatenates all channels into a raw data structure that is compatible with the % output of FT_PREPROCESSING. % % Use as % ...
a9acf0d6f54239d84ca725ba06a39a11114abc847c029813b228b22e5ee4bcab
MATLAB
3,356
181
%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...
219c518ead906cbdf1de75ae26e403987b23321180a6bfc1a659c1e704aa22ef
MATLAB
3,357
94
function simulateCombSimpleModel(baseModel, outFilename, fracA, TNM, TNG, TAM, TAG, statUtil, mobUtilN, mobUtilA) % simulateCombSimpleModel % % Generates a combined model from the params supplied and runs a simulation. % The fluxes of glycolysis, mitochondrial respiration, and both are then extracted % for both ne...
49050bb3d10771d661aebbb37d3001b16938c283433b38cc0498d0552ba5688a
MATLAB
3,357
125
% mv_crossvalidate unit test rng(42) tol = 10e-10; mf = mfilename; % Generate data nsamples = 100; nfeatures = 10; nclasses = 2; prop = []; scale = 1; do_plot = 0; [X, clabel] = simulate_gaussian_data(nsamples, nfeatures, nclasses, prop, scale, do_plot); %% accuracy on test set should be lower than on training set c...
65a33725e26252a0e9ed4994a46df464c8d4b10090e7d8097c27912c4a9ea3cb
MATLAB
3,365
182
%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...
0a435c92c3bdef32d0294cbf5d3b564eb96413a411aad985b7fdf9ed764d4dad
MATLAB
3,368
181
%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...
3c4b66f7fef766963e99192a3ef0e278e225f30441370c901ff58bf86c4e0df2
MATLAB
3,370
182
%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...
3668894d653d3dd407c4c0b32b0bd80d62e18b33141168dcb5ae869d7030cc23
MATLAB
3,371
181
%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...
516b5f394899a2fd07aa1999f5f4ea7869bba7b99acb40a3541ab0a9241abc3e
MATLAB
3,373
130
function figureS1(dataFolder) if(nargin<1) error('Path to data required as input argument. Data can be downloaded from link in README file.'); end for i = 1:11 render_neuron_morphology(i,dataFolder); end end function fig = render_neuron_morphology(mType,dataFolder) mTypes ={'L23...
ad7b608ff3a53381f5216471cef4bcfe78814a1b711402fcf4ad6091e3c5dbbb
MATLAB
3,373
125
clear all % Define PB and FB angles thetaRight = -[67.5 112.5 157.5 157.5 -157.5 -112.5 -112.5 ... -67.5 -22.5 -22.5 22.5 67.5]; thetaLeft = -[-67.5 -22.5 22.5 22.5 67.5 112.5 112.5 ... 157.5 -157.5 -157.5 -112.5 -67.5]; thetaFB = -((0:30:330) + 15); % Parameters from data fit a = 29.2...
7785db6cda7effc2caf4981622ddcae5a28344e354be862e6d2e771c654c0afc
MATLAB
3,374
90
function[RowShifts,ColumnShifts,ZShifts] = InterpolateZshift(ReferenceVolumes, Volume, WidthCorr) % COMPUTEZSHIFTINTERPOLATE: calculate Z shifts % % Inputs: % ReferenceVolumes -- 4D matrix of uint16 or other, dim (x,y,z/n,t) % Volume -- 2D matrix of doubles, dim (z,t) % WidthCorr -- 2D matrix of d...
b0faabef82a9c77772a9443b6efb4dd8597c0efb09b9b2caf89724631e7f37ef
MATLAB
3,374
77
function controlVal = laser_mW_to_control(obj,mW) % Convert a desired value in mW to a control voltage for the laser % % function controlVal = zapit.pointer.laser_mW_to_control(mW) % % Purpose % The user will request a laser power in mW at the sample. If a calibration curve has % been genera...
cfe94a670f6828a7a564b6b6d50f04d6009070e08103e17b4251b0282b5cbc14
MATLAB
3,377
97
function self = detect_sigs(self, objPI, tracesNorm, frameRate, roiNames) %detect_sigs - Detect the signals % % 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 publ...
437c58d79b98c818cd4a2c2e557d805a71733f76bdb39d9d6d71ada7f97f4e96
MATLAB
3,378
133
load('foldersAllIndvFOV.mat'); fieldD={};%day by day distribution fieldDA={};%day by day distribution and amplitude p=pwd; for n=1:11; fieldD{n}=[]; fieldDA{n}=[]; for m=1:length(foldersAllIndvFOV); cd(foldersAllIndvFOV{m}{n}); load('PValueClassifier_KY2_6_sig\al...
d62ac7f536ff58fcab2b7aff77072e348e7c773699bf78bb9d6822dc3edee2cb
MATLAB
3,378
102
function TFplot(job, data, zlim, yScale) % TFplot(job, data, zlim, yScale) % % Creates time-frequency plot (2D heat map) contasting two conditions. % % INPUTS: % job = cell with relevant fields for plotting settings, % required fields: % .TFtiming = vector of 2 scalars, start and end tim...
a258f2c6175e528915d49adfd89c6debc005a6b084481bac6915a29ca148add1
MATLAB
3,379
93
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...
4364990dbd8347919732719494449704cf4f7a7402f773ee785c2f4b6364126c
MATLAB
3,380
181
%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...
d40c5506bc5722b90004809ca695958c913925c302f7affcd09a9a1d927d5ee7
MATLAB
3,380
181
%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...
4de01abeb60573a2cb40f786b9a626d0a70ac4af0f0c353dfb0ed0e5637561d8
MATLAB
3,381
96
function img = resize_img(img, szImg, varargin) %resize_img - Convenience function to resize an image, with warnings % % IMG = resize_img(IMG, [NUMROWS NUMCOLS]) resizes the image IMG so that % it has the specified number of rows and columns. % % IMG = resize_img(IMG, [NUMROWS NUMCOLS], METHOD) specifies a method...
aa4c74d84d2cda3a605d1dad9df493ed6e5a1337e1329de327d0be37a3ff0fbb
MATLAB
3,383
106
function [lambda, fntwrk, gmf, ixAMPAmf] = solve_gALL_lambda_fntwrk_iX(sx, sy, x0ini, xx0ini) % Solves MF & LS equations for synaptic conductances, instability growth % rate, and oscillation frequency given external and population firing % rates. % % External and population rates are passed through % global ...
cf2d28705a3ec3d68626cf9aa3a3a4f40b523c68826793342d18d5e89838ad5a
MATLAB
3,383
181
%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...
556658b696caf3b6b1c37286a3353f8313dc21b37209b18f8e803339802c5e8c
MATLAB
3,390
116
clear close all force warning on imSize = [733, 977]; imSizeCent = fix([733, 977]/2); pix2deg = 34.910; y1 = imSizeCent(1)+(-130:70); x1 = imSizeCent(2)+(-120:0); y2 = imSizeCent(1)+(-130:70); x2 = imSizeCent(2)+(0:120); %load tirals info load('a0_0_bhv2trialStrct.mat', 'dataExp'); load('a0_3_0_extractingTheMorphing...
65cc3b23c6ba83a4286547acb924b09782d8c4f43d237c7c6afd379a02015e92
MATLAB
3,391
91
function [MM, bgCh] = assemble_mixmat(img, maskFPBG) %assemble_mixmat - Assemble the mixing matrix based on masked regions % % MM = assemble_mixmat(IMG, MASKS) assembles a mixing matrix MM for the % image IMG using the exclusive fluorophore regions identified using % MASKS. % IMG must be an MxNxCxP image array,...
70234545b2658b42f9070da53eeebcbfe81f9c9cfccf5ec5325c017594d56a71
MATLAB
3,395
90
%% Note Filter Example % % <html> % Import streaming EEG data into Matlab using TDTbin2mat <br> % Filter around behavioral events that were timestamped by the user % using the Run-time Notes feature in Synapse <br> % Plot each occurrence in a subplot organized by Note type <br> % Good for sleep scoring and behav...
06285c08df3ce227c35fd6c9f33c2c35476e7ad481a1ab191461ea1c56ae5d88
MATLAB
3,397
90
%% Note Filter Example % % <html> % Import streaming EEG data into Matlab using TDTbin2mat <br> % Filter around behavioral events that were timestamped by the user % using the Run-time Notes feature in Synapse <br> % Plot each occurrence in a subplot organized by Note type <br> % Good for sleep scoring and behav...
222a8a8c72c3914d1d95abf613a046f7350021891727dcf7413126f417820b94
MATLAB
3,399
92
% folder of the raw video dir_video='..\..\demo\data\'; % folder of the GT Masks dir_GTMasks=fullfile(dir_video,'GT Masks\'); % name of the videos list_Exp_ID={'YST_part11';'YST_part12';'YST_part21';'YST_part22'}; fs=10; % frame rate before=15; % number of frames before spike peak after=60; % number of frame...
462c0770de2a6409db6f7b27f1dd21cce220d4e0ff5a5aa7b03f27801efe9944
MATLAB
3,401
58
function periBout = GetBoutData( boutScans, T, loco, deform, fluor, deformVars, periParam ) % , isCSD Nbout = numel(boutScans); periBout = struct('Nbout',Nbout, 'dur',nan(1,Nbout), 'scan',[], 'Nscan',nan(1,Nbout), 'iso',[], 'T',[], 'Tstart',nan(1,Nbout), 'Tstop',nan(1,Nbout), 'preScan',[], 'boutScan',[], 'postScan'...
a94de0f213095926ccfaf2871642ff81c24a8dbcd681052eef7e2230dcf755c3
MATLAB
3,402
106
function [All, outVars] = defineDistanceTypes(All, outVars) numExps = numel(All); for ind = 1:numExps pTime =tic; fprintf(['Processing Experiment ' num2str(ind) '...']); if isfield(All(ind).out.exp, 'dataToUse') dataToUse = All(ind).out.exp.dataToUse; else disp(['ind ' num2str(ind)...
6078dd3df59ed177a6578bc58b400e5158653dd110347daa7c0661e60b55533d
MATLAB
3,404
110
% fida_depCheck.m % Jamie Near, Sunnybrook Research Institute 2024. % % USAGE: % [flist,plist]=fida_depCheck(in); % % DESCRIPTION: % Returns the full list of file dependencies and matlab product dependencies % within a particular FID-A toolbox (or within all FID-A toolboxes). % % INPUTS: % in = The name of the FID-...
e51a33c6f037eb0e63f38250e31c869067efce620f2e7c658ec21e296e427512
MATLAB
3,405
181
%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...
8375fbbbdcde02218250e6727823ecebc9b0e4954727ee0d48a175d8d427c6a9
MATLAB
3,406
102
function [ephysWaveform,scaleFactor] = filterForEphys(obj,inputWaveform) % Filter the laser waveform for ephys: turning square waves into sinusoids % % function ephysWaveform = zapit.stimConfig.filterForEphys(obj,inputWaveform) % % Purpose % By default the laser is gated by a square wave which i...
6859c6e603d5f272e46eed7c51c3422d83a45a95c634fd66fc34a9d5fe43f402
MATLAB
3,407
74
function success = loadStimConfig(obj,pathToConfig) % Load a stim config and add as property % % success = zapit.pointer.loadStimConfig(pathToConfig) % % Purpose % Load a stim config file and attach it as a zapit.stimConfig % to zapit.pointer.stimConfig and set up the parent property. % ...
165540bdde55ecd66a92c98b617a0436989d069d23c05460af2dd593c1a74bef
MATLAB
3,408
140
close all force % clear load('a0_0_bhv2trialStrct.mat') %} NImage{2} = [... 2 4 5 6 8 10 12 13 17 18 19 20 26 29 35 ]; NImage{1} = [... 7 11 25 27 38 39 40 47 49 53 56 60 9 22 28 41 42 ...
aac902831263236613d2a63778334317521dc4de143b86f3ffdc136f8b220a99
MATLAB
3,414
93
function [totModel] = buildSimpleAstroNeuronModel(baseModel, fracA, TNM, TNG, TAM, TAG, statUtil, mobUtilN, mobUtilA) % buildSimpleAstroNeuronModel % % Generates a combined model having one astrocyte model and one neuron model. % The models can exchange lactate. Glucose is administered via the neuron model (untagged) %...
806be20d5eae221c782d9ca418b38077dbde39fc61642d944b2141ff9fe3042a
MATLAB
3,423
113
% CYL_TREE Cylinder coordinates of all segments in a tree. % (trees package) % % [X1, X2, Y1, Y2 ,Z1, Z2] = cyl_tree (intree, options) % ----------------------------------------------------- % % OR (if only one output): % % M = cyl_tree (intree, options) % ------------------------------ % % Uses the adjacency m...
8715395f0303fca788b88d98f98bae98dd233f8611327e43ef90685abdb19147
MATLAB
3,424
84
Nz = size(ref_vol,3); z_ref = round(Nz/2); metric = registration.metric.MeanSquares; optimizer = registration.optimizer.RegularStepGradientDescent; imView = imref2d(size(ref_vol,[1,2])); %temp_ref = ref_vol(:,:,z); figure; temp_trim = [0,0]; % y, x dX = zeros(Nz,1); dY = zeros(Nz,1); blank_tform = im...
6608b4260d8ba557c15a4da32d63d394239f06700ebd6b037278ffafddf42c8f
MATLAB
3,425
72
load('Fig3DoubleDissociationEffect') for ntp = 1:49 [h,p(ntp),dc,stats] = ttest2(-AMY_structure.real_t_val_aro(ntp,:) , -AMY_structure.real_t_val_discrimination(ntp,:) ,'tail', 'right') ; % t_val(ntp) = stats.tstat ; end h = p<=0.05; [labeledA, numRegions] = bwlabel(h , 8); for n_cluster = 1:numRe...
f81951dba3043b1b1c70e0aac3f6c4877cc2e690ae55ac0ffb84d84ba6225502
MATLAB
3,430
102
function [lambda, fntwrk, gN] = solve_gNMDA_lambda_fntwrk(xvar, yvar, sync, nuX0, g0, omega0, xx0ini) % Solves MF & LS equations for population firing rates, instability growth rate, % and oscillation frequency given conductances and external firing rate. % % Population rates are passed through global variable s...
65e0e09dca99f062aeb6004234d0ab0c808e0cf507af30beb4d24b2a2adee838
MATLAB
3,431
100
function [loglik] = EEGfMRIPav_cbm_mod04(parameters,subj) % Standard Q-learning model with delta learning rule and with Go bias and % instrumental learning bias. % ----------------------------------------------------------------------- % %% Retrieve parameters: % 1) Feedback sensitivity: nd_rho = parameters(1);...
5e2cce4ff56f9e540bcb1dbac5a2d6fd1df0255ef19dbdba2371b0bdf7195b93
MATLAB
3,440
181
%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...
fd2d49dd41b8a5e02c5a4d430e7fad4003e494457e3c9b763f2a0f7c8c99364f
MATLAB
3,442
98
function [ph_filt_signals, amp_filt_signals] = filt_signalsWAV(sig1,sig2,... Fs, ph_freq_vec, amp_freq_vec, measure, width) % function [ph_filt_signals, amp_filt_signals] = filt_signalsWAV(sig1,sig2,... % Fs, ph_freq_vec, amp_freq_vec, measure, width) % % Returns cell arrays 'ph_filt_signals' and 'amp_filt_signals'...
ec1466e90d90f03ce1f81b4c0d3648e831f0bc234ee5fe68c17c6486a75f0558
MATLAB
3,443
181
%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...
0aba4fdd167798969c57173b287b7a2e8bf7e6b02bbd5b18c04a7c416de748db
MATLAB
3,447
133
function [Y,Nsum] = moving_average(X,F,DIM) %MOVING_AVERAGE Smooths a vector through the moving average method. % % Syntax: % [Y,Nsum] = moving_average(X,F,DIM); % % Input: % X - Vector or matrix of finite elements. % F - Window semi-length. A positive scalar (default 0). % DIM - If DIM=1: smo...
6ad8dd9e6552e8d11723e5f9e9409848451e251765f3a8982cc2b5f303663015
MATLAB
3,459
110
function tfce_progress(action,varargin) % Display progress and remaining time % FORMAT tfce_progress('Init',n_iterations,process_name,iteration_name) % Initialises progress tool % % FORMAT tfce_progress('Set',value) % Sets iteration. % % FORMAT tfce_progress('Clear') % Clears the progress output and prints processing t...
e9d66f806fc2ed07c0c930fc8cc0df274565c6f0e2e6fb0e6942730d97a79d65
MATLAB
3,459
95
function [m]=mesh_extract_points(m,chunk_points_logical,varargin) % Returns a mesh which contains only the selected points (i.e., nodes) % and affected simplices and data. % USAGE: [m] = MESH_EXTRACT_POINTS(m,chunk_points_logical) % Mirko Windhoff, 2009 % updated by Alexander Opitz, 2016 % modified by Ivan...
853e72cc7725e8ccacce570810ab33bd2450fcf4032f22558b1d8180634316ba
MATLAB
3,460
82
%% READ ME: % % Written by Zachary Sanger, M.S. % University of Minnesota % Biomedical Engineering Department % May 16th, 2023 % INPUTS: This code requires a path which defines the location for whatever folder your data % is stored. Filename can be changed to a structure if you plan to load % multiple ".json" files....
c27aa167d30b6a149ac098e8c43aa484b24e58800765b7149c7a7387310ded4f
MATLAB
3,478
128
classdef testCamera < handle % zapit.testCamera % % Barebones class to test the camera stream to be used in the optostim box % % e.g. % C = zapit.testCamera % % % Now stop and start the video % C.stopVideo % C.startVideo % % % Rob Campbell - SWC 2022 % The foll...
aaedf038801be9e47be2c89a3aa10a312e55fce1478f7067339e51f659178cf9
MATLAB
3,480
181
%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...
edc8a87719d1fbc96d9e4f5da7ad0aeed1087b4612e11fcdc21a57773e35c028
MATLAB
3,481
112
%% Load data load('demo_data'); %% %% PLOTTING INTRACRANIAL ELECTRODES AND DATA %% %% First we will plot the brain (the right hemisphere): % You can rotate the brain with the 3D rotation tool (selected by default). % Since you are also rotating the light source, it needs to be manually % reset. To do this, de-selec...
8902ee3f90cd4daac1e0b3d616fa06b0c2eb7ec8a294e7301e129932b8d3d149
MATLAB
3,483
181
%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...
0756e63594c5f7559b2beee50371e6b49f85da13ec45d3b055497523559753b0
MATLAB
3,485
129
% SCALE_TREE Scales a tree. % (trees package) % % tree = scale_tree (intree, fac, options) % ---------------------------------------- % % Scales the entire tree by factor fac at the location where it is (NEW!). % If fac 3-tupel scaling factor can be different for X, Y and Z. By % default, diameter is also scaled (as ...
fbd3436b7614a445f826d169914a502111bae401c8d042f50c936a0995efc6c4
MATLAB
3,486
31
%% To extract the voltage from 32 channels and timestamps for stimuli for experiment 20211021 Record1_data_20211021 = load_open_ephys_binary('D:\Data\optogenetics\Open Ephys\DataFiles\max_ephys1_2021-10-21_16-34-10\Record Node 110\experiment1\recording1\structure.oebin','continuous',1); Record1_stim_20211021 = load...
d972bf54edd1e6e3a9e3817eab487f72654224deb9356e9369811516577d7d8b
MATLAB
3,488
107
% PETERS_TREE Calculates candidate synapses oftwo trees. % (trees package) % % syn = peters_tree (intree1, intree2, spinedis, synapsedis, options) % ----------------------------------------------------------- % % Finds putative synapses of two trees. Loops through all nodes of tree2 to % find all nodes of tree1 closer...
0ffff528b01e7f00cac7445a6ba25040a34619dc366349c3e2d5eb833a8457c7
MATLAB
3,494
112
lambda_E = @(p) pdf('logn',p,log(0.5),1); lambda_I = @(p) pdf('logn',p,log(2.5),1); tauE = @(p) pdf('unif',p,1,3.5); tauI = @(p) pdf('unif',p,5,20); gE = @(p) pdf('unif',p,0.2e-3,2e-3); gI = @(p) pdf('unif',p,0.2e-3,2e-3); erev = @(p) pdf('unif',p,-75,-45); gleak = @(p) pdf('unif',log10(p),-5,log10(0.005)); t1 = 10.^...
b59bf154878cec76bc99c09e645c03e183deb636f7a93e5a7a434bb9016f489e
MATLAB
3,498
102
function val_nuisance % Calibration of the three strategies for nuisance variables. % % Draper-Stoneman permutes the effects of interest in the design, Freedman-Lane % permutes the data after residualising it against the nuisance variables, and % Smith orthogonalises the effects of interest against the nuisance space b...
f5cd2f5fbb7b1e4af67fea172b26e2b2edacb8631727fedc4e4d58dbd9eb47d8
MATLAB
3,498
111
% PRUNE_TREE Prunes short branches. % (trees package) % % tree = prune_tree (intree, radius, region, options) % ------------------------------------------- % % Cleans tree of terminating segment smaller than radius. If two sub % branches are smaller, then the shorter one is deleted first. % % Input % ----- % - intree...
8fd9f84fac54716cad74ac13f546679ef9d99e283241918b9606e63c8c4edf00
MATLAB
3,499
130
function [proj] = KMAproject(labeled,unlabeled,test,ALPHA,options) % Kernel manifold alignment % % Usage : [eigenvectors,eigenvalues] = KMA(Labeled,Unlabeled,NumDomains,options) % % Inputs: % % - labeled: structure with labeled data [1,NumDomains]. % each cell has X (n1 x dim1) and Y (n1 x 1) fi...
97e78e6c450dbd8eaf2c839a7f46a723cf316b1cb692b1362f6163ae293a6e55
MATLAB
3,499
99
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: % %...
2fea20cf92ed6e57f1a366bf0010b475aeef63eebaf10199ddb586db183694cd
MATLAB
3,502
91
function edges = GetEdges(inputIm, varargin) % edges =[ leftEdge, rightEdge, topEdge, bottomEdge ] IP = inputParser; addRequired( IP, 'inputIm', @isnumeric ) addParameter( IP, 'max', [300, 300, 150, 150], @isnumeric ) addParameter( IP, 'minInt', 2000, @isnumeric ) % addParameter( IP, 'show', false, @islogical...
68bfd0d1895514770f84115b485e6fd1c32be58e250ca6f43341492c1b403205
MATLAB
3,503
120
% LOADDIR_STACK load images from a folder into a stack structure. % (trees package) % % [stack path] = loaddir_stack (path, options) % -------------------------------------------- % % Loads all images from a directory to an image stack. Images must have the % same size. But no file error handling. % % the stack struc...
a0d6de1932d7ac9d087c32bd418f243ec5c6ec9c9e37ee8ef48b4aa5edbc3c80
MATLAB
3,504
87
classdef SbxWriter < handle % A class to write SBX files, which keeps track of the current position properties path = []; curframe = 1; info = []; fid = []; end methods function obj = SbxWriter(path, info, extension, force) % Path for savin...
df3336afb298b5fd79d8b0a30db76dd367e0277c90e879aad91658b02ae1eab8
MATLAB
3,505
72
function normalizeImage_cuda(roundnum,do_downsample) %TODO: The CUDA Version of normalization still needs to be improved. See normalizeImage.m % for reference. -DG 2020 09 09 loadParameters; src_folder_name = params.colorCorrectionImagesDir; dst_folder_name = params.normalizedImagesDir; channe...
34c623e85544a0ac96bcac31564c6ae4c757a1e8d39f1d7dcade5da7431c07a9
MATLAB
3,506
113
function varargout = calibrateScanners(obj) % Calibrate scanners with camera: conduct an affine transform to calibrate camera and beam % % function varargout = zapit.pointer.calibrateScanners() % % Purpose % Moves beam sequentially across a series of locations and records the intended vs % a...
bd8b105484f308ea894f33936d53c6549dd86e0ca645b3073d703cd53defe213
MATLAB
3,507
93
function [totModel] = buildSimpleAstroNeuronModel(baseModel, fracA, TNM, TNG, TAM, TAG, statUtil, mobUtilN, mobUtilA) % buildSimpleAstroNeuronModel % % Generates a combined model having one astrocyte model and one neuron model. % The models can exchange lactate. Glucose is administered via the neuron model (untagge...
562fe127930621522b72d94ac3f60958773a8a185cc39434986dad6eb44d0b2a
MATLAB
3,515
127
function val = read_stats(dir,save) val = 0; printdocs = 1; beta = []; load(strcat(save,'/train_stats.mat')); fileID = fopen(strcat(save,'/train_alphabet.txt'),'r'); tok = textscan(fileID, '%s'); fclose(fileID); fileID = fopen(strcat(save,'/train_target_alphabet.txt'),'r'); label = textscan(fileID, '%s'); fclose(file...
2820605332b222271158deb43480c4e783949310135cf44556f72a5049643da0
MATLAB
3,519
101
function plot_imgs_sub(self, objPI, hAxes, varargin) % 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 Foundation, either versio...
1d71c7b1bd1de91585154b7ec46cf902d0e3c450dbc1d4c5daf124e4e9d37ba7
MATLAB
3,522
83
% Compute segregation measures based on Chan et al. (2014) PNAS paper % Both global and network-level measures are created % Function files required: % 1) systemsegregation.m: computes the system segregation measures given the network assignment and FC matrix % 2) mat2col.m: converts the 2D FC matrix to a vector colum...
965ae7fd123b9ab9151fbb403b816fed6f395e55a36f31a06fdaa2867c07b14a
MATLAB
3,522
118
function varargout = plot_default(self, objPI, ~, varargin) %plot - Plot a figure % 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 Softw...
fc55f7e5ecc0ccb587c60ce08326ff9c916c67895e552ab28fee13314ccf5799
MATLAB
3,525
134
function [respvolTotal,timeVector, rawTotal] = getRespCompSliceTR(inputImage,s,TR,interpolationFactor) imSize = s(1:3); imIndex = 0:19:38; respvolTotal = zeros(size(inputImage)); rawTotal = zeros(19,s(4)); for ii = 1:19 inputSG = squeeze(inputImage(:,:,imIndex + ii,:)); imSizeSG = size(inputSG,1:3); ...
977c5694bc140250a7fc2f5cd77fb88a57dc29f52980f8c541603aa904a53eec
MATLAB
3,537
112
function [objID, objZoom, pxSize, experimenter, channels] = parseOME(self) % 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 Fou...
0c68f160dc888f5fc9aca809f010bfe11ab74c5608342f10d064f348e87b2de9
MATLAB
3,540
113
function prop = parsepropval(prop, varargin) %PARSEPROPVAL2: Parse property/value pairs and return a structure. % Manages property/value pairs like MathWorks Handle Graphics functions. % This means that in addition to passing in Property name strings and % Values, you can also include structures with appropriately n...
1ce469f50edc64fef8258b92b09933d71c0f492aea65615f4eb5a0c3db06da3e
MATLAB
3,541
106
function maskFPsBG = select_fp_masks(img, nFPs) %select_fp_masks - Select masks for fluorophore and background regions % % MASKS = select_fp_masks(IMG, N_FP) displays the multichannel image % and prompts to select N_FP regions, each one containing exclusively a % single fluorophore, as well as a mutual background...