sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f35223be2c89be73f5f0d33948f03363f83695936e28c2e207275b9dea21d7ed
MATLAB
3,843
109
% Function File: [yf, tf, HTF] = binomialf (y, t, n, correction) % % Application of a binomial smoothing filter of order n to the y-vector. % % For filter orders upto 50, filtering is achieved by application of a % sliding (2n+1)-point box weighted with normalised binomial coefficients. % For ...
f3ca4e057fad8c4f1309646bcd93528ce756c2416d71794c811022aae18d88db
MATLAB
3,843
118
function result_info=my_gen_seg_result(seg_param, ds_info, predict_info) result_info=[]; img_size=seg_param.img_size_input; gt_mask=seg_param.gt_mask_input; assert(~isempty(gt_mask)); gt_mask=uint8(gt_mask); assert(all(img_size==size(gt_mask))); eva_param=...
5be9cdb3cbf6e7d064521607200c6de411a67f2a774eaae63b4663c90c0506c7
MATLAB
3,845
135
function [] = ExtDataFig08_AveTimeCourse_OptStim_Neuron() % Code for plotting the time course of ΔF/F in Extended Data Fig. 8a,d. GT = 'pIP10'; Target = 'pIP10_NR'; % Extended Data Fig. 8a % GT = 'pMP2'; Target = 'pMP2_NR'; % Extended Data Fig. 8d switch Target case 'pIP10_NR' TargetROI = 3; ylimr...
d999bb62785b7335f7b86f937605f5a3f170ebd16eca0474dfdd1bdbee96b0ae
MATLAB
3,846
120
function [h2mm, s2mm] = openmeeg_megm(pos, vol, sens) % OPENMEEG_MEGM computes the OpenMEEG H2MM and S2MM matrices % i.e. the contribution to MEG from the potential and from the source % % Use as % [h2mm,s2mm] = openmeeg_megm(vol, isolated) % Copyright (C) 2010, Emmanuel Olivi % INRIA Athena Project Te...
1ecd98f4fea7639452aa96ff73a85b062f7013687accd404db1480b82129ea04
MATLAB
3,847
89
function status = fillStreamingParameters( obj, data ) % Extract and visualize LFPs from online streaming mode % % Syntax: % status = FILLSTREAMINGPARAMETERS( obj, data ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % % Output parameters: % * status % % Example: % ...
db91300be63f5137933928747992dfd09f21cb05b22f9539101de2b2807ffcb3
MATLAB
3,850
86
% "Wire coil creator" tool for the entire coil. Models the outer surface % of coil windings by multiple wire segments. The output is saved in the % binary file coil.mat and includes: % Pwire{:, 3} - set of nodes for all wires % Ewire{:, 2} - set of edges/segments for all wires (current flows from the fir...
cd7fe10085338e83b1a841705ca6c9d93d20dde0380063987cefdd7f855af611
MATLAB
3,851
109
%Sample code %Davor Curic, 2023, Complexity Science Group, University of Calgary % %This code generates avalanches with respect to a network. In this case the %network is generated from pixels within a specified radius. % %IMPORTANT: the sample recording was too large to fit into github %repository. This code sh...
ea340a68af337940fe4d5fa1c536b1adc18b5dabe24574de162f116b22f9e6e0
MATLAB
3,852
110
classdef file_object < handle % Simple file object that fcloses() the fid when no longer referenced. % Can be used just like a fid in most cases. properties (Access = protected) fid_ = [] %uid_ = [] %file_name_ = [] end methods function self = file_object(va...
06ea490e33188cefcbbaf37292ac684ede23b5462bb51ba4159cd6998e393657
MATLAB
3,853
100
%% create figure 2H %% janine.thome@zi-mannheim.de %% paths clear all; close all addpath([pwd '/circularGraph/']) %% load data x=load('FC_ALS_HC_Fig2H.mat'); cols=[213 62 79; 154 213 148; 50 136 189]/255; %background colors col1=cols(1,:); col2=cols(2,:); col3=cols(3,:); nvp1=size(x.x...
bdb09896dad632bf2f3d0daa36fd0bdfe334d73ae5eb744856c04811aff7e9df
MATLAB
3,853
152
tic %% open/read file and set up Environment %clear;clc;close all activateCEDS64 % Start Time START_TIME = 0; %AstSamples = floor(START_TIME * 1000); AstSamples = 1; % Wavelength WAVELENGTH = 999; % path to file files = [ %"Z:\1_Ruth Empson\151217 VOR\segment_1.smr" %"Z:\1_Ruth Empson\151217 VOR\segment_2.sm...
8724db31c8954619e9ff3170c25aa78f8589efa77ceb743140c2f93f8b39f7dd
MATLAB
3,854
97
% makeDiscImgSeries.m % % Function that generates series of disc images centered at % user-specified center. Returns images and their corresponding sizes, in % degrees % For generating discs for looming stimuli on visual panels. User % specifies dimensions of panels, in LED pixels, and the conversion factor % to de...
78d7dec3d65b252028143b34eeb77d3cd033c2d4276cbac25cd795451fa24017
MATLAB
3,855
110
function [p] = ml_cai_behavcam_referenceframe_create( trialFolder, dataFolder, varargin ) p = inputParser; p.CaseSensitive = false; addRequired(p,'trialFolder', @isstr); addRequired(p,'dataFolder', @isstr); addParameter(p, 'outputFolder', dataFolder, @isstr); addParameter(p, 'verbose',...
8e1da7797e17cfb15a8ebade5d2162ae15e4f8072c726ad4c53f5ca06af61b59
MATLAB
3,855
121
% ------------------------------------------------------------------------% % compute the W2 distance between feature a and b % code written by Lei Zhu, IPRAI, Huazhong Univ. Sci. & Tech. % last modified time: 2013.07.11 % ------------------------------------------------------------------------% function D = W2Dis...
78cf49feadd411ee3df0bc3ed9db1f19e5e2f686cd2a88c29a5075e7a8bc6e52
MATLAB
3,856
86
% mglMetalReadTexture.m % % usage: [im, results] = mglMetalReadTexture(tex) % by: Ben Heasly % date: 03/04/2022 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: read texture data from mglMetal, back into a Matlab image. % usage: % % % Create and show a ...
de1079972caf0c92fbf43cccf26bf089dfd1a7a6c7efa44bf84937f2f43ff201
MATLAB
3,857
168
function [val] = read_asa(filename, elem, format, number, token) % READ_ASA reads a specified element from an ASA file % % val = read_asa(filename, element, type, number) % % where the element is a string such as % NumberSlices % NumberPositions % Rows % Columns % etc. % % and format specifies the datatype a...
c821a476bec51f6a4bd58b86beed6173db06d1ad576a449b0cc0acf4cd9af587
MATLAB
3,858
124
function[data,h]=SONGetMarkerChannel(fid, chan, varargin) % SONGETMARKERCHANNEL reads a marker channel from a SON file. % % [data{, h}]=SONGETMARKER(FID, CHAN) % FID is the MATLAB file handle and CHAN is the channel number (1 to Max) % DATA is a structure containing: % DATA.TIMINGS: a length n vector with the m...
f7fa6ec004f120405693ba30fefc1e6c51a6744586509790ae044f11ac6951d7
MATLAB
3,858
116
function toon_motionCorrect(baseDir, expt, session) % toon_motionCorrect(baseDir, expt, session, motion_cutoff); % % % Runs within and between scan motion correction for Toonotopy experiment % % Within scan motion correction relative to the 8th frame of each scan % params.motionCompRefFrame = 8; % reference TR for mo...
6cf940f5df6501537d3c39d52d36cdbb54c4e6077bc84d6b5a79c7a221d7b587
MATLAB
3,860
107
function [gp_tmp,varargout] = masked_3DGP_test(grid_sz, l_scale, p_scale, mu, bin_mask, threshold, l_weights,type) % [gp_vals] = masked_3DGP_v2(grid_sz, l_scale, p_scale, varargin) % % This function draws from a 3-D GP with mean mu, length-scale l_scale and % variance scale parameter p_scale. Basically it returns a v...
6846e71b96cb048d019ad2f8977acef57234c74067844ad9272aa9ef4c6c9225
MATLAB
3,861
86
function [f, data, comments] = import_adicht(file_path) % Author: Jürgen Graf % date: 23.05.2021 % dependent on: % Installation Simple Data File SDK (provides a Windows dll) % found in C:\Program Files (x86)\ADInstruments\LabChart8\Extras % ADInstruments (LabChart) SDK from Jim Hokanson % https://git...
a6ebff3b58ef832dd06ded27a58d1665aa8a2e94803f29e893d270051b22f0d1
MATLAB
3,861
95
% makeTraces.m % % usage: myscreen = makeTraces(myscreen,<verbose>) % by: justin gardner % date: 02/28/07 % purpose: makes traces from event times % function myscreen = makeTraces(myscreen,verbose) % check arguments if ~any(nargin == [1 2]) help makeTraces return end if nargin < 2,verbose = ...
610c3098bcdaa2f2784c01adb828a651c958cc8d411f8c38f160f3f4a439d65a
MATLAB
3,863
136
function tests = dataPipeTest() tests = functiontests(localfunctions); end function setupOnce(testCase) rootPath = fullfile(fileparts(mfilename('fullpath')), '..', '..'); testCase.applyFixture(matlab.unittest.fixtures.PathFixture(rootPath)); end function setup(testCase) testCase.applyFixture(matlab.unittest.fixtures....
8496dba7ca4e5949cba50d72c584e12abe8aa9bd5049e877635f849ec3d61df8
MATLAB
3,863
169
function aedes_smiswrite(data,filename,varargin) % AEDES_SMISWRITE - Write S.M.I.S. Data Files (*.sur) % % % Synopsis: % aedes_smiswrite(data,filename,param1,value1,param2,value2,...) % % Description: % Write data to S.M.I.S. SUR-Format files. % % Examples: % % See also: % AEDES_SMISREAD, AEDES_RE...
7f6a3ec3d53c268071249f7e86279c1b65c43ae3668cafdc8a6156b9a85d5b61
MATLAB
3,865
100
function Video_Player(hObject,eventdata,handles,varargin) % tic % global index; % index=index+1 handles=guidata(gcf); cal_play_index=handles.cal_play_index; objindex=get(handles.PlayVideo,'Value'); if objindex==1 set(handles.slider1,'Value',handles.frame_index); video_index=find(handles.video_frame_bine_2-handl...
6a2993a41df181a74d687ff4944d203fd121a9c9e87aea7e10b2ad5c8a1280e0
MATLAB
3,868
185
function [chm, snrk] = modskew(ch,sk,p); % Adjust the sample skewness of a vector/matrix, using gradient projection, % without affecting its sample mean and variance. % % This operation is not an orthogonal projection, but the projection angle is % near pi/2 when sk is close to the original skewness, which is a realis...
bf2a1d700e954e752921877013dfd26adea28487819aa9dfd788d371bcb74a49
MATLAB
3,871
118
function [acc,left_num,right_num] = TWFB_DGFMDM(MIEEGData,label,Fs,LowFreq,UpFreq) % Input: % MIEEGData:The raw motor imagery data % label: motor imagery data label, 1 and 2 % Fs: the sampling frequency (in Hz) % LowFreq: High pass filtering parameter settings % UpFreq:Low pass filtering parameter settings ...
c3f36e907af449ea790281ac3b20d97e5e99aaaa476502f887ebd16b6a74634d
MATLAB
3,871
135
% run_simulations_residuals_global_local_shuf.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) % will test residuals, global shuffling, local shuffling %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analy...
022d87de01826c6ffd2ebb188563f8800896953f8e7b1a70db89efe220a99f39
MATLAB
3,872
114
% ephysIInj.m % % Trial Type Function % Records ephys channels, performs current injection % % INPUTS: % settings - struct of ephys setup settings, from ephysSettings() % duration - duration of trial, in seconds % % OUTPUTS: % rawData - raw data measured by DAQ, matrix where each column is data % from a di...
498d7cd5713dbf8c46262ed808be1bc07aea61d305d5fde991f3f177ae95edfd
MATLAB
3,874
139
%{ For the best clustering, generate 2D matrices for LE(t) and dFC(t) centroids by averaging according to the clustering. Next, average while multiplying the dFC(t) by occurrence. Adapts code from: https://github.com/juanitacabral/LEiDA https://github.com/trendscenter/gift Output: k_LE.h5 2D centroids for LE(t). k_...
beaae5d27e47d2d56093459cf61ba14c35c51b321109a89905822fd6852de262
MATLAB
3,875
95
function [b_sensitivity] = lookupBS(separation) %LOOKUPBS Brain Sensitivity lookup table % Returns the brain sensitivity (white + gray matter only) of a SD % separation. Assumes a five layer slab model. If the SD separation is % not an integer, brain sensitivity is linearly interpolated. The max SD % separation...
6b1274d56b43595e4779cb767f533bb406d6aa658fc861f65c0835918bf5c15f
MATLAB
3,876
92
function ms = msGenerateVideoObj(dirName, filePrefix) %MSGENERATEMS Summary of this function goes here % Detailed explanation goes here ms.dirName = dirName; % Added by GE to keep track of where the files were initially MAXFRAMESPERFILE = 1000; %This is set in the miniscope control software % f...
d1cdfbe5cc8c4815ae78c6df1f3929b1c40140937f3b6d462cdddf757948de28
MATLAB
3,878
175
% Author: Guosheng Lin (guosheng.lin@gmail.com) % here shows an example of % evaluating the segmentation performance of a trained model on the voc dataset: % Before running this demo file for evaluation, you need to % download the PASCAL VOC 2012 dataset and place it at: % ../datasets/voc2012_trainval function d...
3728b0f8c37968b590b829ce1caf337e1ac0f97466a1ce8532da5ce906940241
MATLAB
3,883
128
function create_climerics_matrix_average(obj, session) tf = session.getAnalysisDirectory(); fn = fullfile(tf, sprintf('%s_ics.mat', session.getName())); if ~isfile(fn) warning('Can not create ics matrix average because (%s) was not found.\n', fn); return; end fd = load(fn); % Use cell-like cells OMG cellClas...
0996ce88bb11e2edecb59b8e64de2f0d0ac74bc4e330d6a1da977f359b29d451
MATLAB
3,885
99
%% BICEPS %% Overview %% Example %% Exploring the outputs %% Rationale %% Recommended steps in preparation to run it smoothly %% Explore BIDS folders, get list of participants and report counts % % To feed the GUI_environments you need a list of participants (paths to % BIDS formatted data). You ca...
c92078b11920081536040a9f17ba837820e09e41be4b09675fe0fe18c11460df
MATLAB
3,885
103
function fH = plotDNST_CSTopt_CViolinPlots(params,roisToPlot,... cmapModels, saveFigs, saveFigDir) %% CV-R^2 violin Plots modelName = {'CST_{fix}','CST_{opt}','DNST'}; cmapModelsCell = {cmapModels(1,:);cmapModels(2,:);cmapModels(3,:)}; mnR2 = NaN(9,3,7); fH = figure; set(gcf,'Position',[500 1 965 9...
321e9ab34436cf7c82249332502ccc129092e26c05cd188a5ce953ca96f6e876
MATLAB
3,886
122
function [F_ancova, P_ancova, DF_ancova, T_post, P_post, DF_post] = gretna_ancova1(Data, Cova) %========================================================================== % This function is used to perform one-way ancova on independent samples. % % % Syntax: function [F_ancova, P_ancova, DF_ancova, T_post, P_post, DF_...
c3da74852885582c4e44b7673e25f5c38f9789f982866eee45a628961d18e6d4
MATLAB
3,887
100
function fH = plotDNST_CSTopt_DiffCV_BarPlot(params, roisToPlot, cmapModels, saveFigs, saveFigDir) % Preallocate space mean_diffCVR2_acrossVoxels = NaN(7,length(roisToPlot),length(params)); maxNC = mean_diffCVR2_acrossVoxels; diffCVR2_allVoxels = cell(length(roisToPlot),length(params)); ipsIdx = cellfind(...
3aaa705f00d5dfd2f128064d908581aa3a113b5dd7d076a1502a955dc3a2a144
MATLAB
3,889
128
% written by Marge Maallo, 15/11/2021 % CSAN, LiU % read response mat files for each subject and perform SVM classification % return confusion matrix % edited by Marge Maallo, 19/11/2021 % read in scaled timeseries % edited by Marge Maallo, 23/11/2021 % do 10 repeats so we can get an estimate eg SEM % edited by M...
8c52f182f94f2ff437802afc7f353e45e9f5d9b184917f0e7fc80f842c73f14f
MATLAB
3,889
98
function spm_progress_bar(action,varargin) % Display a 'Progress Bar' in the 'Interactive' window % FORMAT spm_progress_bar('Init',height,xlabel,ylabel,flgs) % Initialises the bar in the 'Interactive' window. % If flgs contains a 't', then use tex interpreter for labels. % % FORMAT spm_progress_bar('Set',value) % Sets ...
bd53f6e9ef593cb28f6a98ed8df1504061f4a7eefd04cd473d45246291c7395a
MATLAB
3,891
121
function plot_trajectories_prep_exec_after(score,idx_dir,t_from,duration_range) %% plot_trajectories_prep_exec_after plots the trajectories corresponding to different directions (of the same duration range) during movement preparation, %% movement execution and after movement end % % INPUTS % % score: Projection of th...
faca63f312bd5193accc8757b2b8318007e78a7056a962a8fad52c07184c978f
MATLAB
3,893
126
% returnDFF.m % % Function that converts background-subtracted fluorescence signal into % dF/F (for 1 channel data) or dR/R (for 2 channel data) for a single % trial folder. When there is only 1 ROI, prompts user for whether it's % left or right cell. When there are 2 ROIs, also returns sum and % difference of dF/F...
e56f77890d44ec39cc31014ed6125458f87d5870ff8fc7945871d43748349e83
MATLAB
3,894
94
function [fa, md, rd, ad, cl, SuperFiber, fgClipped, cp, cs, fgResampled, myValsFgSTD] = ... dtiComputeDiffusionPropertiesAlongFG(fg, dt, roi1, roi2, numberOfNodes, dFallOff) % Compute a weighted average of a variable (FA/MD/RD/AD) in a track segment % % [fa, md, rd, ad, cl, SuperFiber,fgClipped, cp, cs, fgR...
d3a01b81f555557de1fee443bad1d06b0b1c576cb942e8749af53a62e3de80ff
MATLAB
3,896
122
function PlotConfusionMatrix(data) title1 = {'CSP+LDA','FBCSP+SVM','TSLDA+DGFMDM','TWFB+DGFMDM'}; for fig =1:4 Sub1 = subplot(2,2,fig); % »æÍ¼£¬°´1ÐÐ3ÁÐÅÅÁÐ mat = data{fig,1}; % ±êÇ© label = {'Right Hand','Left Hand'}; % »ìÏý¾ØÕóÖ÷ÌâÑÕÉ« maxcolor = [50,114,189]; % ×î´óÖµÑÕ...
6f6dff6a09e4422749c8370ff333acad74a849ed37058007732afb255bae6952
MATLAB
3,897
72
classdef IntracellularRecordingsTable < types.hdmf_common.AlignedDynamicTable & types.untyped.GroupClass % INTRACELLULARRECORDINGSTABLE A table to group together a stimulus and response from a single electrode and a single simultaneous recording. Each row in the table represents a single recording consisting typically ...
59e39b051177a5fdca94ca359d4f899e209a316d96e03ad60b1bbf264e321c5c
MATLAB
3,898
106
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [output] = compute_cell_rate_difference_matrix_by_context(firingRates, trialIds, contextIds, rateMatrixNumTrials) if rateMatrixNumTrials <= 0 || length(rateMatrixNumTrials) ~= 1 error('rateMatrixNumTrials must be...
f596214fb0ad111145c69b07f8a59be1dbb484240517656ceccb18e69876701e
MATLAB
3,898
90
% Designate Paths [pathstr, ~, ~] = fileparts(pwd); usedir = pathstr; codedir = pwd; rawdata = fullfile(usedir, 'bids', 'sourcedata', 'Scan-Investment_Game', 'logs'); sublist_file = fullfile(codedir, 'sublist_all.txt'); subjects = table2array(readtable(sublist_file)); for ii = 1:length(subjects) try sub...
3a10a95d76606b7d8a645724d2940720943cd8484d00a963ada493af9ae13fcd
MATLAB
3,900
120
function names = nii_deface(job, overwrite) % extends nii_deface to remove excess neck and face details % Face strip images % FORMAT names = spm_deface(job) % job.images - cell array of NIfTI file names % % names - cell array of de-faced images % % This is a little routine for attempting to strip the face from...
57b0ec7ab6937020eb503d841c3d8b3e2b06bdbb001d86971f7ef1004cad3ca2
MATLAB
3,902
146
function take_snapshot(DATA,ROI,AddInfo) % TAKE_SNAPSHOT - A snapshot plugin for Aedes % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % De...
b1eef0a20e07ae837ac30918b0e94485f52a32e51638e35f641f663f49d23cb5
MATLAB
3,902
100
%% Description %{ This script detects transient neural oscillatory bursts from the mouse LFP signals, bandpass filtered by the user-defined frequency range. The time point and amplitude of the detected bursts, along with their binary event markings, will be saved as an output. %} %% Configure Library Path UTIL_DIR = ge...
359548c52fa26eabf436bbb282548b5bf17a663ace6f39bc387e57e005faa955
MATLAB
3,906
144
function[data,header]=SONGetChannel(fid, chan, varargin) % SONGETCHANNEL provides a gateway to the individual channel read functions. % % [DATA{, HEADER}]=SONGETCHANNEL(FID, CHAN{, OPTIONS}); % where: % FID is the matlab file handle % CHAN is the channel number to read (1 to Max) % OPTION...
754f1872799afef9d7c29e1a24ecd1f09aadd82488684b39945684a44b64811a
MATLAB
3,911
97
%% Concatenate all the videos of the trials into one data set that spans the entire session. function ml_miniscope_pipeline_concatenated_make_scopevideos(session) numTrials = session.getNumTrials(); %fprintf('Processing session %d of %d (%s)\n', iSession, numSessions, session.getName()); sessionDirec...
e043b9d91dcb657ad7f6a9648446f821c201b10dc2d9522aa0a495e015b54251
MATLAB
3,914
89
function [start_index, end_index, min_dist_index] = find_next_section(binary_annotation, current_index, backwards_or_forwards, all_center_line_tips) %finds the next section bounded by 1s going either forwards or backwards in time if strcmp(backwards_or_forwards, 'b') %going backwards %find wher...
7deb6a27a5cbee4d69b994ed7c1898ad7d8f44f0843a514887d5b88bbd8cbb25
MATLAB
3,915
118
function alpha=krippendorff(data,scale) % alpha=kriAlpha(data,scale) % calculates Krippendorff's Alpha as a measure of inter-rater agreement % data: rate matrix, each col is a rater or coder, each row is a case % scale: level of measurement, supported are 'nominal', 'ordinal', 'interval' % missing value...
835fdae3cb2aedf8e0658ef553a3ceefb2413574010f13300c3a3d8badf70cf3
MATLAB
3,916
121
%function gm_raster_vertical(data_dir, id, item_or_loc, spiketable) % % Mackay et al. 2024 (DOI:10.1038/s41467-024-52295-5) % License: MIT License (see LICENSE file for details) % ------------------------------------------------------------------------- function gm_raster_vertical(data_dir, id, item_or_loc, spiketable...
d8d49625be7115819115991e6a5e7b09758f691ffa9738508080264b20b3524a
MATLAB
3,916
82
%first download and add the Neural Decoding Toolbox (NDT) :http://www.readout.info/downloads/ %Meyers, E. (2013). The Neural Decoding Toolbox. Frontiers in Neuroinformatics, 7:8 % dataset_design,uncertain split 3 phase dataset_design % train by one phase, test by other phase stabletrain_uncertaintest uncertain1tr...
641a8cb3aff3f1cc0622b98922aaca0d9a901321a211947524275794eafc0249
MATLAB
3,917
97
% function [RegressionSummary] = multivariateregression(Y,X) %Multivariate multiple regression on DVar Y along dimensions d and IVar X along dimensions p. %Y is the dependent variable, each row subject, each column is condition. Xmat is matrix containing IV, should be all n x p, where n is subject %and every column p ...
d15159c5869e3f5154588f6970d2f9225d452c3bc93c11721cac2d3a865a4b2e
MATLAB
3,918
102
function vol = ft_datatype_vol(vol, varargin) % FT_DATATYPE_SOURCE describes the FieldTrip MATLAB structure for volume data % % The vol data structure represents data on a regular volumetric 3-D grid, like % an anatomical MRI, a functional MRI, etc. It can also represent a source % reconstructed estimate of the activi...
5296dfcfc76502968b0676804baafe3856f8a88be37371bbe03ceba0e89085a8
MATLAB
3,919
98
% preprocessFicTrac.m % % Function for preprocessing raw FicTrac voltage data acquired on the user % DAQ. Called by preprocess(). Takes 0-10V signal of heading, intX, and % intY and returns angular position and velocity for each dimension. For x % and y, also returns position and velocity in distance units (mm). Raw...
30e57039e3158bc6e6c5ac3e2a55b4e7caf335a8ac71dd1e38684c8d623588e4
MATLAB
3,921
132
function [] = ExtDataFig05_pIP10_OptStim_TuningCurve_Neuron() % Code for plotting the tuning curves of calcium signals of each neuron induced by optogenetics in Extended Data Fig. 5h. GT = 'TN1dsx'; switch GT case 'TN1dsx' ylimrange = [-1,4]; end %% parameters nTrials = 3; nStim = 6; T = 1370; % T Thre_...
b2f067d5b7ff8609742520f5cc14308357c25dad3cf45050817929794de7d401
MATLAB
3,923
105
%% msRun2018 % Version 1.0 GE % Updated version of the msRun script originally proposed by Daniel B % Aharoni to analyse miniscope 1p calcium imaging data. % This version is build on top of the original package to maximize compatibility. % It includes NormCorre for image registration, CNMF-E for source extraction, % an...
3284cc8d10c43ed5a0f12b70696f98f765ec015b6307333b0a270eb3a5240cf6
MATLAB
3,925
75
function [probe] = rotateModules(probe, moduleidx, rotate_amount) %ROTATEMODULES Rotates modules within a probe % Rotates modules within a probe layout by rotate_amount. Modules are % identified by their module idx. moduleidx can be a vector of module ids % in the probe. If moduleidx is empty (ie []), then the el...
7ee45a780ff90d290ea78a2006ca85c3f0b575fc4dda906e7ed3253e23b2f4ad
MATLAB
3,926
98
function roc = genAlgorithmPairROC(cnmf,pcaica,suite2p,est,varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Input parsing if nargin > 4 N = varargin{1}; else N = 0.5; end if nargin > 5 cutoff = varargin{2}; else cutoff = 0.5; end if isempty(cutoff) cutoff ...
bef37492cbdd3621b0c4de95c359a7f316116ca082134fb31e886d4507f6192e
MATLAB
3,927
106
function [frame_thred, noisy, final_thred] = threshold_frame(frame, thred_inten, target_area, unmasked) [Lxm,Lym] = size(frame); if ~exist('unmasked','var') unmasked = true(Lxm,Lym); end final_thred = thred_inten; frame_thred = frame > thred_inten; noisy = false; [L,nL] = bwlabe...
41898f753a353ca7a87eb7c15355dadb53aced3bd56542ef38d149a4625e326e
MATLAB
3,928
138
% plotCondLegStepParam_allFlies.m % % Function that takes output files from saveLegStepParamByCond_fly() and % generates a plot of the legStep param for each leg. Plots mean +/- SEM % for each fly. Different conditions in different columns. Points from the % same fly are connected by lines. % Select output files t...
88a8f62762314a7b411b17fd2ce8bda60ec29d243cd976f7395e09f6187cf9c3
MATLAB
3,929
80
function tracker(videos, options, calibration_file_name, vinfo_or_video_file_name) % Track (and calibrate) videos. % % To run tracker with interface, use: % % tracker % % To run tracker without interface, use: % % tracker(videos, [options], [f_calib], [vinfo_or_video_file_name]) % % where [] denotes an optional par...
cdaae8947ec0b458c4a5beb7a48da37148c510623820144b8b6d83b8e3512a3c
MATLAB
3,929
145
function [avr] = read_besa_avr(filename) % READ_BESA_AVR reads average EEG data in BESA format % % Use as % [avr] = read_besa_avr(filename) % % This will return a structure with the header information in % avr.npnt % avr.tsb % avr.di % avr.sb % avr.sc % avr.Nchan (optional) % avr.label (optional) %...
debd2fe707e28fe26500978fc6f04cbd3f4864e012990aa70bf637a6c7352c23
MATLAB
3,929
128
function [verts, faces] = mne_read_surface(fname) % % [verts, faces] = mne_read_surface(fname) % % Reads a FreeSurfer surface file % % fname - The file to read % verts - Vertex coordinates in meters % faces - The triangle descriptions % NOTE: The quad file faces are split by this routine...
6f49b1d366d50eb52f5f0b10f87eb29a3d88e61ec7073e5f2921f2be4dd136be
MATLAB
3,930
128
function[data,h]=SONGetEventChannel(fid, chan, varargin) % SONGETEVENTCHANNEL reads an event channel from a SON file % % DATA{, H}]=SONGETEVENTCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}}) % % FID is the matlab file handle and chan is the channel number (1-max) % If START/STOP are absent, all data is read. When ...
cbfc1e030e7834ee2f493bceae92d3afd3ff8b9e777fe82d23516566dd38c897
MATLAB
3,930
137
function [] = Fig01_AveTimeCourse_OptStim_Song % Code for plotting the average time course of pulse and sine song during optogenetic activation of dPR1 and TN1A neurons in isolated male flies in Fig. 1c,d. GT = 'dPR1_Chr'; % Fig. 1c: dPR1 > CsChrimson % GT = 'TN1_Chr'; % Fig. 1d: TN1A > CsChrimson switch GT case ...
4f409bc863829ef16264c09733efe6a3767d9a25b8691b81606e4c5e4c1dcc37
MATLAB
3,934
138
function [R] = randomizer_bin_und(R,alpha) %RANDOMIZER_BIN_UND Random graph with preserved in/out degree distribution % % R = randomizer_bin_und(A,alpha); % % This function randomizes a binary undirected network, while preserving % the degree distribution. The function directly searches for rewirable % ed...
08c028930097acf12f4d4c85be84fbe92d98e0400e8134d93e48145d88fe6582
MATLAB
3,936
86
% dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th6'); % dir_SUNS_sub = fullfile('SUNS_FISSA_SF25','4816[1]th3'); % dir_SUNS_sub = fullfile('SUNS_TUnCaT_noSF','4816[1]th2'); % dir_SUNS_sub = fullfile('SUNS_FISSA_noSF','4816[1]th2'); addpath(genpath('.')) %% % name of the videos list_Exp_ID={'Mouse_1K', 'Mouse_2K'...
830f7b828a0589e8dcf3f2b7c742f007a8dc52452823f8cb7bb53259227169a5
MATLAB
3,936
127
function newfig = figs2subplots( name , tiling , arr ) % FIGS2SUBLPLOTS Combine axes in many figures into subplots in one figure % % The syntax: % % >> newfig = figs2subplots(handles,tiling,arr); % % creates a new figure with handle "newfig", in which the axes specified % in vector "handles" are reproduced ...
4f1f8325fdeaf9c5da6884632bfba689dcfb7d63bfa7480995bd9cd8974e9b0d
MATLAB
3,939
64
function reorderRecordings( obj, order_indx ) % Change the streaming recordings order. % % Syntax: % REORDERRECORDINGS( obj, order_indx ); % % Input parameters: % * obj - object containg data % * order_indx - array with new order % % Example: % REORDERRECORDINGS( obj, indx_alpha, indx_beta ); % % Available at...
b6ddeeedf7a753cec1102558b0943a84568e7a0a9ab71ecfd37cf901fae47fec
MATLAB
3,941
107
function CBIG_ASDf_visualizeFactorComp(sub_info_file, factorComp, K, output_name) % CBIG_ASDf_visualizeFactorComp(sub_info_file, factorComp, K, output_name) % % This function plots participants' factor compositions for K = 2 and 3. % For K = 2, the visualization is created using histogram; for K = 3, the % visualizatio...
09785c8636eed69df870ebe766aa2179cb2c6e3cabd1861452dea41cd22162bf
MATLAB
3,944
86
function [ISImax, pks, flags] = calcIBEImax(bins, ISIhist, mpd, voidParamTh, ISITh, elecNum) % initialize variables % array of ISImax threshold for burst detection ISImax = zeros(elecNum,1); % array of flags that tell if a channel is bursting or not flags = zeros(elecNum,1); % peaks detected pks = cell(elecNum,1); for ...
6672237b35834c2adf318725f58b1560e5f50a0fcf3b95846d03d0985c44cf1e
MATLAB
3,946
110
%% Amplitude distribution %% cleaning clear close all %% input [start_folder]= selectfolder('Select the source folder that contains the PeakDetectionMAT files'); if strcmp(num2str(start_folder),'0') errordlg('Selection Failed - End of Session', 'Error'); return end cd(start_folder) %% amplitude computation ...
ccccd4959e339583abfec47108673374849571e11be45e31bd7547a69b09fa1d
MATLAB
3,946
131
%% LOAD if ismac load('/Volumes/Runyan2/Christian/Processed Data/Event Analysis/standard_ds_onsets.mat') else load('Y:\Christian\Processed Data\Event Analysis\standard_ds_onsets.mat'); end %% MAKE VARIABLES start=-30; activity_length=10; rg='yes'; corrs=cell(2,length(ds_events)); conditions={'SOM','PV'}; ...
c56ff6d4722a1c46aac85b71007b32c7d5756a9b11ee1f3f1f517c973ae037cc
MATLAB
3,948
138
%% structure parameters num_columns = 1; npp = 100; ppc = 2*npp; num_VTA = 100; N = ppc*num_columns + num_VTA; pop = num_columns*2; n = N; unit_num = 1:2:(2*num_columns); % num_trials = 600; num_trials = 80; %% time parameters dt = 1; %time step T = 100/dt; %time stimulated T_R = 150/dt; %time of reward delta = 600/dt...
b51c66f9c385e0b2e768dba11db6a32fad5049de6ac03c33af705faca1260ea8
MATLAB
3,950
88
function mltp_plot_rate_difference_matrix_average_days(obj) averageMatrix = {}; seqNum = []; cids = []; labels = {}; numSessions = obj.Experiment.getNumSessions(); for iSession = 1:numSessions session = obj.Experiment.getSession(iSession); sessionName = session.getName(); ...
2af8271d3503629bbae8cf439058c436076c54c8fa111b8f29a385ef11bbfefd
MATLAB
3,953
135
% run_simulations_stdFR_stdRP_splines.m % to generate a new set of % 540 x 100 simulations % (# param combos x # iter) % and create residuals PSDs using % either indiator functions or splines %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../...
68ed6ea70b6728bbe1067b4275fb1c5720241d3fb025815340f6bf987461f90b
MATLAB
3,955
141
function [P, beta] = d2p_sparse(D, u, tol, maxNeighbors) %D2P Identifies appropriate sigma's to get kk NNs up to some tolerance % % [P, beta] = d2p(D, kk, tol) % % Identifies the required precision (= 1 / variance^2) to obtain a Gaussian % kernel with a certain uncertainty for every datapoint. The desired % uncerta...
ce1c8da31e91d601ddbd7a9e7e7baf59db7b5dd74cd21defdd578e43859931c4
MATLAB
3,959
152
function net_config=gen_network_main(train_opts) fprintf('\n generate network...\n\n'); net_config=gen_init_net_config(); net_config.ref.group_counter=0; net_config.ref.root_group_info=My_net_util.gen_group_info_basic(net_config, 'root'); group_output_info=gen_multi_featnet_group(train_opts, net_config); g...
ea55a2b25c85ac5630b56def9feb22347b279d3d6b32a33b1e41b62d7b4f41c4
MATLAB
3,959
138
function [] = ExtDataFig04_OptStim_TuningCurve_Neuron() % Code for plotting the tuning curves of calcium signals of each neuron induced by optogenetics in Extended Data Fig. 4f,i. GT = 'dPR1'; % Extended Data Fig. 4f % GT = 'TN1SG'; % Extended Data Fig. 4i switch GT case 'dPR1' ylimrange = [-.5,5]; ca...
4b03da1d58def9410af9edc1809a7b1e4c820b9df3d12f480407280c4bf4ec0e
MATLAB
3,964
93
% load all EEG and fMRI datasets % % 2022-08-22 Jonathan Wirsich function [allgroup_mean_fMRI, allgroup_mean_EEG, allsub_fMRI, allsub_EEG, groups, group_idx, conf_idx, bands, atlases] = loadDatasets4eeg_fmri_tle(atl) [confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_co...
57b3ff8dc6cac9975cde54bc6d77b759d4cb9d864ab5b33968e2af1d07d73133
MATLAB
3,968
136
%{ For the specified k and participant, extract dFC(t) across and within states and within runs, calculate mean for FC strength and std for FC variability, average across runs. Output: dFC_strvar.h5 Contains dFC FC strength and variability across all states and within states. %} %Define command line arguments. funct...
0c09413849c7eb0a3c809c23d3ef0d73007f5ee76653ff1d02bf875ffcef2f57
MATLAB
3,969
90
function [if_both_hemi_match] = CBIG_gwMRF_check_example_results(output_folder, seed) % This function checks if the generated example results are identical with % the reference files provided for a given seed. % % Input: % - output_folder: The path under which the generated example results is saved. % - seed: indic...
262c1ccf72e29c00a2f328c97a9e205a34ebe1f657cb017bdea6da4826604fa1
MATLAB
3,973
90
% function subject_FD_parse(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm) % function subject_FD_parse(runs,FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm) % POST FIDL Version to read in new FD Vector % Iterates over range of values from 0.1 to maximum of 0.5 FD threshold % Outputs to .mat file ...
040ba8674012b8849f330f5f4a1cde04125749ebeb9af9840f6420948d439037
MATLAB
3,977
143
%% For Amin's Gen Analysis %% Prep & Pre-allocate clear;clc;close all % get files files = dir([cd '\**\normGainPost.mat']); Hz_p2 = NaN(length(files),1); Hz_p5 = Hz_p2; Hz_1 = Hz_p2; Hz_2 = Hz_p2; Hz_3 = Hz_p2; Hz_4 = Hz_p2; mouse = cell(length(files), 1); cohort = mouse; Hz_p2_goodC = NaN(length(files), 4); Hz_p5_go...
ec574e883f14f1ad11f6e4d4fa170fce3f8392403e8caa7a89888c1b9c60318a
MATLAB
3,978
116
%Test FmaxGRP 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'); %De...
62c56237fa3894f6f0d5a359fe6f9e13e4d6a51f9d34e346c0da53093a45d8eb
MATLAB
3,980
124
%% Side prediction using rates and SVMs % CMG % 7/15/2022 data_path = '/Users/celia/Documents/two_context_data'; % change this load(fullfile(data_path, 'ratemaps-2021_12_1_12_34_49_K1_d4.mat')); minTrial = 4; animals = extractfield(ratemaps.data, 'animal'); cPred = cell(length(animals),3); northDigs = {'Corr'}; sout...
6a05914f466cbac112b4f4d203492fe085ddd3b3c1dd0b53952fa63e917bfdf8
MATLAB
3,980
98
function [event] = read_nmc_archive_k_event(eventfile) % READ_NMC_ARCHIVE_K_EVENT extracts event-data from nmc_archive_k datasets % % Use as % event = read_nmc_archive_k_event(eventfile) % % % This function specifically only reads data from one of the archived % datasets of the Neurophysiological Mechanisms of Cogni...
dc16629aff5c24c2e4d41a6a3fc380edaa9f4577fd2f168ea584dc0773d52046
MATLAB
3,980
133
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % Figure S16A and Figure S16B (Absolute Rate Difference for Tetrodes separated by cell type) % This uses the min occupancy of 50%. close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = CHENGS_TASK_2C_FIGURES...
1af2262c3061aa102da65feb6eda39a0e1d0be0b3a265b180ea86d3bc6544cbd
MATLAB
3,981
115
function val = checkDtype(name, type, val) %ref %any, double, int/uint, char persistent WHITELIST; if isempty(WHITELIST) WHITELIST = {... 'types.untyped.ExternalLink'... 'types.untyped.SoftLink'... }; end %% compound type processing if isstruct(type) names = fieldnames(type); assert...
2426d6b3f0378d7c6b6c2f76b6e7cb52bc2ad34d28fcedcda75e14c3a3d20987
MATLAB
3,982
129
function plot_ct_event(pyr_mean_activity,som_mean_activity,pv_mean_activity,save_yn) frames=size(pyr_mean_activity,3); num_ds=size(pyr_mean_activity,1); %% PYR ACTIVITY DURING EVENTS figure(99) hold on set(gcf,'color','w') % Pyr during SOM x = linspace(1,frames,frames)'; y = squeeze(nanmean(pyr_mean_activity(:...
da7a0fbf009514af486f8d777082f78fd551e19fb4d7609f401e4b4400fc79f0
MATLAB
3,986
131
function [acc,left_num,right_num] = TSLDA_DGFMDM(MIEEGData,label,Fs,LowFreq,UpFreq) % Input: % MIEEGData:The raw motor imagery data % label: motor imagery data label, 1 and 2 % Fs: the sampling frequency (in Hz) % LowFreq: High pass filtering parameter settings % UpFreq:Low pass filtering parameter settings...
2c3cf4b3d29551a90cfda73add5b55f072af5ac98a804659d7ea1600b7953a21
MATLAB
3,987
120
function amps = Amplitudes(stimchans) % function amps = Amplitudes(stimchans) % % this program runs through amplitudes in pseudo-random but increasing % order for the given electrode pair. It takes about 10 minutes to run. % % INPUTS % % stimchans a 1x2 matrix with the two stimulation channels cerestim ...
e3a3691b22c4069d47d8af7445bbafd6d1b4a5597ed906ef82d02d37bf88bc77
MATLAB
3,987
98
function fH = makeSupplFigure2_SuppressionDeltas(ds,lmmResults,roisToPlot, ... cmapROIs,subjnrs,useSTRetParams,temporalModel, spatialModel, ... saveFigs,saveFigDir) % Function to reproduce supplementary figure 2: % panel a: Difference in suppression level (LMM slopes) vs ROI vs stimulu...
7cb2331392101b91f40fe24a5e15a3e4b5858fb62d28477c61c7494bd5103e21
MATLAB
3,990
94
function [task myscreen] = taskTemplateDualSubsidiary(myscreen) % This is an example of an RSVP task at fixation % I've taken out the parts where I keep track of % correct and incorrect responses, for the sake of % keeping the code simple. % % In this task, subjects must press a key % when they see an 'X' % show RS...
ec4031886fe8086e3ab8a7598f7825baf7135fa9af65c8d56100ba53b2aff05a
MATLAB
3,990
101
function [dat, dimord] = read_shm_data(hdr, chanindx, begtrial, endtrial) % READ_SHM_DATA reads the data in real-time from shared memory % this is a helper function for READ_DATA % Copyright (C) 2007-2009, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the docu...
92cbcdaee8004539420258925c9c7e296ba1b9fe839ad0f5712d48a0242442a7
MATLAB
3,993
87
% dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4'); % dir_SUNS_sub = fullfile('SUNS_FISSA_SF25','4816[1]th3'); % dir_SUNS_sub = fullfile('SUNS_TUnCaT_noSF','4816[1]th2'); % dir_SUNS_sub = fullfile('SUNS_FISSA_noSF','4816[1]th2'); addpath(genpath('.')) %% % name of the videos list_Exp_ID = { 'c25_59_228','c27_1...
550f7bd1636e9fc4e93f42b391e88f7c412d5af673b0f2924fef7839b5f1d480
MATLAB
3,995
104
function [version] = hasyokogawa(desired) % HASYOKOGAWA tests whether the data input toolbox for MEG systems by % Yokogawa (www.yokogawa.com, designed by KIT/EagleTechnology) is % installed. Only the newest version of the toolbox is accepted. % % Use as % [string] = hasyokogawa; % which returns a string describing ...