sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
7163f98b1ae2919b4ad0bc6504edcc0bfcbc5d9b9fbcad0485b660c3388cfe7d | MATLAB | 6,914 | 187 | function [prot,rstraj] = read_twix_hdr(fid)
% function to read raw data header information from siemens MRI scanners
% (currently VB and VD software versions are supported and tested).
%
% Author: Philipp Ehses (philipp.ehses@tuebingen.mpg.de), Mar/11/2014
nbuffers = fread(fid, 1,'uint32');
prot = [... |
31ace602c9854d0643ff8e82af74a8ca3ebd6365fddecda31624a2791444d4b2 | MATLAB | 6,920 | 197 | function InstallMex(SourceFile, varargin)
% Compile a C-Mex file
% This function calls MEX() to compile a C/C++/F-Mex source file.
% Advanced users can call "mex -O SourceFile.c" instead, but beginners are
% sometimes overwhelmed by compiling instructions.
%
% InstallMex(SourceFile, ...)
% INPUT:
% SourceFile: Name ... |
d1f585a16a800427c5d7967d6cc246b2fc9513090f95cdcc3611bf6edeb094bc | MATLAB | 6,923 | 191 | function [map,lo,hi] = cubehelix(N,start,rots,sat,gamma,irange,domain)
% Generate an RGB colormap of Dave Green's Cubehelix colorscheme. With range and domain control.
%
% (c) 2015 Stephen Cobeldick
%
% ### Function ###
%
% Returns a colormap with colors defined by Dave Green's Cubehelix colorscheme.
% The colormap nod... |
a5911e46cb1f62236ec2e3c9afc48453836c2ad6395a7d496c24253cb0bd3ba4 | MATLAB | 6,924 | 157 | function varargout = hardwareContinuousVoltageNoCallback(devName)
% Example showing hardware-timed continuous analog output using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AO.hardwareContinuousVoltageNoCallback
%
% Purpose
% Demonstrates how to do hardware-timed continuous analog outp... |
a75d38ff6066b0ecf4f48c6788fba887608e74439e56aa045b20a3b65b862f0d | MATLAB | 6,925 | 140 | function [W1,Wp,Clist_GT,Wm, X, threshold_GT] = sampling_ind_reg(subject_num, N, sigma0, f2, DF, cluster_size, rho_in, rho_out, L, Reliability)
% SAMPLING_IND_REG Simulates data for independent regression analysis.
%
% This function generates a simulated dataset for regression analysis,
% where the network structu... |
f1361a2b492a1a68939d5f535febc9ff6c6b884999f95f244bb6c8ab4b19d1d6 | MATLAB | 6,927 | 194 |
% Calculating Correspondences in CUDA
% This is the code that calculates the keypoints and descriptors at
% varying scale levels
%
% INPUTS:
% moving_run: which expeirment do you want to warp accordingly?
% OUTPUTS:
% no variables. All outputs saved to params.registeredImagesDir
%
% Author: Daniel Goodwin dgoodwin208@... |
949b30c2ddfb723d27b69d9f0de3c3496fdf8fc0c456afd0ed8ebf1959671b2e | MATLAB | 6,932 | 206 | function outputs = export(result, outputDir, prefix, opts)
%EXPORT Write regressor outputs for MATLAB, BIDS-style, SPM, AFNI, and CONN.
arguments
result struct
outputDir {mustBeTextScalar}
prefix {mustBeTextScalar}
opts.formats = ["matlab", "bids", "spm", "afni", "conn"]
end
outputDir = string(outputD... |
459056b16c963eb150b3f5c83ed141bd1080cf38741568260b77b6e225e7c870 | MATLAB | 6,938 | 209 | function [imgSeq, barLabel] = scaleBar(imgSeq, pixelSize, varargin)
%scaleBar - Insert scale bar into an image
%
% [IMGOUT, LABEL] = scaleBar(IMGIN, PIXELSIZE)is a utility function that
% creates a scale bar for a given image and returns the image with scale
% bar (IMGOUT), as well as the label (LABEL) for the sc... |
43a33e35b5a3333b7aee8c48322fc0568ac2e010c0db1fae279c9899bd20abe7 | MATLAB | 6,942 | 200 | function add(self, varargin)
%add - Add children to the object
%
% add(OBJ) prompts for all required information to load/create
% RawImgComposite objects, create ProcessedImg objects, and add them to
% the CompositeImg object OBJ.
%
% add(OBJ, CONFIG, PROCTYPE, MASK) creates Processable objects of the
% type ... |
212bec9ccac476d33380b7d970be94674435678c5f13c046d84c8162ac3a0d2e | MATLAB | 6,946 | 173 | function [Y, job,betas] = taft_preprocess_load_EEG(job)
% [Y, job,betas] = taft_preprocess_load_EEG(job)
%
% Loads EEG data, reformat into matrix Y.
% Also update job for which (good) trials are kept.
%
% INPUTS:
% job = structure with settings to be specified via taft_preprocess_initialize_job
% .EEGdomain... |
e12a8b5071a012454e3976b89b577ae26f5d5e2369d428cb363658b56eaf2643 | MATLAB | 6,959 | 216 | function e = solve_spatiotemporal(x,params, stim, data,t)
% Generates anonymous objective function that can be passed to fmincon
% nruns = size(stim,3);
% x = [ -0.0027 1.4215 0.0122];
% x = [ 1.0442 -1.4051 0.0155 0.2541 17.1991]
% x = [-13.7539 -2.6928 1.6509 0.2930 1.0000 0];
... |
34cc40dd3942319bccaaa6adb6e997c6ee4b59c47eed609bfdb4dd32052ff839 | MATLAB | 6,963 | 251 | load(fullfile(dataFolder,'simulations','trend_peak_interactions','parameter_changes'));
f = 0.1:0.1:500;
rhythms = load(fullfile(dataFolder,'simulations','trend_peak_interactions','rhythm_spectra.mat'));
rhythms.psd = rhythms.psd([1,5,3,4,2]);
P3 = zeros(length(f),5,5);
P3(:,:,1) = mean(P2(:,:,1:5),2);
P3(:,:,2) = me... |
31facf35c36d1ebf74eb4e36663449513516cc4842940dd5b02ac4ee0ff54029 | MATLAB | 6,964 | 189 | function varargout = denoise(self, varargin)
%denoise - Denoise the images
%
% 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.1016/j.ymeth.2... |
1ce4635746187d29b52c08a9b0681485eb01bee039857ee11a8f8e94ecd1dbb6 | MATLAB | 6,967 | 189 | classdef Test_LineScanVel < matlab.unittest.TestCase
%TEST_LINESCAN Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
methods (Test)
function testConstructor(self)
% V... |
79609e53fad83e83eab84d91df97fa92dc656363ef6d195f8a676b7c4a1c9233 | MATLAB | 6,987 | 232 | function outputs = generateReport(result, regressorOutputs, cfg)
%GENERATEREPORT Write QC figures and a text summary for one pipeline run.
arguments
result struct
regressorOutputs struct
cfg struct
end
qcDir = string(cfg.qcDir);
if strlength(qcDir) == 0
qcDir = fullfile(string(cfg.outputDir), string(c... |
5eb01f60bde86694703dab3bceb22dcb66885fb1eb99a1d8da8826dac756de22 | MATLAB | 6,993 | 208 | classdef DataDetectSigsCellSort < DataDetectSigs
%DataDetectSigsClsfy - Data from signal detection and classification
%
% The DataDetectSigsClsfy class is a data class that is designed to
% contain all the data output from CalcDetectSigsClsfy.
%
% DataDetectSigsClsfy public properties inherited from Data:
% mask ... |
89444dab46bb5b90787669957bd9bc8dc18c3f24c8980117597e07748d4d4dde | MATLAB | 6,999 | 228 | %% LineScanVel
% Analyse line scan images of vessel velocities
%% Usage
% OBJ = LineScanVel(NAME, RAWIMG, CONFIG, ISDS, COLS)
%% Arguments
% * |NAME| is the name for this |LineScanVel| object.
% * |RAWIMG| is the |RawImg| object that will be used to create the
% |LineScanVel| object.
% * |CONFIG| contains the confi... |
95f57f4401d634ab6de14ecd07d8c2d158be625ce504a7aca8b60b60751cfc1d | MATLAB | 7,019 | 171 | classdef ConfigDiameterTiRS < Config
%ConfigDiameterTiRS - Parameters for TiRS-based diameter calculation
%
% The ConfigDiameterTiRS class is a configuration class that contains the
% parameters necessary for calculating diameters based on the
% thresholding in Radon space (TiRS) algorithm. For more information o... |
73b56d5b730f50de958f03e514cc3614741ccd5e274ddecc1515d7bea4cfb4c1 | MATLAB | 7,023 | 176 | %function [Data OrigIndex]= LoadBinary(FileName, Channels, nChannels, method, intype, outtype, Periods, Resample)
% Channels - list of channels to load starting from 1
% nChannels - number of channels in a file, will be read from par/xml file
% if present
% intype/outtype - data types in the file and in the matri... |
e7810a670581fbfed964e9922db14594e354433bd30099f158ee23e9e6b3bef2 | MATLAB | 7,026 | 220 | % op_matchLW.m
% Jamie Near, Floris van Vugt, McGill University 2018.
%
% USAGE:
% [out,lb,k]=op_matchLW(in,ref,ppmmin,ppmmax,tmax,mode);
%
% DESCRIPTION:
% Line-broaden the input spectrum (in) to match the linewidth of the
% reference spectrum (ref). A spectral similarity metric, similar to the
% one used in 'op_rm... |
2703934736572a8c521d0ebd716997b183b0b0368fdc5446112e75882e3b9e4f | MATLAB | 7,032 | 179 | function [outModel] = buildFullBrainModel(robModel, neuronModel, astroModel, fracN, fracA)
% buildFullBrainModel
%
% Generates a combined model with neurons, astrocytes, and 'the rest of the body' (rob).
% The model supports a total tumor biomass objective function which builds
% ECM and tumor cells. The other cell typ... |
11db0b74b4682df6810654d83a89a2484ba569d2c705f0b46734797db140dc0d | MATLAB | 7,049 | 199 | %% Behavior analysis
% Written by Rita Gil and Mafalda Valente
% Modified last in 15.12.2023
% For every batch calculate the percent of pulsating light reports across sessions
% Join batches
% Fit of the average response and bootstrapp with replacement for the std calculation
% Correlation with fMRI steady-state data... |
57400856506f3e2756b0560e11712d983a50d391f66f29acedd52f80a2114c70 | MATLAB | 7,053 | 169 | classdef view < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
hFig matlab.ui.Figure
GridLayout matlab.ui.container.GridLayout
Panel matlab.ui.container.Panel
RampdownmsSpinner ... |
92c6f8733167c37e3639ac641cdd1b096501a0249a328a54d96c7f4f7188a8a5 | MATLAB | 7,062 | 202 | function y = mrSampFunc(x,transp,samplingOp,R,opt)
% Perform MRI sampling.
%
% Usage: y = mrSampFunc(x,transp,samplingOp,R,opt)
% y = mrSampFunc(x,'notransp',...) performs MRI sampling for
% object-domain input x. y = mrSampFunc(x,'transp',...) performs
% adjoint of MRI sampling for data samples x.
%... |
4a1d45a9a43f7464e065f04494c3a9e177b2b5f13238e2752e2f5e894c1bf8bf | MATLAB | 7,068 | 281 | %Tristan Ursell
%2D Random Number Generator for a Given Discrete Distribution
%March 2012
%
%[x0,y0]=pinky(Xin,Yin,dist_in,varargin);
%
%'Xin' is a vector specifying the equally spaced values along the x-axis.
%
%'Yin' is a vector specifying the equally spaced values along the y-axis.
%
%'dist_in' (dist_in > ... |
cc0644ec019f43a5a417273e67c0e3be8120a1150ff3d863c520f7121984b2a3 | MATLAB | 7,070 | 153 | function [stackOut, stackChan, binLims, projPaths] = WriteSbxPlaneTif(sbxPath, sbxInfo, z, varargin)
IP = inputParser;
addRequired( IP, 'sbxPath', @ischar )
addRequired( IP, 'sbxInfo', @isstruct)
addRequired( IP, 'z', @isnumeric)
addParameter( IP, 'chan', 'both', @ischar ) % 'green', 'red', 'both'. for scanbox, 1... |
68f6b0c32d7641a3dd978f830e211f3021661b9d80153781e2862c1b288a4729 | MATLAB | 7,077 | 183 | % Selects one of default option bundles
% current working version is analysis option 2 or 97
function optionBundle = st_selectOption(analysisoption)
switch analysisoption
% Maximal Version
% no spaital smoothing
% currentWorking Version
case 1
rmName = 'GLMDenoised';
numberStimul... |
8625468ff22a4b6e3c9ae27946fa5b58ea546305aa7d3449eb6678b9b1d67093 | MATLAB | 7,078 | 295 | %
clear
close all force
load('a0_0_bhv2trialStrct.mat');
load a16_0_SacProperties.mat
%}
%%
iMonkey = 1;
UMuscimol = [ 0, 12,9 ,4,1 ,14,11 ,6,3 ];
UMuscimol = [ 0, 12,9 ];
UMuscimol = [ 0, 12,9 ,4,1 ];
UMonkey = [1,3];
nMuscimol = numel(UMuscimol);
figure(1);clf
figure(2);cl... |
e9b59d870ebaf258d0ded5e3be8ec205ca42bcfd4a49323817457b4a4270f5c3 | MATLAB | 7,078 | 195 | % op_alignAverages.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% [out,fs,phs]=op_alignAverages(in,tmax,med,ref);
%
% DESCRIPTION:
% Perform spectral registration in the time domain to correct frequency and
% phase drifts. As described in Near et al. Frequency and phase drift
% correction of magnetic resonan... |
4e4514f84c3b9ee1943850aa1b8f011726354000e5953932b8d77d76fb69447c | MATLAB | 7,088 | 191 | % loadParameters;
%Load puncta_centroids, puncta_voxels
filename_centroids = fullfile(params.punctaSubvolumeDir,sprintf('%s_centroids+pixels.mat',params.FILE_BASENAME));
load(filename_centroids);
filename_transcripts = fullfile(params.basecallingResultsDir, 'transcript_objects.mat');
load(filename_transcripts);
%Loa... |
27c59e4f4dd1ee5ad9a66ada421e381aa55531af735670648cb0353fb5102e97 | MATLAB | 7,089 | 135 | % the pattern separation toolbox: analyse spike train ensembles
% Copyright (C) 2022 Alexander D Bird
function [joint_distribution,input_distribution,output_distribution]=joint_distribution_MI(binned_inputs,input_code,binned_outputs,output_code,wordsize)
n_trial_in=size(binned_inputs,1);
n_trial_out=size... |
6b9f65fb14dca75727aba7128d2945aa2445c0fbc4525f507e88dde2a78658f3 | MATLAB | 7,099 | 159 | %%==========================================================================
% This is the main part of codes for help rejection model proposed by Gao, X., Jolly, E., Yu, H., Liu, H., Zhou, X., & Chang, L. J. (2020). The hidden cost of receiving favors: A theory of indebtedness. BioRxiv, 2020-02. doi: https://doi.org/1... |
a480982a1952d64801be3ec24ffe52e0db6731e9e760ce7aaf428df1284289ec | MATLAB | 7,119 | 204 | % FITD_STACK get cylinder diameter values from image stack.
% (trees package)
%
% D = fitD_stack (intree, stack, maxR, options)
% ---------------------------------------------
%
% Attempts to derive diameter values for tree intree based on the
% underlying image stack stack. maxR determines a threshold maximum radius... |
bebe83a447adae7fb0c75183acf8777ad8fb9558c07be487d7facc807bd14533 | MATLAB | 7,144 | 237 | clear;clc;
close all
colors={[51 103 161],[150 68 71]};legend_name={'Low-Depth','High-Depth'};
frequency=[8 24 40];
%% Figure 6a
subs=[8,30];
blocknum=12;
condition=2;
channum=9;%Pz¡¢PO5¡¢PO3¡¢POz¡¢PO4¡¢PO6¡¢O1¡¢Oz¡¢O2
frequency=[8 24 40];
bpdatah1=[];
home_path=[pwd,'\temporary data\Downsdata\'];
for j... |
08ea116408b375e2243e9dbfac5ed38bcbf793daf9ae3a2ff6de71bda387ba56 | MATLAB | 7,152 | 229 | function [pacmat, freqvec_ph, freqvec_amp] = find_pac_shf_fdr (sig_pac, Fs, measure, ...
sig_mod, ph_freq_vec, amp_freq_vec, plt, waitbar, width, nfft, num_shf, alpha,...
dataname, sig_pac_name, sig_mod_name)
% This function calculates a matrix of PAC values using either the ESC, MI
% or CFC measure.
% It use... |
b6a0713c16c8e5718d8b35b13387a5659732e8a3f120491e0d0ad4e90f0847bd | MATLAB | 7,154 | 199 | function [ROImask, nameList] = create_imgJ_mask(varargin)
%create_imgJ_mask - Helper function to create a mask from ImageJ ROIs
%
% ROI_MASK = create_imgJ_mask() prompts for all required information and
% creates a mask (ROI_MASK) specifying the regions of interest (ROIs)
% that were defined and saved using the e... |
0460df33b58e61c5645d6e0c2edf1c3d52d550b52641946b77420db827e743fc | MATLAB | 7,163 | 217 | % R_MC_TREE Checks R value in given tree.
% (trees package)
%
% [R, Rmin, Rmax, r0, rE, rEmin, rEmax, rEstd, n, rEs] = ...
% r_mc_tree (tree, alpha, n_mc, level, options)
% -------------------------------------------------------------
%
% Calculates the R value in a given tree using a Monte Carlo approach.
% It ... |
80126c009b99d20c0c2abe0c014ba86ee9fb10fc81ac83300df31fe20b1aac14 | MATLAB | 7,172 | 226 | %% This script allows performing analysis on hippocampal data.
% Here, define the path to the SampleData folder on your computer:
PathRawData='C:\Users\user\Downloads\island-master\SampleData';
%%
ActivityThreshold=1;
downsample_flag=2;
ActvitySmoothingSize=2;
NumOfBins=24;
p_neighbors_vec=[0.075/15 0.075];
global ... |
8f3acecb1d5dabb47a59f18d2f4b1efe679b336939438d1234c97803edba5db0 | MATLAB | 7,187 | 267 |
clear
close all force
load('a3_1_1_countingTime_everyTrial_SacExcluded.mat')
%load('a3_1_1_countingTime_everyTrialGroup.mat')
UM = [ 12,9 ;13,10 ;4,1 ;5,2 ;14,11 ;15,16 ;6,3 ;7,17 ]+1;
UMS = {'ML_10_M','ML_10_S','Co_10_M','Co_10_S','ML_5_M','ML_5_S','Co_5_M','Co_5_S'};
UM = [ 12,9 ... |
afad5ed76d0396dd0868deb00e2fd6447454242b3bbe439b3b375ef5ede20537 | MATLAB | 7,194 | 136 | function sbxInfo = RegisterRun(sbxInfo, regParams, varargin) % mouse, exptDate
% Run scanbox data through stages of optotune correction, rigid registration, and z interpolation. Also, write out tifs summarizing results from each stage.
IP = inputParser;
addRequired( IP, 'sbxInfo', @isstruct )
addRequired( IP, 'regP... |
8274ae468ff5e9c4f73f6950b3d9b34d3a928f6b14d0476dc5e8af5e65eaeb5e | MATLAB | 7,202 | 163 | %% Fit test range responses to cosine tuning curves
thetaRange = linspace(-pi, pi, 1000)';
tuningModel = @(b,x)( b(1) + b(2)*cos(b(4)*x - b(3)) ); % beta = [offset, tuning sharpness, peak angle, frequency ]
figure('WindowState','maximized');
tic;
cosFitResults = cell(1,Nexpt);
for x = 6
for r = flip(1:Nclic... |
a58e60e3d9002b2f3ab2d4f957f21d6d8c88482b6355139ec1440046e313da87 | MATLAB | 7,206 | 187 | %==========================================================================
% This script imports the microwire data.
%
% Lukas Kunz, 2020
%==========================================================================
% start
clear; clc; close all;
addpath(genpath('E:\NPMK-master\20201215\'));
% paths
beh_path = 'E:\... |
d4c240e7aaf07fb197b6d582951feba330d4c7a2bfa1c62b5db2b9783e1060cb | MATLAB | 7,209 | 182 | %%% Toy Model Ising Frustrato
% Costruiamo una geometria esagonale con link -1 e un settimo spin al
% centro collegato agli altri con spin +1
clear; clc
addpath('C:\Users\tomsc\Dropbox\Matlab\Dottorato Matlab\Projects\my_Code\GHOI')
N = 7;
B = [0,0,0,0,0,0,0]; % External magnetic field
% Create hexagon... |
0fb9ccc230109268c5f6475378eca6b2be1066b908ae5f7cc51022a5ff441348 | MATLAB | 7,211 | 179 | function [outModel] = buildFullBrainModel(robModel, neuronModel, astroModel, fracN, fracA)
% buildFullBrainModel
%
% Generates a combined model with neurons, astrocytes, and 'the rest of the body' (rob).
% The model supports a total tumor biomass objective function which builds
% ECM and tumor cells. The other cel... |
616a986938e6173db393836cfaf7652f8b22ff2e6f0c985d0bc673e7fc1f5d6d | MATLAB | 7,233 | 165 | function [pressed firstPress firstRelease lastPress lastRelease] = KbQueueWaitCheck();
% secs=KbQueueWait()
%
% Requires Mac OS X 10.3 or later
%
% The routines KbQueueCreate, KbQueueStart, KbQueueStop, KbQueueCheck
% KbQueueWait, KbQueueFlush and KbQueueRelease provide replacments for
% KbCheck and KbWait, providing... |
bd1ade7127c16aae815d8789b1ba7cfc37f0a603a719bbddc31653ee9b39c09e | MATLAB | 7,234 | 202 | clear all
close all
rng(0)
unifyContextClasses = false;
averageAllBoutsFromSession = false;
NumTrees = 80;
TakeJustTheta = false;
TakeJustGamma = true;
matlabImpute = true;
imputeIters = 80;
paramsStr = ['Ntree',num2str(NumTrees),'_Unify',num2str(unifyContextClasses),'_JustT',num2str(TakeJustTheta),'_Ju... |
6c295c02ed4a870a9e17a4ea6adbdbe7c22e904e1558518a4f6ed6fb47eb396a | MATLAB | 7,267 | 227 | % Compute expected EEG variance of 16 billion passive neurons
load(fullfile(dataFolder,'cortex_anatomy','anatomy_cortical_pairwise_distance_distribution.mat'));
signed_area = A;
N = 16e9;
dMids = 0.5*(rValues(2:end)+rValues(1:end-1));
nrnCount = mean(diff(signed_area),2)*200000;
nrnCount(end) = N-sum(nrnCount(1:end-1))... |
0b5f36817f8ef33ec86972f3472526ad0aa8a35ffcd62ec9481352ef22e19b1b | MATLAB | 7,277 | 149 | function segmentation_data = Extract_3D_Mask(sbxPath, sbxInfo, mask, trace_hp, trace_raw, projScans, censScans, varargin)
p = inputParser;
addOptional(p,'prctile_cutoff',90); %correlation coefficient cutoff prctile
addOptional(p,'volume_cutoff',100); %size filter for objects in 3d mask (voxels)
addOptional(p,'xypro... |
d4d52b764d4214912b2141809a0e5496e29dc92fed06931204ca5139e0795300 | MATLAB | 7,281 | 229 | % VHULL_TREE Voronoi based subdivision of a tree.
% (trees package)
%
% [HP, VO, KK, vol] = vhull_tree (intree, v, points, ipart, DD, options)
% ----------------------------------------------------------------------
%
% Subdivides a tree in convex polygons using the voronoi-algorithm. Returns
% 1 patch around each po... |
7c30312b687ff818d373e54a2a47bbf73b8283bb5788a11aae1967bec8302499 | MATLAB | 7,294 | 328 |
clear
close all force
warning on
imSize = [733, 977];
pix2deg = 34.910;
V = round(pix2deg*2);
W = round(pix2deg*2);
S = imSize;
M = S(1) - mod(S(1), V);
N = S(2) - mod(S(2), W);
MV = M / V;
NW = N / W;
sigXY = pix2deg * .25;
load('a0_0_bhv2trialStrct.mat');
%{
NIm{1} = [7
9
11
22
25
27
28
38
39
40
41
42
43
44
47
4... |
cfe5107367e44728a5abf1197d4e733eec298b4a8c2b314e88722fa3c61dacbc | MATLAB | 7,299 | 197 | function [img_u, MM] = linear_unmix(img, varargin)
%linear_unmix - Perform linear unmixing of image channels
%
% IMG = linear_unmix(IMG) prompts for all required information, and
% performs linear spectral unmixing on IMG, an MxNxCxP image array, where
% MxN are the dimensions of the image(s), C is the number of ... |
c19949d97e13d9be8e52bce16ca0fdf5b4697b3a838ec4216827958ea10b710e | MATLAB | 7,305 | 279 | %io_loadspec_data.m
%Jamie Near, McGill University 2014.
%
% USAGE:
% [out,out_w]=io_loadspec_data(filename,sw,Larmor,subspecs,te,tr);
%
% DESCRIPTION:
% Reads in philips MRS data (.data and .list files) using code adapted from
% PhilipsRead_data.m, provided as part of the Gannet software package by
% Richard Edden ... |
06bb6f3166ab0afa587f91ed0783ce764ed552c5c95e08bdaac82defc547bbe8 | MATLAB | 7,308 | 191 | %==========================================================================
% This script imports the iEEG-data.
%--------------------------------------------------------------------------
% This results in the fieldtrip structure "eeg_original" with
% .label: cell-array containing strings, Nchan x 1
% .fsample... |
7784382c4323264543e45d6523be49e6828a974423252794913538d1df4fc2a2 | MATLAB | 7,315 | 212 | function [N,X,sp] = histogram(varargin)
% HISTOGRAM generates a histogram using the "optimal" number of bins
%
% If called with no output argument, histogram plots into the current axes
%
% SYNOPSIS [N,X,sp] = histogram(data,factor,normalize)
% [...] = histogram(data,'smooth')
% [...] = histogr... |
2aef288a899dfec42427be54487f628733dd83d7b33fa560a114c3cd8d51330b | MATLAB | 7,339 | 163 | %%
% Reproduces the modeling panels in Fig. 6 in:
% IA Oldenburg, WD Hendricks, G Handy, K Shamardani, HA Bounds, B Doiron,
% H Adesnik. The logic of recurrent circuits in the primary visual
% cortex. Nature Neuroscience (2024)
%
% Written and edited by G Handy, IA Oldenburg, and WD Hendricks
%%
clear;
% Load ... |
96cfbb93ea1b3a74f806c45c0492992b38e4d7338f8b4bf31af70f8341442525 | MATLAB | 7,351 | 182 | classdef ConfigFindROIsAuto < Config
%ConfigFindROIsAuto - Parameters for automatic ROI identification
%
% The ConfigFindROIsAuto class is an abstract configuration class that
% contains the general parameters necessary for region of interest (ROI)
% identification. Further parameters are found in the concrete
%... |
882817d5e83173a5df265d7dde1d2880f65113de337885a5e1293f4fae1f62e3 | MATLAB | 7,354 | 320 | function [fn,saveName] = st_plot_temporal_bar(DT, params,roiList,targetModel,targetVar)
%%
if targetModel == 2
tms = {'\tau_1', '\itw', '\tau_2', '\itn_D_N', '\sigma_D_N'};
nParam = 5;
elseif targetModel == 3
tms = {'\tau', '\tau'};
nParam = 1;
end
if notDefined('targetVar')
targetVar = 'temporal';... |
8530f2ba9a5e5aad812f0b5f9af3d40780a5d4555d1e24406c6d6985ee9e7c67 | MATLAB | 7,367 | 271 | % mv_regress unit test
rng(42)
tol = 10e-10;
%% Create a dataset where there is a linear relationship for the first half of the time points
nsamples = 100;
ntime = 300;
nfeatures = 10;
scale1 = 0.0001; % low noise = strong relationship
scale2 = 1000; % high noise = weak relationship
% Generate data with is noise f... |
515ee1fd8124989dc6ab501c3c432faf90bbf070f43a960c6a57b203267f3309 | MATLAB | 7,372 | 184 | function [amp, Vrest] = t2n_findCurr(neuron,tree,desv,amp,options)
% This function finds the current necessary to keep the neurons defined in
% "neuron" and "tree" at a desired voltage or alternatively finds the
% spiking threshold.
%
% INPUTS
% neuron t2n neuron structure with already defined mechanisms (s... |
636d5a5f790746c1a28a56f23cc948a96e75ac86640c6bd614c896dfabd2b278 | MATLAB | 7,392 | 194 | function stimConfigPatternGenerator(fname,coords,varargin)
% Add a pattern of points to a stim config file. Creates it if necessary
%
% function zapit.utils.stimConfigPatternGenerator(fname,varargin)
%
% Purpose
% Used to generate patterns of unilateral stimulation points. So if you
% make ... |
9a9305d0c8510528f7f84c5481ee6aca58d6fc6e94ec2160cfe8ea53906c69c1 | MATLAB | 7,392 | 150 | function [projStack, rgbStack, projPath] = WriteSbxProjection(sbxPath, sbxInfo, varargin) % projPath,
% Extract data from an SBX file, and then perform a projection (mean or max) across frames
checkInfo = @(x)(isstruct(x) || isempty(x));
IP = inputParser;
addRequired( IP, 'sbxPath', @ischar )
addRequired( IP, 'sb... |
8aaaf69774f5b972a76c3bc7096b0eb2db3188e6b659d8fad47341ffc285f93c | MATLAB | 7,395 | 188 | classdef DataVelocityRadon < DataVelocityStreaks
%DataVelocityRadon - Data from Radon based velocity calculations
%
% The DataVelocityRadon class is a data class that is designed to
% contain all the basic data output from CalcVelocityRadon.
%
% DataVelocityRadon public properties inherited from Data:
% mask ... |
b79a8806f3b24c2521ed22319c894bb39c8c32fc278b711404ea7bfc085b524b | MATLAB | 7,395 | 205 | classdef Test_ArbLineScan < matlab.unittest.TestCase
%TEST_ARBLINESCAN Summary of this class goes here
% Detailed explanation goes here
% ================================================================== %
properties
end
% ===========================================================... |
3437e0833bfd7425dcf3fcf154b1ed1fe4809e61267593ff70b7c2e6c3e8024c | MATLAB | 7,410 | 210 | function val_glm_fast
% Is the accelerated GLM identical to the unaccelerated one, and how much faster?
%
% calc_GLM_fast obtains the permuted statistic from the n_vox x rank(X) matrix
% Beta alone. It never forms the permuted data matrix and never forms the
% residual matrix, because
%
% ResSS = ||R*y||^2 = ||y||^2 ... |
9fed8db6d0bbbee9285569bcb0f266012322abd10bbfb5708ca00848053523f5 | MATLAB | 7,429 | 158 | function hardwareContinuousVoltageNoRegen_DigTrig
% Example showing hardware-timed continuous analog output without regeneration using the Vidrio dabs.ni.daqmx wrapper
%
% function vidrio.AO.hardwareContinuousVoltageNoRegen_DigTrig
%
% Purpose
% Demonstrates how to do hardware-timed continuous a... |
982ee2fb6f1e09c80e786d1b6cc466155a848b4716e6ba9617566d09a95773f1 | MATLAB | 7,431 | 210 | 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... |
91e5fc38376d06beb398391db289bb9fd6d8969f8cdc917a5e2eb425a0b38e0f | MATLAB | 7,437 | 210 | classdef (SharedTestFixtures={matlab.unittest.fixtures.PathFixture(...
fullfile(fileparts(mfilename('fullpath')), '..', '..', '..', 'processingTools'), ...
'IncludeSubfolders', true)}) ...
testop_CSIApodize < matlab.unittest.TestCase
properties
MRSIStruct
kMaxX
kMax... |
c9b6707a12a49e6498461267f6741eaafddb15053d5e8d2211abba2b747118ef | MATLAB | 7,441 | 193 | %% Snippet Plot Example
%
% <html>
% Import snippet data into Matlab using TDTbin2mat <br>
% Sort snippets based on channel number and sort code for any number of channels and sort codes <br>
% Plot the average waveform shape and standard deviation for 16 channels and three sort codes <br>
% Good for spike sortin... |
81fcde4cbb1edf63505ac5fd8f21d87238a2f7939b53675a4fbe405760e3f6e1 | MATLAB | 7,442 | 209 | function [data] = ft_nirs_transform_ODs(cfg, data)
% FT_NIRS_TRANSFORM_ODs computes the transformation from optical densities (OD)
% to chromophore concentrations such as (de-)oxygenated hemoglobin, or the
% other way around.
%
% Use as either
% [data] = ft_nirs_transform_ODs(cfg, data)
% [freq] = ft_ni... |
3f6e4b3949beceb8cf4183314969375e0d9290f845c08ca8f21f0493695f4a7b | MATLAB | 7,451 | 197 | %op_CSIDensityCompensation.m
%Brenden Kadota, Jamie Near, Sunnybrook 2021.
%
% USAGE:
% [out, weight_map]=op_CSIDensityCompensation(in,k_space_file, NamveValueArgs);
%
% DESCRIPTION:
% Takes a CSI FID-A structure and a k space file and applies density
% compensation from voronoi diagrams. Name value arguments can be p... |
a6c7521adc1325b12cfb40f8ac6cafad14ccf842459d5ddf020592c344367fee | MATLAB | 7,455 | 185 | function out = LK_3DPermutationTest_OneSampleAgainstZero_20220302(dat)
%
% LK_3DPermutationTest_OneSampleAgainstZero_20220302 performs cluster-based
% permutation testing against zero for three-dimensional data (e.g., time x
% frequency x channels).
%
% Note that the statistics are calculated across the third dimension... |
d2c510f3fa44336a7cd84d6e69aab91a943535a2dd3491a18b125103b2f96caa | MATLAB | 7,463 | 200 | function figureS3(dataFolder)
if(nargin<1)
error('Path to data required as input argument. Data can be downloaded from link in README file.');
end
% Add paths for function execution
myPath = mfilename('fullpath');
basePath = fileparts(fileparts(myPath));
addpath(fullfile(basePath,'auxiliary'));
addpath(fullfile(b... |
fe3eba00eb54d38f92bc84d4363d7dc5ff56dd11decf52e14a7106bb7fc7ff85 | MATLAB | 7,463 | 187 | function [perf, result, testlabel] = mv_crossvalidate(cfg, X, clabel)
% Cross-validation. A classifier is trained and validated for
% given 2D [samples x features] dataset X.
%
% If the data has a time component as well [samples x features x time] and
% is 3D, mv_classify_across_time can be used instead to perform
% cr... |
ef8ffc0a1b4390b0092a0bc1f960f6fcfccb627cc88b7cad8cbf3e7a113f212a | MATLAB | 7,467 | 187 | function [job, dirs, betas] = taft_postprocess_load_job(EEGdomain, ROIs2use, behav2use, selTrials)
% [job, dirs, betas] = taft_postprocess_load_job(EEGdomain, ROIs2use, behav2use, selTrials)
%
% Interactive script.
% Load beta-weights from multiple linear regression of EEG on fMRI and
% behavior per subject.
% Only r... |
8e2848589453e7cfd8633a8526da760594354326897ea3139e7c17c7022a7603 | MATLAB | 7,468 | 215 | classdef TDTUDP < handle
%TDTUDP TDT UDP class.
% obj = TDTUDP(TDT_UDP_HOSTNAME, TYPE) connects to RZ specified by
% TDT_UDP_HOSTNAME, which can be either the RZ's IP address or
% NetBIOS name
% TYPE (optional) specifies the data type to expect. Default is
% 'int32'.
%
... |
530e9e80402bccfabec53b87d845ea91b3444772d19870bbce4c1df9b8dc65f9 | MATLAB | 7,469 | 184 | % NEUROML_TREE Export tree to NeuroML format.
% (trees package)
%
% [name path] = neuroml_tree (intree, name, options)
% --------------------------------------------------
%
% exports a tree to NeuroML format for use for example
% MORE...
% Input
% -----
% - intree::integer:index of tree in trees or structured tre... |
9fe9dd64c1cc598de050e5a04f8ed302c8f6cd7043f9a8a65bfb2b16ab3ccd12 | MATLAB | 7,485 | 264 | clear
close all force
% this code will include faces presented on the center for now, if you need that, activate:
% "%if ~isFixationPointOnFace{cImage}(iFp) && ~isFixationPointXOnFace{cImage}(iFp)"
% the problem is if you need corrected baseline, it's not valid anymore and you need to recalculate the corrected b... |
2e2df5a26b03b4401940773bb2f4dfa671cd037eea799aec922bbec88dec855d | MATLAB | 7,488 | 195 | function model=rmGrayModel(view,model)
% rmSave - save/reshape model analysis in output that mrVISTA can read
%
% output = rmSave(view,model,forceSave);
%
% 12/2006 SOD: wrote it.
if notDefined('view'), error('Need view structure'); end
if notDefined('model'), error('Need model structure'); end
% if notDefined('p... |
bbe11f515540ff6b7bb359b8bc749e2764e3710d21718dd318871efa26529bfd | MATLAB | 7,502 | 228 | %% ImgGroup
% Contain and analyse groups of processable objects
%% Usage
% OBJ = ImgGroup(RAWIMG, CONFIG, PROCTYPE)
% OBJ = ImgGroup(..., PROCOBJ1, PROCOBJ2, ...)
% OBJ = ImgGroup(NAME, ...)
%% Arguments
% * |RAWIMG| is the |RawImg| object array that will be used to create the
% |ProcessedImg| child objects in the... |
32f99de677ca3cb66e19c453f98090d2b9839ae23c7851c97a786a5a4307e9d8 | MATLAB | 7,512 | 228 | classdef (Abstract) Processable < matlab.mixin.Copyable & ITraj
%Processable - Superclass for Processable classes
%
% The Processable class is an abstract superclass that implements (or
% requires implementation in its subclasses via abstract methods or
% properties) most functionality related to Processable obj... |
4686c050adaaf5d6e6a87941eed01b742f1c9ae14ea3979e586e7d481c213c6f | MATLAB | 7,515 | 201 | function figureS3(dataFolder)
if(nargin<1)
error('Path to data required as input argument. Data can be downloaded from link in README file.');
end
% Add paths for function execution
myPath = mfilename('fullpath');
basePath = fileparts(fileparts(myPath));
addpath(fullfile(basePath,'auxiliary'));
addpath(fullfile(b... |
f2a2ec95fc8cc63adc2a8642bc5363e6357f8ffae43f9eed85540c58d48238cd | MATLAB | 7,516 | 179 | constants
load([DATA_PATH '\full_neuron_firing_per_bin']) %num of spikes cells-by-time
load([DATA_PATH '\angle_per_temporal_bin'])
load([DATA_PATH '\position_per_temporal_bin'])
load([DATA_PATH '\spike_rate_mat_neuron_by_angle'])
%%
number_of_neurons = size(full_neuron_firing_per_bin, 2);
% Filter the neurons firing... |
843dbd13313163cb3db28ef275b4affeb334f223ed6f5f717f85153fd51b1428 | MATLAB | 7,521 | 193 | function [tg, corrp] = taft_postprocess_time_ERplot(job, dirs, sortBetas, iROI, selChans, thresh, nP, isSave)
% [tg, corrp] = taft_postprocess_time_ERplot(job, dirs, sortBetas, iROI, selChans, thresh, nP, isSave)
%
% For fMRI-EEG regression weights for selected ROI,
% select data for given channels/ time range, perfo... |
e8ac80b17199823266fe5b702686aa150c354969c857d3591a2681d1a9dba597 | MATLAB | 7,531 | 204 | classdef (Abstract) DataFindROIs < Data
%DataFindROIs - Superclass for all DataFindROIs classes
%
% The DataFindROIs class is an abstract superclass that implements (or
% requires implementation in its subclasses via abstract methods or
% properties) all basic functionality related to storing data from ROI
% id... |
87d6fae13959ec8612380c5b14eb621c0a925bf2c3e3de39bf9248311a5902b0 | MATLAB | 7,537 | 158 | function SpecificMod_EnvironmentalSounds_01032022(AllDataFiles,AllParameters,app)
NumOfFiles=[ length(AllDataFiles.TimeStampsfileList) ...
length(AllDataFiles.ManuallyDefinedEventsfileList) ...
length(AllDataFiles.Video1BehavioralfileList) ...
length(AllDataFile... |
cb064e55e932561defada227f8f56c635f1f254456777ea00f0cbfe0e5310bab | MATLAB | 7,543 | 227 | function output = plot_PEs_ROI_outcome(ROIname, ROItitle, GLMID, condOrderName, isPoint, isLegend, yLim)
% Create bar plots for outcome-locked parameter estimates per condition
% extracted from ROI.
% Plot in order of extraction (i.e. Valence, then Action).
% THIS SCRIPT MIGHT ONCE HAVE BEEN JUST A TEMPLATE FOR THE OT... |
5dd77f14ff60fa4d04fcd091c490dc0bbb43c548e8291a8f2125331557a80d6d | MATLAB | 7,549 | 138 | function [redundancies]=joint_distribution_RR(binned_spikes,code,wordsize)
if ismatrix(binned_spikes)
sz=size(binned_spikes);
binned_spikes=reshape(binned_spikes,[sz(1),1,sz(2)]);
end
n_trial=size(binned_spikes,1);
n_rep=size(binned_spikes,2);
if ~strcmp(code,'temporal')
... |
e68e55f937ad7b7c87448fb6c460fbb8ee4db41ef74e93f031aba7094428fa25 | MATLAB | 7,549 | 210 | function varargout = process(self, useParallel, varargin)
%process - Process the child objects
%
% process(OBJ) processes the children of the ImgGroup object OBJ.
%
% process(OBJ, USEPARALLEL) explicitly specifies whether to process the
% ImgGroup object's children in parallel, using an available parallel
% poo... |
e571a0f07ca1cff8b17da3e39ed9011dfd72559061f8130640e4fdfc99163459 | MATLAB | 7,553 | 205 | function [cf,Sw,lambda,mu1,mu2] = train_lda(param,X,clabel)
% Trains a linear discriminant analysis with regularization of the
% covariance matrix.
%
% Usage:
% cf = train_lda(param,X,clabel)
%
%Parameters:
% X - [samples x features] matrix of training samples
% clabel - [samples x 1] vector of cl... |
0c3028e4e44cf2fbf274329e10843dd46b2538d690d491f33ea6ac9c78bbac93 | MATLAB | 7,557 | 101 | %% Use GLM to assess contribution of different variables
locoDeform_vol_pred = cell(1,Nexpt); locoDeform_vol_resp = cell(1,Nexpt); locoDeform_vol_opts = cell(1,Nexpt); locoDeform_vol_result = cell(1,Nexpt); locoDeform_vol_summary = cell(1,Nexpt);
%figDir = 'D:\MATLAB\LevyLab\Figures\3D\GLM\'; mkdir( figDir )
%rLocoP... |
fb70ae46afc61146d1c447ae053b7700098fdb229315bf180d0702808225383d | MATLAB | 7,564 | 298 | %
clear
close all force
load('a0_0_bhv2trialStrct.mat');
load a16_0_SacProperties.mat
%}
%%
%
iMonkey = 1;
UMuscimol = [ 0, 12,9 ,4,1 ,14,11 ,6,3 ];
UMuscimol = [ 0, 12,9 ];
UMuscimol = [ 0, 12,9 ,4,1 ];
UMonkey = [1,3];
nMuscimol = numel(UMuscimol);
figure(1);clf
figure(2);... |
9013b5acc0cd4189992897f552455cec4a4fd2569560ed6181ca0cc4aa9f5f2a | MATLAB | 7,570 | 38 | % Look-up table for Turbo colormap.
% Includes example usage and comparison with other colormaps.
% Adapted for Matlab from https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f
% https://gist.github.com/nikolaskaralis/b19a1d192e6972d73ab7a0a1005a0e17
% Nikolas Karalis, 21 August 2019
turbomap2 = [[... |
fd26dff9da7fc0be2c8c1d2ffabb28a7bacacdbf9d5dfd3571a3808b7f7614bd | MATLAB | 7,590 | 213 | function out = LK_RippleDetection_DetectRipples_20220319(mycfg, myeeg)
%
% LK_RippleDetection_DetectRipples_20220319 detects ripples.
% Step 1: candidate ripples are detected.
% Step 2: candidates are selected as ripples based on several criteria:
% - peak amplitude;
% - duration;
% - number of cycles;
% - powe... |
7923c0b82683466f2d3051e5d3e5db2f0bfd5b25660565118ad97a45e2591628 | MATLAB | 7,591 | 187 | classdef CalcMeasureROIsDummy < CalcMeasureROIs
%CalcMeasureROIsDummy - Class for basic ROI measurements
%
% The CalcMeasureROIsDummy class is a Calc class that obtains basic
% measurements from previously identified ROIs, especially the raw
% traces, and traces normalised to a baseline period.
%
% CalcMeasureR... |
324c6488d1774c980872e9722ea75e2cbd54fd0ffca6a12e7b1df23bbcc98ca4 | MATLAB | 7,614 | 163 | function out = LK_PlotCueObjTuning_20230923(dt)
%
% LK_PlotCueObjTuning_20230923 plots various information about object
% tuning during the cue period.
%
% Input is a structure with multiple fields for plotting.
%
% Output is a structure with fields:
% f --> figure handle
% m --> average firing rates for the un... |
5b5d30488ca70842561e26cc5e45aa7ca3c6a5d2961df1bfe7853684d384c63e | MATLAB | 7,616 | 189 | classdef DataFindROIsFLIKA < DataFindROIs
%DataFindROIsFLIKA - Data from FLIKA-based ROI identification
%
% The DataFindROIsFLIKA class is an abstract superclass that implements
% (or requires implementation in its subclasses via abstract methods or
% properties) all basic functionality related to storing data fr... |
b708dfea1b791d4cbccf10cdbf1e12d2c1a1b09746f4942a3a3f80bcc50ccd58 | MATLAB | 7,654 | 191 | function [cfg, Y, nmetrics] = mv_check_inputs_for_regression(cfg, X, Y)
% For regression: Performs some sanity checks and sets some defaults for
% input parameters cfg, X, and y.
% Also checks whether external toolboxes (LIBSVM and LIBLINEAR) are
% available if required.
if ~iscell(cfg.metric)
cfg.metric = {cfg.m... |
0a6dc09c43068e6deeef5e73156fdf6af8bf4f6371a7732cb7a1e82a47a8e899 | MATLAB | 7,657 | 232 | 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
% using the default formatting parameters. If the filename includes an
% extension, it will be used as-is; if it does not, the relevant data
% class s... |
e33892a80feafa542eb4e35fb517e29d279b0b86551ec7d81d17e9158f89f701 | MATLAB | 7,673 | 216 | function EEGfMRIPav_OutcomeLocked_6_finalPP(rootDir, subVec)
% EEGfMRIPav_OutcomeLocked_6_finalPP(rootDir, subVec)
%
% Reject trials, compute surface LaPlacian filter (and at the same time
% interpolate bad channels). Final steps of pre-processing.
%
% INPUTS:
% rootDir = string, root directory of project
... |
02016405befa3d37ce68471c6f0707adc6fb3d0e8fcb4a27199d017784338735 | MATLAB | 7,674 | 177 | clc;clear;close all
%%
% Read data from a CSV file and remove the first row and column
df_reduced_UKB = readmatrix("data/beta_t_p.csv");
df_reduced_UKB = df_reduced_UKB(2:end, 2:end);
% df_reduced_UKB = df_reduced_UKB(:, 2:end);
% Compute the negative logarithm of the p-values (column 5 of the data)
nlogp_gscore... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.