sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
66f807a067cb864729a56baa28b8c2fbdc8ae86b42642c01db972a2f4ca583ec
MATLAB
4,496
135
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_bestaligned_registered(BestAligned, MapsData, registeredCellName, doNormalization) hFig = figure('position', get(0, 'screensize')); maxTrials = 6+2; cdata = BestAligned(ismember(BestAligned.regis...
eeadf089c83df314154e3cf7c21dc70e14ec0ac9f63c988cd1bdba05191fd77b
MATLAB
4,497
215
function[]= check_redcells(redcell_vect,cell_stat,img,thresholds,shift) xshift=shift(1); yshift=shift(2); cellstat_ids=1:length(cell_stat); %% figure subplot(1,2,1) %redcells on short image imshow(img.short) caxis([0 max(max(img.short))/thresholds(1)]) hold on red_stat=cell_stat(redcell_vect); red_ids=cel...
1ff74f303742c872f27667a5ec472a961a239f846afec672414ea55eeb4b811a
MATLAB
4,499
139
%# usage: y = filtfilt(b, a, x) %# %# Forward and reverse filter the signal. This corrects for phase %# distortion introduced by a one-pass filter, though it does square the %# magnitude response in the process. That's the theory at least. In %# practice the phase correction is not perfect, and magnitude response %#...
a7ef9c5a6510f34d848013ba2c799f776fa974e9d72af7b7a8cb45b62a97d37a
MATLAB
4,499
120
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This loads celias tetrode data into a form that can be used by the % population vector code function [T] = load_celia_data_structure_as_table_v3(data) %data = load(dataFilename); %data = data.ratemaps; animalNames = ex...
2ae4fcd32afa622c347d69566aa53ac13349797f7490d4e84a9011fb2d223d16
MATLAB
4,501
99
% RIDGEORIENT - Estimates the local orientation of ridges in a fingerprint % % Usage: [orientim, reliability, coherence] = ridgeorientation(im, gradientsigma,... % blocksigma, ... % orientsmoothsigma) % % Arguments: im ...
5705970372a7b900b55a347449a50fa9eb921148252718c3abfa6672593f67f5
MATLAB
4,501
169
function [vol] = dipoli(vol, isolated) % DIPOLI computes a BEM system matrix % % Use as % [vol] = dipoli(vol, isolated) % Copyright (C) 2005-2008, Robert Oostenveld % % $Log: dipoli.m,v $ % Revision 1.3 2008/12/24 10:25:41 roboos % cleaned up the dipoli wrapper, replaced the binary by a better one and added a cop...
5e3c524a3683143a9f98e6bdf70d3c07e7bea54c4972c2a5d7cf849e225322ff
MATLAB
4,502
139
%%%%%%%% edit these values %%%%%%%% frequencies = [ 10 ... 20 ... 40 ... 80 ... 100 ... 160 ... 200 ]; delays = [ 0]; intertrialinterval = 5; % in seconds numtrials = 5; stimamplit...
8790ed76c663e411fb8de3d311d80fdb2357fe5953f480ebc413aa9ff362a0cf
MATLAB
4,502
123
% getVarFromParameters.m % % $Id: % usage: getVarFromParameters(varname,e,<allPossibleVals=0>) % by: justin gardner % date: 03/16/07 % purpose: get a variable name from task parameters, could be % will return the full qualified name of the variable % e is returned f...
f317b17a27854f5f213ee8785f8ecccb95324e323b9939fd159fdabdaa15f4ac
MATLAB
4,502
138
function [TR,W]=TriQuad(TR,W) % Subdivide a triangular surface mesh using generalized triangular % quadrisection. Triangular quadrisection is a linear subdivision procedure % which inserts new vertices into the input mesh at the edge midpoints % thereby producing four new faces for every face of the original mesh. %...
5b6d5b45beee1bc89450be2cc5e191685291c4d4dce19af65c020510e6ec2d9f
MATLAB
4,504
147
% plotDFFCond_bouts.m % % Function to plot output of saveDFFCond_bouts(), pooled across % multiple flies and conditions. % User specifies number of conditions, and then selects files (1 per fly) % for each condition through GUI. Plots mean for each fly and mean across % flies for each condition (different colors ...
ccd893ac94939497f70a8df3255b34b79ce602bd7f220b37065d1062178e7aec
MATLAB
4,504
131
function flag=SONImport(fid,varargin) % SONIMPORT copies all channels into a MAT-file % % Note: Use ImportSMR in the sigTOOL package in preference to SONImport % unless you want data stored in the same way as with previous versions of % the SON library. % % SONIMPORT(FID, {OPTIONS}); % where: % FID is the matla...
e270bcb08a5e8920ceba3def834db2ec714674968e820919ac82bc7cbdda981f
MATLAB
4,504
133
%get statistics from Amo data %First time learining data from Amo - assumes data in same directory as .m %file. Otherwise need to set path for the .mat file %Only first 40 trials, or less if there are less type 1 trials are used %This is because ther seems to be a habituation of US response for a larger %number of tria...
edfceec0477266dae84daaaba762306003f4ef7eba9b1fa16dcffb885311dcc3
MATLAB
4,506
137
% % Please cite this paper if you use any component of this software: % S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast % and robust active neuron segmentation in two-photon calcium imaging using % spatio-temporal deep learning," Proceedings of the National Academy of Sciences (PNAS), 2019. % ...
4da7f5ac9473642440e0b718ec4271c5e84bafe44662b82e07429421e9b24345
MATLAB
4,507
120
% initUserDAQ.m % % Function to initialize user DAQ (i.e. DAQ that coordinates experiment and % collects appropriate voltage signals) % Sets up channels and DAQ and channel settings. Does not set up any % experiment-specific output streams. % % INPUT: % settings - struct from ephysSettings() containing all DAQ sett...
8089ac2ee52335f2e68a13131c8807cf762af1a718aa1921b057057d5e4c2c37
MATLAB
4,507
155
function [] = ExtDataFig05_pIP10_OptStim_TuningCurve_Song % Code for plotting the tuning curves of pulse and sine songs induced by optogenetics in Extended Data Fig. 5i. GT = 'TN1dsx'; TargetPeriod = [0,10]; %% parameters nTrials = 3; nStim = 6; T = 1370; % T DAQrate = 10000; x1 = [0:1/DAQrate:190-1/DAQrate]; PreD...
19e9b848bc8919d98d0f8fcc15c611b9faf369c966c835d8e3fe05a51446a192
MATLAB
4,512
132
% taskTemplate.m % % $Id: taskTemplate.m 217 2007-04-04 16:54:42Z justin $ % usage: taskTemplate % by: eric dewitt % date: 03/19/2010 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: example program that demonstrates a gaze contingent experiment % (displays...
e5f0707a229704ef55900393a1bba55fe6da8dda1aefcc18db171c5740ffa904
MATLAB
4,513
113
%% CREATE VARIABLES/ SET PARAMETERS if ismac base = '/Volumes/Runyan/Potter et al datasets/'; else base= 'Z:\Potter et al datasets\'; end datasets = {'EC1-1R/2021-11-05/', 'EC1-1R/2022-01-13/','FL5-3L/2022-03-09/','FL5-3L/2022-04-18/','FU1-00/2022-03-17/','FU1-00/2022-05-10/','GE3-00/2022-10-27/',... 'G...
f18cffd2076e211db0a4dae52a5e4e9b0e9f73ddece5fe2ce418b47771d87043
MATLAB
4,514
148
function script02_proofread_vols(samplei) % merge axons, myelin & cells into one volume and remove small spurious % objects from the segmented volumes for better visualization % samplei = the index of the sample to analyze % % This script needs the original DeepAcson segmentations in folder % White_Matter_EM/*/ % The...
4adcd7e2614d28f83cb0cd51128dcfc4cf59a0459433d7fba43ed01395c51e76
MATLAB
4,515
83
%put too much effort into these, I'm saving them in case they were needed. %But basically left RFt on left sensors (and vice verca) doesn't make sense %as the other hemifield is being flickered with another frequency and isn't %a good control. %% calculate MI-RFT left (MI_63_right + MI_70_right) on left sensors %%%...
d68da557cc13206008e862db414c55674205c975d4e3d6168e03e1ecefa7b82f
MATLAB
4,517
116
% BAYESIAN BOOTSTRAP CREDIBLE INTERVAL SIMULATION SCRIPT clear % bootbayes settings nboot = 10000; prob = 0.95; prior = 1; % Simulation for prior set to either 1 or 'auto' switch (prior) % Set weight for estimates of the moments from the samples in the simulation case 1 w = 1; % For standard deviation using d...
1a167074cc0cff539e2728de8603be149e242c4df0965ceb4055d6e917192f6f
MATLAB
4,519
98
function fhand2 = smrCopy(smrFile, ending) maxPointsToRead = 200000000; %% Open file & gather info activateCEDS64; fhand1 = CEDS64Open(smrFile); if (fhand1 <= 0); fprintf(fhand1); CEDS64ErrorMessage(fhand1); unloadlibrary ceds64int; return; end [~, OldFileId] = CEDS64AppID( fhand1 ); timebase = CEDS64TimeBase( fh...
14a76768146f11a8fa29f9c1ada6aca25da40319931dbe085c2dd5a7c7a4c478
MATLAB
4,523
153
% mglMetalBltTexture.m % % usage: results = mglMetalBltTexture(tex, position, hAlignment, vAlignment, rotation, phase, width, height, socketInfo) % by: justin gardner % date: 09/28/2021 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Private mglMetal function to blt text...
2f170c82726305851108a1f37d244e21654a013100f3719105e1146812daf795
MATLAB
4,534
153
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = plot_normal_bfo90_table_withinacross(NormalBFO90, DaysToSessions) % Makes a figure with 4 subplots each with a BFO 90 SessionsEarly = DaysToSessions(ismember(DaysToSessions.dayNum, [1,2]),:); MatchE...
77b688a44756db896ea4a7177e223d0a1840226a05fce870483df4d4495ec7ab
MATLAB
4,535
103
%MGL library functions % %Main screen functions % mglOpen : Opens the screen % mglFlush : Flips front and back buffer % mglClose : Closes the screen % mglResolution : Sets the resolution of a display % %Other screen functions % mglSwitchDisplay ...
1c1e3e772552226d2a15c07cf83e9dc4c4e9f897863fb9fa370f9588e7d75c53
MATLAB
4,536
155
%% structure parameters num_columns = 3; 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 = 160; %% time parameters dt = 1; %time step T = 100/dt; %time stimulated T_R = 150/dt; %time of reward delta = 600/d...
e7cd45d7883abc59f7eb33fd438938bdb8b541a28f3dd5725b5f7840f737009d
MATLAB
4,542
166
function hdr = load_nifti(niftifile,hdronly) % hdr = load_nifti(niftifile,hdronly) % % Loads nifti header and volume. The volume is stored % in hdr.vol. Columns and rows are not swapped. % % Handles compressed nifti (nii.gz) by issuing a unix command to % uncompress the file to a temporary file, which is then deleted. ...
1f54ecfb4015fbe8b61322d6b3455dede580900624df079282446485083cb711
MATLAB
4,543
104
function varargout = spm_select(varargin) % File selector % FORMAT [t,sts] = spm_select(n,typ,mesg,sel,wd,filt,frames) % n - Number of files % A single value or a range. e.g. % 1 - Select one file % Inf - Select any number of files % [1 Inf] - Select 1 to In...
4c83db53f9a36ffe071a062c290bc0a4b65caaa0255fc1dde5df368a10fbecba
MATLAB
4,544
156
function dim = crossvalidate_fa(X, varargin) % % dim = crossvalidate_fa(X, ...) % % Cross-validation to determine optimal latent dimensionality for % factor analysis % % xDim: data dimensionality % N: number of data points % % INPUTS: % % X - data matrix (xDim x N) % % OUTPUTS: % % dim - structure whose ith e...
73cbd6a25b7427bfbe985a9117e75878188a24ea9354e31b57a142e6c1656130
MATLAB
4,546
146
function BNV_surface_and_nodes(data, NIFTI, node_coords, surface_node_idx, Config, surf, savename) %BNV_surface_and_nodes Create a BNV image that colors both a brain surface %and nodes (likely subcortex nodes) simultaneously. % Usage: % BNV_surface_and_nodes(data, NIFTI, node_coords, surface_node_idx, Config, s...
42986bbccde8aeb1910ce18c94e405cb5762f6e7d89e81b0381fbcfd43d7729a
MATLAB
4,547
120
% fwhm.m % % Function to compute full width at half max (FWHM) given x and y. X is % what width will be computed on; y defines peak. % % INPUTS: % x - vector that defines width of peak % y - vector that defines height of peak % valInd - indices into x/y in which to find peak % minOrMax - 'max' or 'min' for whe...
678013261611506593e3e16ee6d527fdb05baf934a54791ad438ae199c5a1861
MATLAB
4,548
116
function [newW,varargout] = minimiseMaximumRealEigenvalue(W,ICells,Options) % minimiseMaximumRealEigenvalue optimises weight matrix to be stable % newW = minimiseMaximumRealEigenvalue(W,IndexI,Options) iteratively alters % the original NxN weight matrix W to minimise its maximum real eigenvalue % and so enforce stabil...
70bbbdc1a30719037e82d7401fbba422ae5eaea64075faf8ffc8b746f705a8be
MATLAB
4,549
120
function timelock = ft_datatype_timelock(timelock, varargin) % FT_DATATYPE_TIMELOCK describes the FieldTrip MATLAB structure for timelock data % % The timelock data structure represents averaged or non-averaged % event-releted potentials (ERPs, in case of EEG) or ERFs (in case % of MEG). This data structure is usually...
9d51e2e4fd418c0577a1ce3a2471f6aeec9fc9a0afc4974020f4011d9c817564
MATLAB
4,550
160
function [chi_M, chik_tkd] =SFCR_m_SB_k(deltaB, D_k, maskErode, maskSS, wG, lambdaSet, itermax, thred) % [chi_M, chik_tkd] =SFCR_m_SB_k(deltaB, D_k, maskErode, maskSS, wG, lambdaSet, itermax, thred) % SFCR M-step using Split-Bregmen L1 solver, usin k-space based version % % Input: deltaB, D_k, maskErode, maskSS, wG...
102bbc0329911d97b30f04a1b44bb3fbf1ce4f110ff4c6d7ff611a538f1e9967
MATLAB
4,551
163
function [Blocal, chi_source] = dipolefit_v2(data, mask, weight, Params, tol, itermax, centerswitch) % [Blocal, chi_source] = dipolefit_v2(data, mask, weight, Params, tol, itermax, centerswitch) %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Purpose: % dipole field fitting for rem...
828375914cedeb5ce6ceda331ef7e81c5f4ee586e479ba37a3c3e4730e069b18
MATLAB
4,556
193
function batch_data=batch_do_data_crop(train_opts, imdb, work_info_epoch, batch_data, work_info_batch, work_info) data_crop_config=train_opts.data_crop_config; if work_info.ref.run_eva || ~data_crop_config.do_crop batch_data.crop_info=[]; return; end img_data=batch_data.img_data; mask_data=batch_data.la...
5521be762d8fa6f3c660ae7a49f87cdefc931ca56f9553622e47caba5d3f0ff0
MATLAB
4,557
106
function [] = plot_worm_frame_post_analysis_showing_path_mochi_data(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio,smoothed_path_x,smoothed_path_y,stimulus_delivered,path_history,demo_mode) % % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, Unce...
d242a0aa13c7c59ae26bafede0e17869f2ae52484b3c732ce7b87d67848a029f
MATLAB
4,557
80
% run amapOFshow clear all; runMode = 'batch'; globals; initglobals; PLOT_TYPE = {'tuning'}; % {'map'}, {'trajectory'}, {'tuning'}, {'map';'trajectory'} ; VarMargin1=0; VarMargin2=0.01; Nshuffling = 100; runShuffling = 0; %runRmap = 0; % make this option... IncludeFileCell = {'opF'}; %{'opF';'nW'} Exc...
d3b64865198374d07a99b250fd6fa4d25ea41043de1b45e2231fc52b91015498
MATLAB
4,557
142
%% Path & Parameters HEM = {'LH','RH'}; SUB = 1:15; ROIN = {'left HG','left TPJ','right HG','right mSTS'}; nROI = 4; nROI_hem = 2; % datapath: change to local path dp = '../SOURCE_DATA'; load(fullfile(dp,'results_PATSIM.mat')); addpath('./etc'); % make it easier to code s2s_cor = single2scene_cor; %% Figu...
eb6d8eb6f83d63a6e3c0e3cddeb462c43ff868c00d8ce4d72e036d99f644592b
MATLAB
4,558
82
function [Tracks, number_of_behaviors] = find_stereotyped_behaviors_from_velocity(Tracks) % not used in paper number_of_behaviors = 5; fps = 14; duration_cutoff = 0.5 * fps; if isempty(Tracks) return else Tracks(1).BehavioralTransition = []; %preallocate memory end ...
7b42d9fe2338a72740310d38b50155f733035608f02fe84ac5179dcbae64cf77
MATLAB
4,559
147
% BOOTSTRAP CONFIDENCE INTERVAL SIMULATION SCRIPT % EVALUATION OF INTERVAL COVERAGE, TAIL PROBABILITIES, LENGTH AND SHAPE clear % Save warning states and turn off all warnings state = warning ('query', 'all'); warning ('off', 'all'); % Set significance level alpha = .05; % 95% confidence interval %alpha = [....
63b263157ffb7807aa9c8ed4c17c0a0258484a7ee369b82aadd96b01aedd36ff
MATLAB
4,560
146
% mglBltTexture.m % % $Id$ % usage: results = mglBltTexture(tex, position, hAlignment, vAlignment, rotation, phase, width, height) % by: justin gardner % date: 05/10/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Draw a texture to the screen in desi...
1280edfa678f9fe6a27313dde6d9d74ea33bb5351bb3828c547d3f8c31750188
MATLAB
4,561
130
classdef rpgdegibbs < handle properties (GetAccess = public, SetAccess = private) end methods (Access = public) function this = rpgdegibbs() end function imgdg = degibbs(this,img, dim, pf, params) if nargin <= 4 ...
60b418ad32f454a46a22fd86fccf9fdf48212ed635948252d9ecd9064c41fbc2
MATLAB
4,561
123
function mltp_compute_bfo_90_wc(obj, session) % Allow the function to run so that other functions do not break, % but give a warning. if session.getNumTrialsToUse() < 2 warning('This function requires the session to have more than 1 trial.'); end % We have to use the shrunk data if the ...
a5c55fdd7360abd03905eaf46c546882703c06838d63b12c5bac17f718d48781
MATLAB
4,561
169
function [vol] = openmeeg(vol, isolated) % OPENMEEG computes a symmetric BEM system matrix % % Use as % [vol] = openmeeg(vol, isolated) % % Attention: the normals of the mesh describing the volume conductor are by % FieldTrip convention pointing outwards (with respect to the mesh center), % whereas OpenMEEG binari...
045b51ee5bed2abcb92e7d29184e3de9b1593960b1df5f00f1f925083f957016
MATLAB
4,562
137
function [hdr, dat] = read_neurosim_evolution(filename, varargin) % READ_NEUROSIM_EVOLUTION reads the "evolution" file that is written % by Jan van der Eerden's NeuroSim software. When a directory is used % as input, the default filename 'evolution' is read. % % Use as % [hdr, dat] = read_neurosim_evolution(filename...
44281dc3fd1c868d8e2a4a8a76a5cf3487ef7dec9c0c4bff342365529f117fc1
MATLAB
4,562
151
function [change_explained_by_adap,FR_touch]=all_Tcurves_per_whisker(fig4) do_extra_plot=0; counter=0; counter2=1; av_unit=0; percentile_1=0.95; percentile_2=0.95; NpointsTcurve=4; ff=dir('*.mat*'); nunits=33; FR_touch=nan(nunits,4); h_atte=nan(nunits,1); coeff1=nan(nunits,2); coeff2=nan(nunits,2); for f=1:size(ff,1)...
9d3a977b7d7eb0ca2aea8a9077bd1487696a74b72993d18ebbf344ccc80cddbf
MATLAB
4,562
145
%-------------------------------------------------------------------------- % sampleparcels.m % Identify 10 parcels, each belonging to one of 10 functional networks, and % choose a column that is central to each parcel. %-------------------------------------------------------------------------- %close all % Note: I ca...
69d4899f413125a71878aaa85fa56fd5e5d75426c2a7882155e732e978634884
MATLAB
4,570
150
function [S,gammas]=eventSamples(A,n,varargin) % eventSamples Compute multiresolution ensemble using event sampling. % % Syntax %__________________________________________________________________________ % % [S,gammas]=eventSamples(A,n) % % [S,gammas]=eventSamples(__,Name,Value) % % % Description %_________________...
73d976194c916c9894f6c06b52436fb32719607f37b40578e3e62116c6ad65d5
MATLAB
4,573
159
% % Please cite this paper if you use any component of this software: % S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast % and robust active neuron segmentation in two-photon calcium imaging using % spatio-temporal deep learning," Submitted to PNAS. % % Released under a GPL v2 license. %% funct...
361a7ebbc4968a98cb1e10342dfc74157fb2b859bec4e3ea1beb6d3e33c8dab5
MATLAB
4,574
144
% plotIInjFicTracChangePos_allFlies.m % % Function that plots effect of current injection on FicTrac position % parameters. Specifically, for each fly, plots the average across trials % of the difference in cumulative position/angle between a start time % point and an end time point relative to the current injectio...
e9af141b488f4ee18d7dbdfd30b1eec48f8278c3b52aa54821cd99ec0b6b95d2
MATLAB
4,574
99
% convert UGR raw behavioral to BIDS events % set relative directories filePath = matlab.desktop.editor.getActiveFilename; [codedir,name,ext] = fileparts(filePath); [basedir,~,~] = fileparts(codedir); maindir = fullfile(basedir,'bids','sourcedata','Scan-Lets_Make_A_Deal'); % load subject list and loop through subs su...
28bdf144208528ead401c9c9b0f34ffc32c74e047fb769de876530b8cfc90b6d
MATLAB
4,575
156
function [] = ExtDataFig04_OptStim_TuningCurve_Song % 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 TargetPeriod = [0,10]; %% parameters nTrials = 3; nStim = 6; T =...
88d91cd30ed397bdbc65f9a11de63ad9afbab80012e0e45d71bfeadff5d1060c
MATLAB
4,575
173
function [lambda1,lambda2]=Tcurve_touches_dk_cross_val(touches,touches_whisker,psth,k_c1,k_c2,do_plot,N_first) %this code assumes that the input is dk1 and dk2 counter=1; k_hor(:,:,1)=k_c1; k_hor(:,:,2)=k_c2; window=100; window_ad=600; %N_first=5; N_latter=N_first; percentile_1=1; percentile_2=0.95; if do_plot figu...
06fa3f3eab7d81ac5db2e83fd9eea8144700a87a87d5f035960993bd4ae62cd8
MATLAB
4,577
144
function [resmat,mdls,rpInfo] = getLastSpkResiduals(data,resopt) %getLastSpkResiduals.m concatWins = optCheck(resopt,'concatWins',false,[true false]); oneModel = optCheck(resopt,'oneModel',true,[true false]); model_order = optCheck(resopt,'order','auto',[]); if isnumeric(model_order) rpInfo.RPend = model_order; e...
639ab553b522a6207624b6d4ad5080af70cb69740cfa0418f2ef8d8afb47d704
MATLAB
4,578
135
% ********** Setup the directory on your computer ********** clear restoredefaultpath filePath = matlab.desktop.editor.getActiveFilename; root0 = fileparts(filePath); addpath(genpath(fullfile(root0,'lib'))); root = fullfile(root0,'data'); projname = 'cylinder_1'; %% Read simulation result files = dir(fullfile(root,pr...
ad4a0bbb02ff22fe2fd65af4c5ae050616d65e2cb34477ab54d2f63d2db28702
MATLAB
4,580
127
classdef MLVideoRecord < handle %MLVideoRecord A video record % This class loads and saves the timestamps and associated % information for a sequence of videos representing one % video record. properties (SetAccess = private) thisFilename = ''; datasetName = ''; su...
e3dfc764ca3d8d79e7ab748065252cc9560a0bf1e5c883b25e5e90f67c5b6080
MATLAB
4,581
127
function fH = makeSupplFigure4_DistributionCSTExponents(ds,roisToPlot,cmapROIs,saveFigs, saveFigDir) % Function to reproduce supplementary figure 4: % Plotting the distribution of fitted CST pRF exponents % % From the paper: % Title: Rethinking simultaneous suppression in visual cortex via % compressive sp...
1a90d966ca0e717c3d21d3616908df4987e8a44dbaaf8df6d16b50d0c45d6065
MATLAB
4,582
96
function [UL_results_A, HF_results_A, UL_results_C, HF_results_C] = ET_average_group(results, name) all_participants = fieldnames(results); UL_results_A_mean = zeros(2,6); HF_results_A_mean = zeros(2,2); UL_results_C_mean = zeros(2,6); HF_results_C_mean = zeros(2,2); HF_results_A = []; ...
89f803f4f4aff236396a0330dd7878d2fb8ebeeda9d602459b7a3e58d4bc1931
MATLAB
4,582
128
% zipFfmpgLegVid.m % % Function given trial with leg video, generates .mp4 file from individual % tiffs and zip file of same tiffs for that trial. % Called by preprocessLegVidFiles(). Does not stand alone. % % INPUTS: % inputParams - metadata about trial, loaded from saved data % scriptsPath - full path to where ...
fb9cb5d5cd5efe2f840ab320891319f6d30795577fffe2066d929b575394078a
MATLAB
4,583
207
function DATA = aedes_readfdf(filename,varargin) % AEDES_READFDF - Read Varian Flexible Data Format (FDF) 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...
d0def538ad6295a0fde2f402cae5de2b1e87bfb0b10a575c650746e2e0038076
MATLAB
4,584
88
% Function File: yf = hpfilter (y, t, Fc) % % Fast algorithm to high-pass filter y-values at the specified -3 dB % filter cut-off (Fc) using binomial filters. % % This algorithm executes cycles of anti-alias filtering and data % reduction for improved speed. The net result following sequential...
ed61cdaedd0435148e362ebb1ae7f1a597886cf8e94587b731eb2ea0e0b74c5d
MATLAB
4,584
129
% findFlyNotMovingFt.m % % Function that takes in fly's smoothed, normalized total speed, a % threshold on that speed, and a minimum bout length to extract when the % fly is moving or not moving. % Merges bouts that are too short and assigns % % Helper function for interactGetNotMovingIndWFt() % % INPUTS: % totSpd...
49101dcf41331f1c9095bb22bb7fd9a65d65bd5f62c346fd342bb9d0fa917e13
MATLAB
4,585
137
function [corrs] = get_ms_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_...
bd0e41b3b15e9fa5704d24ee162e151193d17a4ed06de0178053c613c61a3b07
MATLAB
4,586
159
function header = ufmf_read_header(filename) % header = ufmf_read_header(filename) % This version is designed to shadow the version in JAABA/filehandling. % Only difference is that it uses a file_object instead of a raw fid % when opening the file. The file_object should work just like the fid % except that it fclose(...
753874070a307542cbe2224df2933f9277cbf4f587d7b352ba0265b1c2b82529
MATLAB
4,588
122
% multiStepIInj.m % % Current Injection Function. Injects square current steps of user % specified amplitudes of user specified durations. Durations can be % different among steps. Has option to randomize amplitudes or not. User % specified step duration and time between steps. User specified space % amplitude....
ccd768ca0ad9a22c6b12a907acfe437adf4c6ff6f5278dc754c1e22c12a84b83
MATLAB
4,588
196
function dataformat = aedes_getdataformat(filename) % AEDES_GETDATAFORMAT - Try to determine the data format of a file % % % Synopsis: % dataformat=aedes_getdataformat(filename); % % Description: % Returns an identifier string corresponding to the data format of % the file FILENAME. If the data format...
b516cccd612fbd5b705e692f147381730cd0619cc1ba3686a1252f5045dec6cf
MATLAB
4,593
122
<<<<<<< HEAD function [gms, gmsTime, gmsTime_n] = createGMS(result_f, key_f, general) % Calculate GMS gmsTime = 0; gmsTime_n = 0; oldID = -1; w_r = 0; % Only for matching_function == 'library'. % I load the library for better performance if strcmp(general.MATCHING_function, 'library') == 1 loadlibrary(general.MATC...
1a71275104f06a0bad496c18418a37ea9260dbef14ede063a2d7a295eec4c987
MATLAB
4,594
178
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % % Inputs (required) % x - vec...
717c70397150f26524a49d45764f053a9cf593d803531982a04c136e87542428
MATLAB
4,597
143
% run after SimulationFig4E.m & spkcounts.m % spike counts data provided for nws=1 (set Nnws=1) %% PARAMETERS conditions = {'SOM', 'PV'}; Np=2; %%number of conditions? Nsample=length(ds); % 10 samples per weight matrix realization rs = 5; %%random resamples of the neurons M=40; % latent dimensionality to fit data N...
aa2d2f4ddc41489ae5a2a555a1da16932ebb6971175026af30a7de425a807df5
MATLAB
4,597
154
function PrepareFlyTracker4JAABA(expdirs,varargin) if ~iscell(expdirs), expdirs = {expdirs}; end [rootoutdir,rootdatadir,dataloc_params,analysis_protocol,settingsdir,forcecompute] = ... myparse(varargin,'rootoutdir','',... 'rootdatadir','',... 'dataloc_params',[],... 'analysis_protocol','current',... 'set...
e38199bfee80872a2fd138c948cf1a4616b5c35e43fd30965f0a37b948353dc3
MATLAB
4,597
142
% plotSpikerateCond_bouts.m % % Function to plot output of saveSpikerateCond_bouts(), pooled across % multiple flies and conditions. % User specifies number of conditions, and then selects files (1 per fly) % for each condition through GUI. Plots mean for each fly and mean across % flies for each condition (diffe...
74ef8e01ec834f3d00eeafea350c7efd42c4258642f1086befffb7731d79e2bc
MATLAB
4,599
153
function obj = subsasgn(obj,subs,dat) % Overloaded subsasgn function for file_array objects. % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: subsasgn.m 8776 2013-11-14 09:04:48Z roboos $ if isempty(subs) return; end; i...
ff56886badf207cec55c98182a64887ce4cefe01a56dcba799527262b8322a4e
MATLAB
4,602
127
function [ds_unit_angles,ds_within_angles,unit_angles,within_angles] = get_vector_angles(outcomes,ds_events) sunit_angles=[]; swithin_angles=[]; punit_angles=[]; pwithin_angles=[]; eunit_angles=[]; ewithin_angles=[]; peunit_angles=[]; pewithin_angles=[]; seunit_angles=[]; sewithin_angles=[]; ds_unit_angles=nan(5,1...
f970f4a2e98c2d2476f7bb23e0f32f0df439b8e0c0633c37e9e9e37b22ae7250
MATLAB
4,603
109
% mglTestMultipleSockets.m % % $Id: mglTestMultipleSockets.m % usage: mglTestMultipleSockets(socketCount=3, socketDir='/tmp') % by: Benjamin Heasly % date: 08/24/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test socket connectivity, read, write,...
9fd37e7ceb0ec4d1b78981e34f9d70df6e42cb45766c8a65f2f589e77c75d636
MATLAB
4,606
108
function [colors1, colors2] = getROISummaryColors(type) switch type case 0 colors1 = [... 38,60,142; ... % V1: Dark blue 73,115,184; ... % V2: Medium dark blue 142, 189, 228; ... % V3: Light blue 15,104,53; ... % hV4: Dark green 132,197, 81; ... %...
fbaeae0efd1e2172641992f8da0949874703d60035fe94394d1f8fbe9a3e6d8b
MATLAB
4,606
113
%% msBatchRun2018 % Version 1.0 GE % Updated version of the msBatchRun script originally proposed by Daniel B % Aharoni to analyse miniscope 1p calcium imaging data on large batches of % data. % This version is build on top of the original package to maximize compatibility. % It includes NormCorre for image registratio...
5f5681d052b7b541e01acef621d8643c756252919ada72946a820c4ef5dd9430
MATLAB
4,607
87
function [VarList, SetxBins, SetyBins,VarMargin1, VarMargin2] = getVarList(DATA_TYPE) globals; switch DATA_TYPE, case 'OF', %Set = 'all'; Set = 'free'; Set = 'o0'; Set = 'do21'; switch Set % Var1 -> x-axis and Var2 -> y-axis case 'all', ...
85657eb9769296abfa1bf2b505009d8fc3a95525093dc4ad529e986f7a5832ae
MATLAB
4,607
113
clc; %Recreate needed property constants defined in nilibddc_m.h DDC_FILE_DATETIME = 'datetime'; %Check if the paths to 'nilibddc.dll' and 'nilibddc_m.h' have been %selected. If not, prompt the user to browse to each of the files. if exist('NI_TDM_DLL_Path','var')==0 [dllfile,dllfolder]=uigetfile('*dll','...
c515c12144bfb3c02c3893a33d9407bf0bcbc15c5e4c5ed5388be0be741cebe7
MATLAB
4,609
156
function [] = ExtDataFig05_pIP10_AveTimeCourse_OptStim_Song % Code for plotting the time course of and the proportions of pulse and sine song in Extended Data Fig. 5g. GT = 'TN1dsx'; %% parameters nTrials = 3; nStim = 6; T = 1370; % T DAQrate = 10000; x1 = [0:1/DAQrate:190-1/DAQrate]; PreDurImg = 10*DAQrate; % 10 s...
49d3baa1d96bea9a25c50265d0665747a4b5eb4c0f8c6b2d057bea32c7dc8fdb
MATLAB
4,610
112
%% Constant Parameters for QSM_Toolbox_v3.0 % Authors: Jiri van Bergen and Xu Li % Updated by Xu Li, 2019-06-20 % Updated by Xu Li, 2021-06-23 for cluster version % Updated by Xu Li, 2023-06-01 added wsl support for pc % Updated by Xu Li, 2023-10-11 added default values for TemplateEcho and AvgBeforeBR handles....
e62285a8c5cc9354a663a5b09247557132c69e755f2ec7bb61fa5cf8c07aaf00
MATLAB
4,610
129
function [data4violins, mdl] = data_transform_DMM(filename) %plots superplots of data and compares using mixed model %ask for directory name for outputs prompt= 'Enter output directory name '; name = input(prompt,'s'); mkdir(name); %get names of sheets in input xls sheets = sheetnames(filename); %iterate through l...
9bdb9a7b57aca3549ba508bc18d98ae95d70f5682e81cab38d4c4dc2444f837d
MATLAB
4,611
107
function isPloted = plotTC(r,pop, Iattn, Delta_e,Delta_i, time, rawORenv, envWdo) %UNTITLED plot time course of the dynamics % parameters include r,v,g % save or not save, raw data or envelope % which population % rawOrEnv: 0 for raw data, 1 for envelope, 2 for both popName = {'1L23e','1L23i','1L4e','1L...
d3290876d525a3c657779e79f58be3babc36e76a9d4476c63198bb09c5268c3f
MATLAB
4,611
113
function PLOT_linearityComparison(mag_all, mag_chunks, vid_aligned, mag_aligned, keep, c, sacStarts, sacStops) figure(); www = tight_subplot(2,2,[.055 .025],[.04 .025],[.03 .03]); %% axes(www(1)) scatter(vid_aligned(keep), mag_aligned(keep), 4, c(keep), '.'); hold on colormap hsv plot(mag_all.yfit', mag_all.range', '...
6d4ccceb93a537af214d17a26726990c30a7288650b817eb63ae078f4e2db370
MATLAB
4,615
127
% data_ind = 4; addpath(genpath('.')) gcp; %% % name of the videos list_data_names={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'}; list_ID_part = {'_part11', '_part12', '_part21', '_part22'}; data_name = list_data_names{data_ind}; list_Exp_ID = cellfun(@(x) [data_name,x], list_ID_part,'Un...
fe04c90e9298163a5ced76f97c4ec3ac0025a8559111946fe71eab591d22a35f
MATLAB
4,617
122
% function figure2_from_xlsx(results, item_or_loc, id) % % Produces a figure from summary data in an Excel sheet % This function generates a figure based on the summary data provided in % the input struct 'results', which is loaded from an Excel file. The % figure produced corresponds to figure 2 in a publication, show...
df7718ce0dab3d5f97665e490ee586e0eafcc7e2e9cb1940764aab804f57e41f
MATLAB
4,619
137
function[data,h]=SONGetRealMarkerChannel(fid, chan, varargin) % SONGETREALMARKERCHANNEL reads an RealMark channel from a SON file. % % [DATA {, HEADER}]=SONGETREALMARKERCHANNEL(FID, CHAN{, START{, STOP{, OPTIONS}}}) % FID is the matlab file handle, CHAN is the channel number (1=max) % % [DATA, HEADER]=SONGETREAL...
c1f952e8da40bf114aa5c081742b8ebfa66b8ca0b264e52fbf2fbc74df07b64f
MATLAB
4,620
113
% % Draw a color-coded line by using the edge of a patch with no facecolor % % SYNTAX % ====== % h = cline(x, y [, z, cdata]) % % INPUT % ===== % x vector with x-values % y vector with y-values % z (opt.) vector with z-values % cdata (opt.) vecto...
3bcf3bb65549955da09f9528efe02cec43cac856066644ebbfdfc5ee7e21f106
MATLAB
4,621
149
function mosaic = sift_mosaic(im1, im2) % SIFT_MOSAIC Demonstrates matching two images using SIFT and RANSAC % % SIFT_MOSAIC demonstrates matching two images based on SIFT % features and RANSAC and computing their mosaic. % % SIFT_MOSAIC by itself runs the algorithm on two standard test % images. Use SIFT_MOSAI...
f39fc92c6959bf1ca8ed487d45ed77e9180cd69d53e45b594f156fac3946f8b8
MATLAB
4,621
134
% TREX provides X-Y data in cm, using a default value of 30 cm as the image % width. Use this value to recalibrate the data to the correct size % To ignore this conversion (if for example TREX is correct) assign 0 to TREX_meta_real_width % After measuring the number of pixels on the ruler and calculating from that the...
534ee2c3fd1022de4691ebfbf36ec7e704c11c8b4ec5f89530a8b202a53bc13d
MATLAB
4,622
82
function tuningA(var,uspikes,Fs) % I prepared a script (example.m) that calls all the functions needed to generate a directional tuning and compute the von Mises fits, so that you won't have to call each function separately. All the functions needed are in the zip file attached. % % If you run the example.m script...
42100428e2e99d3a49c8fd829f5c559301deba88bd4b6417911586df2a8607bd
MATLAB
4,628
72
% Get header of mri % [ Yokogawa MEG Reader toolbox for MATLAB ] % % brief: % This function retrieves header information of specified mri file (*.mri). % % usage: % mri_header = getYkgwMriHdr(filepath) % % arguments: % filepath : file path of *.mri file % % return values: % mri_header ...
bc90d14c7f50d2cab6cbca91d3063716a4c0f406b28d95e484828584e4b5527c
MATLAB
4,628
148
function toon_prfRun(baseDir, subjID, session, paramPath, imgPath, prfModel) % toon_prfRun(baseDir, expt, session); % % Step 4 of the workflow for analyzing toonotopy % Runs the prf model (CSS) % % Example input values % baseDir '/oak/stanford/groups/kalanit/biac2/kgs/projects/' % expt 'subj01' % sessio...
deb097b7bff1d2bbe151c69a6992e727e40e7b687741b2e3f1c96ea565c29ab6
MATLAB
4,629
148
function toon_init(baseDir, expt, session, canonXflag,clip, runBase) % % toon_init(baseDir, expt, session, canonXflag,clip, runBase) % % Step 1 of the workflow for analyzing toonotopy % Initializes the data for mrVista % % Default Input values % baseDir '/biac2/kgs/projects/' % expt 'spatiotemporal/experiments/si...
4449b290a8a6bf8f068962d307e6b6b2b431da335b2a4ed99aaab2873484155f
MATLAB
4,634
157
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function make_stabilitybfo90_percell_formatted_for_sigmastats_v2(analysisSettings, analysisResults, outputFolder) BestAligned = analysisResults.BestAligned; F = 'NormalPerCell90'; T = analysisResults.(F); [SessionsToGroups] = load...
187e924cd0b76ddecb8a311f07473376208f7b4ae6f2b68ed735c828e5739485
MATLAB
4,635
131
function flag=SONImport(fid,varargin) % SONIMPORT copies all channels into a MAT-file % % Note: Use ImportSMR in the sigTOOL package in preference to SONImport % unless you want data stored in the same way as with previous versions of % the SON library. % % SONIMPORT(FID, {OPTIONS}); % where: % FID is ...
52454b9cab06173d1212d928c1a52753de733127c6ca0e59a073e1722951b7a4
MATLAB
4,636
121
function [Net_para, Node_para] = gretna_batch_networkanalysis_bin(Mat_path, File_filter, Thr1, Thr2, Delta, N_rand, Stype, Ttype) %========================================================================== % This function is used to calculate several global and nodal network % metrics for both binary and weighted netw...
9e74539e9e494977832368245caa379eb64707b116d48a975ccc4fad80d96683
MATLAB
4,640
117
% analyzes a group of experiments and saves the properties % they will be saved inside the first folder; not used in paper %function LNPStats = CreateBehavioralMappingExperimentGroup() %clear all; %set up parameters recalculateSpectra = true; parameters.numProcessors = 15; parameters.numProjection...
f1a6788fc384fd617d5b7c0137cce4e46f516776bb1c0da1802f770e26bed654
MATLAB
4,641
127
% calculate all the things filePath = fileparts(matlab.desktop.editor.getActiveFilename); temp = load('all_epochs.mat', 'balancedgrouped'); balancedepochs = temp.balancedgrouped; num_of_raters = 7; num_initial_cols = 8; rater_comps = NaN(num_of_raters); for n=1:num_of_raters col = n+num_initial_cols; for m=1:n...
7baa0344773709bba62ef03c4c8a1f1323f47b779a60a36ca46d88fd248197e3
MATLAB
4,643
132
function [f, params] = get3DSpatiotemporalpRFs(params) % Description: Function that creates spatiotemporal pRF models % to use as linear filters. % % INPUT: % params : (struct) Params struct should have the following fields: % tktktk % % OUTPUT: % prfs : (double) matrix with [x-pixels by y-pixels (in ...
479f484482f29c9098537c5970625b561e71c5d7a2636ae07333376a6b4796d6
MATLAB
4,645
165
%% Calculate Blood Vessel Width Based on Full-Width at Half-Maximum method %Input: Single 8-bit tif image %TO USE: Draw straight line perpendicular to blood vessel %User drawn lines saved to image %Calculates vessel width based off user defined pixel_size %Output: Saves vessel width to excel file %Made by Chris...