sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b97a2fcc4888c54342bc8c5386a2b6f358d51506b0300b59d0d1c2695cdad7e6
MATLAB
2,200
48
function results = CulcVesselDistMat(mask_p,boundary,F2S) % setting variables boundary_l = boundary(1:6,:); boundary_r = boundary(7:end,:); [k_l,~] = convhull(boundary_l); [k_r,~] = convhull(boundary_r); % Detect object perimeter in binary images mask_bound = bwperim(mask_p,8); figure; imshowpair(mask_p,ma...
553389f72e13acc016a8964da12cbc5664fda75fa75b1ff6741d5dcab715f89b
MATLAB
2,202
68
% rcepsminphase() - Convert FIR filter coefficient to minimum phase % % Usage: % >> b = minphaserceps(b); % % Inputs: % b - FIR filter coefficients % % Outputs: % bMinPhase - minimum phase FIR filter coefficients % % Author: Andreas Widmann, University of Leipzig, 2013 % % References: % [1] Smith III, O. J. (20...
d382e6567a0f2bdc9fc07aead2205f2658daa7c44c81a281cf6922b8a83c8481
MATLAB
2,202
62
function [mu, sigma] = SNR_normalization(trace,meth_sigma,meth_baseline) % Possion noise based filter act on the traces, and calculate the median and % std of the filterd trace % Inputs: % trace is the raw trace. Each row is a timeseris of a neuron. Each column is a time frame. % meth_sigma is the method to de...
ac25dc8c1b04ddd2629c20eb0d334896327b31d472f85ba438d6470acdf77687
MATLAB
2,205
65
function [vol] = read_ctf_hdm(filename); % READ_CTF_HDM reads the head volume conductor model from a *.hdm file % % vol = read_ctf_hdm(filename) % Copyright (C) 2003, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation and details. % % FieldTri...
7c758f93bb590d497266e55d961abe2ad396d52bf767cd1d7c6dbf44dfbaebe9
MATLAB
2,206
67
function handle = ternary_tick_lines( handle, varargin ) % ternary_tick_lines create axes tick lines % % Inputs % %% Check Inputs % Check if handle is given if (nargin==0) error('Too few inputs') end % Create defaul settings if no extra arguments supplied if ( nargin < 2...
43eacabc8e1af2a1ce92ea013edbfee81e7a2346aa13a8255cc21c0f490a33fb
MATLAB
2,208
68
function [pupil, edgeThresh, epx, epy, epx2, epy2] = detectPupilQuick(img, circen, crx, cry, crr, varargin) %% Process imputs p = inputParser; addOptional(p,'pupilStart',[]); addParamValue(p,'radiiPupil',60); addParamValue(p,'edgeThresh',30); addParamValue(p,'MinFeatures',.6,@(x)x<1||x>0) parse(p,varargin{:}) pupilS...
ec88be2c8ca98941110860ae97f6ae48dee5e075f9d012c010a5feca9d5ccb2f
MATLAB
2,208
62
function [mu, sigma] = SNR_normalization(trace,meth_sigma,meth_baseline) % Possion noise based filter act on the traces, and calculate the median and % std of the filterd trace % Inputs: % trace is the raw trace. Each row is a timeseris of a neuron. Each column is a time frame. % meth_sigma is the method to de...
f849155ac60ce6c5ecaaf068df816c6dd09321906430ae3cd3e7e3ad47e1ef01
MATLAB
2,208
73
function [hdr] = ft_fetch_header(data) % FT_FETCH_HEADER mimics the behaviour of FT_READ_HEADER, but for a FieldTrip % raw data structure instead of a file on disk. % % Use as % [hdr] = ft_fetch_header(data) % % See also FT_READ_HEADER, FT_FETCH_DATA, FT_FETCH_EVENT % Copyright (C) 2008, Esther Meeuwissen % % This ...
3d6a21fe62de2fc9c9f4e9719ea842aa3576039c9475eb4f9b73ad84429fdf3a
MATLAB
2,209
54
function [perCell, uniqueCellIds] = ml_algo_bfo_percell_general(placemaps, cellIds, contextIds, trialIds, rotationsDeg) uniqueCellIds = sort(unique(cellIds)); uniqueContextIds = sort(unique(contextIds)); uniqueTrialIds = sort(unique(trialIds)); numTrials = length(uniqueTrialIds); numCells = le...
0836c9aea6bd947821a031e6f6a18a91e7e5c8354349851c53f8ce1dab53486d
MATLAB
2,210
59
function [wRidge,rho,SDebars,postHess,logevid] = autoRegress_PoissonRidge(xx,yy,fnlin,iirdge,rhoNull,rhovals,w0) % [wRidge,rho,SDebars,postHess,logevid] = autoRegress_PoissonRidge(xx,yy,fnlin,iirdge,rhoNull,rhovals,w0) % % Computes empirical Bayes ridge regression filter estimate under a Poisson-GLM. % % Inputs: % ...
2e5574e74aebd895c3856d255244d9ed3146d4d4cb2efe00f36b84626a761e12
MATLAB
2,210
90
function dtvariance_patch(path_list_file,varargin) %% Internal variables fs=filesep; %% Define defaults % Save in BIDS folder, default NO, save_in_BIDS_folder=0; output_folder=[pwd fs 'dtvariance_files']; % string_to_match=['*func' fs '*rest*bold*dtseries.nii*']; %% Read additional arguments, if provided v = le...
6db195e08d739d5bca6de3eb97917d675f41a5a18aa6b5ba7625319f33cc9a8e
MATLAB
2,210
67
function [status] = QSM_cluster(varargin) % this is the cluster version with no gui interaction % status = QSM_cluster(varargin) % Example call: % ParamsSetFile = 'ParamsSetting_cluster.m'; % LogFile = 'logd.txt'; % QSM_cluster(ParamsSetFile, LogFile) % 2024-05-31, update with TableDataFile argument if nargin ...
9784a54916400ad7e4db746857fe28030bef67a9f224bd9d125ab4839fc1346b
MATLAB
2,210
58
function mltp_plot_bfo_general_placey_sessions(obj, rotDeg, group) numAngles = 360/rotDeg; angles = (0:numAngles-1)*rotDeg; % Load the data fn = fullfile(obj.Experiment.getAnalysisParentDirectory(), sprintf('bfo_%d_placey_%s_avg.mat', rotDeg, group)); if ~isfile(fn) error("The file (%s)...
5b8491f562467f9b114444d6210e0929a692ae79364fb50a5070bf516a1998a8
MATLAB
2,212
78
% mglGluDisk - draw disk(s) at location x,y; alternative to glPoints for circular dots % % $Id$ % usage: results = mglGluDisk(x, y, size, color, [nslices], [nloops], [antialiasing]) % by: Benjamin Heasly % date: 03-17-2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYI...
abaa01ed8b24d1524055d726aa2a8cb930eb8c5bdb5682e006eb23d048c2b2ef
MATLAB
2,213
74
% filtDigraphBySynNum.m % % Function to filter digraph by number of synapses. Only keep connections % (and corresponding neurons) with greater than or equal to minSynNum % % INPUTS: % s - source neurons, maps all connections % t - target neurons, maps all connections % weights - number of synapses for all connec...
91e77fb4ca5a394960b3dd12910864f49bae4d50244e0e88d0c208ddc482fbd3
MATLAB
2,215
67
% not used in paper folder_name = uigetdir cd(folder_name) %open the directory of image sequence allFiles = dir(); %get all the tif files fps = 14; allTracks = struct('maxVoltage', {}, 'LEDVoltages', {}, 'reversalCounts', {}, 'frameCounts', {}, 'order', {}); order = 1; for file_index = 1:length(allFiles) if allFi...
a65d6071d8da75a8ece586c6fefc96165e2b5c4db2d53180932b319e27786e78
MATLAB
2,218
61
% data_ind = 4; addpath(genpath('.')) %% % name of the videos list_data_names={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'}; list_ID_part = {'_part11', '_part12', '_part21', '_part22'}; list_avg_radius = [5,6,8,14]; list_lam = [15,5,8,8]; r_bg_ratio = 3; data_name = list_data_names{data...
b370a4ff4619d7e2d703a8beccde1c6acf12f776669a1064d7194d9c49ad5162
MATLAB
2,218
59
%{ 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...
f0844c6895622bdca145b1b02105b3b87d04bc4d178babb338ef8666b60bc837
MATLAB
2,218
67
classdef EnumData < types.hdmf_common.VectorData & types.untyped.DatasetClass % ENUMDATA Data that come from a fixed set of values. A data value of i corresponds to the i-th value in the VectorData referenced by the 'elements' attribute. % OPTIONAL PROPERTIES properties elements; % (Object Reference to VectorDat...
21154cfd0df19cadf4f9fd95efaa0c85af347d60c7f9d29443a8cd1694fb4136
MATLAB
2,219
52
clear; close all; [pathstr,name,ext] = fileparts(pwd); usedir = pathstr; maindir = pwd; input_file_path = fullfile(usedir,'bids','sourcedata','Scan-Social_Doors','data'); warning off all subs = load('sublist_all.txt'); tasks = {'facesA1', 'facesA2','facesA3','facesA4',... 'facesB1','facesB2','facesB3','facesB4',....
55da4373e70b8df7ade558bf839cdb0489e0b8d1ca8759fa1f02b64af3d858b8
MATLAB
2,220
84
classdef MLTrial < MLTrialInterface %MLTrial An implementation for trial interface % An implementation for a trial interface properties (SetAccess=private, GetAccess = protected) Name SliceId TrialId ContextId Digs HasDigs IsEnabled ...
773b2365881b586962067c9b337fd8c7fe84e2384db1e8250e04855b4b8f7ce3
MATLAB
2,220
50
function scan_params = check_imaging_params(scan_params) % scan_params = check_scan_params(scan_params) % % This function checks the elements of the struct scan_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - scan_params - Struct ...
e2e9e6af93d5a5d3a8e179b4f1be0c4e26df1d44cf4c4fbbf9116d8fe8ab3ec0
MATLAB
2,223
68
%% Adapted from AllenSDK python function demixer.py % # Allen Institute Software License - This software license is the 2-clause BSD % # license plus a third clause that prohibits redistribution for commercial % # purposes without further permission. % # % # Copyright 2017. Allen Institute. All rights reserved. % % # ...
887d8e2d14952b8c4efd2dac75d32e65822350fdec13d1f19963ea342f26f5b6
MATLAB
2,224
68
%{ 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...
e727f98f375020b5d3e49fe4e4a8e82b6a1044536687a17441888c0e49a23f91
MATLAB
2,224
64
function write_TPM_movie(mov, save_name, varargin) % function write_TPM_movie(mov,save_name,{dataType,dataHeader,blockSize}) % % Write the 3-D array in mov to a file. Can writ to either a tiff stack, a % fits file, or a matlab '.mat' file. The mode is automatically chosen % based on the extension of the file-name ...
4683964f6207d0c699da753f738c5d85399f1721046bab53bd0a1718046bf515
MATLAB
2,225
53
function mltp_make_session_orientation_plot_aligned(obj, session) if obj.isVerbose() fprintf('Making the session orientation plot (aligned/canonical).\n'); end h = figure('name', sprintf('Session %s', session.getName()), 'Position', get(0,'Screensize')); % Fixme! Increase the size if it wont fi...
4f4922f255ee46ff8f1308c506c131fba1b6098dd9c4b98fffa7f285a6110a1f
MATLAB
2,225
68
function plotYawFwdSpikerateHeatmap(tDelay, spikeRateScale) % prompt user to select pData files [pDataFNames, pDataPath] = uigetfile('*.mat', 'Select pData files', ... pDataDir(), 'MultiSelect', 'on'); % if only 1 pData file selected, not cell array; make sure loop still % works i...
750e059ac7778e79b1fe7d790ef6adc5be9ae54dd35ad7c31ca05b7c78a29a45
MATLAB
2,225
70
function plotRawDataSetupON( obj, varargin ) % PLOTRAWDATASETUPON % Plot setup ON LFP recordings raw data % % Syntax: % PLOTRAWDATASETUPON( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optional) ax Axis where to plot. % * rec Index o...
b06731f870c47ce85336581d8154f3ac403b959801cd9adbaea86f0b835cc11a
MATLAB
2,225
53
% VL_SIFTDESCRIPTOR Raw SIFT descriptor % D = VL_SIFTDESCRIPTOR(GRAD, F) calculates the SIFT descriptors of % the keypoints F on the pre-processed image GRAD. GRAD is a 2xMxN % array. The first layer GRAD(1,:,:) contains the modulus of % gradient of the original image modulus. The second layer % GRAD(2,:,:) ...
d8844c1cf405b5365fca8248714e72dce448df55c468c03e4f8e3a5ca3de9b5d
MATLAB
2,225
102
% f_CheckTextNumbers.m [Part of HFO Detection Project] % Written by: % Miguel G. Navarrete Mejia % Electrical Engineering MS candidate % UNIVERSIDAD DE LOS ANDES % Colombia, 2012 % mnavarretem@gmail.com function [v_Numbers,s_Check] = f_CheckTextNumbers(... pstr_Ini,pstr_End,ps...
63d892c93ffc09524439734eb17cc004bd93e618021c09c79b80aedd455ace20
MATLAB
2,226
68
function gretna_gen_data_path(Data_path, Output_path, Output_filename, Subfolder_name) %========================================================================= % This function is used to generate a .txt file that contains the % directories of those dataset to be processed. Of note, the outputed .txt file will be % a...
8969a70c20bf9e16fcd7e8d986971bd94b465430c090f72a2bb55a940a7a321f
MATLAB
2,227
55
function data_out= auxchannel_regression(data_nirs, data_accel, data_gyr, data_orient) % AUXCHANNEL_REGRESSION % auxchannelregression performs a OLS regression of the fNIRS data with the long % channels as the dependent variable and the short channels and movement % data as regressors. It first z-transforms the data an...
7b9c9baa7b4a39defb05ed62ad810cd53d961b5d22c17ff33ef873588b0a2984
MATLAB
2,228
72
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This code makes Figure S9B (inforate per decile). It needs for Figure S9A % to be run first to make required Excels. close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = '../figure_S9A/local_output'; OUTP...
1b253167bb9fa5a0e969c5a5c0d228117e1b52e34f9f0f7e220052a4310afbe0
MATLAB
2,230
57
function mltp_plot_bfo_general_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.outputFolder, ....
4a0f3b5d928dfa4ebb5f447a438bf6ead0dc961e5edfab2f64780011d15e2901
MATLAB
2,232
52
function fH = makeFigure7_PredictedSuppressionLevels(ds,lmmResults, lmmResults_Model,roisToPlot,cmapROIs,saveFigs,saveFigDir) % Function to reproduce main manuscript figure 7: % Suppression level (LMM slopes) vs model-based (predicted) suppression % level by each pRF model (LSS,CSS,CST) % % From the paper: % Title: ...
65f4707453a8dd7cec07ae292cf041746a6e42a58be888959c8c7837df6f38ea
MATLAB
2,232
69
function plotRawDataSetupOFF( obj, varargin ) % PLOTRAWDATASETUPOFF % Plot setup OFF LFP recordings raw data % % Syntax: % PLOTRAWDATASETUPOFF( obj, varargin ); % % Input parameters: % * obj DBScope object containg streaming data. % * (optional) ax Axis where to plot. % * rec Ind...
2c77db5cd834ecbacf7e04e151533742f5b08a49a0a148c0639c045e739b6c00
MATLAB
2,233
61
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [hFig, ax] = plot_bfo180_average_similarity_curves_per_period(DaysToSessions, NormalBFO180Similarity, ShuffledTable) T = compute_bfo180_average_similarity_curves_per_period_table(DaysToSessions, NormalBFO180Similarity); ...
baaf292eea19a5b790ffd29ec2f04955c91d2ec8767c2a5f2b3d44b46f535135
MATLAB
2,233
59
function [mu, sigma] = SNR_normalization_video(video,meth_sigma,meth_baseline) % Possion noise based filter act on the videos, and calculate the median and % std of the filterd video % Inputs: % video is the raw video. Each row is a timeseris of a neuron. Each column is a time frame. % meth_sigma is the method...
833fde8d460fd39e0f70ea26852e147786b89df217e4b01c9519fbb52d7da2da
MATLAB
2,235
67
function wG = gradient_mask_all(rawImage, Mask, percentage, kspaceFlag, wG_thresh) % wG = gradient_mask_all(rawImage, Mask, percentage, wG_thresh) % Generate weighting using gradient of rawImage % with percentage of voxels in Mask to be edges % % Authors: Xu Li % Affiliation: Radiology @ JHU % Email address:...
2364214032817e194487dd9bdb3c5cf75f1d00cb10e480e1bc2e2a392dc71fc1
MATLAB
2,236
97
load('sampledata_connectivity.mat'); % preprocessing %% remove line noise cfg=[]; cfg.precision = 'single'; cfg.dftfilter = 'yes'; cfg.dftfreq = [60 120 180 240]; [data_left] = ft_preprocessing(cfg, data_left); [data_right] = ft_preprocessing(cfg, data_right); %% CAR cfg=[]; cfg.reref ...
3606c8e7dec59027888109a63a302dd1ade30e799c5433a40dfc6fc736afbe73
MATLAB
2,236
74
% computePData_all.m % % Function to compute all processed data (currently, for imaging and % FicTrac data) for all trials in specified date folder(s). % Saves processed data into a pData.mat file in the same trial folder. % Preprocessing, ROI selection, and FicTrac dropped frames selection must % have been complete...
43d5d673ed3c57bc2167cfe9bed2d03ade9b795bb50676c0bc31f7a8fcea64b5
MATLAB
2,236
83
function density = joint_density(x,y,flag) % simple routine to compute and plot the joint density histogram of x and y % % FORMAT: joint_density(x,y) % joint_density(x,y,flag) % % INPUTS: x and y are two vectors of the same length % flag if 1 (default) plot both the mesh and isocontour else only plot ...
4804830c701fe21df447ff43a55b6ce5d4eb12ef4c52f0b37cda48facde348d4
MATLAB
2,236
61
function [eeg] = read_eep_cnt(fn); % READ_EEP_CNT reads continuous EEG data from an EEProbe *.cnt file % and returns a structure containing the header and data information. % % eeg = read_eep_cnt(filename, sample1, sample2) % % where sample1 and sample2 are the begin and end sample of the data % to be read. % % eeg.la...
bed1dc8358546388f4b070414566ea11e342413f4c1ff59f08af4572906ba054
MATLAB
2,236
60
% $Id$ % usage: [currentMatrix, results] = mglTransform(operation, value, socketInfo) % by: Ben Heasly % date: 2021-12-03 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: applies view transformations % arguments: operation: 'get', 'set', 'scale', 'trans...
e554f9fccbe03e6e8ddfce6d954cf06f607e152c61b93c530348d6106de5d808
MATLAB
2,236
71
function [hprsmax,wmap,maxlogev,logevids] = gridsearch_GLMevidence(w0,mstruct,varargin) % [hprsmax,wmap,maxlogev,logevids] = gridsearch_GLMevidence(w0,mstruct,varargin) % % Search 1d, 2d or 3D grid of hyperparameters for maximum evidence (i.e., % for initializing gradient ascent of evidence) % % Maximizes posterior a...
9a1009aad57c7f2167f52f76b6ca3a197b29e68352217a60cf46d3c52ef854ef
MATLAB
2,239
62
classdef SimpleMultiContainer < types.hdmf_common.Container & types.untyped.GroupClass % SIMPLEMULTICONTAINER A simple Container for holding onto multiple containers. % OPTIONAL PROPERTIES properties container; % (Container) Container objects held within this SimpleMultiContainer. data; % (Data) Data object...
06178606150a5da50990048fbbdec27ecc5f6420f8d7d2645007f62b4daa4727
MATLAB
2,240
43
% analyze fluoresence intensity of a cell body within a region of interest % ParamAnalysisItemsStr = '{''FluoDifference'', ''FluoMain'', ''FluoBackground'', ''Area''}'; % ParamDisplayItemsStr = '{''dT''}'; Components(1).Name = 'PlotDropDown'; Components(1).Properties = {'Visible', 'Items', 'Value'}; PlotItemsStr = '{'...
0d3cab8cd7eab532d41d27b2b9e6f4abbb4662241b5121a6c7c43c88fcc8f05e
MATLAB
2,240
59
function ISIHistLOGISImaxThptrain201907230101nbasal0001 = importfile1(filename, startRow, endRow) %IMPORTFILE1 Import numeric data from a text file as a matrix. % ISIHISTLOGISIMAXTHPTRAIN201907230101NBASAL0001 = IMPORTFILE1(FILENAME) % Reads data from text file FILENAME for the default selection. % % ISIHISTLOGIS...
2bbdbba24423effcb1d70f80a8f04c1d423862b7e6722e2245a402e1a33165ff
MATLAB
2,240
52
function [x_bounded, y_bounded, xedges, yedges, xi, yi, sxi, syi, ... spikeCountMap, visitedCountMap, dwellTimeMap, ... positionProbMap, meanFiringRateMap, ... dwellTimeMapSmoothed, spikeCountMapSmoothed, meanFiringRateMapSmoothed, ... meanFiringRateMapPlot, dwellTimeMapPlot, ... meanFiringRateMapSm...
0cb07499b1ceaa72f147828170966151d7946430e17390d7fa3bcf48bf705ef3
MATLAB
2,241
72
classdef ObjectView < handle properties (SetAccess = private, Hidden) target = []; end properties (SetAccess = private) path = ''; end properties (Constant, Hidden) type = 'H5T_STD_REF_OBJ'; reftype = 'H5R_OBJECT'; end methods function o...
13856462a2c0e45f489c38247fb769d59cefc5fe23d5f0ed4e95a989fd2cf892
MATLAB
2,241
82
function rhs2spike2(files,clean) % Use raw data by default if ~exist('clean','var') clean = 0; end %% Extract matrix and other relevant data for i = 1:length(files(i)) % get data from .rhs file try clear amplifier_data read_Intan_RHS2000_file(files(i)); catch ...
26f6facc5202c430214b66dfc48bd1798e509c985b7ed44bda3245167c31602c
MATLAB
2,241
71
%% Start the main pipeline filenames = {'PFC4_15Hz_part11','PFC4_15Hz_part12','PFC4_15Hz_part21','PFC4_15Hz_part22'}; radii = [3:7]; SNRs = [7:4:31]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenames) for q = 1:length(radii) for r = 1:length(SNRs) [p q r...
3dd7ee44037a02e1e5ed68bb494a3a526703cef40972c8bf7506d7e17ac3ca88
MATLAB
2,241
84
function [v_PowSpec v_Freq s_TotalPow] = ... f_PowSpec(... pv_Sig, ... ps_SamRate, ... ps_ARMethod, ... ps_AROrder) % % Function: f_PowSpec.m % % Description: % This function computes the power spectrum of the input signal. % % Inputs: % pv_Sig: input signal % ps_SamRate: sample rate in Hz % ps_...
4b50a9f3ed7c1fe5e7feeab073c2641b72f46a8f747afb5931df7b0661ee09fd
MATLAB
2,242
57
% getCatStepValsXYcond.m % % Helper function for plotAEPPEPscatter(), plotAEPPEPContours(), and % plotAEPPEPmeans() % Returns step X and Y values, as well as leg calls for selected amp and % dur, given keys. Conditions on step value. Operates on single vectors. % Modification of getCatStepValsXY.m % % INPUTS: % st...
6b78e5d804dfcd6d3db4cd790f016b0913b5bcbbd9a5a68909c2690cc2116a47
MATLAB
2,244
98
close all %clear all clc % This tests the code. % Just change which example is used. [m1, coa1, ax1, ay1, m2, coa2, ax2, ay2] = mk_example2a(); [angleDiff] = ml_alg_center_out_difference(coa1, coa2); m3 = zeros(30,20); close all figure ax = []; ax(1) = subplot(1,3,1); imagesc(m1) hold on plot_coa(m1, ax1, ay1) s...
e4a9126de2ea64f253ffce24a837216aa5e446d4f416437f86158c3f4ee31553
MATLAB
2,244
71
%% Start the main pipeline filenames = {'bma22_epm_part11','bma22_epm_part12','bma22_epm_part21','bma22_epm_part22'}; radii = [6:1:10]; SNRs = [7:4:27]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenames) for q = 1:length(radii) for r = 1:length(SNRs) [p ...
9fa6db8466af7c885e10efa060cbf5ccb4599ece588f2e52b1b36af3b4575fea
MATLAB
2,245
71
%% 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) for q = 1:length(radii) for r = 1:length(SNRs) [p...
444d873c97c1f1dddbafe1c44464a453c9b23c518227dd159f9cc7a35c740823
MATLAB
2,248
59
clear; close all; % dir and load data cd add_path load('output_events_detected.mat'); %% global config exp = fieldnames(Dat); params = {'AbsNREMDur','SpindleDensity','DeltaMeanAmp','DeltaEnergy',... 'SODensity','AbsREMDur','REMThetaMeanAmp','REMThetaEnergy'}; para_corr ={'SWS time (min)','Spindle densit...
54352f5561210df6b0eeb9105f1960ffcf5939cecbebc414321d1f2ec7508c71
MATLAB
2,248
64
% mglMetalIsRunning: Returns info about any running mglMetal processes % % $Id$ % usage: [tf, pids, addresses] = mglMetalIsRunning(socketInfo) % by: justin gardner % date: 09/27/2021 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Returns whether mglMetal is running, ...
3dd2b299120f5c86b2a413df08e55b06c2bf51919219b14a25a26d3e21f3fa6f
MATLAB
2,249
43
function [cum_distances, sequences] = find_cumulative_distance_minus_backtrack(points,BW_size) % given a set of points in order, return the cumlative distance from the % first point until all subsequent points, accounting for backtracking if size(points,1) <= 1 cum_distances = 0; else distances ...
c9787c78f3ec6eb880e356ca66e46fca99f238cb533d76d520868064c80573a2
MATLAB
2,250
64
function plotHeatmap(obj, startIdx, endIdx, image) % This function generates one figure with the heatmap of the gazepositions. % The Colorbar can be adapt with click into the figure and move the cursor % up and down or sideways. To get back to the default values for the % colorbar, click the right mouse button. ...
fb8e74cbf94b19d363eeff4dd2cae3f7a8e29252650db394ad5c1022997fe490
MATLAB
2,250
74
function [rej] = read_eep_rej(fn); % READ_EEP_REJ reads rejection marks from an EEProbe *.rej file % % This function returns a Nx2 matrix with the begin and end latency % of N rejection marks. The latency is in miliseconds. % % rej = read_eep_rej(filename) % % An EEProbe rejection file is formatted like % 0.0000-0.3...
77565a8bae839d86de86cabb19e513c22e60ed09c46c47937e4ae225411f3c9f
MATLAB
2,251
48
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',... ...
2fadf3b2d0c4072ad2e3903547db9627a89f8f803e33366ef9d2ee2705f2ca2e
MATLAB
2,252
60
function vars = PLOT_DesaccadedTraces(vars) %% load data loadAnalysisInfo_APP; %% Setup A = figure('units','normalized','outerposition',[0 0 1 1]); desacPLot = tight_subplot(3,1,[.025 .025],[.025 .025],[.015 .01]); %% Magnet Channel 1 axes(desacPLot(1)); title('Magnet Channel-1, Unscaled'); hold on; plot(mag1.time,...
bc4b6d82942e777b82e9e4b4f60e0026d4cd5f9210beab740fe28620b8f86b36
MATLAB
2,253
71
%% 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(filenames) for q = 1:length(radii) for r = 1:length(SNRs) ...
2280f2ffaaaba40a1c90611bf85fa6be6a896d1c864b165ee400b52aac0fe4bc
MATLAB
2,256
113
% cgsolve.m % % Solve a symmetric positive definite system Ax = b via conjugate gradients. % % Usage: [x, res, iter] = cgsolve(A, b, tol, maxiter, verbose, x0) % % A - Either an NxN matrix, or a function handle. % % b - N vector % % tol - Desired precision. Algorithm terminates when % norm(Ax-b)/norm(b) < tol . % ...
c7e686e863dd15f11178ca1afd140a7fce873149181398ea7a048f69e117aa72
MATLAB
2,256
76
% plots error bar in one out of a few colors, with a line in the middle and % shade around it. %The inputs: function tess_errorbar(Xdata,Ydata,Error,Color) % Color - 1=black, 2=gray, 3=red, 4=green, 5=blue % Xdata, Ydata, Error must have the same length N % For each point (Xdata(i),Ydata(i),Error(i)), wher...
ff3098a11ef71f2610b8730868226890e7de97bd814c5c4765870bedffa16370
MATLAB
2,256
49
function [selectedVoxels, rNC, ve] = selectVoxels(noiseceilingRun, paramsROI, nc_thresh, ve_thresh, roiOrder, combROIs) % Get nr subjects and rois [nrSubjects, nrROIs] = size(noiseceilingRun); % Preallocate space selectedVoxels = cell(nrSubjects,nrROIs); rNC = selectedVoxels; ve = selectedVoxels; % Loop over subje...
3ccfcd55d826169a4b04a0274e58f56868fc27df40ae027678a83c3ce5e20dd9
MATLAB
2,261
104
function [ynn_t,nn_stat,nn_dyn,Xi,Ai] = TrainNLDNLS(Imat_t,dsr_t,nh,no,tn) maxiter = 10; int_mat_1 = zeros(nh,tn); check1 = Inf; x_in = Imat_t; net_s = feedforwardnet(nh,'trainlm'); net_s.layers{1}.transferFcn = 'logsig'; net_s.layers{2}.transferFcn = 'purelin'; net_s.trainParam.max_fail = 2000; % ...
5443869aef5f5c0d7003c9261041805956fa8adad5db5612f14b45f3419b1d8e
MATLAB
2,261
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...
54c68b2fb4110dc4f7db3e0a82affd28a33ff8d5ed4677a443d8f516681e0631
MATLAB
2,262
58
function TestPCAOutput = computekNNClassificationPerformance(ftestPCA_all, TestPCALabels, sizeTest, distMatrix, stepPrint, numCoresKnn, param) %start_pool(numCoresKnn); %modo parallelo per knn (k = 1) classification %leave-one-out %we use knn_neighbors + 1 because otherwise it would find the same vector %in this way ...
67509f2d6dc5f4a3ffab584d14b945f61bc835451d898513c447909f8a331585
MATLAB
2,262
53
clear all; close all; restoredefaultpath; scriptsDir = 'C:\InterpolationAfterDREDge\'; %Change to the directory where repository is addpath(genpath([scriptsDir 'Scripts/AP/'])); addpath(genpath('Kilosort-2.5/'));%Change to the directory where Kilosort2.5 is %% Requirements %basePath folder should contain .dat file nam...
aa1477ed88abe7f38f7c6fb0e5f92e31a004f2678be847a4f9e0888aa5450141
MATLAB
2,262
62
function [sti_tracks,TAPonly_tracks,LEDonly_tracks]=get_tracks_with_sti(Tracks,time_before,time_after) % extract tracks that around a tap/LED sti sti_tracks=struct([]); TAPonly_tracks=struct([]); LEDonly_tracks=struct([]); fps=14; n_track=length(Tracks); LED_on_duration=56; hold_before_tap=28; LED_after_tap=LED_on_dur...
e3d3537d8ca2ef1cb2e9436b0c8e583f2ebb1fc62371d0b2f1be8f7d99b64b39
MATLAB
2,262
60
% mglScreenCoordinates.m % % $Id$ % usage: mglScreenCoordinates() % by: justin gardner % date: 05/27/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Set coordinate frame so that it is in pixels % with 0,0 in the top left hand corrner % fu...
00e462c2a3d6256a4519c7b8119e2fa7e0a5f4d74b41407637291e9ccac34a96
MATLAB
2,263
72
%{ 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...
562d621b45ddf651c826923b322bc99ef4c9fe1f71cf59ef8529432da04c6bb2
MATLAB
2,263
73
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; ...
d67b70097d391830e0af193a1add884aa911c7f040c5fe6a79d04b1bc6cbe9e7
MATLAB
2,263
75
%# -*- texinfo -*- %# @deftypefn {Function File} {} gampdf (@var{x}, @var{a}, @var{b}) %# For each element of @var{x}, return the probability density function %# (PDF) at @var{x} of the Gamma distribution with parameters @var{a} %# and @var{b}. %# @seealso{gamma, gammaln, gammainc, gamcdf, gaminv, gamrnd} %# @end def...
bd6fbce325ea8ce2693f685c88be8bac834558b9e57eefb221f2f683361ecaf8
MATLAB
2,265
65
% mglMetalFullscreen.m % % usage: results = mglMetalFullscreen(isFullscreen, socketInfo) % by: Benjamin Heasly % date: 27 April 2022 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Function to toggle the mglMetal app between windowed and % fullscreen. % % usag...
d67b413e7514357ae81e5727271469e533ab549f6ada44684fbb81a8e8b2fd5b
MATLAB
2,265
67
% mglQuad.m % % $Id$ % usage: results = mglQuad( vX, vY, rgbColor, [antiAliasFlag] ); % by: justin gardner % date: 09/28/2021 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Function to draw a quad in an mglMetal screen opened with mglOpen % vX: 4 row by N column matr...
0b0d43cb856d93183ecd4923bec890bece913301ebf984c71a5201733c6a394b
MATLAB
2,266
71
%{ 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...
9f354e1095500b05e4b40fb2c7c969f0cb44f832965f2537da7af70affeda004
MATLAB
2,266
64
function [m_Spectrum, v_Time, v_Freq] = f_PixelScale(... pm_Spectrum,pv_Time,pv_Freq) str_PreUnits = get(gca,'units'); set(gca,'units','pixels') v_Axepos = get(gca,'position'); v_Axepos = round(v_Axepos([3,4])); set(gca,'units',str_Pr...
001072fb7ea6a09fc2f71cfe52d611257d2c0ef8388d390326ef55928d7663e7
MATLAB
2,268
69
% VL_ALLDIST2 Pairwise distances % D = VL_ALLDIST2(X,Y) returns the pairwise distance matrix D of the % columns of S1 and S2, yielding % % D(i,j) = sum (X(:,i) - Y(:,j)).^2 % % VL_ALLDIST2(X) returns the pairwise distance matrix fo the columns of % S, yielding % % D(i,j) = sum (X(:,i) - X(:,j)).^2 % % VL_AL...
34cb3d6215c63160c9daa02e63e83bbb20dba446ff7087f3a72f471501cf37cd
MATLAB
2,268
86
function varargout = dtype(varargin) % Format % For getting the value % dat = dtype(obj) % % For setting the value % obj = dtype(obj,dat) % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: dtype.m 8776 2013-11-14 09:04:48Z robo...
1a994907fd94213e7892f65cc0664c1c37570f0617399fafd894a8bbd26581c6
MATLAB
2,269
77
function data = read_asa_msr(fn); % READ_ASA_MSR reads EEG or MEG data from an ASA data file % converting the units to uV or fT % Copyright (C) 2002, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation and details. % % FieldTrip is free softwar...
4b5b16da71fbedfd4090f07a7ea8d90b606370a97c92ae61f8d253d4f4d889f2
MATLAB
2,270
65
% % 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...
2a49a2c0bc0e7d8bac7a42935c03f06319ae66ec7b74c03d4e723e5e3a616f23
MATLAB
2,271
83
function imsegs = APPgetSpStats(imsegs) % imsegs = APPgetSpStats(imsegs) % Gets basic information about the superpixels % % Copyright(C) Derek Hoiem, Carnegie Mellon University, 2005 % Current Version: 1.0 09/30/2005 for ii = 1:length(imsegs) nseg = imsegs(ii).nseg; segimage = double( imsegs(ii)....
b4fddc48d711da86b811de50493d6109751a8a4d834c6ad0598cdb6394d42e14
MATLAB
2,271
95
function output_info=cnn_layer_dagnn_wrapper_forward(input_info, layer, work_info_batch) run_trn=work_info_batch.ref.run_trn; group_info=get_current_work_group_idx(work_info_batch); net=group_info.dag_net; if input_info.is_group_data input_var_names=layer.input_var_names; input_num=length(input_var_nam...
6bdd5350d303ec3f38e8894308776188710fa482caf714851b88d5992ba29e21
MATLAB
2,272
91
function ciu = fcn_consensus_communities(ci,niter,vis) %FCN_CONSENSUS_COMMUNITIES generate consensus communities % % ciu = fcn_consensus_communities(ci,niter,vis) takes as input a [node x % partition] ensemble, ci, and returns an estimate of consensus % communities. The algorithm calculates the coassignment mat...
c7d56de3c35e040858537a257c5ced2b8af249726e59b04b6945d07505b55b65
MATLAB
2,273
71
%% Start the main pipeline filenames = {'blood_vessel_10Hz_part11','blood_vessel_10Hz_part12','blood_vessel_10Hz_part21','blood_vessel_10Hz_part22'}; radii = [3:7]; SNRs = [7:4:23]; CV_times = zeros(length(filenames),length(radii),length(SNRs)); for p = 1:length(filenames) for q = 1:length(radii) for r = 1...
f5878b8a94421dbe83f51d756b6f8e89d1ab350aaad9f272b6236e5092db9aa5
MATLAB
2,275
86
function varargout = dtype(varargin) % Format % For getting the value % dat = dtype(obj) % % For setting the value % obj = dtype(obj,dat) % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: privatedtype.m 8776 2013-11-14 09:04:4...
e656ed3db60a22018143720a2698d00bc6b1bd7d6c4c5f0dfa58ec58fb9408f7
MATLAB
2,276
65
%% how many points are within d and how many within d+d? load('intersects'); d = 12; %% neighbours = zeros(size(intersects,1),5); for iSynapse= 1:size(intersects,1); startClose = intersects(iSynapse,2)-d; endClose = intersects(iSynapse,2)+d; startFar = intersects(iSynapse,2)-2*d; endFar...
49dd41d98fda9daa5a2b31bae8579212cc9c392d546d68517dac48ca952f1939
MATLAB
2,277
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...
07991f2b549c476af579c2bdfbe4c4f7e7cef41bc1f9cddd46c2f33ca664e854
MATLAB
2,278
92
% % Plot a signed time histogram. % % PARAMETERS % $network % % INPUT FILES % uni/out.$network % uni/meta.$network % % OUTPUT FILES % plot/time_histogram_signed.[a].$network.eps % bins = 90; font_size = 22; color_pos = [0 1 0]; color_neg = [1 0 0]; consts = konect_consts(); [negative, interval_scale] = konec...
92b7af1cf15d1f55fdfcb28415d63014ffeb745f91dd635eadd167af7ef5fc90
MATLAB
2,279
63
% 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 ...
dfaa2c31ff41d24ef2e35c7516003b92610cd0c2c8360e23a2e08e5ed4c9ebae
MATLAB
2,279
68
function spm_normalise_disp(matname,VF) % Display results of spatial normalisation % FORMAT spm_normalise_disp(matname) % matname - name of sn3d.mat file %_______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % John Ashburner % $Id: spm_norm...
1546efa0cde538d00785e7229b1b7c655a196815fb19175708263c0a393bf4d9
MATLAB
2,280
80
function plot_singleFileSanityCheck(recData, z, segInfo, segment_ssfr, p, cycleMat_ss, cycleMean_ss) figure('Position', [1 41 1920 1083]); overviewPlot = tight_subplot(3,3,[.05 .01],[.03 .03],[.01 .01]); axes(overviewPlot(1)); plot(z.segTime_ssfr, segment_ssfr); xlim([0 10]); yticks([]); title('Cont. Firing Rate: Se...
594088e08d40699b3077a34945fc06f7fd1f004546ef48964f9151fb1f228401
MATLAB
2,280
79
% % Make the X axis labels by correct for year numbers. % % DEPRECATED -- use time_xaxis_unix.m % % PARAMETERS % t_min, t_max Minimum and maximum values to be plotted, in % year numbers % function time_xaxis(t_min, t_max) NUM = 7; % Maximum number of ticks to show on the date axis (X axis) months = {'Jan', 'Fe...
46bff30673e977b4f93f9648e7c800baea969c064e91ddc28d678285e399b099
MATLAB
2,282
101
%% Prep & params clear;clc;close all thresh = .0078; window = [20 40]; % 114 file = 'Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Exp-GCamp-115-07182018-OKR only\Exp-GCamp-114-07182018-OKR only3.smr'; startT = 160; endT = 560; % 115 %file = 'Z:\1_Maxwell_Gagnon\ProjectData_Amin\Boris Recordings\Exp-GCamp-1...
50bae67fe9424fda78981f12ea3a6e335d050fcc148a9f09d213e7f54291cbb0
MATLAB
2,282
64
%% This is a script m-file that will be run each time Matlab is started, %% provided that this file is in the Matlab search path (see PATH %% command). % If there appears any graphical anomalities when running AEDES, try to % some of the following OpenGL workarounds. If you experience some of the % symptoms descriped ...
fb7aded7fea861b261e214f8cd372105a51810be09bff139ccbed127232dbf3d
MATLAB
2,282
68
function [decon_smoothed_r_matrix]=get_nonevent_partialcorr(combined_info,ds_events,d) %% LOAD cur_onsets=ds_events(d).onsets; decon = combined_info.deconv; %%get forward, reverse, left, right velocity velocity = combined_info.velocity; [roll_pos,roll_neg, pitch_pos, pitch_neg, yaw_pos, yaw_neg] = separate_velocity...