sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5415a92e093ab58cec1cf189f8671fc08a391bb2894df46e9f22f5463066ce92
MATLAB
18,227
412
function [out] = ro_freq_meeglet(dat,cfg) % meeglet (ver 1.0) % Denis Engemann & Jörg Hipp, Feb 2024 % % Log-spaced frequency transform using Morlet wavelets for continous % electrophysiological signals. Derive power, covariance and various % conncetivity metrics % % % Input % - dat ... [channels x samples], set inval...
40314b567a3a37b6559450035204bfa43dea0d8af542319c2c12c593b9da0985
MATLAB
18,256
591
function SNRvideo = AddROI(video,name,masks,video_SNR) global CallBackInterrupted; CallBackInterrupted = 0; global IsPlaying IsPlaying = false; % Play flag, playing when it is 'True' global S; S = 1; global sno; global Rmin; global Rmax; global Img; global title_text; global alpha; alpha = 0.5; Tinterv = 100; SFn...
5189c3d571724fe4ff2ec13f2ef558a7a397667c5d1b07624d9c227dcbc428c7
MATLAB
18,258
453
function [UniqueIDConversion, MatchTable, WaveformInfo, param] = UnitMatch(clusinfo,param) %% Match units on neurophysiological evidence % Input: % - clusinfo (this is a struct that contains per unit the following information): % * cluster_id (e.g. kilosort output clus_id) % * Good_ID: ones for units that should be in...
28e27f17ac5a00eb2b251e9bf85df9dd66cf1e8706722b80eb15a7b3eb385295
MATLAB
18,281
416
function [] = C1_TFR_RFT(sub,av_type) %RFT TFR analysis %% Load clean MEG file % proc_folder='/rds/projects/j/jenseno-avtemporal-attention/Load/MEG Data/proc_data/'; %Portal % addpath /rds/projects/j/jenseno-avtemporal-attention/MATLAB/fieldtrip-20210328 %Portal proc_folder='Z:\Load\MEG Data\proc_data\'; %Windows add...
902a11309f741ce3975697ac4d886a3997769fd91318ba0620827171b17a7076
MATLAB
18,354
405
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % Run this code first. % This code computes the mfr and pfr for different occupancy thresholds and % then saves the results in folders needed by the other scripts. close all clear all clc % Paths run('../load_figure_config.m') INPU...
7f8da3c311e8180c1ffdcfbf35213b6a10fb00b4e85c0551cf07d7c049a72a9d
MATLAB
18,393
415
classdef TimeSeries < types.core.NWBDataInterface & types.untyped.GroupClass % TIMESERIES General purpose time series. % READONLY PROPERTIES properties(SetAccess = protected) starting_time_unit; % (char) Unit of measurement for time, which is fixed to 'seconds'. timestamps_interval; % (int32) Value is '1' ...
fb068ed745df7c505be67bff286038e22d460325ff74111d17d02f4db42561ae
MATLAB
18,417
304
% DATA ANALYSIS PIPELINE FOR FIBER PHOTOMETRY EXPERIMENT % Name: OptoDoseResponse_PooledMatrices_2023 % Cohort: PFC dLight1.3b with opto % May 2023 - Marie Labouesse, marie.labouesse@gmail.com % 1- POOLED DATA % loads FP data previously analyzed (with: OptoDoseResponse_DataExtraction) in matlab space "Individ...
475f82e8d0fe4374d6864e89a5386b0310d67a800f8ea7ec36db9200c7b94476
MATLAB
18,506
418
% saveLegStepParamCond_indpt.m % % Function that saves legStep parameters for all steps that meet the user % specified conditions on bodytraj % Treats all steps as independent, as long as bodytraj condition(s) are % met, unlike saveLegStepParamCond_bouts.m % Steps are included if at least for half their duration, th...
34565a3dbbbe55dddf805399b2ada16bcdcec458fb72c1ad5195b8a58ec57c9c
MATLAB
18,606
437
% heatmapMoveCondData.m % % Function to generate heat map of movement conditioned data generated by % moveCondPairData(). Similar to scatterMoveCondData() but as heat map, % plots the value of the dependent variable z against two independent % variables, x and y. Each value in heatmap is a mean of the values that % ...
60685b8f638b29293facb247f8e7b6e23742e73cb421a93b926ed9654fa2b6d5
MATLAB
18,632
604
function [] = ExtDataFig09_TuningCurve_OptStim_SongProb % Code for plotting the tuning curves in Extended Data Fig. 9e-g. GT = 'pIP10_Chr'; % GT = 'dPR1_Chr'; % GT = 'TN1_Chr'; % GT = 'pMP2_Chr'; switch GT case 'w_Chr' Target = [1,2]; case 'pIP10_Chr' Target = [3,4]; ylim1 = [-0.03,0.0...
93204c9e0c24cf764b2c0a7ad64dd7cb43a1cff5346f12141b3c16c958789efa
MATLAB
18,686
507
clc clear %% Loading the Data for Model Development % This code develops steady-state MCNN models for the cases when no noise % or a constant bias with / without Gaussian noise is added to true data to % generate training data % This code requires the MATLAB Neural Network Toolbox to train the % unconstrai...
0426ddcc16e768e10274d689e60a61a763df1510ebd6ccebac7bf5b2f487b6eb
MATLAB
18,688
437
function fH = makeSupplFigure6_compareLMMs(ds,roisToPlot,saveFigs,saveFigDir) % Function to reproduce supplementary figure 5: % Compare goodness of fit for different linear mixed models % % Main LMM: fixed ampl & condition effects + random subject intercept and slope for each condition. % LMM alternative 0: fixed ampl...
59f0c64f6b1ca90e07d53907822d4025c0917f7cacb9e188fef69992d1fe5618
MATLAB
18,690
501
function [HDR]=fltopen(arg1,arg3,arg4,arg5,arg6) % FLTOPEN opens FLT file % However, it is recommended to use SOPEN instead . % For loading whole data files, use SLOAD. % % see also: SOPEN, SREAD, SSEEK, STELL, SCLOSE, SWRITE, SEOF % HDR=fltopen(HDR); % $Id: fltopen.m 8776 2013-11-14 09:04:48Z roboos $ % Copyright (...
6d55e59412ae4b1632ae7bcb3e8499e16473761efd1873cc028c48969429b643
MATLAB
18,710
508
clc clear %% Loading the Data for Model Development % This code develops steady-state MCNN models for the case when a random % bias with / without Gaussian noise is added to true data to generate % training data % This code requires the MATLAB Neural Network Toolbox to train the % unconstrained neural net...
a465825770d2de87c08a60134c75843c43dd325e263838b1841d22e39b56f23e
MATLAB
18,782
474
% clc ManualMark_on=get(handles.cue_channel,'Value'); calmode=get(handles.calmode_pm,'Value'); switch calmode case 1 modeindex='data405'; cal=passdata.data405; case 2 modeindex='data470'; cal=passdata.data470; case 3 modeindex='data580'; cal=passdata.data580; ...
03922322d8044422452d8c5cbbb67687e79bace3e24f85cac987b7f51f268edb
MATLAB
18,810
422
function opt_out = simulate_1p_optical_propagation(vol_params,psf_params,vol_out) % opt_out = simulate_optical_propagation(vol_params,psf_params,vol_out) % % Function to simulate optical propgation through the simulated volume. % Generates the PSF and appropriate blurring representing aberrations % within the tissue. ...
c6c51eb44ce39f5af5e1a1cdb415d448a1d5de16fcc8357e711fd851e047d4c6
MATLAB
18,869
455
%% Script to load, preprocess and save blood MNIST images to .amat format close all clear all clc disp('Hello!') %% Cancer cells myDir = 'K:\PhData\bloodmnist\train\0'; myFiles = dir(fullfile(myDir,'*.png')); %gets all png files in struct total_length = 11959; imglinearlength = 785; final_file = zeros...
ce33833897f84662f9835ee34c400f95ce45ad6e080f38b310e05d7ba23ca24f
MATLAB
18,963
578
function dimord = getdimord(data, field, varargin) % GETDIMORD % % Use as % dimord = getdimord(data, field) % % See also GETDIMSIZ if ~isfield(data, field) && isfield(data, 'avg') && isfield(data.avg, field) field = ['avg.' field]; elseif ~isfield(data, field) && isfield(data, 'trial') && isfield(data.trial, fiel...
5050c2f12d910aad62a0c2fa0b26395133a2cf5ad11892749b1d5fe5689e333c
MATLAB
18,979
533
function [Out1, Out2, Out3] = fastica(mixedsig, varargin) %FASTICA - Fast Independent Component Analysis % % NOTICE! % THIS IS NOT THE ORIGINAL VERSION BUT A MODIFIED VERSION: % this one does not compute the icasig if this is not necessary (otherwise % there is no change, thus there is (should be) no change in behav...
7b7e4da2e540d867ebada41a5b9b3aa9ad25288e7171f7aae45470455c372f44
MATLAB
18,996
439
function all_Tcurves_correct_incorrect k3d=2;%1= k3d, 0=k_hor, 2=newk counter=0; av_unit=0; %fig2=figure; folder=[{'Glu32_19092017H'};{'Glu32_21092017H'};{'Glu43_22122017H'};{'Glu35_10112017H'};{'Glu35_13112017H_1'};{'Glu35_13112017H_2'}]; %folder2=[{'Glu32_190917a_20170919_'},{'Glu32_210917a_20170921_'},{'Glu43_221217...
168b4d65e1a6af5c42905e26161725b1e03912c733896d9911e0e2cbe4dc01cb
MATLAB
19,033
491
clc clear %% Loading the Data for Model Development followed by Partitioning % This code develops dynamic (hybrid parallel) MCNN models for the case % when a time-invariant bias with / without Gaussian noise is added to % true data to generate training data % This code requires the MATLAB Neural Network T...
d0f039ea59554a5366faf6736b53e97174899817aa8a5d4904d81ff48b8d2331
MATLAB
19,041
456
function result = stageFiles(img,recipePath,logPath,stageDir,varargin) % Assemble the files for one web-preview upload in stageDir % % function result = webupload.stageFiles(img,recipePath,logPath,stageDir,'Param1',val1,...) % % Purpose % Files written, under the names the server keeps (webuploa...
11e9b9634d13275db29f51cbc24f887962d2ba8165cb6091164e1ea5f97a1b13
MATLAB
19,150
371
function in = intriangulation(vertices,faces,testp,heavytest) % intriangulation: Test points in 3d wether inside or outside a (closed) triangulation % usage: in = intriangulation(vertices,faces,testp,heavytest) % % arguments: (input) % vertices - points in 3d as matrix with three columns % % faces - descriptio...
9305e0ea15e8396c8f9579e660a071e1c9ea5d8489417f9dc5bcd44b79f1944b
MATLAB
19,164
375
%% Clean-up clear; close all; % warning('off', 'MATLAB:print:FigureTooLargeForPage') % Specify parameters Options.directory = 'D:\JG\Project Gi-DREADD\Auswertung\P11_Emx1_NaCl\'; Options.lengthFOVid = 12; % number of characters specifying animal & FOV Options.timestamp = datestr(now, 'yymmdd_HHMMSS'); Options....
a510004d6d5290f92f69cc6466bf092abae746c13e453aee0bf0c13ea808fcf5
MATLAB
19,169
401
clear close all % % DirData = 'Y:\niels\Jianfeng\EEGDataScored\Matlab\'; % DirSave = 'Y:\niels\Jianfeng\Results\DetectedEvents\'; DirData = '/gpfs01/born/animal/niels/Jianfeng/EEGDataScored/Matlab/'; DirSave = '/gpfs01/born/animal/niels/Jianfeng/Results/DetectedEventsSpiNew/'; % DirData = 'Y:\niels\LunAMPASca...
ff49fdda4681d37ec9a76b3dbe6dafa9c52d67e63482ebe67d734be6a5c36281
MATLAB
19,187
416
function varargout = TDMS_handleGetDataOption(mode,optionsIn,metaStruct) %TDMS_handleGetDataOption Processes input options % % Shouldn't be called directly by user % % This function does some initial verfication on the types of inputs % that have been passed in. The second call generates instructions % on ho...
62f53236cfaf72d1a8258310cd566a6259340c67a4de16c81510fd68a5213687
MATLAB
19,197
462
classdef MLContinuousPlacemap < handle properties (SetAccess = private) % Copies of the inputs x = []; y = []; ts_ms = []; trace_ts_ms = []; trace_value = []; x_input = []; y_input = []; ts_ms_input = []; trace_ts_ms_input = [...
4a41e1ff64e5755d96de6137d07293276e3e1cc4602f72dbd0e9462245820a51
MATLAB
19,223
667
function fasticag(mixedsig, InitialGuess) %FASTICAG - Fast Independent Component Analysis, the Graphical User Interface % % FASTICAG gives a graphical user interface for performing independent % component analysis by the FastICA package. No arguments are % necessary in the function call. % % Optional arguments can be g...
ce1a4ee0d6e40269c03e2e93e0f19b15fad43e161c285dd188b750ab901415de
MATLAB
19,267
541
function spm_check_installation(action) % Check SPM installation % FORMAT spm_check_installation('basic') % Perform a superficial check of SPM installation [default]. % % FORMAT spm_check_installation('full') % Perform an in-depth diagnostic of SPM installation. % % FORMAT spm_check_installation('build') % Build signat...
e2d21a4009a0524568e07a4d78031380c3904bfd60e1d071593a55dc3d859948
MATLAB
19,274
390
function fH = plotDataModelFitSTRet_singleVoxel_StimulusConditionBlocks(projectDir,subjnrs,varargin) % Function to plot single voxel time series for each SEQ-SIM stimulus % condition. This function is used in Figures 2, 3, 6, Suppl figure 7,8,9 % in the paper: % % Title: Rethinking simultaneous suppression in visual ...
5fbd53bb8c2f043cf0067f77925274ba7eabfe38881b6d93612fde2e5fd84196
MATLAB
19,293
615
function [TR, TT, ER, t, info] = icp(q,p,varargin) % Perform the Iterative Closest Point algorithm on three dimensional point % clouds. % % [TR, TT] = icp(q,p) returns the rotation matrix TR and translation % vector TT that minimizes the distances from (TR * p + TT) to q. % p is a 3xm matrix and q is a 3xn matrix. % ...
8ea62ef9f1fd1cdf863d3ee969c704e68ae269224c07bf9a3fb135510c7b4d1e
MATLAB
19,363
442
classdef ImagingPlane < types.core.NWBContainer & types.untyped.GroupClass % IMAGINGPLANE An imaging plane and its metadata. % REQUIRED PROPERTIES properties excitation_lambda; % REQUIRED (single) Excitation wavelength, in nm. indicator; % REQUIRED (char) Calcium indicator. location; % REQUIRED (char) Loc...
1c5219626e3b7f82d85ba74ab6ce8a9bcc7bef2fef48b50a1df43502a45a9948
MATLAB
19,364
502
%% VOR_SineFit.m % Input: % data - dat structure with channels % 'htvel' % 'hhvel' % 'hepos' % 'vepos' % 'stim pul' % params.segStarts - time window start times % params.segEnds - time wndow stop times % sinefreq - frequency of stimulus for each segment % labels - label for each segment % time...
19373ad6074ec89285511db8a26c994f7031aaae1b9f581c5af372f114800d3f
MATLAB
19,404
425
function [Spikes,LFP,theta,nose,Fs, allo]=getSpikes(File, passNo); %function [Spikes,nose,Fs]=getSpikesOF(File, passNo); %getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct %2016 % %1. parse the data according to gaps in Timestamps (> 1s) %Session_str, e.g.,'20150906Thalamus36\20150906Thal...
1a7ca282c21f24e775974127325b11f927501d005d898ba20a8824cda1ae016f
MATLAB
19,413
581
function gui_cb(action) % % This file is used by FASTICAG % This file holds the callbacks to the main window % @(#)$Id: gui_cb.m 8776 2013-11-14 09:04:48Z roboos $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the main figure global hf_FastICA_MAIN; ...
8c174dad1ce6fb61ddfebb03a81f2d26fbf55c02b2f87db4ab4be922863799fe
MATLAB
19,413
481
% gaborWavelet - Function for computing gabor features of a gray-scale image % % This function calculates gabor features. Mean-squared energy & meanAmplitude % for each scale % and orientation is returned. % % There are potentially many arguments, here is the full usage: % % [gaborSquareEnergy, gaborMeanAmplitude] =...
0ab04681f53553b0ea93612a42f9f9f629057b24f8cbb41963b73018acbc7d02
MATLAB
19,501
490
classdef packsph < handle % Packing spheres % % Usage: % pc = packsph(); % pc.packing(maxdensity,hardwallBC,rinit,root,target,compileFlag,n,gap) % % Input: % maxdensity: maximal sphere volume fraction % hardwallBC: boundary condition, 0 for periodic, 1 for hard wall % rinit: cyl...
b561015806e7fe069b2665a8b19f247303eb7c10a59b463a3c34accf7b10fc9d
MATLAB
19,582
490
% extractOptomotorBoutsLegStepParams_fly.m % % Function that extracts turning bouts in response to optomotor stimulus % and saves leg step parameters during these bouts, relative to yaw % velocity peak. % Adaptation of saveBallLegStepParamCond_bouts(), which extracts turning % bouts in flies walking on the ball, wit...
d0da4e7a85d5cba1b833e5d1d235a9fb2154d36d762e7f2afd202b181362bdde
MATLAB
19,602
416
function varargout = TDMS_handleGetDataOption(mode,optionsIn,metaStruct) %TDMS_handleGetDataOption Processes input options % % Shouldn't be called directly by user % % This function does some initial verfication on the types of inputs % that have been passed in. The second call generates instructions % ...
56be5e75f4e29af777df49a45fdbb4f12f2dd3986bee5f68ffa429cfaf4a434f
MATLAB
19,622
463
%% Clean up clear close all clc imgshow = 0; addpath(genpath('J:\Data\Matlab')); %% Load file filepath = uigetdir; cd(filepath); allDat = dir('*.dat'); allData = {}; for aa = 1:size(allDat,1) inputFile = HEKA_Importer(allDat(aa).name); dataPart...
f68178df197754cb256cc052430a207c2d830c18523472203f6fb27432a75fc6
MATLAB
19,718
545
function [input] = ft_apply_montage(input, montage, varargin) % FT_APPLY_MONTAGE changes the montage of an electrode or gradiometer array. A % montage can be used for EEG rereferencing, MEG synthetic gradients, MEG % planar gradients or unmixing using ICA. This function applies the montage % to the inputor array. The ...
4e0960b6faf1335d6bfd925756c910712ed2d11e5bf90f497c7fc5bc86679c54
MATLAB
19,768
503
function [center, Cn, PNR] = initComponents_parallel(obj, K, frame_range, save_avi, use_parallel, use_prev) %% initializing spatial/temporal components for calcium imaging data %% input: % K: scalar, maximum number of neurons % frame_range: 1 X 2 vector indicating the starting and ending frames % save_avi: save ...
11923b2b0fe0f12ee1da5088d5015d8716290330cd5823db88892d280fcd221e
MATLAB
19,818
666
%%%%%%%%%%%%%%%%%%%%%%Beheaviour cd C:\Users\xic58kn\Desktop\singleton2\dataprocessed2 load behaviourProcessed acc_all2(:,1:24)=acc_all(:,1:24); acc_all2(:,25)=nan; acc_all2(:,26:30)=acc_all(:,25:29); rt_all2(:,1:24)=rt_all(:,1:24); rt_all2(:,25)=nan; rt_all2(:,26:30)=rt_all(:,25:29); stimInfo_all2...
9d00d7f5f429df0e67c8b7348056141b32db288694cb7a0be6e9b8dcf21027f4
MATLAB
19,822
386
%Averaging the data from the Unpredicted Reward experiment %Author:Maria Wilhelm %Clean the previous matlab sesion close all clearvars clc %give folder with matlab functions folder_with_matlab_scripts = 'Y:\Chernysheva Maria\MATLAB\Matlab_scripts_AlloLight'; addpath (genpath(folder_with_matlab_scripts)) ...
5630bdf98d1acd7c251037eb33ec87319c01ef8e4011fc9fdcc0dd8135e10957
MATLAB
19,826
522
%% SETUP clear;clc;%close all try [dataTable] = readtable('G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_C.xlsx'); expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\Jennifer Data Reorganized'; catch [dataTable] = readtable('D:\My Drive\Expmt Data\Max\...
6845905d33e7be876d4b543653c21cf15fbc3d2fb17bfa1e0cae6696b93af2ce
MATLAB
19,839
509
%% VOR_SineFit.m % Input: % data - dat structure with channels % 'htvel' % 'hhvel' % 'hepos' % 'vepos' % 'stim pul' % params.segStarts - time window start times % params.segEnds - time wndow stop times % sinefreq - frequency of stimulus for each segment % labels - label for each segment % time...
b9095372109389eb321c2b0f50e60b2b539313110468ef7106ffa583161f75ec
MATLAB
19,882
397
% opto tagged neurons modulated the stimulus-induced neurons BaseDir='OptoinducedFiles'; filelist=dir(BaseDir); Eventtype={'VonfreyInON','VonfreyUnON','InjuredON','UninjuredON','VonfreyInOFF','VonfreyUnOFF','InjuredOFF','UninjuredOFF','OptoTag','airpuffON','airpuffOFF'}; for i=3:length(filelist) tmpmat=matfile(fu...
2b0b9858b40e70a272cb5ac03cbf248e65ae0f8e30c673fdb3c58d5e7c5e63e8
MATLAB
19,952
441
function [Spikes,nose,Fs]=getSpikesEM4Tagging(File, passNo); % modified (ehud 2020) from getSpikesEM - for tagging PSTHs, in % scanTagging.m %function [Spikes,nose,Fs]=getSpikesOF(File, passNo); %getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct %2016 % %1. parse the data according to gaps...
8fec7b5d790c2808f48c5a45ef1de7e999b408971d6e78159480ce0f3d3e9218
MATLAB
19,953
441
function [Spikes,nose,Fs]=getSpikesEM4Tagging(File, passNo); % modified (ehud 2020) from getSpikesEM - for tagging PSTHs, in % scanTagging.m %function [Spikes,nose,Fs]=getSpikesOF(File, passNo); %getSpikesOF, modified from getSpikes to read OpenField data. ehud, Oct %2016 % %1. parse the data according to gaps...
6908dca0bc1123dc7f9d14aeb5913290a45cd3a7731094eed92fe3248648165b
MATLAB
20,001
583
% Function file: lsqfit % % [x] = lsqfit (fun, x0, xdata, ydata) % [x] = lsqfit (fun, x0, xdata, ydata, lb) % [x] = lsqfit (fun, x0, xdata, ydata, lb, ub) % [x] = lsqfit (fun, x0, xdata, ydata, lb, ub, options) % [x, resnorm] = lsqfit (...) % [x, resnorm, residual] = lsqfit (...) % [x, resnorm, residual, exitfl...
7714deaae24fc9b913defdcb063d40b4ed5e0b13a834d5495f1618bcf212f585
MATLAB
20,123
578
% Author: Zachary Chiang, Buenrostro Lab, Harvard University % Processes a single cell of in situ genome sequencing data function[] = expt002_cell(exp,condition,fov,cell,run,umi_file,primers,ligations) %% Manually set parameters %exp = "expt002"; %condition = "well2"; %fov = 30; %cell = 2; %run = "b1"; %umi_file = "...
ea1c040d4ca6220f9160c4970975f4c76593ed7385896d8753e061d0f2533da4
MATLAB
20,245
552
function VO = spm_write_sn(V,prm,flags,extras) % Write Out Warped Images. % FORMAT VO = spm_write_sn(V,matname,flags,msk) % V - Images to transform (filenames or volume structure). % matname - Transformation information (filename or structure). % flags - flags structure, with fields... % interp ...
2ff41755f6ea2cadc64d66896c379271e8be2c7e0942fc27041b3a3cc67d3bba
MATLAB
20,271
670
%% Passive Imaging Opto Script % Enny van Beest, January 2019. Script made for passive Imaging + Opto. %% Manual settings arduino = 1; %Arduino connected? MetaData = 1; %Metafile (Jason) saving? debug = 0;%Debug mode (i.e. Destkop computer is cogent screen) MovingGratings = 1; %if 1; stimuli move. If 0; stimuli don't ...
89637116de4370acf0d1629a2636839516fa323bbc8dc4a37cbb9bf73e304fd9
MATLAB
20,277
451
% extractFicTracOpto_fly.m % % Function to extract FicTrac values with optogenetic % stimulation. % Like extractContStepParamsOpto_fly(), allows filtering valid opto trials % by the fly's behavior (has to be walking before, during, and % after the stimulation) beyond move/not move and selects no stim periods % as ...
8f1ed393909481b7856703c6e5b6bb46ec13b0b28e97744d1a2fd8e98f6914d0
MATLAB
20,296
548
function [M,scal] = spm_affreg(VG,VF,flags,M,scal) % Affine registration using least squares. % FORMAT [M,scal] = spm_affreg(VG,VF,flags,M0,scal0) % % VG - Vector of template volumes. % VF - Source volume. % flags - a structure containing various options. The fields are: % WG - Weig...
608a8f0552a7c27fdf76322e4a0883b287e2af7285fc6b4269c762f076a21ce8
MATLAB
20,344
403
function [varargout] = read_plexon_plx(filename, varargin) % READ_PLEXON_PLX reads header or data from a Plexon *.plx 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). % %...
6a73ff8c43ece3ca97a906401bfd08054d860d6a0b7f3a9896320c8c364c8f44
MATLAB
20,370
443
%% Author: Jiri van Bergen and Xu Li % Affiliation: Radiology @ JHU - Kirby Center % Contact via xuli@mri.jhu.edu % Updated by Xu Li, 2019-07-09 % Updated by Xu Li, 2019-12-19 % Updated 2021-06-28 X.L., cluster version % Updated 2021-07-08 X.L. % Updated 2021-08-05 X.L., added unreliable phase mask2 % Updated...
4bacb360e080da18e09a0e3b1dcf6da5da9d46e7e12b6270b1d8ee601a9ca3cb
MATLAB
20,428
517
% visstimLegFictracOptoVInj.m % % Experimental Function % For simultaneous acquisition of leg video and FicTrac behavior data while % providing optogenetic stimulation by controlling the shutter in front of % the mercury lamp for the scope (light through objective) and visual % stimuli on the G3 panels that when in ...
4c8fcb926e1415ac914bdbc4583624af2ac1edd63d2ee269d275879733bb0e01
MATLAB
20,542
169
function [methodinfo,structs,enuminfo,ThunkLibName]=ceds32Prot %CEDS32PROT Create structures to define interfaces found in 'ceds64int'. %This function was generated by loadlibrary.m parser version 1.1.6.38 on Mon Nov 24 17:34:24 2014 %perl options:'ceds64int.i -outfile=ceds32Prot.m' ival={cell(1,0)}; % change 0 to the...
9affe355094f756cb9fe83a7d7fb06a77642368ca0c0eabf7354af27ca75aeb0
MATLAB
20,568
568
function results = spm_preproc(varargin) % Combined Segmentation and Spatial Normalisation % % FORMAT results = spm_preproc(V,opts) % V - image to work with % opts - options % opts.tpm - n tissue probability images for each class % opts.ngaus - number of Gaussians per class (n+1 classes) % opts.warpreg ...
4253ae25c1b2e9f0f6920fb4f95fd436a13c48d34ad9574e6a226858c9eeb9d4
MATLAB
20,596
464
%In vivo analysis code used to generate data in Figure 1 of Ryan et al., %2024. %Created by Michael B. Ryan 01/11/24 %% Compile neural data %Open the folder with corresponding plexon data cd(fullfile('Users','michaelryan','Documents','TRAP','Analysis','InVivo')) animals = dir; for i = 1:length(animals) ...
95638343c190dfdfa669a9b08559ddd9c959821c133bfbd3c77e3888c9bac91b
MATLAB
20,597
504
%%%%% Fix for unsorted units!! %%%%% close all clear all mouse='Thalamus25'; date='20150904'; CSCs=[1:7 10:16]; %Thalamus31 Thalamus25 % CSCs=[2:15]; %Thalamus36 Thalamus28 win=0.002; win_sum=0.05; baseline=0.05; n_cyc=12; z_Scr=2; %z-score figCount=0; for gg=1:length(CSCs) %% Laser %% ...
e314bcf1469e655ca3c3bea90576c8c8d1a9fb82dfe2a8ff3a5ad399fa296ea6
MATLAB
20,637
519
% visstimLegFictracEphysOptoVInj.m % % Experimental Function % For simultaneous acquisition of leg video, FicTrac behavior, and % electrophysiology data while providing optogenetic stimulation by % controlling the shutter in front of the mercury lamp for the scope % (light through objective) and visual stimuli on...
a8c20b1ecaa5b5987312f320753ab4404c81257e028a9249f092d863d7b9acf1
MATLAB
20,664
422
function fH = plotDataModelFit_singleVoxel_StimulusConditionBlocks(projectDir,subjnrs,varargin) % Function to visualize single voxel fMRI BOLD time series and model % predictions per stimulus condition. % % Show in the paper: % Title: Rethinking simultaneous suppression in visual cortex via % compressive sp...
7f2f9f04620d8c614e9b76b6fa48706920d2021758bb3d7ec652dcd4b0194d08
MATLAB
20,676
460
classdef MLSpikePlacemap < handle properties (SetAccess = private) % Copies of the inputs x = []; y = []; ts_ms = []; spike_ts_ms = []; % Either input or defaults boundsx = [];% boundsy = []; nbinsx = []; nbinsy = []; ...
feac505263611097578449465854e939c3edb2c2a22c58178a8f9a96076ec9ee
MATLAB
20,711
475
% extractKernels.m % % Function that takes in metaDat struct of selected trials and returns % linear filters, 1 per fly. Also returns mean and % standard error of the mean. % % INPUT: % selMetaDat - metaDat struct with only trials that will be incorporated % in this analysis % pdPath - full path to pData d...
a1fe9d30389b52329eacddc8c262fa7a52d81d3f1b2fcd528d1473c882203041
MATLAB
20,743
498
function varargout = cbires(varargin) % CBIRES MATLAB code for cbires.fig % CBIRES, by itself, creates a new CBIRES or raises the existing % singleton*. % % H = CBIRES returns the handle to a new CBIRES or the handle to % the existing singleton*. % % CBIRES('CALLBACK',hObject,eventData,handles,...
10955bfd88ee685bd8ecd75a0c04b408f346fb96903df3e47a483bda8be14666
MATLAB
20,793
455
function [sens] = ft_datatype_sens(sens, varargin) % FT_DATATYPE_SENS describes the FieldTrip structure that represents % an EEG, ECoG, or MEG sensor array. This structure is commonly called % "elec" for EEG and "grad" for MEG, or more general "sens" for either % one. % % The structure for MEG gradiometers and/or magn...
50afc2492d02d232863e795bba77dd0712f72b5f96ff3091d51224d0dc35effe
MATLAB
20,802
651
%% load data % run compute_coherency_table and then summarize_coherency_table before you % run the rest of this script. % % filepath = fileparts(mfilename('fullpath')); % cd(filepath); % compute_coherency_table; % summarize_coherency_table; % %% Figure 5C data = readtable('output/coherency_table.csv'); summary = re...
43cb78a7eed719076f7556e1f0c6e6a2293ef7a36a73b0864f8b0adffa2182af
MATLAB
20,831
443
function [BKR,s]=bkropen(arg1,arg3,arg4,arg5,arg6) % BKROPEN opens BKR file % However, it is recommended to use SOPEN instead . % For loading whole data files, use SLOAD. % % see also: SOPEN, SREAD, SSEEK, STELL, SCLOSE, SWRITE, SEOF % $Id: bkropen.m 8776 2013-11-14 09:04:48Z roboos $ % Copyright (c) 1997-2008 by Alo...
ca9732a24eb3072f16f1011f0e43ec0506098d0854964ff99c8124dcb0738a6a
MATLAB
20,978
446
% extractContStepParamsOpto_fly.m % % Function to extract continuous leg step parameters with optogenetic % stimulation. % This uses the continuous estimate of the step parameters using the % envelope method (legStepsCont struct) % Like extractLegStepParamsOpto_fly(), allows filtering valid opto trials % by the fly...
de66943f6d0c18b9dba659a33c30f24f8c47244d3946c0ee7da370b4fad40e37
MATLAB
21,070
603
function syncAndCrunch(serverDir,chanToPlot,varargin) % Pull data off acquisition system, pre-process, and send sample images to the WWW % % function syncAndCrunch(serverDir,chanToPlot, ... ) % % % Purpose % Perform tile index generation, pre-processing of images, and send preview stitched % images to the web. % % Set ...
ceb4537be2e27dcc5004769ed10efc717e578a6b2b7659318848b01d6d30e749
MATLAB
21,085
552
function save(this,filename,encoding) % Save GIfTI object in a GIfTI format file % FORMAT save(this,filename) % this - GIfTI object % filename - name of GIfTI file to be created [Default: 'untitled.gii'] % encoding - optional argument to specify encoding format, among % ASCII, Base64Binary, GZipBase6...
c197c47bb8b576bb677955f412d62db44222387c32f04fe06500d3091db6b9f0
MATLAB
21,091
466
function result = updateSectionImage(img,varargin) % Stage and upload the web preview for one section or run. Never throws % % function result = webupload.updateSectionImage(img,'Param1',val1,...) % % Purpose % Sends the last completed section image to the web site, or marks the start or end ...
eb1590598acf1498b61e0b50e87a68111c583d8c3bce50d5d290983917473ff4
MATLAB
21,117
490
function [unitPresence, unitProbaMatch, days, EPosAndNeg, DataSetInfo] = summaryMatchingPlots(UMFiles,UIDtoUse,groupVector,computeFuncScores) %% Settings PlotIndividualMice = 0; % Drifts2Exclude = 50; % more than 50 micron, expected to lose neurons. This has nothing to do with software but with quality of recordings M...
5d825da09f655f372029287fda9d4b9e87f364452b4689f01fecbc0e321746af
MATLAB
21,179
575
%------------------------------------------------------------------------------------- % plot_voltages_noamp.m % Generates a figure with % 1) Voltage of CX L2 neurons over time % 2) Average voltage of all CX L2 voltages over time (with no x or y axes) % 3) Voltage of two individual neurons in CX L2 % 3) Histogram of vo...
a9e60584b81ba774a6bcc4276cd9c6cac671b4fa6ab30e50b5659a58df65692b
MATLAB
21,221
933
clear all close all clc %% Rejection analysis values = 1002:4000; UG_Reject = []; for ii = 1:length(values); try name = ['Subject_' num2str(values(ii)) '_rejected.csv']; T = readtable(name); UG_Reject = vertcat(UG_Reject,T); end end %% rejection rate rejection...
ca56aca583e6162e68c01f376a53ab7fe560ec948092f51891ed4c65e9cb8a7d
MATLAB
21,302
474
% Uses bootstrap to evaluate the likely number of real peaks (i.e. modes) % in the distribution of a single set of data. % % -- Function File: H = bootmode (X, M) % -- Function File: H = bootmode (X, M, NBOOT) % -- Function File: H = bootmode (X, M, NBOOT, KERNEL) % -- Function File: H = bootmode (X, M, NBOOT, KERNEL, ...
a20fc76dc2b7f370e34faa2b4e07094180a6656a4cc19b23fc1e8938582223ee
MATLAB
21,353
529
function [tf, lthresh, uthresh, center] = isthisanoutlier(a,varargin) % ISOUTLIER Find outliers in data % TF = ISOUTLIER(A) returns a logical array whose elements are true when % an outlier is detected in the corresponding element. An outlier is an % element that is greater than 3 scaled median absolute deviati...
cdc831de491f6fc618374656489e20e51473b6e38d9c8483fa7992528da78313
MATLAB
21,364
537
%% VOR_SineFit.m % Input: % data - dat structure with channels % 'htvel' % 'hhvel' % 'hepos' % 'vepos' % 'stim pul' % params.segStarts - time window start times % params.segEnds - time wndow stop times % sinefreq - frequency of stimulus for each segment % labels - label for each segment % time...
cde60d8e7250e739b1fb89d995b86cfe5d37ed2c0fa0f5b4b66768f03b4e1656
MATLAB
21,372
539
function varargout = spm_jobman(varargin) % Main interface for SPM Batch System % This function provides a compatibility layer between SPM and matlabbatch. % It translates spm_jobman callbacks into matlabbatch callbacks and allows % to edit and run SPM5 style batch jobs. % % FORMAT job_id = spm_jobman % job_id =...
8f182da3449b1588211ccf06a666b18322283c0eb2320485cbf63363ffdd1852
MATLAB
21,388
690
function fh=st_plot_data_quality(cfg) % Copyright (C) 2022-, Roy Cox, Frederik D. Weber % % This file is part of SleepTrip, see http://www.sleeptrip.org % for the documentation and details. % % SleepTrip is free software: you can redistribute it and/or modify % it under the terms of the GNU General Publi...
d88ccfd1633038e64aaf9d39d3a8e24497bb5be9290929634d9ea8746dcc65c9
MATLAB
21,441
542
function singleRun_simSeqPRF_varySize_x_Duration_mainExp(subject,runNum,versionNr,loadTrials,offset,atScanner, coil, useEyelink) % Wrapper function to run a single experimental run of the % simultaneous-sequential spatiotemporal pRF experiment % % FOR USAGE BUTTON BOX at the scanner: % set trigger box to these options ...
d82b7c8290ff5f1d4ccaabe4e99e66e5490a6296c9454acbc2c1ad5a280f4358
MATLAB
21,540
577
classdef LinePlotReducer < handle % LinePlotReducer % % Manages the information in a standard MATLAB plot so that only the % necessary number of data points are shown. For instance, if the width of % the axis in the plot is only 500 pixels, there's no reason to have more % than 1000 data points along the width. Th...
8f7c04e555c6e2681d27f2e985db5c517a907e2785e415002ee3cbbaf6904a11
MATLAB
21,542
579
function script09_fods_dispersion(samplei,regioni,timei) % Compute FOD and some of its properties for all axons in the EM sample % % samplei = the index of the EM sample to analyze % regioni = 1 == cc only , 2 == cg only , 3 == cc+cg (combined) , 4 == cc and cg (separated at same run) % timei = diffusion time (ms)...
f20f6a460646e253491407a6de38ad260d1860397cc846791c6b73be9eaf140f
MATLAB
21,544
779
% ------------------------------------------------------------------------ % Method : ImportAgilent % Description : Import data stored in Agilent (.D, .MS, .CH) files % ------------------------------------------------------------------------ % % ---------------------------------------------------------------------...
0b36183ceb8849b0392d0d2b45c61511dc6d9ddbd2581702b8c65da401a3c109
MATLAB
21,584
490
% extractOptomotorFicTracOptoCond_fly.m % % Function to extract FicTrac values in response to optomotor visual % stimulus with optogenetic stimulation. % Adaptation of extractFicTracOptoCond_fly with addition of visual stimulus % Select all pData files for 1 fly through GUI % Saves output file with name defined by fi...
0a4d7d839be431aeba516349f33fbc878387dc9fa55a40caa071bf93cd414cbc
MATLAB
21,652
536
% Link tracklets (sequences) to form continuous trajectories (no more than % the expected number of flies indicated in calib) % % To link tracklets, use: % % trks = track_segment(trks, calib) % % where: % % trks - tracklets obtained from track_segment % calib - calibration obtained fr...
c45c32ef90b312c35549dc11a473203fa3f9d00a8f7cfdfd4b4b15a0b1155ad2
MATLAB
21,714
737
function bemcp_example % Simple function to test/demonstrate how the Boundary element functions are % used in combination with Fildtrip/Forwinv routines. % % 1. A model is created as 3 concentric meshed spheres (using FT's % icosahedron routines), % 2. then random electrodes are placed on the upper part of the outer...
bff4e2ee574429bf6bfa66036cf95e5ce7421dc2eb7333afe8102a99533ee744
MATLAB
21,804
495
% conditionedLegStepsFictracEphysIinj.m % % Function that takes reps extracted from % computeLegStepsFictracEphysIinj_1Fly() and returns only those that % meet the specified criteria: greater than or less than a threshold value % on the variable to condition on, during a time window prioer to % stimulation % Retur...
f4275d5b16cfad74f11131dd6124cae4dee1f840403a1d8d66e378a3fdfb76d3
MATLAB
21,948
524
function [AllWVBParameters,param] = ExtractParameters(Path4UnitNPY,clusinfo,param) % Prepare fitting Interpolate = 0; opts = optimset('Display','off'); %% Extract relevant information nclus = length(Path4UnitNPY); spikeWidth = param.spikeWidth; Allchannelpos = param.AllChannelPos; RecSes = clusinfo.RecSesID; if isfiel...
48c9aa89bdef6f88a5dcfa133fc3f058a729e7a1f04907ec12bff0efc6fde554
MATLAB
21,960
589
classdef LinePlotReducer < handle % LinePlotReducer % % Manages the information in a standard MATLAB plot so that only the % necessary number of data points are shown. For instance, if the width of % the axis in the plot is only 500 pixels, there's no reason to have more % than 1000 data points along the width. Th...
5a9430840f0642984c088ba729d0153ad42f65152ede2fd640407e64008e46d6
MATLAB
21,982
605
%# -*- texinfo -*- %# @deftypefn {Function File} {@var{yi} =} interp1 (@var{x}, @var{y}, @var{xi}) %# @deftypefnx {Function File} {@var{yi} =} interp1 (@dots{}, @var{method}) %# @deftypefnx {Function File} {@var{yi} =} interp1 (@dots{}, @var{extrap}) %# @deftypefnx {Function File} {@var{pp} =} interp1 (@dots{}, 'pp')...
9be1f548a563a9e0b1939f6a6e9480e68b1feabdd073b24d43665f0c6eff38ca
MATLAB
21,982
492
% extractFicTracIInj_fly.m % % Function to extract FicTrac values with current injection. % Like extractContStepParamsIInj_fly(), allows filtering valid IInj trials % by the fly's behavior (has to be walking before, during, and % after the stimulation) beyond move/not move and selects no stim periods % as deliberate...
b29b5a30080757aa20370b8b166bbf03fbb93e0b64c5602a257cc08b95847834
MATLAB
22,286
567
% getStimvolFromVarname.m % % usage: [stimvol stimNames] = getStimvolFromVarname(varnameIn,myscreen,task,[taskNum],[phaseNum],[segmentNum],[verbose]) % by: justin gardner % date: 03/15/07 % purpose: returns the volume numbers for the stimulus variable in stimvol and also % a string whi...
14a920e45ee116da3a06b32a015c34782752ac72c5144715bcffaa5e8c3d939b
MATLAB
22,308
572
function generateSimSeqStim_VaryConditionsMulti60Hz() % Function to generate variations of the sequential and simultaneous % presentation of square stimuli in the upper right visual field, as in % Kastner et al '98 (Science) and exp 1 in '01 (J Neurophys). Varations in- % clude: longer durations, more transients in seq...
99bd0c7f6f3286c7e807f867d5ad40d415ad56ed4b16509c0c14109a812b51b8
MATLAB
22,358
483
%Function to conduct an Fmax permutation test for one-way and factorial %within-subjects ANOVA % %EXAMPLE USAGE % >> GND = FmaxGND(GND, 'bins', 1:6, 'factor_names', {'probability', 'emotion'}, ... % 'factor_levels', [3, 2], 'time_wind', [500, 800], ... % 'include_chans', {'Fz', 'Cz', '...
99c82605b94ed22263bcb2034154c91e07aee0b84134262c13842288e2d2971a
MATLAB
22,394
607
function read_Intan_RHS2000_file(path, file) % read_Intan_RHS2000_file % % Version 1.0, 30 January 2017 % % Reads Intan Technologies RHS2000 data file generated by Intan % Stimulation / Recording Controller. Data are parsed and placed into % variables that appear in the base MATLAB workspace. Therefore, it is % rec...
943187c940c69bb96399e2e51ba01387176384b502bb58e98c25dc024929da0c
MATLAB
22,435
479
%Function to conduct an ANOVA with FDR correction across electrodes and %time points for one-way and factorial within-subjects ANOVA % %EXAMPLE USAGE % >> GND = FfdrGND(GND, 'bins', 1:6, 'factor_names', {'probability', 'emotion'}, ... % 'factor_levels', [3, 2], 'time_wind', [300, 900], ... % ...
a7a344a499d700dfad2ca9dc2b1c8791904b04af556621cd9e442436cc044f19
MATLAB
22,448
535
% This function plots figure 3 of Mackay et al. 2024 % (DOI:10.1038/s41467-024-52295-5) % % function figure3(alpha_resp, plot_visibility, ... % narrow_ylims, seed, no_overlaps, which_half, binned_test,... % read_from_excel, data_dir) % % INPUTS: % alpha_resp (numeric): Threshold for detecting neurons (defa...