sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b5196673b256616cb4a402a84d56f9e9709b4049341552a2f3b833b65389dff9
MATLAB
3,261
80
function plot_stage_burst_rate_band(br1_stage, br2_stage, channel_id, lbl_opt) %% Function: 'plot_stage_burst_rate' % DESCRIPTION % Plots burst occurrence rates of two conditions or groups per % frequency band, averaged over each task stage % USAGE % Full Input : plot_stage_burst_rate_band(br1_...
afa21d11168bc05ae826a7353d8d189bdfce7e00c4f99ff390bb3540bfda0a6a
MATLAB
3,262
74
function subject_power_2014_FD_only_parse_v3(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,varargin) % FD parsing Nipype wrapper pulling in list of motion files % Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store % values appropriately in the 51x51x3 cell array of structs % ...
a824477f6e55dd7d015fad5c82a7205de9aea29c3b6f0a3375648d0413dd48e8
MATLAB
3,264
98
%Test FclustGRP function % %AUTHOR: Eric Fields %VERSION DATE: 12 June 2020 global test_xls_output; if isempty(test_xls_output) test_xls_output = true; end %Load GRP FMUT_dir = fileparts(fileparts(which('A_setupTest'))); load(fullfile(FMUT_dir, 'testing', 'data', 'Disflu_GroupLevel.GRP'), '-mat'); ...
16a3005ae3c982053d0810e4251cdb20f8784a7e5f1fbdfb036a1ef9ef5def49
MATLAB
3,265
126
function [vol, M, tmpdcminfo, mr_parms] = load_dicom_series(seriesno,dcmdir,dcmfile) % [vol, M, dcminfo] = load_dicom_series(seriesno,<dcmdir>,<dcmfile>) % % Reads in a dicom series given: % 1. The series number and directory, or % 2. A dicom file from the desired series % % If the series number is given but no dcmdi...
cf4300837cf5e7384cb549294ea5d2dbdf1cce299f836f4c872267a1eb90e8c6
MATLAB
3,265
99
clearvars; clc; num_data = readmatrix("data_mod.csv"); Mean = mean(num_data, 'omitnan'); sd_data = std(num_data,'omitnan'); % Statistical analysis for 2 Hz stimulation data1 = num_data(:,5); data2 = num_data(:,6); % Combine the data and create a grouping variable allData = [data1; data2]; group = [ones(siz...
20dd0b03390ef88fa857e6ae041a23c9798c5db308c16f34bf3b9469406cb8d4
MATLAB
3,266
138
function hdr = load_analyze(imgfile,hdronly) % hdr = load_analyze(imgfile,hdronly) % % Loads analyze volume and header. The volume is stored % in hdr.vol. It is not permuted to swap columns and rows. % % hdr.dime.dim(1) = number dims % hdr.dime.dim(2) = number of items in first dim % hdr.dime.dim(3) = number of items i...
79576d4f0955001619356ad4393b9476389fe6691c495744492e1142765d5703
MATLAB
3,266
88
classdef ProcessingModule < types.core.NWBContainer & types.untyped.GroupClass % PROCESSINGMODULE A collection of processed data. % OPTIONAL PROPERTIES properties description; % (char) Description of this collection of processed data. dynamictable; % (DynamicTable) Tables stored in this collection. nwbd...
9e37693c7e779170e566ba6d42c7a43c290e6ac43d980c7c0320c7b0fca6df38
MATLAB
3,268
96
function [xnora dur amp durprot velprot set np durd]=cycdur(x); % cycle-based duration % values are for the cycle strting at the neg peak (np) % durd: finds neg peaks (np), compute the diff between them (in samples) % dur = interp1(durd) for the length of x % nora - x, where each cycle is normalized between 0 and ...
2232c9c134d7bacf1302a33b7fdc921977b98cf1849de4d80b670f38c115f0c3
MATLAB
3,269
85
% This script performs magnetic field computations for a single volumetric % ring with M wires and compares the result with the analytical % solution % % Copyright SNM 2018-2019 clear all; %#ok<CLALL> if ~isunix s = pwd; addpath(strcat(s(1:end-5), '\Engine')); else s = pwd; addpath(strcat(s(1...
f4c1b59dd1b2d000cf45f28a44a1c6445120c7e6606d8334afce96fa9b196459
MATLAB
3,269
93
function [m_out] = noise_suppress(m_in, maxall, Fs, nflag, filename) % batch version of anisotropic diffusion & background removal % Jinghao Lu, 11/18/2019 h = tic; if nargin > 4 && ~isempty(filename) msg = 'Overwrite post registered .mat file (data)? (y/n)'; overwrite_flag = true; % jud...
ceeada29f097af19e177fefc74e9690b4e86c58072b2fa1162817a6c3371bb7c
MATLAB
3,270
134
% This script will clean the data set %% Check for columns with no non-zero elements [l,w] = size(all_lesions); del_store = []; for col = 1:w non_zeros(1,col) = nnz(all_lesions(:,col)); if nnz(all_lesions(:,col)) < 25 display(['Less than 10% of entries for column ', num2...
d16dcffb8bb1bba0fe5c89c1af74c6149c93aa8d8e47d6f406022dbfcf8a5523
MATLAB
3,270
82
function saveSimulationParts(fullFileName) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Get basic data and load the .mat file fprintf('Loading mat file...') fileBase = fullFileName(1:end-4); m = matfile(fullFileName); fprintf('done.\n') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
e2064e5f07e51b550693ef2cdaf3442bf374f28a053f74ebf66033042538f9da
MATLAB
3,270
134
function plot_velocity_event(velo,ds_events,t,save_yn) frames=size(velo,3); num_ds=size(velo,1); med= median(1:frames); scaled_start=med-60; scaled_end= med+120; %% PLOT VELOCITY DURING EVENTS figure(99) clf set(gcf,'color','w') % SOM events --- x = linspace(1,frames,frames)'; y = squeeze(nanmean(velo(:,1,:)...
d353435b82637bae132991f088cdde3cbe6454e43db1f78c3f4c6f76bf68cc5e
MATLAB
3,280
98
function [labeledFrame avCount Av] = updateLabels(Av, labeledFrame, currentTime, currentClusters, prevActive, network, avCount ) t = currentTime; for i = 1:length(currentClusters) c = [currentClusters{i}]; % %first get the active parents parentcluster = getActiveParent...
a63e0e58da4a3c00e52401aa4051c0914eb6d7d63d55fe70d4cd78cec41f6534
MATLAB
3,282
78
function [psf,x,y,z,intensity] = gaussian_psf_na(na,lambda,sampling,matSize,theta,nidx) % [psf,x,y,z] = gaussian_psf(psflen,lambda,sampling,matSize,theta) % % This function provides a sampled point-spread function (PSF) for use in % the scanning simulation. Specifically, this function generates Gaussian % shaped PSFs...
77edfe2d6affa3cdf90b2a1930cfd9f4039e4f94af678b5faa7a56980c07f9c8
MATLAB
3,283
92
load 200128_10s.mat; load 200128_attention_weights.mat; %% Visualize attention weights color coded by the sleep states NREMepochs=find(y_preds==1); REMepochs=find(y_preds==2); Wakeepochs=find(y_preds==0); for i = 1:size(att_weights, 1) att_weights(i, :) = rescale(att_weights(i, :), 0, 1); end %att_weights = resha...
1abbf52e16fcf5d8b005f9c0ac6effb8e34bde942d891a06ec7748aebd5f2390
MATLAB
3,285
88
%confocal scan f_fin_0 = OPT_S.f_fin.*SC.mask_f_laser; fx_laser_0 = SC.ramps.fx_laser; fy_laser_0 = SC.ramps.fy_laser; fx_cam_0 = SC.ramps.fx_cam; fy_cam_0 = SC.ramps.fy_cam; %% confocal settings n_conf = FOV.n_conf; d_conf_x = FOV.d_conf_pix; d_conf_y = FOV.d_conf_pix; N_conf_x = 2*FOV.n_conf+1; N_conf_y = 2*FOV.n...
080d5ff7e12d1c983beae0f7f9df08b2e507e5fa3e8ef9838ebcfd54274cbd2d
MATLAB
3,286
88
% function invcompE(tol,N) % % tol is the absolute tolerance in ms % % Two event time (ms) values u and v are within tolerance if: % abs(u-v) <= tol % % A good value for tol is 1.2 ms % % The input argument N should be the total number of detections possible. % N is used in the calculation of TN. If no N argument is...
280e5e684fc33b7872f23191273f577b99d7a36783d4bb92b8b48e4a336a7119
MATLAB
3,287
114
% plotSpikesStepPhase.m % % Function to plot timing of spikes relative to leg phase, at different % time offsets between ephys and behavior. I.e., plots the output of % getSpikesStepPhase_cell(), but combining multiple flies. % One figure per delay; 6 subplots, 1 for each leg per figure % % INPUTS: % datDir - direc...
2ee9944f11894c78aa019a00e08d6d288d2841eff48efe552601cb1a9cfb5c4a
MATLAB
3,291
87
%% This script computes Membrane Potential (Vm) and Membrane Resistance (Rm) in CC_AS protocol Recordings % ================================================== % Authors: Arash Samiee, Knut Kirmse % last modification: 01/2023 % ================================================== % How to use: % (1) Specify paramete...
3817173cb36ec83f6b49dee72c1d432c85062327e879dc351f17267646ad2d3b
MATLAB
3,292
72
function [HiddenMarkovModels, info] = HiddenMarkovModel_trn_cross(emission_sequence_cross, number_of_states, number_of_start_condition, init, tol, maxiter, parfor_enabled,info, str_save_append) %% This function trains Hidden Markov Models (HMMs) using cross-validation. %% authors: Stefano Diomedi %% date: 22nd Febr...
9faba0faca0d038e072ce6646a003ea70e86ecd82280a95608b6b5f151eb4574
MATLAB
3,295
86
classdef Images < types.core.NWBDataInterface & types.untyped.GroupClass % IMAGES A collection of images with an optional way to specify the order of the images using the "order_of_images" dataset. An order must be specified if the images are referenced by index, e.g., from an IndexSeries. % REQUIRED PROPERTIES prope...
13dd3c2e2652e4bb307fa314f71c4f8ed37d3ebe7120992e22c6620d79400885
MATLAB
3,298
64
% %%creation of file containing three tables % % save tables from analysis % save('unitsTableOF_NoseO.mat'); % save('unitsTableOF_NoseDO2.mat'); % save('unitsTableOF_NoseV.mat'); % % load 3 tables and save in one file % load('unitsTableOF_NoseO.mat'); % load('unitsTableOF_NoseDO2.mat'); % load('unitsTableOF_Nos...
1e1fb9fa2735e3a97a18cbe23d48725809528d45cb0e98da37e4eea08170fdf8
MATLAB
3,298
118
% writeCFS.m % prompts to write a CFS file - needs all data to be available first % needs cfs32.dll and MATCFS32.dll % 06 Mar 09: version 1 jgc % 9 May 09: define other % 17 June 09: transpose vector if not correct dimensions INT1=0; WRD1=1; INT2=2; WRD2=3; INT4=4; RL4=5; RL8=6; LSTR=7; EQUALSP...
aaa025fa95397cc697304be88f7d8cdab3ce3b37813d604300b3b5e7dceb839d
MATLAB
3,298
75
function varargout = spm_brainwarp(varargin) % Part of nonlinear spatial normalisation - a compiled routine %_______________________________________________________________________ % [Alpha,Beta,Var] = spm_brainwarp(VG,VF,Affine,basX,basY,basZ,... % dbasX,dbasY,dbasZ,T,fwhm,VW,VW2) % V...
007a2c5e6594fc288cf8a93236e5adf9119e9523b93750c879733e16221bba71
MATLAB
3,301
64
function P = check_free_T(T_s,edges_s,edge_type,P) % check which triangles formed by spectrin bundles (edge_type = 0 ) do not have myosin % attached. P.myosin_Tfree = []; for l = 1:size(T_s,1) aux_e1 = find(edges_s(edge_type == 0,1) == T_s(l,1) & edges_s(edge_type == 0,2) == T_s(l,2)); if ~ise...
2abaff82aadf116c351f866ab79da090ddd447b0e3278d9e933c4a455c72a212
MATLAB
3,301
97
function [ACTIVITY, MOBILITY, COMPLEXITY,m0,m1,m2] = hjorth(S,UC,A) % HJORTH calculates ACTIVITY, MOBILITY, COMPLEXITY % % [ACTIVITY, MOBILITY, COMPLEXITY] = hjorth(...) % % [...] = hjorth(S,0) % calculates stationary Hjorth parameter % [...] = hjorth(S,UC) with 0<UC<1, % calculate...
d966afae9a343e4837f4b06b0bebc550444bf5b0d6c475a14d2694c80e39eb00
MATLAB
3,303
122
% plotContLegStepParamCond_bouts_ipsiContra.m % % Function to plot overlay of ipsi and contra legs for output of % saveContLegStepParamCond_bouts(), 1 file. % % INPUTS: % whichParam - name of parameter to plot % datDir - directory with output files % yScale - y scale for plots, as [min max] % semError - boole...
6a4d6fe2282066e97ce78750e14fdf18b99db38fe24eb43741f284acb125f81b
MATLAB
3,304
120
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_normal_bfo90_table_all(NormalBFO90, DaysToSessions) SessionsEarly = DaysToSessions(ismember(DaysToSessions.dayNum, [1,2]),:); MatchEarly = get_match_table_by_sessions(SessionsEarly, NormalBFO90); ...
3dce34b88be0a3f67531fbce03cbf0ccdba1cfa67b72bc7a2416d24c6a396c57
MATLAB
3,306
89
function out = toUint8(img) % Convert a gray (HxW) or RGB (HxWx3) numeric image to rounded uint8 % % function out = webupload.toUint8(img) % % Purpose % Pure (no I/O). The image must be at least 2x2: vectors and scalars are not images. % Classes: uint8, uint16, int16, single, double; others ...
4bf162d6b2741958bab0d515912a70567574f5a1dec631c4070b433d9c9a8a92
MATLAB
3,308
120
function [M_V] = vox2ras_ksolve(M_R, Vc_Ps, varargin) %% %% NAME %% %% vox2ras_ksolve.m (vox2ras_k{-space column}solve) %% %% AUTHOR %% %% Rudolph Pienaar %% %% VERSION %% %% $Id: vox2ras_ksolve.m 8776 2013-11-14 09:04:48Z roboos $ %% %% SYNOPSIS %% %% [M_V] = vox2ras_ksolve(M_R, Vc_Ps, Vr_logicalSpace) %% %% ...
b31ba8cfa6f03c04e6fdaa856b9035de0763ed848ae731a73e5117a9be59adc7
MATLAB
3,308
76
function subject_power_2014_FD_only_parse_v3_gaby(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count,varargin) % FD parsing Nipype wrapper pulling in list of motion files % Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store % values appropriately in the 5 1x51x3 cell array of stru...
3a1746f57f6c080ac57dd11536ffe85d21a19fd9b11845fb909bdca3af66ecb4
MATLAB
3,310
88
%Calculate the Greenhouse-Geisser, Hyunh-Feldt, or lower bound estimate %of epsilon at all time points and electrodes % %EXAMPLE USAGE % >> epsilon = estimate_epsilon(data, [], 3, 'gg'); % %REQUIRED INPUTS % data - An electrode x time points x conditions x subjects array % of ERP data...
0dfd30509e024e8103903e4b951d442f699d1b3d80545fbcf5811623e67e997e
MATLAB
3,311
102
% mglGetMouseEvent.m % % $Id$ % usage: mglGetMouseEvent(<waitTime>,<getAllEvents>) % alt usage: [buttons when x y] = mglGetMouseEvent(<waitTime>,<getAllEvents>) % by: justin gardner % date: 09/12/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: retur...
3204b9fc1a9fb3100326644ee6454aead61bbb3f2dec3ea3cbd49f548c8f2a97
MATLAB
3,311
114
% 1_190129_150035.rhs IS THE IN VIVO FILE %% Setup clear;clc;close all dbstop if error % Load file 19 11 31 3 folder = 'G:\My Drive\Expmt Data\MultiElectrode Data\In_vivo_Cerebellar_Vermis_Exp3and4\New folder'; % Remove everything that is not an .rhs file recFiles = dir([folder '\**\*.rhs']); % Window around Stim A...
3bdd683d38aff3395ec9c84bc83940cac12c1cf46d84f81f301d15a528b81178
MATLAB
3,311
105
function [nse] = read_neuralynx_nse(filename, begrecord, endrecord) % READ_NEURALYNX_NSE reads a single electrode waveform file % % Use as % [nse] = read_neuralynx_nse(filename) % [nse] = read_neuralynx_nse(filename, begrecord, endrecord) % Copyright (C) 2005-2007, Robert Oostenveld % % This file is part of Field...
7d362b8f7e4a59d8fa649ea44a09293a27ccbc60a4da3a0ef038348e49b81d6d
MATLAB
3,311
76
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [predictionDataset] = filter_prediction_dataset(predictionDataset, params) nRows = size(predictionDataset,1); nCellsBeforeFiltering = nan(nRows,1); nCellsAfterFiltering = nan(nRows,1); emptyRows = []; fo...
070050cd7278150066979fc05064131da92ea72c5210404783bcf09a8e3a8765
MATLAB
3,313
104
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Code for the numerical simulations and computational results % in the manuscript "Fibromyalgia pathogenesis explained by % a neuroendocrine multistable model" % by Ilaria Demori, Serena Losacco, Giulia Giordano, Viviana Mucci, % Franco Blanchi...
633f87694a5c3bc06b1f262e67c3e0ac776af6319a02accabba1142fe1e9c8f5
MATLAB
3,313
86
function result = filterI2MC(raw_data, opt) % FILTERI2MC Find the fixations in eyetrackingdata with the I2MC algorithm. % The function makes the algoritm written by Hessels et al compatible % with the functions used in this project. % The I2MC algorithm was designed to accomplish fixation detection in...
d12e7c58f0f8cbc71ba564efba9575c3b6459ac67a2d4a5b0888e0a031c23b49
MATLAB
3,313
47
% The script "demo_UFARSA_realData.m" applies UFARSA to the "sample_data.mat" file containing a number of fluorescence % traces (i.e. time-courses), which can be assumed to be extracted from different region of interests (ROIs). Simply run % this script and see UFARSA's spiking activity reconstruction results for th...
bdfe1b611025c049ff8447cde5d0386b447c210a94cc3047b2946daf7bc15f30
MATLAB
3,314
100
% This example takes in a hexagonal shape and varies the spacing from 0 to % a specified amount. The number of channels, brain sensitivity, and % spatial multiplexing groups are calculated for each spacing. clear all % Lumo modules probe.module = createModule(6, 18); y1 = 10; probe.module.srcposns = [0, ...
07a27f8907f6fa9c8c3da3da10518afdf0ea8f2369880d091926e45f64bfc383
MATLAB
3,320
92
function gretna_Sim_PDF_matrix(Data_path, File_filter, Npoints, PDFType, SIMType) %========================================================================== % This function is used to calculate similarity among different probability % distribution functions based on the Jensen¨CShannon (JS) divergence, % Kullback¨CLe...
21d5d21d7b371a33b6a78efc1f6f14f2ab4582bce5bda2443984ceff37a9b71a
MATLAB
3,320
131
function chi_S = SFCR_s_SB(deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, titermax) % chi_S = SFCR_s_SB(deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, titermax) % SFCR S-step using Split-Bregmen L1 solver % % Input: deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, x % DPWeight is ki...
dbcb0dc0be213f95c45bac86128ff05cb57933aae497503ad7d8ab93636557a2
MATLAB
3,320
96
% DeviceInit Loading MATLAB Driver for robotic device and initialization. % The script begins by loading the PI_MATLAB_Driver_GCS2, which is a driver for the PI GCS controller. % It establishes a connection to the controller through RS232 or TCP/IP based on the parameters set in the script. % The connection settings su...
5121c41865e647c591abf7a084bdf1af4f0019fe2d69902ac96577153775b260
MATLAB
3,323
153
function outmat = logic_truth_table3(EXP,idx,newfig,scale) NODEMULT = false; % use actual voltages LABELMULT = true; if nargin<2 || isempty(idx) idx = size(EXP.TestMeasurements,3); elseif idx < 0 idx = size(EXP.TestMeasurements,3)+idx+1; end idx(idx<0) = idx(idx<0)+EXP.MES+1; outputs = EXP.Te...
35622d0fba73810e8ee3d07d8e95d60b8c180dd3b11f2e8e24584b30be754465
MATLAB
3,324
131
% getTaskVarnames.m % % $id: % usage: [varnames varnamesStr] = getTaskVarnames(task) % [varnames varnamesStr] = getTaskVarnames(v) % by: justin gardner % date: 03/14/07 % purpose: returns all the names of the variables in the task % as a cell array (second optional o...
82c5296cba67b7dce07e64d9737bded7c1082b076ad94564fff354a618ef095e
MATLAB
3,326
114
close all clear all %% create figure 2G %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% fig set fs=16; lw=2; basevalue=0; %baseline of background color height=[.6]; %height...
aca93bd7162e94390e36da94d5c0891ae0f3cd0db345db36ab281ea5acbbcf2e
MATLAB
3,327
79
function exportFieldtrip( obj, filename ) % EXPORTFIELDTRIP Exports streaming data to .mat file that is readable by % the fieldtrip toolbox. % % NOTE: To export everything in the same file, we opted to consider all % used channels. This means that if a channel is only used in one of the % recordings, it will still be p...
70006600c97cbe9964ae27d9fb4714d4fa34ef80d9fc5bc00546bd5f4ef53471
MATLAB
3,328
93
function [siguse, roiuse, seedsuse, buse, bfuse, datasmthuse, cutoffuse, pkcutoffuse] = iter_seeds_select(m_in, mask, Params, P, options, flag) %%% variables initialization %%% siguse = []; roiuse = []; % buse = []; % bfuse = []; seedsuse = []; datasmthuse = []; cutoffuse = []; pkcut...
11c65c369096617e13190848bcc2e0a2c6d1ec497c5f54f21c8b6b61ec4c4774
MATLAB
3,332
69
classdef SequentialRecordingsTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % SEQUENTIALRECORDINGSTABLE A table for grouping different sequential recordings from the SimultaneousRecordingsTable table together. This is typically used to group together sequential recordings where a sequence of stimuli ...
82d2cfcdb6dccdc9bff1dfbadbc2de224659627ca8904a52db62423c48accbb9
MATLAB
3,337
104
% getNTLinLoc.m % % Function to generate digraph arrays for neurons' hemilineage, location, % and neurotransmitter (info for both nodes and edges) % % INPUTS: % ntCSVfile - full path to neurotransmitter CSV file % s - array of source nodes for digraph % names - array of node names for digraph % % OUTPUTS: % si...
55d4edcf155fee6e4d7f1aa332391804e7993c7891f4f6c2943e6d23dacc229a
MATLAB
3,338
88
function filt = filter_with_correction(B,A,dat,dir,usefftfilt) % FILTER_WITH_CORRECTION applies a to the data and corrects % edge-artifacts for one-pass filtering. % % Use as % [filt] = filter_with_correction(B,A,dat,dir); % where % B,A filter coefficients % dat data matrix (Nchans X Ntime) % dir...
7564238ae28b2fbcad16e7196bc870182bf00d03416a62340c4bfa8172b2bc4e
MATLAB
3,342
85
function nulldist(interval, perm) % NON PARAMETRIC SIG ESTIMATION OF SPEARMAN RHO COEFF % This script assesses significance of the correlations maps at the group level by pooling correlation % values across participants using Fisher's z-transform. By generating the null distribution at the group % level, it considers...
ef75c8767344524b9eec23172523de54b7390cad63cfe3e06028ee93b8863ed0
MATLAB
3,342
56
function [X_timespent_binned, X_at_spikes_binned, X_firing_rate, X_firing_rate_smoothed, prefered_X, Rayleigh_length, information_per_spike] ... = Arseny_gen_1D_tuning ... (X_video, X_spikes, X_bins_vector_of_centers, time_spent_minimum_for_1D_bins, frames_per_second, smoothing_window_1D,perform_circular_smoo...
3c54c64e1893fff3446cee0df5778cb6ced13fedae172e52f32ed3f1f76c746f
MATLAB
3,345
107
function [sel1, sel2] = match_str(a, b, fullout) % MATCH_STR looks for matching labels in two listst of strings % and returns the indices into both the 1st and 2nd list of the matches. % They will be ordered according to the first input argument. % % [sel1, sel2] = match_str(strlist1, strlist2) % % The strings can be ...
f15eb4dd554a0bcaef7886fd717e1fee0657fb2e51c5f39231070b863995dec1
MATLAB
3,345
119
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This makes Figure 2E. % % Note that the figures were post-processed in Adobe Illustator. close all clear clc % Paths run('../load_figure_config.m') INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER; OUTPUT_FOLDER = CHENGS_T...
088b79e61676f8a0c3bd32589a4a4183b69b42412a0607ab395da30ca8c6470a
MATLAB
3,347
101
function [fid, sens, label] = read_polhemus_fil(Fname_pol,skip) % Reads Polhemus files: % either sensor file or headshape file or both % % FORMAT [fid, sens, label] = read_polhemus_fil(Fname_pol,skip) % Input: % Fname_pol - Polhemus ASCII file containing sensor locations (cm) % (headshape can also be con...
4d699a63e24d4115c04ebfd741857c812be14890a9447cb31551c4e8b6e0e3f7
MATLAB
3,348
84
function [neur_ves,conn] = connToVol(nodes,conn,nv,idxs,neur_ves) % [neur_ves,conn] = connToVol(nodes,conn,nv,idxs,neur_ves) % % Function to add vasculature connectivity to a volume. Inputs to this function % are: % % - nodes - struct array containing blood vessel node information % .num - identifying...
600a5a1e3ff24968bc37f1073f94b70304d2704700e4a006fa76febb303fbe0a
MATLAB
3,348
78
function [] = plot_worm_frame_post_analysis(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, UncertainTips, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % IWFig = fi...
8cd986ddcea3efef1d944739d7a50f7852906874020ceef4cd2f1167af81f28d
MATLAB
3,348
85
%function stsum(x,y,STS,elec,unit,cc); function STS = rmap(spikes,y,y2,STS); % updates the STS global struct: STS.sts[], response map % input: % x, spike frames, % y, variable binned along x-axis % y2, variable binned along y-axis % if length(spikes)<2, return; end; globals; DEBUG = GDEBUG; if DEBUG>1, fig...
2ea72a2915d504cb1147371afdc2241f92bfd36f3bcb98213b76f8656a3b44d8
MATLAB
3,351
106
function [artifact] = detect_MA(data, bad_chan) % DETECT_MA % This detects motion artifacts with a moving average and is an adapted version from Homer 3: hrmR_MotionArtefactByChannel % The parameters are defined at the beginning of the function (tMotion = % 0.5; tMask = 1; std_thresh = 65; amp_thresh = 0.05) % % INPUT:...
a7af582a443306bf5e53046e4024feee7219cff7d3e61a0c7703128bc22275ea
MATLAB
3,351
99
function trajPlot(uspikes,Y,X) % presents spikes over trajectories of pairs of kinematic variables (X, Y) % Oct 2016, ehud. % globals; % pars %SHOW_TIME = [0,0]; %s, session time to show %MarkerSize = 8; Xin=X; Yin=Y; fnum = get(gcf,'Number'); % get entrance values hold off; if 0 fnum = get(gcf,'...
5d2369209f92c9f3c54584cf74b051c87b5c10b7ef1ca2744d28c9b121f61e56
MATLAB
3,354
88
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hc_group, prob_group, totalSamples, numCells, numSamplesExcluded] = compute_bfo_using_percell_table(PerCell, rotationsDeg, fieldNamesWanted, BFO90_MIN_MAPS, BF90_MIN_CORRELATION) fieldNamesPossible = {'any', 'context1',...
520ad99fcb43d29a95e93b1d189466574542b82907ede4cd7b25da91e6c29c66
MATLAB
3,356
71
function MD5 = CalcMD5(Data, InClass, OutClass) %#ok<STOUT,INUSD> % 128 bit MD5 checksum: file, string, byte stream [MEX] % This function calculates a 128 bit checksum for arrays and files. % Digest = CalcMD5(Data, [InClass], [OutClass]) % INPUT: % Data: Data array or file name. Either numerical or CHAR array. % ...
c1bad20b6489ddbde6d4b0faf8079122e888d016a91509c24ecfb0c7c845f3b0
MATLAB
3,357
88
function result = twoChansmodel(param, prfResponse, t) % Function to predict neural response to time course using the 2-channel % temporal model with a sustained channel (using a exponential decay) and % a transient channel (using a nonlinear on/off sigmoidal function) % % result = twoChansmodel(params, stimulus, ...
f6c8c88be6579b995e0604af16324379083a00484374b5780223e384d423d8c8
MATLAB
3,358
111
function colorAutoCorrelogram = colorAutoCorrelogram(image) % input: image in uint8 form, from wich to extract the color auto correlogram % output: 1x64 feature vector containing the color auto correlogram % quantize image into 64 colors = 4x4x4, in RGB space [img_no_dither, map] = rgb2ind(image, 64, 'nodither'); % fi...
0eed04604bf57bfc45522d92442b81621ef425ec4015dcf9c6c318cbcd785b46
MATLAB
3,364
103
function fH = plotSingleVoxelLocationAndTs(roiVoxelData, prfData, onsetTimeSecs, selectedVoxels, TR, conditions, pths, roiName, subFolder, saveFigs, savePth) %% Plot location and timseries of single voxel fH = figure(99); clf; set(gcf, 'position', [73,555,1904,555], 'color', 'w') roisplit = strsplit(roiName, '_'); ro...
46858081efd609c875303bfe2aaf696bae6486ac4caf60a636306c71b92ff57c
MATLAB
3,365
125
function Behaviour_spikes_per_trial(Session,Area,Ndir,Ntrial) %% Behaviour_spikes_per_trial plots the timing, movement kinematic and neural activity of a selected trial % Behaviour_spikes_per_trial(Session,Area,Ndir,Ntrial) plots: % 1) The hand speed of the trial Ntrial of the behavioural session Session. % The times ...
e0a2404103bc8cdd339840c6e9a2cc5f6e251e75e8a3c03b7847238aba34f87e
MATLAB
3,366
78
function [] = plot_worm_frame_post_analysis_original(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, UncertainTips, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % I...
ffffc339056f9b6b3594d5ec496122660c6fb85ed682f37f43db267e12fde08a
MATLAB
3,366
87
clear all; close all; %% Simulate mice with parameters estimated from neutral sequences nSimulations = 100; %% Load regression parameters parameters = readtable('coeffs.csv'); % extract mouseNames mice = unique(parameters.mouseName); % only keep parameters of one environment parameters = parameters(parameters.environ...
67effb55a891af7f865a2d8233d5cba8cd54553f5141201a07bfbfff9e12e441
MATLAB
3,367
67
function mltp_tfiles_to_singleunits(obj, session) % Due to the problem with the 32bit vs 64bit, we need % to load the NLX timestamps for comparison nvtFilename = fullfile(session.getSessionDirectory(), obj.Experiment.getNvtFilename()); %[nlxNvtTimeStamps_mus, ~, ~, ~, ~, ~, ~] = Nlx2MatV...
5ff24b0f370b8519dff344da2374256337ebeca63776aa2f7d9ff688d38734fa
MATLAB
3,370
87
% Vectorized function for computing Pearson's correlation coefficient (RHO) % between each of the respective columns in two data vectors or matrices. % % -- Function File: RHO = cor (X, Y) % -- Function File: R2 = cor (X, Y, 'squared') % % 'RHO = cor (X, Y)' computes Pearson's correlation coefficient (RHO) % b...
aa055f372dcd2b97d30ffcc585d93b5797c124c4a25415b97c4bed4e6785bfc8
MATLAB
3,372
76
%Calculate F-test cluster mass permutation effect. % %EXAMPLE USAGE % >> test_results = calc_Fclust(data, [], [3, 4], 1e4, 0.05, chan_hood, 0.05) % %REQUIRED INPUTS % data - An electrode x time points x conditions x subjects array of ERP % data. Array will vary in number of dimensions ba...
1d6846d834fdb903411c1c5c4da22ccb061de3b8a818b6dc5099c2c1d0750c3c
MATLAB
3,374
113
% plotSpikePhaseLockExTrace.m % % Quick script to plot leg phase and ephys trace %% plotting parameters jPot = 13; % junction potential (to be subtracted from Vm) Vmscale = [-70 -50]; Vmscale = [-65 -45]; phaseScale = [0 360]; xScale = [180 181]; % DNa02 xScale = [176.58 177.58]; % DNg13 xScale = [176.15 177.15]; % ...
ac3416d10fedfa932a0e63fcce4d77f103f07b383c8b05874ad32c04d3e5510d
MATLAB
3,374
100
% displayFictracVelocityDistribution.m % % Function that prompts user for trial.mat file for a fictracOnly type % experiment and processes that FicTrac data to display a heatmap % representing the distribution of counts across yaw and forward % velocities. % Used to check FicTrac calibration, as existing data sugge...
bb63e727f91305eb969edebe9cf06a8deb613017568c66b1247389b628872d16
MATLAB
3,374
50
base = 'X:\Potter et al datasets\'; conditions = {'SOM', 'PV'}; % MAKE SO THAT THERE IS EXCLUSION CRITERION FOR SOM AND PV EVENTS % what is events_per_min supposed to be about? event_frame = 120; load('Y:\Christian\Processed Data\Event Analysis\standard_ds_onsets.mat') %% GET MEAN ACTIVITY BY EVENTS % divided int...
e69666d361a619e20cf9c872a64054fa96f82d6852c71c617e6b6f05674b5e31
MATLAB
3,374
146
function [c1,c2,r1,r2,ratio] = BDFT(j,pitch) i=pitch; thre=200; f=abs(fft2(i)/256); s=fftshift(f); smap=uint8(s); smap=imresize(smap,[800,800]); figure; set(gcf,'Position',[0,0,800,800]); imshow(smap,'border','tight','initialmagnification','fit'); hold on [d...
54b70791bf72d4176432f69887115579f63362202a2786d937d99245c7885aec
MATLAB
3,375
113
function [ ] = Patlak_twotimepoints(workingDir,concentrationmap1File,concentrationmap2File,maskFile) % Patlak - Calculates the ki and vp maps, i.e. Ki and Vp per voxel. % Based on script "kimap_20141111.m" of Joost de Jong and "Patlak.m" of % Lisanne Canjels % Adapted for 2 MP2RAGE timepoints after contrast injection ...
85e7e6bacfe1d1b3a4ae922768735caa5df15644d465a0dc96e4063a926576a5
MATLAB
3,376
94
function [tblPeaksIntegrated, tblSpectra] = extractSpectraAndIntegrate(csvDataDir, outputSpectraDir) %extractSpectraAndIntegrate(csvDataDir, outputSpectraDir) % Analyzes the GCMS data in the directory csvDataDir. The data should be % converted into CSV files. Indetifies peaks in the total ion chromatogram, % extract...
aeaa77a9ad5913addc1015cfb78a59c78ad1ff6744b7b388627851663b790ea1
MATLAB
3,378
98
function event = read_serial_event(filename) % READ_SERIAL_EVENT % % changed A.Hadjipapas 2010 % % The only thing transmitted is the event.value (no info about sample) but it works % Copyright (C) 2007, Christian Hesse % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documenta...
b94b27d01d8c08b6ab30f84b7530c90486e4af01dfc65692dcc58ce025d1b835
MATLAB
3,379
106
% computeLRrunCorr_pDataGUI.m % % Function to compute the running correlation between the left and right % cells' dF/F, given a window size to compute the correlation over % Runs on all pData files selected through GUI % Saves correlation and window size back into selected pData file % Correlation computed on img.filt...
624c8b2c9488f7661c470fae2dcb940b284d3f8f50024e84ed42cbde31de1192
MATLAB
3,380
106
function [corrs] = get_partial_correlations(ds_events,activity_length,bin_size,type,ex_thresh) start=0; corrs=cell(3,length(ds_events)); %% for d = 1:12 ds_som_corrs=[]; ds_pv_corrs=[]; ds_ex_corrs=[]; load(['Z:\Potter et al datasets\' ds_events(d).tag 'activity.mat']) velocity= combined_inf...
7c00ff523fccbdb7c6ee08fe172b366024576e99357e94ad72873106bfcb8e51
MATLAB
3,380
81
function ml_two_contexts_plot_best_fit_alignment(projectConfig) plot_day_averaged(projectConfig, projectConfig.analysisFeaturePoorFolder, 'poor', 'all'); plot_day_averaged(projectConfig, projectConfig.analysisFeaturePoorFolder, 'poor', 'within'); plot_day_averaged(projectConfig, projectConfig.analysisFeatur...
125d2bca36abe0974f9802feae915a23d467b57ac1c727d4961438441534ff9b
MATLAB
3,382
89
%Bar plots with the individual data points for different cohorts %You can use Prism Program instead :) %author: Chernysheva Maria %version:01.09.22 function SEM_Input = bar_plots_open_field(InputData,Legend_Cohort,Color_Cohort, Title,YLabel,FontSize, paired) %some arbitrary numbers for the plot's design: ...
2ae24bd2b4d9bed39e14c3204aacb22b828212b2497a2112d7de8d83ada73d2f
MATLAB
3,384
118
function view_kspace(DATA,ROI,AddInfo) % VIEW_KSPACE - Aedes plugin for viewing k-space of vnmr files % % % 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@...
a6b856fb1b7d3391a139a4de7eb1140ec6c492e7662489b8abdb0cdbb8719782
MATLAB
3,384
145
function [fullD_results] = cluster_masks (intensities,red_vect,flatwave_identities,info,img,red_cellocs) mean_image=img.sum_proj; % change if you want a different image numpocks=length(info.pockels); numwaves=length(info.wavelengths); mouse=info.mouse; date=info.date; cell_idx=1:length(red_vect); t=[mouse,' ',dat...
52bf4c30106b9e69d55c74644af3677fff759500a5600ed5a209f46074f14250
MATLAB
3,387
90
function MNE_out = CMNE_opt(MNE_in,P_tmp,t_tmp) %%% define the maximum allocated current to each coil in this script Gx = MNE_in.Gxu; Gy = MNE_in.Gyu; Gz = MNE_in.Gzu; G = cat(1,Gx,Gy,Gz); [U S V]=svd(G,'econ'); n_cutoff = 14; S_tmp_diag = diag(S); ...
317f199ace6347466dd7b7b45aa90227d64e74bc1f5f61cf85c35d9be41ff742
MATLAB
3,388
98
% analyzeKernelsPooled.m % % Script to compute kernels averaged over multiple trials. Saves the % kernels as well as the corresponding figures % % run extractKernels.m on all selected trials, save data, save figures % % UPDATED: % 8/29/19 % 9/4/19 - autocorrelation computation now working datPath = '/Users/hyang/...
a0f1481cf1dda787c318e394e51a24624d937ea57d3b892dbac21a0bdcdd0731
MATLAB
3,388
111
%% Script for the extraction of the amplitude histograms %% % no worning on names %% Set up % nbins=100; clear close all binwidth = 1; Ampl_ECM_18_all = []; % manual setting (select all and modify) Ampl_ECM_18_el = []; % manual setting [end_folder]= selectfolder('Select the result folder'); if strcmp(num2str(...
c65993b1d0c9426f7240e13a09f5ea16cf717a568a0f95103d2df94a90a849cc
MATLAB
3,389
106
function [TChannel]= SONChannelInfo(fid,chan) % SONCHANNELINFO reads the SON file channel header for a channel % Output follows the CED disk header structure but a FileName field % is added to tag the returned structure with its source file. % % % INFO=SONCHANNELINFO(FID, CHAN) % where FID is the matlab file handle and...
da27db15af4274166a1f42b54927517b694907d81007bcff66bd35179d3b7bdf
MATLAB
3,390
87
classdef DynamicTableRegion < types.hdmf_common.VectorData & types.untyped.DatasetClass % DYNAMICTABLEREGION DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicat...
2d2b7835203fb43ea80cb7ff9ad781d8e9b9cc699af41dd2338a0bc12bb76036
MATLAB
3,391
98
% This code takes an individual TIFF stack and outputs a series of CSV files, each representing individual slices. % It can handle up to 4 channels as long and by default name them as red, green, blue, and white (in that order) slices = 25; width = 1012; height = 424; redT = 0; %T is for the threshold of that channel ...
ae4c3aad415b7fee30fea30d175f93c3b7b33f718c692f972fe93a75ca0f1765
MATLAB
3,392
71
clear; close all; %maindir = fileparts(convert("fullpath")); maindir = fullfile('/ZPOOL/data/projects/rf1-sra'); warning off all %subs = [10317, 10369, 10402, 10418, 10462, 10478, 10486, 10529, 10541, ... % 10572, 10581, 10584, 10585, 10589, 10590, 10596, 10603, 10606, 10608, 10617, ... % 10636, 10638, 106...
6129cd92ee8e8056c739b91a89d91a78342f74c1d76c18ca8918f394e88cfa26
MATLAB
3,393
98
% analyzeMoveCondKernels.m % % Script to extract movement conditioned kernels % % run extractMoveCondKernels.m on all selected trials, save data, save % figures % % NOTE: with current set of movement conditioned data and current kernel % parameters (or with winLen = 1.5), the bouts are too short to extract % valid ...
0da0e5db8357f5376fe0dd9216135e34fffdf6c5ad8ce9c05afc0f48d02bf608
MATLAB
3,394
113
function my_batch_run_config(opts, imdb, work_info, net_config, work_info_epoch, work_info_batch) do_init_work_info_batch(opts, imdb, work_info, net_config, work_info_epoch, work_info_batch) work_info_batch.ref.batch_skip=false; batch_size=work_info_epoch.ref.batch_size; torun_task_subidxes=...
d3765a02b8ff3ff413c5578a0d214f45f3f960442b5fda7accb1b57fa5085a03
MATLAB
3,394
116
function [ax_C,ax_H,order]=consensusPlot(C,Sc,Tree,varargin) % consensusPlot Plot hierarchical consensus clustering results % % Syntax %__________________________________________________________________________ % % consensusPlot(C,Sc,Tree) % % consensusPlot(__,Name,Value) % % [ax_C,ax_H]=consensusPlot(__) % % % D...
0ecfc66c7b34095d4269394526bebda0fd6c7ded12583a4eb21368ea697951cb
MATLAB
3,397
51
function [psth, response, visI] = processAnimalData(cell_activity_allday, stim_type_allday, trials, nanimals, nstim_type, win, threshold, ngratings) % This function processes data for all animals and returns the psth, response, and visI structures. % Initialize structures psth = struct(); response ...
36d46d447c195e071098edc2bb9cc7976fbc60a8e85bd4b197d2d0bedd28a617
MATLAB
3,397
123
function ExampleAnalog() % function OutputAnalogVector = ExampleAnalog() % 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...
41f01797b612104ed6f7e36c510d4d8db5feee0b964345b6528e37bc1a622771
MATLAB
3,397
111
% mglValidateScreenParams.m % % $Id:$ % usage: mglValidateScreenParams() % by: justin gardner % date: 07/23/09 % purpose: Validates a screenParams structure to make sure that it % has all necessary fields % % screenParams = mglDefaultScreenParams; % screenParams = mglValidateS...
6d1484b4dd49ba0b7baa6480d687f784b37aaf78c1d7414d892eb957e3664ceb
MATLAB
3,402
138
figure; plot(legXShiftRot(40000:41500,refPts.headPtInd),legYShiftRot(40000:41500,refPts.headPtInd), 'x'); hold on; plot(legXShiftRot(40000:41500,refPts.abdPtInd),legYShiftRot(40000:41500,refPts.abdPtInd), 'x'); plot(legXShiftRot(40000:41500,refPts.thxMidInd),legYShiftRot(40000:41500,refPts.thxMidInd), 'x'); figure; p...