sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
24fdf15b7298512735ea086c9de42fd1420c7ae06833d40f4badd6f3f8a7e822 | MATLAB | 5,282 | 113 | classdef CBIG_ASDf_unit_test < matlab.unittest.TestCase
% Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
methods (Test)
function test_short(testCase)
% create output folder
CBIG_CODE_DIR = getenv('CBIG_CODE_DIR');
... |
17bc376d79abf8bde750e55bcefcdd5fafc3d864077afbae9607fe637ac0bab1 | MATLAB | 5,284 | 137 | function [Neural_info,Mov_params]=neural_data_per_duration(cont,trial_table2,neural_data,sigma_filter,t_from,t_upto,duration_range)
%% neural_data_per_duration selects the neural activity and the movement parameters for all movements within the duration range
%
% INPUTS
%
% Session= Name of the session to be analysed.
... |
01de102a3a1906a05e088a87fa406e1e04c9d92e36da91c3418fd6e3d165e9e8 | MATLAB | 5,286 | 116 | %% Obtain Spine density and dynamics values
% For in vivo spine data analyzed using MapManager V_20171028
% Author: Richard Roth (rhroth@stanford.edu)
% Date: Sept 2023
% Requires the following functions:
% getmyMapListValuesCond.m
% segmentCall.m
% removeNanRows.m
%% Get Values
clearvar... |
1d979e0f6dbf0d287a1eb9d881a8ea13f2cce21b28729ac55f493705c67d0f78 | MATLAB | 5,287 | 199 | function varargout=shadedErrorBar(x,y,errBar,varargin)
% generate continuous error bar area around a line plot
%
% function H=shadedErrorBar(x,y,errBar, ...)
%
% Purpose
% Makes a 2-d line plot with a pretty shaded error bar made
% using patch. Error bar color is chosen automatically.
%
%
% Inputs (required)
% x - vec... |
6261aab7678a1babe749246499fe791b8db86fc152da11d116ba25583af4c765 | MATLAB | 5,287 | 149 | function [f, BlkIdx] = HashingHist(PalmNet, ImgIdx, OutImg)
% Output layer of PCANet (Hashing plus local histogram)
% ========= INPUT ============
% PCANet PCANet parameters (struct)
% .PCANet.NumStages
% the number of stages in PCANet; e.g., 2
% .PatchSize
% the patch size (fil... |
c4056fcb08053207c1d77664acdb8ce4d290e41a0dee2cbf015f38959bec51f8 | MATLAB | 5,288 | 173 | addpath(genpath('.'))
addpath(genpath(fullfile('..','ANE')))
%%
global gui;
global txtFntSz;
global video;
global masks;
global area;
global r_bg_ratio;
global comx;
global comy;
global list_weight;
global list_weight_trace;
global list_weight_frame;
global list_neighbors;
% global list_mask_update;
% global masks_up... |
d0cc934fb73e77b25f7bc60d75733299b15d22a45f3b3dfe8224abfe7fb6eaf2 | MATLAB | 5,290 | 164 | function RF = stGaussian2d(X,Y,sigmaMajor,sigmaMinor,theta, x0,y0)
% pmGaussian2d - Create a two dimensional Gaussian receptive field,
% this function is inherited from vistasoft/PRFmodel
%
% RF = pmGaussian2d(X,Y,sigmaMajor,sigmaMinor,theta,x0,y0);
%
% X,Y : Sample positions in deg
% sigmaMajor : standar... |
81700a019089922609c3add4cebc10df3dcc9db0220d7782fbccdd463c8b7618 | MATLAB | 5,291 | 169 | function Params = params_bruker(fname, expno, procno)
% Params = params_bruker(fname, expno, procno)
%
%% Author: Xu Li (xuli@mri.jhu.edu)
% Affiliation: Radiology @ JHU
%
% read in scan parameters from Bruker ParaVision 5
% the image file is in the directory <fname>/<expno>/pdata/<procno>/2dseq
%
% certain... |
455d797046b075d22a40864cba76646c5ba8184eba16d058a1f8d7cfe43ab593 | MATLAB | 5,294 | 149 | classdef simul3Dcylinder_cuda_pgse < handle
properties (GetAccess = public, SetAccess = public)
sig;
TD;
dtime; Tstep; NPar; Din; Dex; kappa; pinit; res;
% dt_lls; adSig; rdSig; mdSig; akSig; rkSig; mkSig;
dx2t; dx4t;
% dx2tSig; dx4tSig;
% dx2tShl; dx4tSh... |
99d3832e51c8b839d6b870115f7daeea63b1b91c4716faf3d1c4c59463e1279f | MATLAB | 5,295 | 146 | % multiStepOpto.m
%
% Optogenetic Stimulation Function. Opens up shutter in front of mercury
% lamp for durations specified by user.
% When specifying durations, enter as vector, with square brackets
% Has option to randomize durations or not. User specified step
% duration and time between steps.
% Returns vector... |
1c117af8ce06606e40878c1421ceb3259044c240156d4992706f3dd7bf9e0fc9 | MATLAB | 5,296 | 140 | classdef AbstractFeatureSeries < types.core.TimeSeries & types.untyped.GroupClass
% ABSTRACTFEATURESERIES Abstract features, such as quantitative descriptions of sensory stimuli. The TimeSeries::data field is a 2D array, storing those features (e.g., for visual grating stimulus this might be orientation, spatial freque... |
6eb40dbf2f13cdef7421bef153301527f91edc83f6fec8423d14664aeea0aecf | MATLAB | 5,299 | 160 | function [SMVdata, background] = SHARP_Adaptive_Multi2D(GREPhaseSE, mask, radiusMAX, thresh_reg, Params)
% [SMVdata, background] = SHARP_Adaptive_Multi2D(GREPhaseSE, mask, radiusMAX, thresh_reg, Params)
% Author: Xu Li
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
%
% Ref: Schweser et al. 2011, NIMG,... |
f77f62440403781ec921544f4373c54af9f2defd72da88047d4bc28fbd5bf003 | MATLAB | 5,304 | 147 | % stepParam2VectorSpline.m
%
% Function that takes in legSteps struct and returns a vector of values for
% a single field, during either stance or swing, at a specified times.
% Assigns parameter to midpoint of half step to which it belongs. Then uses
% spline interpolation to fill in values for specified times. NaNs... |
bc1d7f11f58e52864c12b3bd8cd9f77412accf93da529668f7a92d37eff2fddf | MATLAB | 5,307 | 179 | function [x, cost_reg_history, cost_data_history] = delta2chi_MEDI(deltaB, Params, m, Mask, lambda, merit, edgePer, smv_rad)
% [x, cost_reg_history, cost_data_history] = delta2chi_MEDI(deltaB, Params, m, maskErode, lambda, merit, edgePer, smv_rad)
% QSM using MEDI_L1
% deltaB: field change in ppm
% Params:... |
7d8caea9024f7a2dcfd7594e63e22b1960f267e2b97845660f504c3f5b8ab7e9 | MATLAB | 5,311 | 147 | classdef simul3Dsphere_cuda < handle
properties (GetAccess = public, SetAccess = public)
TD;
dtime; Tstep; NPar; Nbvec; Din; Dex; kappa; pinit;
% dt_lls; adSig; rdSig; mdSig; akSig; rkSig; mkSig;
dx2t; dx4t; sig;
bval; bvec;
% dx2tSig; dx4tSig;
% dx2tShl;... |
3f0ce4f6d8ca5fc2f425ef8a1c1a33361e2bf37b543c79db053f468bf0377ced | MATLAB | 5,312 | 154 | %% run chase classifier on some simulated data
%% set up path
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/misc;
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/filehandling;
addpath(genpath('/groups/branson/home/bransonk/tracking/code/FlyTracker-1.0.5'));
fb... |
3a58f1cc0ec85912d4a1ddcb0c4a97e1cf48a1be851d2a3192c4400e44ca38e1 | MATLAB | 5,317 | 131 | %Calculate parametric ANOVA at each time point and electrode with various
%multiple comparisons corrections available.
%
%EXAMPLE USAGE
% >> test_results = calc_param_ANOVA(data, [], [3, 4], 0.05, 'bh')
%
%REQUIRED INPUTS
% data - An electrode x time points x conditions x subjects array of ERP
% ... |
6e62661eeda04f32c1212d8921ccf66895cbe8327bb304b93255645c0e6db08a | MATLAB | 5,319 | 148 | function VOR_Tests(params)
% This function takes in the information given to the UI and runs the
% relavent test(s) on the data
params.TopFolder = params.folder;
% Single Analysis
if params.count == 1
params.folder = params.smr_files(1).folder; % hackish. related to folder selection error
... |
ab380cdbde3e19effb1820ebced4e65b5b38ea8d294d8dd8a2b18f48d38d04da | MATLAB | 5,321 | 149 | % computeKernelFromAutoXcorr.m
%
% Function to take pre-computed autocorrelations and cross-correlations
% (outputs of getSpikerateAutocorr_cell() and
% getXCorrEphysContParam_cell()) and convert it to a first-order Wiener
% kernel by transforming the autocorrelation and cross-correlation into
% frequency space and... |
189d0c83c0fed48ce0f6bbac5f26f4f550353ef3c33fa0ed646073b7b5d20b6e | MATLAB | 5,324 | 128 | % Get permuted split-half of EEG connectomes
% SI Table 3 manuscript
%
% 2022-08-22 Jonathan Wirsich
[confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_conf_tle();
perm_iters = 5000;
perm_iters_conf = zeros(length(confs), 1);
for atl=1:1
for j = 1:length(groups)
... |
a271a68dd7d9ff0abcb5053857f6e225545dc1e241a4b69c210c2a2a0c666ba8 | MATLAB | 5,325 | 130 | %% Berron et al manual subfields in unfolded space
addpath(genpath([getenv('AUTOTOP_DIR') '/tools']));
APres = 256; PDres = 128;
unfoldedSubfields = nan([APres PDres,35]);
n=0;
for s = 0:34
sub = sprintf('%03d',s);
for LR = 'LR'
if LR=='L'; lr = 'left'; else lr = 'right'; end
AP = load_untouch_n... |
cb3331ab9b8a0d7e87cef7bfa9800a2d28034661b5cc73eb8d46cf7548065d48 | MATLAB | 5,325 | 199 | %
% Split a dataset into source, target and test sets.
%
% Unconnected vertices are removed.
%
% The source, target and test set are output as *×3 matrices,
% where the first two columns represented row and column indexes, and
% the third column the edge weight. The zero test set only has row and
% column indexes. ... |
7e078d36e332ea451a6c98b87a592366de4a7c65bc0e1c0fc9d25a27d7e2f72c | MATLAB | 5,331 | 176 | % mglEyelinkEDFRead.m
%
% usage: mglEyelinkEDFRead(filename,<verbose>)
% by: justin gardner
% date: 04/04/10
% purpose: Function to read EyeLink eye-tracker files into matlab
%
function retval = mglEyelinkEDFRead(filename,verbose)
% default return argument
retval = [];
% check arguments
if ~any(... |
abc1342996879a3a49d80e3d80720157aac231daf779665c1ee9836bcd996b7b | MATLAB | 5,331 | 129 | function [] = moca_plotProbe(probe, experiment)
%PLOTPROBE Summary of this function goes here
% Detailed explanation goes here
optexist = true; % flag to determine if optodes were defined.
if( isfield(probe.module, 'srcposns') == false )
optexist = false;
end
% find only the active modules
%activeModuleIdx ... |
caeb86402aff45b28f909621d8cb0da8c552d5c0482ff085bcff91db23d73812 | MATLAB | 5,332 | 182 | % mglTestBindTexture.m
%
% $Id:$
% usage: mglTestBindTexture()
% by: justin gardner
% date: 02/01/12
% purpose: function to test live textures - this is a fast way
% to update textures - that is, if you have the same image
% dimensions and want to change just the al... |
0190d8094113edaff62f58dc1769f5e7284bebcafcdcbe8fb4848513d86dcb74 | MATLAB | 5,336 | 129 | % VL_DSIFT Dense SIFT
% [FRAMES,DESCRS] = VL_DSIFT(I) extracts a dense set of SIFT
% features from image I. I must be of class SINGLE and grayscale.
% FRAMES is a 2 x NUMKEYPOINTS, each colum storing the center (X,Y)
% of a keypoint frame (all frames have the same scale and
% orientation). DESCRS is a 128 x ... |
3319b072994249089deea519ed631dfa1989f20741e255e7f4cfeaf67bc7af02 | MATLAB | 5,339 | 164 | % PLOT_SINGLEIBI.m
% by M. Chiappalone (26 Maggio 2006)
% modified by Luca Leonardo Bologna 04 June 2007
% - modified in order to handle 64 channels
clr
[FileName,PathName] = uigetfile('*.mat','Select a Burst Detection file');
if strcmp(num2str(FileName),'0')
errordlg('Selection Failed - End of Session', 'Error'... |
e37ffa54f73ab64f5f1634de2ad6a28e0cdbd15fd3b4d515317e2c5bf4c67842 | MATLAB | 5,344 | 184 | function datout = importSpike(filename, chans)
%% Converts Spike File to continuous data structure
%
% Input:
% filename
% (chans) - which channels to import
%
% Output:
% datout - dat object with fields:
% 'data' - column vector of numeric data (row)
% 'chanlabels' - string labels for each channel
% ... |
ef2b46d942890b2b25be8f81920413bf077c54d1fff56df25a9e2467f6fc2e33 | MATLAB | 5,344 | 177 | % mglEyelinkEDFRead.m
%
% usage: mglEyelinkEDFRead(filename,<verbose>)
% by: justin gardner
% date: 04/04/10
% purpose: Function to read EyeLink eye-tracker files into matlab
%
function retval = mglEyelinkEDFRead(filename,verbose)
% default return argument
retval = [];
% check arguments
if ~any(... |
c464301559460a654b39bd1f22dc04c4fa53a10694131b649ca2537d6b0db594 | MATLAB | 5,346 | 225 | clear;
close all;
load('modepPerMouse_by_freq_and_stim');
load('modepPerMouse_Ctrl_by_freq_and_stim');
%%
modepVarNames = who('Modep*')';
lengthModepData = 0; %594
ctrlModepLength = 0; %120
for modep=modepVarNames(1:12)
lengthModepData = lengthModepData + eval(['length(',cell2mat(modep),'.v)']);
end;
for modep=mo... |
2ee0bc816c3ab66f0e08129340a7d5d4dd4909004a0639d0a72018da6816776f | MATLAB | 5,347 | 118 | function convertTrust_BIDS(subj)
maindir = pwd;
% Partner is Friend=3, Stranger=2, Computer=1
% Reciprocate is Yes=1, No=0
% cLeft is the left option
% cRight is the right option
% high/low value option will randomly flip between left/right
%
% subj = subject number
fname = sprintf('summary_misses_task-trust.csv');
f... |
12f7dff84124872c6c133f2fb79135803638b0edfada2fcd841d911526d71342 | MATLAB | 5,350 | 154 | function [Pq,tpath,plq,qstop,allpths,util] = findpaths(CIJ,sources,qmax,savepths)
% FINDPATHS Network paths
%
% [Pq,tpath,plq,qstop,allpths,util] = findpaths(CIJ,sources,qmax,savepths);
%
% Paths are sequences of linked nodes, that never visit a single node
% more than once. This function finds all paths that... |
88a0dc0eb7620ee36c71253ff5d7cc48bd6cab18ddcf81d4f73928c55e13757d | MATLAB | 5,357 | 174 | addpath(genpath('.'))
addpath(genpath(fullfile('..','ANE')))
%%
global gui;
global txtFntSz;
global video;
global masks;
global area;
global r_bg_ratio;
global comx;
global comy;
global list_weight;
global list_weight_trace;
global list_weight_frame;
global list_neighbors;
% global list_mask_update;
% global masks_up... |
dec14cf3a9d4b9e843c6e150675a7ca0636bcde602d059105e5cfc9a448fba86 | MATLAB | 5,358 | 128 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R] = organize_data_for_predictions(dataset)
AVERAGE_OVER_MULITPLE_FIELDS = false;
PLACEFIELD_PERCENTILE_THRESHOLD = 95;
R = [];
MapsData = dataset.MapsData;
BA = dataset.BestAligned;
% get an ... |
bd676a3680dda82b774a8442624488fe0370660efedc6ac583a9de1af2eaffc2 | MATLAB | 5,359 | 128 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R] = organize_data_for_predictions(dataset)
AVERAGE_OVER_MULITPLE_FIELDS = false;
PLACEFIELD_PERCENTILE_THRESHOLD = 95;
R = [];
MapsData = dataset.MapsData;
BA = dataset.BestAligned;
% get an ... |
9a5bbbbb0a6711e6247fe4192f92c5af6a49a3a03b17dd1dca8cb0af522c33f2 | MATLAB | 5,360 | 172 | % mglDispText.m
%
% usage: mglDispText(<whichScreen>,<defaultText>,<centeredText>)
% by: justin gardner
% date: 05/16/06
% purpose: display text to screen (useful for communicating w/subject).
%
% all arguments are optional.
% whichScreen: (screen to open, if [], then defa... |
e25d05798b46570c2063e48a553001e3fecf93a70a7e38a55919ef976324a452 | MATLAB | 5,360 | 196 | function [] = Fig03_Example_TimeCourseRaw_TN1dsx()
% Code for plotting the time courses of delta F/F for TN1 neurons and simultaneously recorded song in Fig. 3b.
GT = 'TN1dsx';
Target_FileID = 2;
Target_ROI = 1;
Target_Trial = 5;
FileID = Target_FileID;
Target_WithinTrialID = 4; % 4-4
TargetMic = 2;
Xrange = [104 11... |
53fbaeddfd6893c45accb262e7aa9cf9439c304331977a377385efe82c853599 | MATLAB | 5,368 | 105 | % analyzes a group of experiments and saves the properties
% they will be saved inside the first folder; not used in paper
%function Experiments = CreateExperimentGroup()
%clear all;
fps = 14;
folders = {};
Experiments = [];
[filename,pathname] = uiputfile('*.mat','Save Experiment Group As');
... |
19135b2a01a343924d934e589f5bcf87a5b17f2c67a28a1e068948f62db69325 | MATLAB | 5,374 | 140 | function [datatyp,limits,datatypes,numbits,GDFTYP] = gdfdatatype(GDFTYP)
% GDFDATATYPE converts number into data type according to the definition of the GDF format [1].
%
% [datatyp,limits,datatypes,numbits,GDFTYP]=gdfdatatype(gdftyp)
%
%
% See also: SOPEN, SREAD, SWRITE, SCLOSE
%
% References:
% [1] A. Schlögl, O. ... |
a26da56cc110e6cc1d622b2af95d88a11a40721ad5bb5b9af843809f78e855ed | MATLAB | 5,378 | 123 | function [] = plot_worm_frame_post_analysis_showing_path(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio,smoothed_path_x,smoothed_path_y,stimulus_delivered,path_history,demo_mode)
% % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, UncertainTips, ... |
56c08c3116fc233172008c5e3cc83b6d4fd6abb88b4e1a0bd9ceeef7b9ce0698 | MATLAB | 5,382 | 77 | function concatenateRecordings( obj, indx_alpha, indx_beta )
% Concatenate two recordings.
%
% Syntax:
% CONCATENATERECORDINGS( obj, indx_alpha, indx_beta );
%
% Input parameters:
% * obj - object containg data
% * indx_alpha - first indx of recording to be concatenated
% * indx_beta - second indx of recordi... |
a05720d42a464adbbf95d27be2945b59bf4cfeaebc8f5004eccfd379336baf3e | MATLAB | 5,382 | 145 |
% A more straightforward algorithm for identifying the starting points of
% each cycle in an oscillating "sawtooth-like" signal in a robust manner.
% Expecially good for integrated bursting signals, such as those recovered
% from respiratory EMG recordings. Best performance when the cycles are
% fairly consist... |
5afb2515188a78ba798b5a89757c6e1e21b6342de2ccb7e62131251501df69d5 | MATLAB | 5,386 | 118 | % writePData.m
%
% Function that takes in metadata structs and preprocessed data structs,
% does some light re-organization, and saves the info into a pData
% directory.
%
% INPUTS:
% pDataDir - full path to pData directory
% settings - settings struct output from ephysSettings() and saved in
% metaDat.mat... |
56ef2862a66133d3f917224370d00bc329fa1381f7cda00530db0f7b211867e3 | MATLAB | 5,390 | 164 | %% for each step, get spike rate; variable time offset
% for each half step
% delays in sec, neg delay is ephys b/f behavior
tDelay = [-0.5 -0.2 -0.1 -0.05 -0.025 0 0.025 0.05 0.1 0.2 0.5];
% preallocate for spike rate matrix for (number of steps x 2 (for 2 half
% steps) x num delays
stepSpikeRate = zeros(size(legS... |
6065abab34383413face6be08a576843d7667398f235b47efaa226a052017bf5 | MATLAB | 5,390 | 254 | %%
clear all
close all
%% Create mean vectors (Symbols)
M = 7; % #symbols
N = 100; % dimension
S = randn(N,M);
alp = ('A':'Z')';
%voc = alp(1:M);
voc = alp(M:-1:1);
SAVE_FIGURES = false;
%normalize vectors
for k=1:M
S(:,k) = S(:,k)/norm(S(:,k));
end
%% Orthogonalizing
[ST,~] = mgson(S);
%% Adding Noise on coup... |
0c7b358eaab096faf5717e787aa68b6117e553b206f58e991bec8f2a85a1a287 | MATLAB | 5,394 | 157 | function videoTest(radiiPupil, varargin)
p = inputParser;
addOptional(p,'ROIpad',[60 40]) % width x height
addOptional(p,'RadiiCR1',[10 16])
addOptional(p,'RadiiCR2',[10 16])
addOptional(p,'MinFeatures',.7)
addParamValue(p,'Manual',0)
addParamValue(p,'ImAdjust',0)
addParamValue(p,'Frame',1) % Frame of image to use
add... |
05b19d3cb5c77b69b353b48753a17f7b0262e2b7974016fc9692e58a21c6e2c2 | MATLAB | 5,396 | 192 |
function extra_data_info=my_net_forward(net_info, work_info_batch, data_info, net_run_config, extra_output_layer_idxes)
gpu_mode=net_run_config.use_gpu;
if gpu_mode
if ~net_info.ref.net_on_gpu
my_move_net(net_info, 'gpu') ;
end
data_info.ref.output_info_laye... |
664f6b5a231391c677d8e597cc8cfe808a61063e7d8570b9b5b09121c0bfe5de | MATLAB | 5,398 | 145 | % data_ind = 1; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th5');
% data_ind = 2; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4');
% data_ind = 3; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4');
% data_ind = 4; dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF50','4816[1]th4');
addpath(genpath(... |
8e706ca16a12eddebd8e6d214377a47a54d1e5bfae90107eaa3552325df20da9 | MATLAB | 5,398 | 121 | classdef PlaneSegmentation < types.hdmf_common.DynamicTable & types.untyped.GroupClass
% PLANESEGMENTATION Results from image segmentation of a specific imaging plane.
% OPTIONAL PROPERTIES
properties
image_mask; % (VectorData) ROI masks for each ROI. Each image mask is the size of the original imaging plane (or... |
505e47b96f2b3392043ea9d0546817a36fdefe37e752d4b8de4637c386e987df | MATLAB | 5,399 | 163 | % plotOptomotorOptoFicTracChangePos_allFlies.m
%
% Function that takes outputs from extractOptomotorFicTracOptoCond_fly()
% and plots the change in FicTrac position parameters. Specifically, for
% each fly, plots the average across trials of the difference in
% cumulative position/angle between a start time point ... |
9c92a13d22a658c12ecaee11df785ead0249773dc284941716b52b2404518d64 | MATLAB | 5,399 | 149 | function [total_fraction,Delta_distances,All_dist_dir,All_dist_dur,Delta_dist_all_same]=Test_distance_between_trajectories(score,idx_dir,idx_duration,ndim,do_plot,ColourArea,nsamples_condition,Hdist_same)
%% Test_distance_between_trajectories calculates the Hausdorff distance between
%% trajectories of different dura... |
d852c3b57ac23403e33a53b27a59469795a8f00321c6f18bf8617ae65eb4caea | MATLAB | 5,399 | 130 | %% para
%% run after matlab 2018 version
file_name_all = {'Edge_GLM_gene_str_dis_commu_gene_PLS_DBM.mat',...
'Edge_GLM_gene_str_dis_commu_gene_PLS_VBM.mat'};
for ifile = 1:length(file_name_all)
file_name = file_name_all{ifile};
load(file_name)
z_thr = -icdf('normal',0.05,0,1);
GO_size_min = 0;
... |
03aea4e2fec491b092f8b7d9f0cd2db3a486a818b07572bbc0c5422e73115942 | MATLAB | 5,402 | 180 | %% Code Outline
% This code produces the results for behavioural analyses
% - statistical comparisons of early vs. late for each condition
% - compares final performance across conditions
% - compares learning and initial performance
% - code for FIGURE 2B/C
%% Statistical Compar... |
bdb081ab0f3f8d1b554bdffe5ea2acd4df26e4cbc4bc6708e147a3bb37556b5a | MATLAB | 5,403 | 198 | function [] = ExtDataFig05_Example_TimeCourseRaw_TN1dsx()
% Code for plotting the time courses of delta F/F for TN1 neurons and simultaneously recorded song in Extended Data Fig. 5f.
GT = 'TN1dsx';
Target_FileID = 5;
Target_ROI = 1;
Target_Trial = 3;
FileID = Target_FileID;
Target_WithinTrialID = 4; % 4-4
TargetMic =... |
aefaecab527a5787fd5115659e5f135be71bf7904336d101ed13a87f3e00f58c | MATLAB | 5,404 | 154 | % updated 2024/3/23, script for calculating statistics of peak intensity, interpeak interval (Jerry paper)
[duration,cellnum] = size(channel1);
%% reset all as empty to start
p2p_bycell=[];
p2p_all_as_cell=[];
p2p_all_as_matrix=[];
peakI_bycell=[];
peakI_as_cell=[];
peakI_as_matrix=[];
%% analyze every single cell ... |
26d5ce810580ff86acdfd192073ca3e9acfd4557c727990e4a3684dd910ce6a4 | MATLAB | 5,407 | 120 | function mlgp_compute_bfo_percell_90(obj, session)
%fprintf('\tComputing bfo 90 for session %s\n', session.getName());
sessionName = session.getName();
placemapDatabaseFilename = fullfile(session.getAnalysisDirectory(), sprintf('%s_placemaps_shrunk.mat', session.getName()));
if ~isfile(placema... |
10d90ecb8a1f8023920551c53df2221ad3cd49e42ef62e01ee2310ce5b6a8603 | MATLAB | 5,410 | 172 | function [EventCodes, segHdr, eventData] = read_sbin_events(filename)
% READ_SBIN_EVENTS reads the events information from an EGI segmented simple binary format file
%
% Use as
% [EventCodes, segHdr, eventData] = read_sbin_events(filename)
% with
% EventCodes - if NEvent (from header_array) != 0, then array o... |
7b304506047e7fadce3b861eb2cc51203fa06aabac29f6ff0a8dcf06cd0913d3 | MATLAB | 5,410 | 170 | % function [h, f, ylimits_]=plot_signals(signals, x, plot_color,...
% error_type, x_label, y_label, ...
% do_transparency, nperms, do_labels,...
% do_normalize_to_max,maxval_for_normalization)
%
% p... |
cc733c9fe976f458543aab06cf1153baa1def30aad65a8da03786af0074382f5 | MATLAB | 5,410 | 98 |
%%%calculates changes in firing rate in cortex before and at end of media
%%%injection - each animal is an individual experiment.
%%%% EXPERIMENTAL DETAILS FOR EACH ANIMAL %%%%
static_vars.AnimID={'ANIM_ID1','ANIM_ID2','ANIM_ID3','ANIM_ID4','ANIM_ID5','ANIM_ID6','ANIM_ID7','ANIM_ID8','ANIM_ID9','ANIM_ID10','ANI... |
31b1a502882abf216ed9117cd6d0610b9333cadfc17f1867838128714e8cb4f1 | MATLAB | 5,412 | 136 | function show = toShow(Sesname,elec,unit,saveStat)
if nargin < 4, saveStat=0; end;
globals;
show=1;
if strcmp(DATA_TYPE,'EM'), % structures not ready yet
switch SHOW_UNITS,
case 'all',
otherwise,
% ShowUnits = unitn2i(ShowUnitNames); % rename ShowUnits from real elec ... |
6a6631a36563e96ea01970beccaac6a2b399c37eaaca28c33c45131c571c36dd | MATLAB | 5,414 | 127 | function strength_of_whisker_touches(fig3)
%% strength_of_whisker_touches plots
% 1. Delta kappa per touch number divided into hit and miss trials
% 2. Delta kappa per session divided into first/ later and hit/miss trials
% this function also does ANOVA (balanced and unbalanced) for delta kappa for first/ later and
... |
570ce6e74253427478348205dc8ea24a30d44d1d90b3dc0ee96189d6f289c8a1 | MATLAB | 5,423 | 190 | function [] = Fig01_Example_TimeCourse_dPR1TN1ANP()
GT = 'dPR1NP'; % Fig. 1h
% GT = 'TN1SGNP'; % Fig. 1k
switch GT
case 'dPR1NP'
Target_FileID = 10;
Target_ROI = 1;
Target_Trial = 3;
Target_WithinTrialID = 6;
TargetMic = 1;
case 'TN1SGNP'
Target_FileID = 10; % [... |
e59643b11039c09fe67c73775efa11bc079b5893053c8f5d822ce6dd88946213 | MATLAB | 5,423 | 128 | % function [RegressionSummary] = multivariateregression(Y,X)
%Multivariate multiple regression on DVar Y along dimensions d and IVar X along dimensions p.
%Y is the dependent variable, each row subject, each column is condition. Xmat is matrix containing IV, should be all n x p, where n is subject
%and every column p ... |
ce2d332c036fbbc6c8c585add682625f7de750f79db02ee8f51cbeb8bfe40256 | MATLAB | 5,429 | 102 | function mltp_compute_singleunit_placemap_data_shrunk(obj, session)
% This shrinks from a rectangle to a square in so that the 90 degree
% rotations can be performed for the pixel-to-pixel correlations.
if ~strcmpi(obj.Experiment.getArenaGeometry().shape, 'rectangle')
fprintf('No need to shrink sinc... |
b8cff28f913ddba3aa846df6c2e38fffc565a516e92f9efab044b942b25872ab | MATLAB | 5,433 | 149 | % evenMultiStepOpto.m
%
% Optogenetic Stimulation Function. Opens up shutter in front of mercury
% lamp for n durations spaced linearly betweeen min and max as specified
% by the user.
% Has option to randomize durations or not. User specified step
% duration and time between steps.
% Returns vector of to feed ... |
d5b663f46673c8c77cd3684613bc370e5dd2de5009b6457bf7e0ad783fa2cce7 | MATLAB | 5,433 | 193 | function [] = Fig06_AveTimeCourseSongTrans_pMP2()
% Code for plotting calcium signals and song probabilities during song type transitions in Fig. 6g.
Target = 'pMP2_NR';
selpath = ['../Data/Summary_pMP2/'];
load([selpath,'Transitions'])
%%
switch Target
case 'pMP2_NR'
Ylim_1 = [-.1 .6];
Yhori_1 =... |
4cc392ed0b6685ef2a5991a8183de5ce43a252aa3d7bc855bfe18ebb6741781d | MATLAB | 5,442 | 132 | function object_task_correlations_for_5sessions(pipe)
% This can be made dynamic and the code will still work as long as it is >= 2.
% Isabel said there are 5, so I'm leaving it at 5 for now.
numSessions = 5;
if pipe.Experiment.getNumSessions() ~= numSessions
error('The object task consecu... |
dfe2924347a590335f80fd5b1f31d9fbe715849f3455121ce61ee29a2428facc | MATLAB | 5,442 | 123 | function setupEyelink_Bore( edfName, win )
% setupEyelink_Toon setups eyelink system for eye tracking with the
% projector.
%
% setupEyelink_Projector( edfName )
% edfName - (string) what you would like to call your edf (should be
% no more than 8 characters)
% win - PsychToolBox... |
8b46318a13c943af8a950b2876ff1e10dcd69c67c2409eec25a2a7791b7dd99d | MATLAB | 5,443 | 189 | function [] = Fig02_Example_TimeCourseRaw_dPR1TN1A()
% Code for plotting the time courses of delta F/F for a dPR1 (Fig. 2c) and a TN1A (Fig. 2f) neuron.
GT = 'dPR1'; % Fig. 2c
% GT = 'TN1SG'; % Fig. 2f
switch GT
case 'dPR1'
Target_FileID = 6; % 6 (4, 6)
Target_ROI = 1;
Target_Trial = 2;
... |
1617e95627fca22f7d17483ceeb830668f5b543373ce1aa9ce579cb5d476c7e6 | MATLAB | 5,444 | 171 | % CameraInit Camera calibration using the robot.
% Camera calibration should be performed when you use cameras for the
% first time so that proper mapping between the absolute coordinate and
% one in the camera frame.
%% Device and Camera setup
% Execute this section to establish the connection to the device,
% create... |
addbe56ac991b2b6bf0ba438a4aafe8f6940f0b80a442a277562085596e7c62f | MATLAB | 5,444 | 129 | %%% demo of the full MIN1PIPE %%%
clear
warning off
gcp;
min1pipe_init;
addpath(genpath('../ANE'))
%% Set data and folder
list_data_names={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'};
list_ID_part = {'_part11', '_part12', '_part21', '_part22'};
list_patch_dims = [120,120; 80,80; 88,88; ... |
0616bef65f6cd2ee39048da46a3ab89a785797de135a2a2cd722a94212571cd8 | MATLAB | 5,450 | 147 | %% contextPrediction_SVM
% The one that's used in the figure. Context Prediction using Geo axis
% trials (digs are Correct or Geo).
data_path = '/Users/celia/Documents/two_context_data'; % change this
load(fullfile(data_path, 'ratemaps-2021_12_1_12_34_49_K1_d4.mat'));
minTrial = 4;
fid = fopen('Fig7Edata.csv', 'w');
... |
d8c99e0a4b1577ed3cd5544b2d88bdfe769cec4a458ffd22b53a69cb748e3cd6 | MATLAB | 5,454 | 130 | function [probe] = createLayout(probe, denseoption)
%CREATELAYOUT Create a probe composed of modules over a ROI
% Create layout is a MOCA function used to facilitate the tessellation of
% a module design over a ROI. Tessellation is done as a "grid" over the
% ROI that covers the max width and max height of the R... |
63c889db437717ae291d3c7230557ffddd9565918196686531938bf959cc52cb | MATLAB | 5,458 | 136 | % findBoutStepInds.m
%
% Helper function for saveLegStepParamCond_bouts() that takes in bout peak,
% start, and end indices (output of findCondYawVelPeaks() helper function)
% as well as step index info, and returns aligned steps, as indices into
% legStep matrices.
% Also, returns whether bout peak is during stance... |
dd24af570d2ac015443a1ac1ff0ce46bec3b38d64a33d623c0c433a687ae1df4 | MATLAB | 5,460 | 152 | function vl_demo_alldist
%
numRepetitions = 3 ;
numDimensions = 1000 ;
numSamplesRange = [300] ;
settingsRange = {{'alldist2', 'double', 'l2', }, ...
{'alldist', 'double', 'l2', 'nosimd'}, ...
{'alldist', 'double', 'l2' }, ...
{'alldist2', 's... |
1749e13408a12638fe2cb838935f52376d7488a271298c4ae1f95556c471d617 | MATLAB | 5,467 | 110 | function [hdr] = read_nifti2_hdr(filename)
% READ_NIFTI2_HDR
%
% Use as
% [hdr] = read_nifti2_hdr(filename)
% where
% filename = string
%
% This implements the format as described at
% http://www.nitrc.org/forum/forum.php?thread_id=2148&forum_id=1941
%
% Please note that it is different from the suggested f... |
c4569d1ef18fbeee2a00d8a8b7bc8829bf718086be0f49f1b3c4f45d0c452304 | MATLAB | 5,468 | 173 | function [motionData] = ml_motion_load_calcium_session( recordingsSessionFolder )
% Make the record. This should be done better, but no time.
recordingOpened.hour = 1;
recordingOpened.minute = 1;
recordingOpened.second = 1;
recordingOpened.year = 1979;
recordingOpened.month = 4;
recordingOp... |
bc7e6f57f17df68a2ab08185a3495b84f8b56c735461339b51ddf40efc79c6e5 | MATLAB | 5,471 | 131 | % assign file paramters
function savename=TDTformatBDH(channel)
if channel==1;
eventList=['472_';'405_';'Cam1'];%'Fi1r'];
%eventList=['472N';'405N';'Cam1'];
elseif channel==2
eventList=['B72B';'B05B';'Cam1'];
end
%eventList=['472_';'405_';'Cam1';'Tick'];%'Cam1'
%even... |
a5aecdca6ed43a7108cafc0d514d638461192c3d456fde23afa57ecbb93c8135 | MATLAB | 5,477 | 213 | #!/bin/bash
#SBATCH --time=72:00:00
#SBATCH --job-name=NULL_D2_MCS
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem=3G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-101
#SBATCH --output=outputs/MCS_Null_D2_A%A_%a.out
#SBATCH --error=outputs/MCS_Null_D2_A%A_%a.err
#Load Matlab 2017a module
ml MATLAB
matlab -no... |
e135fbe835a4496adbdeb5bdc222d569f78ed5b66eff5789011854cd26469047 | MATLAB | 5,481 | 85 | function [] = individual_worm_videos(Tracks, folder_name, parameters, behavior_colors)
plotting_fps = min(parameters.IndividualVideoPlottingFrameRate,parameters.SampleRate);
% ImageSize = 2*round(parameters.TrackingWormBoxHalfSize * parameters.CameraPixeltommConversion);
% image_size = [ImageSize, ImageSize... |
a38eb7803df68b8424d0a07f50e5107bc4bdcb3216810303144d63fc4bb47630 | MATLAB | 5,482 | 187 | %fig11_unit_population.m
% this will both recreate figure 6
% and run some descriptive and
% inferential stats
% (see descriptions towards the end of the file)
%%
clear all;
close all;
clc;
warning('on','all')
%% addpath if not added yet
% assumes script run within local directory
scriptdirs = {pwd;
'..\..\plot';
... |
8153043bcd9e5d164c43e260fc838181e226fedaee09261870d9ab9a31c24fa8 | MATLAB | 5,485 | 242 | function jdx = aedes_readjcamp(filename)
% AEDES_READJCAMP - Read JCAMP DX format files (Bruker parameter files)
%
%
% Synopsis:
% jdx=aedes_readjcamp(filename)
%
% Description:
% The function reads the JCAMP DX files and returns a
% structure with parameters as structure fields. The input
% ... |
aa29bb5d732c0b971bbc509897a7ef55bd9f3ecd769c2dd1216eda80544b1b49 | MATLAB | 5,485 | 128 |
% Read requested frame from the video.
%
% [im,id] = video_read_frame(vinfo, id)
%
% returns im, the frame of the video specified by id (0-indexed), and the
% true frame id of the im returned (for videos with missing frames this is
% the nearest neighbor to the requested id). All returned images are
% converted ... |
40d57024776820424bf0a1a22629a8c077ef9bbb2654fe60efa078a65f9799aa | MATLAB | 5,496 | 125 | function object_task_correlations_for_4hab_1test(pipe)
% Get the t-files that are present for both day 1 and day 2
if pipe.Experiment.getNumSessions() ~= 2
error('The object task consecutive trials experiments requires exactly two sessions (hab and test) of data.');
end
% Find the tfiles th... |
6047d04dc6c5064a82a04db42cb18866a402fabc1e2c2342739e29cbe394031d | MATLAB | 5,497 | 213 | #!/bin/bash
#SBATCH --time=72:00:00
#SBATCH --job-name=NULL_5HT2A_MCS
#SBATCH --mail-type=END
#SBATCH --mail-user=
#SBATCH --mem=3G
#SBATCH --cpus-per-task=2
#SBATCH --array=1-101
#SBATCH --output=outputs/MCS_Null_5HT2A_A%A_%a.out
#SBATCH --error=outputs/MCS_Null_5HT2A_A%A_%a.err
#Load Matlab 2017a module
ml MATLAB
m... |
b72e7d414775640fe2dd0862794f9418c33e38ab8b8fc2f2c9fab74dc78baa50 | MATLAB | 5,497 | 116 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [R, success] = compute_stability_bfo90_table(PerCell, BestAligned, BESTALIGNED_STABILITY_THRESHOLD_CRITERIA, BFO90_FILTER_MIN_MAPS, BFO90_FILTER_MIN_TRIAL_CORRELATION)
BFO90_ROTATIONS_TO_CHECK = [0, 90, 180, 270];
... |
caa95d0427519041d05cd796ac2d234baeab89b76d743e42ab360e1b561df045 | MATLAB | 5,497 | 160 | %abc
%plot signals
%plot xcorr with LFP (mean over all elecs)
%plot STA for units, only those whose Mdep has p<0.05 by bootstrap
%
% to add:
% check consistency between all movies of that session
% i. elecunit (all spikes from each elec)
% ii. bundleunit (all spikes from all elec)
%% ******* to do **********... |
8e8ddbce62ae4a4470df4396ee2d8d2b3574406a5d8218cf9a0e0838f786411e | MATLAB | 5,498 | 149 | % Function File: simPSCs
% ---------------------------------------------------------------------
% Simulation for data
%
% 25 Hz sampling rate
%
% ---------------------------------------------------------------------
% This function is for generating events that have had noise added to it to
% simulate realistic trac... |
a7ff585c2e249847931cf0016e6d4c481c7be49f16e7fa23b3777676c4aa17f7 | MATLAB | 5,498 | 200 | function [] = Fig08_Plot_InputOutputHist_Single_TN1A1()
% Code for plotting the histogram in Fig. 8e.
%% parameters
pIP10 = [13417,13038]; % pIP10 (L, R)
pMP2 = [11977,11987];
dPR1 = [10267,10300]; % dPR1
TN1A1 = [15521,16465,15148,12883,16207,...
16113,14581,14810,15387,17640];
TN1A2 = [13945,14401,13928,16391,16... |
22ade1480ce238d30b91163c1395082e3aea8e6ffa967a962a8d56add0efe4dc | MATLAB | 5,499 | 149 | % Function File: simPSCs
% ---------------------------------------------------------------------
% Simulation for data
%
% 25 Hz sampling rate
%
% ---------------------------------------------------------------------
% This function is for generating events that have had noise added to it to
% simulate realistic trac... |
b9fce944d02bd64c06ad33fe4c026b663b863202a18e1a70ab8ccf76bc75b108 | MATLAB | 5,506 | 163 | function [data_timelock_BL] = timelock(trials, ID, vis, type, condition, baselinecorr)
%% TIMELOCK
% Computes the timelock average for the given participant and the given
% condition. It baseline corrects the data if asked for.
%
% INPUT:
% - trials: the epoched fNIRS data of the given participant
% - ID: participant... |
dc3ef3bacf04cf91ca79a9d783d33161cef4cc03ee76ca057db3058b3d1d5e27 | MATLAB | 5,507 | 162 | function [err,Indx] = AFNI_XYZcontinuous2Index (XYZmm, Info, CoordCode, IndexDim, retNaNoutside)
%
% [err,Indx] = AFNI_XYZcontinuous2Index (XYZmm, Info, [CoordCode], [IndexDim], [retNaNoutside)
%
%Purpose:
% Change from voxel XYZ in mm to XYZindex (called Voxel Coords in AFNI)
% The mm and voxel coordinates refe... |
f78fc7cf8f3c3906f00fd2082182dd6c3e7643a959429c7158bc0c8fbe64afaa | MATLAB | 5,510 | 167 | % Computes the empirical cumulative distribution function (ECDF), accounting for
% the presence of ties. Useful for bootstrap statistics, which often contain ties.
%
% -- Function File: [x, F] = bootcdf (y)
% -- Function File: [x, F] = bootcdf (y, trim)
% -- Function File: [x, F] = bootcdf (y, trim, m)
% -- Function Fi... |
8cbce8d37661115ee351e44f92ce46fb843145137ed24818ae5f7fac4a88f5ce | MATLAB | 5,511 | 200 | %% ANOVA tests for IInj
datDir = '/Users/hyang/Dropbox (HMS)/EphysAnalysis-Helen/AnalyzedData';
whichParam = 'stepXLengths';
whichPhase = 'stance';
durs = 1;
amps = [-75 100];
yScale = [-0.06 0.06];
plotAvg = 'mean';
plotIndiv = true;
plotDiff = true;
% legInds = 4:6;
% legInds = 1:3;
legInds = 1:6;
allFliesMeans = ... |
c6515ec3d27478579d5f07ce976feab56ec399b1ed42e43abc88f87508a411c0 | MATLAB | 5,511 | 197 | function [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist)
% [vol, M, dcminfo, mr_parms] = load_dicom_fl(flist)
%
% Loads a volume from the dicom files in flist.
%
% The volume dimensions are arranged such that the
% readout dimension is first, followed by the phase-encode,
% followed by the slices (this is not implem... |
39c1259849c7be79785c19731c3696a2c99d38bfe94a285e11415d13bcf2af4b | MATLAB | 5,519 | 132 | %% Script to calculate the Sum of Squared Diferences between diagnoses and groups (relatives, PE, FEP and chronic)
% Copyright (C) 2023 University of Seville
% Written by Natalia García San Martín (ngarcia1@us.es)
% This file is part of Neurobiology Centiles Psychosis toolkit.
%
% Neurobiology Centiles Mappi... |
89711ca0be7a3d2b064b52573ac7c1db488be07df25079864e015b375c7bb9f5 | MATLAB | 5,520 | 119 | % Yokogawa MEG Reader toolbox for MATLAB
% Version 1.04.01 01-Nov-2011
%
% Files
% getYkgwData - Get measured data
% getYkgwHdrSystem - Get header of the system information
% getYkgwHdrChannel - Get header of the system information
% getYkgwHdrAcqCond - Get header of the system information
% getYkg... |
9f3291412dbd9d19301093d165d67dfbd28118034b0b504f3bf84828c974d0e6 | MATLAB | 5,520 | 172 | function V = spm_vol(P)
% Get header information etc for images.
% FORMAT V = spm_vol(P)
% P - a matrix of filenames.
% V - a vector of structures containing image volume information.
% The elements of the structures are:
% V.fname - the filename of the image.
% V.dim - the x, y and z dimensions of the vo... |
f2c54df7b8b335a98c40c5e770dff6c1ca0dbf3ca9600eb3a1bdc0d380444b78 | MATLAB | 5,522 | 151 | % extractTrialsOpto.m
%
% Helper function for computeLegFictracOpto_1Fly() that takes in one
% trial's worth of data for one behavior parameter and divides it into
% reps based on the opto stimulation
% Output appends trials into cell array given as input
% Has option to align position data by subtracting value at s... |
086346a4d98467ff8eff67f83f781df63d05b3a74f769b80fc5300aa16f23596 | MATLAB | 5,524 | 139 | % preprocess.m
%
% First function to run on imaging/FicTrac/leg tracking data.
%
% On imaging data:
% Reads in ScanImage .tif files. Aligns each time series. Saves the aligned
% series, unaligned series, mean image, and metadata output by ScanImage.
%
% On FicTrac data:
% Converts raw voltage traces collected on exp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.