sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c53f30d2a426070ff3cc22f529e39c1f8c400674103b9d8ed1d18574a3f1adf9 | MATLAB | 7,422 | 200 | function [mri, seg, hdr] = read_asa_mri(fn);
% READ_ASA_MRI reads an ASA format MRI file
%
% Use as
% [mri, seg, hdr] = read_asa_mri(filename)
%
% The raw image data is returned, together with the position of the
% external head markers in raw image coordinates.
%
% In the ASA default PAN (pre-auricular/nasion) coor... |
7d122d351b2414e42e25732905bdba52987ba82d7adf07562d13702922cdb722 | MATLAB | 7,425 | 193 | function [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% READ_SBIN_HEADER reads the header information from an EGI segmented simple binary format file
%
% Use as
% [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% with
% header_array - differs b... |
927c8523b35f841bb609509a60096852e1472a89edf72c6fcd211b0d22d4708a | MATLAB | 7,436 | 217 | %
% Comparison plot of all link prediction methods.
%
% Important: the (a) and (b) plots are not fair since they take, for
% each network, a separate best submethod for each method, meaning
% that a method with many submethods will seem to perform better than
% a method with few submethods.
%
% PARAMETERS
% $NETWOR... |
72d1ff38b5572db1e4f6e3b9a543786cc524ef02108e582cce2fd1e354038a35 | MATLAB | 7,444 | 236 | %run_subsample_and_ROC_residuals_global_local_shuf.m
% assumes run_simulations_stdFR_stdRP.m has been run first
% note ROC stage all pairs comprised of 2 of 3 methods:
% global shuffling, local shuffling, residuals
% the ROC cropping (to account for variable FA ranges) accounts for
% all three of these at once, althou... |
465c4ebb1af82329790b90aa24b42404660d40f3eb85f0bc2cee5ecbe75ac868 | MATLAB | 7,448 | 271 |
function my_epoch_run_config(opts, imdb, work_info, net_config, work_info_epoch)
do_config_basic(opts, imdb, work_info, net_config, work_info_epoch);
run_trn=work_info.ref.run_trn;
if run_trn
do_config_train(opts, imdb, work_info, net_config, work_info_epoch);
end
run_eva=work_info.ref.run_eva;
if run... |
3f65a84341348702b445961fa4a6113432a9fd56e3c9958313732f056e7f94a0 | MATLAB | 7,451 | 221 | % loadBigRigFlyData.m
%
% Script to load big-rig data from Luke and output fly trajectories and
% velocities
% Adapted from main-for-helen jupyter notebook from Luke
%
% CREATED: 6/11/19
% UPDATED: 6/24/19
%% define constants
TIME_RES = 0.01; % sampling time to interpolate fly behavior to
% smoothing of fly behavior... |
aef01ee8057939686f6bd223c14293c13c47de65df3d56e07c51c0b612787450 | MATLAB | 7,462 | 128 | function fH = plotLMMregressionSlopes_v_pRFtau_stRetParams(allLMMResults,...
params, modelToPlot, roisToPlot, cmapROIs, saveFigs, saveFigDir)
ipsIdx = cellfind(regexp(string(roisToPlot),'IPS0/IPS1','once'));
roisNoIPS = setdiff([1:length(roisToPlot)],ipsIdx);
fH = figure; set(gcf,'Position',[329 450 768 ... |
f3927acc5f3337dd34dde7a01c17ae850d33430d53b9d47f57a762a641aaf760 | MATLAB | 7,470 | 202 | % preprocessBigRigFlyData.m
%
% Script to load big-rig data from Luke and Ashley and output processed
% data files (one for each fly)
% Also, calls ffmpeg to adjust levels in video files, convert to mp4,
% rename to include trial name, and put all videos in one folder
% Processed data contains:
%
% Adapted from main... |
dc0613e2501ee5130b1c3579c4907ab7390f921802e2efb7fdacecc23081f303 | MATLAB | 7,473 | 251 | % createEphysLegtrackFictracMovie.m
%
% Quick and dirty script to generate movie showing ephys recording, FicTrac
% variables, and leg movie. Starts from raw data.
% Made 9/20/21, used for video for U19 year 4 review talk
% full path to data folder
pDataFilePath = ['/Users/hyang/Dropbox (HMS)/EphysAnalysis-Helen/... |
39e655049b8e2d151eebb7e72931e3ef7dafd2ac641e19240b98a644c637c857 | MATLAB | 7,476 | 174 | function varargout = SelectExperimentByTag(varargin)
% SELECTEXPERIMENTBYTAG MATLAB code for SelectExperimentByTag.fig
% SELECTEXPERIMENTBYTAG, by itself, creates a new SELECTEXPERIMENTBYTAG or raises the existing
% singleton*.
%
% H = SELECTEXPERIMENTBYTAG returns the handle to a new... |
fac67ab085e2de94a0eb78dc58cd6027196c8a08fb01096e36d68f5f7cbad2d7 | MATLAB | 7,482 | 209 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
% This part makes the "*_rm.mat" files needed by the other scripts which takes FOREVER.
close all
clear all
clc
% Paths
run('../load_figure_config.m')
INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER;
calciumAnalysisResult... |
ce2754f25a5704650c65ab191f0f0068773bcbd8957e2d9c4878e54ecd2b405d | MATLAB | 7,495 | 147 | %% Script to run in parallel multiple PCA-CCA of psychosis-related groups
%% classified according to their clinical profile
% 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 Cen... |
ac3f70b8f5a8f15d8a27969576461b251f740be79bb257563ae1648f5d8bd095 | MATLAB | 7,499 | 180 | function mlgp_create_mcmappy_shrunk_database(obj, session)
fprintf('Creating mcmappy database (shrunk) for session %s\n', session.getName());
numTrials = session.getNumTrials();
numCells = [];
maps = [];
trialIds = [];
contextIds = [];
cellIds = [];
traceMaximums = [];
tra... |
f62afd8025a2e57b1fb24b222f184018712e754b638ee3958c4f39d1388736e8 | MATLAB | 7,499 | 180 | function mlgp_create_mcmappy_database(obj, session)
fprintf('Creating mcmappy database (normal) for session %s\n', session.getName());
numTrials = session.getNumTrials();
numCells = [];
maps = [];
trialIds = [];
contextIds = [];
cellIds = [];
traceMaximums = [];
traceMaps ... |
6af7e145416f75569748c3f82b9e0f5fc51f03416dac2e3abf0f26eb4940cf59 | MATLAB | 7,504 | 243 | % plotEphysBehXCorr.m
%
% Function to plot cross-correlation of ephys parameter (output of
% getXCorrEphysContParam_cell()). Plots the cross-correlation itself as
% well as the peak time, across conditions. Plots one line/pt per cell and
% mean +/- SEM across cells
% Select output files through GUI
%
% INPUTS:
% ... |
cb1dcdbc3eeb0a09bee214b64e8e5b74355b7a54f3f764a768c2bc0265175fa9 | MATLAB | 7,505 | 192 | % plotLegFictracIndivOptoTrials.m
%
% Function to plot leg and FicTrac data for individual opto stimulation
% trials for a single fly. Each column is an opto stim trial, each row is
% a different parameter.
% User specifies which leg and FicTrac parameters, by name of fields in
% legTrackOpto and fictracOpto structs... |
84657108643ed5c8a605e319af49a08cfa9d0ac98f738bd04c209f0df9124930 | MATLAB | 7,507 | 223 | function [A, C, iduse, datasmthf, cutofff, pkcutofff] = refine_roi(m, C, f, Aold, iduse, noise, datasmthf, cutofff, pkcutofff, ispara)
% [A, b, C, iduse] = refine_roi refine roi by basis pursuit denoising
% modified from E Pnevmatikakis
% Jinghao Lu 06/10/2016
hroi = tic;
%% initialization %%
%%% ... |
a0c5dfa38a972e37cc3b4a9990922b6e417641051dbf2b915fbd7f6ee9075924 | MATLAB | 7,509 | 209 | function [bandwidth,density,X,Y]=kde2d(data,n,MIN_XY,MAX_XY)
% fast and accurate state-of-the-art
% bivariate kernel density estimator
% with diagonal bandwidth matrix.
% The kernel is assumed to be Gaussian.
% The two bandwidth parameters are
% chosen optimally without ever
% using/assuming a parametric model for the ... |
62a8656783735bdb48d8a00a89b410749f6cee28a8804f263daf43a2f91ca260 | MATLAB | 7,513 | 205 | function plotFiltDataStream_multi( obj, filter_indx, varargin )
% Plot filtered LFP online streaming recordings: plot two filters
%
% Syntax:
% PLOTFILTDATASTREAM_MULTI( obj, filter_indx, varargin );
%
% Input parameters:
% * obj - object containg data
% * filter_indx
% * ax (optional) - axis where you want ... |
3b2f5d71d2aed52d79b2f55250fc3ae64bf6b36ddf2fd6af44c2132a33ebec3a | MATLAB | 7,515 | 189 | % This script accurately computes and displays electric fields sampled on
% a cross-section (transverse plane) via the FMM method with accurate neighbor integration
%
% Copyright SNM/WAW 2017-2020
%% Load/prepare data
planeABCD = [0 0 1 Z]; % Equation of the plane of the cross-section (Ax + By + Cz... |
4a08854220e48413a6221e9fa5aa8a841cd75df8946a88f176acc2714b8053ad | MATLAB | 7,523 | 215 | %% fig.4 - Analysis of Grating Responses with LED Manipulation
% Run config.m
for kk= 1:nanimals
for jj = 1:2 %1: LED off, 2:LED on,
psth.mean{kk}(jj,:,:,:) = squeeze(mean(cell_activity_allday{kk}(:,:,stim_type_allday{kk}(:,jj),:),3));
end
%stim_type 1 (LED off) and 2 (LED on)
response... |
32bdcddf91dd9323660c6170a8cabd1034c58d04fe48dabddabe421f67e3eabf | MATLAB | 7,524 | 199 | function fcstr = fillConstructor(name, parentname, defaults, props, namespace)
caps = upper(name);
fcnbody = ['% ' caps ' Constructor for ' name];
txt = fillBody(parentname, defaults, props, namespace);
if ~isempty(txt)
fcnbody = [fcnbody newline txt];
end
fcnbody = strjoin({fcnbody,..... |
8be2972cc641d44dbc10cd8fdcffe582677ec44510b30cfa5497ba00d7cad1c9 | MATLAB | 7,528 | 250 | function Res = aedes_roi_stats(DATA,ROI)
% AEDES_ROI_STATS - Calculate ROI statistics
%
%
% Synopsis:
%
% Description:
%
% Examples:
%
% See also:
%
% This function is a part of Aedes - A graphical tool for analyzing
% medical images
%
% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi>
%
% Dep... |
eef2c2ef07f5fba6f57a91e597ad0cae99124d6a211110f8485104e99cd7af23 | MATLAB | 7,528 | 191 | % plotLegFictracIndivIinjTrials.m
%
% Function to plot leg and FicTrac data for individual current injection
% trials for a single fly. Each column is an Iinj stim trial, each row is
% a different parameter.
% User specifies which leg and FicTrac parameters, by name of fields in
% legTrackIinj and fictracIinj struct... |
ba078e82b3996c8aa7bcca589d9c72312f32018c024488127b20bde182e27d6f | MATLAB | 7,531 | 225 | function analyses_v2(config_path)
%% load variables from config
conf_str = fileread(config_path);
conf_str = strrep(conf_str, ' ', ''); % hack to get loadjson to work
conf_json = loadjson(conf_str);
path_wb_c = conf_json.path_wb_c;
taskname = conf_json.taskname;
version = conf_json.version... |
20e4d47cab865053f8a28e71f249497a49b7aa6798fd4af355141cd5c1bc0173 | MATLAB | 7,534 | 188 | classdef DAQTimeStamp < handle
properties (SetAccess = private)
cameraNum = [];
frameNum = [];
sysClock = [];
bufferNum = [];
end % properties
methods
function obj = DAQTimeStamp( timestampFilename )
if nargin == 1
obj = ReadFile( obj,... |
b235037325d47a76f6c57d29c09a757b144f7e4a3233b2744ef408b69d065375 | MATLAB | 7,535 | 235 | function reading_data_from_DANDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% reading_data_from_DANDI is a function that converts the data
% from the DANDI repository into Matlab structures to perform subsequent
% analyses
%
% 30/01/2025
% Andrea Colins Rodriguez
%
% Pl... |
a5d846b6c2a423f57e779ad1aa127f6adc73c886a9d2cfef0fac3e83902654d4 | MATLAB | 7,542 | 238 | clearvars
load('colour.mat')
addpath('PeriodData')
load("PeriodGlu.dat")
load("PeriodGABA.dat")
load("glutr1.dat")
load("glutr2.dat")
endy=2;
Stable=NaN(length(glutr1),4);
for i =1:length(glutr1)
Stable(i,1)=glutr1(i,1);
Stable(i,2) = glutr1(i,3);
Stable(i,3) = glutr1(i,4);
Stable... |
1179edeca18a2a5fd2dfead7e5c6c87e34fca64fc5a5e830e98bc8b7bcde10b7 | MATLAB | 7,548 | 185 |
% Open a video and return a handle to it.
%
% vinfo = video_open(filename)
%
% where filename is a video file that supports random access to frames.
% Returns a vinfo structure which serves as a handle for accessing
% individual video frames.
%
% vinfo = video_open(filename, cache_size)
%
% where filename is a... |
7bb2cc6631bb1f07f8eed17628289af9b4569e62c53b0d3f731b1bce0c6d8c3b | MATLAB | 7,558 | 157 | function [] = E4_Beta_Comparison_Plotting(slctd_strct,n_BS,plotting)
% plots bootstrapped beta estimates and their differences in conditions and structures
% slctd_strct = which structures to do comarison on ([1,2,4]; %Th, CN and GP: selected based
% on best model on ... |
8b1b837116e9c910efbb61af5df8094a9e27beaeb1d935881f496118183dbbdd | MATLAB | 7,561 | 186 | %% Network Burst Propagation
clear all
clc
% Load file to compute the NB propagation
[filename, pathname] = uigetfile({'*.mat'},'Select NetworkBurstDetectionFile with all electrodes');
if isequal(filename,0)
return
else
col = ['gray ' 'green ' 'red ' 'cyan ' 'yellow ' 'violet ' 'blue '];
str_comp = interse... |
885b4a6909856be4f75e4cb39b13225f2b174108e8b12791b8531e3412f6e990 | MATLAB | 7,571 | 167 | % getTuning -
%%
globals;
clear tuneSs_plot;
strPlt = ''; for ii=1:length(PLOT_TYPE), strPlt = [strPlt cell2mat(PLOT_TYPE(ii)) '-']; end; strPlt=strPlt(1:end-1);
strQs = ''; for ii=1:length(ShowUnitsQs), strQs = [strQs cell2mat(ShowUnitsQs(ii)) '-']; end; strQs=strQs(1:end-1);
strVars = ''; for ii=1:length(VarLis... |
eeb121624568a21335996f68da653629a2808c692b81c3a25088ee50f31eff7a | MATLAB | 7,572 | 150 | function [LNPStats,meanLEDPower, stdLEDPower] = ML_FitLNP(Tracks,folder_indecies,folders,cross_valdiation)
% FitLNP takes in tracks and outputs the parameters of the LNP; not used in paper
if nargin<4
cross_valdiation = false;
end
numbins = 10;
fps = 14;
BTA_seconds_before_and_after = 1... |
62f05fe44f39da07cd2aee837cb75a6a37497a205f31c2356f23d7bb23c1a4dc | MATLAB | 7,574 | 205 | function plotEventHistograms (obj, varargin )
% Plot circadian distribution of events
%
% Syntax:
% PLOTEVENTHISTOGRAMS(obj, event_date, event_type, ax );
%
% Input parameters:
% * obj - object containg data
% * event_type ( optional ) - type of event to plot
% * date_range (optional ) - period of events log... |
62a50ff3b7c06932517385941801038329deded13ca513208a606f40923f0533 | MATLAB | 7,579 | 264 | function dcan_signal_processing(config_path)
% DCAN Signal Processsing
%
% runs motion filtering and signal regression on HCP grayordinate results.
% accepts a configuration file (.json) which specifies parameters as well
% as expected file paths.
%
%% load variables from config
conf_str = fileread(config_path);
co... |
a95d2e7e200b7acb1536e5ef71b63f647c380d71100d536b4d0cc0dddbcd4840 | MATLAB | 7,582 | 206 | % Computes percentile confidence interval(s) directly from a vector (or row-
% major matrix) of bootstrap statistics.
%
% -- Function File: CI = bootint (BOOTSTAT)
% -- Function File: CI = bootint (BOOTSTAT, PROB)
% -- Function File: CI = bootint (BOOTSTAT, PROB, ORIGINAL)
%
% 'CI = bootint (BOOTSTAT)' computes sim... |
f5686ceeb6189a10ea96e413cfc8fde35d3672b44c35fdc12ce1f1175e1aa580 | MATLAB | 7,583 | 282 | function [] = Fig05_Example_AveSong()
% Code for plotting images for the example recordings in Fig. 5b.
GT = 'fruD';
switch GT
case 'fruD'
TargetDataID = 3;
zrange = [2:9];
ylimrange1 = [0,1];
ylimrange2 = [-.3,.3];
ylimrange3 = [0,.8];
ylimrange4 = [-.3,.3];
... |
2618322df8be5278d65c2f4f22c868014d1376869651ad07d20ca46ab6396b61 | MATLAB | 7,585 | 233 | function Example()
% Prompt for the correct DLL
disp(' '); % Blank line
DLLName = input('DLL Name: ', 's');
% Load the appropriate DLL
[nsresult] = ns_SetLibrary(DLLName);
if (nsresult ~= 0)
disp('DLL was not found!');
return
end
% Find out the data file from user
disp(' '); % Blank line
filename = input('... |
9373bb7702d6c73e84ca7eca186255689c3c14fc33cec2c664f71eb715c9db39 | MATLAB | 7,589 | 167 | function [fLMM,fixedInterceptsFull,fixedInterceptsFull_CI,fixedInterceptsFull_SE, ...
fixedSlopesFull, fixedSlopesFull_CI, fixedSlopesFull_SE, ...
subjInterceptsFull, subjInterceptsFull_CI, subjInterceptsFull_SE, ...
subjSlopesFull, subjSlopesFull_CI,subjSlopesFull_SE] = ...
ge... |
9ffa981d32028b91a4ff5dd1fb42b8daa9bd50b3d29436c3be2bb84db403a28f | MATLAB | 7,591 | 220 | function [data] = fixdimord(data)
% FIXDIMORD ensures consistency between the dimord string and the axes
% that describe the data dimensions. The main purpose of this function
% is to ensure backward compatibility of all functions with data that has
% been processed by older FieldTrip versions
%
% Use as
% [data] = ... |
3d4ff005234681910a97203d533f7e98b6a2d7c54fad4cbd14a123fbcc0bbf0e | MATLAB | 7,592 | 170 | function [spikeData,proc,imageOnsetTimesAll,imageOffsetTimesAll,imageIDsAll] = getNatImResp(spikesAll,expFolders,binFileRef,proc)
%%% Load natural images responses
% spikesAll.times: spike times
% spikesAll.clusters: cluster ID for each spike
% expFolders: folder for each experiment to load for that spi... |
d9a93a2bd940bf28a2a8563b8f7ac3d11337e642a0c671141c1a3dd570cc3cc3 | MATLAB | 7,597 | 148 | % mglDoRetinotopy.m
%
% $Id$
% usage: mglDoRetinotopy()
% by: justin gardner
% date: 04/09/07
% purpose:
%
function retval = mglDoRetinotopy()
% check arguments
if ~any(nargin == [0])
help mglDoRetinotopy
return
end
if ~exist('mrParamsDialog')
disp(sprintf('(mglDoRetinotopy) You mu... |
62b39f7526d8853f82d7ae45c97c37cb1f869ea1fc50f8af6a2032ffd05e3c09 | MATLAB | 7,600 | 255 | <<<<<<< HEAD
function [distMatrix, genuineInd, impostorInd, genuinesNorm, impostorsNorm, genuinesAggr, impostorsAggr, fprNorm, fnrNorm, fprAggr, fnrAggr, EERNorm, EERAggr, ...
FMR1000Norm, FMR1000Aggr, genuineDist, impostorDist] = ...
computeVerificationPerformance(numImagesTest, ftest_all, filenameTest, stepPr... |
1f483178594bfddbc2097749c110c250666bcb8e5e13d11ba14c404982b30ab9 | MATLAB | 7,608 | 132 | function [] = moca()
% MOCA - Modular Optode Configuration Analyzer
% Morris Vanegas <vanegas.m at northeastern.edu>
% URL: https://github.com/cotilab/moca
%
% Format:
% probe=characterizeProbe(probe);
%
% Workflow:
% https://github.com/COTILab/MOCA/blob/master/ima... |
c6811f00fe659354c8e0ab36f858d281113b853a9a43ba0f457e054bcc7e09bb | MATLAB | 7,608 | 217 | % stepParamFitlm.m
%
% Function that takes in one or more pData files from same fly (specified
% through GUI), a list of step parameters to use as predictors, a time
% delay, and a sample rate and uses the MATLAB fitlm function to produce a
% multiple linear regression model that predicts spike rate or membrane
% v... |
4c9e635771a5457355edf1f1c40a8fb58412d0a438a3a52d3b4160f5fdeeb4b3 | MATLAB | 7,609 | 242 | clear all
close all
% Fig 8H, tooked strees fibers
P.y0 = 180;
P.x0 = sqrt(P.y0^2 - (P.y0/2)^2);
P.max_y0 = 17*P.y0/2;
P.max_x0 = P.x0*15;
[r_s,T_s,edges_s,edge_type] = create_mesh(P);
aux = find(r_s(:,2) == min(r_s(:,2)));
P.stress =aux;
edges_s = [edges_s;aux(1:end-1) aux(2:end)];
aux = find(r_s(:,2) == max(r_s(:... |
c69dd7441deb7183d79f9ea65e91bdb578b9652677efa24ba87d0611b4e71082 | MATLAB | 7,611 | 198 | % minMaxPosToSteps.m
%
% Function that takes indicies of min and max leg positions and converts
% them into steps.
% Define step start as leg in back-most position (maxInds), as from test
% data, that is where leg movements start when fly starts moving
% Filtered to ensure steps are w/in same moving bout
%
% INPUTS:
... |
f0102c1dc44b5f293428b7db5871d3e6f1c9b89b752d6899851b7645b0a920a5 | MATLAB | 7,611 | 168 | function mglVisualAngleCoordinates(physicalDistance,physicalSize);
% mglVisualAngleCoordinates(physicalDistance,physicalSize);
%
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% $Id$
% Sets view transformation to correspond to visual angles (in degrees)
% given size and distance of d... |
3b8b23970f28ba7631868b59412c3d98f085dc7b52808d918f71375210bc8360 | MATLAB | 7,614 | 197 | % getLegBodyPosFromTrk.m
%
% Function that takes in raw leg X and Y coordinates (output from
% loadTrkFile) and returns coordinates that are shifted and rotated to
% align all the frames to the center point of the fly (point at middle of
% back of thorax) and normalized so the units are body lengths (instead of
% p... |
1856586f065c4fa17c49709eb746602dd768958f1dd08e4018e5395f5aff864d | MATLAB | 7,632 | 249 | % Function: f_GaborAWTransformMatlab.m
%
% Description:
% This function calculates the Wavelet Transform using a Gaussian modulated
% window (Gabor Wavelet).
% The Sample Rate of the input signal is considered in order to compute
% the transform.
%
% Parameters:
% pv_Signal(*): Signal to process
% ps_SampleRate(*): S... |
0dec6684fd41f414148b9fc0d1d4ba6f2df6f0c33166d531f9be410c3a0f63c4 | MATLAB | 7,637 | 178 | function [varargout] = read_plexon_nex(filename, varargin)
% READ_PLEXON_NEX reads header or data from a Plexon *.nex file, which
% is a file containing action-potential (spike) timestamps and waveforms
% (spike channels), event timestamps (event channels), and continuous
% variable data (continuous A/D channels).
%
%... |
24d0d0a50bdcf4b32e2cb768e2b80e184c7dbaadc1c8c38220816ab1f79cd386 | MATLAB | 7,637 | 211 | %% CREATE_DATAFRAME_NGE
% Converts the trial data of all normal gait events into a table which can
% be read in by R. It contains the fNIRS data averaged over 4 time windows
% (baseline, pre, post, and post2) for each channel, trial and participant with
% extra info about each trial.
% (baseline = [-10 -5]; pre = [-3 ... |
b911c7310c75c657edc62af2ee7efbce32f02480c55311f3661ffa5c9710bc6c | MATLAB | 7,641 | 117 | function [cnmf,suite2p,pcaica,est] = separateByCorrelation(cnmf,suite2p,pcaica,est,cuttoff)
% [cnmf,suite2p,pcaica,est] = separateByCorrelation(cnmf,suite2p,pcaica,est,cuttoff)
%
%
%
% 2018 - Adam Charles & Alex Song
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Input parsing/initiali... |
df2142df9ce777e34fecdb99e7006f2df000f3cec94ad3e15fb73bc05c163c5d | MATLAB | 7,641 | 263 |
%% Load and analyze data
experimentfilename = '/data/experiment_modes13_23-10-18-14-10-59.mat';
load([cd,experimentfilename]); % cd gives current directory
EXP = experiment;
addpath([cd,'/helper_scripts/'])
times = [.04,1,4];
Time = cumsum(EXP.LearnTimes)/10^6;
ts = zeros(size(times));
tsprev = ts+1;
f... |
6e95adf57b2ce0f9e8df2155d20ee439f34a328c5094fd5e2348bfd3e79c0f1b | MATLAB | 7,646 | 171 | %% SETUP
clear;clc;%close all
try
[dataTable] = readtable('G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_C.xlsx');
p.expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\Jennifer Data Reorganized';
catch
[dataTable] = readtable('D:\My Drive\Expmt Data\Max... |
873592e5e5c8301046d3351af573f533a3c1e11f3f03712e5edfdf95e642b631 | MATLAB | 7,646 | 232 | % ----------------------------------------------------------------
% Load Dataset
% ----------------------------------------------------------------
unzip datasetImages.zip
data = load('vehicleDatasetGroundTruth.mat');
vehicleDataset = data.vehicleDataset;
rng(0)
shuffledIndices = randperm(height(vehicleDataset));
id... |
64579c14d74a5351f608a9aeafe7457dc458794e52ef0735d5b543eef9029dea | MATLAB | 7,647 | 162 | function [chi_res, chi_res_M] = delta2chi_nSFCR(deltaB, maskErode, DPWeight, nSFCRparams)
% chi_res = delta2chi_nSFCR(deltaB, maskErode, DPWeight, nSFCRparams)
% delta2chi_nSFCR main wrapper of nSFCR
% which calls delta2chi_nSFCRL2 & delta2chi_nSFCRL1
% Ref: Bao et al, IEEE TMI, 2016 35(9):2040-50
% Chen et a... |
1e0f5ac8accf807c412b1bdc9396dae75ab95fab5c59b9f9e79fd349c7885134 | MATLAB | 7,648 | 284 | %%
clear all
close all
%% Create mean vectors (Symbols)
SAVE_FIGURES = false;
M = 6; % #symbols
N = 100; % dimension
S = randn(N,M);
alp = ('A':'Z')';
%voc = alp(1:M);
voc = alp(M:-1:1);
%normalize vectors
for k=1:M
S(:,k) = S(:,k)/norm(S(:,k));
end
%% Orthogonalizing
[ST,~] = mgson(S);
%% Adding memory and no... |
9df8424509ff0647e4c661edf810a9b8f6ad140eb80b925a8f82c897cdb72454 | MATLAB | 7,648 | 265 | function img = read_2dseq_V1(folderName, procno)
% img = read_2dseq_V1(fname, expno, procno)
%
%% Author: Jiadi Xu
%% Author: Xu Li (xuli@mri.jhu.edu)
% Affiliation: Radiology @ JHU
%
% read image data in file "2dseq" reconstructed from Bruker ParaVision 5
% the file is in the directory <fname>/<expno>/pdata/... |
e633e1a428f058855e8ce21ff59751b2233662b803c33a0bfd0baf2141d5bd9e | MATLAB | 7,650 | 119 | function vasc_params = check_vasc_params(vasc_params)
% vasc_params = check_vasc_params(vasc_params)
%
% This function checks the elements of the struct vasc_params to ensure
% that all fields are set. Fields not set are set to a list of default
% parameters. The struct checked is:
%
% - vasc_params - Struct cont... |
cc15d6208c2f8384d3eacc09f2e760b54c2ca29a99072f0f018156427de7b513 | MATLAB | 7,652 | 194 | %Calculate the interaction residuals for the highest order interaction in
%the data. If the data has two factors, the main effects will be
%subtracted. If the data has three factors, the main effects and two-way
%interactions will be subtracted.
%
%EXAMPLE USAGE
% >> int_res = get_int_res(data, [], [3, 4])
%
%... |
a5047e2db531d5e67bb7e2d39f853ab280f91807dd968d84d0033b91fe2a7600 | MATLAB | 7,666 | 233 | classdef Set < handle & matlab.mixin.CustomDisplay
properties(SetAccess=protected)
map; %containers.Map
fcn; %validation function
end
methods
function obj = Set(varargin)
% obj = SET returns an empty set
% obj = SET(field1,value1,...,fieldN,valueN) return... |
43d1dc5fe4825a158962145cc3bb3bf43e69acb1fd6d47159ca6369ca4c51a19 | MATLAB | 7,669 | 175 | % TDMS_VERSION_INFO
%
% Current Version: 2.5
% Date : 7/28/2012
% Authors : James Hokanson
%
% The most notable reason for this change was to make a major bug fix.
% Major only in the sense that it could fail without the user knowing it
% (fail silently), giving the illusion of ... |
5f42d145165ee75d4d261ef415dd830a11b686f5439dd7f0b34446898501f698 | MATLAB | 7,673 | 202 | function script06_axon_diam_skel_props(samplei)
% compute skeletons and cross seccional areas on aligned axons
% and also check several properties of the axons
% samplei = the index of the EM sample to analyze
%
% This script needs the original volumes and the results from scripts:
% script01_props3d.m
% script... |
f10358a7804053c4a2249b0831a187e275934c030c906a1ae9a1b19b889ceaa8 | MATLAB | 7,674 | 237 | function ft_write_headshape(filename, bnd, varargin)
% FT_WRITE_HEADSHAPE writes a head surface, cortical sheet or
% geometrical descrition of the volume conduction model or source
% model to a file for further processing in external software.
%
% Use as
% ft_write_headshape(filename, bnd, ...)
% or
% ft_write_hea... |
1cfbe39d57fca06fef824141bb3ce93fc427faf360206f0b4f165c2c4ad8bab7 | MATLAB | 7,676 | 216 | % stepParamStepwiselm.m
%
% Function that takes in one or more pData files from the same fly
% (specified through GUI), a list of step parameters to use as predictors,
% a time delay, and a sample rate and uses the MATLAB stepwiselm to
% perform stepwise regression.
%
% INPUTS:
% paramList - cell array of names ... |
bfae453acc08c9ce0162b64c2314050e5cdad5e89e3cfd6787794bcaea9e3b94 | MATLAB | 7,676 | 176 | function sse = eval_function(model_name,data,fitting_target,value_init,x)
mouseNames = unique(data.mouseName);
% simulate the model with parameters x
switch model_name
case 'multi_trial_belief'
% loop over mice
for iMouse = 1:length(mouseNames)
% subselect da... |
5872931056479d6ea487e21907ff9bcf5aeb4cfe4f8b2c3fcf6ba335e4a0b713 | MATLAB | 7,682 | 200 | function binRawData(sectionsToProcess, targetDir, binSize, binType, ...
resolution, copySIHeader, copyBakingTrayFiles)
%BINRAWDATA Reads the raw data folder, bin tiff files and write
%them in targetDir
%
% binRawData(sectionsToProcess, targetDir, binSize, binType, ...
% resolution, copySIHeader, copyBaki... |
051acb4c70da22248a3fcd3a12d0b439462cbd8c51b0c00bb36ebd0ceaceb1e0 | MATLAB | 7,685 | 147 | clc
clear all
%% enable FSL
setenv('FSLDIR', '/afs/cbs.mpg.de/software/fsl/5.0.11/ubuntu-xenial-amd64/'); %insert your FSL dir here
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
setenv('FSLOUTPUTTYPE', 'NIFTI_GZ'); % this to tell what the output type would be
%% ... |
07e07d93e00d7c7c5e7930a2c730ff63ab982d9556afd19f7166fce1c27c794c | MATLAB | 7,689 | 180 | % VL_COVDET Covariant feature detectors and descriptors
% VL_COVDET() implements a number of co-variant feature detectors
% (e.g., DoG, Harris-Affine, Harris-Laplace) and corresponding
% feature descriptors (SIFT, raw patches).
%
% F = VL_COVDET(I) detects upright scale and translation covariant
% features b... |
40a19783b42b01bff4df7663d2cb44456d4090b8f3cd156381783962215aad3b | MATLAB | 7,689 | 246 | function DATA = aedes_smisread(filename,opt)
% AEDES_SMISREAD - Read S.M.I.S. Data Files (*.sur)
%
%
% Synopsis:
% DATA = aedes_smisread(filename)
%
% Description:
% Read image data from S.M.I.S. SUR-Files.
%
% Examples:
%
% See also:
% AEDES_READFID, AEDES_READ_NIFTI
% This function is a part of... |
3c415ae3a4ca4dfc8cf0ebdb865401e0172c97cb24ac5800c00a8171dbddf362 | MATLAB | 7,690 | 251 | % plotPairDiffByFwdAccEPhysVYawVel.m
%
% Function to plot output of getCorrelationEphysFwdAccYawVel_cond_all() or
% getSlideWinEphysFwdAccYawVel_cond_all() as difference in average ephys
% value between two forward acceleration bins, in specific yaw velocity
% bins
% I.e. for each fly, average ephys value in one fo... |
6bfbe69b0737af53e5f61ddbd2b27849862c4c8552d6571fa4749c37dae0ae80 | MATLAB | 7,690 | 174 | %% Clean-up
clearvars; close all;
%% Specify parameters
Options2.directory = '\\folder\';
Options2.subdirectories = {'folder_groupA\', 'folder_groupB\'}; % cell; each sub-directory represents one group in analysis
Options2.lengthFOVid = 16; % number of characters specifying animal & FOV
Options2.directory_out = [... |
ef1c20d39fd8504bd262d57cca016be35ecdff283b2ca55bfb79cfa79a12d71c | MATLAB | 7,692 | 148 | clc
clear all
%% enable FSL
setenv('FSLDIR', '/afs/cbs.mpg.de/software/fsl/5.0.11/ubuntu-xenial-amd64/'); %insert your FSL dir here
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
setenv('FSLOUTPUTTYPE', 'NIFTI_GZ'); % this to tell what the output type would be
%% I... |
f7452f64429378bd4f0bde74399e8eadd965f814a6ac443006be3ae38311f4a6 | MATLAB | 7,693 | 257 | % taskTemplateMovie.m
%
% $Id: taskTemplate.m 835 2010-06-29 04:04:08Z justin $
% usage: taskTemplate
% by: justin gardner
% date: 1/20/2013
% copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING)
% purpose: example program to show how to use the task structure
% and display... |
164602a2c08d61353452666a8839cf0b575f816e2ac8b1c1f9a2a3744e9d02e7 | MATLAB | 7,699 | 221 | % findCondYawVelPeaks.m
%
% Helper function for saveLegStepParamCond_bouts() that takes in bodytraj,
% cond, and moveNotMove and returns indices (of bodytraj) for valid yaw
% velocity peaks as well as start/end indices for corresponding bouts.
% Boolean for whether to extract right or left turns
%
% INPUTS:
% bodyt... |
0fb803fc47ded4c3a9911707c15914ade1e8c5d0c22db7f975685e25a650d9b4 | MATLAB | 7,704 | 221 | function [SMVdata, background] = SHARP_Adaptive_Multi(GREPhaseSE, mask, radiusMAX, thresh_reg, Params, handles)
% [SMVdata, background] = SHARP_Adaptive(data, mask, radiusMAX,thresh_reg,Params)
% Author: Xu Li
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
%
% Ref: Schweser et al. 2011, NIMG, Wu, et... |
120d57bc778c64ab988b718b5a48d16852b816f0f87bd813a62d0e06851f5543 | MATLAB | 7,716 | 184 | % sortLegStepsByOpto.m
%
% Function that categorizes all leg steps by whether they're during an
% opto stim bout (and opto stim duration) or not.
% Labels every half step with category index number, and generates key for
% matching b/w category indices and conditions (different durations).
% Not during opto stim has ... |
84e89e0cac2492148c030d637c31b405ae3c6db9d42c97da269cab4cc0e8d3e9 | MATLAB | 7,717 | 270 | % disppercent.m
%
% by: justin gardner
% date: 10/05/04
% usage: disppercent(percentdone,message)
% purpose: display percent done
% Start by calling with a negative value:
% disppercent(-inf,'Message to display');
%
% Update by calling with percent done:
% ... |
4e3689a4bd8f6568ba4a46c3ddeccf9b362595fe9c0cdcfc35c54a23403fe144 | MATLAB | 7,719 | 183 | %%This script analyses the raw neural responses to select face-selective
%%neurons. To select a face-selective window, the permutation analysis is
%%performed. Therefore, the number of neurons with significant
%%face-selective windows might slightly vary each time you are running the
%%script
%% Loading raw data
... |
a5e2311a1b67e2e68e0573ebefbf3005358d3591f21a5639e9d3a2adbcb7d4f4 | MATLAB | 7,719 | 152 | function [LNPStats, meandutycycle, stddutycycle] = FitLNP_vibrations(Tracks,folder_indecies,folders,cross_valdiation)
%FitLNP takes in tracks and outputs the parameters of the LNP
% Detailed explanation goes here
numbins = 10;
if nargin<4
cross_valdiation = false;
end
fps = 14;
B... |
0a2e78e8f43890a22906d4929185fca509b04864bd5db567584b43e6aaa094b7 | MATLAB | 7,722 | 196 | %Function to get amplitude averaged across the time points and electrodes
%that were significant in a mass univariate test. Mean amplitude is
%returned for each subject and bin involved in the test.
%
%Note that care should be taken with regard to analyses conducted on such
%mean amplitudes:
%If analyses are not... |
5205e04c2fa963818543ccf62e323a3fc437c3f8ede0380f14df50dfead7506d | MATLAB | 7,737 | 175 | %% Script to test the brain regions that exhibit significant differences from HC (centiles; Wilcoxon rank sum test),
%% or are significantly different from 0 (effect sizes, permutation test) with FDR correction
% Copyright (C) 2023 University of Seville
% Written by Natalia García San Martín (ngarcia1@us.es)
... |
62183e4b7e7b03426bb53216ad834d11a1c6594008bdb70173a537f3b07d5c26 | MATLAB | 7,737 | 221 | % stepParamFitlm.m
%
% Function that takes in one or more pData files from same fly (specified
% through GUI), a list of step parameters to use as predictors, a time
% delay, and a sample rate and uses the MATLAB fitlm function to produce a
% multiple linear regression model that predicts spike rate or membrane
% v... |
654318e9ae9e19a34f2d4fc3fe9486b9d8cbc371fc2c1dd6d7afe23f039fdbb1 | MATLAB | 7,755 | 195 |
%# usage: [Sz, Sp, Sg] = sftrans(Sz, Sp, Sg, W, stop)
%#
%# Transform band edges of a generic lowpass filter (cutoff at W=1)
%# represented in splane zero-pole-gain form. W is the edge of the
%# target filter (or edges if band pass or band stop). Stop is true for
%# high pass and band stop filters or false for low p... |
62e9a82c5a732ef36953e9773d87bdc3943506e175492e0c4432258e3c65fd71 | MATLAB | 7,764 | 227 | function [data] = ft_transform_ODs(cfg, data)
% FT_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_transform_ODs(cfg, data);
% [freq] = ft_transform_ODs(cfg, freq);
... |
909ad20e1fb59e8260718b859ac0b09c0b3489f866c5716e8ac1fc32ac95ca5e | MATLAB | 7,773 | 166 |
showfigs = 0;
%% Define all three planes (m)
X = 1e-6; % YZ Cross-section position, m
Y = 1e-6; % XZ Cross-section position, m
Z = 100e-6; % XY Cross-section position, m
delta = 2.0e-2; % half plane window, m ... |
f43f04dddab2867a63c7d18f7f6ba384900a3f7c2cf47a75b10eb43ac609ce73 | MATLAB | 7,773 | 162 | function core_core_tracker(output_track_file_path, ...
working_background_file_name, ...
output_segmentation_file_path, ...
input_video_file_path, ...
options, ...
calibration)
% T... |
338036d0f905c5e85b982c5d3c1379fb8e56b19cb82e6c248456e6fe803d21c4 | MATLAB | 7,777 | 186 | function [status, fieldsUsed] = spm_matlab_version_chk(chk,tbx)
% Check a version number against a Toolbox version.
% FORMAT [STATUS FIELDSUSED] = SPM_MATLAB_VERSION(CHK,TBX)
%
% This function checks if a user supplied version number is less than,
% equal to or greater than the version number of specified too... |
6e492a24320f7cf39e126ace0d3c1e19f6e9dfb1d2df5f50409a98eeb02a8c15 | MATLAB | 7,777 | 229 | %% Predict heading and context using only CG trials
% averaged per animal and two sample t test for prediction rates of FI and
% FS
% Rate as the predictor
% Predict one cell at a time across days.
clear all;
data_path = '/Users/celia/Documents/two_context_data';
load(fullfile(data_path, 'tetrodes_20220316_100902/ana... |
a585a9e6e2b78c734346375473f46be2307f7753ff6d6d6dac36c12ec46ddf91 | MATLAB | 7,786 | 177 | % DeviceWrapper This class is a wrapper for the robot device, providing a set of methods to interact with the device and control its behavior.
%
% The purpose of this wrapper is to abstract away the details of the robot device and
% provide a simplified interface for users. By using this wrapper, users
% can easily swi... |
c144755adf5b57af56ee7f66795235642e7357af861a180690d8a3c5f19116e9 | MATLAB | 7,786 | 198 | function [M,Q]=community_louvain(W,gamma,M0,B)
%COMMUNITY_LOUVAIN Optimal community structure
%
% M = community_louvain(W);
% [M,Q] = community_louvain(W,gamma);
% [M,Q] = community_louvain(W,gamma,M0);
% [M,Q] = community_louvain(W,gamma,M0,'potts');
% [M,Q] = community_louvain(W,gamma,M0,'negative_a... |
3dba1a0ebd416fe15085cf0cdf5d9d2d7a79394844a52eec32028922e7b09a80 | MATLAB | 7,788 | 176 | function Path4UnitNPY = ExtractAndSaveAverageWaveforms(clusinfo,param)
%% Called by UnitMatch, but can also be used on its own to save two averaged waveforms per unit per session
%% Read in from param
RedoExtraction = param.RedoExtraction; % Raw waveform and parameter extraction
AllDecompPaths = param.AllDecompPaths;
... |
dd1fa2f62c211358315f219fbdddf054adb2a8c6a3061f07deeee00e6e05dfdb | MATLAB | 7,791 | 227 | function Results = gretna_binary_classification_linear(Features, Group_label, K_fold, Method, C_type, C_thr)
%==========================================================================
% This function is used to classify two groups based on linear models.
%
% Syntax: function Results = gretna_binary_classification_lin... |
ff8907fde901dd7480ce9a6564ed9c8135effeb77797e58e9d5ec5b8a8c79485 | MATLAB | 7,797 | 170 |
showfigs = 0;
%% Define all three planes (m)
X = 1e-6; % YZ Cross-section position, m
Y = -1e-6; % XZ Cross-section position, m
Z = 100e-6; % XY Cross-section position, m
delta = 2e-3; % half plane window... |
29d5a8095ef76a2456eee5575f4e96d078f217ac480b1d6fcfd667f49a046fcd | MATLAB | 7,806 | 185 | %% s_makeAllManuscriptFigures.m
% Script to reproduce all data figures of the paper:
% Title: Rethinking simultaneous suppression in visual cortex via
% compressive spatiotemporal population receptive fields.
% Authors: Kupers, Kim, Grill-Spector (2024).
% Journal: Nature Communications
% DOI: XXX
%
% M... |
17cdf2be18912a70b0f6eb72ca84f448164166ee2d937dd46e92d24fb15d93a6 | MATLAB | 7,808 | 290 | %
% Fit a distribution. This version allows multiplicities for
% values, but does not draw a figure.
%
% PARAMETERS
% type String representing the type of distribution that is
% tested against; see below for possible values
% x (k*1) The vector of values
% c (k*1) Counts
%
% RESULTS
% ret A struct with the follow... |
e1ec6ddc5945d1a489d7902ecc72b43ca0b1b363bf10e87a36d5943053bbfb30 | MATLAB | 7,823 | 258 | function [ws, warned] = ft_warning(varargin)
% FT_WARNING will throw a warning for every unique point in the
% stacktrace only, e.g. in a for-loop a warning is thrown only once.
%
% Use as one of the following
% ft_warning(string)
% ft_warning(id, string)
% Alternatively, you can use ft_warning using a timeout
% ... |
a0d91fe8d97be342408c6566a55e7ef2e8f69f6c4e896d456c99896fad76d5b9 | MATLAB | 7,842 | 201 |
%% Index
% Index for trial start - first
NumberIndex=length(trial);
for i=2:NumberIndex
if trial(i) == 1
Index_TrialStart(1)=i;
break;
end
end
m=2;
for i=2:NumberIndex
if (trial(i-1) ~= trial(i)) && trial(i) ~= 1
Index_TrialStart(m)=i; m=m+1;
elseif Flag_help(i) ... |
7bf15aa188ded1a1342ecbadca1a321921a5f2032bb6ef59093cfd762ad09788 | MATLAB | 7,844 | 194 | function [perCell] = mlgp_compute_bfo_general_mod(obj, session, rotDeg, mirrorContexts)
% mirrorContexts should be the same length as the number of contexts
% an entry of 0 means do not mirror, and 1 means to mirror
% this is used because often context 2 has the reward cup mirrored
% Allow the func... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.