sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
8f59a5d95763c819461e3308c8eae966d17bd798c58c34b1f53b947912cc0ab1
MATLAB
6,144
183
%% iterativeVectorDecomposition (IVD) % %// Takes a multidimensional signal, determines 'heading vectors' %across these dimensions, extracting these vector pulses from the time %series data, to build 'pulses' of excursion within a vector heading. Meant %as a master script for swapping between different methods. % % Alt...
04de91818806da3db6bfa05804bf900307e37f165f77350e03e4a54819a9a255
MATLAB
6,145
164
%--------------------------------------------------------------------------------- % Example script for the decoding analysis performed with the Neural % Decoding Toolbox (NDT) by Ethan M. Meyers % % Meyers, E. The neural decoding toolbox. Front. Neuroinformatics 7, (2013). % % Code based on the tutorial NDT tutorial: ...
0f3618ddfadc0bad840e23324f6db656321a213476c1a29f44aeff53a6c7cb78
MATLAB
6,149
207
% Author: Birgit Nierula % nierula@cbs.mpg.de function esg_prepro_loop6(subject, condition, srmr_nr) debug_mode = false; %% set variables subject_id = sprintf('sub-%03i', subject); analysis_path = [getenv('ANADIR') subject_id '/esg/prepro/']; cfg_path = getenv('CFGDIR'); % get condition info [cond_info] = get_condi...
d92683ee52e28766d21c52e13421b091e456c11936b2780c9a8e274deb40cf7e
MATLAB
6,151
204
function [IX,SigmaX,deltaMuX,suffStat] = VBA_IX_lagged(X,y,posterior,suffStat,dim,u,options) % lagged Laplace-EKF (Gauss-Newton update of hidden states) % Look-up which hidden states to update indIn = options.params2update.x; % Get precision parameters alphaHat = posterior.a_alpha./posterior.b_alpha; sigmaHat = pos...
223d917bcc9cd5ca87c527265e6f265f91862f426b82f2ef0bdd6b731536843a
MATLAB
6,153
119
function [r_other_asbl_int_on,r_other_asbl_int_off,r_out_asbl_int_on,r_out_asbl_int_off] = assembly_trig_corr (traces, pyr_id, int_id, si_img, TRace, RasterRace, CellCl, PCl, C0) n_int_in_assembly = sum(sum(CellCl(:,int_id))); pyr_out_assemblies = intersect(pyr_id,find(sum(CellCl,1)==0)); %find pyr cells not in assemb...
8035b62d80183d8898975be8e55ab07ae303e5dc36c5bae49c57592b3d98ee17
MATLAB
6,153
198
function M = fixedrankfactory_2factors_preconditioned(m, n, k) % Manifold of m-by-n matrices of rank k with two factor quotient geometry. % % function M = fixedrankfactory_2factors_preconditioned(m, n, k) % % This geometry is tuned to least-squares problems such as low-rank matrix % completion with ell-2 loss. %...
a0c8406f78c2e4279fb04a06eecb34fda91f762132cdde116b59f11e76597637
MATLAB
6,160
140
function J = imtransform2( I, H, varargin ) % Applies a linear or nonlinear transformation to an image I. % % Takes the center of the image as the origin, not the top left corner. % Also, the coordinate system is row/column format, so H must be also. % % The bounding box of the image is set by the BBOX argument, a stri...
4be2c489fc7a5ab7381d13ed0df53ed825259139ace8bc4fa3b76bb083f9e9e1
MATLAB
6,161
198
%PRINT2ARRAY Exports a figure to an image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % [A bcol] = print2array(...) % % This function outputs a bitmap image of the given fig...
67c7dee2bc8b2d5a75ea3e1b9928776e4487358a8ac6edc0badbac7e0c6ee8de
MATLAB
6,161
176
% plot_Figure5 % Plot leverage of Sramp, Spc1 and STin on behavior %% Load data medA = load(fullfile(saveLoc, 'for_plots_mediation_norm_to_se')); %% Plot settings mediatedDimsA = [52 19 27]; dimTin = 27;% ramp, PC1, Tin ('for_plots_mediation_norm_to_se') % mediatedDimsA = [3 11 60 68]; % MinC, MinI, MinI-...
ac004574aad362996c5b03ee900ad20dbc4e6494455c525a466b964aff34f351
MATLAB
6,161
169
function [labelx, labely, labelz] = coordsys2label(coordsys, format, both) % COORDSYS2LABEL returns the labels for the three axes, given the symbolic % string representation of the coordinate system. % % Use as % [labelx, labely, labelz] = coordsys2label(coordsys, format, both) % % The scalar argument 'format' resul...
fd9a53237063d3f01e481fa39e84b5a159e04b152ceef7b52a65e351bf23f3b4
MATLAB
6,164
142
function [EEG, markers] = DS_Threshold(EEG,PARAM) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Detect events beyond a threshold % % Part of detect_spindles toolbox: % % Authors: Stephane Sockeel, PhD, University of Montreal % Stuart Fogel, PhD, University of Ottaw...
5a74e4e500b54de4c927305075389d00bf7c8feaaa929c0788b378f3e0546649
MATLAB
6,165
140
function S = synclft3d( T, N, dm, dM ) % SYNCLFT3D Segment surfaces that have the closest surface along normal (N) direction is in % the range [dm,dM] % INPUT: % T - Input binary tomogram % N - Normal vector 3D field % dm - minimum distance % dM - maximum distance % OUTPUT: % ...
be8824af63f88d003d4b23a56ae7c49dc9ab88f63d43ed4c95498b17c7de9eec
MATLAB
6,165
201
% Author: Birgit iNierula % nierula@cbs.mpg.de function figure_spinalSEP(condition, subjects) % set path savepath_ga = getenv('GADIR'); % condition info srmr_nr = 1; cond_info = get_conditionInfo(condition, srmr_nr); cond_name = cond_info.cond_name; nerve = cond_info.nerve; trigger_name = cond_info.trigger_name; if...
63550cccb5bbf2634527ce9d209842eb359a48cfd50452df9f0c51b57d6cce84
MATLAB
6,166
164
classdef SpotsReader < SurpassObjectReader % SpotsReader Read Imaris ims file Spots data % % © 2015–2016, Peter Beemiller (pbeemiller@gmail.com) % % See also ImarisReader | SurpassObjectReader properties (SetAccess = 'immutable', GetAccess = 'public', Transient = true) ...
6c297bafdacbb319f499d9b6066e5033098667323843a36ea96c17dc13eeba3b
MATLAB
6,168
217
function [A,fH,figNames] = meg_plotFFT(data,p,selectedChannels,selectedFreq) % MEG_PLOTERP(data,selectedChannels,plotSingleTrial,plotAvgTrial) % % INPUT % data % structure of condition cells containing % data matrix, time x channels x trials % selectedChannels % vector of meg channels to inspect % selectedFreq ...
9dfd83823cdcf3228aa06e7aa0181cc949cdd1cefd4f07ddf9ffb0565bbcd9d3
MATLAB
6,169
160
function ft_plot_vol(headmodel, varargin) % FT_PLOT_VOL visualizes the boundaries in the volume conduction model of the head as % specified in the headmodel structure % % Use as % hs = ft_plot_vol(headmodel, varargin) % % Optional arguments should come in key-value pairs and can include % 'facecolor' = [r g b] ...
b3cb8979d1e5cd221f0b615c5f6e0dc0bd0970eecf21729db4800a33337389ab
MATLAB
6,169
216
%%%%%%%%%%%%%%%%%%%% REPROJECT ON THE IMAGES %%%%%%%%%%%%%%%%%%%%%%%% if ~exist('n_ima')|~exist('fc'), fprintf(1,'No calibration data available.\n'); return; end; if ~exist('no_image'), no_image = 0; end; if ~exist('nx')&~exist('ny'), fprintf(1,'WARNING: No image size (nx,ny) available. Setting nx=640 an...
488170b2be885b7d4844641c0999acaf54701a98cf2b8bca1f28838436258f55
MATLAB
6,170
192
%%%%%%%%%%%%%%%%%%% GRAB sensor imaging data analysis%%%%%%%%%%%%%%%%%%%% clc clear all close all %% open file extracted from ImageJ (.csv) %Need to have the folder containing the .csv file open or add it to path rawfluo=readmatrix('ROI1.csv'); %% optional step: subtract backgound from ROI on the stimulating elect...
518c1a1243cb2a722df7c0e384109a9700a26a5013ab36c11fd30fd6b2b7dd6a
MATLAB
6,171
136
function [Obj, log] = SOFAexpand(Obj,VarName) %SOFAexpand % Obj = SOFAexpand(Obj) expands the singleton dimensions of all variables. % Only variables will be expanded. Data and attributes won't. Note that % also Obj.API.Dimensions will be updated to the new dimensions. % % Obj = SOFAexpand(Obj,VarName) expands ...
19868e73110a381e0acac931237d6edd074dfc0af925bf9ff95fb40c173d590c
MATLAB
6,174
161
function DataStructure=SigmoidFit_ZN(Xdata,Ydata,FitOption) if size(Xdata,1)<=1&&size(Xdata,2)<=1&&size(Ydata,1)<=1&&size(Ydata,2)<=1 warning('Need to provide more than one data point to fit!') DataStructure=[]; elseif size(Xdata,1)~=size(Ydata,1)||size(Xdata,2)~=size(Ydata,2) warning('N...
3a0efd9ee15f3a2eb46babddeb5ce0a11c5fd7f5b72603272e9ccfceb3bbd487
MATLAB
6,174
200
%% tsdata_to_var % % Fit VAR model to multi-trial, multivariate time series data % % <matlab:open('tsdata_to_var.m') code> % %% Syntax % % [A,SIG,E] = tsdata_to_var(X,p,regmode) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % % _input_ % % X multi-trial time s...
83d81ea29c82d5d7a1506326d87e2856487d4d46d72bc283dbcebc32db840a6f
MATLAB
6,174
160
function ft_plot_headmodel(headmodel, varargin) % FT_PLOT_HEADMODEL visualizes the boundaries in the volume conduction model of the head as % specified in the headmodel structure % % Use as % hs = ft_plot_headmodel(headmodel, varargin) % % Optional arguments should come in key-value pairs and can include % 'faceco...
ece84a748d04e66876df8aff123b40e23f76ee078ba1b5633e9eb0162b11ae18
MATLAB
6,174
196
function h = ft_plot_dipole(pos, ori, varargin) % FT_PLOT_DIPOLE makes a 3-D representation of a dipole using a sphere and a stick % pointing along the dipole orientation % % Use as % ft_plot_dipole(pos, mom, ...) % where pos and mom are the dipole mosition and moment. % % Optional input arguments should be specifie...
067d15dab08d77bf25a5a143a8234c8402b0f385a11d693d2bcba450005e7cf8
MATLAB
6,176
163
function test_MetaPath() % Test basic MetaPath functionality with different platforms and locales pathObj = apt.Path('/test/path', apt.Platform.posix); metaPath = apt.MetaPath(pathObj, apt.PathLocale.native, apt.FileRole.movie); % Test char works pathStr = metaPath.char(); if ~strcmp(pathStr, '/test/path') error('M...
de3473e400ed19cc72c1eb095ce7f0742eaab5c723ebb720e1df77d094c1e544
MATLAB
6,178
190
function [C,Ceq] = Constraint_Function (xopt) % MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % % Description: % This M-file provides an equality constraint that ensures the joint mo...
e15443bbb379dc81815cc0b2f50f6a85c4dc948c80611d66aa1d2664b2f745c3
MATLAB
6,179
196
function h = ft_plot_dipole(pos, ori, varargin) % FT_PLOT_DIPOLE makes a 3-D representation of a dipole using a sphere and a stick % pointing along the dipole orientation % % Use as % ft_plot_dipole(pos, mom, ...) % where pos and mom are the dipole mosition and moment. % % Optional input arguments should be specifie...
cca3f6816048d96445bb4886684c156ad440f4b5791960261b7b5156019323bf
MATLAB
6,180
220
function [kappa,apk,ap,meanoks,savename] = ComputeOKSPrecisionTable(gtdata,varargin) [kappadistname,apvals,meanapvals,nets,legendnames,colors,exptype,... conddata,labeltypes,datatypes,... pttypes,annoterrdata,... savedir,savename,dosavefig,... threshmethod,threshprctile,... dormoutliers,nremove] = myparse(va...
760ee2bb3e26f4a9c2836fb961e1b38db881ad83de40fcc23066003866e174e6
MATLAB
6,185
181
% % fourieeg.m (beta) % % fourieeg Single-Sided Power Spectrum of your (continuous or epoched) dataset % % [ym f] = fourieeg(EEG,ch,f1,f2) returns the squared module, ym, of the FFT output % of your dataset, evaluated at channel ch, between the frequencies f1 and f2 (in Hz). % f contains the frequency range. % % [ym f]...
fca52b366658559f4ec749e61c049f1f47dfb8c98f39e35bd21adfc5be794d31
MATLAB
6,186
182
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% fit1_dipole_fitting.m %%% %%% Fit a dipole for the selected model and raw data %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% load Fieldtr...
4209d59ab7176ff7632dbf4803316427acf89e025ff2e0ab08234446f6f8a58c
MATLAB
6,188
183
classdef model % MODEL Top-level MCmatlab model class % % MCmatlab.model collects all objects (as properties) and methods % required to define a full MCmatlab model. properties name (1,:) char G (1,1) MCmatlab.geometry MC (1,1) MCmatlab.monteCarloSimulation FMC (1,1) MCmatlab.fluore...
ad7a2e43363418b1898d037d29871dcde9b9e0472d962cf6b8679a7791c1275a
MATLAB
6,188
207
function model = mrf2Create(adj, nStates, varargin) % Make a Markov random field with pairwise potentials % Wrapper to Mark Schmidt's UGM library % which is available from http://www.cs.ubc.ca/~schmidtm/Software/UGM % % model = mrfCreate(adj, nstates, 'nodePot', nodePot, 'edgePot', edgePot, ... % 't...
55f885748aaae887474867bba879f112cc8adda78750f57ce4f8d54e0bb80fb0
MATLAB
6,190
235
function [Reg,FinSize,DomId] = ClustRegFill(map,thr) map(map~=0)=1; map=map-1; map=abs(map); s=size(map); s1=s(1); s2=s(2); Reg=zeros(s1,s2); ClusSize=zeros(1,700000); if map(1,1)>0 ClusNum=1; Reg(1,1)=ClusNum; ClusSize(ClusNum)=ClusSize(ClusNum)+1; else ClusNum=0; end for n=2:s2 if map(1,n)>0...
e3cf784d8055b2ba6907c9bd2b29377e5fbe31bdffc194ca0ea20088ebb78eb4
MATLAB
6,190
175
function [collection, registry] = loadCollection(fullpath, name, omitHeavyFeatures,... omitHeavyGraphs) % This function loads a data-collection. Always use this function to load data % in the dspace-format. % % Data-collections are explained here: <a href="matlab:doc('dspace_data.DataColl...
1bc1923b19654ee9b96df0dd3c189b38d570475b7a4ab4b260f20c796c8ec8b3
MATLAB
6,192
163
function [hdr] = read_brainvision_vhdr(filename) % READ_BRAINVISION_VHDR reads the known items from the BrainVision EEG % header file and returns them in a structure % % Use as % hdr = read_brainvision_vhdr(filename) % % See also READ_BRAINVISION_EEG, READ_BRAINVISION_VMRK % Copyright (C) 2003, Robert Oostenveld % ...
51f96c1afec073f0d8992003d699aac4aeb56a074caddb11189dd60acbceec0e
MATLAB
6,192
158
%Load the set of all pixels of all puncta across all rounds from the filename_pixels = sprintf(fullfile(params.punctaSubvolumeDir,sprintf('%s_punctavoxels.mat',params.FILE_BASENAME))); load(filename_pixels) fprintf('Loaded Pixels.\n'); %This is the size of the cropped images, corresponding to ~15um pre-ExM filename_...
e3b810e16144a561c144cebbca836aa3db8f50917ca8c9999db9de06c7b4831c
MATLAB
6,192
203
function hAxes = dscatter(X,Y, varargin) % DSCATTER creates a scatter plot coloured by density. % % DSCATTER(X,Y) creates a scatterplot of X and Y at the locations % specified by the vectors X and Y (which must be the same size), colored % by the density of the points. % % DSCATTER(...,'MARKER',M) allows...
0a0d8b67ede94c3b05e29cf2947ea6c8224cc1f9d12f13f8214ed3f6979a0219
MATLAB
6,195
156
function [Allobject_container, SHGMask_container, CellMask_container, ... Cell755, Cell860] = FLIM_generate_masks_SeparateMasks(roi_names, ... file_identifiers, image_array, filtersize, prctile_thr, Masks) if nargin < 6 Masks = 0; elseif nargin < 4 Masks = 0; prctile_thr = 94; end % Ini...
97109d2ce27caf7cf1bab145d38f94ce2fcb5c5c68ac900c8fcc8977126f6ad8
MATLAB
6,195
173
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% step0_create_meshmodel.m %%% %%% Creates a model for the BEM-FMM forward solution. %%% %%% ------------------------------------------------------------------- %%% %%% Please make ...
71d33601c53fe4cb9fa58b314ef257d4c6578b72ea54a427a97ce4291c0aa7f5
MATLAB
6,205
177
function NETCDFsave(filename,Obj,Compression) %NETCDFSAVE % NETCDFsave(filename,Dataset,Compression) saves all data and metadata to % a SOFA file. % SOFA API - function netcdf/NETCDFsave % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences % Licensed under the EUPL, Version 1.1 or ...
c267f2043fbd7a4b333b59de975209724a106e0cbba4f9632e99078978d3e5dd
MATLAB
6,208
155
% stereo_gui % Stereo Camera Calibration Toolbox (two cameras, internal and external calibration): % % It is assumed that the two cameras (left and right) have been calibrated with the pattern at the same 3D locations, and the same points % on the pattern (select the same grid points). Therefore, in particular, the sam...
fadcd6e1610d1be0ba827420f774540d5d3e73dfbc326f5f43ef9c2252955b82
MATLAB
6,212
123
%% %This script was created by Professor Baxter Rogeres (VUIIS), but is heavily modified based on our lab pipeline by Jin Wang 3/7/2019 %(1) realignment to mean, reslice the mean. %(2) segment anatomical image to TPM template. We get a deformation file "y_filename" and this is used in normalisation step to normalize al...
164f7334ff8758719387958271ba4f4c683948ba4f3bb84c8c9381b170765521
MATLAB
6,213
90
function [p_values, replay_scores] = extract_score_and_pvalue_ground_truth(scored_replay, scored_replay1, scored_replay2, method, replay_above_rippleThresh_index) % INPUTS: % Scored_replay, scored_replay1, scored_replay2: structures loaded. Contain score and pvalue of each replay event for each method analysed. % ...
ddf197ae01fe34ccdfb1fe63146e398b220172112514738085d35baf1f68c740
MATLAB
6,215
140
function [ROICenter,XYZCenter,IJKCenter] = y_ExtractROICenterOfMass(ROIDef, OutputName, IsMultipleLabel, ROISelectedIndex, RefFile, Header) % [ROICenter,XYZCenter,IJKCenter] = y_ExtractROICenterOfMass(ROIDef, OutputName, IsMultipleLabel, ROISelectedIndex, RefFile, Header) % Extract the ROI Cen...
0fac99feeaddc4d10fab86452ae3253251c49381ac015b50ad05434242c43a49
MATLAB
6,218
145
function varargout = StrategyforSameSeriesStrategy(varargin) % STRATEGYFORSAMESERIESNAME MATLAB code for StrategyforSameSeriesStrategy.fig % STRATEGYFORSAMESERIESNAME, by itself, creates a new STRATEGYFORSAMESERIESNAME or raises the existing % singleton*. % % H = STRATEGYFORSAMESERIESNAME returns the han...
2b2fb09777404ce2f5a0f7a632fcf2e21e9c3a0cc69ce585b46e2505ab4f424a
MATLAB
6,218
106
function out = calculate_replay_detection_performance(data,epoch_index,segment_id,log_pval,p_val_threshold,total_number,option) % multi_event_index = find(log_odd_compare{nshuffle}.multi_track == 1); out = []; log_odd_difference = []; percent_multi_events = []; percent_sig_events = []; if strcmp(option,...
b3fdfcc48f71ac6675be62564676bc8190119f637feb29cf1a06b10f885b7292
MATLAB
6,219
224
load for_plots_mediation_norm_to_se.mat %% choose what to plot signal = 'TinC'; mediator = 'ramp'; %% example plot m = {leverage.mediator}; s = {leverage.signal}; I = ismember(s,signal) & ismember(m,mediator); L = leverage(I); colors = cbrewer('qual','Paired',6); colors = colors([2,4,6],:); t = L.t'; p = publish...
a1ab4773630f418acbc09ff99a79b8f4ccd5e58fd8fded48167cb6ec7916826a
MATLAB
6,227
197
% DELCODE-SAME, Figure "FADE SAME Amyloid" % _ % original paper: Soch*, Richter* et al., HBM, 2022 % Figure: not available % % DELCODE paper: Soch et al., medRxiv, 2023 % Figure 5: FADE and SAME scores by diagnostic group and amyloid positivity % % written by Joram Soch <Joram.Soch@DZNE.de>, 21/02/2023, 16:23 (DELC...
45e1e83063683903e3f1ed549f5e5783f9cb362ab7b50a8a58f1195c35a32475
MATLAB
6,231
120
clear; addpath(genpath('.')); %% Set file path files{1} = {'C:\Users\Jason\Documents\MATLAB\Dugtrio\2020-08-20-002\MC_Video_TSub_nonrigid.tif'}; %% Set options - Downsampled (1.5 Hz) options.maxVal = 2^13; % Maximum pixel intensity. Set anything above to 0 % Size of image patche...
b80d4c954abee11dad43d18058d0bbd3c20f31643492fa534c1c418cc7ef4c87
MATLAB
6,231
170
% Covariance matrix on the unit square, Matern 3/2 kernel. % % This is basically the same as COV_SQUARE1 but using the Matern 3/2 kernel. % % Inputs (defaults are used if not provided or set empty): % % - N: number of points in each dimension (default: N = 128) % - OCC: tree occupancy parameter (default: OCC = 64) ...
c7dff9db53eff693defbbc5751045dce4eaa5c0041bb685369f1ed056637f9de
MATLAB
6,233
183
function model = crf2FitStruct(y, Xnode, Xedge, varargin) % Fit pairwise CRF using group L1 on the edge weights % % Input: % y: Ncases * Nnodes (1,2,.., Nstates) % XNode: Ncases * NnodeFeatures * Nnodes % We add a column of 1s to Xnode internally. % Set Xnode = NaN for MRF. % % Xedge: Ncases * NedgeFeatures * Nedges %...
9e9b000bc9c9c2bbd90dc8c07300eff3a99041ecf982be19bfec4c09e8d6d36c
MATLAB
6,234
185
function exgauss_plot(plotType,y,X,varargin) % EXGAUSS_PLOT plots a histogram of the data and a line plot of the mode % % DESCRIPTION % Plots a histogram of the data and a line plot of the ex-Gaussian % distribution with best-fitting parameters % % SYNTAX % EXGAUSS_PLOT(plotType,y,X); % plotType - char arra...
3694f0f20f2b391b449df644d77c8c0e8ff9f93ed03caa0c516ceec60564360d
MATLAB
6,235
157
function Aout = h_tracingByMarks3(handles) % global h_img3; [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); state = currentStruct.state; % data = currentStruct.image.data; cstr = {'cyan', 'blue', 'green', 'magenta', 'cyan', 'yellow'}; % info does not work for l...
7734f8d018234942b5252b8026c3f7464013bc2f1e5c01a84932c50b238d2cbd
MATLAB
6,235
175
function y_ICC_Image(Rate1Dir,Rate2Dir,OutputName,MaskFile) % function y_ICC_Image(Rate1Dir,Rate2Dir,OutputName,MaskFile) % Calculate the Intraclass correlation coefficient for brain images. % Note: the ICC calculation is based on Xi-Nian Zuo's IPN_icc (http://www.mathworks.com/matlabcentral/fileexchange/22122) whic...
80a8079bf27b1048954a6e4110614507b2011fed43d641ddc8d000165da11aaf
MATLAB
6,236
97
function [ time, X, parameters ] = modelRunner_ToRORdLand( X0, options, parameters, beats, ignoreFirst) % Parameters are set here % defaults which may be overwritten cellType = 0; if (isfield(parameters,'cellType')) cellType = parameters.cellType;end % if the number of simulated beat is to be printed out. verbose = ...
610b7d0c242f396fe1d30e6df52e37a44ac639936820c59c570e0545e659e386
MATLAB
6,241
131
function [Data_Corrected, ClusterSize, Header]=y_ApplyAlphaSimThreshold(StatsImgFile,VoxelPThreshold,IsTwoTailed,ClusterSize,ConnectivityCriterion,OutputName,MaskFile,Flag,Df1,Df2,VoxelSize,Header) % function [Data_Corrected, ClusterSize, Header]=y_ApplyAlphaSimThreshold(StatsImgFile,VoxelPThreshold,IsTwoTailed,Cluster...
bc2436c2483f8dbcc6eb533d92bd5471a7bf98eb44e7b30b8bec05f7e84cfa3a
MATLAB
6,241
254
function wlPlot_plotEventXYMulti(cfg, matchseries, ... freqrange, durrange, amprange, figtitle, filelabel) % function wlPlot_plotEventXYMulti(cfg, matchseries, ... % freqrange, durrange, amprange, figtitle, filelabel) % % This function makes a scatter-plot of detected parameter values vs % ground-truth parameter v...
9946fa678f1a93a598aa34b71129b54232e488906b44357f1390e700f50d4a9f
MATLAB
6,244
141
function RP = renditionPercentiles(NNids, epochs, varargin) % COMPUTEPERCENTILES This function computes repertoire dating percentiles for % each rendition based on a nearest neighbor graph defined for a number of % measurements/renditions (size(NNids, 1)) and measurement times (epochs). % % ...
0fc926a3ad143d2a2df90acf71539188ebfbfc370f8eaacdebff180174d1ba51
MATLAB
6,245
137
addpath(genpath([pwd '/Utils'])); addpath(genpath([pwd '/Data'])); addpath(genpath([pwd '/SubRoutines'])); clear;close all genotypeName = {'R22D03AD_R20E08DBD Retinal Male','R22D03AD_R20E08DBD Retinal Female',... 'L320 Retinal Male','L320 Retinal Female',... 'L188 Retinal Male','L188 Retinal Female',... 'L219...
5239f1af96b0de48095e4001100820d1ef29112ed78d0187897f3daf1f218e50
MATLAB
6,246
136
function log = ReadBehavLog(logFile, task) scanRL1 = 'Subject:%s Date:%s Time:%s Attempt:%u16 Trial:%u16 Food:%u16 Block:%u16 Block trial:%u16 Center:%u8 Port poked:%u16 RT:%u16 MT:%u16 PreT:%u16 ResponseLimit:%u16 TrPerBlock:%u16 FalseStart:%u16 WrongStart:%u16 FailureToRespond:%u16 Prob Left:%u16 Prob Right:%u16 Ta...
9f014c87e651a3f61182a9c75f6b413104bd431218b542b2e79d3e3baf8a6022
MATLAB
6,246
174
function mri_unbias = ft_volumebiascorrect(cfg, mri) % FT_VOLUMEBIASCORRECT corrects the image inhomogeneity bias in an anatomical MRI % % Use as % mri_unbias = ft_volumebiascorrect(cfg, mri) % where the input mri should be a single anatomical volume that was for example read with % FT_READ_MRI. % % The configurati...
dce10a0f3ac41bd547508073001f4e9422df3cb9465f83922ea62aaaeada4c29
MATLAB
6,248
156
function saveCollection(collection, fullpath, collectionName, collectionRegistry,... omitHeavyFeatures, omitHeavyGraphs) % This function saves a data-collection. Always use this function to save data % in the dspace-format. % % Data-collections are explained here: <a href="matlab:doc('dsp...
cacf2550a054e36872545f0019d067492174ee2443a56bc6379fb22cc8ac0163
MATLAB
6,249
231
function plot_2c(mat1, mat2,CHAN_LAB, EJEX,EJEF,normal,CAXIS,electrode,area,stata) % % e.g. plot_2c(controles, obejtos, chanlocs, EjeX,EjeF,1,[-4 4],[1]) % % mat1 y mat2 = signal in matrix 4d % CHAN_LAB = estructure with channel labels (CHAN_LAB(x).labels) eeglab. % EJEX = times % EJEF = % normal = 1 -> z-score % ele...
c7d60dd6874d8a2f43e757b5a3049af7ca6146cfc10afbfc1c8b83bbc0d7a5b7
MATLAB
6,252
216
function B = medfilt3(A, siz, padopt, CHUNKFACTOR) %MEDFILT3 1-D, 2-D and 3-D median filtering. % B = MEDFILT3(A,[M N P]) performs median filtering of the 3-D array A. % Each output pixel contains the median value in the M-by-N-by-P % neighborhood around the corresponding pixel in the input array. % % B = MEDF...
9c09c4812bba9e76cdf7cdbd08c1e1917419cdda8a31290794f8e4b5264e4320
MATLAB
6,253
157
function [] = ground_truth_log_odd_analysis_spike_train_randomised_addon(folders,timebin,BAYSESIAN_NORMALIZED_ACROSS_TRACKS) % Input: % Folders: Each Folder is data for a session % Timebin: 0.02 or 1 % 0.02 -> 20ms time bin % 1 -> 1 event time bin % posbin: [] or 1 % [] -> 20 position bin per track (will load extracted...
a10a6d0803be6d2e1fd987681c9f6a309188fa6f99590153cba58d236af52654
MATLAB
6,253
127
%% Description % This example illustrates that deposition criteria can be specified to determine when % photon packets should contribute to output data, for example one could % specify the number of scattering events must be at least 1 and at most 3. % See also examples 8 and 25 for more use of the deposition criteria....
9b4f2784175fce99230c18e6553502f5491a6006d1594dfe782920eec5dd5c57
MATLAB
6,256
164
function [J,data] = jacobian_FD(mesh,varargin) % JACOBIAN_FD Calculates spatial distributions of sensitivity of % field registerd on the mesh boundary to changes of optical properties % per mesh node. This function relays parameters and calls specialized % functions based on the mesh type. % % SYNTAX: % [J,DAT...
e8875f8c0fb26a1354f067ebf89438550e0c9fd01c252315a7265772883dab22
MATLAB
6,258
163
%% This function constructs the 'paradigm' of interest function [time,Regressor] = GSP_Paradigm(PathToPar,n_rem,task) Now = pwd; cd(PathToPar); % n_shift = 10; % Creates the regressor that will highlight the presentation of the % stimulus switch task case 'tfMRI_GAMBL...
ef536427b2ef47f7027ca0bfc5d42939025c4a37d350d4c494e03bb2f0939a79
MATLAB
6,258
201
function [wavg, f, exitflag, output] = stochgrad(objFun, w0, options, X, y, varargin) % Stochastic gradient descent with averaging % Interface is similar to minfunc except you must explicitly % pass in X and y, which is needed for mini-batching % Example: % opt.batchsize = 10; opt.method = 'sgd'; w=stochgrad(objFn, win...
bdfd3b038494e6af5c8967608250abd21fa4f3da7cf4e7e32dce5c97bc6bd76e
MATLAB
6,263
150
function [EEG, rejectDataIntervals, badPointsInSec, badPointsPerc] = trimOutlier_profound_cleaning(EEG, sd_thresh_lf, amplitudeThreshold_hf, pointSpreadWidth, chan_ex) % Modified from trimOutlier() by Elena Cesnait & Paul Steinfath % Adapted for ERP data by Tilman Stephani, 08/2019 % Apply thresholds based on SD (sd_t...
f5fbd38cb057b27087d9f3c3db8382a5310a3cf513e18bce2ca867a4f888a94a
MATLAB
6,267
167
function [obj] = TLmakeSearchSpace(obj,thalsegfile,maskfilein) % Open TL image leftMGNnum = 8115; leftLGNnum = 8109; rightMGNnum = 8215; rightLGNnum = 8209; fn = thalsegfile; [thalamusHeader,thalamusData] = tippVol(fn); leftMGN = thalamusData == leftMGNnum; leftLGN = thalamusD...
32d8a04cadb81fea8627bc118411561d4e531b3d5a6ee35b2544f175fe79c5a4
MATLAB
6,269
189
function [model, varargout] = svmFit(X, y, varargin) % Fit a support vector machine. % Supports binary and multiclass classification, as well as regression. % This is a wrapper to SVMlight, libsvm, liblinear % and our own QP-based SVM code (which requires the quadprog function % in the optimization toolbox). % See svm...
06be157054f721517c90cfb75d1f0714b7bd1779f3d5ae5203cfc8131ff02dd1
MATLAB
6,276
198
%PRINT2ARRAY Exports a figure to an image array % % Examples: % A = print2array % A = print2array(figure_handle) % A = print2array(figure_handle, resolution) % A = print2array(figure_handle, resolution, renderer) % [A bcol] = print2array(...) % % This function outputs a bitmap image of the given figure, at t...
ec7c6664d9d8e6b5651af9fdb98ab56549a1857ffd98f0ca8c0eff1e4d613b10
MATLAB
6,276
261
function [hfig,savenames] = PlotAPOverX_CompareConditions(varargin) [gtdata,nets,legendnames,colors,exptype,... n_train,conddata,labeltypes,datatypes,... statname,hfig,figpos,savedir,savenames,dosavefig,xl,savekey,logscaley,... dataallonly,labelallonly,extras] = ... myparse_nocheck(varargin,'gtdata',[],... '...
139247238157e5c67daf0fe860ccb5aa299b1d23b2302dbbaae0dbaa721f5eca
MATLAB
6,279
212
% pop_basicfilter % % PURPOSE : Filters EEG data % % FORMAT : % % >> EEG = pop_basicfilter( EEG, chanArray, locutoff, hicutoff,filterorder, % typef, remove_dc, boundarycode ); % % EXAMPLE : % % >> EEG = pop_basicfilter( EEG, 1:38, 0.1, 30, 2, ?butter?, 1,'boundary'); % % INPUTS : % % EEG - input...
8411b67373a08dc6bb75213ade8fcffa6a9bf6117e1b6b90c1dd70795d42e74f
MATLAB
6,279
159
function h_loadAnalyzedRoiData3(handles, flag) global h_img3; [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); currentFilename = get(handles.currentFileName,'String'); [pname, fname, fExt] = fileparts(currentFilename); analysisNumber = h_img3.(currentStructName).state.an...
1bb63e8ca68ce70627f1b120e5cfd736b7c31d138a75f2e0d3f901188c541e54
MATLAB
6,282
180
function [spiral_grad_shape,adcSamples,adcDwell,params] = prepare_spirals_rf_grad_adc(params) lims = params.gen.lims; %% Readout Gradients % AMM Implementation raw Archimiedean spiral k_fov = 1./params.gen.res; last_tetha = (2*pi*k_fov(1)*params.gen.fov(1)/2); last_tetha = floor(last_tetha/(2*pi))*2*pi; teth...
a470cecb7886e3c0786917a0f8d3a968ee421cbffd4f756a7e38c0f09977de1d
MATLAB
6,283
123
%% Parse data out across FOV clear pathname = uigetdir(pwd,'Input Directory'); pathname = fullfile(pathname); directory = dir(fullfile(pathname,'*.mat')); %% rhoVal = {};LSrhoVal = {};nLSrhoVal = {}; waveDir = {};LSwaveDir = {};nLSwaveDir = {}; waveDur = {};LSwaveDur = {};nLSwaveDur = {}; waveMag = [];LSwave...
93df03f698d92556ed611212519646d329542f5fa2e3dbfc2ea93a429e6fcd69
MATLAB
6,286
149
% TANoise manuscript figs % scatterplots % Behav and slope %% Setup % Read data dataFile = 'figData/Fig_Behav.xlsx'; T = readtable(dataFile); % subject level data % Figure settings xJitter = 0.2; saveFigs = 1; subjectColor = [0.86 0.86 0.86]; dateStr = datetime('now','TimeZone','local','Format','yyMMdd'); fig...
1454c750096be5f56e39dcd7b55898e5135eeb30f519dbe6a233e091949f89d0
MATLAB
6,287
235
%% Draw a 6-node "tiny web" % This is from Section 2.11 of "Numerical Computing with MATLAB" % by Cleve Moler, SIAM, 2004. It then simulates the % computation of Google's PageRank algorithm, by randomly selecting links to % traverse. If a link is traversed, the edge and the target node are displayed % in red. If th...
760d12bf1e0839e78b61cd3a39bc09c311cfc6573774ad006dd096297b30b7f1
MATLAB
6,291
146
function [bandwidth,density,xmesh]=kde(data,n,MIN,MAX) % Reliable and extremely fast kernel density estimator for one-dimensional data; % Gaussian kernel is assumed and the bandwidth is chosen automatically; % Unlike many other implementations, this one is immune to problems % caused by multimo...
179e69f537acc471011040f76b59b93f7057483e2018cd5a88214b24dc3b0e59
MATLAB
6,295
177
%PRINT2EPS Prints figures to eps with improved line styles % % Examples: % print2eps filename % print2eps(filename, fig_handle) % print2eps(filename, fig_handle, options) % % This function saves a figure as an eps file, with two improvements over % MATLAB's print command. First, it improves the line styl...
52eda1d1141ab038bedecb80aca91455aaef85a0941dca734437c3faf9fef152
MATLAB
6,296
147
% This code cleans up the seizure data from noisy artefacts and selects the % components that are relevant to seizure (those that demonstrate % correlation with seizure onset time). % data_noise Sohrabpour % 1/9/2018 clear all; close all; clc % This part of the code was to load the data for our data base. We...
7965c841ce1fe26c71dad5ff021a591ee5ba1b70a3036ea826483b65b5c28ce2
MATLAB
6,298
226
function [ newevents avglongestprobe avgendtotal convergefrac ] = ... wlProc_doEvAnnealAmplitudeHilbert( ... oldevents, samprate, hilmag, hilfreq, hilphase, ... comparefunc, maxprobes, maxtotal) % function [ newevents avglongestprobe avgendtotal convergefrac ] = ... % wlProc_doEvAnnealAmplitudeHilbert( ......
57008296afa77071ea69538cb4b4e420a040a35e4811496bae88c5c955457e40
MATLAB
6,300
182
function [imgPair] = measurementError(imgPair,sampleInterval,autoSave,readSaved) computeError = 1; displayError = 1; F = imgPair.moving.F; mask = imgPair.moving.mask; if computeError mask = double(mask); nanMask = mask; nanMask(mask==0) = NaN; nanMask = cat(3,nanMask,nanMask); sizeImg = size(...
e8925ac1eacf618be29f727563eaf7b3efb4ac2af5b0e9d109391a3415d154af
MATLAB
6,300
224
function plotPrior(res) % this function creates the plot illustrating the priors on the different % parameters % % this is meant to be a 3 column, 2 rows multipanel plot. % parameters lineW = 2; lineC = [0,105/255,170/255]; markerSize = 30; data = res.data; % get correct stimulus range if numel(res.options.stim...
4b62743ba8e84439f00606111c36e2be8caf6fe8bcf52e96e267c262d829a597
MATLAB
6,302
130
function [C,OutputFiles] = cifti(obj) % Extract CIFTI-2 extension from a NIfTI-2 file and export data %__________________________________________________________________________ % Copyright (C) 2019 Wellcome Trust Centre for Neuroimaging C = []; OutputFiles = {}; %-Check input is a CIFTI file %----------------------...
74581aaf92de676a4ecbafa92fde5b6012330647a7fc303764b6b5f3db76da7f
MATLAB
6,302
195
%% Supervised learning in pmtk3 % %% Models % An auto-generated list of all the supervised models and their methods % is shown % <http://pmtk3.googlecode.com/svn/trunk/docs/modelsByMethods/supervisedModels.html here>. % % Below we show a manually created list % (in alphabetical order) % of pmtk models that a...
f09d36f57a6612fbd73a358b56da8def55433893353096c760459590434fa164
MATLAB
6,307
155
function headmodel = ft_headmodel_concentricspheres(mesh, varargin) % FT_HEADMODEL_CONCENTRICSPHERES creates a volume conduction model % of the head based on three or four concentric spheres. For a 3-sphere % model the spheres represent the skin surface, the outside of the % skull and the inside of the skull For a 4-s...
36713d83e43e0c4349644aebfcd4cc5895b24b8ff14dddab5d896aa44278e26a
MATLAB
6,308
138
% Phase precession computation based on spike-time correlation coefficient function [] = C01_phase_precession_r_NWB (nwbData, bpfreq) %% prepare interval data (encoding period) %=== load data from the interval table encoding_table = nwbData.intervals.get('encoding_table'); ttls_clip_onsets = encoding_table.start...
41b253add1b46f733fffe54251144b0cea0e4f1bd40bf2a0b4d578ed887972e6
MATLAB
6,310
174
%% Creates parcellation csv for every AvgR_Fz file, calculates a correlation with an NT and calculates a correlation betweeen the correlation and beta activity addpath C:\Code\wjn_toolbox-master addpath C:\Code\spm12 addpath(genpath('C:\Code\leaddbs')) %% D1 % select directory containing fmaps fmap_dir = 'C:\Users\IC...
b667560e308c1265de83857211d191014579fdba4bf49f78f63777b2c85de203
MATLAB
6,310
130
classdef CBIG_AuthorTopic_unit_test < matlab.unittest.TestCase % % Wrapper function to unit-test a coordinate-based meta-analysis with the author-topic model. % The inference was performed with the following hard-coded hyperparameters % - K = 2:3 - number of cognitive components to be estimated is 2 and 3 % ...
21d4b05a356344d1c9ca4d6ba86fd028742b0ab6dda262020de699144e1010df
MATLAB
6,314
160
% Nine-point stencil on the unit square, constant-coefficient Poisson equation, % Dirichlet boundary conditions. % % This is basically the same as FD_SQUARE1X but using a fourth-order % approximation with stencil radius two. Correspondingly, the nested dissection % separators have width two. % % Inputs (defaults are us...
3cbeb538107ec15b8a2226e36f28ae3b18eb160056ea88e1443e3e178e92d8d0
MATLAB
6,314
257
%if exist('images_read'); % active_images = active_images & images_read; %end; var2fix = 'dX_default'; fixvariable; var2fix = 'dY_default'; fixvariable; var2fix = 'map'; fixvariable; if ~exist('n_ima'), data_calib_no_read; end; check_active_images; % Step used to clean the memory if a previous atttempt ...
f162470c9c70d8128056101687663a50360e750a513335186e732acd56351dc6
MATLAB
6,314
171
function d = getdict % Dictionary of NIFTI stuff %__________________________________________________________________________ % Copyright (C) 2005-2019 Wellcome Trust Centre for Neuroimaging % % $Id: getdict.m 7620 2019-06-19 15:44:39Z guillaume $ persistent dict; if ~isempty(dict) d = dict; return; end % Da...
91bfd8242ded4b8fbcce039d6b34d7a0a5ff54f6c39e2fbdc2416b42b067fb1f
MATLAB
6,315
195
%TPS3DWARP Calculates a 3D Thin Plate Spline, then applies it to the moving %Tile input (tileM). Keypoints for moving (keyM) and fixed (keyF) are %intended to outputs from the calc_affine function, ie, vetted %correspondence points that are stored as a Nx3 vector format. outDim is %the size of the (padded) output image...
f0d91b2a5d81806e54495d393ea7145cbbd4150582f48dcf0c13c21681e3933b
MATLAB
6,317
170
function [PFresultsStruct, resultsStruct] = run_grid_decode(data_path, varargin) % run_grid_decode(simParam.save_path) % % Code to perform bayesian decoding on the spike-time cell arrays produced % by simulateParameterGrid.m. Adapted from the script run_grid_decode % % Inputs: % - data_path: a string of the location ...
1737e62f45d89ba56d74134f8529da22a0d7f25a71dad30dac85798669923f58
MATLAB
6,318
127
% EXTRACTS SLEEP STATE % Considers that animal is sleeping when: % Velocity is less than 4cm/s within a 60 second window % Median firing rate across neurons with a lower firing rate (lower 1/3 of population) has a zscore > 0 within a 60 second window % Interpolates replay event time with time_bin_centre (using 'neares...
7ef46b684d69d82860042b870722a78f3ef6f8665111b6b7a59200ce20ab4c52
MATLAB
6,322
174
function [figHandleSubplots, figHandleSingle] = netDimRed(network, dimRedInput, varargin) % Uses dimensionality reduction techniques to visualize the clustering of % the network structure % % newtork: network structure % dimRedInput: option for the input to the dimensionality reduction algorithms % 'W': just the conn...
720233da2553e76a4bf50c82209be39c2b291ee2399a20b498600a3af34af681
MATLAB
6,323
221
function [h,t,w,w_times,halfh, auc] = fir2htw2(b,varargin) % Estimates height, time to peak, and width of FIR response % % :Usage: % :: % % [h,t,w,w_times,halfh, auc] = fir2htw2(b,[hconstraint],[doplot],[colors cell]) % % :Inputs: % % **b:** % beta/estimate series for hemodynamic response curve % % hcons...
0d18a7eb2d7e587cf1cd8e103c8f64f9e0a7515ecab417df23efb72e63aac22b
MATLAB
6,327
189
clear; clc; do_save_fig= 0; %% Common parameters fs= 20e3; stimdur_s= 1; stimlen= round(fs*stimdur_s); fc_Hz= 3e3; mod_depth= 1; t_stim_ms= (1:stimlen)/stimlen*stimdur_s*1e3; %% freq params fm_Hz= .5e3; dam_f_start= 2^4; dam_f_end= 2^10.25; dam_traj_Hz= 2.^linspace(log2(dam_f_start), log2(dam_f_end), stimlen); t_...