sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a5831ec3963e9b3ea926a1384f48a47528cb20d6dc8dc1b022194964d3ae0b53
MATLAB
2,709
63
function st_prfResponse = getPRFStimResponse(stim, linearPRFFilters, params) % Function to generate neural pRF time course for given pRF and stimulus. % % INPUTs: % stim : (double/logical matrix) % stimulus xy (pixels) by time (ms) by run % linearPRFFilters : (double vector/matrix) li...
e9b50805c4e38a4d76e719cbb7e380a12d1e6ee1c3540ec3e82c3927fbd82eb0
MATLAB
2,709
85
%% function all_figures_and_stats(git_directory, read_from_excel) % generates all figures and stats % % parameters: % git_directory (str): e.g. '/path/to/git_dir/grid_memory' % read_from_excel (bool): false (read .mat files, recommended) % true (read .xlsx files, not recommended) % % Mackay ...
167e89ce97308f62ff60d1cf18e3dc475a47fba8eefa69cd8e9003e4de0e8ef9
MATLAB
2,711
74
classdef MLArenaSquare < MLArena properties length_cm; end % properties methods function obj = MLArenaSquare(referencePointsVideo, length_cm) % Validate the inputs if ~all(size(referencePointsVideo) == [2, 4]) error('Must referencePointsV...
8e5a75a8015b9a8953af0aca0bacb60d0ce763f075dc4e8d18d1accc7d17f937
MATLAB
2,711
87
classdef MLBehaviourInterface < handle %MLBehaviourInterface Interface class for animal behaviour % An interface class for the fundamental animal behaviour methods (Abstract) % Returns the common length of the arrays getArrayLength(obj) % Returns the x coordinate of t...
dfc4c422168d98b8b996907155150d91ae37a2914402efba36983c25b656df47
MATLAB
2,711
40
% expand_unitsTableEM [RR, CC]= size(unitsTable); Titles = unitsTable(1,:); unitsTable(1,CC+1) = {'alloDiff.L_modep'}; unitsTable(2:RR,CC+1) = num2cell(cell2mat(unitsTable(2:RR,find(strcmp(Titles,'allo.L_modep'))))... - cell2mat(unitsTable(2:RR,find(strcmp(Titles,'theta.L_modep'))))); unitsTable(1,CC+2) = {...
7274fbebe18dd1949f2cd2315a36dd98e344d37f8e396d89a3827b2aae037661
MATLAB
2,715
122
function cMon=aedes_getcurrentmonitor(hFig) % AEDES_GETCURRENTMONITOR - Returns the monitor, where the pointer % currently resides % % % Synopsis: % CurrentMonitor=aedes_getcurrentmonitor(hFig); % % Description: % If called without input arguments, returns the index for the ...
c7db8ac9e99492c6ef65bd24b7764b7d2783c4f9aedc2ded31e9015032ba915a
MATLAB
2,715
119
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_pasca...
5ea2ff59f79293040631b0ac7f347dd850817558b0e88c9d08e9589fde03b2fc
MATLAB
2,716
57
clear; close all; maindir = fileparts(convert("fullpath")); warning off all %subs = [10317, 10369, 10402, 10418, 10462, 10478, 10486, 10529, 10541, ... % 10572, 10581, 10584, 10585, 10589, 10590, 10596, 10603, 10606, 10608, 10617, ... % 10636, 10638, 10640, 10641, 10642, 10644, 10647, 10649, 10652, 10656, ...
1d005301e8ad2f7f3526ffd7e76cc25764efa4e1a0f23734bbacc6921129867a
MATLAB
2,718
58
function mlgp_compute_placemaps_inclusion(obj, session) sessionName = session.getName(); sessionAnalysisFolder = session.getAnalysisDirectory(); % Load the map dataset placemapData = load(fullfile(sessionAnalysisFolder, sprintf('%s_placemaps.mat', sessionName))); % Create the basic structure i...
a62daa5e4a1d16c0b9519b7ec80016b49f8345f86b18a528d533234623eae785
MATLAB
2,719
61
function [fluor_deflectFree, opt] = deflectionRemoval_UFARSA(opt, fluor) % [fluor_deflectFree, opt] = deflectionRemoval_UFARSA(opt, fluor) % % Removing the large positive impulses and large short-lasting deflections % from fluorescence trace. Currently this function should only be applied to % drift-free t...
e17f8e0b0a61ffbee5d089b897a7d67709bbda23b837147e28f65c7faf135d71
MATLAB
2,720
77
function mlgp_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, ....
c66668fe89093cba075222e87f36403df2ae3206ed0cabaf23358ab49180bf52
MATLAB
2,721
85
function dspec = addCovariate(dspec, covLabel, desc, stimHandle, basisStruct, offset, cond, plotOpts) % Add a covariate to the design specification object. % dspec = addCovariate(dspec, covLabel, desc, stimHandle, basisStruct, offset, cond, plotOpts); % % Input % dspec: struct - design specification object (see initD...
3e3efe86c101290e4aae07a14a452fd56cc9faef2e720de5da5d7777b4d49d7d
MATLAB
2,724
95
function PlotFeatureComparison(fd,cd,ftrx,ctrx,f2c,fn,varargin) [haxcurr,plottype,limprctile,nbins,domatch] = myparse(varargin,'hax',nan,'plottype','hist',... 'limprctile',1,'nbins',100,'domatch',true); fnflies = numel(ftrx); cnflies = numel(ctrx); if ~ishandle(haxcurr), hfig = figure; haxcurr = gca; ...
d1fccea6e7ab1d824c3f6866f12d254ccea462ef0eeecf0fe88ebb3b77a3b4b1
MATLAB
2,724
70
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
a68b4c0d7ecc22c1948625774cf1f6fee0ab8206296497cc911dc832b5e56b50
MATLAB
2,725
70
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
731354651dd5d7beecb98d94ed08eb6203673fe2261303742618492cb1db636c
MATLAB
2,727
48
function [DATA,MARKER,info] = fromH5DFtoDATAandMARKER(str_h5_filename,str_save_append) %% Function to convert data from an HDF5 file into DATA and MARKER arrays %% author: Stefano Diomedi %% date: 21/02/2024 % %% Inputs: % - str_h5_filename: string containing the name of the HDF5 file %% Outputs: % - DATA: ...
1379d1815ce406bc9d54f6b0de322d0a92dfc4af35d668dcbe3a2eb77e3caf50
MATLAB
2,729
68
classdef MLCaiTrialResult < handle properties (SetAccess = private) trialResultsFolder = []; neuronFilename; scopeFilename; behavFilename; behavTrackVidFilename; behavTrackVid; neuronData; scopeVideoData; behavVideoData; end ...
c4f729ed8554ced3ff121e1c6af42fe1271804a69f5c482c366f89ca66d9bbea
MATLAB
2,730
121
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_nyud(...
fd90b3c133b11c3989bdcd488f4a5d4f10a011a0aa676daef40b32d759705a6e
MATLAB
2,732
67
function [] = plot_worm_frame(I, center_lines, centerline_color, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % % % % % % [] = plot_worm_frame(I, center_lines, centerline_color, UncertainTips, centerline_stimulus, debugimage,in_track_index,current_ellipse_ratio) % IWFig = findobj('Tag', [...
74b78f09f208d290712ac1ce9bae9e3cda2e67b93dff9f2d67bf83108c39d2ee
MATLAB
2,733
108
function smooth_data_out = aedes_fmri_smooth(data,fwhm_sz,voxsize,out_file) if nargin==4 writeSmoothedData = true; else writeSmoothedData = false; end if nargin<3 || isempty(voxsize) fwhmInPixels = true; else fwhmInPixels = false; end % Check if data is an Aedes structure if isstruct(data) data = data.FTDA...
b75e3e8176d8d21e5ac1e78d2c5b04e273a6c587fab5833e479f4f0914eb8ea3
MATLAB
2,733
63
function [DATA, MARKER, info] = checkingTrials(DATA, MARKER, info, wanted_n_trials,str_save_append) %% Function to check and modify the number of trials for each condition %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % - DATA: cell array containing spike train data % - MARKER: cell a...
b9a5e1b8e6cc38d5921c24075fd7a23ad91966721b0089307960b01f72ea072f
MATLAB
2,734
84
function V = spm_write_vol(V,Y) % Write an image volume to disk, setting scales and offsets as appropriate % FORMAT V = spm_write_vol(V,Y) % V (input) - a structure containing image volume information (see spm_vol) % Y - a one, two or three dimensional matrix containing the image voxels % V (output) - data st...
3f68e2497276d70ff3b23ddc5cd509077cf3d5869f933c237b483b4f6dfd641d
MATLAB
2,735
74
function BC=betweenness_wei(G) %BETWEENNESS_WEI Node betweenness centrality % % BC = betweenness_wei(W); % % Node betweenness centrality is the fraction of all shortest paths in % the network that contain a given node. Nodes with high values of % betweenness centrality participate in a large number of shor...
702a7b03fee6d21faa6821d34be02170fd283f00c904b94fbbc7f757d06757d7
MATLAB
2,735
85
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This part makes the Excel file which is then plotted in part 3. close all clear all clc SPEED_THRESHOLD_CM_PER_S = 2; SPIKE_THRESHOLD = 0; % These ones include m4 which is the PFR LOCAL_INPUT_FOLDER = './local_output'; OUTPUT_FOL...
18e8a93e646e2e1544ce067ffa55443e283c5089e39215aa20ee7806c78e248e
MATLAB
2,736
76
% oneStepIInj.m % % Current Injection Function. Injects square step of current of user % specified amplitude for user specified duration. Repeats until end of % trial with user specified space duration and amplitude between steps. % Returns vector of to feed to output of DAQ (i.e. appropriately scaled to % be read d...
d8ca37b559b3c470e97d33d4397c59ec4d10eeb4c1ddd8b86bf02cd52cd8cf2c
MATLAB
2,736
88
% For in vivo spine data analyzed using MapManager V_20171028 % Author: Richard Roth (rhroth@stanford.edu) % Date: October 2019 % Based on MapManager-Matlab-1.0.1-alpha by Robert Cudmore, 20171016 % Used for NearesNeighbor.m and getmyMapListValuesCondDist_Neighbour.m function [retVal,retValDist] = segmentCall...
aaeac823563a81d0ddbb2b6d9c358d5914b383a56361913a6a3b2a555bf6c1ba
MATLAB
2,739
87
function rez = applyDredge(rez) %% Adapted from Kilosort2.5 function datashift2.m %% by Richard Hardstone (2022_11_30) %% outDir = rez.ops.dredge.outDir; if ~exist(outDir,'dir') mkdir(outDir); end %% if getOr(rez.ops, 'nblocks', 1)==0 rez.iorig = 1:rez.temp.Nbatch; return; end ops = rez.ops; % The min ...
62df67e28e50d9b72aedabb871df459a8b1d3e6351ae95f46e3cfafde363b4ca
MATLAB
2,740
95
close all clear all clc %a = 100; %poly = [0 0; a, 0; a, a; 0, a]; a = [0, 20]; b = [0, 0]; c = [30, 0]; d = [30, 20]; refCanPts = [a(1), b(1), c(1), d(1); a(2), b(2), c(2), d(2)]; poly = refCanPts'; figure plot(poly(:,1), poly(:,2), 'b-*', 'linewidth', 10) hold on plot([poly(1,1), poly(end,1)], [poly(1,2), poly(end...
d45d5920fef4c65e0a6eb2c41c620bed25d6e7c73d596d9470843d7fff0c1fe2
MATLAB
2,741
87
function [A,B,C] = tern2base( name_E, E, wlimits, extra ) %tern2base determines the edge A,B,C coordinates from one ternary coordinate % % Take a name and a matrix of coordinates for that name, and obtains % A,B,C at the base of the axis and the other side. Wsum is needed to % compute units, if not given it is as...
880780958c12696cf42e19b3c888bc92849534bf362f9df59fabc33711710fa4
MATLAB
2,743
82
function dispstat(TXT,varargin) % Prints overwritable message to the command line. If you dont want to keep % this message, call dispstat function with option 'keepthis'. If you want to % keep the previous message, use option 'keepprev'. First argument must be % the message. % IMPORTANT! In the firt call, option 'init'...
ebd0a80e3d0366bc26958d2f634ab77e540181c4b42ba6cec7c61fa88cef395c
MATLAB
2,743
74
function handles = SetSeq(handles,seqi,isfirstframe) % set the GUI state for displaying a particular sequence index % splintered from fixerrorsgui 6/23/12 JAB handles.seqi = seqi; handles.seq = handles.seqs(seqi); handles.f = handles.seq.frames(1); handles.nselect = 0; handles.selected = []; set(handles.errnumbertext,...
c012f8d172ce7abb76c40cb4c2f784d2ae7ee8c0abc4694bb67cb53b15cfa496
MATLAB
2,745
82
% readPostsynConnFromCSV.m % % Function that reads in connectivity from folder of CSV files, where each % CSV file is a neuron's postsynaptic targets (ID and number of synapses % it receives). Each CSV file is named the ID of the presynaptic neuron. % Returns the connectivity of all the neurons in the CSV file as a s...
eb947333af268f5fed916091f576cdbf60e61a107d9ad605a50e5b256d41366e
MATLAB
2,745
89
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This code makes Figure S9A (but used Excel + R for paper). close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = './local_output'; OUTPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.FIGURE_OUTPUT_FOLDER; if ~ex...
2bda6739f12767675866af39a83a842b2cdcfdcb0d807e812db65ed0cfb38e2f
MATLAB
2,746
82
% mglClearScreen.m % % $Id$ % usage: results = mglClearScreen([clearColor], [clearBits]) % by: Justin Gardner % date: 09/27/2021 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Sets the background color and clears the buffer. 'clearBits' % is an optional ...
4fd474a40166e7cb9e2979647f7f749b4e5d8fec2b1aca2570c29c151075e7dc
MATLAB
2,748
91
function [h1, h2, h3] = plot3plane(data, sag_ind, cor_ind, axi_ind, cmin, cmax, lineflag, plotflag) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % plot 3 planes of the 3D dataset % lineflag: 0: no line, 1: with lines to mark the slice locations % plotflag: 1: use im...
90325691d00ca018d170f7c2bcdd27d2b36aa2f99e8b1e367472dadf4a4b477a
MATLAB
2,748
70
function [PN,PNstar,gamma0,mv] = get_prevalence(V,V_rnd,alpha,perms,StatNtest) % gets the measured and permuted observations and returns the prevalence % statistics. % % [PN,PNSTAR,GAMMA0,MV] = GET_PREVALENCE(V,V_RND,ALPHA,PERMS,STATNTEST) % gets the measured observations V, the permuted observations V_RND, % si...
3be4b356093d57e8269beb20096631ff714197dc6966d8a02b8a18e84d5d6a2d
MATLAB
2,750
82
% readPresynConnFromCSV.m % % Function that reads in connectivity from folder of CSV files, where each % CSV file is a neuron's presynaptic inputs (ID and number of synapses % it receives). Each CSV file is named the ID of the postsynaptic neuron. % Returns the connectivity of all the neurons in the CSV file as a set...
afa9dad20196025ad8bf5ff225ceeba76d1afc12fad28a47075af7ff2a0e8fe4
MATLAB
2,750
64
% replacement of PET clear; clc; close all; initime = clock; addpath('../funcs'); % get the change of PET in parameter space Delta_e_start = 0.3; % cannot equal to 0 Delta_e_end = 0.3; % can equal to 0.5 Delta_i_start = 0.027; % cannot equal to 0 Delta_i_end = 0.032; % can equal to 0.5 Delta_steps = 200; Iattn = 0.0...
c3e95889482ea160f4f4649e3abe37079b69ef4016a77b6cd80ddf13cda2a95e
MATLAB
2,751
76
function [E,O,inds,segs] = edgesDetect( I, model ) % Detect edges in image. % % For an introductory tutorial please see edgesDemo.m. % % The following model params may be altered prior to detecting edges: % prm = stride, sharpen, multiscale, nTreesEval, nThreads, nms % Simply alter model.opts.prm. For example, set mod...
04d7ed953510b4861bc17dd47b51a38d804d58cb8fdf410f2711076a63afbe45
MATLAB
2,753
64
% mglMetalStartBatch: start queueing up Metal commands to process later. % % usage: batchInfo = mglMetalStartBatch() % by: ben heasly % date: 01/12/2024 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Put the Mgl Metal app into its batch "building" state. % ...
15d83940787cef38c6969d57c6a13f41c79d33611c1adda2ae75ff158ef35806
MATLAB
2,753
65
function [d,eegICAprunned]=preProcessingPipeLine2(eegData,epoc_length,chanlocs) % eegData=forgedEEG; %% EEGLAB ON 'Data' VARAIABLE, IMPORT IT AS MATLAB ARRAY IN EEGLAB %% YOU NEED TO SETUP EEGLAB SOFTWare FROM https://sccn.ucsd.edu/eeglab/index.php %addpath('.\eeglab2021.1'); %% PLEASE CHANGE THE PA...
cc3b3b5a29cfd220eec76ae7139a9e6be44085e30536753051e0e5eabd6acf2d
MATLAB
2,753
93
function [V,Tri]=SpiralSampleSphere(N,vis) % Produce an approximately uniform sampling of a unit sphere using a spiral % method [1]. According to this approach particle (i.e., sample) longitudes % are proportional to particle rank (1 to N) and latitudes are assigned to % ensure uniform sampling density. % % INPUT: %...
45813738a9c7a770007c91aff55a0b2140f6c6c9e8d637fd56b08c0b67a4759b
MATLAB
2,754
83
function JSDs = gretna_JSDs(Data, varargin) % %========================================================================== % This function is used to calculate the Jensen¨CShannon (JS) distance based % similarity among all pairs of probability distribution functions in the % Data. The JS distance is the square root of t...
7b0a951a993b69db6a22f2e928ed2412a498583fa3ee86ea46d8b5ccaa82685c
MATLAB
2,754
90
function [bfoUsingCorrelations] = ml_core_compute_bfo_90(placemaps, bfoType) maxId = size(placemaps,1); numTrials = size(placemaps,2); perCell = struct('v_all', [], 'vind_all', []); for gid = 1:maxId perCell(gid).v_all = []; perCell(gid).vind_all = []; for iTrial1 = 1:numTrial...
1b7fb368d6297291f15cacaea69c59036f0f5cde83f7b99f55a726798cb4a367
MATLAB
2,755
69
function [hdr] = read_nex_header(filename) % READ_NEX_HEADER for Plexon *.nex file % % Use as % [hdr] = read_nex_header(filename) % % See also RAD_NEX_DATA, READ_NEX_EVENT % Copyright (C) 2007, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation ...
d9b7e4210b45a3bfd08055b6f53430d074fd62bcc70520a5dc5c74cacf9bb2e9
MATLAB
2,758
71
function [f F]=motif4funct_bin(W) %MOTIF4FUNCT_BIN Frequency of functional class-4 motifs % % [f F] = motif4funct_bin(W); % % Functional motifs are subsets of connection patterns embedded within % anatomical motifs. Motif frequency is the frequency of occurrence of % motifs around a node. % % Input: ...
e18db517548149124d5de4ae9ad99344c6e3ba7a2ddfa7cefcd2f437bdd11dea
MATLAB
2,760
63
function [Iseg labels map gaps E] = vl_quickseg(I, ratio, kernelsize, maxdist) % VL_QUICKSEG Produce a quickshift segmentation of a grayscale or color image % [ISEG LABELS MAPS GAPS E] = VL_QUICKSEG(I, RATIO, KERNELSIZE, MAXDIST) % % Produces a Quickshift segmentation of an image. See VL_QUICKSHIFT for more % details...
590557340da62783b65e307518533c083cd231cbd7a4a303a48bfab1da2d7f93
MATLAB
2,762
94
% needed for video test mglOpen(); mglScreenCoordinates(); mglClearScreen([0.5 0.5 0.5]); % open the link % calls mglPrivateEyelinkOpen, default ip is '100.1.1.1', default conntype is 0 try retval = mglEyelinkOpen('100.1.1.1', 0); catch err = lasterror fprintf(2,'Defaulting to simulation mode.'); retval = mgl...
b81290ff88c3472d5b533888ef484baa89f107d5b1f68982f12d20ea869e5d45
MATLAB
2,762
58
% Licenses for the files included in the correlation toolbox %% Correlation toolbox - GNU General Public License % Corr_toolbox is a matlab toolbox intended for the visualization and robust % correlation analysis of any sets of data. This program is a collaborative % work between Dr Cyril Pernet (University of Edin...
2aea21b6c40d05412965a01725ad6e98e3a948f6d6ebaecc3b9de18ff988035e
MATLAB
2,763
89
function make_motif34lib %MAKE_MOTIF34LIB Auxiliary motif library function % % make_motif34lib; % % This function generates the motif34lib.mat library required for all % other motif computations. % % % Mika Rubinov, UNSW, 2007-2010 [M3 M3n ID3 N3]=motif3generate; [M4 M4n ID4 N4]=motif4generate; save mo...
690f523e4cbfb560e85d4eacda4f4632f5032282852cd3bab35c87d9e7d390f9
MATLAB
2,763
91
function [neuronmasks,times] = piece_neurons_consume(neuronmasks,avgA,thresh_mask,thresh_consume,times) % Combine masks with large IOU or consume. % thresh_IOU=0.5; % thresh_consume=0.8; % thresh_consume should be larger than 2*thresh_IOU/(1+thresh_IOU) to avoid % two masks consuming each other. % [Lx,Ly,n] = siz...
a8e78d61b127505973bcdd64bc1709091bfcd3b55f410b347c42876d9db657f1
MATLAB
2,764
86
function [stim,keepPixels] = getSTStimulus(params,stimulusNumber,stimFile) %% Function to get spatiotemporal stimulus images and parameters % % [stim,keepPixels] = getSTStimulus(params,stimulusNumber) % % Grabs stimulus and params for each stimulus file % % INPUT: % params.stim.images_unconvolved : Aperture images...
eb6d7f989b58ceb54decb8e991f44d77c1a11a7a665641ca622f4e449e6251ba
MATLAB
2,765
70
% mglMetalRepeatingDots.m % % $Id$ % usage: [ackTime, drawTimes, frameTimes] = mglMetalRepeatingDots(nFrames, nDots, randomSeed) % by: Benjamin heasly % date: 06/17/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Send one command that causes multip...
522597bced52bd8270b2b7f60f61314482ca8dd2c48c99ce3f76d59f8b4e4b9a
MATLAB
2,767
63
function lfp_time_domain = fillSurveyParametersMontage( obj, data, fname, obj_file ) % Extract and visualize LFPs from Survey test mode % % Syntax: % FILLSURVEYPARAMETERS( obj, data, fname, obj_file ) % % Input parameters: % obj % data % fname % obj_file % % Example: % FILLSURV...
87b33a487943852358c97b46f2108b6733e7912fd929f9f5318fdebf625c12a5
MATLAB
2,767
65
% expand_unitsTableEM % add columns with diffs right - left [RR, CC]= size(unitsTable); Titles = unitsTable(1,:); % unitsTable(1,CC+1) = {'RLDiff.L_modep'}; % unitsTable(2:RR,CC+1) = num2cell(cell2mat(unitsTable(2:RR,find(strcmp(Titles,'theta.R_modep'))))... % - cell2mat(unitsTable(2:RR,find(strcmp(Titles...
bdbc75bc6c2db7f7cd9606d579f12cb53979955e3d6ec749cef4ee7b9de5bba2
MATLAB
2,767
56
% extract statistical texture histogram using integral histogram(texture and lbp features) function [featArr_c, featArr_s] = sp_texture_grid_cs(chns, grid_x, grid_y, patch_size, surrWidth) [imh, imw, ~] = size(chns.imtext); % [featArr.texture, ~] = calcMeanandVariance(chns.imtext, grid_x, grid_y, [patch_size, patch_...
6c283a0fdcb9b561e193cd89781b00f97f1a83fdc74fdc52dab56c0b9884922a
MATLAB
2,769
81
function [cfgs] = exhaustOrientation(probe) %EXHAUSTORIENTATION Exhaustively analyze all possible module orientations % Takes in a probe and exhaustively changes each module orientation. Does % this for all possible combinations of modules. The number of possible % configurations is A^B, where A is the number of ...
8f84270234773b4cc9500e9bcb9ecf2493f6a01c2dfdbf1c0617fea52137b778
MATLAB
2,769
102
function [ ] = MYsavenii( data, outputdir, name, varargin ) % Usage: MYsavenii( data, outputdir, name, [refnii] (full path, optional) ) % Saves your matrix in the outputdir with the specified name. Use a nifti % in the same space to get correct rotations and spatial parameters. The % varargin can also be a vox...
a186f3e5d778052ea40e01c9d2f3689623f52334f82607a8284e1cfe7fccdb47
MATLAB
2,769
60
function subject_power_2014_FD_only_parse_v2_0_to_1(movement_files,skip_seconds,epi_TR,expected_contiguous_frame_count) % FD parsing Nipype wrapper pulling in list of motion files % Modified to read DVAR_pre_reg, DVAR_post_reg, and DVAR_post_all and store % values appropriately in the 51x51x3 cell array of structs % % ...
ef678affc2d5aa384678b880f82ba3c92a640c6b89ebe4635218d6a284b08ee0
MATLAB
2,770
73
clear cd .. load('binned_site_info.mat') load('stable') binned_data=[];binned_labels.stimulus_ID=[]; for i=1:549 Hit=population.goHit.eachDF{i}(46:90,:)'; Miss=population.goMiss.eachDF{i}(46:90,:)'; CR=population.nogoCR.eachDF{i}(46:90,:)'; FA=population.nogoFA.eachDF{i}(46:90,:...
61c9a969eaabe0b7ebbff5fa390c91e46d7288d561e25a9791decd4aec17deae
MATLAB
2,772
106
% VL_TEST_INIT Intialize unit test file % This is a VLFeat internal function used to initialize an .m file % containing a unit test. % % See also: VL_TEST(), VL_HELP(). % Author:: Andrea Vedaldi % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. % Copyright (C) 2013 Andrea Vedaldi. % All rights reserv...
97fd859377706588999b1989ad764ebc90be52ca0e7c26602bfa439861924e99
MATLAB
2,772
99
function toon_2gray(baseDir, expt, session) % toon_2gray(baseDir, expt, session); % % Step 3 of the workflow for analyzing toonotopy % Transforms the time series from the inplane to volume anatomy and % averages the time series % % Default Input values % baseDir '/biac2/kgs/projects/' % expt '/psych224/...
0392bfc4cf927b0c632c7e701479685d8d6d2937e89ad19a2e960a033f72e874
MATLAB
2,773
98
% % 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...
e048569d767ba282539a3a76fa8c783a5b162456cff049e0b600e3f1d8df7c02
MATLAB
2,775
54
clear file=dir('ACC*reverse*.mat'); k1=1;k2=1; for jj=1:length(file) load(file(jj).name) n=length(outcome);n1=fix(n*0.15); % outcome=outcome(1:n1,:); nogotrial=find(outcome(:,1)==3|outcome(:,1)==4);%Nogo trial,cr/fa nogotrial(find(nogotrial<=1))=[]; previous_trial_ng=outcome(nogotrial-1...
ec8efa79ce70a11d2a19d05ce2ed7e1e54c4f7b35926f72c6949b78bffd84e10
MATLAB
2,776
109
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This makes figure S1, which is the dig matrices. close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER; OUTPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.FIGURE_OUTPUT_...
1cca73df6068e19d56f3e05432f202850979c550ac53ff22d8ef4990d55a8244
MATLAB
2,777
62
function [subject_survival_list, subject_survival, missing_data] = power_motion_survival_plot(group_folder_path,subject_list_file) %Displays a colour map of the number of seconds remaining at various FD thresholds % Inputs: % group_folder_path Full filepath to where your timecourses are located % subject_list_fil...
21cd3301940cce890266b7602dc77e2926cdde0cf5c7514da7761333f0ed5ca8
MATLAB
2,777
101
close all clear all %% create figure 4A_B_C %% janine.thome@zi-mannheim.de %% paths pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% load file = 'Multim_Performance.mat'; load(file) %% plot Balanced Accuracy % create colored fig h1=fi...
644512d9afc842cb62be7bc8afa11cd647eff0a349ed04bdcb3323e93577475c
MATLAB
2,777
67
function output = TDMS_dataToGroupChanStruct_v3(inputStruct,varargin) %TDMS_dataToGroupChanStruct_v3 % % translates objects AND properties to valid field names % % Similar to TDMS_dataToGroupChanStruct_v1, but also translates % properties % % output = TDMS_dataToGroupChanStruct_v3(inputStruct) % % ...
ab0a3061af0e4e4e8009e2c8b057c32a9605007561f48798ec48c12d25102617
MATLAB
2,778
105
% % Compute a network statistic over time on the full data (i.e. not split). % % PARAMETERS % $network The network; must have timestamps % $statistic The statistic % $type The data to use, "full" or "split" % % INPUT % dat/info.$network % dat/data.$network.mat (only full) % dat/split.$network.mat (only split) % dat...
1a6c77791fd5124b5f32362cbde56203b70b9dd49996583a7ace99fee138aa59
MATLAB
2,779
76
function [unit_angles,means,types,ratios,lengths,ds_vect,som_trials,pv_trials] = get_vector_angles_ratio(ds_events,id_list,activity_length) count=0; unit_angles=[]; ratios=[]; means=[]; types=[]; start=0; for d = 1:12 %load(['Z:\Potter et al datasets\' ds_events(d).tag 'activity.mat']) cell_ids=id_list{d};...
fa7dc968f4c66b55abdb32fbf47c54a041c4c9b9f846f2710499f84a18322dbf
MATLAB
2,779
68
function compute_smoothed_behaviour(obj, session, trial) experimentDescriptionFilename = fullfile(obj.RecordingsParentFolder, 'experiment_description.json'); uniform_dt_ms = 10; dmax_cm = 0.25; maxSpeed_cm_s = 30; trialFolder = trial.getAnalysisDirectory(); %scopeFilename = fullfile(trialFolder...
81ce94b4c44e96b823e87dbe85f680450e657a96be01dece8c6085f543c3377e
MATLAB
2,780
87
function [stim,keepPixels] = getSTStimulus(params,stimulusNumber,stimFile) %% Function to get spatiotemporal stimulus images and parameters % % [stim,keepPixels] = getSTStimulus(params,stimulusNumber) % % Grabs stimulus and params for each stimulus file % % INPUT: % params.stim.images_unconvolved : Aperture images...
885a67a750f349e0ff4de7c87ea18e7f0603e7a5b63adf3b5fc51d90b157868d
MATLAB
2,781
88
%Test FfdrGRP function % %AUTHOR: Eric Fields %VERSION DATE: 12 June 2020 global test_xls_output if isempty(test_xls_output) test_xls_output = true; end %Load GRP FMUT_dir = fileparts(fileparts(which('A_setupTest'))); load(fullfile(FMUT_dir, 'testing', 'data', 'Disflu_GroupLevel.GRP'), '-mat'); %De...
e7caf137c7cbdf7eb750c5efa2a7a855cafa66f17bfbce1c7af2b8b50ec443cd
MATLAB
2,782
127
% % Plot and print a cross-method comparison plot. % % PARAMETERS % prec (m*n) Precision values % filename_a, filename_a_bw, filename_b, filename_b_bw, filename_legend, filename_legend_bw % Filename of plots % labels_method_id (m) Names of methods % labels_network_id (n) % label_measure % function comparison_c...
1610f6dc3a38aaff9ad810c1b0cb4d76bb1b986f15dd032f285fb4261d8ba8ec
MATLAB
2,784
66
function output = TDMS_dataToGroupChanStruct_v4(inputStruct,varargin) %TDMS_dataToGroupChanStruct_v4 % % NOTE: This reproduces the data structure for the old lab functionality % of the function getStructTDM % % See Also: TDMS_genvarname2, TDMS_readTDMSFile REPLACE_STR = '_'; PREPEND_STR = 'p_'; P...
f2ca5f30831bc81205a88dbf6f10be365e13b00f1254a8407afaee52c99b7553
MATLAB
2,784
82
function mlgp_create_sfp_celllike_database(obj, session) fprintf('Creating spatial footprint (sfp) celllike database (one sfp per placemap) for session %s\n', session.getName()); % This create an array database that has one sfp classification % per neuron, per trial for one session. numTrials ...
e8911b5b821ca1c62167b5fdb676e259f1d5ab504edcb983b7cd03ebd5a9ea21
MATLAB
2,785
91
function h = nifti(varargin) % Create a NIFTI-1 object % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: nifti.m 8776 2013-11-14 09:04:48Z roboos $ switch nargin case 0, org = niftistruc; hdr = []; for i=1:length...
b1420788da31a631346c6989e78c07f4ab3bcf38fd823c4f9c10a6ee291d2145
MATLAB
2,786
73
%% Clean clearvars close all clc %% Load streamline data atlas = "JHUlabels"; % Selecct white matter atlas atlas_labels=importdata(atlas+"_labels_short.txt"); % import labels of atlas sessions = ["midcycle" "interictal"]; % Load streamlines of all groups for s = 1:length(sessions) [streamlines.(sessions(s)),n_no...
d56c8c421c368967adf741ece482124d1312a38edacfedbda83451ccabcaa8b4
MATLAB
2,786
99
% [pos, neg] = get_clusters(vals, mode) % this is a subfunction of perm_ttest.m, perm_oneway.m and gets cluster infos % from a series of values (t/f,1-D array of either from the true or one of the % false label assignments) % vals shouls already be thresholded, i.e., only contain vals % for which p < clusteralpha, an...
4e6955dd4f516195601763483b2ce4a1b3ee8cf481e263c33504a3c22c3ebbe0
MATLAB
2,787
77
function hdr = read_deymed_ini(filename) % READ_DEYMED_INI reads EEG data from the Deymed Truescan file format % % Use as % hdr = read_deymed_ini(filename) % % See also READ_DEYMED_DAT % Copyright (C) 2013, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the d...
a9ee1b8ba8c7514bd8f4f230a5c219c2882fe874654701fe5b09ce4a67817f46
MATLAB
2,787
73
% % 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...
4766581049fd8464949b3153aa42622d3013fb7e35baaa2f825dab92454191b2
MATLAB
2,788
85
% % 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...
935a94593af8d5fd78fe72f77e558f5d35ee7bc0d8ee48916bfc68c5566452cc
MATLAB
2,788
73
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [output] = get_cell_data_by_name(T, animalName, sessionName, cellName) % Should be a table with one entry for each cells and each trial. eg. % if 2 cells and 12 trials each, table should have 24 rows. output...
6bedd578807c7fd16f8c0243c77781f4276be6115f878bb18a4682765586f601
MATLAB
2,789
74
function heatmaps = getHeatmaps(data, opt) heatmaps = struct(); pois_voronoi = opt.aois.UL.M.face1.voronoi + ... opt.aois.UL.M.face2.voronoi + ... opt.aois.UL.M.face3.voronoi + ... opt.aois.UL.M.face4.voronoi + ... opt.aois.UL.M.face5.voronoi + ... opt.aois.UL.M.face...
9ec469d5bfbeb293476d3f05e7c3b120aefe3cc4bce3ce6e0a4121360bf16a43
MATLAB
2,791
141
function plot_wcp(in,varargin) % PLOT_WCP Plot two-channel data recorded with the WinWCP software. % % PLOT_WCP(IN) plots WinWCP data, where IN can be a string containing the % filename or the output of the function IMPORT_WCP. % % PLOT_WCP('',...) user inteface selection of the file. % % PLOT_WCP(......
e377f6717e56c47bf4e1b88407ccf9ee6957aaeab9617c980cceae082d0164db
MATLAB
2,794
96
close all clear all clc %a = 100; %poly = [0 0; a, 0; a, a; 0, a]; a = [0, 20]; b = [0, 0]; c = [30, 0]; d = [30, 20]; refCanPts = [a(1), b(1), c(1), d(1); a(2), b(2), c(2), d(2)]; poly = refCanPts'; figure plot(poly(:,2), poly(:,1), 'b-*', 'linewidth', 10) hold on plot([poly(1,2), poly(end,2)], [poly(1,1), poly(end...
f6c0f6954e508067db6db78fd0c4be3e7ce2c7a62a0a0fb7b6b811e9424e069d
MATLAB
2,794
125
% % Plot the edge weight and multiplicity distributions of a network. % % PARAMETERS % $network Network name, must not have format UNWEIGHTED % % INPUT FILES % dat/data.$network.mat % % OUTPUT FILES % plot/weights.{a}.$network.eps % network = getenv('network'); font_size = 22; consts = konect_consts(); colo...
05d2ca0c7b138fab500440543c5d8d5394a84fa944abb621a4a4e0095938950e
MATLAB
2,795
69
classdef SweepTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % SWEEPTABLE [DEPRECATED] Table used to group different PatchClampSeries. SweepTable is being replaced by IntracellularRecordingsTable and SimultaneousRecordingsTable tables. Additional SequentialRecordingsTable, RepetitionsTable, and Exper...
e375fbab8414852cdbcba83a48822b43a6130e34d12ce8d1c44aad67a33ce053
MATLAB
2,797
54
%% fs = filesep; handles.fs = fs; %% Defaults to calculate connectotyping handles.connectotyping_settings.default_frames=60; % set the number of random frames included to connectotype, subjects with fewer frames will be excluded from this environment handles.connectotyping_settings.repetitions=10; % if a participant ha...
6510ac15fb1a120c72bf9a177aa045d4e57e641fed577fc1a087ea4f19b7eddf
MATLAB
2,801
50
function [probe] = translateModules(probe, moduleidx, translate_amount) %TRANSLATEMODULE Translates a module within a probe in x and y % Give a vector of module ids and a translate_amount=[x,y], this function % will update the modules' centroid position as well as sources and % detector (if they exist). optexis...
100f694870947c381ad4656476db846d55a2d8f5f1a1cc989b8697596891c368
MATLAB
2,805
104
%% Combine Motor & Ephys Files into a Spike2 .smr %% Reset Everything clear;clc;close all %% Setup %ExpmtDataFolder = 'G:\My Drive\Expmt Data\2019_05 - Max Climbing Fiber\Initial Data for testing'; ExpmtDataFolder = 'G:\My Drive\Expmt Data\2019_05 - Akira and Sriram Complex Spikes'; bFiles = dir([ExpmtDataFolder '\*...
3e2abe777dc766d3758ba751106c383717acb27f7327ba8724a8f5811cd13d87
MATLAB
2,806
82
function Params = readparamsfromdicom(dicomheader, Params) % function Params = readparamsfromdicom(dicomheader, Params) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % extracted scan information from dicom header and save to Params structure % % input: % dicomheader: dicom...
d9ea3309ddf47f12940cfd630dd7bcaa07a3783bcb9304753eec7666d12002c6
MATLAB
2,806
85
function eframes = vl_frame2oell(frames) % VL_FRAMES2OELL Convert a geometric frame to an oriented ellipse % EFRAME = VL_FRAME2OELL(FRAME) converts the generic FRAME to an % oriented ellipses EFRAME. FRAME and EFRAME can be matrices, with % one frame per column. % % A frame is either a point, a disc, an orien...
089c07bd6329684f927f5dd85775631fe2e9b8652ea5d3c0835744d6a052f4e0
MATLAB
2,807
75
classdef voronoi_AOI < AOI %UNTITLED Summary of this class goes here % Detailed explanation goes here properties voronoi_distance; end methods function self = voronoi_AOI(all_pois, trail, allowed_angle, max_vor_distance) self.allowed_angle = allowed_angle; ...
513b0f36398ea96ed47b7f3bd3f3be84fc744d08a9b885898aff324605415cd0
MATLAB
2,807
80
function [avg] = read_ns_avg(filename) % READ_NS_AVG read a NeuroScan 3.x or 4.x AVG File % % [avg] = read_ns_avg(filename) % % The output data structure avg has the fields: % avg.data - ERP signal in uV (Nchan x Npnt) % avg.nsweeps - number of accepted trials/sweeps in avg % avg.variance - varian...
b293ad51851a72492a073cf0ace46b856af12e843d849f6636ae6d717da2b53b
MATLAB
2,807
85
function [ text ] = plotImpedance( obj, varargin ) % Plot impedance. % % Syntax: % PLOTIMPEDANCE( obj ); % % Input parameters: % * obj - object containg data % % Output parameters: % text % % Example: % PLOTIMPEDANCE( ); % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andr...
d93ab0df28a02182ccfdf30746fd9c9cb09f72117c429c95d493f718d51c84dd
MATLAB
2,807
53
function cmd = backgroundCommand(cfgPath, zipPath, isPC) % Shell command that runs curl detached, then deletes the curl config and the zip % % function cmd = webupload.backgroundCommand(cfgPath, zipPath, isPC) % % Purpose % Composes the command string that webupload.postZip hands to system() whe...
1e574af392471b0af544810a1fe6b3a017b46785b14c0b74ea0eb71bf3a39995
MATLAB
2,809
102
classdef My_sum_layer < dagnn.ElementWise %SUM DagNN sum layer % The SUM layer takes the sum of all its inputs and store the result % as its only output. properties (Transient) numInputs=[]; end properties use_gradient_scale_factor=true; end methods(Static) end methods...
129900f1938239742e2d2d6cb244d222880755b726f63a439c8865cfa4a510bf
MATLAB
2,812
109
close all; clear all; clc %% create figure 2D %% janine.thome@zi-mannheim.de %% path pato=['/###/Figures/']; %% add output path if ~isdir(pato), mkdir(pato); end %% fig set fs=16; lw=2; basevalue=0; ...
da34ccf57526dccad72a62d63f6b073a587f033b3cac99c8385b85d29331ff2c
MATLAB
2,812
73
function [list_weight,list_weight_trace,list_weight_frame, sum_edges]... = frame_weight_blockwise_mm(mm, d, masks, leng) T=mm.Format{2}(3); % [Lx,Ly,T]=size(video); [Lx,Ly,N] = size(masks); npatchx = ceil(Lx/leng)-1; npatchy = ceil(Ly/leng)-1; % ROIs2 = reshape(masks,Lx*Ly,N); edges = false(Lx,Ly,N); for nn=1:N ...