sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b857938a6a01c69ad6fc0bbc6c43e598ce9a0235cc96372559dd56f57b258f60
MATLAB
2,284
49
function test_tracker() this_script_folder_name = fileparts(mfilename('fullpath')) ; flytracker_folder_path = fileparts(this_script_folder_name) ; flydisco_folder_path = fileparts(flytracker_folder_path) ; flytracker_test_files_folder_path = fullfile(flydisco_folder_path, 'flytracker-test-files') ; ...
fd3a5561a9eeddf6ebfa863a40152c9319a15a338788aee4fe4d135eda5f492b
MATLAB
2,284
97
function results = vl_test_alldist2(varargin) % VL_TEST_ALLDIST vl_test_init ; % TODO: test integer classes function s = setup() vl_twister('state', 0) ; s.X = 3.1 * vl_twister(10,10) ; s.Y = 4.7 * vl_twister(10,7) ; function test_null_args(s) vl_assert_equal(... vl_alldist2(zeros(15,12), zeros(15,0), 'kl2'), ... ...
2721e91a51a81c3652db16b1e60263fb46428cbbc03b90ee2aea99c88bb8536b
MATLAB
2,286
91
%build_sim_RP_table_stdFR_stdRP.m % assumes run_simulations_stdFR_stdRP.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; }; datadir = pwd; %% addpath(scriptdirs{:}) addpath(datadir) %% set write prefs down a...
ad966fc6d41d28e2a8cdac34738ebdd620a836405aee96d9cccf8239e6cb7d06
MATLAB
2,287
55
ops.chanMap = 'D:\GitHub\KiloSort2\configFiles\neuropixPhase3A_kilosortChanMap.mat'; % ops.chanMap = 1:ops.Nchan; % treated as linear probe if no chanMap file % sample rate ops.fs = 30000; % frequency for high pass filtering (150) ops.fshigh = 300; % threshold on projections (like in Kilosort1, can ...
36783e129f60ae987a7cacd5e2d88cdeb9a775b6b2919786d9e7f34a911a8050
MATLAB
2,288
71
%% Start the main pipeline filenames = {'c25_59_228','c25_123_348','c25_163_267','c27_12_326','c27_114_176','c27_122_121','c28_83_210','c28_161_149','c28_163_244'}; radii = [3:8]; SNRs = [7:4:23]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenames) for q = 1:length(radii) ...
92c1e5bbb7fb265a74e3b349d8847aeddfd2910ddce7b530c7e34bfce2805c1a
MATLAB
2,288
75
function [track] = ml_cai_dlc_to_mlbehaviourtrack_with_heading(trialDLCFolder, timestamp_ms) % This code reads in the multiple h5 files produced by DeepLabCut % and then converts the data so that it can be saved as a % MLBehaviourTrack hdf5 file used by the pipeline. %trialDLCFolder = pwd; %trialAnalysisFolder = pwd; ...
d184f25f005049c9063cebe36e7cf528ade79496794ecd98681991d203cdc656
MATLAB
2,288
73
classdef MLTetrodeSession < MLSession %MLTetrodeSession A tetrode session % A session specific for tetrodes properties TFilesFilenamePrefixes end methods function obj = MLTetrodeSession(... config, ... sessionRecord, ... nam...
34bfbccbb698f01ba3c8efb22b25fc272ec6591cced876392582edb1b139692c
MATLAB
2,289
90
%build_sim_RP_table_highFR_stdRP.m % assumes run_simulations_highFR_stdRP.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; }; datadir = pwd; %% addpath(scriptdirs{:}) addpath(datadir) %% set write prefs down...
35166ae3d8caa4a9ea3de1a7afa10f37cdfe1173b8124ed8095c088dfcc972b1
MATLAB
2,289
86
function [h, t] = vl_plotbox(boxes, varargin) % VL_PLOTBOX Plot boxes % VL_PLOTBOX(BOX) plots a box specified by the 4-dimensional column % vector BOXES = [XMIN YMIN XMAX YMAX]'. If BOXES is a 4 x N matrix, % a box for each of the N columns is plotted. % % H = VL_PLOTBOX(BOXES) returns a handle to the line dra...
86217ade5ee283daf47a94dfc9a4e0ed5a16927df678130cac3561a9f0896a58
MATLAB
2,290
49
function sigRange = sigPntPlot2(x,y,posSigIdx,negSigIdx,poscolor,negcolor) sigRange = nan(1,6); interval = x(2) - x(1); if ~isempty(y) % posSigIdx = y > threshH; if ~isempty(find(posSigIdx,1)) sigPmY = y(posSigIdx); sigPX = x(posSigIdx); possIdx = find(posSigIdx,1,'firs...
b3bf8bbd74e30e003e26b40dd8056b2f7b59fe44b5b9bf75fa596e7141e133dd
MATLAB
2,290
59
classdef IntervalSeries < types.core.TimeSeries & types.untyped.GroupClass % INTERVALSERIES Stores intervals of data. The timestamps field stores the beginning and end of intervals. The data field stores whether the interval just started (>0 value) or ended (<0 value). Different interval types can be represented in the...
ba702c409ea92f3af1ed1addd23f1fe0f4049def606c9f3ec37e72eb233bbc1c
MATLAB
2,290
64
% initASLEyeTracker.m % % $Id: initASLEyeTracker.m 203 2007-03-19 15:41:00Z justin $ % usage: initASLEyeTracker.m() % by: justin gardner, eric dewitt % date: 02/24/05 % copyright: (c) 2006 Justin Gardner; 2009 Eric DeWitt (GPL see mgl/COPYING) % function myscreen = initASLEyeTracker(myscreen,...
42eb255afc1252339c5bf105060978aab81ff5958451519a972312b54199cac4
MATLAB
2,292
92
%fig9_unit_ex.m %% clear all; close all; clc; warning('on','all') %% addpath if not added yet % assumes script run within local directory scriptdirs = {pwd; '..\..\plot'; '..\..\helper_functions'; }; addpath(scriptdirs{:}) %% datadir = pwd; datafile = 'fig9_fig10_unit_ex.mat'; datapath = fullfile(datadir,datafile)...
c24280e8516c59a6f153db3a593e0fb6470d6b0e93a2fd9d60bf34ddecb5dded
MATLAB
2,292
51
clear;clc % set FSL environment -- check without the last 4 lines setenv('FSLDIR','/usr/local/fsl'); % this to tell where FSL folder is setenv('FSLOUTPUTTYPE','NIFTI_GZ'); % this to tell what the output type would be fsldir = getenv('FSLDIR'); fsldirmpath = sprintf('%s/etc/matlab',fsldir); path(path, fsldirmpath); cl...
0d80d98fbc2c7998c37fd534839e6387e5ce63f9dbaa4050aec4461c76bf3648
MATLAB
2,293
56
function fH = makeSupplFigure8_STRetParams_TimeSeriesPredictionsRsquared(projectDir,... allDS,roisToPlot,temporalModel, spatialModel, subjnrs, saveFigs, saveFigDir) % Function to reproduce supplementary manuscript figure 8: % panel a/b: V1 time series + CSTfix, CSTopt, DN-ST model prediction for each stimulus cond...
a2a7ae8fa1ddb0e625bfad3502c94d431cb287fa0bf25542019497d7e8d3f4c1
MATLAB
2,294
57
function mltp_plot_bfo_general_placey_session_grouped(obj, session, rotDeg) % This function is used by the pipeline and supplied with either % rotDeg = 90 or 180. It plots the groups best fit orientations. dataFilename = fullfile(session.getAnalysisDirectory(), obj.Config.best_fit_orientations_placey.o...
57cd1a907cebe72c345f5d33e42be4a91005d0b420c440224e869e347f6c7933
MATLAB
2,295
91
function raster_plot(spikes,touch_idx,nplot) %check that both variables have the same number of rows if size(spikes,1)~=size(touch_idx,2) display(['The variables have a different number of rows Spikes = ' num2str(size(spikes,1)) ' touch = ' num2str(size(touch_idx,2))]) keyboard end %% plot rasterplot chronologi...
77f02b8c5b4499070814a10fd1a7e9d982a00aecc591f07a3e4547a4538a8658
MATLAB
2,296
74
%% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; load('eval.mat') % radii = [4:8]; % SNRs = [3:4:23]; output_folder = ['./EXTRACT_CV/']; if ~exist(output_folder,'dir') mkdir(output_folder); end CV_times = zeros(length(filenames),1); for p = 1...
96e8dd66c8d6e43185cf615e318872a5eda271c6dd222c4bc10fdcee60e93d06
MATLAB
2,297
91
%build_sim_RP_table_stdFR_RPk0nr3.m % assumes run_simulations_stdFR_RPk0nr3.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; }; datadir = pwd; %% addpath(scriptdirs{:}) addpath(datadir) %% %% set write prefs...
9c33cfe64cf63cd83ed8b72c1bfefd06bb84f5cb7b516fa74ddda4d37ef7288e
MATLAB
2,297
91
function [videoFrames] = ml_freezeframe_read_video(fn) % This function read a limelight video file ("llii" extension). if isempty(fn) error('Filename is empty'); end if ~isfile(fn) error('The file does not exist (%s)\n', fn); end fileId = fopen(fn); if fileId == -1 ...
dd92e5c3e5577e83416b9237b19fdc9488be33551c6e9a30ac18368dab72ce4c
MATLAB
2,297
50
function fH = plotLMMregressionSlopes_v_pRFSize(lmmResults, resampled_medianPRFSz, roisToPlot, cmapROIs,saveFigs,saveFigDir) fH = figure; set(gcf,'Position',[889,294,963,604]); hold all; for idx = 1:length(roisToPlot) currMnSz = mean(resampled_medianPRFSz(:,idx),1,'omitnan'); currSEMSz = std(resampled_...
43194e5770b18ce2156c83ba455edc6d7d3aed4208054901e117d29b6ee631a6
MATLAB
2,299
90
%build_sim_RP_table_stdFR_RPk0.4nr4.m % assumes run_simulations_stdFR_RPk0.4nr4.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; }; datadir = pwd; %% addpath(scriptdirs{:}) addpath(datadir) %% set write pref...
c3648667cc52b32ff0e2f4546ee109861501dd8a5eade7ff62bc4f7596f97fc2
MATLAB
2,299
65
% mglTestDots.m % % $Id: mglTestDots.m 380 2008-12-31 04:39:55Z justin $ % usage: mglTestDots(screenNumber,numsec,backgroundColor) % by: justin gardner % date: 04/05/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: test OpenGL dots % function retval =...
ea68585e1965930356de998b0708cbf5d1d0a2724bcb4607a16358c89dec3b37
MATLAB
2,299
64
% manualMoveNotMoveCorrect.m % quick script to modify moveNotMove to make not moving anything after % cutoffT (in sec) % 8/5/22 cutoffT = 120; cutoffLegInd = find(legTrack.t >= cutoffT,1,'first'); cutoffFtInd = find(fictracProc.t >= cutoffT, 1, 'first'); legNotMoveInd = unique([moveNotMove.legNotMoveInd; (cutoffLegIn...
1317d0ad53b23d5528894292d276538824fd6eb4b580c771daa243dfe21ed0be
MATLAB
2,300
76
function [file] = read_bti_ascii(filename) % READ_BTI_ASCII reads general data from a BTI configuration file % % The file should be formatted like % Group: % item1 : value1a value1b value1c % item2 : value2a value2b value2c % item3 : value3a value3b value3c % item4 : value4a value4b value4c ...
d796618d200aaf9243b667b3257d1b7f6de0d9b105cae28884ed7f0eb56bdc64
MATLAB
2,300
77
% $Id$ % % by: Benjamin Heasly % date: 03/18/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Function to draw a polygon in a screen opened with mglOpen. % x and y can be vectors (the polygon will be closed) % % Note for MGL v3 with Metal: % ...
7601e8b9d1fc5e891c17f77f436fb4cc0496a783aa5061745104f12d14228fca
MATLAB
2,301
67
function [parameters,error] = fitting_function(data,fitting_target,starting_values,model_name) % set up initial values and bounds switch model_name case 'multi_trial_belief' value_init = ones(2,4) * 0.2; lb = [0.05,0.01,0.01,0.01,0,0]; % lower bound ub = [0.5,1,1,1,1,0]; % upper bound ...
95247d667f318880a478bcd5a63bb700a74654e79e43ab673cb7b47c8cc54d3e
MATLAB
2,301
74
%% Copyright (C) 2005 Julius O. Smith III %% %% This program is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation; either version 2 of the License, or %% (at your option) any later version. %% %% This program is ...
98362cf88ff12e124caa3ec22009eba7e91f8eb57568084bf39c4e023381ea3c
MATLAB
2,301
78
% % Plot the precision over a given set of methods. % % PARAMETERS % $NETWORK % $METHODS Space-separated list of methods % % INPUT % dat/precision.$METHOD.$NETWORK.mat for each $METHOD in $METHODS % % OUTPUT % plot/precision.all.[a].$MEASURE.$NETWORK.eps % for all $MEASURE % a - Show only the best submethod for ea...
98478838e64eb9cd40214073da4f31dc073bffc7c061907ab3053e367f301853
MATLAB
2,301
93
% % Labels of submethods. % % RESULT % labels % .(submethod) Readable label of the submethod % function labels = get_labels_submethod() labels = struct(); % Local labels.adad = 'AA'; labels.absadad = '|AA|'; labels.jaccard = 'Jaccard'; labels.absjaccard = '|Jaccard|'; labels.common = 'CN'; labels.abscomm...
3bf1aef61f01683fcb35f45bea8b112e21e9d6ae4d6e766f9549b274b797f0a7
MATLAB
2,302
67
% mglStencilCreateBegin % % $Id$ % usage: results = mglStencilCreateBegin(stencilNumber, invert, socketInfo) % by: justin gardner and ben heasly % date: 05/26/2006 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Begin drawing to stencil. Until mglStenci...
7808e9d18b58d99cb6d26813f44bd6b99fe99c294abe5cea1c3393369f45675e
MATLAB
2,302
57
% calculate the mean and variance of arbitery windows using integral image computation function [avg_c, var_c] = calcVariance(I, gridx, gridy, patchSize) % if isdouble(I), Ip = I; else Ip = double(I); end Ip = double(I); [imh, ~, imc] = size(Ip); % coordinates of center pixels for computing regional sum in integra...
656443ea7d1192c2b9872bdb2dce014185b6cdb30b71c4df6dee64d72f1c9427
MATLAB
2,303
54
function [probe] = translateProbe(probe, translate_amount) %TRANSLATEPROBE Translate probe relative to ROI % Translates the entire probe (assembly of modules) relative to ROI to % ensure proper coverage. Translate_amount is defined as [deltax, deltay] % where deltas can be negative or positive. Additionally, if %...
e75d13fe0eeaa877d4dda03482f0617fe9553cb363c7d97cea36b5e08f51e64d
MATLAB
2,303
79
function [peak_distance,OS_peak]=OS_poincare_v5(ROI_profile,name,timeinterval,varargin) % last updated 20240324 mw. % Diffrence from V4, normalize data first, then find peaks. Deleted unused codes %% This code is for analyzing traces with irregular periodicity, including %% load the traces ROI_profile=ROI_profile...
ff98c82c4e8bb8e3bc38b59959531849d3262b55e14ce82f58bd6a826a464d56
MATLAB
2,303
117
% script for quick plots of avgLegFictracEphysIinj figure; hold on; sampRate = 1000; avgWin = 0.1; durInd = 3; lgdStr = {}; for i = 1:length(amps) % moving average smooth FicTrac data movAvgFwdVel = moveAvgFilt(fictracIinj.fwdVel.means{i,durInd},sampRate,avgWin); plot(fictracIinj.durTs{durInd},movAvgFw...
bb2bcd8f6a395eeb425039ee41c8be877d2579264819186d1da20e89ea9e4f9c
MATLAB
2,304
71
% this script create a 3-D scatter plot showing different pattern of the % dynamics, including ON-ON, OFF-ON, OFF-OFF and ON-OFF % 3 dimensions are: DeltaE (x), DeltaI (y), and Isens(z) rootFolder = "figure_40_diff/"; % ON-ON data = readFilename(rootFolder+"asAllCriteria/*_*_*_*.png",'%f_%f_%f_%f'); data( all(~data,2),...
370eac5cd8a37a0305cb371593fb2fbd8d00235b10b4fa396edb118804223c95
MATLAB
2,305
76
function [acc,left_num,right_num] = CSP_LDA(MIEEGData,label,Fs,LowFreq,UpFreq) % Common Spatial Pattern + Linear Discriminant Analysis % 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 sett...
b2e99adc8a90f8bbd58c4bb7431f7d218911379238a903a99ab32777a171aa6b
MATLAB
2,305
54
%% Script to reproduce the results of the paper %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Note: A few sessions contain simultaneous recordings from M1 and PMd. % % We define: % % Session: Behavioural session. A file that contain one set of movements % and their kinema...
0e4fc97613c4442eb53091911ef0f61125d230a8c2b0bfa3ec8419c57f22942e
MATLAB
2,306
92
%build_sim_RP_table_stdFR_RPk0.7nr18.m % assumes run_simulations_stdFR_RPk0.7nr18.m has been run first %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../figures'; }; datadir = pwd; %% addpath(scriptdirs{:}) addpath(datadir) %% %% set writ...
859ffb62a8eb4a2278e7ed2cab4fcc221e5fae999ed593d6c20539dbe9c7416d
MATLAB
2,308
77
% get feature planes for the whole image function chns = extr_feat_plane(I, descPara) [imh, imw, imc] = size(I); if imc ~= 3 error('only rgb image is accepted'); end chns.imh = imh; chns.imw = imw; % transform rgb image to other color spaces (all in the range of [0,1]) [chns.rgb, ~] = Image2ColourSpace...
e166e69a7f57f6a2ca91711a1aca08f2878710bf70fb53dfaadd5cf84c24f6ae
MATLAB
2,308
56
% Computes the design effect (DEFF), which can subsequently be used to correct % sample size calculations using the 'sampszcalc' function. % % -- Function File: DEFF = deffcalc (BOOTSTAT, BOOTSTAT_SRS) % % 'DEFF = deff_calc (BOOTSTAT, BOOTSTAT_SRS)' computes the design effect % (DEFF) by taking the ratio of the...
02398ce810932405f74d5f750fcdf3bdf101b7495f2eafa64d412de63dd049bd
MATLAB
2,310
58
function [ns_RESULT, TimeStamp, Data, SampleCount, UnitID] = ns_GetSegmentData(hFile, EntityID, Index); %ns_GetSegmentData Retrieves segment data by index % % Usage: % [ns_RESULT, TimeStamp, Data, SampleCount, UnitID] = % ns_GetSegmentData(hFile, EntityID, Index) % % Descripti...
11c3962b47d426eafffda0f39ac44023c256312f676581c17e93917c893fefe3
MATLAB
2,310
78
function GRE_preparation_2nifti(dcm, output_dir, cleanup) % function GRE_preparation_2nifti(dcm, output_dir, cleanup) % % preparation for multi-echo GRE data, convert from DICOM file/folder to NIFTI using dcm2niix % then combine multi-echo GRE data and read Params from json file and save to .mat % % input_dir: inp...
53d76aa961002b40025c948703c032bb34a47c7edd05e481fa5514257582bcbe
MATLAB
2,310
64
%{ 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...
66bd5cfc938521939088373ff0829231f802af33746982f17bffdf68e60ae2dc
MATLAB
2,310
63
% % 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. functio...
5ff0767797ee5b8e2fa8df622d57b06f9d8557feabe9b004261f4d3155640763
MATLAB
2,311
85
function vol = read_hdr(fname) % Get a variety of information from a NIFTI-1 header. % FORMAT vol = read_hdr(fname) % fname - filename of image % vol - various bits of information % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % %...
80840ac62b3f09aeb8f3198736b139f95997cf665f6eb2ad1cc6feb47bf7a5a0
MATLAB
2,311
95
%% Script for the extraction of IBI distributions %% % attenzione non da worning su nomi %% Set up iniziale % nbins=100; clear close all binwidth = 0.1; IBI_Sponge_18_all = []; %da cambiare manualmente per ora per ogni configurazione (seleziona tutti e modifica) %% Output folder [end_folder]= selectfolder('Sel...
7e4805b23fdb54e96c7368d537c4902b4571dca3678156c9316d9714b8dbec31
MATLAB
2,312
50
% Cost Function for the GBM model % Original Source: Marisa Eisenberg (marisae@umich.edu) % Since we had less T cell data than the other cell types, we had to modify how the T cell data % was inputted into the error equations. We used the weighted ordinary least squares (OLS) error, % but this script constains multip...
a0b8074cd4a6fee6970dd27195ce0e81123569046f8cd475fc7e4f3a603fcb3a
MATLAB
2,313
81
function section=handleSectionArg(section) % Handle section arg for various functions such as stitchSection % % function section=handleSectionArg(section) % % Purpose % Physical section/optical section converter. % % INPUTS % section - 1) A scalar (the z section in the brain). Used to retrieve one plane only. % ...
35f85eb942dd14a4800264f4c31c3ed3f629e07311ef6eda12746c41492d4e56
MATLAB
2,316
108
movfiles = dir('/groups/branson/home/bransonk/behavioranalysis/code/SSRNN/SSRNN/Data/bowl/GMR_71G01_AE_01_TrpA_*/movie.ufmf'); for i = 1:numel(movfiles), [~,nframes(i),fid] = get_readframe_fcn(fullfile(movfiles(i).folder,movfiles(i).name)); fclose(fid); end %% n = numel(pd0.data{7}); for i = 1:n, if i...
6f965675a179d2baeeea10f29c501bdeb0786cbcca4bfd8cca29ddfe618f9da6
MATLAB
2,316
92
%fig10_additional_unit_ex.m %% clear all; close all; clc; warning('on','all') %% addpath if not added yet % assumes script run within local directory scriptdirs = {pwd; '..\..\plot'; '..\..\helper_functions'; }; addpath(scriptdirs{:}) %% datadir = pwd; datafile = 'fig9_fig10_unit_ex.mat'; datapath = fullfile(datad...
d7300549bc3383d21fb168eb62a32bbd66d3eb06c6d9e60c8ae241922cef4851
MATLAB
2,316
55
function [Pwire, Ewire] = wire_single_loop(Rx, Ry, a, b, N, M, type) % This function creates the structured wire grid for a single % ellipsoidal or circular loop with semi-axes Rx, Ry % a - cross-section conductor radius in m when option type='circle' is chosen for % the wire cross-section % a, b - conductor...
1f9f0f91112378becf682d8515631dece3879e3a48e0f556bf13724973de2de8
MATLAB
2,317
66
% 2021-06-04: I wrote this code to test the path simulation code. The path % simulation code performs a random walk with intermitent attraction to one % of the 4 cups so that the paths are more realistic to what we see with % real data. % 2021-06-08: Extended the demo code to generate an entire sessions's % behaviour ...
7958e34c4755d05431b2fa5370bfdf7fd924c1037c8ae215b82d54c937f39f32
MATLAB
2,317
78
function [x, state] = ft_preproc_standardize(x, begsample, endsample, state) % FT_PREPROC_STANDARDIZE performs a z-transformation or standardization % of the data. The standardized data will have a zero-mean and a unit % standard deviation. % % Use as % [dat] = ft_preproc_standardize(dat, begsample, endsample) % whe...
dfae38169785317e9460d10b59d8b5de45391bbd2f3bd7b2b867dd9428150260
MATLAB
2,317
58
clear file=dir('ACC*restable*.mat'); k=1; for jj=1:length(file) load(file(jj).name) gotrial=find(outcome(:,1)==1|outcome(:,1)==2);%Go trial,hit/miss gotrial(find(gotrial<=1),:)=[]; %delte first trial previous_trial_g=outcome(gotrial-1,1);%previous trial reward_trial_g=find(previous_tri...
0ec92766ef90ffba2ae107618248aa99225bfd23793e4fe0f4f532231984ec62
MATLAB
2,318
85
function vol = read_hdr(fname) % Get a variety of information from a NIFTI-1 header. % FORMAT vol = read_hdr(fname) % fname - filename of image % vol - various bits of information % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % %...
538dcfc6046ce4b2d7d2046fb04bbd1f71a106c4e1f9aee7b08caa1d9c54a187
MATLAB
2,319
63
% getLegReversals.m % % Function for getting max and min in leg positions, when leg reverses % direction % Adapted from nonInteractGetLegReversals(), but uses findpeaks to get leg % reversals instead of findLegReversals() % % INPUTS: % legTrack - struct of leg tracking data, output of preprocessLegTrack % moveNo...
19b47029c006dc100b30165050e82a6b5a58547c1e5d2212e93db324dc43cae2
MATLAB
2,320
113
% mglTestTexFast.m % % $Id:$ % usage: mglTestTexFast() % by: justin gardner % date: 05/17/12 % purpose: % function retval = mglTestTexFast() % check arguments if ~any(nargin == [0]) help mglTestTexFast return end % open screen mglOpen(0.8); mglScreenCoordinates; % size of image to ...
7154448f6311be9e4c2640d5c1ac1eaeab5326b28112f6660a0f5f40b092e37e
MATLAB
2,320
72
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline 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]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenames...
51562f109a318564bd01a508e8e4ff5f85c2ddcd28ce42758c1c21d5abc1e5c9
MATLAB
2,321
113
% mglTestTexFast.m % % $Id:$ % usage: mglTestTexFast() % by: justin gardner % date: 05/17/12 % purpose: % function retval = mglTestTexFast() % check arguments if ~any(nargin == [0]) help mglTestTexFast return end % open screen mglOpen(0.8); mglScreenCoordinates; % size of image to ...
9a656c45f62bc1337124ab4256dac3c53f973b101005f9a385361d60e18d18f6
MATLAB
2,322
71
%% Start the main pipeline filenames = {'CaMKII_120_TMT Exposure_5fps_part11','CaMKII_120_TMT Exposure_5fps_part12','CaMKII_120_TMT Exposure_5fps_part21','CaMKII_120_TMT Exposure_5fps_part22'}; radii = [10:2:18]; SNRs = [15:4:31]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenam...
8e3ad379897df4da19931aefa01e134048ee4d446c3a1e84f82fafb2363add8e
MATLAB
2,323
90
function vl_xmkdir(path, varargin) % VL_XMKDIR Create a directory recursively. % VL_XMKDIR(PATH) creates all directory specified by PATH if they % do not exist (existing directories are skipped). % % The function is meant as a silent replacement of MATLAB's builtin % MKDIR() function. It can also be used to sh...
4c69d7c2eb934d08e0e453c64f7f44ce5192ca882f4494bf63b6ab70e17bc3e6
MATLAB
2,326
66
% mglTestDots.m % % $Id: mglTestDots.m 380 2008-12-31 04:39:55Z justin $ % usage: mglTestDots(screenNumber,numsec,backgroundColor) % by: justin gardner % date: 04/05/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: test OpenGL dots % function retval =...
83081af0caaf8ae8499afac79bf76632c04629067f159b4cfa4a4c3a52d57d06
MATLAB
2,327
82
function P=sampleApprox(alpha,mu,n_samples) % sampleApprox Compute sample-approximated null model % % Syntax %__________________________________________________________________________ % % P=sampleApprox(alpha,mu) % % P=sampleApprox(alpha,mu,n_samples) % % % Description %____________________________________________...
d6cb8890877ebdb6b54f2ed12adf0715809045e0244df93c9ecec5dddc017f55
MATLAB
2,327
84
filename = 'Sim1'; noise_wave = 1; % Script to simulate mEPSCs with amplitude and kinetics Time=9.9; n=40; % set between 5 (0.5 Hz) and 40 (4 Hz) sample_rate=40000; N=sample_rate*Time; Event=zeros(N,1); EventMarkers=Event; Trace=zeros(N,1); T = (0:N-1)'*1/sample_rate; % Generating...
044969c6f01609e1c14a37e4f8fbae4ae618f6e7daeadc0bbc4e500b61d3b57e
MATLAB
2,328
115
function path = findPathInDiGraph(adj, src, snk, verbose) %FINDPATHINDIGRAPH Return all paths between two nodes of a graph % https://github.com/kakearney/pathbetweennodes-pkg % pth = pathbetweennodes(adj, src, snk) % pth = pathbetweennodes(adj, src, snk, vflag) % % % This function returns all simple paths (i.e. no cycl...
066ecdfacfe265b5e875b913b4da7ae24fd0ed0a013c287df64774470c0f3aff
MATLAB
2,328
72
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'Mouse_1K','Mouse_2K','Mouse_3K','Mouse_4K','Mouse_1M','Mouse_2M','Mouse_3M','Mouse_4M'}; radii = [4:9]; SNRs = [7:4:23]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(f...
a190fd06446a3793a8ff107ac9ca03b89c456f6f620bfc3b62941b4627ff053b
MATLAB
2,329
74
% This example shows how to NOT use MOCA assembly functions to create a % probe. Design parameters and probe are set manually, and % characterizeProbe() is still used to determine metrics clear all % Design Parameters % Manually define the perimeter, src/det posns, and roi probe.module.perimeter = [-17.5000 17.500...
60601597be585e98019304d329e991ee167a78b928ccab78147c1213c1dc5797
MATLAB
2,331
55
classdef RECORDINGMODE_SETUP < RECORDINGMODE_COMMONMETHODS % Object with properties and methods to analyse setup fields from % PerceptPC json file at NCN lab % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andreia M. Oliveira, Eduardo Carvalho, Beatriz Barros, Car...
43a7e907170ce2c240fc9e4a2e9962dfe250f712de1486521a68e06e82b2398f
MATLAB
2,332
75
% mglTestTextureOddSizes: an automated and/or interactive test for rendering. % % usage: mglTestTextureOddSizes(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test rendering some text as an image. % ...
fc8cf76784aba6c8d3d5fb546fd8a3ea4549c27103785713c03659844f01c226
MATLAB
2,334
72
% mglTestUpdateTexture: an automated and/or interactive test for rendering. % % usage: mglTestUpdateTexture(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test rendering a smoothly varying texture. % ...
29e77da660157af9894fdb57132e33d19f0b8a8e93b0d061bc540e4017952224
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 8; SNRs = 3; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
2d7195784b9a5a74304830a4769404c3de9951b058e675a09e210d423d728aa8
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 6; SNRs = 7; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
4e670b267d9c07e9effbf00caa2a28d302ddae63d71253e3fbc6ad8816ceb63c
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 8; SNRs = 4; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
b26681d3ff1efbf17b20c35971f3b3c3b28f0c30253f5b758d47889cbb765d77
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 4; SNRs = 4; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
cc986545316612dac65cd53755c24580b0c45ac58563236c1011e8daefca6749
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 7; SNRs = 7; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
cdc180d4da053b5264950b8fad6772353528aee1410547f67f129e32089f9fb6
MATLAB
2,335
71
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4','sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = 9; SNRs = 3; output_folder = ['./','EXTRACT_radius',num2str(radii),'_SNR',num2str(SNRs)','./']; if ~exist(output_fo...
8692cda67740ae9ba28134b2a59a1c5376202581946c2b87e09fc55c68c315d9
MATLAB
2,336
90
% plotSpikerateMoveNotMove.m % % Function to plot the mean spike rate during moving and not moving periods % (output of getMoveNotMoveSpikerate()). % % INPUTS: % datDir - folder containing getXCorrEphysContParam_cell() output files % yScale - scale for y-axis % % OUTPUTS: % none, but generates plot % % CREATED:...
1f3058d3529ee9c527e7189595fbecda28ebcfd0107193857e7c63a5a8eb3c8c
MATLAB
2,338
72
addpath(genpath('C:\Users\Yijun\Documents\MATLAB\EXTRACT-public-master')); %% Start the main pipeline filenames = {'Mouse_1K','Mouse_2K','Mouse_3K','Mouse_4K','Mouse_1M','Mouse_2M','Mouse_3M','Mouse_4M'}; radii = [4:9]; SNRs = [3:4:23]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(f...
7eb89170834836c7a5f71b5a9424be989515b635abf47151a7c87c73352b2e09
MATLAB
2,338
82
% Function: f_ImageMatrix % % Descrption: % This function makes the image of the data contained in a matrix. Each % cell in the matrix is the center of a rectangular pixel. % % Parameters: % pm_Data(*): Matrix to display as image % pv_XAxis: Vector containing the bounds of x axis (see "help imagesc") % pv_YAxis: Vec...
a20437c331145a8e17185909e5d7b3b34d845a20c91508faa127fb782d5629f9
MATLAB
2,338
98
function batch_data=batch_do_data_augmentation(train_opts, imdb, work_info_epoch, batch_data, work_info_batch, work_info) data_aug_config=train_opts.data_aug_config; if work_info.ref.run_eva || ~data_aug_config.do_aug batch_data.aug_info=[]; return; end if ~isfield(imdb.ref, 'data_aug_params') || isempty(...
bd958e8802b0940339f2d1f78ce28472994008a88e2db2d946df0864df3c472e
MATLAB
2,338
86
function B = aedes_rot3d(A,k,dim) % AEDES_ROT3D - Rotate 3D (or 4D) matrix in 90 degree steps in 3 dimensions % % % 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.Nis...
d6d0182ee404bf4e946d8bd38552bd3baa134474a955d6be3bfe91d4698d65fa
MATLAB
2,338
116
function [all_ref,all_som,all_pv] = plot_binned_correlations(corrs,ds_ct_matrix) all_ref=[]; all_som=[]; all_pv=[]; all_comp=[]; for d = 1:length(ds_ct_matrix) reference=ds_ct_matrix{d,1,1}; som_rsc=mean(corrs{1,d},3,'omitnan'); pv_rsc=mean(corrs{2,d},3,'omitnan'); select=ones(size(som_rsc,1)...
e41517226d7e26b932fba41bb51badf40de81bba992e0e07cbec788205cb4adc
MATLAB
2,342
65
function one_result=seg_eva_gen_result_from_con_mat(one_con_mat, exclude_class_idxes) class_num=size(one_con_mat, 1); accuracy_classes=zeros(class_num, 1); inter_union_score_classes=zeros(class_num, 1); if nargin<2 exclude_class_idxes=[]; end ...
932a35e3643a0a675bd65ac1ac1c0fd40bafe37044a13bbc6252107f9f8364a3
MATLAB
2,345
90
%% import the NGS file VV=fastqread('E:\GXX\mHMLPseq\2ndseq\mHMLPseq-2_combined_R2.fastq\mHMLPseq-2_combined_R2.fastq'); seq=[]; for i =1:size(VV,2) seq{i}=VV(i).Sequence; end data_set=seq; pool_ref_sgRNA=refpool; %import data->.scv->cell->file name named as refpool ref_sequence='GTTTTAGAGCTAGAAATAG'; sg...
ec8d783f3a1c2cbbf140b93e90a3094ecba0e26b738db4cdbae3b86ceab9a1be
MATLAB
2,345
71
function [Wrot, CC] = get_whitening_matrix(rez) % based on a subset of the data, compute a channel whitening matrix % this requires temporal filtering first (gpufilter) ops = rez.ops; Nbatch = ops.Nbatch; twind = ops.twind; NchanTOT = ops.NchanTOT; NT = ops.NT; NTbuff = ops.NTbuff; chanMap = ops.chanMap; Nchan = rez.o...
19d26fc0b2c56969881898c512fda9f46f853206b1afe22e1065c637ea86badb
MATLAB
2,346
63
function [density_diff] = PlotWatershedDifference(embeddingValues1,embeddingValues2) %Plots the density map along with the watershed; not used in paper maxVal = max(max(abs([embeddingValues1;embeddingValues2]))); maxVal = round(maxVal * 1.1); load('reference_embedding.mat') sigma = 4; %change smoothing...
cce170dc0aeb797cad4c0068c5296cd701655115104fad807aed4ad9968ed3d1
MATLAB
2,346
52
function [Pwire, Ewire, Swire, P, t, tind] = meshcoil(x0, y0, z0, M, N, a, b, flag, sk) % Create the mesh (both CAD surface mesh and a computational wire grid) % for a simple z-oriented coil with elliptical/spherical turns % characterized by centerline intersections x0, y0, z0 with xz and yz % planes and 1 A of...
e675d29ada85cabae607d05fe9ed522b1afffc26fc7a837076ab7254db4a9968
MATLAB
2,346
79
classdef MLExperiment < MLExperimentInterface %MLExperiment Implementation of the interface % An implementation of the experiment interface properties (SetAccess=private, GetAccess = protected) AnimalName ImagingRegion ExperimentName ArenaGeometry NumContexts ...
087200b644caaa6ad14bfbe3a39bbc99e60f64e2719bcbcce762163528c42f8b
MATLAB
2,347
100
function[] = overlayMarkersMax(); %% Project synapse locations onto maximum projections of dendrite % size not taken into account here %% load maximum projection dendriteList = dir('*MAX*Dendrite*.tif'); nFiles = size(dendriteList, 1); if nFiles>1; disp('There are multiple max projections, help me!'); ...
312522890963a1a32e575e4f2fc02362d4d3c05429ad03314e5e4d7468dfa2fc
MATLAB
2,347
105
% % Plot the eigenvalue distribution. % % PARAMETERS % $network % $decomposition % % INPUT FILES % dat/distr.$decomposition.$network % % OUTPUT FILES % plot/distr.$decomposition.[abf].$network.eps % (a) Plain distribution % (b) Stairs, i.e. transposed cumulative distribution % (f) Cumulative distribution % % % C...
b5b13d0a01fe07936f9ed0776fcf6dd140298c0b5187450ead222bca3a5039b2
MATLAB
2,347
66
function text = cleanECG( obj, fs ) % filter ECG artifacts from LFP online streaming recordings % % Syntax: % CLEANECG( obj, fs, ax ); % % Input parameters: % * obj - object containg data % * fs - sampling frequency % * ax (optional) - axis where you want to plot % % Example: % CLEANECG( fs, ax ); % % Avai...
52a35b5a9fb6ade7ff75b964690f276517d8ace4182253bb2ccc749c552bbbbd
MATLAB
2,348
65
% ---------------------------------------------------------------- % function CalScale % input: I ...........Input image % output: ScaleMap.....Output Scale Map % implementation described in the paper: % Peng Jiang, Haibin Ling, Jingyi Yu, Jingliang Peng % Salient Region Detection by ...
1bcb68749497ae79c4979a3c81abfb4aafcd2fb7e69a3609f61cc86222ca36d2
MATLAB
2,349
67
function [emm] = relevel_table(emm, var2relevel, varargin) % Re-level categorical variables in the estimated marginal means table % Copyright 2019, J. Hartman, Cornell University % written using Matlab version R2016a % % INPUTS: % emm is output from emmeans.m % var2relevel is 1 x N cell array of strings corres...
5b58b9460f3080be0a682f8f215a9e174df22e47cf04f98d6088c123fe8dd099
MATLAB
2,349
46
%{ TDMS files can store many different types of data inside of them, such as uint8, int16, doubles, etc. A full list is outside the scope of this document. One of these data types is rawDAQmx. I think this data type is actually the bit representation captured by the DAQ (hence the name raw). The presence of this dat...
d62a57c7ba7f255edb328a3d3dcd5eefcd94643dc6f00f38f1687e7cc9c7d1cd
MATLAB
2,349
55
function [SVM, Acc_SVM, Sens_SVM, Spec_SVM, labs_SVM, corr_SVM, corr_SVM_F]=get_svm_jt(groupTrain,groupTest,datTrain,datTest,lab,kernel,Seed,kf,ztransfo) Xtr = datTrain; Xte = datTest; Ytr = groupTrain; Yte = groupTest; if ztransfo == 1 Xtr=(Xtr-mean(Xtr))./std(Xtr); ...
0578fbb98611b1b21dd88ca7a37aafdc0f40e411087ee9e6e8c68024a4dccd0e
MATLAB
2,350
72
function T = spm_type(x, arg) % translates data type specifiers between SPM & Matlab representations % FORMAT T = spm_type(x, arg) % x - specifier % T - type % arg - optional string argument, can be % - 'maxval' - return maximum allowed value. % - 'minval' - return minimum allowed value. % - 'nanrep' ...
a7afa231e0cbcaf1243231f0eacf4733e5bc6d85801e02ff240a974ff0ef7ccd
MATLAB
2,350
61
function [selectedVoxels, rNC] = selectVoxelsFromNoiseCeiling(noiseceilingRun, amplTrial, roiOrder, combROIs, topX) % Get nr subjects and rois [nrSubjects, nrROIs] = size(noiseceilingRun); % Preallocate space selectedVoxels = cell(nrSubjects,nrROIs); rNC = selectedVoxels; switch topX case 'top250vox' to...
47c8b3f7c275776691527e853d61a9731f730409e767d393152f936e51b38966
MATLAB
2,351
71
function [headmodel] = ft_read_vol(filename, varargin) % FT_READ_VOL reads a volume conduction model from various manufacturer % specific files. Currently supported are ASA, CTF, Neuromag, MBFYS % and Matlab. % % Use as % headmodel = ft_read_vol(filename, ...) % % Additional options should be specified in key-value ...
4a0d32fe6f6ef94d91a62c01ac1b76b230bb41e0b7dc59303df4fc49d61a1cee
MATLAB
2,351
73
function [fixed] = ml_nlx_nvt_fix_extracted_array(nlx_vt_extracted_array) PARAM_WS=15; % How many points to smooth over % All of the indices that we will work on allIndices = 1:length(nlx_vt_extracted_array); % Find the indices that are definitely bad badIndices = find(nlx_vt_extracted_array == 0); % Find indices th...