sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f10257a62dbb9daf9fe789356baafaee5c40927de68b6de3e8f0561a3405e3ed
MATLAB
2,420
68
function design_mat = cvBMS_analysis_batch(stud_dir, subj_file, MS_file, LME_img, stat_suff) % _ % Create batch for manual cvBMS analysis using MACS toolbox % % stud_dir - study directory in data/analyses are located % subj_file - an XLS file containing subject IDs and covariates % MS_file - a MAT f...
03565433617a8ab2df76b4b38b5ae766864de9126ed4c7f69fcc06f3fd2b8b1a
MATLAB
2,421
55
function mff_setup % MFF_SETUP ensures that the JVM is available and that the MFF java % implementation is on the java classpath. % this toolbox requires JAVA to be running and properly configured if ~usejava('jvm') error('the EGI_MFF format requires that the java virtual machine is available, see http://fieldtrip....
d3eb990d4967b162f04d9896ebdd37cf39a3d08393977c071fbcdc1dece7f90a
MATLAB
2,423
87
% plotCorrCoeffBehContParam.m % % Function to plot output of getCorrCoeffBehContParam_cond_all() % Heatmap (using MATLAB function) of mean correlation coefficient across % flies, where each one is its own file (assumes multiple files all have % same matrix of correlation coefficients) % Select files through GUI % % I...
2523eb70a41fbdb5e368823214fdc959ada85312bb47663f2870354ed959144c
MATLAB
2,424
50
function [ns_RESULT, ContCount, Data] = ns_GetAnalogData(hFile, EntityID, StartIndex, IndexCount); %ns_GetAnalogData Retrieves analog data by index % % Usage: % [ns_RESULT, ContCount, Data] = % ns_GetAnalogData(hFile, EntityID, StartIndex, IndexCount) % % Description: % Returns the ...
cd6ee8cea6511ed2cfbcf2e46c49e33e5474eb8ed900e812944a802d15f04b9c
MATLAB
2,425
92
function [spkwaveform,ttspan,... HW, AHP, Threshold, Amp,max_slope,min_slope,... HWidx,AHPidx, Thresholdidx,max_slopeidx,min_slopeidx] = AP_Statistic_HERE(data,peaktime,tspan,Goodidx) %INPUT % data : a vector % tspan: a vector,have the same elememt with data % NumSpk: successive number of spike to be ...
c5f9f7e986ad986f91ca828dd30994f1ecf7a4cab0cfaae7bfaa7720da6ddc13
MATLAB
2,427
75
% plot sin wave at freq f (Hz) and duration TT (s) InterpMethod = 'pchip'; % 'nearest' Nearest neighbor interpolation % 'linear'Linear interpolation (default) % 'spline' Cubic spline interpolation % 'pchip' Piecewise cubic Hermite interpolation % 'v5cubic' Cubic interpolation used in MATLAB 5. This method does no...
29926a9d0fe577ecdc7ed3feef988d9b5cf6f63b10e58eab3860ea6673f006ca
MATLAB
2,428
69
function prepare_savedir(stg,prf) % prepares the directory in which new files, results and folders will be % saved. % % PREPARE_SAVEDIR(STG,PRF) gets the STG and PRF variables and prepares the % required folders in which the pipeline will save the results and new % files. % % Ehsan Kakaei, Jochen Braun 2021 ...
55e853d343d0e826270ea03e9658fb8ca815b9296641ea5d0683ad46079a2279
MATLAB
2,429
114
function [b,c,d,x,y,z,qfac] = vox2rasToQform(vox2ras) % [a,b,c,x,y,z,qfac] = vox2rasToQform(vox2ras) % % Converts a vox2ras matrix to NIFTI qform parameters. % Note: the vox2ras should be 6 DOF. This code mostly just % follows CH's mriToNiftiQform() in mriio.c. % % hdr.pixdim(1) = qfac; % hdr.quatern_b = b; % h...
128cdc60cad3857c35131d10081af2750fa6c8c33074d210e6035af023ab2f72
MATLAB
2,430
101
clear all close all %% create figure 3C %% janine.thome@zi-mannheim.de pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% set fig fs=16; lw=2; %% load feat load('D_ALS_HC_Fig3C.mat'); %% color def colHC=[0 0 0]; colALS=[ 252 141 89]/...
770420332b1ceeff886c7f524ffcfa57d6d5b11657733a294d7adeff81d2624c
MATLAB
2,430
57
%% Written by Eric Earl, 10/15/2014 function subject_motion_numbers_TXT_parse(movement_files) % Motion numbers parsing Nipype wrapper pulling in list of motion files % Outputs motion_numbers to "motion_numbers.mat" file % movement_files = {'motion_numbers0.txt', 'motion_numbers1.txt', 'motion_numbers2.txt'}; % movement...
5b83f32ef46eba73d2245d30b3335168df44ec62418288e5d28ef779ca2f1175
MATLAB
2,431
47
classdef FilteredEphys < types.core.NWBDataInterface & types.untyped.GroupClass % FILTEREDEPHYS Electrophysiology data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each...
9e63b11c24aabeae870212a74b89602dfbdd797ca0792b64ff00b5a642f7f594
MATLAB
2,431
75
function VO = spm_smoothto8bit(V,fwhm) % 3 dimensional convolution of an image to 8bit data in memory % FORMAT VO = spm_smoothto8bit(V,fwhm) % V - mapped image to be smoothed % fwhm - FWHM of Guassian filter width in mm % VO - smoothed volume in a form that can be used by the % spm_*_vol.mex* functions....
9e6b864c5f35947118904eb16226fe7214bb80a884843f74b7c1bf26df8141af
MATLAB
2,431
54
function [BTA, behaviorCounts, BTA_std, BTA_stats] = BehaviorTriggeredAverage(Behaviors, LEDPowers, parameters, bootstrap) %finds the behavior triggered average, optionally determine the %significance of the BTA by shuffling transitions randomly and finding %the BTA BTA_seconds_before_and_after = 10; ...
a39a850678f04ef24a9aded4706846a4b6b6babe60aafb4c9515053a0fedf3b1
MATLAB
2,432
66
function varName = TDMS_genvarname2(string,replaceStr,prependStr,alwaysPrepend) %GENVARNAME2: Outputs a valid variable name VARNAME % % GENVARNAME2(STRING,*REPLACESTR,*PREPENDSTR,*ALWAYSPREPEND) replaces invalid % characters in STRING with REPLACESTR. If the first letter is not % a letter, or ALWAYSPREPEN...
ad1a3a3664bae4964854849fb551a0ea6cdfaeb25b450e5f25d9deca078a386a
MATLAB
2,434
93
function [ax] = gridPlot(xmat,ymat,dmat,dtype,suff,figopt) %gridPlot.m 9/13/22 doYlbl = optCheck(figopt,'doYlbl',[],[]); doXlbl = optCheck(figopt,'doXlbl',[],[]); doYRlbl = optCheck(figopt,'doYRlbl',[],[]); yrmat = optCheck(figopt,'yrmat',[],[]); hlightCoords = optCheck(figopt,'hlightCoords',[],[]); prefixMap = optChe...
3550fd23b4e1d56060ac9c91518dbc89ba5771455e5d49843447abc5fe89cc24
MATLAB
2,435
79
%% fitlm between str connectivity, dis, commu and functional connectivity %% the dis and communicability are calculated by averaging individual auc %% para roi_num = 48; load('unrelated_sub_matrix_str_DBM.mat') str_data = mean(sub_matrix,3); load('unrelated_sub_matrix_fun.mat') fun_data = mean(sub_matrix,3); load('unr...
ba2f3129fcddf56de2a0d239c9a932dca2927de1cffb37ad77ec9385ae0cc2ad
MATLAB
2,435
79
%% fitlm between str connectivity, dis, commu and structural connectivity %% the dis and communicability are calculated by averaging individual auc %% para roi_num = 48; load('unrelated_sub_matrix_str_DBM.mat') str_data = mean(sub_matrix,3); load('unrelated_sub_matrix_fun.mat') fun_data = mean(sub_matrix,3); load('unr...
f0825256328175aaf25b15806bc0f4fa3e9f556f0dc65a0491c81069d5b84d7a
MATLAB
2,435
53
function fH = makeFigure8_SuppressionLevels_v_pRFParams(ds,lmmResults,subjnrs,roisToPlot,... cmapROIs,spatialModel,temporalModel,useSTRetParams,saveFigs, saveFigDir) % Function to reproduce main manuscript figure 8: % panel a: Suppression level (LMM slopes) vs effective pRF size for each ROI %...
69aa1cd464cd5ae0b3508b2988d62b03d67d8b1fd25bb3fda926128fa39d2606
MATLAB
2,436
68
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [output] = ml_alg_best_aligned_average_context_maps_for_cell_v2(maps, trialIds, contextIds, comparisonMethod, REFLECT_ONE_CONTEXT) %% % sdataMaps should be a MxNxK matrix where K is the number of cells % sdataCellIds should...
c2ccaae58965d13a2a5712353e4a2037ea822b99b32c57ac80ff0198fb7e41fc
MATLAB
2,436
75
cd('M:\Matt Chilvers\Documents\PhD\Project3_WhiteMatterLesion\Scripts\PCA_Regression') SetUpDataForPCA %% Run partial least squares regression on 10 components % X = stnd_predictor_variables; % y = stnd_response_variable; % [n,p] = size(X); % % [Xloadings,Yloadings,Xscores,Yscores,betaPLS10,PLSPctVar,MSE,PL...
3eb5e476dd8e861fe53b9619175e2a68999d8c2276243d6a635a21593984a239
MATLAB
2,438
82
function [outs] = agplotripraster(rwtrials,postrwtrials,varargin) fulllength = 1; colortrig = 0; sortorder = 'off'; % 'rw' or 'postrw' cols = [.8 .8 .8; 1 1 1; 0 0 0; 1 0 0]; if (~isempty(varargin)) assign(varargin{:}); end hold on; maxtime = 80; % in sec, must be even center = maxtime/2; timebin = .01; % 10ms ...
22276493932cef7b7f7c00a68941beaa7898509691b2220b44c1280775e137b7
MATLAB
2,439
75
cd('M:\Matt Chilvers\Documents\PhD\Project3_WhiteMatterLesion\Scripts\PCA_Regression') SetUpDataForPCA %% Run partial least squares regression on 10 components % X = stnd_predictor_variables; % y = stnd_response_variable; % [n,p] = size(X); % % [Xloadings,Yloadings,Xscores,Yscores,betaPLS10,PLSPctVar,MSE,PL...
3a7b47e1ef4c25e046fea864516ea002dc15b769730b676d383ab2f5e3df4f4f
MATLAB
2,440
75
function [cfgs] = exhaustSpacing(probe, spacingAmount) %EXHAUSTIVESPACING Varies spacing between modules, exhaustively % Varies the spacing between modules by the amount specified in the row % vector spacingAmount. Each new configuration is then analyzed. This % results in a cfgs structure with the number of chan...
b6f78c4f33a5a37f2d0039c8bb86ce268da5462b9858b2e9454d7946dfecdfa3
MATLAB
2,440
91
function akc_out = outlierdetection(dt,mask) if ~exist('mask','var') || isempty(mask) mask = ~isnan(dt(:,:,:,1)); end dt = vec(dt, mask); load('dirs10000.mat','dir'); nvxls = size(dt, 2); akc_out = zeros([1 nvxls]); N = 10000; nblocks = 10; for i=1:nblock...
d0b06b60e4fd78a178831f894955cf56c3894a4af452cd0dc44be3b1a22aaf85
MATLAB
2,440
71
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig] = stabilitybfo90table_plot_withinacross_prob(MeanTable, ErrorTable, showExcluded) numGroups = size(MeanTable,1); hFig = figure('position', get(0, 'screensize')); % Each group gets a column with ...
3665cb00ae2224b28767170d5a50a77aabca7f56117447501907b522a15d048a
MATLAB
2,442
96
% % Perform the preferential attachment tests. % % PARAMETERS % $network The network % % INPUT FILES % dat/split.$network.mat % dat/info.$network % % OUTPUT FILES % dat/pa.$network.mat % Parameters of the fits % .pa % .a, .u, .v (existence depending on the format) % .$method (see konect_pa_full_full.m in KONEC...
c924683cbb03d628d4bdd7520b21f6819d45f8d3aa09b3adba1c03b924fd863c
MATLAB
2,442
125
% % Test Helmholtz particle FMMs in R^3 % zk = complex(1.1); N = maxNumCompThreads nsource = 2000; source = zeros(3,nsource); idist=1; if( idist == 1 ), theta=rand(1,nsource)*pi; phi=rand(1,nsource)*2*pi; source(1,:)=.5*cos(phi).*sin(theta); source(2,:)=.5*sin(phi).*sin(theta); source(3,:)=.5*cos(theta); end if...
f46a464b4e638ba79c8fa8a97957da574dcdf656d80713d018cf1575089b759d
MATLAB
2,442
94
% this function outputs two alternate time bases (x) to use with FP y data % original time base is timeFP_RS, derived from FP x data, nominally 100Hz % or whatever the FP data was resampled to % video time = camtime % timeFP_RSretime warps timeFP_RS to match the variable frame rate expressed in c...
60813053867d05d07bf8a6db47dcb7adc189b6669aaa9e8491742b15d9cdea3b
MATLAB
2,444
67
classdef fuzzy_rect_AOI < rectangle_AOI methods function self = fuzzy_rect_AOI(all_aois, trail, allowed_angle) %UNTITLED2 Construct an instance of this class % Detailed explanation goes here argin{1} = all_aois; argin{2} = trail; argin{3} = all...
a8447005ab2d82dbd6e1608e90a10bd34a8f4c76850a53328c23979595edc065
MATLAB
2,444
75
function FM = ft_preproc_online_filter_init(B, A, x) % function FM = ft_preproc_online_filter_init(B, A, x) % % Initialize an IIR filter model with coefficients B and A, as used in filter and butter etc. % One sample x of the signal must be given as a column vector. % % This function will calculate the filter delay st...
0130585e28b262398995657fa635b1a04e809102c9641cf6f8430a98c468bf99
MATLAB
2,447
45
function mltp_plot_bfo_90_dc(obj) numAngles = 4; best_fit_orientations_different_contexts = zeros(obj.Experiment.getNumSessions(), numAngles); plotlegend = cell(obj.Experiment.getNumSessions(), 1); for iSession = 1:obj.Experiment.getNumSessions() session = obj.Experiment.getSession(iSession); ...
060636778878cd9ed08cab3f97d9c5f3dbd7ab6c3acc4621700aec7875118a11
MATLAB
2,449
91
%{ Use the group clustering and the centroids for each k to produce the cluster validity indices to produce the elbow plot, where lower values are better. Adapts code from: https://github.com/trendscenter/gift Output: metric_group.h5 Contains the CVI values for each k for the group. %} %Define command line arguments....
382e2fd03376942e2d81cb53a9eb84cbd510376a08271167282d038817fa4e14
MATLAB
2,449
86
function results = vl_test_kdtree(varargin) % VL_TEST_KDTREE vl_test_init ; function s = setup() randn('state',0) ; s.X = single(randn(10, 1000)) ; s.Q = single(randn(10, 10)) ; function test_nearest(s) for tmethod = {'median', 'mean'} for type = {@single, @double} conv = type{1} ; tmethod = char(tmethod) ;...
a85a32b6284d1f4cbb911effa8e1fca6b3bee7d86cd8e37c9de597e63702c478
MATLAB
2,449
54
function subject_FD_parse_HCP(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm) % FD parsing Nipype wrapper pulling in list of motion files % All variables (skips, TR, CurrentDirectory) set within Nipype % Iterates over range of values from 0.1 to maximum of 0.5 FD threshold % Outputs to .mat file % FD_movement...
c77a5978c90c0b60bfd454999c716c012063468fca48ee35281beebdf61b1fd4
MATLAB
2,452
93
function createStim() sizeStimBlockWDeg = 4; % deg sizeStimBlockHDeg = sizeStimBlockWDeg; % screenWidth = 38; %104; % cm (old CNI = 104cm at both 16ch and 32ch) screenHeight = 20; % cm scanCoil = 16; if scanCoil == 32 viewingDist = 272; % cm; CNI = 270-273cm at 32ch, 265 at 16ch; else viewingDi...
3f57e91fa103c517b2f301bf651bc4322003d0f5c46cc5d7c7af1337770ec277
MATLAB
2,453
66
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: Greg P. Smith Web: www.ced.co.uk email: greg@ced.co.uk This file is part of CEDS64ML, an SON MATLAB interface. CEDS64ML is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License...
6670a1d542131e3d33a3045b811dab8a9357e7e2be060783be8353771bbb1d89
MATLAB
2,454
65
% 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,...
5f46ba96ef4373681eddeaac9fceafdbd2f518c056e8a8ffe189bcbd584f501f
MATLAB
2,455
65
%% function density_plot(spikes, idx) % creates density plot of the spikes % % % Portions of this code were adapted from work by Simeon Knieling, with % permission. %-------------------------------------------------------------------------- function density_plot(spikes, idx) color_ = [0 0 0]; if ~exist('idx', 'var'...
1cd5d5f2680cc5706d1f31c2f8bcbf0dfb122cdc45305bf3324250be6af455d0
MATLAB
2,457
93
% % Make the X axis labels by correct for year numbers. % % PARAMETERS % t_min, t_max Minimum and maximum values to be plotted, in % Unix times % function time_xaxis_unix(t_min, t_max) t_min t_max assert(t_max > t_min); NUM = 7; % Maximum number of ticks to show on the date axis (X axis) YEAR = 3600 * 24 *...
b5868266fd04d6e53ba86e89768ad5527db52ad1869dce582f20bec90c250947
MATLAB
2,457
91
% displayRawSignals.m % % Function that plots dF/F over time for each ROI, as well as raw % fluorescence before background subtraction as separate plot. Displays % average image with ROIs overlaid % % INPUT: % frameTimes - time at which each frame occured % avSignal - raw fluorescence before background subtractio...
bd99bcbdd239ef148789b304149058e95e769103d8f69a213457b82ddaa0bb7d
MATLAB
2,457
63
function SC=init_system(SC) %% ramps SC.N_PG=2*SC.n_PG+1; n=SC.n; SC.r0 = 1046; %main camera 00 SC.c0 = 953; %main camera 00 SC.ramp_fx_laser=1; %DC offset laser SLM x SC.ramp_fy_laser=0; ...
74801f3607a6acf55463be51574c1c96155c28215024214b3281a42fe4b5113c
MATLAB
2,458
62
function [p] = ml_cai_scopecam_alignvideo( dataFolder, varargin ) p = inputParser; p.CaseSensitive = false; addRequired(p,'dataFolder', @isstr); %addRequired(p, 'dataFolder', @isstr); addParameter(p, 'videoFolder', dataFolder, @isstr); addParameter(p, 'outputFolder', dataFolder, @isstr); ...
5575995f0329c72cef48d68185eae5501517173382eb8ca8f74d20264e9932fd
MATLAB
2,459
102
% theta = choose_orientations_generic(theta,wtheta,appearancecost) % % we will set the orientation to theta_t = theta_t + s_t * pi % we want to choose s_t to minimize % \sum_t cost(s_t|s_{t-1}) % cost(s_t|s_{t-1}) = [wtheta_t*d(\theta_t,\theta_{t-1}) + % appearancecost(s_t,t)] % % we will find the ...
8fe02621b21a36afe27f1b1c21ce2ca68b5b29ee2d93e99f9f17e40d45c8f01e
MATLAB
2,459
51
function NamedUnitNames = getSesNames(Sesname,var) %globals; NamedUnitNames=[]; switch var case 'nose.o', switch Sesname, case '20160601Thalamus45_opF_W', case '20160602Thalamus48_opF_W', case '20160602Thalamus49_opF_W', case '20160603Thalamus39_opF_W...
357cbaaa7d5fda00b5ced5347b4eedfe379f0a27da63dc2b1c5f88f20fade6ba
MATLAB
2,461
80
% computeEnvelopeStepParamsPData.m % % Function that computes a continuous estimate of AEP, PEP, step length, % and step direction on multiple selected pData files (selected through % GUI). % pData file must have legTrack, legSteps, and moveNotMove structs % This functionality has now been added to extractLegStepsF...
791fe9e04e220a38b28e2a35c95c1f4af7301ace6e5709c4a0e14e14d1ce76ec
MATLAB
2,462
55
function yml=mbmling(xml,plt) %MBMLING_CELL converts any XML into MbML (Matlab Markup Language) compliant string % %Syntax: yml=mbmling(xml,plt) % %Description: % Converts any XML syntax into Matlab Markup Language (MbML) % % Jonas Almeida, almeidaj@musc.edu, 18 May 2002, MAT4NAT Tbox if nargin<2;plt=0;end if plt==...
08ca8911a0bda043efc0ab1e80566d4704cfb08ae990f15e0c56974dc1c23c12
MATLAB
2,464
57
function ok = clearStage(cfg,micID,varargin) % Empty the managed stage folder without uploading. Never throws % % function ok = webupload.clearStage(cfg,micID,'Param1',val1,...) % % Purpose % Call once at the start of a new run so a previous run's recipe and log can never be % sent with the ...
b39096afdfb977f53b082f273866b25c81d392f7b620be4f691194648bf0d9b7
MATLAB
2,464
77
% merge forward/backward replay onsets to single file folder = [pathResults '/']; %% merge replay onsets for mental simulation task mkdir([folder '/merged/cued_mental_simulation_replay']) mkdir([folder '/merged/cued_mental_simulation_prob']) f_fwd = dir([folder 'onsets-fwdMentalSimulation/sub*fwdMentalSimulation*rep...
c910f020576967beb67667adf3be762f80748bc646d8e7b3af6e7e8c6f7f9dc8
MATLAB
2,464
77
% takes each "bout" of activity from frame [C1] to [C2] % and calculates a running total of df/f over multiple bouts % input bouts as RxC w C1 = start C2 = end % make an array to store the integrated bout df/f % need to find the longest bout to create the array function[boutArray,boutInteg,CumBoutInteg] = boutDFF(bou...
ca0fc83b6f609a7c48ada36c4f4872d2ac9002050f7ba4c926569def1f76a958
MATLAB
2,464
59
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [s] = load_dataset(folder) [BestAligned, analysisSettings] = load_best_aligned(folder); [MapsData] = load_maps_data(folder, analysisSettings); % Verify the integrity of the data because we have to index between...
998375deb0271ecda2ed352d8e39ef5f7a18563973f1888382d30efd80366cf7
MATLAB
2,465
53
fig = figure; fig.Units = 'centimeters'; fig.Position = [0 28 22 28]; colours = brewermap(3,'accent'); featurenames = {'LogVariance', 'Skew', 'Kurtosis', 'DeltaV',... 'LogHalfHzPwr', 'Lambda', 'Fiterror', 'DeltaLambda', 'DeltaFiterror',... 'DeltaLogPower', 'ThetaLambda', 'ThetaFiterror', 'ThetaLogPower',... ...
d737d9a0a8d6e63509ceee0167b6135b8e8f9651e60e3ee3393f426a5c3ca20a
MATLAB
2,465
78
%run getSpikes clear all; globals; DEBUG=0; PLOTALL=1; % plot also non significant cases [spikes, LFP, theta, nose,FPS, Files] = getSpikes('20150906Thalamus36'); Nframes = length(nose.x); [Nelecs, Nunits]=size(spikes); if DEBUG, Nelecs=1; Nunits=1; end; tt=0:1/FPS:(Nframes-1)/FPS; figure(1); clf; p...
61c40ef2bd36e170be777763f30b50a934c7ec726e4811786011388d6c8dd3ac
MATLAB
2,466
75
function lat = fcn_bilaterality(c,hemi,nrand) %FCN_BILATERALITY measures laterality of partition % % lat = fcn_bilaterality(c,hemi,nrand) takes a [node x 1] partition, a % [node x 1] vector of hemisphere labels (1 = RH, 2 = LH), and a number % of random permutations. It returns the laterality index from Lohse ...
c8eadf6de6d4320ffff3909ed7dc0920010408740f12cee18f37a2310b4384da
MATLAB
2,467
76
% visstimFictrac.m % % Trial Type Function % Presents visual stimulus on G3 panels, records FicTrac behavior data % % INPUTS: % settings - struct of ephys setup settings, from ephysSettings() % duration - duration of trial, in seconds % % OUTPUTS: % rawData - raw data measured by DAQ, matrix where each column is...
426411d8e28dd80e008aef947d3237654a3fd88904fca5bed3e035c103e64a49
MATLAB
2,470
69
% VL_KDTREEBUILD Build randomized kd-tree % FOREST = VL_KDTREEBUILD(X) returns a structure FOREST containing % the kd-tree indexing the data X. X is a M x N dimensional matrix % of class DOUBLE or SINGLE with one data point per column. Use % VL_KDTREEQUERY() to query the index. % % VL_KDETREEBUILD() accepts ...
cf1da79b5c91edfa10b406d0420d00f24e858c9f6e3356f00fc3efb1e0af77ca
MATLAB
2,473
80
%% Set up clear;clc; A = chanData; % open Excel File A.excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max.xlsx'; %A.excelFile = 'C:\Users\Public\RaymondLabCode\Projects\Max - CF Project\Monkey Metadata by Max (Akira).xlsx'; A.expmt_table = readtable(A.excelFile); A.expmtDataF...
5b4cbaad5f41447a1dd64bd0d2007fd1c10ff213fb68c1ab438e9499a084c4cf
MATLAB
2,474
79
function [A coords] = grid_graph(varargin) % GRID_GRAPH Generate a grid graph or hypergrid graph % % [A xy] = grid_graph(m,n) generates a grid graph with m vertices along the % x axis and n vertices along the y axis. The xy output gives the 2d % coordinates of each vertex. % [A xyz] = grid_graph(m,n,k) generates a ...
ec6b2423475f0bf51045fe714e7fc2196909dcf49b78e17d9a861e8b49a89146
MATLAB
2,474
71
function fH = plotLMMfittedRegressionSlopesCummulative(deltasGroup,deltasSubj, ... deltasSE,deltaLabels,cmapROIs, saveFigs,saveFigDir) % Function to plot the cummuluative effect of suppression slopes across the % visual hierarchy (Suppl Figure 2A) %% Check inputs if ~exist('saveFigs','var') || isempty(saveFig...
77e011f6072712ca2845eb4e266838f3330b764be2a2075e15de24b88191b774
MATLAB
2,475
78
function ndx = sub2ind_faster(siz,varargin) %SUB2IND Linear index from multiple subscripts. % SUB2IND is used to determine the equivalent single index % corresponding to a given set of subscript values. % % IND = SUB2IND(SIZ,I,J) returns the linear index equivalent to the % row and column subscripts in the arra...
78f3ccb3d64e7f7af9bfed5fee2e7b5068d99f2c62c039af836dc5cd4d8abc51
MATLAB
2,475
104
% % Plot the plots for one PA variant. % % PARAMETERS % network % letter For output filename % pa_x Curve fitting values (see konect_pa_full.m) % pa_data_x Plotting data (see konect_pa_full.m) % % OUTPUT FILES % plot/pa.[a...]$letter.$network.eps % function pa_plot_one(network, letter, pa_x, pa_data_x) network...
d1291c404f17da54c1e22f6b7cd56e1e21c691407328f888ca0773fc4a9bd3da
MATLAB
2,475
76
function [tok] = tokenize(str, sep, rep) % TOKENIZE cuts a string into pieces, returning the pieces in a cell array % % Use as % t = tokenize(str) % t = tokenize(str, sep) % t = tokenize(str, sep, rep) % where % str = the string that you want to cut into pieces % sep = the separator at which to cut (default ...
33afff96743b3cfa4de5113b7b8d7e3f36e552af28a3cc4d9f78169392ab5bea
MATLAB
2,476
62
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [output] = compute_cell_rate_difference_matrix_by_context_v0(firingRates, trialIds, contextIds, rateMatrixNumTrials) if rateMatrixNumTrials <= 0 || length(rateMatrixNumTrials) ~= 1 error('rateMatrixNumTrials must...
3d01227c8cf602bc7e8b45dcedd0f3b3a938d4bee2e7351f81873b0388adbadc
MATLAB
2,476
74
function spm_extract_anatomical_rois(cfg) % Extracts ROIs from one subject. % Arguments: % cfg: A struct with the following fields % % target_dir: path to subject's first level analysis % results. % % adjust: 0 to not adjust, NaN to adjust % ...
9c8329dbdc2793a73ec26a36a609210ee5ca2b3c5ed5d136168c073c03544ca2
MATLAB
2,476
74
function [allAngles, allDistances] = ml_cai_egocentric_compute_distances(mousePosition, mouseHeadingDeg, mouseEgocentricAngles, poly) Mv = mousePosition; %[mousePosition(2) mousePosition(1)]; mhdr = mouseHeadingDeg; angles = mouseEgocentricAngles; % egocentric angle 0 corresponds to mouse heading direction numPoly = l...
b64e5289080d8fb58df47375604b4b6229c9e558f22a3fb22740760006edc66c
MATLAB
2,476
71
function [t] = neuralynx_timestamp(filename, num) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SUBFUNCTION for reading a single timestamp of a single channel Neuralynx file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright (C) 2007, Robe...
d640af661cb84efd50f0999f15f849c9b0e2971ca2c214e3f4a3e2103950e37b
MATLAB
2,476
78
% saveAllKernels.m % % Function to compute kernels for all selected date directories. % Calls extractAllKernels() % % INPUT: % dateFolderPaths - [] if gui to select one date folder; otherwise, % cell array of full paths to date folders % winLen - length of window, in seconds that averages are computed over % ...
a2314f068a7d1a13dfd3100e48e4cb4efc66d4887834970082821d0d41a12408
MATLAB
2,478
86
function output = pomdp_observer(stimulus_sequence,sigma,alpha_pos,alpha_neg,... softmax_temperature,memory_strength_positive,memory_strength_negative,value_init) % reward storage reward = zeros(length(stimulus_sequence),1); % response storage response = zeros(length(stimulus_sequence),1); % value storage value ...
55a61413f5e51d0edbb26158cb9fbdcdcf046efa87a2d8a8490f10093bf2713e
MATLAB
2,480
60
function success = calculate_behaviors(folder_name) % given tracks that has embeddings, classify every time point into a % behavior addpath(genpath(pwd)) %set up parameters parameters = load_parameters(folder_name); if parameters.TrackOnly success = true; return end load('referen...
bbad392a0c990b9e97ee5beb80f1022cd8381165144dd79739705ed859a9ad9c
MATLAB
2,480
82
function [trainingSetData,trainingSetAmps,projectionFiles] = ... runEmbeddingSubSampling(data,parameters) %runEmbeddingSubSampling generates a training set given a set of .mat files % % Input variables: % % data -> spectralgram % parameters -> struct containing non-default choices for paramete...
9e16f624109130e7d9a69c3edec424d1f9c0cd51fdeb07dcbed8050ae99f9b2e
MATLAB
2,481
75
clear; ft_path = '/Users/wenwen/Documents/MatlabToolbox/fieldtrip-20240704';% require fieldtrip toolbox addpath(ft_path); ft_defaults txtCell = {'','','','';'_lap','_dephase','_corrTrials','_bl2preDelay'}; subj_files = {'DMSS053_resp_LCMV.mat','DMSS056_resp_LCMV.mat','DMSS061_resp_LCMV.mat'}; %% for s = 1:le...
8af8999c55a2c0b9f451a213399f051bdb97efa0d3bc0af46e4b1599afa7040d
MATLAB
2,483
68
%% binary_classification to HC and MS with edge roi_num = 48; load('group_data_DBM.mat') edge_data = cat(3,data.HC,data.MS,data.NMO); net_mask = logical(tril(ones(roi_num),-1)); Features = zeros(size(edge_data,3),sum(net_mask(:))); for isub = 1:size(edge_data,3) edge_data_i = edge_data(:,:,isub); Features(isu...
9192f0e177974b482ca075f3e05017af239479e19c2e55bd92409620c0f77815
MATLAB
2,483
48
function test_on_single_vnc_experiment() % Where does this script live? 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(...
e08c21f1134421b83484f1d18fab7b09ebbb3af91e7bf3fe39f95a50de6bdd2c
MATLAB
2,483
56
function [order_in, order_out, frac_X] =... spreading_func(aij, data_run, 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 s...
ab558ad2a9714415f0f012d44e47150d1de204237c80de7fdbd58f059b3f423d
MATLAB
2,484
82
% VL_DEMO_DSIFT Demo: DSIFT randn('state',0) ; rand('state',0) ; % read a test image I = imread(fullfile(vl_root,'data','roofs1.jpg')) ; I = single(vl_imdown(rgb2gray(I))) ; % -------------------------------------------------------------------- % Basic benchmark %...
8745e82bfa03e13f37c2e6e8f4e6deb4ad3ef6a26c937fc82c37d0300448975d
MATLAB
2,485
68
%% binary_classification to HC and NMO with edge roi_num = 48; load('group_data_DBM.mat') edge_data = cat(3,data.HC,data.MS,data.NMO); net_mask = logical(tril(ones(roi_num),-1)); Features = zeros(size(edge_data,3),sum(net_mask(:))); for isub = 1:size(edge_data,3) edge_data_i = edge_data(:,:,isub); Features(is...
8ee77229cba8e382fd85e736d2bed91cc3344093f8d05dccec8835e559c780e7
MATLAB
2,485
65
%%Data for this tutorial is available here: dx.doi.org/10.6084/m9.figshare.26597269 %% Tutorial clear all close all %% Step 1: Load data %Here we are loading a raster that has been downsampled from 18 to 1 kHz %Data was initially processed with a second-order bandpass Butterworth %filter in the forward and re...
0571c957cdff330f6dc307057da9c57306302cf07821fbcbc16234749d6d9fb2
MATLAB
2,486
68
%% binary_classification to NMO and MS with edge roi_num = 48; load('group_data_DBM.mat') edge_data = cat(3,data.HC,data.MS,data.NMO); net_mask = logical(tril(ones(roi_num),-1)); Features = zeros(size(edge_data,3),sum(net_mask(:))); for isub = 1:size(edge_data,3) edge_data_i = edge_data(:,:,isub); Features(is...
5db609ed2a5ba6a29e61df64733f9adc222ce5578a7eb72e57abc7377e0fab9f
MATLAB
2,486
103
function [C, KSq] = conv_kernel_rot_c0(Params, R, datatype, kerneltype) % [C, KSq] = conv_kernel_rot_c0(Params, R, datatype, kerneltype) % Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Updated X.L., 2019-07 % Updated X.L., 2020-10-10 if nargin < 3 datatype = 'double'; kerne...
922be5d0a16d5e3f5b2995e970f4b59320f301492678ae9641948ae590187a14
MATLAB
2,488
70
function [output,metaStruct] = TDMS_getStruct(filePath,structVersion,readOptions,structConvOptions) %TDMS_getStruct A wrapper for simplifying data retrieval from TDMS_readTDMSFile % % output = TDMS_getStruct(*filePath,*structVer,*readOptions,*structConvOptions) % % OPTIONAL INPUTS % =======================...
e0444334f89d495218aef123e4b3eefa97fe6927d32dd79e1dd8b510f8f68ac0
MATLAB
2,488
68
%% para path = pwd; load('node_name') load('Edge_compare_DBM.mat') load('group_data_DBM.mat') fdr = 0.05; p_correct = 1/1001; post = struct; %% tidy PT_FDR = gretna_FDR(results.TFNBS_t_pval_sig_edge + p_correct,fdr); if isempty(PT_FDR), PT_FDR = -1; end for i = 1:results.N_sig_edge post(i).data = {squeeze(data....
b46fdf05ed9925ee73eb2164ee0a2cfbe5116b4c79a647749e588a3ddc5704c3
MATLAB
2,489
70
function [ anon ] = createAnonymized( obj ) % CREATEANONYMIZED % Import and Anonymize Medtronic Percept PC json files % This funtion anonymizes selected parameters from json files, Percept PC. % The variables are the following: % from Patient Information Initial / Final: % PatientFirstName % PatientLastName % PatientG...
dce91ad17066a040a4210b40f2b3a920094d6a59c07dc1a3dd6517bb1cd1bfe6
MATLAB
2,489
82
% plotAllKernels.m % % Function to plot all kernels. Also shows variance explained. Generates % separate plots for spikeRate and medFiltV. % Requires the structs generated by computeKernels_pData() % % Adapted from plotAllKernels() in 2PAnalysisCode-Helen % % INPUT: % kernels - kernels struct from computeKernels_pDa...
fc34fabd17f108fbbc203e844ae22e9b07dcb357020f64fda1c40149c39c3c98
MATLAB
2,490
112
function bw_out = aedes_roifill(bw,seed) % AEDES_ROIFILL - Do flood fill operation (4-conn) for binary image % % % Synopsis: % bw_out = aedes_roifill(bw_in,seed); % % Description: % Flood fill operation (4-connected) for binary 2D images. % % Examples: % % See also: % AEDES % This function is a p...
2bd7f3d62472653e011840c61ad4d3d6bf2274efec464d3c4dfb0bde85d17d9d
MATLAB
2,493
42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%% Install NAOMi Simulation %%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%...
7c837025b79ff0ce1d57828827eff491038aa4eae310c93c617b4646808916fa
MATLAB
2,493
60
%% Restable nogocue clear file=dir('ACC*restable*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome);n1=fix(n*0.15); early=[find(outcome(1:n1,1)==3);find(outcome(1:n1,1)==4);];%early phase late=[find(outcome(n1+1:n,1)==3);find(outcome(n1+1:n,1)==4)]+n1;%late phase for...
8186dc3dafd28e78e26ce2c9933651a553d83854235cc8a33b040631173ce9d7
MATLAB
2,493
68
function fH = plotpRFModelcvR2Distributions(diffR2Resampled) r2bins = -100:5:100; clear histR2 h for sj = 1:length(subjnrs) for idx = 1:length(roisToPlot) for mm = 1:3 if sum(isnan(diffR2Resampled(sj,idx,mm,:)))~=length(diffR2Resampled(sj,idx,mm,:)) h = histogram(squeeze(d...
e3a42524616e2150b25add94875f0442e923f08b1d363baaa94b6ee411a86898
MATLAB
2,494
72
function cfg_artifacts=st_repair_grid(cfg_artifacts) % ST_REPAIR_GRID determines the repair grid/matrix % % Use as: % cfg=st_repair_grid(cfg) % % Required configuration parameters: % cfg.grid = structure containing segment-based artifact grids % % Output: % cfg = artifact configuration with...
ec8f54ce35b4a8fe9f28a7f7b240fd5dcf8d7c71f3c5563c09f5f75e5173b868
MATLAB
2,495
78
function imdb = setupCaltech256(datasetDir, varargin) % SETUPCALTECH256 Setup Caltech 256 and 101 datasets % This is similar to SETUPGENERIC(), with modifications to setup % Caltech-101 and Caltech-256 according to the standard % evaluation protocols. Specific options include: % % Variant:: 'caltech256' ...
a7187ed8cf346d558d633e21a3502737c51307e4c2c7ae4b970c4acc995b8fa0
MATLAB
2,496
67
function logfile = importfile_logfilenew(filename, startRow, endRow) %IMPORTFILE Import numeric data from a text file as a matrix. % S1LOGFILE = IMPORTFILE(FILENAME) Reads data from text file FILENAME for % the default selection. % % S1LOGFILE = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads data from rows % ...
c78e47d8c37185ac7c50daa23cacce2440ede474476c509ed1c67619d3f2d9c9
MATLAB
2,496
74
function vl_demo_gmm_3d % VL_DEMO_GMM_3D Show how to initialize GMM learning with a custom set of modes %% Initialize points clustered in 3D numClusters = 5 ; dimension = 3 ; cc = hsv(numClusters) ; randn('state',0) ; X = [] ; for i=1:numClusters delta = 5*[i;0;0] ; %num = ceil(1000 / i) ; num = 500 ; s = di...
d31049af63502e4d7986b12829df49626be32370928812bbe545ff77ba5e196f
MATLAB
2,496
86
%% corr the coupling R2 or P-value with gene expression via PLS %% para path = pwd; pls_dim = 1; roi_num = 48; rand_time = 10000; p_thr = 0.05; gen_results = struct; %% data % AR data load('Edge_GLM_gene_str_dis_commu_DBM.mat') roi_index = cat(1,results(:).roi); AR = cat(1,results(:).AR); AR_p = -log10(cat(1,result...
f96f2f3f20d2e2f2d4a7eddf8218f47a349fb83bba0f9aa579efd161b583bcf4
MATLAB
2,496
74
%{ 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...
0ff72afd0df70a4c7040e2eb1e8ff8763bb9ed66333ee0c3cccf0a4474dd9b2a
MATLAB
2,497
46
function mltp_plot_bfo_90_wc(obj) numAngles = 4; best_fit_orientations_within_contexts = zeros(obj.Experiment.getNumSessions(), numAngles); plotlegend = cell(obj.Experiment.getNumSessions(), 1); for iSession = 1:obj.Experiment.getNumSessions() session = obj.Experiment.getSession(iSession); ...
8e29d73a6ebdd925c43a8a3869bb3fa403a81ae1f5d10f48d3888a0f37d8448c
MATLAB
2,497
60
function SONLoad() % SONLOAD loads the son32.dll library and defines global constants % % Version 32 of the SON library works only under Windows and requires % version 7 of MATALAB and a copy of CED's son32.dll. % % The routines use CEDs son32.dll to provide I/O. This file must be present % in a 'c:\Spike5' directory (...
75412293f7a919cbdda0696b1fa9b27d8b3e95bb136e8b73d77c0c29e0cd86f6
MATLAB
2,498
76
function [paths,pathnums] = dilateDendritePathAll(paths,pathnums,obstruction) % [paths,pathnums] = dilateDendritePathAll(paths,pathnums,obstruction) % % Function to simultaneously dilate all the dendrite paths in the volume. % This function looks for empty space around the established dendrite % positions to allocate ...
5093438978686beebe464fccae876de245e7aca26fe0054f9fbf192133d73956
MATLAB
2,499
57
function plot_avg_burst_rate(burst1_rates, burst2_rates, channel_id, lbl_opt) %% Function: 'plot_avg_burst_rate' % DESCRIPTION % Plots trial-averaged burst occurrence rates of two conditions or % groups % USAGE % Full Input : plot_avg_burst_rate(burst1_rates, burst2_rates, channel_id, lbl_opt) ...
f79827472509eba7d6b645c4a027b5e456acb3bd4f9e48f30381b95906b37ed7
MATLAB
2,500
72
function grad = fif2grad(filename) % FIF2GRAD constructs a gradiometer definition from a Neuromag *.fif file % The resulting gradiometer definition can be used by Fieldtrip for forward % and inverse computations. % % Use as % grad = fif2grad(filename) % % See also CTF2GRAD, BTI2GRAD, MNE2GRAD, ITAB2GRAD, YOKOGAWA2GRAD...
46b7b6691237d1150cc70878266cc9be1f765beebc8aeb99d2bae5ae8c68ce4e
MATLAB
2,501
69
%% Fig3E % Examples of FI and FS cells data_path = '/Users/celia/Documents/two_context_data'; % change this cal = load(fullfile(data_path, 'calcium_20220516_170618/analysis_results.mat')); tet = load(fullfile(data_path, 'tetrodes_20220316_100902/analysis_results.mat')); best_aligned = [cal.analysisResults.BestAligned...
f3bdcf7327a59e8040679f8abde7a6d9c44ceb074839e03651a42e105d63a4a9
MATLAB
2,501
92
function polarPlotVectorsMean(File) % open up csv file containin the gain and phase [~, ~, array] = xlsread(File); [row, ~] = size(array); rLimits = [0, .62]; myfig = figure(); % cycle through each entry and plot them on one % polar figure for i = 1:row % get Title ( optional) % theTitle = vals(((i-1) * 4...
c37af675a887378b947ab87bbe3cdf3b5b46419e69aa5bcbea42fd7c98c9e214
MATLAB
2,503
73
function [indx] = labelcmb2indx(labelcmb, label) % LABELCMB2INDX computes an array with indices, corresponding to the order % in a list of labels, for an Nx2 list of label combinations % % Use as % [indx] = labelcmb2indx(labelcmb, label) % or % [indx] = labelcmb2indx(labelcmb) % % Labelcmb is an Nx2 cell-array wit...