sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
859e870eb2e17f8e46d1f61bda0adf735edf9181bae73a520671252e85d7ceaa
MATLAB
3,550
107
function dat = read_egis_data(filename, hdr, begtrial, endtrial, chanindx); % READ_EGIS_DATA reads the data from an EGI EGIS format file % % Use as % dat = read_egis_data(filename, hdr, begtrial, endtrial, chanindx); % where % filename name of the input file % hdr header structure, see READ_HEAD...
53463d84b5f68e15d89a9d65b54a06578eed88f72e4cf501b1fb05ed76b41f77
MATLAB
3,552
89
function [artitable] = features_from_alleeg(alleeg) % eg. outputtable = features_from_alleeg(ALLEEG);; % once you've done this, you can save the table to file using % writetable(outputtable, 'balanced_epochs.csv') displayplots = false; ids_missing_data = []; warning('off','MATLAB:colon:nonIntegerIndex') warning('off'...
897276532ea73acc4bf9a98e9373a7acf0bdaa9dd754ca487558ae5ca0ef7f40
MATLAB
3,554
114
classdef MLTrialData %MLTrialData Summary of this class goes here % Detailed explanation goes here properties dataFolder roi mlvidrecBehav mlvidrecScope track spatialFootprint ms cnmfe adjustReferenceFrame end method...
e155037f976c603f7c8b1eed807e056bea137714e206f3258c06dfe1e9675dc6
MATLAB
3,556
80
function [] = plot_worm_frame_post_analysis_with_track(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio,path_of_worm) % % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, UncertainTips, centerline_stimulus, debugimage,in_track_index,current_ellipse_r...
4a0b2490d75353e99522b6b642050e92e4bd45128a0bfc42a894913709829af7
MATLAB
3,557
127
%build_sim_HR_FA_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 preference...
4d89917efcd0164c938926bffd5122aa2951fb9c65883daabf435ff52437898f
MATLAB
3,558
143
function Denoising_T1(packagepath, flag, method, beta, patchradius, searchradius, suffixfile, rician, namein, pathin) disp(packagepath) disp(namein) % this code is taken from the MRI Denoising Package verbose =0; addpath(genpath(fullfile(packagepath, 'MRIDenoisingPackage'))); fprintf('%s\n\n', 'Selected param...
a4ed6bb6e8ef00a44df679f1a50c2d6f0ff5dd0fb2bdc0f78644e030ae45df68
MATLAB
3,558
117
savename = 'd\d_100Hz'; savename=strcat(savename,'.mat'); load(savename) seg = 1; temp.special = 1; samplerate = 101.7253; % mouse 115, recording 1 (only recording) thresh = 1.3; %% Mouse Specific % FRAME NUMBER (~ 10 frames / s) start_camFrame = [308; 5509; 14869; 15269; 15949; 17934; 21829; 25029]; stop_camFrame ...
7672ba9e2b3bde4239ea429886b7ceb2327af96684ec12747e96b87e1232795b
MATLAB
3,559
122
% Copyright (C) 1999 Paul Kienzle % % 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 distributed in t...
b49b5d59f6c5349ae4dac2ac24352e529be8668a8d59896733af0c2b033cb2fc
MATLAB
3,559
103
function [cut, map, short] = vl_aibcut(parents, n) % VL_AIBCUT Cut VL_AIB tree % CUT = VL_AIBCUT(PARENTS, N) cuts the binary merge tree PARENTS and % returns a cut CUT of N nodes. The format of PARENTS is the same % used by the VL_AIB() function. % % A cut is a set of N nodes such that no node is a descendant of a...
5131ff0d69fe1bdaa4f030dac60e0c7a84a3288200a1f62562170a4a72af6805
MATLAB
3,560
127
%build_sim_HR_FA_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 preferen...
c997630c2271e26f49b10fe86d25cced87d661eb06f7abc2fe10ddda8da08e69
MATLAB
3,563
127
%build_sim_HR_FA_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 prefer...
1f43c9fda771f595bca781c76dda355ef7aa1f16e113491ccd947b869a2fe223
MATLAB
3,565
78
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [TMissing] = helper_mapsdata_get_missing_trials_as_zeromaps(T) % All maps should have this size mapSize = size(T.map{1}); % Get all of the sessions present in the main map table [Sessions] = get_sessions_fro...
201dc937d24278ba3b95a391ce56ffb2b40f706a3c3b65262715b550cf511a67
MATLAB
3,565
130
function [RSS, XYproj] = Residuals_ellipse(XY,ParG) % % Projecting a given set of points onto an ellipse % and computing the distances from the points to the ellipse % % This is a modified version of an iterative algorithm published by D. Eberly % Internet publication: "Distance from a point to an ellipse in ...
762ffc11ec0a91ec6bf9b825d18d5fb2b858f8df0bd1cd0c4e5f84ba214d002e
MATLAB
3,566
83
function ops = Kilosort25Configuration_Dredge(dredgeParams) %% RH edits CODE rootpath = pwd; [~,ed] = fileparts(pwd); ops.chanMap = fullfile(rootpath,'chanMap.mat'); % make this file using createChannelMapFile.m load(fullfile(rootpath,'chanMap.mat')) ops.NchanTOT = length(connected); % total n...
e3673450760bf6ba6f0f8a13f5c92716988f05a54271e2df2abdc9bc4a56b029
MATLAB
3,568
101
function [Para, R2]= gretna_degree_distribution(Deg, Nbins) %========================================================================== % This function is used to fit the degree (also betweenness and others) % distribution of a network G in terms of three types: % Tpye1: exponential truncated power law fitting % ...
056dfb27e84c0cbf685c490aa47d5622ca7822a972622aab9edfdb9e6377c5fd
MATLAB
3,569
127
%build_sim_HR_FA_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 pr...
2f20d5e110db68cf2b715abe4a0155f600b186242cc5e2d34399fc520c0a3bd4
MATLAB
3,570
88
%Bar plots with the individual data points for different cohorts %You can use Prism Program instead :) %author: Chernysheva Maria %version:01.09.22 function SEM_Input = bar_plots_cohorts(input_data,legend_cohort,color_cohort, plot_title,YLabel,font_size, paired) %some arbitrary numbers for the plot's design...
790b36f747ae0e0ec1ed41ad534365093bb520dd425d64d4a3a0763ade98b7cf
MATLAB
3,571
108
function s = fillProps(props, names, varargin) % Fills the property list in the classdef assert(isa(props, 'containers.Map')); assert(iscellstr(names) || isstring(names)); s = ''; if isempty(names) return; end p = inputParser; p.addParameter('PropertyAttributes', '', ... ...
c5da24e00579fcf06529f7fb69f817ac6be8ffc394387143dfa416804146060a
MATLAB
3,572
127
%build_sim_HR_FA_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 write ...
51619baa78c104b20af4319aa974d8b8b80847f6ba40bbcd57b804c2a14c443b
MATLAB
3,573
94
clc; %Recreate needed property constants defined in nilibddc_m.h DDC_FILE_NAME = 'name'; DDC_FILE_DESCRIPTION = 'description'; DDC_FILE_TITLE = 'title'; DDC_FILE_AUTHOR = 'author'; DDC_FILE_DATETIME = 'datetime'; DDC_CHANNELGROUP_NAME = 'name'; DDC_CHANNELGROUP_DESCRIPTION = 'description'; ...
80be38f78ce4fcffb02438ba0144bfb8a8a010ae751a9fb344e51843dc9704a7
MATLAB
3,573
88
function mltp_plot_behaviour_averaged_placemaps_contexts(obj, session) sr = session.sessionRecord; ti = sr.getTrialsToProcess(); digTypes = ['C', 'G', 'F', 'W']; % don't match '?' numDigTypes = length(digTypes); numCells = session.num_tfiles; %numTrials = sr.getNumTrialsToProcess(); digs = ...
14c658839068c8a3c9e92dcc6f6acdd8e51a07bfea1fd3d597c139b99e9b0754
MATLAB
3,578
87
% mglListener.m % % $Id$ % usage: mglListener(command,<arg1>) % by: justin gardner % date: 06/19/08 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: This is a mac specific command that is used to capture low-level % keyboard and mouse events....
1979831cd197279366ce09387b9903031eb01ecdcb7934006672642498d4a47a
MATLAB
3,578
92
% This demo shows how to use the software described in our IJCV paper: % Selective Search for Object Recognition, % J.R.R. Uijlings, K.E.A. van de Sande, T. Gevers, A.W.M. Smeulders, IJCV 2013 %% fprintf('Demo of how to run the code for:\n'); fprintf(' J. Uijlings, K. van de Sande, T. Gevers, A. Smeulders...
388d3f411730795e1db8883f344b9b473d79300c72a27af5e1a63876f652423a
MATLAB
3,579
79
clear file=dir('ACC*restable*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome); n1=fix(n*0.33);n2=fix(n*0.67); go{1}=[find(outcome(1:n1,1)==1);find(outcome(1:n1,1)==2)]; go{2}=[find(outcome(n1+1:n2,1)==1);find(outcome(n1+1:n2,1)==2)]+n1; go{3}=[find(outcome(n2+1:e...
13a31be17d2e2a58b681c925eef7cfe7e073f416c129215345e4153122d2aba3
MATLAB
3,583
74
function E = bemf5_volume_field_electric(Points, c, P, t, Center, Area, normals, R, planeABCD) % Computes electric field for an array Points anywhere in space (line, % surface, volume). This field is due to surface charges at triangular % facets only. Includes accurate neighbor triangle integrals for % points l...
4689b771dd61cfeba1df2a25333367debc467f03d77d3b00664be19773deb20b
MATLAB
3,583
136
function [F,G] = edfcnd(z,c,G,varargin) %EDFCND Empirical Distribution Function CoNDitioned that X>=c % and optionally computes it for distribution G. % % CALL: [Fc,Gc] = edfcnd(X,c,G,options); % % Fc = conditional EDF of X given X>=c, (2 column matrix or wdata). % Gc = conditional CDF, G(x;X>...
b96d4662bd4d5789d0d9c99aa0c299ee998a0c3ea183958e9754f25ea6ccdfb2
MATLAB
3,584
141
% mglTestTexMulti.m % % $Id: mglTestTexMulti.m 380 2008-12-31 04:39:55Z justin $ % usage: mglTestTexMulti(screenNum) % by: justin gardner % date: 04/11/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: % function retval = mglTestTexMulti(screenNumber)...
7561f5dd0d4c19012f13848399be2c31a2e2c4a77cc184c9dbcdee58944864a4
MATLAB
3,585
141
% mglTestTexMulti.m % % $Id: mglTestTexMulti.m 380 2008-12-31 04:39:55Z justin $ % usage: mglTestTexMulti(screenNum) % by: justin gardner % date: 04/11/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: % function retval = mglTestTexMulti(screenNumber)...
03c1787034652a1f49cb41b847d12a0e851f5d60ce6ac15a6f6ece2bea35be9e
MATLAB
3,588
128
%function [sta, P2P, p, Nspikes] = STA(x,y, bef_s, aft_s); function tune = STA(y,x,elec,unit); % returns STA[odd/even,:], array 2x:, % input: x holds spike frames, y holds the signal % bef_s and aft_s units are s % globals; MIN_LAT = 0; %ms ignore such latencuesin tune.lat x = find(x); % convert from frame-...
81dac4d0f266981e9d02af6808a653ce475efbfcf620ce55b48baf1acefb0e84
MATLAB
3,588
83
function params = getSpatialParams(params,optionNumber) %% Get getSpatialParams % Grabs default temporal params for each model (params.analysis.temporalModel) % The function first checks if there is a Constant file (user-defined temporal parameter values). % if the function does not exist, default temporal parameter...
e38f6e5e6a578263b61501118c7cc367225527b24b1472adc7fe5f91dc93ca3b
MATLAB
3,588
92
function [psdPeaks, intpsd, gammaP, betaP, meanLevel, envLevel, osci] = recordOnlyAttn(r, allTime) % RECORD give property of the parameter setting % psdPeaksSheet = zeros(Delta_e_steps, Delta_i_steps, 16, 6); % XX peaks in psd, e.g. -1-NaN, 5 peaks, 12 peaks % intpsdSheet = zeros(Delta_e_steps, Delta_i_steps, 16, 6); ...
f74d6cdb201a0738b6e22188626301395e0d92465f7983bbbe7f10726e2e08b9
MATLAB
3,592
83
function params = getSpatialParams(params,optionNumber) %% Get getSpatialParams % % Grabs default temporal params for each model (params.analysis.temporalModel) % % The function first checks if there is a Constant file (user-defined temporal parameter values). % if the function does not exist, default temporal paramet...
89eab821f91b6c636d0fb1c8c447f2a2bee02d73a225be5c44a15e107da5bbf7
MATLAB
3,598
99
function fit_voxels(path_of_script,simulated_SNRs,voxel_folder) load([path_of_script filesep 'Datasets' filesep 'bvalues_and_bvectors' filesep 'bvec_simulation_AxDKI_RBC.mat']); load([path_of_script filesep 'Datasets' filesep 'bvalues_and_bvectors' filesep 'bval_simulation_AxDKI_RBC.mat']); bvalues = bva...
9180f87082c812d315eec89955e9524dcb17693f8c56da230e8947358ba3c3d7
MATLAB
3,600
91
function [] = ExtDataFig08_BidirRespMod_Normalized_vPR9() % Code for plotting the mean change in ΔF/F after song-type transitions relative to ΔF/F before the transitions in Extended Data Fig. 8i,l. load(['../Data/Summary_vPR9NP_SS1/SongTypePrefIndex']) ylimrange1 = [-.5 1]; ylimrange2 = [-.5 1]; %% parameters Thre_Tr...
989c6fa878228309772876a90ae6c8330490c9d3d7cbc36b4487d44409e9823c
MATLAB
3,600
113
function[ synMat, synStruct ] = strippit( fName ); % -------------------------------------------------------------- % file : strippit.m % purpose : Example of stripping and reading a dendrite file % -------------------------------------------------------------- % history : % 2017-02-21 AL added data structure...
b13ec680f54ae6fd25618074c56c5213392633444fbf1972a9a87509557c085b
MATLAB
3,600
140
function H = vl_tightsubplot(varargin) % VL_TIGHTSUBPLOT Tiles axes without wasting space % H = VL_TIGHTSUBPLOT(K,P) returns an handle to the P-th axis in a % regular grid of K axes. The K axes are numbered from left to right % and from top to bottom. The function operates similarly to % SUBPLOT(), but by def...
5eb33cb99b1ff982a32681c5aefe2047771509b514dec986fa0cb017b711b8f1
MATLAB
3,601
107
function genSharedRewardDesign(s) % so clunky: set up relative paths to ensure this works on any computer. % warning: all paths are references based on the location of this file. if % you move the file, you break the paths. for ii = 1:length(s) sub = s(ii); scriptname = pwd disp(scriptname) [scri...
61fd1925eb4a0ab9d7bfbe6169ee24d74c6e75ce9807130a4608e422f9b3cb8f
MATLAB
3,601
95
% mglRunRenderingTests: run multiple rendering tests and check results. % % usage: results = mglRunRenderingTests(testNames) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Run all the mgl test scripts in the mglRenderi...
c387331a3624350eddb8e4a83bab7c6c93cacc3f7cfaddfd8ef6356d0756d6e4
MATLAB
3,601
128
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function make_stability_bfo90_PerAnimal_formatted_for_sigmastats(analysisSettings, analysisResults) % Not used %MIN_COMPARISONS = analysisSettings.BFO90_PER_CELL_MINIMUM_DATA; F = 'StabilityBFO90'; T = analysisResults.(F); [Sessio...
7361889851ae0de30138dabd9ce4a04474336d101944d0d1d193d40a355c2adc
MATLAB
3,605
139
function writemda(X,fname,dtype) %WRITEMDA - write to a .mda file. MDA stands for %multi-dimensional array. % % See http://magland.github.io//articles/mda-format/ % % Syntax: writemda(X,fname) % % Inputs: % X - the multi-dimensional array % fname - path to the output .mda file % dtype - 'complex32', 'int32', '...
3657fc31e98f8d0f4ea1539f1fbbba0f586402f60b9ea8ba8366193fd94f8830
MATLAB
3,609
89
function fH = plotLMMfittedRegressionSlopes_stRetParams(allDS,allLMMResults,... allLMMResults_model,LMMOrder,... roisToPlot,cmapModels, saveFigs, saveFigDir) % Suppl Fig 8: Model performance of alternative spatiotemporal pRF models, % including CST with fixed temporal parameters (CST_fix...
1547681975545aa636fbd3ade0f31cf05792f16b975ce278389b9ce9ae462dbc
MATLAB
3,612
109
% VL_DEMO_SIFT_CMD Demo: SIFT: test command line utility pfx = fullfile(vl_root,'results') ; vl_xmkdir(pfx) ; p_img = fullfile(vl_root,'data','box.pgm') ; p_low = fullfile(vl_root,'data','box.sift') ; p_txt = fullfile(pfx,'box.sift') ; p_tmp = fullfile(pfx,'box.tmp') ; I = imread(p_img) ; I = single(I) ; [f0,d0] = ...
379260002bad59ce8e70c45fe2d61bace68398340562e5052e32a84f77445fc6
MATLAB
3,612
103
% multiStepVInj.m % % Voltage Injection Function for visual panels. % Delivers square voltage step of user-specified amplitudes and duration. % Durations can be different among steps. Steps can be randomized or they % can repeat in the user-specified order until the end of the trial % Voltage values are not scaled, ...
c2cd40078f3d4b3f836039357f2bd699bcdf76dcb20971eebc3fec4975f188be
MATLAB
3,612
85
function parameters = load_parameters(folder_name) %loads the parameter structure based on the tags and labview parameters in %the experimental folder and parameters.csv settings file starting_column_index = 4; type_index = 3; parameters = load('EigenVectors.mat'); %load eigenvectors for eigenworms para...
839ec47bd71ecf8465563d2196bc2cf0908ac5bec706277c9020cf7a1461f350
MATLAB
3,613
119
function vol = read_asa_vol(fn); % READ_ASA_VOL reads an ASA volume conductor file % % all data is converted to the following units % vertices mm % conductivities S/m % Copyright (C) 2002, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the document...
02d0c1058db8de16c883e1901a377c3eba598e03964699754e7722d44712fa8c
MATLAB
3,619
54
function [x,y] = visualAngleArea(eye_pos, centre, angle, number) % VISUALANGLEAREA Return a ellips which displays the area with a valid % visual angle. % The function takes an eye position, a focus of the ellips, a maximum % angle and the number of coordinates that need to be returned as % input. It will re...
6daaeb46b8b4e19e67ab6dc5739b47b089369734cb327617ef923a6c5028bed1
MATLAB
3,619
191
% % Draw the Delaunay plot for one network. % % PARAMETERS % $network Internal name of the network % % INPUT FILES % dat/data.$network.mat % dat/info.$network % % OUTPUT FILES % plot/delaunay.[abcdfgh].$network.eps % consts = konect_consts(); network = getenv('network') info = read_info(network) n = info.n % ...
7645310558cdd58e6c0ebd0763094e0001010efc5dd60ac7c99fd280d140995c
MATLAB
3,623
121
function [x1,x2,x3,x4,p,deltak,touch_idx,FR,whisker]=Tcurve_touches_dk_per_touch(touches,touches_whisker,psth,k_c1,k_c2,NpointsTcurve) %% Tcurve_touches_dk_per_touch computes 4 tuning curves: one for only first, only second and only third touches of the sequences and one for touches >4 % INPUTS % % touches: binary mat...
bb451e40f1a49071c58ecd527c535fa83a641db8536b87d1762afae2241a8c56
MATLAB
3,623
128
function hh = gridxy(x,varargin) % GRIDXY - Plot grid lines % GRIDXY(X) plots vertical grid lines at the positions specified % by X. GRIDXY(X,Y) also plots horizontal grid lines at the positions % specified by Y. GRIDXY uses the current axes, if any. Lines outside % the plot area are plotted but not shown....
02a0129176cd47cdf27023c41216aa1e9244cf59ee1e3c0a8f61d60dd6c46d22
MATLAB
3,624
72
function [expJson] = mlgp_read_experiment_description_json(expJsonFilename) expJson = ml_util_json_read(expJsonFilename); % Validate % Check of the field exists fieldNames = fields(expJson); if ~ismember(fieldNames, 'apparatus_type') error('The field ''apparatus_type'' does not exi...
84a7cc3ba012e2181e9e3d6e63dcb2a8334b2125e43cf700427529401feec42a
MATLAB
3,627
117
function plot(obj, startIdx, endIdx) %PLOT plots the edf content to verify if they are useful. For all other % post processing you should rather define your own plots % % Syntax: obj.plot(); % or % plot(obj); %clear % See also: Edf2Mat.plot(), Edf2Mat.save() % Edf2Mat.Events, Edf2M...
c49f8f0133c567e34eedeeb834f11c02e6213f5da1876e520186475b3f864e09
MATLAB
3,627
109
function write_serial_event(filename, event) % WRITE_SERIAL_EVENT % % changed A.Hadjipapas 2010 % % write to phyiscal serial port % serial port on windows or linux platform % Copyright (C) 2007, Christian Hesse % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation and...
896a7341cbae968b720b68428ec2a07b330ad5999b9e250785fe05284e9bbe99
MATLAB
3,628
76
clear; tbl_dir = pwd; tbl_name = fullfile(tbl_dir,'S3_Data.xlsx'); [~, sheetNames] = xlsfinfo(tbl_name); groupStr = {'Young','Old'}; condStr = {'Load 1','Load 2','Load 4','Load 4'}; % # The third position is included for cases where I use ss = 1:3 rather than ss = [1 2 4] %% Fig.S3 T = readtable(tbl_name,'Sheet',shee...
5630c97279b18d60ea6f5d44f14a7dfda4fe6d0fdaa2ecf6e56a3d5375f80a53
MATLAB
3,629
81
% data_name = 'lowBG=5e+03,poisson=1'; % dir_SUNS_sub = fullfile('SUNS_TUnCaT_SF25','4816[1]th4'); addpath(genpath('.')) %% num_Exp = 10; list_Exp_ID = arrayfun(@(x) ['sim_',num2str(x)],0:(num_Exp-1), 'UniformOutput',false); dir_parent = fullfile('..','data','data_simulation',data_name); d0 = 0.8; lam = 8; dir_GT_in...
5ae259f235ad6e83208aba7462678e66521e74f1543b1057c7e2d7c505baf510
MATLAB
3,629
139
function VOR_Summary_Sriram_Gen(measure, excel_file, norm ) %{ Required measure: Data to make into summary graph. Found in the excel file optional excel_file: location of the excel file. Default is current folder. norm: '1' normalize data. '0' use raw values. Default is raw values. %} %% Prep Variables if ...
5fd607db6362311a36b4281a7a7361311b36e109330b28d91079fa01278d334f
MATLAB
3,629
100
function plot_fig_subcortex(file_path, output_plot_path, color_map, min_scale, max_scale, structure_label) % Visualizing subcortex % Author: Xinyu Wu and Guoyuan Yang, BIT. % % Inputs: % - file_path % Path of files to be plot, must be nifti format files with MNI152 2mm standard voxel space(109*91*91). % % ...
5d9eebfdb7e00dc881825090194427f74a1598f8b9f4517349999cc8426a28e3
MATLAB
3,632
95
function results = vl_test_kmeans(varargin) % VL_TEST_KMEANS % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see the COPYING file). vl_test_init ; function s = setup() randn('sta...
e616604300947f24e4ebf49cb4dd7da69aace6b8d7b8a9adf292691d616cf0f0
MATLAB
3,634
94
function varargout = add(tree,uid,type,parameter) % XMLTREE/ADD Method (add childs to elements of an XML Tree) % FORMAT vararout = add(tree,uid,type,parameter) % % tree - XMLTree object % uid - array of uid's % type - 'element', 'chardata', 'cdata', 'pi' or 'comment' % parameter - property name (a char...
1e2d031aa4566111ad6fa95586345bc10bda853838b3e267a5e634e755c280a1
MATLAB
3,635
123
function [] = ExtDataFig01_TuningCurve_OptStim_Song % Code for plotting the tuning curves of pulse and sine songs induced by optogenetics in Extended Data Fig. 1g,i. GT = 'dPR1_Chr'; % Extended Data Fig. 1g % GT = 'TN1_Chr'; % Extended Data Fig. 1i switch GT case 'dPR1_Chr' Target = [7,8]; case 'TN1_C...
3a8cdae1c49702dcca73e98fbd730204e2bcdbf91af49e8bf18f9696beb4de44
MATLAB
3,635
160
function Resp=aedes_inputdlg(prompt_str,title_str,default_answer) % AEDES_INPUTDLG - Input dialog box % % % Synopsis: % Resp=aedes_inputdlg(prompt_str,title_str,default_answer) % % Description: % % % Examples: % % See also: % AEDES % This function is a part of Aedes - A graphical tool for analyzing ...
57f95b13759146969030021c1bd8bec6b6287e9312f38979223b57bd684d7296
MATLAB
3,637
103
% FREQEST - Estimate fingerprint ridge frequency within image block % % Function to estimate the fingerprint ridge frequency within a small block % of a fingerprint image. This function is used by RIDGEFREQ % % Usage: % freqim = freqest(im, orientim, windsze, minWaveLength, maxWaveLength) % % Arguments: % im...
47a139c8d5b5e42f04acaf71cb3105972a3a5d872a008b6d00a432186817b9b0
MATLAB
3,641
97
classdef MLVideoRecordReader < handle properties videoFolder mlvidrec % Video record to be displayed videoType % Color or BW numVideos videoNumLoaded videoFrames numFrames end methods function obj = MLVideoRecordReader( videoFolder, v...
532e9b209d818781bac2e257422f11dbeb5ed35853fa3744e07fd97007325b99
MATLAB
3,641
112
% mglGetKeyEvent.m % % $Id$ % usage: keyEvent = mglGetKeyEvent(<waitTime>,<getAllEvents>) % alt usage: [keyCode when charCode] = mglGetKeyEvent(<waitTime>,<getAllEvents>) % by: justin gardner % date: 09/12/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purp...
6fe8ef042e1c59bb0951e606a938f9217bd4be7c172bb6ccc31ff12b8f7b089e
MATLAB
3,642
135
function s=drawHierarchy(Sc,Tree,varargin) % drawHierarchy Draw dendrogram for a hierarchical Tree % % Syntax %__________________________________________________________________________ % % drawHierarchy(Sc,Tree) % % drawHierarchy(Sc,Tree,Name,Value) % % % Description %______________________________________________...
a74ff12a606456be6859c57d4b795db80ee374ff91961e989e2aa1a65c76be68
MATLAB
3,643
77
function [Mdl, C, Accuracy, Sens, Spec, FI, labs]=get_RF(dataTr,groupTr,dataTe,groupTe,lab,NumTrees,PredSample,Method,kf,path,Seed) %% hyperpar trees=NumTrees; pred=PredSample; %% prep table for RF T_resp = table(groupTr, 'VariableNames',{'group'}) ; T = table(groupTr, 'VariableNames',{'group'...
f516e15959d14fe54c2da60bcef91bdf33bdf6d4d25aabe096228e8979c47fcb
MATLAB
3,644
149
clearvars %% choose horizon disp('What horizon would you like to simulate?') disp('Possible values 0,1, or 2 ') prompt='nH='; nH=input(prompt); while ~ismember(nH,0:2) disp('You must insert either 0, 1, or 2') nH = input(prompt); end %% select alpha parameter disp('Select the alpha parameter (within range [-0....
2719e37efef0fea0a5fb74ec8e7be64a3544206939e8883213785d4d8dc337aa
MATLAB
3,647
101
% mglPlotCommandResults: plot a sequence of command/frame time records. % % usage: mglPlotCommandResults(flushResults) % by: Benjamin Heasly % date: 01/19/2024 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Visualize a sequence of detailed command and frame t...
2cf7530dc13de55d53553aaa890bedec7ec40cc4150bcd24c83e02751768a617
MATLAB
3,650
110
function [S,D, roots, rootTimes] = calculateAvalanches(raster, network, adjmat, t0) %calculates avalanches according to a provided network %the algorithm is similar to hoshen-koppelman. For a active unit i at time t %there are three possible outcomes %1 - no neighbour of i is active at time t-1 so i is the start ...
70f8fabb673184947dc3ed7049670b1d6e46630b4e040681fa87e9c630968eda
MATLAB
3,652
91
function make_avi(Fmov, video_name, varargin) % make_avi(video_name, Fmov, contrast_val) % % Function to write the movie Fmov to an avi movie file. The inputs to this % function are: % - Fmov - 3D array of data to save (mov(:,:,kk) is the kk^th % frame of the movie) % - video_name - St...
a6d7e4de23fd99b985d97e1e586bd885ff17b1c181e4fbacaea6087764e5d8ed
MATLAB
3,652
105
function [GREPhase, GREMag] = mcpc3Ds(GREMag, GREPhase, Params) % [GREPhase, GREMag] = mcpc3Ds(GREMag, GREPhase, Params) % multiple coil phase combination with MCPC-3D-S and ASPIRE %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Multiple channel phase combination - using MCPC-3D-S...
57fad9d919734afe9eef487e01f010823128d75c90d7ea0a521bc247e3f068b8
MATLAB
3,653
129
function [predictedLabels, score, accuracy, SV] = SVMmodel(observations, classes) % The fitcecoc function in MATLAB is specifically designed for training % support vector machines (SVMs) for multiclass classification using the % error-correcting output codes (ECOC) framework. % INPUTS % observations: cell array, ea...
af841d1f508e895e5d0239ee4b81d5c21c878d94944c8468346ba98b0f863148
MATLAB
3,655
109
function [startstop]=find_startstop_v2(data, events, run, ID, varargin) % FIND_STARTSTOP_V2 % This function detects the timepoints when a participant starts and stops % when walking. This was defined as an increase/decrease in horizontal % pelvis velocity over a threshold of 0.1 m/s after a start/stop signal was give...
f39e8db57150aea333aef097dfe36df5ea4289e40747dfe32dfeb755be977643
MATLAB
3,655
101
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = stabilitybfo90table_percell_plot_withinacross_prob_v1(StableMeanTable, StableErrorTable, UnstableMeanTable, UnstableErrorTable, showExcluded) hasStable = true; hasUnstable = true; numGroups1 = s...
d89e82b79b7981a1151cd5da105e2649cc1e65b4585f432ff2f42be800c7796e
MATLAB
3,660
92
function [t_s, pos_x_cm, pos_y_cm] = ml_sim_random_walk_rectangle(boundsx_cm, boundsy_cm, totalTime_s, samplingRate_hz) % This code simulates a random walk confined to a rectangular area. % The path simulation code performs a random walk with intermitent attraction to one % of the 4 cups so that the paths a...
76e20ec7e532a31a5dcdc7b3973862a6f484cb1f43a62a132861d733e0948d23
MATLAB
3,661
106
function R=randmio_und_signed(R, ITER) %RANDMIO_UND_SIGNED Random graph with preserved degree distribution % % R = randmio_und_signed(A,ITER); % % This function randomizes an undirected weighted network with positive % and negative weights, while simultaneously preserving the degree % distribution of posit...
9fa86e5b715c08fbc392663c74ccab91dd3a4d761fda55c749b75045fdb3ac77
MATLAB
3,662
112
function gui_lc (action) % % This file is used by FASTICAG % This file holds the callbacks for load-dialog % @(#)$Id: gui_lc.m 8776 2013-11-14 09:04:48Z roboos $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Global variables % Handle to the window global hf_FastICA_Load; % Hand...
5d7c1c53c3fa0fbfc92b526ffebe6062b923dd2f941c62b810a75dd28b015ab3
MATLAB
3,667
149
function ROI = aedes_copy_roi(ROI,roi_label,dir_ind,slice_ind,vol_ind,data_ind,copytype) % AEDES_COPY_ROI - Copy ROI in X, Y, or Z direction % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Ju...
937c2a5ebee5b5f49a0b96be56ed6ac6de5651fdc54fd8840a6ea5fd0114a63f
MATLAB
3,667
130
% Function File: [yf, t] = medianf (y, x, r) % % Calculates the median over a sliding window of y-values of 2r+1 % number of points, where r is the filter rank. This filter is % particularly useful to subtract background [1,2]. For this % application where the filter rank used is typically larg...
e8bd9a4febb5d535610d7c18908313a1abbc38ecad9026f126b81d917ed893db
MATLAB
3,667
85
addpath(genpath('.')) %% % name of the videos list_Exp_ID = { 'c25_59_228','c27_12_326','c28_83_210',... 'c25_163_267','c27_114_176','c28_161_149',... 'c25_123_348','c27_122_121','c28_163_244'}; num_Exp = length(list_Exp_ID); avg_radius = 4; % added_refined_masks lam = 15; r_bg_ratio = ...
945bfddce9eada30ca683d63bfeb153e1c210f074c13649e3c3ab1bd80e04612
MATLAB
3,668
122
function [] = ExtDataFig03_AveTimeCourse_OptStim_Neuron() % Code for plotting the time course of ΔF/F recorded from dPR1 and TN1A neurite in Extended Data Fig. 3a,h.Code for plotting the time course of ΔF/F recorded from dPR1 and TN1A neurite in Extended Data Fig. 3a,h.Code for plotting the time course of ΔF/F recorded...
25bf1ac6e3acc4a943ba25cdbff7ee2076b048ef32b07d8bb28c4f650a73f269
MATLAB
3,671
140
% loadCFSfile.m % generic CFS loading file % 13.03.09: version 1, JGC % requires MATCFS32.DLL AND CFS32.DLL % CFS constants % 1.04.09: transpose z INT1=0; WRD1=1; INT2=2; WRD2=3; INT4=4; RL4=5; RL8=6; LSTR=7; EQUALSPACED=0; MATRIX=1; SUBSIDIARY=2; FILEVAR=0; DSVAR=1; READONLY=0; WRITE=1; ...
28c8147ea1d6820377ace5af2950eaa30812ea02659fe772bbb70478bd0a25b8
MATLAB
3,671
108
%{ 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...
aa8fcf0a5ff58065e0e19f74f67d51c2c3ab78eb63ccc634c7bf95944151e7ab
MATLAB
3,671
145
% plotExFreeWalkTraj.m % % Script to plot example free walking trajectories (in XY plane) and % corresponding forward and yaw velocities % % CREATED: 9/8/23 - HHY % % UPDATED: % 9/8/23 - HHY figure; plot(bodytraj.tZeroed, bodytraj.angVelSmoS); figure; plot(bodytraj.tZeroed, bodytraj.fwdVelSmoS); % these are the ...
4942a58ad656194d6ef483ea1a6682a73654a7fcf14a686d0f47ad9f3db9fc20
MATLAB
3,673
97
%function stsum(x,y,STS,elec,unit,cc); function STS = stsum(x,y,STS); % updates the STS global struct: .sts[odd/even/shuf,:], array 2x:; .Ns [2,1] % computes STS for shuffled spike times, for odd only - .stsShuf % input: x holds spike frames, y holds the signal % bef_s and aft_s units are s % %sta, the STA funct...
6e0d7d22afd3238202192e305875e40b29440b864517f6cc61f5f797c3893df7
MATLAB
3,678
133
function [] = ExtDataFig04_AveTimeCourse_OptStim_Neuron() % Code for plotting the time course of ΔF/F recorded from dPR1 and TN1A in Extended Data Fig. 4e,h. GT = 'dPR1'; % Extended Data Fig. 4e % GT = 'TN1SG'; % Extended Data Fig. 4h %% parameters nTrials = 3; nStim = 6; T = 1370; % T FlightTrialThre = 3; PreEvent...
2a8d3c8ce66c1c9c01cfc30c326cef3ecdff17e6532f558b19a0083ae9db6728
MATLAB
3,684
92
classdef MLBehaviourReaderH5 < mlbehaviour.MLBehaviourInterface %MLBehaviour Implementation of the interface. Reads from h5 files. % An implementation of the interface that can read from h5 files. properties (SetAccess = protected, GetAccess = protected) Filename ArrayLength P...
8275008a68a1654a5a19c26e63ebf4ef519c6e07b71bd95135d69d5f8a08b2cf
MATLAB
3,684
108
% img2P.m % % Experimental Function % For acquisition of 2P imaging data % % INPUTS: % settings - struct of settings from twoPhotonSettings() % flyData - fly metadata from getFlyMetadata() % exptDuration - duration of experiment, in seconds % % OUTPUTS: % exptReturn - returns 1 upon successful run (0 if not) % ...
a9fe206ffe5b70b660cf4093f8283b700a5eea67ff8e53e653a9a60ea91f6aa7
MATLAB
3,686
83
function this = subsasgn(this, subs, A) % Subscript assignment for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: subsasgn.m 8776 2013-11-14 09:04:48Z roboos $ switch subs(1).type case...
5dceb3669abfeffdc98abce9290e64b2f062ca00b711236392a38b42e796ce36
MATLAB
3,687
76
function [settings] = ml_miniscope_pipeline_concatenated_load(experimentDescriptionSepFilename) % The data is normally saved as separate trials. This points to the folder % containing the experiment_description.json for the separate trials. Point % this to the mouses parent directory that we will make a con...
21185e8a8d1e9eb08346bffe9b50dbce82d2a3e9e09b5ec655b32473ea8b799a
MATLAB
3,689
80
function plotSelectedFFTProfile ( obj, varargin ) % Plot selected FFT profile % % Syntax: % PLOTSELECTEDFFTPROFILE( obj, ax, event_date ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % * event_date (optional) % % Example: % PLOTSELECTEDFFTPROFILE( o...
5ffeb4509b1e7342a4b6b232b329037b86ed3a65e611f75810d9b524d5f65c99
MATLAB
3,689
107
function plotCoherence ( obj, varargin ) % Plot coherence for LFP online streaming mode % % Syntax: % PLOTCOHERENCE( obj, varargin ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % * data_type (optional) - type of input data (raw, ecg cleaned or filtere...
0f08fd568afd6db62802dc99b663c329b49c816303cc4bd1623fca4420ed50f7
MATLAB
3,691
118
% tickScreenGRU.m % % $Id: tickScreen.m 441 2009-01-30 04:50:34Z justin $ % usage: tickScreen % by: justin gardner % date: 12/10/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: flip screen and update counter - for mgl - modified for use at RIKEN with % ...
576b3a89ae57f297067377354cefcafb1bf2412815e3b88a0c8b26bf10a76d0d
MATLAB
3,691
105
function [PDF, Tsamp] = gretna_PDF(Data, Npoints, Type) %========================================================================== % This function is used to calculate the probability distribution function % of 1-D variable based on an optimized kernel density estimate. % % Syntax: function [PDF, Tsamp] = gretna_PDF(...
0a903e846620ed614b5cc4a8ea2244c70ed71236fd3b2673dceb8c8f613703d9
MATLAB
3,693
91
function [d2soz0, d2soz_lin, rm_edges_sorted, d2soz_rec, rec_set] = ... VR_opt_deterministic() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % If you use this code, then please cite: % 1.- Ana P. Millan, et al. "Individualized epidemic spreading models % predict epilepsy surgery outcomes: a pseud...
90e9c299d9870e1b20fd43bda653f42525b2ddfdf0394193753289f3f2e46cae
MATLAB
3,695
152
function varargout = eyecamTecknet(vid, eyetrack, duration) % Preview mode: eyecam(vid) % Eye track mode: eyeresults = eyecam(vid, 1, filepathname) if ~exist('eyetrack','var') eyetrack = 0; end if ~exist('duration','var') duration = 60; end himg1 = []; himg2 = []; time1 = []; time2 = []; start(vid(1)); sta...
c7d88f13f41c496e7c329b9da7d8eafd5d7fdb89c0d78285f449f9c0346364be
MATLAB
3,696
103
function [Iedge dists map gaps] = vl_quickvis(I, ratio, kernelsize, maxdist, maxcuts) % VL_QUICKVIS Create an edge image from a Quickshift segmentation. % IEDGE = VL_QUICKVIS(I, RATIO, KERNELSIZE, MAXDIST, MAXCUTS) creates an edge % stability image from a Quickshift segmentation. RATIO controls the tradeoff % bet...
67a5eb1bbb7d8e3ba7452603d860f5177b6c3b5a673fb7499ffd7ea00d4f5ea6
MATLAB
3,700
138
function [] = ExtDataFig03_AveTimeCourse_OptStim_SelfOpt_TTX_Neuron() % Code for plotting the time course of ΔF/F recorded from dPR1 and TN1A neurons in Extended Data Fig. 3n,o. GT = 'dPR1'; % Extended Data Fig. 3n % GT = 'TN1A'; % Extended Data Fig. 3o %% parameters nTrials = 2; nStim = 6; T = 1370; % T PreEventImg...
71a037fb38170e4036d416ca210c4227c4e6c7c24b1db24f4e953ed8e20a0c2a
MATLAB
3,701
120
%% fitlm between str connectivity, dis, commu and gene co-expression %% the dis and communicability are calculated by averaging individual auc %% para path = pwd; roi_num = 48; R_index = 8:2:48; rand_time = 10000; p_thr = 0.05; p_fdr = 0.05; results = struct; %% data % dis data load('dis_whole.mat','dis_matrix_bi'...
e1df010d9c1e1198585ef0e8b70dc73030dfa12e44362b79be9edfd6b382c522
MATLAB
3,702
133
%% Figure 1: Eigenvalue Frequency Script %% Setup: scale = 200; filename = sprintf('MICA_schaefer%d_SCFC_struct.mat',scale); % filename = sprintf('MICA_HCP_schaefer%d_SCFC_struct.mat',scale); load(filename); n_subjects = length(MICA); nroi = length(MICA(1).SC); SC_all = zeros(nroi,nroi, n_subjects); ...
ff397b6f4620df84a803f579fc248a9ba47ac9096bd1ae015982e56437608291
MATLAB
3,702
107
function spm_smooth(P,Q,s,dtype) % 3 dimensional convolution of an image % FORMAT spm_smooth(P,Q,S,dtype) % P - image to be smoothed % Q - filename for smoothed image % S - [sx sy sz] Gaussian filter width {FWHM} in mm % dtype - datatype [default: 0 == same datatype as P] %__________________________________...