sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0f9b775a7a437eb687c2c77bd574387b21786d8b178ab607b05920e8fcd0fcc0
MATLAB
1,276
42
classdef CurrentClampStimulusSeries < types.core.PatchClampSeries & types.untyped.GroupClass % CURRENTCLAMPSTIMULUSSERIES Stimulus current applied during current clamp recording. methods function obj = CurrentClampStimulusSeries(varargin) % CURRENTCLAMPSTIMULUSSERIES Constructor for CurrentClampStimulusS...
1d3bb2b028cc7280bc3b4c115a0ad86cb0cbedfcff4cb1dc75dd93b16c12bc09
MATLAB
1,276
42
classdef VoltageClampStimulusSeries < types.core.PatchClampSeries & types.untyped.GroupClass % VOLTAGECLAMPSTIMULUSSERIES Stimulus voltage applied during a voltage clamp recording. methods function obj = VoltageClampStimulusSeries(varargin) % VOLTAGECLAMPSTIMULUSSERIES Constructor for VoltageClampStimulu...
eee0c94adb5127c48bc3b5defd97e55f4f0706ca63a009fb35bd4f2629fe8c67
MATLAB
1,276
47
%% [B0_dir, TAng] = get_B0_dir_from_nifti(nii,B0_dir) % % Input % -------------- % nii : NIfTI format structure from load_untouch_nii.m % B0_dir : default B0 direction (optional, default in z-direction [0;0;1]) % % Output % -------------- % B0_dir : main magnetic field direction with re...
0cf4cc892fc349ccd1d179514dcf4229d6677038b6961a6b8a232867cc1c6534
MATLAB
1,277
55
% % Mask approximation of rank 1. We use the row-column (RC) algorithm % from [1] and use SVD to initialize the eigenvectors. % % [1] Estimation of Rank Deficient Matrices from Partial Observations: % Two-Step Iterative Algorithms, Rui F. C. Guerreiro and Pedro M. Q. % Aguiar. % % PARAMETERS % a (m*n) Matr...
1f6e8b534a8aeed58b36f3c948e2b624340a6fa7a5b68fe36c78ce70ddd0c6e1
MATLAB
1,277
67
function results = vl_test_aib(varargin) % VL_TEST_AIB vl_test_init ; function s = setup() s = [] ; function test_basic(s) Pcx = [.3 .3 0 0 0 0 .2 .2] ; % This results in the AIB tree % % 1 - \ % 5 - \ % 2 - / \ % - 7 % 3 - \ / % 6 - / % 4 - / % % coded by the map [5 ...
48ff7b84869624343e0b40ce7d056ac0a3089da6a33b77a3dd3daf1ed261cd9c
MATLAB
1,277
47
function [xx,density] = findPointDensity(points,sigma,numPoints,rangeVals) %findPointDensity finds a Kernel-estimated PDF from a set of 2D data points %through convolving with a gaussian function % % Input variables: % % points -> N x 2 array of data points % sigma -> standard deviation of smoothing gauss...
5bc119cda1922856d8271ffa2c87397380ca72e48154c070752caeaf1303ed72
MATLAB
1,278
32
function motion_summary_BIDS(motion_numbers_file,FD_thresholds_file,output_folder,output_prefix) load(motion_numbers_file) load(FD_thresholds_file) motion_indices = 6:5:51; remaining_seconds = zeros(1,length(motion_indices)); FD_thresholds = zeros(1,length(motion_indices)); FD = motion_numbers.FD; DVAR_pre...
f43d476b982f64bb1346cf79d8457ee80089845c9947655c8571368a42ce3bc9
MATLAB
1,278
34
function upper_bound_similarity(Sessions,Area,threshold,Ndir,Nbins,t_from,t_upto,edges_dur_bin) %% upper_bound_similarity calculates the upper bound of the similarity between trajectories for all recordings denoted in Sessions and Area % % INPUTS % % Sessions: cell array containing the names of the sessions to be ...
374e327f1862747ff9aa6ce430154e7dbd9063527b3f30465cbc70031559bc12
MATLAB
1,279
43
% madRmOutliers.m % % Function that removes outliers from vector where outliers are greater % than x MADs away from the median, where x is a user specified parameter % % INPUTS: % inVec - input vector % numMADs - number of MADs away to consider as outlier % % OUTPUTS: % outVec - output vector, which is input vec...
25f9aa798e9bb6e326a1385c36b751a2c3a73e78f1a68b37bd26f22192fde277
MATLAB
1,280
44
% mglGluPartialDisk - draw partial disk(s) at location x,y % % $Id$ % usage: [ ] = mglGluPartialDisk( x, y, isize, osize, startAngles, sweepAngles, color, [nslices], [nloops] ) % by: denis schluppeck % date: 2007-03-19 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING...
e79e5b409dddcf6b984e02cd940571e572a88f986781dc0e929cc659577cb985
MATLAB
1,280
57
function [RRa_Hz, HRa_Hz,RR_Hz, HR_Hz]=read_aliased_PMU_data(path_PMU_data,TR) f=filesep; %path_PMU_mat=strtrim(ls([path_PMU_data f '*' f 'PMUextracted.mat'])); path_PMU_mat=strtrim(ls([path_PMU_data f 'PMUextracted.mat'])); path_PMU_mat=regexp(path_PMU_mat,'\n','split'); n_bold=size(path_PMU_mat,2); RR_Hz=zeros(n_bol...
b8d0c013bc9e3a49a73aa102fcd01aaf4f2afed4dc107b7b4ada6ca7b59c029c
MATLAB
1,281
49
function R2starmap = R2star_ARLO(GREMag, TEs, BrainMask) % R2starmap = R2star_ARLO(GREMag, TEs, BrainMask) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % calculat R2* maps from GRE Magnitude, using the ARLO method % Ref: Pei et al, MRM 73:843 2015 classname = class(GREMag); N...
c37fa1b768170752fdb4d18465302a4e50abdeae580689ae08394006cb3afaca
MATLAB
1,281
48
% This example demos options for plotBrainSensitivity(). If plotted % alongside plotProbe() and plotROI(), the probe, it's optodes, and a % spatial brain sensitivity plot can show areas of high channel density clear all %% Design Parameters (module, roi) probe.module = createModule(4, 30); % nsides, mdimension probe...
bff6a538b052de963ce9561559b1deaa60d28240e11008579f4b019f8e3961ee
MATLAB
1,282
51
function [trial,nStim] = st_mkTrial(stimprm,fs) % % function [stimulus, time] = st_fMRIStimulus(with0OrNot) % INPUTS: % stimprm : Stimulus struct [variations X prms] % - prms : [on off trialDur framerate] % - on : on duration (nFrame) % - off : isi (unit: nFrame) % ...
6143901873a496016a38581a0818b9a38dfbcdc248fcf69a8f351ac298c08b36
MATLAB
1,283
53
function dist = bootstrapdim(m,dim,fun,num,sz,dim2) % function dist = bootstrapdim(m,dim,fun,num,sz,dim2) % % <m> is a matrix % <dim> is the dimension along which to draw bootstrap samples % <fun> is a function that takes a bootstrap sample and outputs a matrix % <num> (optional) is number of bootstraps to take. defa...
9d3f1e646858800d82509efe75500180dacc9dbab3a563eec3e60b44f5a53f10
MATLAB
1,283
44
%% Main Motion Censoring Function function logical_removal_vector = power_2014_FD_only_censoring(FD_vector,FD_threshold,skip,expected_contiguous_frame_count) % Caluclate and combine the FD and DVAR removal vectors FD_removal_vector = censor(FD_vector,FD_threshold); logical_removal_vector = contiguous_frame_censor(FD...
fc3712aef90ef45926c7afbf829276aa44aca4d8673f582f2f7aa5f28b47ccf6
MATLAB
1,283
36
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
1aa0e57060c3efbfc1e6fee2b55e023f4fa7741975c873b54ebb3ed2f6b79fdc
MATLAB
1,284
77
<<<<<<< HEAD function [EER, EERlow, EERhigh, index] = computeEERIndex_classic(FAR, FRR) % calcolo le posizioni di confine t1 = min(find(FRR>=FAR)); t2 = max(find(FRR<=FAR)); % Controllo la combinazioni che da errore complessivo inferiore if (FRR(t1) + FAR(t1)) <= (FRR(t2) + FAR(t2)) EERlow = FRR(t1); EERhi...
fd9da8b19fa8f57acab45385e289f0f1f0ed59c5a3e7ca865398630d6d871f30
MATLAB
1,284
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
1ad5250bb6c1cd087f770fe90cfa9920124c29a8a3f6c2d5cf9a8323b309be8d
MATLAB
1,285
33
% Calculate EEG-fMRI spatial FC correlation % Data Figure 2 and Supplementary Table 4 + 5 % % 2022-08-22 Jonathan Wirsich [confs, confs_label, groups, eeg_conn_types, bands, atlases, serialized_path] = init_serialized_conf_tle(); for atl=1:1 %load connectomes [allgroup_mean_fMRI, allgroup_mean_EEG, allsub_fMR...
680014958e344deb8d7ceeecd4df3a26448a57a4fdfa6877bb2c660040a9db34
MATLAB
1,285
36
function write_csvs(output_csv_folder_name, data, names) % Write features to a folder full of csv files, one file per fly. ensure_folder_does_not_exist(output_csv_folder_name) ; ensure_folder_exists(output_csv_folder_name) ; n_flies = size(data,1) ; n_frames = size(data,2) ; n_feats = size(d...
b448c7a6eb580cb63a4f7efdc1ee5058f523b924dcb371ca43fdeac64721f8ee
MATLAB
1,285
33
function [y,varname]=xml2cell(filename_or_xml_string) %XML2CELL reads non-MbML compliant xmlfile into matlab nested cell arrays % % Syntax [y,varname]=xmlfile2cell(filename_or_xml_string) % % Description: % 1. Convert any non-MbML xml into MbML compliant string % 2. Stores individual structures as nested cell arra...
5ff194ed2f99f57a34132a3210b14aa1db82ab80e5e0a01d29f5082f7b7e9cdf
MATLAB
1,286
47
function flag = bivariate_outliers(X) % routine that find the bivariate outliers using orthogonal projection and % box plot rule % find the centre of the data cloud using mid-covariance determinant n = size(X,1); result = mcdcov(X,'cor',1,'plots',0,'h',floor((n+size(X,2)*2+1)/2)); center = result.center; % orthog...
b291707efe525cf1d08183e1a9f400abf5120ce6483d80e4c10b6dc9ca76f828
MATLAB
1,286
36
function [xp1,xp2]=vl_wtps(phi,Yp) % VL_WTPS Thin-plate spline warping % [XP1,XP2]=VL_WTPS(PHI,YP) computes the thin-plate spline (TPS) % specified by the basis PHI and the warped control point Yp. % % Yp is a 2xK matrix with one column per control point and the basis % PHI is calculated by means of the VL_TPS...
4d1ba3bdf4b653632a12fcd4925dafc0ab7c7d22de94c35706e69143d29d8616
MATLAB
1,287
46
function [r] = ml_util_fitrect(tx, ty) k = convhull(tx, ty); % Find the minimum rectangle % For every pair of points, compute the min and max in each dimension % after projecting numK = length(k); numP = length(tx); kx = tx(k); ky = ty(k); A = cell(numK-1,9); for k = 1:numK-1 ...
dc800093d96ab550372f9d6758d083e86bf32cc3223d57a1c174785b6f75f35c
MATLAB
1,287
50
function [L,dL,ddL] = neglogli_poiss(prs,X,Y,nlfun,dtbin) % [L,dL,ddL] = neglogli_poiss(prs,X,Y,g,dtbin) % % Compute negative log-likelihood of data Y given rate g(X*prs). % % INPUT: % prs [M x 1] - parameters % X [N x M] - design matrix % Y [N x 1] - observed Poisson random variables % ...
316ed7004cb9c0ecd2c22a590a7ffa48979f6c36a1530fadc2b59531a7f911db
MATLAB
1,288
35
function [ stack ] = ReadTIFFobj( PathName, firstframe, lastframe ) %% This function reads TIFF xyz-stacks into a 3D matrix. % ---------------------------------------------------------------------- % Author: Dr. Knut Kirmse, 2019-2022. % ---------------------------------------------------------------------- % Inpu...
5fb3c56a4347c692a2697b4971a486b1f21dca8baa59d4fb107d07474a2d3488
MATLAB
1,288
38
%% example code to run fly tracker inexpdir = '/nearline/branson/bowl_data/GMR_71G01_AE_01_TrpA_Rig1Plate15BowlA_20120316T144027'; rootoutdir = '/groups/branson/home/bransonk/tracking/code/FlyTracker-1.0.5/sampledata'; codedir = '/groups/branson/home/bransonk/tracking/code/FlyTracker-1.0.5'; addpath(genpath('.')); mov...
846b382186b7383d60ff2ef9abbc618f681a312768a8e8707419b0d6c2a6dab7
MATLAB
1,288
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
8f61b75d76a6f8381af0976c8f0139c9e1ce13304347ae24d88af9128a57a94a
MATLAB
1,288
45
function [csInfo] = t2t_ExtractChunks(csInfo, segment_ssfr, z) chunkAs = []; chunkBs = []; chunkDiffs = []; for i = 1:size(csInfo, 2) if ~csInfo(i).usable continue end window_e = z.comparisonWindowSize * z.sr_e; start_chunkA = csInfo(i).timeAbs_e - (window_e/2); end_chunkA ...
999412469abdfad617b714b3dc91d572a1f42376cda8b9b3636eb18338d35cd5
MATLAB
1,288
52
function [res, dcminfo] = isdicomfile(fname) % [res, dcminfo] = isdicomfile(fname) % % Determines whether the given file is dicom by % trying to read the dicom info. If this fails, % then res=0 and dcminfo=[]. If successful, then % res=1, and dcminfo is the result of matlabs % dicominfo. % % % isdicomfile.m % % Origi...
6701ba5ffd60da6e8f5b6382e6d41432521b14445c6bc36b3b6702d5b0ca493c
MATLAB
1,290
29
function idList = isolateVisibleSomas(vol,psf,vol_params, neur_params, varargin) % idList = isolateVisibleSomas(vol,psf,vol_params, neur_params, {thresh}) % Compare all locations of neural centers in vol to the main imaging % plane (center of the volume). The distance threshold should be related % to the falloff of t...
87f0ef338bf8ba369e494e708c28032c7b9951d47e2810d4bcbfac8698105f74
MATLAB
1,290
44
% mglTestVisualAngleCoordinates: an automated and/or interactive test for rendering. % % usage: mglTestVisualAngleCoordinates(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test setting the rendering uni...
a2d91ab717b8dd8817858fb8dc8fe50e67b5d1884ee09029707a7a9219ae5db7
MATLAB
1,290
31
% Get header of the digitization information % [ Yokogawa MEG Reader toolbox for MATLAB ] % % brief: % This function retrieves information of the digitization in the specified file. % % usage: % digitize = getYkgwHdrDigitize(filepath) % % arguments: % filepath : file path % % return values: % digit...
087b2b9940f8671f2511dee8a7d82c7a3acb44f613f824735df3fa9ba45890b6
MATLAB
1,291
61
function[pref]= get_event_preference(outcomes,ds_events,nperm) % also write a function to do 3-way anova between SOM/PV/ for d = 1:length(outcomes) cur_onsets=ds_events(d).onsets; cur_somvect=outcomes(d).som_binned_vect; cur_pvvect=outcomes(d).pv_binned_vect; cur_mixvect=outcomes(d).ex_binned_...
8508e0b50a4ffc72c2223ce046a33fee306782777cbbf939c6313005f52f4af2
MATLAB
1,291
44
function prv = getPRV(r,v,g,strt_prd,end_prd) %GETPRV Summary of this function goes here % Detailed explanation goes here % get the pathway currents % from Y to X step_all = end_prd - strt_prd; v_x = zeros(16,16,step_all,5); v_y = zeros(16,16,step_all,5); % mean membrane potential for i = 1:16 % iterate b...
18279c8458ce7568f01d423aaabe62523aeae3576bba5e11b54907f696f9ef1a
MATLAB
1,292
44
function H = aedes_wbar(varargin) % AEDES_WBAR - Slightly modified Matlab Waitbar... % Synopsis: % See the WAITBAR function synopsis by typing 'help waitbar' into % the Matlab command prompt. % % Description: % % Examples: % % See also: % WAITBAR % This function is a part of Aedes - A graphical too...
a031992fb536003809aa936008da2b54456708ac3363c83e884c1be878a71bc9
MATLAB
1,292
30
function cnfme_spatial_footprints_save_to_cellreg(obj, session, trial) cellRegFolder = fullfile(session.getAnalysisDirectory(), obj.Config.cell_registration.session_sfp_output_folder); % Check if the cellreg folder exists if ~isfolder(cellRegFolder) mkdir(cellRegFolder); end cnmfeFile...
b11c4d79df736954cc782d11a45207725ab95789e23aba9cbd45ce4ef5b6253f
MATLAB
1,292
48
function [] = plx_spike_info(filename) % plx_spike_info(filename): prints .plx file spike channel info % % plx_spike_info(filename) % % INPUT: % filename - .plx file name. Will use file open dialog if filename is empty string % % OUTPUT: % (none) if nargin ~= 1 error 'expected 1 input argument'; e...
f5db800522db14cf635a3e155616b11994fbe7974561707c883a46c73d9df18f
MATLAB
1,293
37
% iInjDir.m % % Quick function that specifies folder where current injection protocol % functions live. % Ideally, would have been part of ephysSettings.m, but too awkward to % change now % % INPUTS: none % % OUTPUTS: % iPath - full path to folder containing current injection protocols % % CREATED: 2/11/21 - HHY % ...
00a6b131962f24da893cb19bc97701ebeed90ea49eaf019c942e6cb22f873645
MATLAB
1,294
34
clear %load F1s.mat filenames = {'PFC4_15Hz_part11','PFC4_15Hz_part12','PFC4_15Hz_part21','PFC4_15Hz_part22'}; radii = [3:7]; SNRs = [7:4:31]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) length(radii) l...
2cadaeadf04eaec671a39b383ac497c1541ad58e872fb4a602d1fa6a1ee1e427
MATLAB
1,294
42
function [] = savetracks(Tracks, folder_name, overwrite, fields_to_save) %save the tracks as individual variables given folders if isempty(Tracks) warning('Saving Empty Tracks') return end if strcmp(folder_name(end), filesep) savePath = [folder_name, 'analysis']; else sa...
bf57ec9af75b90d02260e4fbe04850be1fd2086daf77d05f91aa56a482bc913f
MATLAB
1,294
43
function [Ppos Pneg]=participation_coef_sign(W,Ci) %PARTICIPATION_COEF_SIGN Participation coefficient % % [Ppos Pneg] = participation_coef_sign(W,Ci); % % Participation coefficient is a measure of diversity of intermodular % connections of individual nodes. % % Inputs: W, undirected connection matr...
0e974cf085693e6ea54351aee9c2686b340ddd6b162c9752256917fe6be3216f
MATLAB
1,295
48
function I = multiBoundaryImage(X,varargin) % I = multiBoundaryImage(X) % % Function to create a series of bounding curves for multiple images in a % 3D stack. % % Input: X - a 3D array of images, each slice in the 3rd dimension will be % processed independently. % t - a threshold parameter for...
9f8ff7b4e5bccfbb1aa3a698511a6379e0a6c9753cee410e6da8cd98d6186e1c
MATLAB
1,295
40
% % Plot average degree and diameter by time. % % ENVIRONMENT % $network Network name % % INPUT % dat/stepsi.$network % dat/statistic_time.full.diameter.$network % dat/statistic_time.full.avgdegree.$network % % OUTPUT % plot/diadens.a.$network.eps % font_size_label = 18; network = getenv('network'); steps = l...
dc2c0a7601a2bf80e5e24286395bffaa1f6b14ceb68a42f172d0b336e423d83d
MATLAB
1,295
40
function overlap = overlap_neurons_IOU(neuronmasks,thresh_mask,thresh_IOU,times) % Combine masks with large IOU or consume. % thresh_IOU=0.5; % thresh_consume=0.8; % thresh_consume should be larger than 2*thresh_IOU/(1+thresh_IOU) to avoid % two masks consuming each other. % [Lx,Ly,n] = size(neuronmasks); N=size(...
5b4d89586463140b8a89a719b02309bf6a2f6ae91c0ecc79482ae6ae79e98ab8
MATLAB
1,296
53
function[out,h]=SONADCToSingle(in,header) % SONADCTOSINGLE scales a SON ADC channel to single precision floating point % % [OUT {, HEADER}]=SONADCTODOUBLE(IN {, HEADER}) % % Applies the scale and offset supplied in HEADER to the data contained in % IN. These values are derived form the channel header on disc. % ...
0a37a53287da8051b07ac03bb6dc0aacad253843b8a65171d910692af67f4fcf
MATLAB
1,297
34
clear %load F1s.mat filenames = {'bma22_epm_part11','bma22_epm_part12','bma22_epm_part21','bma22_epm_part22'}; radii = [6:1:10]; SNRs = [7:4:27]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) length(radii...
13dc25700966631a4e9707b055ce979d8b967e75a24cb64259877ef13ca084cf
MATLAB
1,297
36
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
58ad29e4e3b0c261cfb316a5c9f33a81047f7a16452f8cffc1bea76267c92777
MATLAB
1,297
55
function badFrames = findBadFrames_APP(app, vars, trackParams, frameData) threshCR = 30; threshpupilr = 10; %% Find NAN frames frameData_table = struct2table(frameData); frameData_nanLocations = ismissing(frameData_table); badFrames = any(frameData_nanLocations,2); %% Find bad CR cr1_x_deriv = diff([frameData.cr1_x]...
ec9ff15bacbba65bf0dfd2b1513c30c82b1ad6e5fe83c12ef95f1eb6a4d4e147
MATLAB
1,297
34
function mltp_user_define_slice_arenaroi(obj, session, trial) if obj.isVerbose() fprintf('Defining the ROI for one trial (a used slice).\n'); end trialId = trial.getTrialId(); sliceId = trial.getSliceId(); % Changed from fnvt to nvt to allow for the fnvt creation to use % the ROI bound...
095e1de00b05f6aeef7938170d12fa73da7570f2593e78111e07036728456f07
MATLAB
1,298
44
function sp_matrix=spikest2vector(units,startt,endt) %% spikes2vector transforms the time of the spikes in the population units to a matrix format %INPUTS % % units: structure containing the time of the spikes of all the units in % the population recording. units has dimensions 1 x number of units and % the time of spi...
13a3c9d5adfff054e1c77663b593ae8e5e214192ee0a4a21af25bb37b3eb0d86
MATLAB
1,298
35
function [recordingOpened] = ml_nlx_nvt_get_recording_datetime( nvtFilename ) %% Get the date and time that the Neuralynx NVT recording was opened [Timestamps, X, Y, Angles, Targets, Points, Header] = Nlx2MatVT(nvtFilename, [1 1 1 1 1 1], 1, 1, [] ); % The third line looks like this: % {'## Time Open...
29bef67ec31c0d03b463c3e0dca356ecc5f99e5f6e1f103a637392f833ae19ff
MATLAB
1,298
61
function varargout = plot(varargin) % plot method for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: plot.m 8776 2013-11-14 09:04:48Z roboos $ % if ishandle(varargin{1}) % h = figure(v...
5248bfe477a250a6bc1171c1f4d7160648fcfd0a164632a39ef93656be2c79da
MATLAB
1,298
59
% plotMultiCorr.m % % Function to plot output from saveStepParamMultiCorr(), 1 file % Plots randomized as mean +/- SD and actual as single line % % INPUTS: % datDir - path to folder containing correlation files % yScale - scale for correlations % % OUTPUTS: % none, but generates plot % % CREATED: 7/26/23 - HHY %...
5d3aae975ef955d29b7de61d4c936d5a8d2171dad85b4484ab9b12c972e71030
MATLAB
1,298
34
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:8]; SNRs = [3:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) length(radi...
8b1c4234293a42b9cd84fa7034261ed99f89c66a57fbebdf0fa0d6c3dcf6c4b3
MATLAB
1,298
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
a6fa54ce0e8624815a27c91df84a2e98197d79efae864d792e178b98e8d4b30b
MATLAB
1,298
38
function [params, result] = ortho_quasi(params, W, w) % Quasi-orthogonalization % W = orthof(params, W) for symmetric dss % w = orthof(params, W, w) for deflation dss % params.alpha For deflation... % W Matrix with projection vectors as rows. For deflation % algorithm only previously calculated ...
db283429075aa371c97d5322e67f9127c1f1b478e0471c41e436573e662977cc
MATLAB
1,298
34
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:8]; SNRs = [7:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) length(radi...
fcac9ccad2833978dae0faca2107b168096e8f6c001d00c536177d9a0e55b1ca
MATLAB
1,298
49
function [A] = clique_graph(n,varargin) % CLIQUE_GRAPH Generate the clique graph or bipartite clique graph % % The clique graph is a graph with as many edges as possible. % % A = clique_graph(n) generates a clique with n vertices and returns the % adjacency matrix A. % % A = clique_graph([m n]) generates a bipartite cl...
5b122726ac28c8c2da81d1134eb153ff2abe185565c32adf942aa9fb13c3d50d
MATLAB
1,299
41
% Test script for AEW % (Results depend on random seeds) clear; close all; noise_level = 1; % 1 or 2 % Parameters for AEW param.k = 10; % The number of neighbors in kNN graph param.sigma = 'median'; % Kernel parameter heuristics 'median' or 'local-scaling' param.max_iter = 100; % -----------------------------------...
08de0b85fd284b0a75a917921bd054085d3eae79147617861145ee54961bebff
MATLAB
1,300
41
classdef MLTetrodeExperiment < MLExperiment %MLTetrodeExperiment A tetrode experiment % Represents a tetrode experiment properties TFileBits NvtFileTrialSeparationThresholdS NvtFilename end methods function obj = MLTetrodeExperiment(... ...
752f5839af2eb7b88a4e8af07ac96bfb407ebad41739bb5de7ad7857f63b135c
MATLAB
1,302
40
function [mean_selected_activity]=plot_trial_averaged_events(dff,ct_inds,event_inds,color,varargin) % %% MAKE VARIABLES % start=varargin{1}; % finish=varargin{2}; % start=varargin{1}; finish=varargin{2}; trial_dff=nan(length(event_inds),length(start:finish)); ct_dff=mean(dff(ct_inds,:),1); for i=1:length(event_inds)...
99823c7b671cf7f572d8757cc8eba242aa16fba1aeaa07906b76bbef40231899
MATLAB
1,303
34
function [X,Y,Width,Height,Lbl] = read_lay(layoutname); % READ_LAY reads an electrode or gradiometer layout file % Layout files are used for topoplotting and multiplotting. % % Use as % [X, Y, Width, Height, Lbl] = read_lay(layoutname) % Copyright (C) 2003, Ole Jensen % % This file is part of FieldTrip, see http://...
4a08bb5e5bc0f2aa372a48ef7770b57c4405feac1f681cf5d990d1c22883f08d
MATLAB
1,304
38
function clearStageDir(folder) % Delete a managed stage folder recursively. A folder that is absent is fine % % function webupload.clearStageDir(folder) % % Purpose % Removes folder and everything in it. Only pass folders obtained from % webupload.stageDirFor, because the delete is recursive...
585a075d365f2a3b5a186c2ca4c8faf89a60d50c54d0d42eaa2b0d618cb84fd6
MATLAB
1,304
46
function min1pipe_init % parse path, and install cvx if not % Jinghao Lu, 11/10/2017 %%% prepare main folder %%% pathname = mfilename('fullpath'); mns = mfilename; lname = length(mns); pathtop1 = pathname(1: end - lname); %%% check if on path %%% pathCell = regexp(path, pathsep, 'spl...
880899f56ce588496365af3afc0e01e2b4946f04765256ded0c28f14ba1e99e9
MATLAB
1,304
31
function [arena] = ml_arena_initialize_from_file(experimentDescriptionFilename, arenaRoiFilename) if ~isfile(experimentDescriptionFilename) error('File (%s) does not exist. Can not load the JSON data.', experimentDescriptionFilename); end if ~isfile(arenaRoiFilename) error('File (%s) do...
c36f3cdcc031afba7414395a68420e7d75ca1f61f8561c2f68669716953db387
MATLAB
1,304
52
function chi_res=SFCR_s(deltaB, D_k, DPWeight, maskErode, maskSSV, wG, lambdaSet, x) % chi_S = SFCR_s(deltaB, D, DPWeight, maskErode, maskU, wG, lambdaSet); % SFCR S-step % adopted from Lijun's Code % Ref: Bao et al, IEEE TMI, 2016 35(9):2040-50 % updated 2019-06 if nargin < 8 x = zeros(size(deltaB)); ...
f343cce0559172f258ef313da5e4947bcfcaac1d1b1995cd90b4f7f2e6b33c8d
MATLAB
1,304
24
function [] = delete_extra_individual_worm_images(folder_name, endIndex) % delete individual worm image files that are no longer relevant individual_worms = dir([folder_name, filesep, 'individual_worm_imgs', filesep, 'worm_', '*.mat']); for image_stack_index = 1:length(individual_worms) current_file_na...
ba2a5eb2e25c710e808efb5aedb122af923359b8738d62a35619ddf777e095f2
MATLAB
1,305
40
% addMyPaths.m % % function to add relevant 2p data analysis paths, including subfolders % % Users: change the following paths to match those on your local computer function addMyPaths() %% ScanImageTiffReader code scanImageTiffReaderPath = ... '/Users/hyang/Documents/MATLAB/ScanImageTiffReader'; ...
c8e2208c3df940d56b6ca70254d2aa1583ab10b614d3918be3b9a536d54e14be
MATLAB
1,305
50
function h=vis_brainwhitesurf(facesl,vertsl,facesr,vertsr,whitefl, whitefr, whitevl, whitevr,yl,ttstr,meshsmooth) if meshsmooth==1 vertsl=sms(vertsl,facesl,5,0.5); vertsr=sms(vertsr,facesr,5,0.5); whitevl=sms(whitevl,whitefl,5,0.5); whitevr=sms(whitevr,whitefr,5,0.5); end h=figure('Position', [0 0 18...
1f6660e2a492d8d93c6aee13e2808a929c7009fa6eae53af1e7a3d939c861b06
MATLAB
1,306
51
function mu=permModel(S) % permModel Compute co-classification probabilities using Permutation Model % % Syntax %__________________________________________________________________________ % % mu=permModel(S) % % % Description %__________________________________________________________________________ % % mu=permMod...
5bea521695bbeb2f435049d3669cf6468218cbb947c412717482ce583c5091ae
MATLAB
1,306
48
% Script to find mean output from the MePD on % the Kp x \alpha parameter space clearvars; clc; load("par.mat") par.d=0.05; p1 = [0 , 22]; p2 = [0.7, 1]; n = 150; % Define the parameter space A = linspace(p1(1), p1(2),n); B = linspace(p2(1), p2(2),n); IC = zeros(6,1); time_vector = 0:0.5:2000; opts = ...
5cd625d672cb93e573506a65c37dd751ec7213b8998bd1ba86e8e65227dadbfc
MATLAB
1,306
39
function xhfd=hfd(x,kmax) %function xhfd=hfd(x,kmax) %Input: %x: (either column or row) vector of length N %kmax: maximum value of k %Output: %xhfd: Higuchi fractal dimension of x if ~exist('kmax','var')||isempty(kmax), kmax=5; end; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% x=x(:)'...
9e629bb10e9723bddb6b5ceaa8d602033297f1d2bcb27a2b232875127c76321f
MATLAB
1,306
34
clear %load F1s.mat filenames = {'Mouse_1K','Mouse_2K','Mouse_3K','Mouse_4K','Mouse_1M','Mouse_2M','Mouse_3M','Mouse_4M'}; radii = [4:9]; SNRs = [7:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) len...
fa75500a768a509c472862a67982772c56cc6d818c94cad3869992edbf9f7389
MATLAB
1,306
34
clear %load F1s.mat filenames = {'Mouse_1K','Mouse_2K','Mouse_3K','Mouse_4K','Mouse_1M','Mouse_2M','Mouse_3M','Mouse_4M'}; radii = [4:9]; SNRs = [3:4:23]; dataset = zeros(length(filenames),length(radii),length(SNRs)); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q,r] = ind2sub([length(filenames) len...
3aa228e3415789790102b1d18cb29a3a1b58fb8b79eb7062ad75dded9740372c
MATLAB
1,307
41
% plotMultISI8x8.m % by Valentina Pasquale, March 2008 function [success,errorStr] = plotIBEISmoothPeaks(saveFolderPath,trialNames,xx,yy,ISImax,peaks,flags) if length(xx) ~= length(yy) errordlg('Cell arrays of XData and YData do not have the same length!', '!!Error!!', 'modal'); return end % Start processing fo...
57fa677f3b450cc9926796e2f9bea436d3b211d3be08dee96ccb206254e0dcd0
MATLAB
1,308
39
function [params, s_new] = denoise_smooth_tanh(params, s, state) % Smooth tanh DSS denoising function % [params, s_new] = denoise_smooth_tanh(params, s, state) % params Function specific modifiable parameters % state DSS algorithm state % s Source signal estimate, matrix of row vector signals % ...
72d823efa38594d7077d57178eef40fbf029124cc834f13ce2293b9c19b09289
MATLAB
1,308
27
function tpt_acu_m = mean_SIR_spread(aij, data_run, new_seed) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % If you use this code, then please cite: % 1.- Ana P. Millan, et al. "Individualized epidemic spreading models % predict epilepsy surgery outcomes: a pseudo-prospective study." % medRxiv ...
dc192328cabba27123c482df57ab1d6c9a9de690b2ce6a7bba0656a3d3f585fd
MATLAB
1,308
40
% FastICA for Matlab 7.x and 6.x % Version 2.5, October 19 2005 % Copyright (c) Hugo Gävert, Jarmo Hurri, Jaakko Särelä, and Aapo Hyvärinen. % % Type fasticag to launch the graphical user interface % % Please refer to your Matlab documentation on how to add FastICA to your % Matlab search path. (One place to start is t...
0d7d2b99991abcaf0543eceef2af4238246bc80427f777118e2b5d34c1eacb26
MATLAB
1,309
45
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [X] = helper_percell90_add_stats(X) % Add distributions per cell numCells = size(X,1); numRotations = 4; X.hc_within = zeros(numCells, numRotations); X.prob_within = zeros(numCells, numRotations); X.samples_within = zeros(n...
4058d2cf264ac5ab3f0177e39537f3b06e72226bb9546f2be851594f198e8088
MATLAB
1,309
41
%{ For the specified k, FDR-correct the p-values for the correlation between pairs of summary scores relating to g or processing speed. Output: pcorr_vec_fullfdr.csv FDR-corrected p-values. %} %Define command line arguments. function [] = LE_group_staterecon_summary_corr_FDR(k) %Add personal folder to the MATLAB pat...
725204aa3ab83921dcfe0c191046412ac42979f86f27161831d26a89877eb69c
MATLAB
1,309
43
function runrpg(pf,dim,root,DKI_root) %% Removal of Partial-fourier induced Gibbs ringing (RPG) % Author: Hong-Hsi Lee, February 2020 % % C++ codes are modified from the code based on local subvoxel-shifts by % Kellner et al. MRM 2016 (doi: 10.1002/mrm.26054) % (https://bitbucket.org/rei...
cbe56d8df3bbf962a0f36ddbc89121201b093785c5aa51976c588f81cdcbe520
MATLAB
1,309
53
%function [sta, P2P, p, Nspikes] = STA(x,y, bef_s, aft_s); function [sta,Nspikes] = STA(x,y, bef_s, aft_s); % returns STA[odd/even,:], array 2x:, % input: x holds spike frames, y holds the signal % bef_s and aft_s units are s % %sta, the STA function % P2P, peak-to-peak diff % p, bootstrap p-value for the P2P ...
1c2911d05bb41a6dd0ccafe3b3682c2b13a9657f9a584903b824874a06a804c3
MATLAB
1,310
47
%% s_simseqAnalysis_overview % Script to rerun data analyses in the paper: % Title: Rethinking simultaneous suppression in visual cortex via % compressive spatiotemporal population receptive fields. % Authors: Kupers, Kim, Grill-Spector (2024). % Journal: Nature Communications % DOI: XXX % % Requires ge...
546ffb8a5edf37c3f0a510615a9a0fc2d7a7f4b7b1aaef1cb228fdf865b0f350
MATLAB
1,310
58
close all clear all clc numCells = 10; mapWidth = 10; mapHeight = 15; numTrials = 12; numMaps = numCells * numTrials; sdataMaps = nan(mapHeight, mapWidth, numMaps); sdataCellIds = nan(numMaps, 1); sdataTrialIds = nan(numMaps, 1); sdataContextIds = nan(numMaps, 1); k = 1; for iTrial = 1:numTrials cid = mod(iTrial...
64a09e142afb2fbabeb44842ee7595791a8b387abd58640d64208d3d560e994a
MATLAB
1,310
43
function retScreenReverse(params, stimulus, xy) % If necessary, flip the screen LR or UD to account for mirrors. % % retScreenReverse(params, stimulus, [xy]) % % We now reverse the screen itself ONCE before the experiment starts % (instead of reversing each image). This ensures that everything, % including the fixa...
7149a5ae142a709489c665e06cc7fd77417b3c2c1e03245b72d267f589219230
MATLAB
1,310
42
% This example creates a square module with optodes. It then uses MOCA's % automated createLayout() function to overlay the module over the ROI. % Once this probe is generated, this demo shows how to toggle individual % modules on/off, how to translate the probe relative to ROI, and how to % rotate individual modules....
b6105b0476e305187354b1b6b3ca0be3ede15295dbe69dc8f6d9d94e1d34482d
MATLAB
1,310
51
% plotBinScatterScript.m close all clearvars dataPath = '/Users/hyang/Dropbox (HMS)/2PAnalysis-Helen/AnalyzedData/190927_moveCond'; figPath = '/Users/hyang/Dropbox (HMS)/2PAnalysis-Helen/Figures/190924_scatter-heatmap'; cellType = 'g13'; % parameters xDataName = 'totAngSpd'; yDataName = 'sum'; xScale = [0 600]; num...
c34b2a1f68af9a6383c885c43a5f31b119549a0ba766f7b8acf805670c191498
MATLAB
1,310
39
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
d6980a60228c0365307228c5d157f96d51c600500c1362f8cb11c0006904c0a1
MATLAB
1,310
37
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [R] = load_tetrode_animal_day_table() R = []; day1.animalNames = {'K1_CA1', 'AK42_CA1', 'AK74_CA1', 'CMG159_recut', 'HGY1_recut', 'JJ9_CA1', 'MG1'}; day1.sessionNames = {'d1', 'd7', 'd1', '...
951d8445b065ad75a62681a18449fd8478d137ee8d5edecd624c2ef438a52eb0
MATLAB
1,311
44
function J=vl_imwhiten(I,alpha,cutoff) % VL_IMWHITEN Whiten an image % J = VL_IMWHITEN(I,ALPHA) approximatively whitens the power spectrum % of the natural image I. The algorithm assumes that the modulus of % the spectrum decays as 1/f^ALPHA (f is the frequency). % % VL_IMWHITEN(I) uses ALPHA=1 (a typical valu...
50f0db4ebca5aed63b617cba5c3e526b95ab9ae899dbc5aa81bcfd9ff630097c
MATLAB
1,312
49
function vid = setROITecknet(vid, img1, img2, res, boxsize, boxoffset) %% Display snapshot figure(1); set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. h(1) =subplot(1,2,1); imshow(img1); title('Camera 1') h(2) =subplot(1,2,2); imshow(img2); title('Camera 2') %% Prompt for ROI around each eye disp('Clic...
c254b2e58483fd43d96bcfa2c919efc335ee7f87b64c233c431fda296260ce49
MATLAB
1,312
56
function [output] = polyfitn3d(input,mask,order,sc) % ========================== % HEADER % ========================== % % Function name: polyfitn3d.m % Author: Jonathan Farrell, Xu Li % Created: March 3 2010 % Last Modified: 2021-02-09 % Pupose: fit a nth order polynomial in 3D to i...
941ec7f42187e859573a8789093e11af429799b5c60b98caec040270bce4ea3b
MATLAB
1,314
34
function ft_destroy_buffer % FT_DESTROY_BUFFER stops the thread with the TCP server attached to % the local MATLAB instance and removes all data from memory. % % Use as % ft_destroy_buffer % % See also FT_CREATE_BUFFER % Copyright (C) 2010, Stefan Klanke % % This file is part of FieldTrip, see http://www.ru.nl/neur...
3125babb5b50bf9a92f2fcdbae40e7bfd7197179027a67461f956989ea1c4576
MATLAB
1,315
40
function text = cleanECGsurvey( obj, fs ) % Filters ECG artifacts from LFP Survey recordings. % % Syntax: % CLEANECGSURVEY( obj, fs ); % % Input parameters: % * obj - object containg survey data % * fs - sampling frequency % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andr...
1ffd93896d1510059dc1da7db41c9eb4117d41950b5f62f1fa8ce91c7b2285b2
MATLAB
1,316
59
function [h] = men_behaviour_roi_plot( roi, useGrayscale ) h = figure; F = roi.refFrame; if useGrayscale F = imadjust(rgb2gray(F)); end imshow(F) hold on % Plot the inside boundary plot([roi.inside.j(:); roi.inside.j(1)], [roi.inside.i(:); roi.inside.i(1)], 'ro-') % Plot the outside boundary plot([roi.outside....
90895b8db3c3452e32144c5aae524f09d3af43017060619b835cf0b8caebafab
MATLAB
1,316
37
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
017a3898ab1140328f89c30788a67ac2c835be1799da4116127a2b2166b429d4
MATLAB
1,318
31
% mglFillRect3D - draw filled rectangle(s) on the screen % % $Id: mglFillRect3D.m 18 2006-09-13 15:41:18Z justin $ % usage: mglFillRect3D(x, y, z, size, [rgb], [rotation], [antialias]) % by: Christopher Broussard % date: 05/10/2011 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see ...
20ed31730f2dbfb7651e9c84a76e8608315d871625ffacacfa450aa678560774
MATLAB
1,318
46
close all clear all clc fl = dir(fullfile(pwd, 'trial*_arenaroi.mat')); numTrials = length(fl); for iTrial = 1:numTrials s = split(fl(iTrial).name, '.'); fprintf('Converting %s to h5\n', s{1}); outputFilename = fullfile(fl(iTrial).folder, sprintf('%s.h5', s{1})); if isfile(outputFilename) ...