sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fa18b4e4cd585bdb4d20a04c9c67c947ccf5202a0d90785b49c32ece0561cd88
MATLAB
6,724
221
clear [task_info,supPath,MaestroPath] = ... loadDBAndSpecifyDataPaths('Vermis'); K_FOLD = 10; req_params.grade = 7; req_params.cell_type = {'PC ss', 'CRB','SNR', 'BG msn'}; % req_params.ID = [4135, 4208, 4209, 4343, 4390, 4569,... % 4570,4602, 4604, 4605, 4623, 4625, 4658, 4701,... % 4791, 4806, 4821, 484...
c0eaa5857469b14cb2c0d6dffd45031468525fe847b662783ebca61dde0c22b9
MATLAB
6,728
191
%% CLEAR AND INITIALIZE clear;close all;clc;tic; %% DEFINE THE STRUCTURE THAT WILL HOLD ALL THE PARAMETERS params = []; %% DEFINE INPUTS AND OUTPUTS params.data_folder = 'F:\2022-131\PAVLOV\DATA'; params.analysis_folder = 'F:\2022-131\PAVLOV\Analysis'; params.figure.folder = params.analysis_folder; %% DEFINE THE...
c2c11cd5cb4feae61d48e8438901c49239cf53cfbefabac402cc35a05514ef7a
MATLAB
6,728
115
%Plots PSD response to flicker stimulation, for all flicker frequencies tested. %2024/02/25 function plot_mod_by_stimfreq(fnames,ref_method) %fetch data: mod_sigs=readtable([fnames.analysis_folder '/LFP/static_ent/LFP_pvalue_table_ref' ref_method '.csv'],'ReadVariableNames',true,'ReadRowNames',true,'PreserveVa...
3852d0b4697af886a102db774fc32b2cbad8ca648ad98e4d751a13af59b14767
MATLAB
6,732
162
% different from redefineStimulusClassesUpdated02. % removed prune channels step to observe auditory cortical regions. % For sbj 12 and afterward function plotSingleTrialRaw(sbjNum) saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir...
f99b6ace2140a576833c90866de86d129fbc2dc9d1083c1001cebde6ad377f16
MATLAB
6,744
169
%% ------------------- participant information ------------------- opt.session_role = {'player','observer'}; opt.epoch_type = {'DecisionMaking','Feedback'}; opt.participant_pair = {'Player_sub01', 'Observer_sub02'; 'Player_sub03', 'Observer_sub06'; 'Player_sub04', '...
c322607109150ac04e4830fd09dbdd3ffef70ba3c7550a69c9c3ce4283e8bd63
MATLAB
6,751
223
% This demo shows how a simple ROI decoding can run on simulated 3D % toy data. The toy data are Matlab matrices and no real fMRI or EEG data, % i.e. results do not necessarily generalize to real data. % % The script creates multiple volumes in the shape of an ellipsoid where % all entries are filled with random...
31e786c85d5b644196c55b0bf89edb9e5e1d4466dd07a63174f704ff87c1a759
MATLAB
6,754
276
% function design = make_design_xclass(cfg) % % % Function to generate design matrix for cross classification using the % decoding toolbox. This function uses all training data and all test data, % without cross-validation. % % IN % cfg.files.chunk: a vector, one chunk number for each file in % cfg.files.name. ...
d196b7896ebdd417bc9fbedcda7c836fcbc47993425fb9ecac34637fced06027
MATLAB
6,757
180
function [regionNames, regionNumberOfDataPoints] = drawStatisticsOnBody (bodyPartsNames, numberOfDataPoints, bodyPartsNames2, numberOfDataPoints2) % Inputs: % bodyPartsNames - cell of strings with body parts names % numberOfDataPoints - number of points per body part, optional. Will % mark as one score pe...
fd84c32f9649b20f18702d0741e7b316c2a6bc195ce42e14863f33523032c214
MATLAB
6,761
177
function gatherAlignedImagesFromAllSubjects(libraryNames,outputFolder,... octBScanToUseAroundCenter,isAverageOCTBScans, outputImagePixelSize_um, ... minPatchSizeX_pix, minPatchSizeY_pix) % This script gathers OCT & Histology images from all subjects in library %% Inputs % Main dataset folder to generat...
8ab1ef86c2bcef159dc81c2e111f7a9e22e5c9a94d0528f5cb97f867d846bdbb
MATLAB
6,763
262
function Duszkiewicz2024_Figure_SingleRec_NPX % This script reporoduces panels from: % Figure 1 % Run in folder A8603-210602 to reproduce the manuscript figure % Dependencies: % TStoolbox %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % Thi...
0669a3c8c51146c97a23938425cd30151511440d5c7b7b63d868ab0034c21fbf
MATLAB
6,765
220
function PLS_bootstrap_nsynth(GENEdata_root, MRIdata_root, ncomp, bootnum, working_dir) % PLS regression and boostrapping %% ------------------------- SCRIPT INFORMATION --------------------------- % % PLS Regression and bootstrapping % % This script will perform a PLS regression analysis for relative gene % expression...
eccf95ab42760c187af764ab22a9cded65b55aa6716188a09b9e915b9f64ce7e
MATLAB
6,765
146
#import <UnityAds/USRVUnityPurchasing.h> #import "UnityAdsUtilities.h" #import "UnityJsonAdditions.h" struct UnityPurchasingProduct { const ushort* productId; const ushort* localizedTitle; const ushort* localizedDescription; const ushort* localizedPriceString; const ushort* isoCurrencyCode; co...
638c5b324a932104899565145cc033395f450191fca95977a1d06469ba192e8c
MATLAB
6,771
189
function [deformed, transformationMatrix] = run_affine_registration(... moving,fixed,startScale,stopScale,numberOfIterationsPerScale,... varargin) % RUN_AFFINE_REGISTRATION Run affine registration on provided data % % run_affine_registration(model,fixed,startScale,stopScale,numberOfIterationsPerScale) % % INPUT...
8742fd059af68814d18edeaab5504f53fc14accbfea693a408e3840818f1c24c
MATLAB
6,772
195
% spaceOp % 1: original feature space % 2: PCA transformed space % 3: log transformed space function plotHistogramFeats(sbjNum,numClasses,spaceOp,saveOp) processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; rawDataDir = ['C:\Users\mn0mn...
f7ff22795026dc975ee41ab6405c8fc02a4cc3aeff0cb6fd5866fd7b465157a0
MATLAB
6,787
141
% Render brain surface turbulence by node clear close all cd ('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/timeseries/outputs/Turbulence_30_06_2022/') addpath('/Volumes/LASA/TBI_OpenNeuro/Shared_code/Turbulence/TBI_turbulence_current_code/') %% Load node-level turbulence for different groups and conditions load('turbu_by...
b3d93b1b46be818a3bb6aad68ef6c2988582ea9c68506f2e738d14c114346595
MATLAB
6,810
198
function [new_results all_acts all_test_idx] = apply_trained_classifier(subj,old_results,regsname,sel_test_name,varargin) % [NEW_RESULTS ALL_ACTS ALL_TEST_IDX] = APPLY_TRAINED_CLASSIFIER(SUBJ,OLD_RESULTS,REGSNAME,SEL_TEST_NAME, ...) % % Takes the OLD_RESULTS structure (including its already-trained % classifiers), and...
1dcf7f54e532dbce84657d313b047c9fcb0e99294ee488cb9fef2215723de4e3
MATLAB
6,813
187
function [deformed, displacementField, displacementFieldInverse] = ... run_non_rigid_registration(... moving, fixed, method, accumulationMethod, ... startScale, stopScale, numberOfIterationsPerScale, ... fluidRegularization, fluidRegularizationData, ... elasticRegularization, elasticRegularizationDa...
b4b646189482d10bd42047843fce0305258f9fa7f2f66479215ed17ecc38ff19
MATLAB
6,821
140
function [X, clabel, cfg] = simulate_oscillatory_data(cfg) % Simulates EEG-like oscillatory data consisting of a superposition of % narrowband sources (typically serving as signal sources) and broadband % sources with a 1/f spectrum (typically serving as noise sources). % All sources are initially created as broadband ...
2eb43399730f4e7154e0b37bdb499c23f4d8cd9b918dbf99fafe063eb87befdc
MATLAB
6,822
202
% test_main Test freezeColors / unfreezeColors % % JRI 4/2007 % Author: % John Iversen % john_iversen@post.harvard.edu disp(' ') disp('==================================================') disp('==freezeColors / unfreezeColors interactive test==') disp('==================================================') dis...
7376c6f687276abe05b6bb5288f398fadd94048d91d65151264488b988649814
MATLAB
6,833
205
% @title Test script for Hill synapses % @file test_Hillsyn.m % @author Romain Beaubois % @date 11 Aug 2021 % @copyright % SPDX-FileCopyrightText: © 2021 Romain Beaubois <refbeaubois@yahoo.com> % SPDX-License-Identifier: GPL-3.0-or-later % % @brief Test script for Hill synapses % % @details % > **...
e554d7e20179aa64eacaeccc9cb6d1e7419d0cccc4ebc0e2b4afb1cb982f206f
MATLAB
6,854
185
% function regressor_names = design_from_spm(spm_folder,save_on) % % This function will extract the relevant information for the current % decoding from an SPM design matrix and will save it as % regressor_names.mat to the folder of the design matrix. % % INPUT: % spm_folder: The folder where the design matrix ...
8c7b412091eb62b210f1f1d10f852fc562bed973603fa73ebf9c0a5d612f8277
MATLAB
6,859
138
function plot_GLM_CV_Performance(sbjNum,respData,numClasses) fs = 50; timePt = (0:0.5*fs:6*fs)+2*fs; %trialTime = [-2 15]; saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\RawDatafNIRS\Experiment' num2str(sbjNum)]; processedDataDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAtte...
a5c8319d5dfe757d69149145ea33c3fd65b21bc95a184e526d2358d4c1005433
MATLAB
6,862
179
%% STABLE ANTI-PHASE CYCLE IN THE PARAMETER SPACE (C1,C2) or (C1,epsilon) %% SETTING clear Path = [pwd, '\IN_sims\']; rng(13) % seed % TIME T = 1500; % time span dt = 0.01; N_eq = 3; % number of equations % PARAMETERS gNa_0 = 30; gK_0 = 20; gL_0 = 0.1; ENa_0 = 45; EK_0 = -80; EL_0 = -60; I_0 = 2...
c7ff8d1841a3bc071369b57dea3412d730bf9a5454833b0d1e4aefe192087ab8
MATLAB
6,892
215
function PLS_bootstrap(GENEdata_root, MRIdata_root, ncomp, bootnum, working_dir) % PLS regression and boostrapping %% ------------------------- SCRIPT INFORMATION --------------------------- % % PLS Regression and bootstrapping % % This script will perform a PLS regression analysis for relative gene % expression in 180...
7b9fd0c0199509b6320f4695b3ad2a5949d874b313cd37125419bcadb441969e
MATLAB
6,896
195
%dsRFPlot plots responses to drifiting grating stimuli (spike rasters and %polar plots) and RF maps from sparse noise stimuli. Uses as input %'..._analyzed.mat' file. %% CLEAR MEMORY AND LOAD DATA clear; clc; close all [fileName, pathName] = uigetfile('*.mat', 'Select analyzed .mat file'); if fileName == 0 ...
2d425a15db46bc3aa6ea2c8cc96597946b27426cf9e5ea75218ca5002fcdee36
MATLAB
6,898
170
clear; close all; clc; %% load comparison grids Topic = 'Ai148_Grm6Cre'; Day = '110318'; Cell = 1; Exp = 5; FolderPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\Noise\Analysis\DataStimulus\'; FileName = sprintf('%s%s_%s_%d_%d', FolderPath, Topic, Day, Cell, Exp); AnkGrids = load(FileName); An...
1ce185335d88ab3682e46501b25ea2459312e741ca5f143e02d999f0ac328c41
MATLAB
6,908
156
%% Plot Raw Data and Spikes (FF and FB) % Ensure you are in the correct directory that houses the .mat files for % raw data and spikes %visualizes data from spikes table data structure clear clc close all parent_dir='D:\Brewer lab data\HFS\test 4'; spikes_table=load(strcat(parent_dir,'\','allregion_unit_matched_spon.m...
fc2183e724f7d95da7a8d033b84e1e1e912b2438d8f9dbb876dce5b44371ce6d
MATLAB
6,908
300
anal_dir = '~/Dropbox/Analysis_Thalamus/'; figDir = [anal_dir 'Figures/AdnPostsub/']; bin = 0.5; nbBins = 100; xcWAll = []; xcSAll = []; xcRAll = []; cellTypeAll = []; cch = []; mwf = []; spkW = []; dayIx = []; shankIx = []; neuIx = []; cIx = []; poHd = []; for ii=1:length(datasets) [dumy fbasename dumy]...
4bf81094521f02999e985a813b70efd8133921669a6c78cb8c96ab13f1b6aa9a
MATLAB
6,909
215
function registration_example3d(varargin) % REGISTRATION_EXAMPLE3D 3D example for image registration % % registration_example3d() % % See also REGISTRATION_EXECUTE % Copyright (c) 2012 Daniel Forsberg % danne.forsberg@outlook.com % % This program is free software: you can redistribute it and/or modify % it under the t...
7c3c6277ba37fa6054a018d5b3818f33b9179350c2270543cd69f5153d79e0f4
MATLAB
6,909
249
function varargout = permcca(varargin) % Permutation inference for canonical correlation % analysis (CCA). % % Usage: % [pfwer,r,A,B,U,V] = permcca(Y,X,nP,Z,W,Sel,partial,Pset) % % Inputs: % - Y : Left set of variables, size N by P. % - X : Right set of variables, size N by Q. % - nP : An integer re...
7dbd4d3fc539132f0c1a680cf83beda4f761a9f9b99ea5d5d4812e27333951ae
MATLAB
6,909
141
% function misc = decoding_load_misc(cfg, passed_data, misc) % % Function to load miscellaneous data from files for decoding.m such as % residuals from a general linear model. If they have been passed already % using misc as input, this function is skipped. % At the moment, we only allow getting residuals. For la...
7bc755c8674ce9f9e0bbc7adbcf388de383477bae6c3d12dbdf168b72d3dbc5a
MATLAB
6,911
139
#import "UnityJsonAdditions.h" NSString *const NSUnityPurchasingTransactionDetailErrorDomain = @"NSUPURTransactionDetailErrorDomain"; NSString *const NSUnityPurchasingTransactionErrorDetailErrorDomain = @"NSUPURTransactionErrorDetailErrorDomain"; UPURTransactionError UPURTransactionErrorFromNSString(NSString *error) ...
d1b22c24d1086a76b566b0e023d8e7dad32277cc65e733cedfffbf9d688163f2
MATLAB
6,913
203
% LOAD_SPK_FROM_DAT and detrend % % CALL SPK = LOAD_SPK_FROM_DAT( FILEBASE, SHANKNUM, CLUNUM ) % % GETS FILEBASE dat file assumed to be FILEBASE.dat % SHAKNUM % CLUNUM clu number/list of spike times/empty (all spikes in...
ee0cc29977ca900da735118a4359ad6b38a61a08c7463f6900fbcf46e798117c
MATLAB
6,929
269
function setpaths(options) % % USAGE: % % setpaths % setpaths(1) % setpaths(0) % currdir = pwd; try warning('off','MATLAB:rmpath:DirNotFound'); appname = 'Homer3'; % Parse arguments addremove = 1; if ~exist('options','var') options = ''; elseif isnumeric(options) ...
f17e81f042ad5e12889364b7403baa5c7184bacf2e832e5b86866dee3db37444
MATLAB
6,943
142
% Classifier unit test % % Classifier: naive_bayes tol = 10e-10; mf = mfilename; %% test whether probabilities within [0, 1] %%% Create Gaussian data nsamples = 60; nfeatures = 10; nclasses = 3; prop = []; scale = 0.01; do_plot = 0; [X_gauss, clabel_gauss] = simulate_gaussian_data(nsamples, nfeatures, nclasses, pro...
8566a3ac4fb24b3e89864bb01a26c14f94c52e96dcbc80444b1367bffa43288d
MATLAB
6,947
241
clear all eeglab; %spmfile = 'D:\home\Data\DBS-MEG\LN_C21\170314\SPMstim\LN_C21_STIM_R_20_off.mat'; spmfile = 'D:\home\Data\DBS-MEG\LN_C10\270613\SPMstim\LN_C10_STIM_R_5_off.mat'; stimfrq = 5; peak_offset = 50; D = spm_eeg_load(spmfile); %% apply tsss S = []; S.D = D; S.tsss =...
8e4560711dcd6c3ee2851f43b131aa6792e735697f29246507ae304e2fd4cc48
MATLAB
6,947
143
function [X, clabel, cfg] = simulate_coupled_oscillations(cfg) % Simulates two datasets with coupled oscillations. This is useful for % multivariate regression scenarios such as CCA. % Simulates EEG-like oscillatory data consisting of a superposition of % narrowband sources (typically serving as signal sources) and b...
fe351444ad589c1ceb33ef12e1bc34dfadbe032b6b09f0180d8bf6191e20b083
MATLAB
6,949
186
%% Create mea tables % Creates tables compatible with % compute_allregion_AFR_table_at_P1s_203011.m ultimately for creation of % connectivity movie. % In order to use, directories must be populated with matlab variables % conaining wave_clus cluster_class variables. different files need to be % created for feedforward ...
99ecdbab4cdb82a3681dfad11a314105952d78415f7b61bd5391eb4bdddad09d
MATLAB
6,953
177
%dsRfAnalysis. This scripts computes keye outputs and parameters of %responses to drifting grating and sparse noise stimuli. Uses as input %'..._parsed.mat' file. %% CLEAR MEMORY AND LOAD DATA clear; clc; close all [fileName, pathName] = uigetfile('*.mat', 'Select parsed .mat file'); if fileName == 0 err...
70fb55e7a14e4fe05c68274fc40886a464286481f8d39396868df0a195e87cf6
MATLAB
6,954
179
function [zeropad_table1, zeropad_table2]=zero_pad_table_210804(table1,table2) % Zero pads two tables with identical fields % Assumes Combine has been run first so the two vectors are of equal length % and the spikes are ordered acending if all(~ismember({'Subregion','Electrode Pairs','Spike Area','Conduction Time',...
1d111f7004b97f8aca496d6fa8c9a526e50c86042a4d9d0326ce1957fc1f9066
MATLAB
6,958
268
%% Single cell PSTHs clear;clc [task_info,supPath,MaestroPath] = ... loadDBAndSpecifyDataPaths('Vermis'); PROBABILITIES = [25:75]; req_params.grade = 7; req_params.cell_type = 'CRB|PC'; req_params.task = 'saccade_8_dir_75and25|pursuit_8_dir_75and25'; req_params.ID = 5000:6000; req_params.num_trials = 120; req_...
b8cad2ae55dd775e6387c468f8aa12f8470e91306afb317b48c4728da4448090
MATLAB
6,965
176
%% Frequency in bins clear clc close all % parent_dir="D:\Brewer lab data\HFS\No Stim\Wells_5SD_500maxSD"; parent_dir_nostim="D:\Brewer lab data\HFS\no stim\Wells_5SD_500maxSD"; parent_dir_theta="D:\Brewer lab data\HFS\Theta Stim\Wells_5SD_500maxSD"; parent_dir_HFS="D:\Brewer lab data\HFS\HFS Stim\Wells_5SD_500maxSD";...
ee4497a48d0452295d792b36173aec50a3546607083a70c0392458a1bae2e36e
MATLAB
6,966
178
close all; clear; clc; addpath('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BasicFunctions'); addpath('\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\BipolarCellTerminal\Analysis'); MainPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\NaturalSceneVideo\Analysis\'; load([MainPath 'Re...
bd16f9147e7b2102b837337bc9e9670439f92ff482714195b1747ff173a260ff
MATLAB
6,975
224
function [subj] = set_mat(subj,objtype,objname,newmat,varargin) % Updates the MAT contents of an object % % [SUBJ] = SET_MAT(SUBJ,OBJTYPE,OBJNAME,NEWMAT,VARARGIN) % % Updates the MAT contents of the object of OBJTYPE type called % OBJNAME with NEWMAT. Does lots of error-checking to try and avoid % possible problems % ...
6eb1b658d5605ea5ad87ef0a2a3d22683102632004aa18eaa99309cfb7926518
MATLAB
6,999
185
%% STABLE ANTI-PHASE CYCLE IN THE PARAMETER SPACE (C1,C2) or (C1,epsilon) %% SETTING clear Path = [pwd, '\ML_sims\']; rng(13) % seed % TIME T = 1200; % time span dt = 0.01; N_eq = 2; % number of equations % PARAMETERS g_Ca_0 = 4; g_K_0 = 8; g_L_0 = 2; E_Ca_0 = 120; E_K_0 = -80; E_L_0 = -60; phi_...
5012e08bd3246b5cd5b888c3064a66bd8005ffc3fc021f0d4af3431916165f0f
MATLAB
7,011
205
function [anova_subregion,anova_ff,anova_fb]=axon_stats_211110(ff_table,fb_table) %get number of subregions subregions=unique(ff_table{1}.Subregion,'stable'); for i=1:length(subregions) current_subregion=subregions(i); num_axons=0; axons_per_tunnel=[]; conduction_times=[]; for j=1:length(ff_table)...
09d943bf40702108f9d7e792349b947624e5b8ff46eb3ad07b6599c81687cc66
MATLAB
7,017
229
function [Ehat, Phat, Phat_source] = modelClosedloop(K, I, head_vel, target_vel, ... light, sine, pc_stim, N) % Optional: to simulate a population of PCs, provide a matrix for K.PH and/or K.PR. % Each col is a cell, rows are filter timepoints ncells = size(K.PH, 2); % Optional: add noise in visual pathway if ~exi...
0a6228ad4853b781d730352693526f907766b46aeb56aeca82abe0331fbbab08
MATLAB
7,019
229
function awsCopyFileFolder(source,dest,v) %This function copys files and folders to from/aws if ~exist('v','var') v = false; %Verboose mode end if isempty(source) || isempty(dest) error('source: "%s", dest: "%s". Cannot copy an empty path'); end %% Set Credentials awsSetCredentials (1); %Write cr...
828b598ff16f9934cdb50eee88d2b6cee0b97047c37d7ec15b50f3e8a6497416
MATLAB
7,023
213
% 1. Add the path of the current script to the search path % 2. Change the current folder to "Fig7 and Supp Fig7 8 Airpuff_map plasticity" % 3. analyze the data within the subfolder of "Fig7 and Supp Fig7 8 Airpuff_map plasticity" % which is WT control, WT tetanus, SK2 tetanus, or CaMKII tetanus % 4. click "Run" t...
e9e5f7b439804ab0ef86fac82ff191e33abf82153f8ec75ccff34552c815a1c3
MATLAB
7,037
157
%% Extract video oding information needed for pre-processing of the data % Check if variable Video_Codes_perP exists already. If yes, load it. if exist([output_dir output_general 'VideoBasedMarkers\Video_Codes_perP.mat']) == 2 load([output_dir output_general 'VideoBasedMarkers\Video_Codes_perP'],'Video_Codes_p...
cd43c9e120f3deb02d3d988a5c540185f5ba7180648192cd9bb9a9151dbd80c1
MATLAB
7,050
196
% Preprocessing unit test % % impute_nan tol = 10e-10; % Get default parameters param = mv_get_preprocess_param('impute_nan'); %% block of Nans at beginning and end of matrix clabel = ones(5,1); X = magic(5); X(1:3,1:2) = nan; X(end-2:end,end-1:end) = nan; param.impute_dimension = 1; param.method = 'forward'; [~, X...
c02572a996bfb38568af8ba6587e8d86f335f3fcced59e9b48fed548c9074fc5
MATLAB
7,067
213
% PrairieLinkRawDataStream % ======================== % Convert and save raw data on-line % Lloyd Russell 2016. Optimised on 2017-03-10. Added 'GUI' on 2017-04-11 % % To do: % ------ % * Fix first run bug - very first tim e running does not connect to PV % * Header could be improved by containing bitdepth, and ...
e2f763f494128ca88afba3e7edf697c6f7bafb50c17c6a5a2d9d2b71d18dd912
MATLAB
7,069
197
% STATUS: Inactive % split into single and multi groups. % new. Use trials from dcNew var function plotPerformanceVsTimeAllChns_MultiOnly(sbjNum,fileName,fileDir,featureName) % channels pruned stored in mlActAuto var %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Exp...
20560d91eebf4e1b4642c9b92528d69958593caf77a4c784d29afb1d1e45ef46
MATLAB
7,072
185
function [freq, freqnoise, params] = simulate_data(opts) ndip = ft_getopt(opts, 'ndip', 50); phs = ft_getopt(opts, 'phs', pi/4); amp = ft_getopt(opts, 'amp', 0.4); % magnitude of correlation snr = ft_getopt(opts, 'snr', 0.5); % SNR parameter for simulation sensor noise versus emptyroom signal...
4b8dd472dbad7881e823ca0d7d0182316e97e7bb25ebb540825e35b49bf6427e
MATLAB
7,106
195
function scGenerateHistologyInstructionsFile(stackConfig,outFilePath,iterations) %INPUTS: % stackConfig - can be stackConfig structure, or file path to stackConfig % outFilePath - where to save file, file format can be pdf or txt % iterations - optional, specify which iteration of sending the sample to % ...
84ad8ed3db74dde88f6750d7748043c8c6d264b255a635848b085f257af944e0
MATLAB
7,107
84
function [spon_areas_table_ff,spon_areas_table_fb]=split_table_fffb_211130(spon_areas_table) spon_areas_table_ff={}; spon_areas_table_fb={}; for i=1:length(spon_areas_table) if strmatch('up_times',spon_areas_table{i}.Properties.VariableNames)~=0 spon_areas_table_ff{i}=table('Size',size(spon_areas_table{i})...
0e6f031e2977ba442e114a6f2b159e97af5a973ae462bf239971e14e7406b75e
MATLAB
7,108
190
function [lfp] = bz_GetLFP(varargin) % bz_GetLFP - Get local field potentials. % % Load local field potentials from disk. No longer dependent on % FMAT/SetCurrentSession. % % USAGE % % [lfp] = bz_GetLFP(channels,<options>) % % INPUTS % % channels(required) -must be first input, numeric % ...
fee11055e773621aebf3d45ea4545f0d68e647c0055ee367342b906be8fe5311
MATLAB
7,120
204
% figure 2C & 2S2: measuring mirror-symmetric viewpoint tuning index in % trained/untrained networks % last update: October 24 2022 % Amirhossein Farzmahdi clear close all clc % fixed random seed for regenerating same result seed = 42; rng(seed) % add path addpath(genpath('functions')) % set the directory images_dir...
7bb2ce1d93d876db3e0f39a4f5dd4392dbffb93b2ce2deee0d8e96e361c9d8b0
MATLAB
7,121
188
%% EXAMPLE OF CONTAMINATION ANALYSIS % This script analyzes the spectrogram correlations between and audio file % and a brain recording files. Both files should be MAT-files with a % defined structure called RecordingMatfiles (see files in 'Test data' % folder). 'Data_preparation_example' script shows how to create th...
b244b1580b125dee40770c1e48c70d393e91af7d2895642bc3fc51ec556d875c
MATLAB
7,124
204
% figure 2D & S2: measuring mirror-symmetric viewpoint tuning index in % trained/untrained networks % last update: December 23 2023 % Amirhossein Farzmahdi clear close all clc % fixed random seed for regenerating same result seed = 42; rng(seed) % add path addpath(genpath('functions')) images_dir = 'mat_files/'; % ...
5f86df6621748bbccbffbc2b9128c70f89dfc4c5db1d0724d285d1aa2431f7c9
MATLAB
7,127
193
function sleepSeries = doSleepDet2(data, epoch, V, P, C) %DOSLEEPDET2 detect sleep episode in actigraphy DATAINMIN % % REF.: [1] Cole et al. Automatic Sleep/Wake identification From Wrist % Activity. SLEEP. 15(5):461-469,1992. % [2] Jean-Louis et al. Sleep estimation from wrist movement % qua...
428fdfec6c34806bef9c40b9183650769422db9f440db2053de0251092b007f9
MATLAB
7,133
203
% Create block regressors to calculate betas for each condition for the % HAXBY 2001 dataset % % Kai, 2014/09/08 % note: subj 5, run 9 (=chunk 8) has only rest condition, so we throw this out %% very basics function matlabbatch = level1_ruwise_all_classes(sbj, runjob) if ~exist('runjob', 'var') runjob = 0; end ...
9aed5e81020d2e7a4a1e77f8d06065f935cc1c42d4a97d8faa9a8aa0bbecac34
MATLAB
7,136
215
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = 'Cumulative Sum';numRept = 5;numClasses...
34f9ab6a4a8630f6b7d5a2cf630bc95834d9e09c8c8fb4639487ae612aca971b
MATLAB
7,146
180
% Tutorial script for predicting the EBC data - "Introduction" Version % % This tutorial will guide you in a step-by-step fashion through some % of the analysis necessary to recreate one of the Princeton EBC % Team's submissions to the competition. This tutorial is geared fro % those who have never seen the MVPA toolb...
c2496d7fb593b6c232d1cd1b3624366432e0d8789b7361096693fa0cd1497d7a
MATLAB
7,154
192
% split into single and multi groups. % new. Use trials from dcNew var function plotPerformanceVsTimeVarName(sbjNum,varName,fileName,fileDir,featureName,timePt) % channels pruned stored in mlActAuto var %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2st...
aadc4f2d14c768f65edc6103449ffe28e166b256fee85394b380f90d21071eab
MATLAB
7,165
199
function [subj] = create_xvalid_indices(subj,runs_selname,varargin) % Creates a selector for each iteration for leave-one-out cross-validation. % % [SUBJ] = CREATE_XVALID_INDICES(SUBJ,RUNS_SELNAME,...) % % Adds the following objects: % - selectors group with nRuns objects, called NEW_SELSTEM % % Each iteration has a s...
4470dfa156c48c65c5275029221b6f3b28e7b1bbe34a8958dd8c7d609559893d
MATLAB
7,169
256
function [Xr,NN_MF]=DBDNMF(X,M,s,options,k) %%% X:[n m] % Code for DBDNMF: A Dual Branch Deep Neural Matrix Factorization Method for Drug Response Prediction % inputs % -- X: an n by m matrix with missing entries (m variables, n samples) % -- M: binary mask matrix for X, 1 indicate observed, 0 indicate missed % -- s: n...
8f7e21c5b6147bc0d87814402992fff5404b7ba234c2669dc39aa0382dea8032
MATLAB
7,177
223
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = 'Cumulative Sum';numRept = 5;numClasses...
bd526a8e5a175744dc16d616e058f3ee9530886a1045795a19b83e01e4a1fb58
MATLAB
7,181
192
function [update] = ... polynomial_expansion_registration2d(moving, fixed, varargin) % POLYNOMIAL_EXPANSION_REGISTRATION2D Estimates a displacement field using polynomial expansion % % INPUT ARGUMENTS % moving - Moving image % fixed - Fixed image % % OPTIONAL INPUT ARGUMENTS %...
adabde88d7ff7a5d6057f31c3fb61924478ad07d792fc6138405f1e1ece34200
MATLAB
7,186
267
% show the angle distribution np = size(Y, 1); ndim = 3; rng('shuffle'); ChooseClip = 1:11; %% for axes alignment cids = Qual < qualthr; %% Surround nIter = 1000; gSize = 90; % a = CSctr; a(cids) = nan; b = BSctr; b(cids) = nan; targetv = log(median(a(:, ChooseClip)./b(:, ChooseClip), 2, 'omitnan')); ...
bed744757c441158c087eba27782a9456fe75d4fa0d1814368407791f3c58625
MATLAB
7,187
273
%% Behavior figure clear [task_info,supPath, MaestroPath,task_DB_path] = ... loadDBAndSpecifyDataPaths('Vermis'); req_params = reqParamsEffectSize("both"); lines = findLinesInDB(task_info,req_params); cells = findPathsToCells (supPath,task_info,lines); behavior_params.time_after = 1500; behavior_params.time_b...
15758387a2fdbfd93227775803883569766eb5d769165e6ba640819199f7fc2a
MATLAB
7,201
172
%% simulateCameraCalibrationData.m % % This script simulates camera calibration data to validate the calibration % script on. clear all; close all; clc %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ % Parameters % path to the folder containing the calibration stacks outputdir...
9e91394daa93a4840ee5f9d4f47b6343cb10af8631bb8f7d73be0a4c7ea85e28
MATLAB
7,204
165
%This script turns the data into a csv for data analysis in r %finding path to statistical analysis folder current_path = pwd; parent_path = fileparts(current_path); if ismac csv_save_path = strcat(parent_path,'/Statistical_analysis_R_studio/data/'); else csv_save_path = strcat(parent_path,'\Statisti...
36420eb1a755f914fdc2c7b9774491e88e1c44fafdd67fde176f6283441d5097
MATLAB
7,217
193
% STATUS: experimental. % Not for publication. % % SYNTAX: % preprocessFNIRS06_CV_ssBeta(sbjNum,rawDataFN,respData) % % DESCRIPTION: % Set SS Beta a priori to 1. No GLM fitting here. % % RESTRICTION: % Only for sbj 08 and 10. % % INPUTS: % sbjNum - subject ID. 2-digits string. Ex: '08'. % rawDataFN - 1xN cell array...
59de66fe6e69a441a629fbb89a7e02652afc73b849e82d938a29266aa5910c8a
MATLAB
7,238
232
function [] = zeroify_write_afni(allvols,sample_brik_name,new_brik_name,varargin) % Writes out BRIKs using the zeroifying method % % [] = ZEROIFY_WRITE_AFNI(ALLVOLS,SAMPLE_BRIK_NAME,NEW_BRIK_NAME, ...) % % This takes in one or more volume's worth of data (x y z t) % and the filenames for the BRIK/HEAD pair that you wa...
8a473c9d2db7f2cff7c6a3673a3578e7257d13c07e838a961a6dc1f5769f0eb8
MATLAB
7,268
189
%% Main Flow Tracking Analysis Script % The goal of this analysis is to track actin dynamics in actin % fluorescence movies using Optical Flow and Crocker-Grier Least-Squares % Minimization Particle Tracking. clear % close all clc %% %% Global parameters %% % File Detail Parameters pxPerMicron = 9.35;%15.38;% fo...
1d1890ff97790d425ac29fa5e764fb83433d2b4987739908ff090feba3cef781
MATLAB
7,275
291
function setup() global h global nSteps global dirnameSrc global dirnameDst try currdir = filesepStandard(pwd); h = waitbar(0,'Installation Progress ...'); [~, exename] = getAppname(); setNamespace(exename) dirnameSrc = currdir; dirnameDst = getAppDir('isdeployed'); ...
5bdb8f6652148fd4b3e1ef44f0310218ead2f13416b2a385b7a96f5fc3dbe6b9
MATLAB
7,275
279
function file_content = tsvread(filename, field_to_return, hdr) % % Load text and numeric data from tab-separated-value or other file. % % USAGE:: % % file_content = tsvread(filename, field_to_return, hdr) % % :param filename: filename (can be gzipped) {txt,mat,csv,tsv,json} % :type filename: char ...
c034a4e01ef26508334dbe50960019ee5121724661aa1e175b900921753552ec
MATLAB
7,276
204
function [updateField, updateCertainty] = ... morphon3d(moving, movingCertainty, fixed, fixedCertainty, ... scale, varargin) % MORPHON3D Estimates a displacement field between moving and fixed using the Morphon % % [updateField, updateCertainty] = morphon3d(... % moving, movingCertainty, fixed, fixedCertain...
335850cfe00fab627e6ba0c0d92cec6f3629c164d9b4ca8e35aa04852aff3e41
MATLAB
7,282
192
% Arithmetic average of HRFs % Light line color, plot ind HRFs % Different processing for sbj 08 and 10 because they use old SD design and % has both single and multi conditions % old codes function grpPlotHRF(sbjList) figSaveDir = 'C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\...
c1f4c803ace5f61dd0283125be20970f7fa4e4f00c8c2682a538eea0fc70f14b
MATLAB
7,290
197
% STAUTS: Inactive % split into single and multi groups. % new. Use trials from dcNew var function plotPerformanceVsTimeAllChns(sbjNum,fileName,fileDir,featureName) % channels pruned stored in mlActAuto var %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' n...
713adf76f5c03a97d2a772b001abc2632157e35f5fc112fa5bc9a3ad3ce6c030
MATLAB
7,309
200
%% EXAMPLE OF CONTAMINATION ANALYSIS % This script analyzes the spectrogram correlations between and audio file % and a brain recording files. Both files should be MAT-files with a % defined structure called RecordingMatfiles (see files in 'Test data' % folder). 'Data_preparation_example' script shows how to crea...
de9ad4f44cbd9034d4883ab3e85d182fcf8e5a00304cfd5e3361f619b1c6782e
MATLAB
7,310
186
% figure S6: measuring mirror-symmetric viewpoint tuning for Leibo and % alexnet models % last update: April 03 2023 % Amirhossein Farzmahdi clear close all clc % main settings ncategory = 9; nview = 9; nexemplar = 25; nobj = ncategory * nexemplar; ncond = 2; npc = 39; n = 227; m = 227; savefig = 1; % add path addpa...
a193bb15ab2ce3d3e6db89e3994ea0478116935534677b389fb33f85b310bf47
MATLAB
7,316
250
%FindRipples - Find hippocampal ripples (~200Hz oscillations). % % USAGE % % ripples = FindRipples(samples,<options>) % % samples filtered LFP (one channel). % <options> optional list of property-value pairs (see table below) % % ================================================================...
e7f4647de9d9acd599871b11567f7a62e65b5ba9a24bb58ba85d141a3cad0e3e
MATLAB
7,323
160
function [S, B, S_eye, S_pc] = ... buildLinearFitMatrices(I, head, target, hevel, PC, sines, light) % [S, PH_basis, EH_basis, R_basis, T_vel_basis, T_acc_basis,... % T_vel_step_basis, T_acc_step_basis, PE_basis, EP_basis] = ... % buildLinearFitMatrices(I, head, target, hevel, PC, sines, light) % % Takes the time domain...
233c1f9387be703b03e617f45c849781fcf1484b2d25e7a543930c3ddc3fca45
MATLAB
7,327
258
% Detect red and blue LEDs position in a video file and creates a 'led' file % % USAGE % % Process_DetectLED(videoFile,<options>) % % videoFile path to Basler video file, including the '.avi' % extension or not % <options> optional list of property-value pairs (see table be...
ae4e4cc6b92565c93edcf3d83c44202867a88a9ff31054e474a1e39c335989a2
MATLAB
7,352
307
% rgb.m: translates a colour from multiple formats into matlab colour format % type 'rgb demo' to get started % % [matlabcolor]=rgb(col) % matlab colors are in the format [R G B] % % if 'col' is a string, it is interpreted as % % [[modifier] descriptor] colour_name % % where % modifier is one of (slightly, normal, ...
bf8ad1e20e5ce3cb7adc113c021b33fdb15f4e52f0332276bbf6cb6151382e9d
MATLAB
7,363
179
%% Visualize slopes Well to Tunnel load("D:\Brewer lab data\HFS\Temporal Analysis\No Stim\AFR Output Full Index slide 10sLM\concatenated_source_table.mat") % pair=199; pair=find(AFR_table.fi==3 & AFR_table.well_names=="K11" & AFR_table.tunnel_names=="G10-u1"); row=AFR_table(pair,:); for i=1:3000 if i==2...
8333182e46d1b367c1a636d016a26c30ab5ff608d10b73ed095392dd00122e5e
MATLAB
7,371
157
function [CC_recon_ratio,CC_recon_FC_r]= CC_recon_marmoset_activity(W,X_RS,U,n_null) % (1) assess CC eigenmodes explain brain activity in marmosets % (2) compare the accuracy of CC eigenmodes against SC eigenmodes zX_RS = X_RS; % % ========================================================================= % % ...
130e22fbe7c3f9396ded15c13614381256ee19b5b5db687d53d65f0b8b19984f
MATLAB
7,382
212
function [ hfig ] = FieldSynthesisInteractive( mask, doshift, gaussianLineSigma ) %FieldSynthesisInteractive Create an interactive line scan demonstration of %field synthesis % % INPUT % mask - mask at the pupil, which is the Fourier transform of electrical % field at the focal plane % doshift - if true, shift t...
0254c81300394afd5c29b734f092234d452b2451d80780b6c2ddb7711419ac2a
MATLAB
7,389
265
function [deviations meanpats mean_deviations_per_cond] = plot_deviations_from_condmean(subj,patname,regsname,runsname,varargin) % [DEVIATIONS MEANPATS MEAN_DEVIATIONS_PER_COND] = PLOT_DEVIATIONS_FROM_CONDMEAN(SUBJ, PATNAME, REGSNAME, RUNSNAME, ...) % % Designed for debugging classification performance. It just runs %...
7555447a5d94e98a8db0d5a6597db1ed203ebbda7fef8a90a2c7776a9ed03e12
MATLAB
7,399
188
% Arithmetic average of HRFs % Light line color, plot ind HRFs % Different processing for sbj 08 and 10 because they use old SD design and % has both single and multi conditions % new codes, ignore grpPlotHRF function grpPlotHRF_Version02(sbjList) figSaveDir = 'C:\Users\mn0mn\Documents\ResearchProjects\spatailAttenti...
aea80899fba679937e033c4701431f382d1b1ca8ae2ba399550ce9748f6bcda6
MATLAB
7,401
217
% split into single and multi groups. % new. Use trials from dcNew var % option to re-run training and classifying or pull from saved data % sbjList is cell array of experiment "number". Ex: sbjList = {'01','02'}; % sbjList = {'08','10','12','13','14','15'};tInd = 8;featureName = 'Cumulative Sum';numRept = 5;numClasses...
c0a823e342819bb237e500e0a1cecefb8c882f2204622a6996a029e0922594e2
MATLAB
7,405
213
function check_registration() % CHECK_REGISTRATION Checks that the data struct registration is ok % % check_registration % % INPUT ARGUMENTS % N/A % % OPTIONAL INPUT ARGUMENTS % N/A % % OUTPUT ARGUMENTS % N/A % Copyright (c) 2012 Daniel Forsberg % danne.forsberg@outlook.com % % This program is free software: you can r...
3584d1fbefef59956e25df668241d3b6ea79388d445c76455667b7bb617b423c
MATLAB
7,425
312
function [errmsgs warnmsgs] = unit_class_ridge(varargin) % USAGE :[ERRMSGS WARNMSGS] = TEST_(type) % % This is a script that tests the functionality of the ridge % regression scripts, train_ridge.m and test_ridge.m It tests that % the function rejects bad parameters and runs the regression % through some basic test ...
cdc3a121ab7f280f21938c20412309c113855a52521503183f2d8e961b5c3009
MATLAB
7,437
275
%% Analysis of spatial information and exploration-dependent place cells % ZhouLab, iHuman, ShanghaiTech, 07/30/2021 clear all close all clc addpath(genpath('helpers')) addpath(genpath('Example_data')) load('Data_MS#6.mat') %% Pre-processing behavior videos to generate anmail moving trajectories % addpa...
1bb6d54a786c33ec462b67b4790178b2b864d7a8d1124cd69f3fe0ab8fc6f6b0
MATLAB
7,441
226
% fNIRS version function plotBands_fNIRS(sbjNum,saveOp) numClasses = 3; exportDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum) '\Figures\HRFs']; saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Exper...
92b0635d2f86c819aefcd652a07a9549b55eed61468597b139f8b6387ad451e5
MATLAB
7,448
165
% Extract single HRF from dcNew variable, the output of GLM fitting function % save to mat file. % All 4 basis, for sbj 12 and after. For 08 and 10, use createSingleTrialHRF_Updated_DiffBasis(sbjNum,respData,numClasses) % For subject 15, exclude first trial because first trial starts at 0.08s, % cannot get -2s pre-onse...
d66f49f0b34116cf165228988eb1ba3d42e9bfcabb4614c2ad85ba8ea553ebe3
MATLAB
7,462
167
function [ResBVC] = generateAllBVCResponses_FShuf(Res,ModMaps,varargin) % Batch function for generating BVC responses for all data, for randomised data, using . % % [Res] = generateAllBVCResponses_FShuf(cellIDList,ModMaps,DataIn,varargin) % % Inputs: Res - Existing results from getBasicSpatScores. % ...
3bcd67af5fc1a6b817ba346adaa15794065a0841f6c7d0099c60e1ab9222bd57
MATLAB
7,471
301
function Duszkiewicz2024_Figure_SingleRec_IsomapRaster % This script reporoduces panels from: % Figure 7, Extended Data Figure 10 % run in folder A3706-200313 to reproduce the manuscript figure % Dependencies: % TStoolbox % CircStat toolbox % TODO: script dependencies, links to external functions % Copyright (C) 2...