sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
60ce8225342703ae691747e17b505dda20034354abbbbc2cd354caacbc2200c5 | MATLAB | 4,701 | 152 | function [c, r, t, cpulse, acq_codes] = tapas_physio_read_physlogfiles_philips(log_files, cardiac_modality)
% reads out physiological time series and timing vector depending on the
% MR scanner vendor and the modality of peripheral cardiac monitoring (ECG
% or pulse oximetry)
%
% [c, r, t, cpulse] = tapas_physio_read... |
713bd98e76c3e87a62e5160585daae4a4eae1f6fdd7f9e972c1d6b6453a240a5 | MATLAB | 4,707 | 161 | % Run Fano factor check to ID how far each cortical area departs from the Poisson assumptions under
% our FI calculation and make sure there aren't substantial difference from
% each other
clear all; close all;
% Load in processed data
load('./analysisFiles/physio/fittingResults_processed.mat');
%% Concatenate data... |
86201c2f42c43aecdd075f340bf224851970dc8bf35701f19a17dfcfa7e2ccef | MATLAB | 4,707 | 126 | function out = LK_RippleDetection_CharacterizeRipples_20220319(mycfg, myeeg)
%
% LK_RippleDetection_CharacterizeRipples_20220319 characterizes ripples.
%
% Use as: out = LK_RippleDetection_CharacterizeRipples_20220319(mycfg, myeeg);
%
% Input #1 is a structure with a matrix that contains the start and end
% indices of ... |
d55d555ce8d14c3762497e820bfb453d186649dd24582baed39a1f0a6cc8f59e | MATLAB | 4,710 | 128 | function varargout = getLaserPosAccuracy(obj, XYdata, backgroundImage, verbose)
% Quantify accuracy of beam pointing
%
% function out = getLaserPosAccuracy(XYdata, backgroundImage, verbose)
%
% Purpose
% Find the coords of the beam location and compare to the desired location. Returns
% resu... |
df5130aabaf9f36afaa3d774c02af096aff83ec479d055ab681c8ceb72450aab | MATLAB | 4,712 | 165 | function varargout = plot_main(self, 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 version 3 of... |
c945cc3dd0845ff7432160305bed70002344042375157f8b5cf0d1ed210d35b1 | MATLAB | 4,714 | 122 | function taft_postprocess_time_topoplot(job, dirs, Tvalues, iROI, startTime, endTime, steps, zlim, isSave)
% taft_postprocess_time_topoplot(job, dirs, Tvalues, iROI, startTime, endTime, steps, zlim, isSave)
%
% For fMRI-EEG regression weights for selected ROI,
% plot a topoplot for given time window ranges (in subp... |
c493aca58a4b537ec1ebb1607515983dd083e6275666bc3f43d7f709d4fc3bed | MATLAB | 4,718 | 155 | % ASYM_TREE Branch point asymmetry.
% (trees package)
%
% asym = asym_tree (intree, v, options)
% -------------------------------------
%
% Calculates for each branching point the ratio of the sums of the two
% daughter branches. The summed values are given by v which attributes a
% value to each node. Typically this... |
72175c7d06944623ac02693a37cbff8ed7de1641a58f287c76b936bd5246cc47 | MATLAB | 4,723 | 127 | load(fullfile(dataFolder,'simulations','simulated_spectra_parameter_sensitivity'));
% Define distributions of parameters
lambda_E = @(p) cdf('logn',p,log(0.5),1);
lambda_I = @(p) cdf('logn',p,log(2.5),1);
tauE = @(p) cdf('unif',p,1,3.5);
tauI = @(p) cdf('unif',p,5,20);
gE = @(p) cdf('unif',p,0.2e-3,2e-3);
gI = @(p) cd... |
7edf550a849b2a77dcfdf3421e57485b89d9f829ae38ca5c7b1e01639c0bda5c | MATLAB | 4,733 | 165 | clear
clc
%% set path
addpath('...\fcn')
addpath(genpath('...\ext'))
%% set directories
data_dir = '...\mammals_connectome';
out_dir = '...\output';
%% load data and set parameters
thresholds = {'0' '0.05' '0.1' '0.15'};
curr_thresh = 1;
load(fullfile(data_dir,...
sprintf('cents_repani_sta... |
0571191af967259315a92f46c40b4da5e8eb2f185fdb381e61fa416df892ed7b | MATLAB | 4,738 | 221 | function [trials,roll,stats] = plotVisFun(file,st,trialsN,params,plotOn,rollON,lickTh)
%%
buffSt = params.buffSt;
buffEnd = params.buffEnd;
timeCue = params.timeCue;
rewCue = 4;
punCue = 5;
if nargin<7 || isempty(lickTh)
lickTh = 0.5;
end
nRoll = 50;
fields = {'like','unlike'};
fCues = [3,2];
... |
baf5568fe81839f844b1ea7f8a0e276ff164621d9f58ad692c8f2d2e6a1c03c2 | MATLAB | 4,744 | 134 | %% compare different cell types
% load the data
clear;clc;
goodF.R = [0,1,1,0.923100000000000,1,0.800000000000000,0.666700000000000,0.800000000000000,1,1,0.750000000000000];
goodN.R = [0.647100000000000,0.680000000000000,0.636400000000000,0.800000000000000,0.533300000000000,1,0.400000000000000,0.727300000000000,0.7... |
6151544ab6786ef2810ad9b74fba383b33bf6179ffcb0420928fb5d6133ed4d8 | MATLAB | 4,746 | 109 | classdef ConfigFrameScan < ConfigMultiple
%ConfigFrameScan - Class containing Config objects for FrameScan
%
% The ConfigFrameScan class is an abstract superclass that is designed to
% contain more than one Config object to simplify construction of
% FrameScan objects. This ensures that a single Config object ca... |
6c72d11eb7c57a5f6858cfdbc556897b2fd0302d547a5176eadf2c64fa2e426a | MATLAB | 4,747 | 149 | function waveformRecorder(devID,fname)
% A simple example showing how to acquire waveforms with hardware-timed continuous
% analog input using using DAQmx via .NET
%
% function waveformRecorder(devID)
%
%
% Inputs
% devID - [optional] 'Dev1' by default
%
%
% Rob Campbell -... |
ffdb4b361634ee3da1b6e100bc102cf3912a535431d168b5b213d84760e6831f | MATLAB | 4,747 | 108 | % op_CSIRemoveLipids.m
%
% Removes lipids from CSI data using L2 regularization. This minimizes the
% equation norm(x - x_0, 2) + beta * norm(W'x, 2)
%
% INPUT:
% MRSIStruct = MRSI structure used in FID-A
% lipidComponents = number of lipid spectra in the lipid basis
% lineWidthRange = range of linewidth us... |
ea582ae9ee146bba5acac99df7ca00fb518bcb30119c1a2dd844df6988cf4c27 | MATLAB | 4,750 | 80 | function [resparr,cresparr,tauarr,atauarr,dtauarr] = resp_eval_v4(slices,avg_factor,tautype_value,taucalc_mode)
% Description - Automatic evaluation of responses
for i = 1:length(slices)
D = diff(slices{i}(:,4));
CV = abs([D ; 0]) >= 0.01; % change vector, marks the position where the changes in hydrogen conc... |
f90708d9a86f47f0c8a755f6ee67b833b50df2bf1b0cff5b09bd38eb1b1db01b | MATLAB | 4,750 | 143 | function [DataMatrix, Labels,MouseIDs,Days, sessionNames, areaNames] = GetLFPDataMatrix(dataFileName)
sessionCnt = 1;
DataMatrix = [];
Labels = [];
sessionNames={};
curFname = dataFileName;%'C:\David\Phd2020\ElectordesClassification\Data.xlsx';
isThetaVec = [];
Days=[]
[~,sheets] = xlsfinfo(curFname);
if len... |
dd12aab7318bed5d5d1d148a4655fd3a285f2ccdcef4930c90b74e9f651385b9 | MATLAB | 4,755 | 126 | function varargout = output_data(self, fnCSV, varargin)
%output_data - Output the data
%
% output_data(OBJ) prompts the user for a filename and outputs the data
% from each Processable object contained in the ImgGroup object OBJ using
% the default formatting parameters. There will one or more files
% produced... |
5e0d42af755261c4e0a59ecb626b823b294128b19feb35df6a362cbece34453d | MATLAB | 4,759 | 119 | function valsToUse = check_crop_vals(imgSize, valsToUseIn, varargin)
%check_crop_vals - Check the values for cropping are appropriate
%
% VAL = check_crop_vals(IMG_SIZE, VAL) checks that the values to crop VAL
% are appropriate, based on the image size IMG_SIZE, and returns VAL,
% corrected when necessary. VAL m... |
06a851cabb129e3e2995522002207b5cf00a782fe1260e50e163ad2b9311134a | MATLAB | 4,760 | 143 | function imgSeq = applyShifts(imgSeq, sx, sy, fillBadData, inpaintIters)
%applyShifts - Apply calculated shifts to an image sequence
%
% This function is not intended to be called directly.
% Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al.
%
% This program is free software: you can redistribut... |
641017f556ed4bc4b2d9b7ae2ac2a88c92bd39ebecd1ed35545ada05fa8a3431 | MATLAB | 4,765 | 172 | function [sy, sx, refImg] = calcShifts(imgSeq, varargin)
%calcShifts - Calculate the whole frame shifts
%
% This function is not intended to be called directly.
% 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 und... |
be316144ae1e154a5434cc422763722652561efd3ebfa23b0dff8677da2efff0 | MATLAB | 4,772 | 133 | %==========================================================================
% This script performs simulations to examine the relationship between the
% firing rates of the neurons and their coactivity.
%
% Lukas Kunz, 2023
%==========================================================================
% start
clear; clc;... |
3fced69452f24524366c02578094219fa8ad56624a7cceda70bee886de6e9b6c | MATLAB | 4,774 | 118 | function power = covariate_net_ttest(n1, n2, N, sigma0, ...
Cohensd, rho_in, rho_out, cluster_size, Covariance,...
FWER_threshold, M_rep, M_perm, Reliability, Useparallel)
%COVARIATE_NET_TTEST Estimates power of data-driven network anlaysis based
% on a two-sample t-test.
%
% This function estimates t... |
309f2a7f167559a04799595b06adbf96a471aa85e988efeea3c393751b4fe948 | MATLAB | 4,782 | 148 | % Step 3: simulating PSFs for deconvolution
% Reference: A. Orth, etc.,Optical fiber bundles: Ultra-slim light field imaging probes
% last modified 2022-05-20
% by Peisheng Ding (peisheng.ding@mpi-halle.mpg.de, peisheng.ding@mail.utoronto.ca)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
06992d05bba557b03be21f400c228445aa5e556c958dde5a4ff71624f4e1ef65 | MATLAB | 4,786 | 116 | % run_simSpinEchoShaped.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=run_simSpinEchoShaped(spinSys);
%
% DESCRIPTION:
% This script simulates a localized spin-echo experiment with a fully shaped
% refocusing pulse. Phase cycling of the refocusing pulse is performed.
% Furthermore, simulations are run... |
22aeee54a1a63430e31f541f9064b17af3fa2ed56ffbd9998bce41c4e298f603 | MATLAB | 4,787 | 143 | classdef OpenExLive < handle
%OpenExLive TDT online data streamer.
% obj = OpenExLive() connects to TTank server and opens currently
% recording block in Workbench
%
% obj.data reference to all available data from block
% obj.update get latest data from current block
% ... |
7c731f5e6a108f391804c6c3aac2df154258985b81c28d1f503e42d3a23d65e5 | MATLAB | 4,789 | 130 | function RESULTS = assessment(Labels,PreLabels,par)
%
% function RESULTS = assessment(Labels,PreLabels,par)
%
% INPUTS:
%
% Labels : A vector containing the true (actual) labels for a given set of sample.
% PreLabels : A vector containing the estimated (predicted) labels for a given set of sample.... |
9b47b8a984873733afe8c19f609539fe71622d1e914c5f58fe1e9c1ad0711e25 | MATLAB | 4,807 | 145 | classdef (Abstract) RawImgHelper < matlab.mixin.Copyable & ITraj
%RawImgHelper - Superclass for all raw image classes
%
% The RawImgHelper class is an abstract superclass that implements (or
% requires implementation in its subclasses via abstract methods or
% properties) most functionality related to RawImg obje... |
cf3da078dde69403264803b22f58bb76a0d29e788feb3d0265fb596f6299f55f | MATLAB | 4,809 | 114 | function nifti = io_CSIload_nifi1(filename)
arguments
filename (1, :) char {mustBeFile}
end
matlabError = [];
nifti = struct();
try
%open the file
fileID = fopen(filename, 'r');
%sizeof_hdr: Needs to be 348
header = fread(fileID, 348, '*int8')';
nif... |
6c1357aac0838d0d37e4ee876126af27e511d43741cda63f0e8dc42cccb62a30 | MATLAB | 4,814 | 134 | function hardwareContinuousVoltageWithCallBack(devID)
% A simple example showing hardware-timed continuous analog input using using DAQmx via .NET
%
% function nidaqmx.AI.hardwareContinuousVoltageWithCallBack(devID)
%
% Purpose
% Demonstrates how to do hardware-timed continuous analog input usin... |
d57766399963e80aef3c2ce719e311dafb83255106ea0ef5554bf433863eacb8 | MATLAB | 4,822 | 99 | clc;clear;close all
%% BNPower
% Retrieve input values from app components
% Simulation Parameters
M_rep = 100; % Number of repetitions for the simulation
M_perm = 100; % Number of permutations for the permutation test
N = 246; % Total number of nodes
NE = N*(N-1)/2; % Number of edges (... |
6eb7d8e278c8c77571c7c139689dbef0bd3a0f4590115c513e65f699f5f1ee4f | MATLAB | 4,823 | 154 | % LOOP_TREE Builds conductance matrix of a tree, including loops.
% (trees package)
%
% M = loop_tree (intree, inodes1, inodes2, gelsyn, options)
% ---------------------------------------------------------
%
% Creates loops in the neuronal structure. Since conventional trees cannot
% be used a conductance matrix is c... |
10947c8d1b214a96a80edeb5098c733ee0c9bcac2fc29f9b69ac2b0a93a2370d | MATLAB | 4,830 | 135 | function [weight] = t2n_findSubthreshWeight(neuron,tree,weight,freq,tim)
% This function finds the synaptic weight of Exp2Syn synapses necessary to
% have the neurons defined in "neuron" and "tree" at a sub-spiking threshold level
%
% INPUT
% neuron T2N neuron structure (already containing all synapses for which
% ... |
7739553a128979d9be1e4d253ae8cb31a84ba33a3f06b89adebe89ef43b4c639 | MATLAB | 4,837 | 173 | % VTEXT_TREE Write text at node locations in a tree.
% (trees package)
%
% HP = vtext_tree (intree, v, color, DD, crange, ipart, options)
% --------------------------------------------------------------
%
% Displays text numbers in the vector v at the coordinates of the nodes
% ipart in the tree.
%
% Input
% -----
%... |
b36a430c18caa656fff170e41dfe333ff5a1df3e9e9ae102b13c2674b5a5bc21 | MATLAB | 4,841 | 120 | function hardwareFiniteVoltage
% Example showing hardware-timed analog input of a finite number of samples using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AI.hardwareFiniteVoltage
%
% Purpose
% Shows how to do hardware-timed analog input using Vidrio's dabs.ni.daqmx wrapper.
% Th... |
5fb442c6d792d195bd659c6a1871e0edb5cfb4d253d7b779e7a6c1eaa0332f8f | MATLAB | 4,842 | 108 | function power = covariate_net_reg(subject_num, N, sigma0,...
f2, DF, rho_in, rho_out, cluster_size, Covariance, ...
FWER_threshold, M_rep, M_perm, Reliability, Useparallel)
%COVARIATE_NET_REG Estimates power of network based on covariate regression.
%
% This function estimates the statistical power of d... |
190d07683a9f39d77f026ce556907084f298393f90693bcd5c8154e1e39f4b5b | MATLAB | 4,849 | 134 | function taft_preprocess_main()
% taft_preprocess_main()
%
% Interactive script.
% Main script to create a new TAfT object by loading EEG data (TF or time
% domain), fMRI data (volume-by-volume, upsample, epoch into
% trial-by-trial), and behavioral data and perform multiple linear
% regression for each channel/ (fre... |
d5c466f976d0fccd8b6cc5bc284ece1babe6c99ddef064cbf86e94209b08d83f | MATLAB | 4,849 | 150 | function [containGC,idx_gc] = detectGC(fileID,data,dist,neibrs,neibrs_soma,d)
% This function detects if the neuron contains noticeable growth cone region from the SWC file
% by setting a threshold for density of skeletal points in the region.
% neuron contains a growth cone need to be checked manually for quality ... |
436e4d9238a875c0442ce1d53642e01568bafaef2c46889be184e7962e0ca092 | MATLAB | 4,850 | 206 | %% plotLocationConsistencyFig
clear all; close all; clc
%% Load RBRLoc by group
load('RBRLocComb_good.mat'); %mean of the consistency as a function of track location
locG = RBRLocComb;
meanRBR = cellfun(@(x) mean(x,1,'omitnan'),locG,'UniformOutput',false);
semRBR = cellfun(@(x) nansem(x,1),locG,'UniformOu... |
7daf7f7980b13d2d188e59e70190d8bc1ddce8e8515a6488e6d430be69d66fc1 | MATLAB | 4,852 | 136 | function [prt,LoD,stdm,stdmc] = prtrf_v11(RespMatComb,CRespMatComb,slices,tinsp,cp,interpmode,posorneg)
% Positive response threshold - reading function
%% Data variance
% tinsp data portion for calcuation
npoints = 60; % 3 min interval with 3s sampling
npointsc = 15; % 45 s interval with 3s sampling for the variance... |
b65b1b3437f0f0c6cde3dbf8acaf6103d6d754c9c2b0f5edf1d1fed18d5e538d | MATLAB | 4,853 | 118 | % sim_megaspecial_shaped.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% sim_megaspecial_shaped(n,sw,Bfield,linewidth,taus,sys,editPulse,editTp,editPh1,editPh2,refPulse,refTp,Gx,dx,refPh)
%
% DESCRIPTION:
% This function simulates the MEGA-SPECIAL sequence with a shaped
% localization pulse and shaped editing pu... |
f2dda0cf3fba58d0dead48a93e14cc473a76768c42db9775ff804d548d0c90b7 | MATLAB | 4,854 | 194 | % Parental touch trial (Petal)
% Script 1 to test the assumptions behind the statistical tests.
% October 2023
% ISRCTN Number: 14135962
% Clinicaltrials.gov identifier: NCT04901611
%% set path, select analysis type, select outcome list
clear;
% paths
path_to_inputFolder = "~/Documents/Petal_dataset/data_tables";
... |
26d80a753acefa66ac441920c9fbaf7ca6fd2e9ebee98ca984991654eae921a9 | MATLAB | 4,856 | 124 | %This is copied from GeckoLight. The difference is that it splits up the costs into the 4 categories
function [MWDivKcatsRes,rxnWcLevels] = GetMWAndKcatNeurons(uniprots, kcats, wcLevels, swissprot, standardMW, mtGenes, pureCytRxns, mitoRxns)
swissProtHashMap = containers.Map(swissprot(:,1),1:length(swissprot(:,1)));
... |
5f702eb0d00654ed58df79fc681b91a664c5ef11947201716f71331248eb0f15 | MATLAB | 4,857 | 163 | % INSERT_TREE Insert a number of points into a tree.
% (trees package)
%
% [tree, ind] = insert_tree (intree, swc, options)
% -------------------------------------------------
%
% Inserts a set of points defined by a matrix swc in SWC order
% ([inode R X Y Z D idpar] BUT NOTE that diameter values are given and NOT
%... |
0014eb85b059631950c17abe72073cd10fa4f55246b5c85bb0d74bad5fcab438 | MATLAB | 4,860 | 124 | function highlightArea_Callback(obj,~,~)
% Highlight the brain area under the mouse cursor
%
% zapit.gui.stimConfigEditor.controller.highlightArea_Callback
%
% Purpose
% This callback highlights the brain area under the mouse cursor.
% For ease
brain_areas = obj.atlasData.dorsal_brain... |
39beffd30d0a80c759f62f40427486061885a4eff505e6876dbf4236f7472757 | MATLAB | 4,861 | 147 | function [fwhmOut, idxEdges] = fwhm(xx, varargin)
%fwhm - Calculate the full width at half maximum
%
% FWHM = fwhm(X) calculates the full width at half maximum of X. X must
% be a vector containing only real numbers.
%
% FWHM = fwhm(..., 'attribute', value) specifies one or more
% attribute/value pairs. Vali... |
6b97901ec556c3dcf6d6a89dac4e8da12486f67a9598927bb55b9957a6ffa7f7 | MATLAB | 4,862 | 158 | 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 publi... |
d4018e287fd27c0cc39a238f3601f45fa1ddf2e577eba3ea5ae9a184cba98c9a | MATLAB | 4,868 | 147 | function [DataMatrix, Labels,MouseIDs,Days, sessionNames, areaNames, sessionNum] = GetLFPDataMatrix(dataFileName)
sessionCnt = 1;
DataMatrix = [];
Labels = [];
sessionNames={};
sessionNum = [];
curFname = dataFileName;%'C:\David\Phd2020\ElectordesClassification\Data.xlsx';
isThetaVec = [];
Days=[]
[~,sheets]... |
a73186ba98b27808fb1833011ea081f25ac812c4462e2e3f406b9464721b44c1 | MATLAB | 4,875 | 198 | %io_loadspec_irBruk.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% out=io_loadspec_irBruk(inDir);
%
% DESCRIPTION:
% Reads in Bruker MRS data (1i and 1r files). Generally with this data,
% the averages and coil channels have already been combined.
%
% op_loadspec_irBruk outputs the data in structure format, with... |
585d4a2f99fa1f6ebaa6d7cf80fe0b5fe19434a5a5e7c6c649b0c2811847cee7 | MATLAB | 4,878 | 138 | function varargout = output_data(self, fnCSV, varargin)
%output_data - Output the data
%
% output_data(OBJ) prompts the user for a filename and outputs the data
% from each Calc object contained in the ProcessedImg object OBJ using
% the default formatting parameters. There will be one file produced for
% each... |
03ea2e9ec61c90ed9a11a064dacfe7971d7d2be0f28f8e843bee0a105d78d9a9 | MATLAB | 4,882 | 165 | load('E:\learningAnalysis\summaryManyMice_includingOldEnvBadMoreMice\indicesAllNewCueThresh.mat');
load('E:\learningAnalysis\summaryManyMice_includingOldEnvBadMoreMice\corrAllFOVs.mat');
load('E:\learningAnalysis\summaryManyMice_includingOldEnvBadMoreMice\dfofSigNormAllFOVs.mat');
i1=indicesAllNewCueThresh.CueRIdx... |
0c5c4a6223a0b3a30979608131aa2dba02505f1b806196f4d510b302ee4e2b07 | MATLAB | 4,899 | 169 | function sff = sff_matchPoints(sff)
%SFF_MATCHPOINTS
%
% Raphael Sarfati, 05/2022
xyt1 = sff.gp1.cln.xyt;
xyt2 = sff.gp2.cln.xyt;
dk = sff.clb.dk;
frameDim = sff.prm.mov.frameDim;
stereo360Params = sff.clb.stereo360Params;
distThresh = sff.prm.trg.matchPointsThrChord;
[matchedAlpha1t,matchedAlpha2t] =... |
0641a9d71e6d6f65d45486b1fe86083edc07eacdeec766bb52ef35e55e2d86d2 | MATLAB | 4,901 | 135 | classdef Test_CalcFindROIs < matlab.unittest.TestCase
%Test_CalcFindROIs Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties
end
% =========================================================... |
7c904b34d6e3000d10466831b6e834de759d60daf56d7f9318f02bf149da7ba4 | MATLAB | 4,909 | 178 | function result = ReadYamlRaw(filename, verbose, nosuchfileaction, treatasdata)
import zapit.yaml.*;
if ~exist('verbose','var')
verbose = 0;
end
if ~exist('nosuchfileaction','var')
nosuchfileaction = 0;
end
if ~ismember(nosuchfileaction,[0,1])
error('nosuchfileexception parameter... |
fc098e5d5c2b1f041952da4843407f959fa03fb305edb9fbafb0f1844dee625d | MATLAB | 4,911 | 148 | classdef OpenExLive < handle
%OpenExLive TDT online data streamer.
% obj = OpenExLive() connects to TTank server and opens currently
% recording block in Workbench
%
% obj.data reference to all available data from block
% obj.update get latest data from current block
% ... |
9bbe51b5270dc23d6a0f5f19728f3f2f15763d8e9bf653f0b56155189068be07 | MATLAB | 4,923 | 98 | function [ dirBinResponse, orBinResponse, resultant ] = AngularTuning( thetaBin, thetaDirTest, thetaOrTest, testActivity, Nboot, show ) % , CI
% Bin the test activity
[ dirBinResponse, orBinResponse ] = AngularResponse( thetaDirTest, thetaOrTest, testActivity, thetaBin, false); % , true
% Suppress negative respon... |
da849b32c6853e6875b060eb20d63061116d6f64cd47e287c85fb89087e935b5 | MATLAB | 4,927 | 122 | function [range, TolFun] = stSearchFit_range(params,model,data)
% rmSearchFit_range - estimate boundaries for fmincon
%
% boundary = rmSearchFit_boundary(params,startparams)
%
% 2010 SOD: split off from rmSearchFit_oneGaussian
if ~exist('params','var') || isempty(params), error('Need params'); end
if ~exist('model'... |
db236454a4dcc5d67a00aa4d1be31d5dfd3abac6d1825df0f78cce62a73334b2 | MATLAB | 4,936 | 222 | %% Copyright: Tsygankov Lab (https://sites.gatech.edu/denislab/)
%% Data files (time series, max projection, standard deviation across all time frames)
filename = 'myosin.tif';
maxname = 'max_myosin.tif';
stdname = 'std_myosin.tif';
info = imfinfo(filename);
Nfr = length(info);
W = info.Width;
H = info.Height;
s = ze... |
69d3a52bd0c2af1959cbc4e358b02bddd7bf3e4b608a04e355707296d757aeff | MATLAB | 4,943 | 174 | % TPRINT Simplified printing.
% (scheme package)
%
% [name path] = tprint (name, options, fsize, shineoptions)
% ---------------------------------------------------------
%
% Prints the current figure to a file.
%
% Input
% -----
% - name ::string: name of the output-file without extension
% {DEFAULT : open g... |
b11792babc81cbbac73fca3376f5810fb4a36674d27c0b53cb7b30d38497faaa | MATLAB | 4,944 | 149 | % DISSECT_TREE Groups together nodes belonging to same branches.
% (trees package)
%
% [sect, vec] = dissect_tree (intree, options)
% --------------------------------------------
%
% Groups segments together which belong to same branches to be used as
% sections in NEURON-like compartmental modeling. Branches are def... |
1a1e60d70999a51e508516fdffd3bd2e7c64a726719a5024baaa695c4b066685 | MATLAB | 4,947 | 133 | function D=load_open_ephys_binary(jsonFile, type, index, varargin)
%function D=load_open_ephys_binary(oebinFile, type, index)
%
%Loads data recorded by Open Ephys in Binary format
% oebinFile: The path for the structure.oebin json file
% type: The type of data to load. Can be 'continuous', 'events' or
% 'spikes'
% ... |
d8d5aa792b789bcce0d2014193f0bc61621a6e0f3bc5b8c9be5d4542100e734c | MATLAB | 4,952 | 191 | function [fft_data,varargout] = TDTfft(data, channel, varargin)
%TDTFFT performs a frequency analysis of the data stream
% [fft_data, fft_freq] = TDTfft(DATA, CHANNEL), where DATA is a stream
% from the output of TDT2mat and CHANNEL is an integer.
%
% fft_data contains power spectrum array
% fft_freq... |
dccc2efc12fd302fb70c9f7dc4de2e358ccd91c647e8caf3bb27a809e0f2d36a | MATLAB | 4,952 | 135 | function displayID = openScreen(displayID, hideCursorFlag)
% openScreen - open screen for psychtoolbox
%
% Usage: displayID = openScreen(displayID, [hideCursorFlag=true])
%
% openScreen takes a displayID structure (e.g., from running
% loadDisplayParams), and does the following:
% 1. opens a PTB window with a backgro... |
d9e2989a5788046ee96d6c2c06f693f4f1b0922ba631200d113f6a9f2eba6b36 | MATLAB | 4,953 | 131 | function [ handle ] = plot_mesh_brain( brain_mesh, ...
view_position, ...
vertex_color_values, ...
transparency, ...
color_map )
%PLOT_MESH_BRAIN plots a 3D brain i... |
4e1fff26e928304e1fd0d05a50acf6e033dd69ff80ea2889714fc29cb3973ce2 | MATLAB | 4,956 | 138 | function getDispStats(imSet,horizontal_disparity,numSamps,ecc,edges_disp,res,resampIter,V1densityMat,V2densityMat,MTdensityMat,circDensityMat)
% For image set what are the disparity statistics?
% Collect disparities within masks and histogram them
% initialize
numIms = size(horizontal_disparity,3);
dispHistV1 = nan(... |
b93c380382f7656dbf35af403d2d9347081e470c79503f6b8c1f22011b4fde34 | MATLAB | 4,971 | 136 | function out = LK_PlaceCellAnalysis_placeFieldTest_20210814(cfg)
%
% LK_PlaceCellAnalysis_placeFieldTest_20210814 identifies a place field
% based on the behavioral data and the firing rates and estimates the
% strength of the place field.
%
% Steps:
% - Estimate the firing-rate map.
% - Smooth the firing-rate map (usi... |
06fd59f22be4d618b065d5a79d94d3d58163ef93dc3e15e2dc3b58746f8d7791 | MATLAB | 4,972 | 170 | % FLATTEN_TREE Flattens tree onto XY plane.
% (trees package)
%
% tree = flatten_tree (intree, options)
% -------------------------------------
%
% Flattens tree into the XY plane by conserving the lengths of the
% individual compartments. (quite similar to morph_tree but not similar
% enough to make one function)
%
... |
2fc7ee191e0c1a5cd463a1da6b3ae35a81672e4f3ed5d2feb538900acf98c4ee | MATLAB | 4,979 | 124 | %This is copied from GeckoLight. The difference is that it splits up the costs into the 4 categories
function [MWDivKcatsRes,rxnWcLevels] = GetMWAndKcatNeurons(uniprots, kcats, wcLevels, swissprot, standardMW, mtGenes, pureCytRxns, mitoRxns)
swissProtHashMap = containers.Map(swissprot(:,1),1:length(swissprot(:,1)))... |
45fd178499e64ebe5f0c08c06ea49f37ac8b864e2c914878b8f93acd61fcf181 | MATLAB | 4,983 | 195 | clearvars
% Select "fig6_triggering" directory
path_to_data = uigetdir();
addpath(genpath(path_to_data));% add fig6_triggering/code directory to path
filelist = dir(fullfile(path_to_data,'data','100kS_trigger','*.mat'));
n_reps_to_plot = 50;
pre_post_window = [.1,1.2];
srate = 100000; %kS/s
time_range_samples = ... |
2c44dcb28513cd3f685dd3c74f4ef351b3e25cc5dc48d265a8b783b5d91fd64d | MATLAB | 4,992 | 103 | function [expt, runInfo, varargout] = ParseDataTable(dataTable, x, dataCol, dataDir, varargin) % dataDir, projParam dataTablePath, dataSet,
IP = inputParser;
addRequired( IP, 'dataTable', @iscell )
addRequired( IP, 'x', @isnumeric )
addRequired( IP, 'dataCol', @isstruct )
addRequired( IP, 'dataDir', @ischar )
ad... |
b8fe4471157527c1c8a0f7473ea259b2cf44ef1d5e7053dd8d98022e166d8f53 | MATLAB | 5,013 | 136 | %% sampHighOrder demo
%
% Try the regSENSE demo before this one. Here, we include spatially
% varying phase from eddy currents and B0 inhomogeniety via sampHighOrder.
%
% sampHighOrder is a very powerful function to execute the forward model
% of MRI sampling (or its adjoint) with minimal assumptions, using a... |
6832c98fe6ddcdac95c324fb36fe25eafd260ec7084fba614ef96daf7a2995fb | MATLAB | 5,015 | 206 | %io_loadspec_IMA.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% out=io_loadspec_IMA(filename,Bo,spectralwidth,te,tr);
%
% DESCRIPTION:
% Loads a siemens .IMA file into matlab structure format.
%
% INPUTS:
% filename = Filename of Siemens .IMA file to load.
% Bo = Field strength (Tesla).
% spect... |
4a2ff4507c59ed79449a6c6079bda07b4860e91b224a213760d0521cfa497339 | MATLAB | 5,018 | 187 | % VER_TREE Verifies the integrity of a tree.
% (trees package)
%
% ver_tree (intree, options)
% --------------------------
%
% verifies the integrity of a tree and creates warnings that precede common
% errors. Is called by basically every single TREES package function. Could
% be useful for something else maybe...
%... |
0f9f96b146b8133a541ae1b5312b6a9bf12fecaf4e9553f39e25494493a78188 | MATLAB | 5,022 | 177 |
clear
close all force
warning on
imSize = [733, 977];
load('a0_3_1_extractingTheMorphingDataFromAnalyze1', 'imgMorphAllSaved','imgAllSaved');
%load tirals info
load('a0_0_bhv2trialStrct.mat');
I = arrayfun(@(x) isfield(x.analyze,mfilename), dataTrl);
if any(I)
I(I) = arrayfun(@(x) x.analyze.(mfilename) , dataTr... |
307c3ba8af002472447ba1eb38309a9221f1466e581d77c0503cf22ef44b22c4 | MATLAB | 5,023 | 144 | function annotate_traces(self, objPI, hAxTraces, 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 ... |
f2ad19cec800cb87c94edc37cbdc16deb34c20061e839168b0afc6cbf4523974 | MATLAB | 5,024 | 139 | load(fullfile(dataFolder,'simulations','synthetic_spikes','simulations_synapse_dipole_orientation.mat'));
dMag = squeeze(max(vecnorm(dipoles,2,2)));
dMag./max(dMag)*3;
dipole_moment = squeeze(nanmedian(dipoles./vecnorm(dipoles,2,2)))';
dipole_moment = [dipole_moment(:,1),dipole_moment(:,3),-dipole_moment(:,2)];
dipol... |
9130196a1d7e731d78a305732120723d81e2e926182c7e0c393ce39a10e8102f | MATLAB | 5,025 | 174 | classdef DAQ < handle
%% DAQ
%
% Class to simulate a DAQ.
%
%
% An example of a class that inherits DAQ is NI.
%
% Rob Campbell - SWC 2022
properties
hAO
hAI
device_ID = 'Dev1'
samplesPerSecond % will be filled in with the value from the user settings file
AOrange = 10
... |
d927211244fac707b8ff9dcd898c549dcccd698dee585b7bc377b969443e716e | MATLAB | 5,031 | 139 | %% Online Raster PSTH Example
%
% <html>
% Import snippet and epoc data into Matlab using SynapseLive while the
% experiment is running <br>
% Generate peri-event raster and histogram plots over all trials <br>
% Good for stim-response experiments, such as optogenetic or electrical
% stimulation, where you need ... |
bc87b2d19364d30a553c1c29672cbbb7cf44990d6af30da18e2fee103ec2fcb3 | MATLAB | 5,036 | 199 | % io_readlcmraw.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=io_readlcmraw(filename,type);
%
% DESCRIPTION:
% Reads LCModel raw data format into the FID-A data structure format in MATLAB.
%
% INPUTS:
% filename = filename of LCModel raw file.
% type = type of LCModel raw file:
% 'rd... |
e836201536ee8107f4dcc0b40c998697f52c1ca58059cd2ebd7ec529eb08aa22 | MATLAB | 5,040 | 118 | %% Ripple detection
clear
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\awake_swr
addpath C:\HaoxinAnalyse... |
4ed725fc1798765317be1fefa41a34c77720319485436ca7edac63f810771b99 | MATLAB | 5,047 | 172 | function job = slice_display_set_job(job)
% job = slice_display_set_job(job)
%
% Complete any job settings for slice display given job name that might not
% have been specified yet.
%
% INPUT:
%
% job = structure with options (necessary and optional
% settings).
%
% NECESSARY INPUTS:
% .lockSettings ... |
4fb85cf2d238a9c478a1d6797f8ee59a852471ab25d2f14814cb48281aba3b7d | MATLAB | 5,049 | 138 | %function Kluster(FileBase,Data, SampleRate, NormFet)
% create files needed for Klusters to run - can use any kind of time, features, waveshape data given you follow the format below.
%Data = {Fet,Spk,Res,Clu}
% Spk has to be [nChannels, SpkSampls, nSpikes]);
% Fet has to be [nSpikes, nFet, nChannels]
% and start the ... |
e2e9092dada39b29bc1d390fb116680cd349e9651609ed2fbf6b3b5ac928f8a4 | MATLAB | 5,052 | 127 | function infoStruct = MakeInfoStruct(varargin) % mainDir, mouse, exptDate, run, FOV
fSep = '\';
if nargin == 1
if exist(varargin{1}, 'dir')
runDir = varargin{1};
dirSplit = split(runDir, '\');
nameSplit = split( dirSplit{end-1}, '_');
mouse = nameSplit{1};
exptDate =... |
b7406dc7ef0d9cb12eaa70591cdb9584476dff062fa5cb8024f5ac56d798eaed | MATLAB | 5,056 | 154 | % Example MATLAB script to test loading and visualizing fMRI phase-derived regressors including my own testing paths.
% Edit these to make them work for you
close all;
clc;
cd('/srv/data/ajaffray/fMRI-phase-toolbox-v2')
addpath('/srv/data/ajaffray/fMRI-phase-toolbox-v2/matlab')
addpath('/srv/data/ajaffray/fMRI-phase... |
4f13ba8dfecd920963df02a20f9b3bb087063cce624eea4ab04517a585a178cc | MATLAB | 5,067 | 97 | function CatInterpZ(sbxPath, sbxInfo, varargin)
IP = inputParser;
addRequired(IP, 'sbxPath', @ischar )
addRequired(IP, 'sbxInfo', @isstruct )
addParameter(IP, 'chunkSize', 15, @isnumeric )
addParameter(IP, 'refChan', 'green', @ischar ) % for scanbox, 1 = green, 2 = red. -1 = both
addParameter(IP, 'refType', 'mean', @is... |
adc936c5f9275325392798227bf9462ce24f6c629ca8a231d70c32d12aba0a87 | MATLAB | 5,071 | 112 | function [trainedClassifier, validationAccuracy] = KNB(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% Returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. Use the
% generated code to automate t... |
692618386554a73a817416d9d00d755543f20b72fb1ad40e8f416cf7cb3c8537 | MATLAB | 5,072 | 174 | %op_HSVDfit.m
%Jay Hennessy, McGill University 2017.
%Jamie Near, Sunnybrook Research Institute 2025.
%
% USAGE:
% [model, resid, K, wppm, amp, alpha, ph]=op_HSVDfit(in,ppmlim,Kinit,M,plot_bool);
%
% DESCRIPTION:
% This function fits an MRS spectrum to a series of lorentzian peaks using
% the HSVD method described by... |
da635417bb756f46a4144147822401f158091ad0240ff7de242484f3c063ae1d | MATLAB | 5,081 | 144 | classdef Test_CalcMeasureROIs_params < matlab.unittest.TestCase
%Test_CalcMeasureROIs Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties (TestParameter)
classCMR = utils.find_subclasses('C... |
e88f0aeb0771389ed16b066ada3442f7c8212ca10146711e691d0b3f2f89c002 | MATLAB | 5,087 | 199 | function [fn,saveName]=st_plot_sigma_window(DT,params, roiList,targetModel,dostats)
mc = getmycolors(3);
if targetModel == 2
tms = {'\tau_1', '\itw', '\tau_2', '\itn_D_N', '\sigma_D_N'};
nParam = 5;
elseif targetModel == 3
tms = {'\tau', '\tau'};
nParam = 1;
end
if notDefined('targetVar')
target... |
524ab987dbd81e0e6db24afe4a9e67dd8e3ae9e9c6c926ba973f576d86175ff0 | MATLAB | 5,094 | 160 | % io_readlcmraw_basis.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=io_readlcmraw_basis(filename);
%
% DESCRIPTION:
% Reads entire LCModel .basis file into multiple FID-A data structures in MATLAB.
%
% INPUTS:
% filename = filename of LCModel .basis file.
%
% OUTPUTS:
% out = Input basis set saved a... |
dba21c9e3019ac19b5e854a494ffef1465be1cd41c34dac17b9e61b10f50d753 | MATLAB | 5,094 | 126 | classdef (Abstract) CalcFindROIsFLIKA < CalcFindROIs
%CalcFindROIsFLIKA - Superclass for FLIKA-based ROI identification
%
% The CalcFindROIsFLIKA class is a Calc class that implements the FLIKA
% algorithm for ROI identification. For further information about FLIKA,
% please refer to <a href="matlab:web('http://d... |
34b9a039437e2b29e9929f2d2b9bfee18a1f4e6abe06a356f06e9e53873e5c8e | MATLAB | 5,095 | 214 | figure;
iB=[3 7 8 10];
iG=setdiff([1:1:15],iB);
%% Matrix correlation %2 figures
load('E:\learningAnalysis\behaviorVSActivity\MatrixCorrelation\deceNTDiffCM\corrM.mat');
NPerMouse=9;
idxB=[];
for n=1:length(iB);
a=[NPerMouse*(iB(n)-1)+1:1:NPerMouse*iB(n)];
idxB(end+1:end+length(a))=a;
end
idxG=... |
6bb0d13d6351351bb2d7609e02f1c978f51c0900b9f64b3088f6403883b0b52b | MATLAB | 5,101 | 157 | % Step 2: Raw image refocusing
% Cite: Optical fiber bundles: Ultra-slim light field imaging probes
% last modified 2022-05-20
% by Peisheng Ding (peisheng.ding@mpi-halle.mpg.de, peisheng.ding@mail.utoronto.ca)
addpath('files')
close all;
%% getting Mx and My
% t1 = 0.40;
% t0 = 0.32;
t1 = 0.352;
t0 = 0.... |
add7e3edb1eba8a0b0c118ed0f06da150f31d3efd2f53690cb9a0a616f01e0b8 | MATLAB | 5,102 | 186 | folder = fullfile(dataFolder,'simulations','subcritical_network','dipole_correlations');
load(fullfile(folder,'S=1.0','m=0.00.mat'));
S1{1} = nanmean(C,3);
load(fullfile(folder,'S=1.0','m=0.63.mat'));
S1{2} = nanmean(C,3);
load(fullfile(folder,'S=1.0','m=0.86.mat'));
S1{3} = nanmean(C,3);
load(fullfile(folder,'S=1.0',... |
3a4d6773c173e8966e6e3c39fd99a5324446156b75d5b8660f22f5d3fc06f468 | MATLAB | 5,106 | 123 | function [experiments] = loadDataV1V2(area)
% Load in raw data
load('./dataPhysio/V1V2/AllDTData.mat');
experiments = {};
cnt = 1;
% for each entry
for x = 1:length(DTdata)
% if this entry belongs to the right area
if DTdata(x).visualarea == area
% load data
disparities = DTd... |
35c5f124741b9abf6d4afab184850d7d9e8ebb6814e8752c1b43b327e2037cb0 | MATLAB | 5,111 | 122 | function channel = sshfrommatlab(parameters)
%SSHFROMMATLAB connects Matlab to a remote computer via a secure shell
%
% CONN = SSHFROMMATLAB(parameters.user,parameters.host,parameters.pw)
%
% Inputs:
% parameters.user is the user name required for the remote machine
% parameters.host is the name of the remote m... |
0735a004afc2d093afa1424b1f4caa21275ec03b1fe8e31389df06c04294594c | MATLAB | 5,112 | 160 | function self = set_acq(self, acq)
%set_acq - Protected class method to set the acquisition properties
% 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 ... |
e28fd0b0dcd03e19c4bc15ae6b563e4aeac3d917023b38f85023ff054a8fc082 | MATLAB | 5,115 | 174 | % DENDROGRAM_TREE Plots a dendrogram of a tree.
% (trees package)
%
% HP = dendrogram_tree (intree, diam, yvec, color, DD, wscale, options)
% ---------------------------------------------------------------------
%
% Plots a dendrogram of the topology of a tree (must be BCT conform).
% (consider applying repair_tree f... |
c1af0b798eca3fac4465d4f2ff06099e20ada8338f43b8b1a44e4a23b17546a0 | MATLAB | 5,118 | 112 | function val_calibration
% Can the calibration check of the permutation null actually answer its question?
%
% tfce_estimate_stat warns when the permutation null looks too narrow, by counting
% how many uncorrected p-values land in the upper tail. A check like that is only
% as good as its threshold and its direction, ... |
9f620b3c7950212e811dc78e00a77df5799988e5a7098b505eba785b8d559362 | MATLAB | 5,119 | 141 | %% Online Raster PSTH Example
%
% <html>
% Import snippet and epoc data into Matlab using SynapseLive while the
% experiment is running <br>
% Generate peri-event raster and histogram plots over all trials <br>
% Good for stim-response experiments, such as optogenetic or electrical
% stimulation, where you need ... |
5dc264345a9821ba950cda2c65fecc33dc9567a825ba56040fb7ccf07fee1ca2 | MATLAB | 5,130 | 136 | function ch_calc(self, ff, chNums, varargin)
%ch_calc - Perform mathematical calculations on image channels
%
% ch_calc(OBJ, F, CH_NUMS) calculates a new channel based on the function
% F applied to the channel numbers specified by CH_NUMS, and merges it
% into the existing image data.
% F must be a function ha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.