sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3a843f75a7c02ec9db241c1e4f4268797a21decb8f013c8e368a3f2cab7a82dc
MATLAB
7,049
187
function [obj] = ft_convert_units(obj, target, varargin) % FT_CONVERT_UNITS changes the geometrical dimension to the specified SI unit. % The units of the input object is determined from the structure field % object.unit, or is estimated based on the spatial extend of the structure, % e.g. a volume conduction model of...
71f6f8f5c807aab045392e96a00c3f4f56b5eab6e69ba6a58b5b6e9218da656f
MATLAB
7,050
212
classdef mediumProperties properties name (1,:) char {mustBeNonempty} = 'Unlabeled medium' mua (1,1) = @defaultnan_41func mus (1,1) = @defaultnan_41func g (1,1) = @defaultnan_41func customPhaseFunc (1,1) = @defaultnan_21func ...
da78be476f9407ceaeba957ba1d75656ebc791376a9aa993392a7054380030d3
MATLAB
7,051
183
function [timelock] = ft_datatype_timelock(timelock, varargin) % FT_DATATYPE_TIMELOCK describes the FieldTrip MATLAB structure for timelock data % % The timelock data structure represents averaged or non-averaged event-releted % potentials (ERPs, in case of EEG) or ERFs (in case of MEG). This data structure is % usual...
c1a5e7a48e4589e509b512c7392a3ae7dd9fbe54d70300ca01abdff77220cff2
MATLAB
7,052
186
function [event] = read_yokogawa_event(filename, varargin) % READ_YOKOGAWA_EVENT reads event information from continuous, % epoched or averaged MEG data that has been generated by the Yokogawa % MEG system and software and allows those events to be used in % combination with FieldTrip. % % Use as % [event] = read_yo...
59a1ea4395ce85266026c923b92f13a1ae8a1be2db5f379f86f5ff67911b8f34
MATLAB
7,054
223
%% (Plot) jointDiffSDO % Co-plot the background and spike-triggered SDO matrices from the 'sdo' % datastructure as heatmaps. For use within the SDO Analysis Toolkit. % %PREREQUISITES: % computeSDO() % INPUT PARAMETERS % sdo: 'sdo' structure % XT_SDO_CH_NO: Row index for the sdo structure, pointing to a particular...
8cc44019407088d62b19052d8950d1c0370ee0fcd1fb6970d85973cf55167137
MATLAB
7,054
168
function varargout = DPABI_Utilities(varargin) % DPABI_UTILITIES MATLAB code for DPABI_Utilities.fig % DPABI_UTILITIES, by itself, creates a new DPABI_UTILITIES or raises the existing % singleton*. % % H = DPABI_UTILITIES returns the handle to a new DPABI_UTILITIES or the handle to % the existing si...
bf971a527d5380e82f747906734e1b62042c2ca1d54a767867a68ad19d722d90
MATLAB
7,055
292
function [ fp fn tp matchlist fplist fnlist ] = ... wlProc_evalEventsVsTruth(evtruth, evtest, bandlim, snrlim, ... comparefunc) % function [ fp fn tp matchlist fplist fnlist ] = ... % wlProc_evalEventsVsTruth(evtruth, evtest, bandlim, snrlim, ... % comparefunc) % % This function compares an event list to a...
c0f54923906ae21169385e0c749a1be3ab020b5a73281229204f8a40a6a630e7
MATLAB
7,056
184
function [Error, Cfg]=y_NetworkConstruction(Cfg,DataDir,OutDir,SubjectListFile) % FORMAT [Error, Cfg]=y_NetworkConstruction(Cfg,DataDir,OutDir,SubjectListFile) % Cfg - the parameters for Network Construction. % DataDir - Define the Data directory to replace the one defined in Cfg % OutDir - Define the Output dire...
0d7f11f61008eb30b8fe80f082a9ebfa42befddb3c40de80f147a6c64f42fed7
MATLAB
7,058
183
function [timelock] = ft_datatype_timelock(timelock, varargin) % FT_DATATYPE_TIMELOCK describes the FieldTrip MATLAB structure for timelock data % % The timelock data structure represents averaged or non-averaged event-releted % potentials (ERPs, in case of EEG) or ERFs (in case of MEG). This data structure is % usual...
64ceb8bd5e1a45c40de601c5b7ae0507cf53495c3818982bfd4555e04541fb7d
MATLAB
7,060
177
function [ dataSource ] = loadTableDatasource( path, saveName, omitHeavyCoordinates, omitHeavyLGs, wbh, headpr ) % Don't directly use this function. Use dspace_data.loadCollection instead. % % % % %<PRE> % This file is part of dspace-core. % % Copyright (C) 2020 University Zuric...
8cc0da65f21ead01c60eec9943599daca1e64c7b114f15e2e22d5e0af0fdeca1
MATLAB
7,060
169
function [varargout] = bivariate_common(cfg, varargin) % BIVARIATE_COMMON makes a selection for a specific reference channel from a % bivariate (i.e. connectivity) dataset and returns that selection as a univariate % dataset. This is used in singleplot/multiplot/topoplot for both ER and TFR data. % % Use as % [varar...
211ab9fbcf1e546fe1e2c382fb65e13554847e2c2d638329310cb98a0d4b12f3
MATLAB
7,062
258
function [ newevent, error ] = wlProc_fitAmpBasic(hilmag, oldevent, atype) % function [ newevent, error ] = wlProc_fitAmpBasic(hilmag, oldevent, atype) % % This function estimates oscillatory burst amplitude by curve fitting a % logarithmic or linear ramp in the region of interest. Roll-on and roll-off % are used if s...
c8ab778d519b8763c18cc07b23ea8973030c2425ac7b7ed7e5f6b6475ffc22d0
MATLAB
7,065
317
function [components1,components2] = localize_model(model,fixed_points,fp_linsys,verbose) n_units=length(model.wO); %%% output of the network computed at fixed points in context 1 output1=fp_linsys.o1; %%% output of the network computed at fixed points in context 2 output2=fp_linsys.o2; %%% I consider the linear s...
2b02321336b59d41daad144448fac12befd5c1095c1d50cf508a5813e4378561
MATLAB
7,067
187
function [trl,eventslist]= searchTaskTrialFun2(cfg) % Defines trials with t = 0 at a stimulus onset marker, based on a motor % response. Defines trial search window as from one stim onset marker to % the next or EOF otherwise. % Ming Scott's code % Adapted from % Sonya Bells's code (taskTrialFun) % Based on Simeon Wong...
c0a091076185910d0ac2ac5e44f8f871a4f0ce3caa4101cb645c555f1512d050
MATLAB
7,067
204
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Script for reproducibly generating MATLAB PREP artifacts via CI %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Author: Austin Hurst %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Step 0: Ini...
2a6f4aab7f132fc670f53b51d61dece7f628a230a0daaa7e84f6428fca30f3c3
MATLAB
7,068
148
function [ titleStr, settings, results ] = repertoireDating_dspace_launcher( dataview, settings ) % This function computes/plots repertoire dating statistics and mixing matrices. % This function can launch the following repertoire dating functions: % % % <a href="matlab:doc('repertoireDating....
36927b78769dde85b907a44c286b22a2c6239af4fb9110749e2a19f40b9827c8
MATLAB
7,072
250
classdef JavaProperties < handle properties(SetAccess=private) p; fileName; end methods function this=JavaProperties(fileName) if nargin<1 this.p=java.util.Properties; else this.p=File.ReadProperties(fileName, true); ...
a19e847f07def1b73b717c0d6dc9ff8f0d94d2ca842939ff0100355e5b6dd447
MATLAB
7,075
219
function colorspace_demo(Cmd) % Demo for colorspace.m - 3D visualizations of various color spaces % Pascal Getreuer 2006 if nargin == 0 % Create a figure with a drop-down menu figure('Color',[1,1,1]); h = uicontrol('Style','popup','Position',[15,10,90,21],... 'BackgroundColor',[1,1,1],'Value',...
0fe280a5d5724957d197f52ab33b5ed08acf89895728442713aabb6aa9b2d2a6
MATLAB
7,078
190
% Covariance matrix on the unit square, squared exponential kernel. % % This example considers the covariance matrix between regular grid points on % the unit square with squared exponential covariance function. The matrix is % square, real, positive definite, and Toeplitz. % % We remark on a few key departures from th...
e39d028000b91ea30d0ccaf0c020c94826e4dc0b7d7078fe10cb4054c2dce10e
MATLAB
7,079
194
%% Tensors % Tensors are extensions of multidimensional arrays with additional % operations defined on them. Here we explain the basics of creating and % working with tensors. %% Creating a tensor from an array % The |tensor| command converts a (multidimensional) array to a tensor % object. M = ones(4,3,2); %<-- A 4 x...
3dc8616b32828e82cfbf4d739fda19a630d181ff1ae6b7124fbc3f944370c95b
MATLAB
7,082
289
%%cell count clear all close all for i = 1 :2 cd Example_images/ filename1 = ['220311_NS_1_cs2_10X_' num2str(i) '_DAPI.tif']; filename = extractBefore(filename1,'DAPI'); dapi = imread(filename1); [px, py] = size(dapi); % figure % subplot(1,2,1) % imshow(dapi) % subp...
6ff7da1fdb60bfac1b9745d36ff85a7529f8161226a3c2c5314b6478b51b6ebb
MATLAB
7,085
182
function varargout = interp_gridded(transform, val, pos_to, varargin) % INTERP_GRIDDED computes a matrix that interpolates values that were % observed on positions in a regular 3-D grid onto positions that are % unstructured, e.g. the vertices of a cortical sheet. % % Use as % [val] = interp_gridded(t...
6b5fa430f65812e4e2ca99e4b2529b0a3895f3a19793400c8221dd1b710a11f1
MATLAB
7,087
163
%%% center_points tiling_info read_file_name xxx_min = floor(min(center_points.xxx + min(center_points.xxx_shift,[],2)) - tiling_info.x_pixel./2) ; xxx_max = ceil(max(center_points.xxx + max(center_points.xxx_shift,[],2)) + tiling_info.x_pixel./2); yyy_min = floor(min(center_points.yyy + min(center_po...
393a2d23bc357c445e3830d034be67d8fc0eec074dcaadba5aeb7dffe1c00bb3
MATLAB
7,088
119
%% 共空间模式 | common spatial patterns (CSP) 不可在main中调用,仅可单独使用 %% one vs one Multiclass or two-classes 目标函数法 % how:N个类别中任意两个做CSP,共得到CN2=N*(N-1)/2个投影矩阵,对每个投影矩阵取最佳的2m个方向(前后各m个),特征矩阵为2m*N*(N-1)/2=m*N*(N-1)维 % 优点:每次计算CSP投影矩阵时,2个类别都是单纯的类别,更容易找到两类差别最大的投影方向 % 缺点:N类需要计算CN2个投影矩阵,N很大时,计算量会大大增加 % 注意:在计算CSP投影矩阵时,并非使用整个trial,而是将trial...
eba3495245d486f3d62c0c0eb6248b7b55069acb41172e9f79a23d7e77e37a1b
MATLAB
7,089
189
function [lfp] = bz_GetLFP(varargin) % bz_GetLFP - Get local field potentials. % % Load local field potentials from disk. No longer dependent on % FMAT/SetCurrentSession. % % USAGE % % [lfp] = bz_GetLFP(channels,<options>) % % INPUTS % % channels(required) -must be first input, numeric % ...
bce2fe6a9e797600262f91580872736af15bc564d49c02edfe5f23502277e62f
MATLAB
7,090
194
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 organised in a structure % as obtained from the FT_READ_MRI func...
b41077377ba517508dc19d1deaa19f8708bca4e9f1ff642d7ac443cedc84bbae
MATLAB
7,094
263
function meg_plotGroup() %% make group data structure 2 % how many channels to inspect? (max 7, if >7 rerun analyses) nC = 5; % cue conds groupD2.cueT1 = []; groupD2.cueT2 = []; groupD2.neutral = []; groupD2.cueT1All = []; groupD2.cueT2All = []; groupD2.neutralAll = []; fields = fieldnames(groupD2); % c...
67fac9fbf4426780d03fae0cb2fdeca8e55770eeb79cf282228e1c5704fd0c30
MATLAB
7,098
203
function bz_ConcatenatedTimes(basepath,sortFiles) % bz_ConcatenatedTimes(basepath) % This function generates the events.mat file that saves all the merge % information. Useful if you dind't do this when you merged the dats. % % USAGE % % bz_ConcatenateDats(basepath,sortFiles) % % INPUTS % % basepath ...
39da6a2342bc984c0b050c5dfc026339129470d5f4165f27cabce21d78e7d4ac
MATLAB
7,099
158
% Written by: Tianyin Xu % Edited by: Qiuting Wen, Adam Wright % Last modified: 20240925 %Modifications: %20240925 -- Updated the UBA mask to be UBA_exclude_VA_PCOM_fmri.nii.gz % Inputs: % fMRI_path -- the scans path -- this path must include the following % files: % - UBA_exclude_VA_PCOM_fmri.nii.gz Modified: 2...
1c7987c912da9e59fd869c9aaf9b5e448b2091d83a3d4dacdb646134b1561bb5
MATLAB
7,101
239
function str = printstruct(name, val) % PRINTSTRUCT converts a MATLAB structure into a multiple-line string that, when % evaluated by MATLAB, results in the original structure. It also works for most % other standard MATLAB classes, such as numbers, vectors, matrices, and cell-arrays. % % Use as % str = printstruct(...
563e281eef769b727e94e136c7c362f5db65f08e0751a9c21c808300ee9f3354
MATLAB
7,101
176
function varargout = w_StructuralSelect(varargin) % W_STRUCTURALSELECT MATLAB code for w_StructuralSelect.fig % W_STRUCTURALSELECT, by itself, creates a new W_STRUCTURALSELECT or raises the existing % singleton*. % % H = W_STRUCTURALSELECT returns the handle to a new W_STRUCTURALSELECT or the handle to %...
dfb1e4905360df26b140e27669f5a34e6a7042851b8c461cd9191afb0672653b
MATLAB
7,101
248
%%%%%%%%%%%%%%%%%%%% 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...
d03ddf4ec9c4eb238f9eb08986547d7e673a61cd1fe80fd379c18a492068dae1
MATLAB
7,105
165
function [result, done]=run_HiD_match(trainingSet, trainingIds, testSet, ... testIds, varargin) %%RUN_HiD_MATCH runs the QF match algorithm % on the subsets found within a training test set of data. % % The publication that introduces the algorithm is % https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5818510/ ...
ec9cdec44f44070a2f635371bb0fbbb3c5d26ef3366d5e98c9bc405bfedf86a4
MATLAB
7,105
291
%%% epoch_lan.m %%% v.1.0.1 (migrating to lan_epoch) %%% V.1 (for epochs.m v2.) %%% %%% 04.04.2012 %%% 14.04.2009 %%% en proceso %%% Pablo Billeke %%% %%% create epochs for continuos data (2D matrix) %%% for EEGLAB, condition is 1, the output is a 3D matrix. default %%% for LAN, condition is 2, the output...
b4be87cf9a23caf67ab6e52e549af885d7fba48fab90db7e8db8826f584b5fb3
MATLAB
7,106
237
function bz_LFPfromDat(basepath,varargin) % perform lowpass (2 X output Fs) sinc filter on wideband data % subsample the filtered data and save as a new flat binary % basename must have basename.dat and basename.xml % basepath is the full path for basename.dat % % note that sincFilter was altered to accomodate GPU filt...
a95d587a1ebfa892f8f5c5d8bcf141eb19e9973de1c5538bedf0fcde87b94dcc
MATLAB
7,107
178
function [ titleStr, settings, results ] = localGraphAnalysisLabels( dataview, settings ) % This function function can summarize the connected nodes for each datapoint % in the current filter in several ways. % % If the graph is a nearest-neighbour graph, this module function computes % stati...
18241e62fe72e77b257decb6f8b736f392ec0e8d4cd8578b19f492200b8da26a
MATLAB
7,109
261
function [hfig,savename,sortederrs] = PlotFracInliersPerLandmark_AR(varargin) [gtdata,net,pttypes,colors,exptype,... conddata,labeltypes,datatypes,statname,... maxerr,minerr,... hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,... annoterrdata,annotcolor,annoterrprc,plotannfracinliers,... APthresh] = mypar...
bacf7313aac83674cb3f555ce224414d8d662b83f45a5310d2692abee8f71eb5
MATLAB
7,109
1
% TSLIMIT Limit the range of subjects, sessions, phases, or trials. % Currently, limiting by date is not supported. % % TSLIMIT(fieldname,INDEX-SPECIFICATION) sets limits on the range that % will be used for statistics computations. fieldname must be either % 'Subjects', 'Sessions', 'Phases', or 'Trials'. %...
75551298f0350c5524d7450793180ddaa721a8a76b4bbfde1d3ddc666ac53dfc
MATLAB
7,110
282
function [xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk] = project_points(X,om,T,f,c,k) %project_points.m % %[xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk] = project_points(X,om,T,f,c,k) % %Projects a 3D structure onto the image plane. % %INPUT: X: 3D structure in the world coordinate frame (3xN matrix for N points) % (om,T): Rigid mo...
8c676f75cda9ce8d661be8a5603c267700c9ef187bf40521a977f95ef926b225
MATLAB
7,111
221
function [fs1, fs2, er] = compareStructs(s1,s2,n1,n2,p,tol) % check two structures for differances - i.e. see if strucutre s1 == structure s2 % function [fs1, fs2, er] = compareStructs(s1,s2,n1,n2,p,tol) % % inputs 6 - 5 optional % s1 structure one class structure % s2 structure ...
86ea279f1ec2099a9eda4fdbfb392d032e3cd9413351eb2d49c29745715f538e
MATLAB
7,121
242
function [out1,out2,out3] = ginput4(arg1) [out1,out2,out3] = ginput(arg1); return; %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse (or by using the Ar...
3a78559652edbf17229478f820d411ce0dc7e838b57625a7590e5bbe1317c065
MATLAB
7,130
183
function StatsTableExporter(PvaluesTable,OverallPValue,GroupNames,TestName,SaveDir) FullLabelTableDisplay=0; for i=1:length(GroupNames) GroupNamesNumberedList{i}=[num2str(i),': ',GroupNames{i}]; GroupNamesNumbers{i}=[num2str(i)]; end if FullLabelTableDisplay MaxLength=14; ...
b0b8ace03e55a006e549e4444a6b3dc50a66e6062f68538a396b569e7b1c0869
MATLAB
7,130
203
function command = trainCodeGenBase(dmc, varargin) % Generate a base command for training. Returned command uses WSL paths (see % DLBackEndClass documentation). This is a static method of DLBackEndClass. [nativeAptRootAsChar,... confparamsextra,... val_split,... ignore_local,... do_just_generate_db] = ... myparse...
4884aa9f559e0395ac0f900d87e4e930f4c0abdae15f8916804804e327bd9804
MATLAB
7,131
251
function [tfr,t,f]=tfrunter(X,time,form,fmin,fmax,N,trace); %TFRUNTER Unterberger time-frequency distribution. % [TFR,T,F]=TFRUNTER(X,T,FORM,FMIN,FMAX,N,TRACE) generates the % auto- or cross-Unterberger distribution (active or passive form). % % X : signal (in time) to be analyzed. If X=[X1 X2], TFRUNTER % compute...
29f548f7b6b4cde9b34620664fe43a680719b567a243758de848c14662b7bf64
MATLAB
7,135
210
function [] = makeProbeMapKlusta2(folder, xmlfile) %% this function takes an xml file with spike groups already assigned and %% generates *.prb files for each shank for spike detection/masking/clustering %% IMPORTANT: this function ASSUMES that the order of the channels for each shank %% in the spike groups map onto ...
259aa10a34a075f143ce56587b369f89c92a0dfc69a760d4f222631951f34c28
MATLAB
7,137
121
function [ mov ] = recordBrain( M, vcontribs, subjstructs, stimuluscode, stimulusstrcell, range, cmapstruct, viewstruct, filename, pos ) %RECORDBRAIN Capture activateBrain's graphical output into an avi file. % % Iteratively calls activateBrain with an activation data column of % passed activation matrix and...
d22f2875cbf969576f67adb85e92db9389ddb4e36e37a27ea23e1fe98411d34a
MATLAB
7,141
137
%% Line (Trapezoid) disp('######################################'); disp('#### Design a circular trajectory ####'); disp('#### ####'); disp('######################################'); disp(' '); kx = linspace(-5,5, 256)'; ky = linspace(-5,5, 256)'; kz = 0*ky; C = [kx ky kz]; [C_riv, time_ri...
16738c974804a3865abf3aab388b5025f78a91e49c480af8459ee82897b7b1be
MATLAB
7,144
240
function [results] = get_ndRMS(data,layout,IED,sample_freq,bad_channels,varargin) %%% requirements %add the latest version of FieldTrip toolbox %(https://www.fieldtriptoolbox.org/) to your path. %%% ------------ inputs: % data: raw data [channels x time] % layout: electrode location in the grid (e.g. [1,2,3;4,5,6;7,8,...
307ea4d6295003031cd816fa012add2f7f8cdd4a565cd7375eac590d0fad0aca
MATLAB
7,144
323
clear clc close all %%% Compute mTDR using rat FOF data from Pagan et al., 2025 addpath('mbtdr/functionFiles') addpath('mbtdr/functionFiles/tools_kron') addpath('mbtdr/minFunc') addpath('mbtdr') %% plotMarinoResults %%% load rat dataset fileDir = 'Arrays_Pagan/'; load(['data/' fileDir 'dataT_Pagan']) paramFi...
30c02a0fef10fcdd1ef01e4c4bfe947ef3f605415150fced7b44db1d19640d60
MATLAB
7,145
134
%%% shifting_key shifting_key_n z_truncate %%% trform %%% tiling_info.z_pixel tiling_info.x_pixel tiling_info.y_pixel %%% tiling_info.x_overlap tiling_info.y_overlap %%% tiling_info.x_tiles, tiling_info.y_tiles, ~, tiling_info.ch_num tiling_info_xy = [tiling_info.x_tiles, tiling_info.y_tiles]; clear center_po...
cf4afa1cdc23674010832e43adcd9f6154e13aa3d636235b5fe49eef06fd9408
MATLAB
7,145
220
function [posterior, out] = demo_dynamicalSystem () % // VBA toolbox ////////////////////////////////////////////////////////// % % [posterior, out] = demo_dynamicalSystem () % Demo of dynamical system simulation and inversion % % This demo provides a simple example of the simulation and the estimation % for a simple ...
66413d542350aad56933c8ff40dece313b1b5e3f63813d193ba431d487370e2c
MATLAB
7,148
194
function histDataStruct = getHistogramData_KB(hImage,ClimInit) % GETHISTOGRAMDATA Returns data needed to create the image histogram. % The fields inside of HISTDATASTRUCT are: % histRange Histogram Range % finalBins Bin locations % counts Histogram counts % nBins Number of b...
9055f246d0166cf6e455cc45bd1906901f4197abe1420183742cece6cdfb110d
MATLAB
7,148
138
%% Line (Trapezoid) disp('######################################'); disp('#### Design a circular trajectory ####'); disp('#### ####'); disp('######################################'); disp(' '); kx = linspace(-5,5, 256)'; ky = linspace(-5,5, 256)'; kz = 0*ky; C = [kx ky kz]; [C_riv, time_ri...
295bfc5ebd171c45370c76e647110692514bc3c4d227a1621d1ead4550a58e26
MATLAB
7,149
177
function grad = yokogawa2grad(hdr) % YOKOGAWA2GRAD converts the position and weights of all coils that % compromise a gradiometer system into a structure that can be used % by FieldTrip. This implementation uses the old "yokogawa" toolbox. % % See also CTF2GRAD, BTI2GRAD, FIF2GRAD, MNE2GRAD, ITAB2GRAD, % FT_READ_SENS,...
5f889d23c800ccaefc9df25718dc306d1e0fd28a3b4f7c62166d084eefd79d19
MATLAB
7,149
189
function Obj = SOFAload(fn,varargin) %SOFALOAD % Obj = SOFAload(FN) reads the SOFA object OBJ with all data from % a SOFA file FN. % % FN can point to a remote file (containing '://') or to a local file: % Remote file: FN will be downloaded to a temporary directory and % loaded. % Local file: If ...
9246508b0bf360ec76a98777ba1e8fb93cb98134eda50ab0d232a96fa7d2fffc
MATLAB
7,154
265
function [hfig,savename,sortederrs] = PlotFracInliersPerLandmark_ARannotator(varargin) [gtdata,net,pttypes,colors,exptype,... conddata,labeltypes,datatypes,statname,... maxerr,minerr,... hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,... annoterrdata,annotcolor,annoterrprc,plotannfracinliers,... APthresh...
9bbf3190048e957a787782891087795f86a8d93fe54f788eacf01a5a4a9f7050
MATLAB
7,155
178
function checkhessian(problem, x, d) % Checks the consistency of the cost function and the Hessian. % % function checkhessian(problem) % function checkhessian(problem, x) % function checkhessian(problem, x, d) % % checkhessian performs a numerical test to check that the directional % derivatives and Hessian def...
94a2a8500fcfff209b989e5a4f6a97fe6741d2f9e9155364d6a8afcfe1d09b3d
MATLAB
7,156
190
function [obj] = ft_convert_units(obj, target, varargin) % FT_CONVERT_UNITS changes the geometrical dimension to the specified SI unit. % The units of the input object is determined from the structure field % object.unit, or is estimated based on the spatial extend of the structure, % e.g. a volume conduction model of...
9e91f61beb9c250301b10298842e30fe848f35442c5d677affe5984d71d5fffe
MATLAB
7,161
191
function grad = ricoh2grad(hdr) %% RICOH2GRAD converts the position and weights of all coils that %% compromise a gradiometer system into a structure that can be used %% by FieldTrip. This implementation uses the "ricoh_meg_reader" toolbox. %% %% See also FT_READ_HEADER, CTF2GRAD, BTI2GRAD, FIF2GRAD, YOKOGAWA2GRAD_NEW...
37d6414d79cec4f734a9b7b39a4cb5967c5f43196c9f078de7e4fe7582fc077d
MATLAB
7,162
206
function [corr_LxLy_tr,corr_LxLy_te,pvals_corr_LxLy_te] = CBIG_VK2019_crossval(X,Y,signif_LC,grouping,k,nPerms) % This function computes PLS in k-fold cross-validation. % The sample is first divided into training & test set, accounting for the % diagnostic groups. % PLS is computed on the training data to obtain the ...
2915c59d48605f2edb49865eba821345258ad3c4e8564fea09d3fc404d15d199
MATLAB
7,165
188
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Cluster Ictal Signal % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % REFERENCE Kameneva2017_Article_NeuralMassModelsAsAToolToInves.pdf %% First Identify the B,G value range clear A = '5.50'; p_m = '90'; p_v = '12...
a744dbcb406607fc100a5a963f4595adfdb8f73130040b22e0a1bcb7541da41a
MATLAB
7,166
133
%% NATSORTFILES Examples % The function <https://www.mathworks.com/matlabcentral/fileexchange/47434 % |NATSORTFILES|> sorts filenames or filepaths in an array (cell/string/struct) % taking into account number values within the text. This is known as % _natural order_ or _alphanumeric order_. Note that MATLAB's inbu...
c131b2f0acbcad878a70bda5dc8d3702c1ca0f5d4a49ec60cfd0d594cb10afd7
MATLAB
7,169
207
function varargout=shadedErrorBar(x,y,errBar,varargin) % generate continuous error bar area around a line plot % % function H=shadedErrorBar(x,y,errBar, ...) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % % Inputs (required)...
e8c2f38c184c0fb2c3f7a7a5be71fd2ebd5b8a77ca4229564f3103883e36066b
MATLAB
7,169
187
function [dataout] = ft_denoise_prewhiten(cfg, datain, noise) % FT_DENOISE_PREWHITEN applies a spatial prewhitening operation to the data using the % inverse noise covariance matrix. The consequence is that all channels are expressed % in singnal-to-noise units, causing different channel types to be comparable. This %...
2fb6d8cc94e5142cd4b383536d9439b3de7e492686138e21a450779199bdc134
MATLAB
7,170
169
function [h,lh,sh] = myboxplot(ax,data_cell,x_pos,significance_matrix,labels,colors,box_alpha,box_width,label_angle,show_caps,show_outliers,data_avg_symbol,whiskerArgs,medianArgs,avgArgs,significanceArgs) if isempty(ax) ax = gca; end if (nargin < 3) || isempty(x_pos) x_pos = 1:numel(data_cel...
b282944e4c99f43487545a2a2d62d746ec43d394fdb19641d9c7c4abf06de592
MATLAB
7,170
166
function [s, cfg] = ft_statfun_depsamplesFmultivariate(cfg, dat, design) % FT_STATFUN_DEPSAMPLESFMULTIVARIATE calculates the MANOVA dependent samples % F-statistic on the biological data in dat (the dependent variable), using the % information on the independent variable (ivar) in design. % % Use this function by call...
afc28dad492e545760f7608b354ae168fa1d71e51a9cca7991ad063a978803d3
MATLAB
7,177
176
function Aout = h_executeFrameAnalysisCalc3(handles) global h_img3 [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles); fname = get(handles.currentFileName,'String'); [filepath, filename, fExt] = fileparts(fname); zLim(1) = str2num(get(handles.zStackStrLow,'String')); zLim(...
e579b5161b59932c175225dcf134532cfbbc66fe906d24f7f411b47dd409e1e8
MATLAB
7,177
210
function M = fixedrankfactory_3factors(m, n, k) % Manifold of m-by-n matrices of rank k with polar quotient geometry. % % function M = fixedrankfactory_3factors(m, n, k) % % The first-order geometry follows the balanced quotient geometry described % in the paper, % "Linear regression under fixed-rank constrain...
b284aa95c0786b4d0718b019f85507571952661cc012377ab99d13f20b55a989
MATLAB
7,182
267
function [hfig,savename,sortederrs] = PlotFracInliersPerGroup(varargin) [gtdata,net,pttypes,colors,exptype,... conddata,labeltypes,datatypes,statname,... maxerr,minerr,... hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,... annoterrdata,annotcolor,annoterrprc,plotannfracinliers,... APthresh,someallonly,la...
f658b4803c58d9f563e39725c3be6db8e10552b719b03afac16a8f2ac3f58e9e
MATLAB
7,182
188
function trl = includesBasedTrialFun(cfg) % Defines trials with t = 0 at a stimulus onset marker, based on inclusion and exclusion of specific % markers within the trial. % % Simeon Wong %%% REQUIRED INPUTS %%% % cfg.dataset - path to CTF dataset % % cfg.trialdef.t0marker - defines the t = 0 of each tri...
1d08d0c6e305a9b9aa61f769b6c9a50662f05585c00a08656778279d89e337ff
MATLAB
7,183
174
% function emotion2020_analysis_BATCH % % This code include % - Data preparations for delineating indivual ROIs, including WholeBrain, HCP360 ROIs, subcortical regions % - (regularized) linear regression analyses (encoding/decoding) between MRI data % and labels (category, dimension, vision, semantic) associa...
9691b46b73c631dcaadf04a944c1471befe33b882e4079835d5ce7145781548a
MATLAB
7,186
248
function headmodel = ft_headmodel_dipoli(mesh, varargin) % FT_HEADMODEL_DIPOLI creates a volume conduction model of the head % using the boundary element method (BEM) for EEG. This function takes % as input the triangulated surfaces that describe the boundaries and % returns as output a volume conduction model which c...
9a0ef08584ff327e4d22300e7698259b43c1b8eb68ea395c234916e8b7a33026
MATLAB
7,186
235
function markdown2matlab(infile,outfile,varargin) % MARKDOWN2MATLAB converts a Markdown file to a MATLAB script or function. All text % is converted to comments, headings are converted to comment lines starting with %% % sections with code are properly formatted, and words that appear in bold, italic or % monospace ar...
ef8d1709de35133982a9958a206274e47a5b52f7edcf088f809ed57f1150c939
MATLAB
7,187
207
function [N,X,sp] = smoothHistogram(varargin) % HISTOGRAM generates a histogram using the "optimal" number of bins % % If called with no output argument, histogram plots into the current axes % % SYNOPSIS [N,X,sp] = histogram(data,factor,normalize) % [...] = histogram(data,'smooth') % [...] = h...
07c39e6dfdae9c485c095d2de14a18bbe90e877e6a304c4d414f579b04f09b52
MATLAB
7,188
162
function CBIG_AuthorTopic_VisualizeComponentsOnBrainSurface(paramsPath, ... outputDir, discretizationRes, minThresh, maxThresh, ... colorscaleName, doRemoveSmallClusters) % CBIG_AuthorTopic_VisualizeComponentsOnBrainSurface(paramsPath, ... % outputDir, discretizationRes, minThresh, maxThresh, ... % colorsca...
a10fcb97c484f46d6c6d1ee0fd531764c70c9bae6f57121a2af7699e0c37ee39
MATLAB
7,191
204
function [EEG ] = pop_loadeeg_lan(filename, filepath, range_chan, range_sweeps, range_typeeeg, range_response, datformat); % EEGLAB origial scripts % % comvertions per Pablo Billeke % 10.11.2010 % command EEG = []; %command = ''; if nargin < 1 % ask user [filename, filepath] = uigetfile('*.eeg;*.EEG', 'Choose an ...
760b0d72794e5f0d0f200bb9a4001c2b12228bd4c61d623661d2680653301838
MATLAB
7,192
248
function headmodel = ft_headmodel_dipoli(mesh, varargin) % FT_HEADMODEL_DIPOLI creates a volume conduction model of the head % using the boundary element method (BEM) for EEG. This function takes % as input the triangulated surfaces that describe the boundaries and % returns as output a volume conduction model which c...
0e8aaef3e7ab3bff64242a7967c490779bcffe0af1308925bb81991a93cde4a3
MATLAB
7,194
157
classdef TrackerCreateInfo % Represents the information needed to create a 'fresh' tracker. % This is meant to replace the "augmented class" cell array data structure % that used to be used for such info. Having it be a proper class allowed % better type checking and leads to more readable code. However, we s...
331268fdb5b86c8a19922709ad8a97755a53eb0be52edfdc55958534e55bfb49
MATLAB
7,194
187
function [features, values_m, values_a] = MARA_extract_time_freq_features(EEG) % function [features, values_m, values_a] = MARA_extract_time_freq_features(EEG) % % values_m = avg. resid value btw 20 and 50 Hz % values_a = avg. resid value btw 8 and 13 Hz % features = list of components with bumps ...
a7cf1c7acca22b215a7c5489bf13fdde79877c8421331b9997a4137cd579ffba
MATLAB
7,196
134
%%% shifting_key shifting_key_n z_truncate %%% trform %%% tiling_info.z_pixel tiling_info.x_pixel tiling_info.y_pixel %%% tiling_info.x_overlap tiling_info.y_overlap %%% tiling_info.x_tiles, tiling_info.y_tiles, ~, tiling_info.ch_num tiling_info_xy = [tiling_info.x_tiles, tiling_info.y_tiles]; clear center_po...
c1399da27fb66e3bf66c31a61a60028a5a2b44837b3ca73f675942852ea20bd0
MATLAB
7,196
173
%% % ================= KEYPRESS ANALYSIS ================= %% clear all; close all; clc; %% for s = 1:21 if s < 10 sub = strcat('P0',num2str(s)); else sub = strcat('P',num2str(s)); end if sub == "A09" || sub == "A15" runs = [1:5]; else ru...
886830c73d54f76d0aa6d89952989ad6cc1beb3244b0da0c4a56be1afa437210
MATLAB
7,200
189
% Function that generates the spikes in the input layer. % Chengcheng Huang's code: % https://github.com/hcc11/SpatialNeuronNet % https://github.com/hcc11/FI_SpatialNet function sx=genXspk(p,Nx,T) % p: param struct % sx=genXspk(stim_type,rX, Nx,cx,sigmac,Nsource,T,dt,taucorr,varargin) switch p.stim_type case 'Lo...
9f88154d6c02443de91927666eea49ddafa36d72410d56935c7796f3300fa7a1
MATLAB
7,206
196
function [label] = atlas_lookup(atlas, pos, varargin) % ATLAS_LOOKUP determines the anatomical label of a location in the given atlas. % % Use as % label = atlas_lookup(atlas, pos, ...); % % Optinal input arguments should come in key-value pairs and can include % 'method' = 'sphere' (default) searches surrou...
90c49c09b97857afc6a9962764e73dd8052fc5d71bb923ca8e350f9a09d59107
MATLAB
7,208
164
%% Compare wave dynamics with task outcome % Do analysis by trial type as well as touch times %%% Spatial map of traveling wave FG = struct(); win = 1; win = [win win+floor(min(Exp.TrialEnd-Exp.TrialStart)/20)]; %Lets look at the full trial response FG.Hit = waveAnalysis(Waves.wavesHit,win); FG.CR = waveAnal...
0fc9cb18d4cd1e9f49a82ff1cee70990b134ab787c6e91ae77477343cd4faf8a
MATLAB
7,210
210
function [result, M] = ft_warp_optim(input, target, method) % FT_WARP_OPTIM determine intermediate positions using warping (deformation) % the input cloud of points is warped to match the target. % The strategy is to start with simpelest linear warp, followed by a more % elaborate linear warp, which then is followed b...
86fdb6461b0c26549169d30d45a63c47f3b67b32ed7c8135acfb7c783f363942
MATLAB
7,212
208
function curr_net = CBIG_Plot17NetworksRearrCorrMat_WhiteGrid_newscale(lh2lhcorrmat, lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix) % curr_net = CBIG_Plot17NetworksRearrCorrMat_WhiteGrid_newscale(lh2lhcorrmat, lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix) % Example : CBIG_Plot17NetworksRearrCorrMat_Wh...
ba8dc853ff7d1f492c7926f9a10876f0adbd31d64a66a5b91decd0a1dd9a548a
MATLAB
7,212
255
function [h] = plotDensity(f_fname,g_fname,u,n_t,options,dim,pX,gX,pY,gY) % plot predictive density % function [hp] = % plotDensity(f_fname,g_fname,u,n_t,options,dim,pX,gX,pY,gY) % IN: % - f_fname: name/handle of the evolution function % - g_fname: name/handle of the observation function % - u: input to the sys...
f064912c317339d9e61e890880087e20f96a094b4add047602a270a8ae9b0d29
MATLAB
7,213
191
function [mri] = align_ctf2acpc(mri, opt, template) % ALIGN_CTF2ACPC performs an approximate rigid body alignment of the anatomical % volume from CTF towards ACPC coordinates. Only the homogeneous transformation % matrix is modified and the coordsys-field is updated. % % Use as % mri = align_ctf2acpc(mri) % mri = ...
4f92733c6356d3efd4cac4a259ddf6d05ef659bb340724590cee577996520846
MATLAB
7,214
190
%% Demo of what constitutes plausible sparsity prior for linear regression % MODEL: y = Ax + noise; s.t. card(x) = k % % ============================================================================= % % MODEL: y = Ax + noise; s.t. card(x) = k % % QUESTION: what constitutes a "plausible" sparsity-inducing prio...
9b597e8c856427f0549686acd7658bb5ee704f3e81aa539b94a0e0ff45ac18c4
MATLAB
7,216
258
% this script displays the voltage trace from the .wcp file from a patched % cell. % It imports the first five (V input, I input, light TTL output, % camera frame input, blue light activation TTL input) channels % Applies a gaussian filter to data. % Returns dummy data for ALL the returned (and thus required) variab...
321ab433c16ff8c5fcfb4dc5266305313798930e9a70b54a726080e044d7ad45
MATLAB
7,218
173
% Wrapper script to turn parcellation files into FreeSurfer annotation % files. Then you can calculate surface area of parcellations! % % Assumes ind_parcellation output from Kong2019 CBIG pipeline. % Written by M. Peterson, Nielsen Brain and Behavior Lab %To run: % 1. Claim computing resources using salloc (ex: `sa...
788ffdec25a9b0fd150315344c372c2e8b6b4d55ae7a03dd7722ae629591af7f
MATLAB
7,219
143
function h_spineAssignment3(handles2, flag) global h_img3; [currentInd2, handles2, currentStruct2, currentStructName2] = h_getCurrendInd3(handles2);% "2" is "Current" structNames = fieldnames(h_img3); for i = 1:length(structNames) if ~strcmpi(structNames{i}, currentStructName2) && ~strcmpi(structNames{...
86c28acff0617aa6cef4a90be289bb04b87050d3e5933d0535c45fa0f26427ca
MATLAB
7,219
184
function p = prepare_roidata_individual(param) % % This script was written for creating preprocessed MRI data for cowen & % keltner movie clip presentation data. % % written by Tomoyasu Horikawa horikawa-t@atr.jp 2020/03/11 % % % Called from prepare_roidata.m % % Required functions: % setdir.m, merge.m % % Required ...
83b72419248eb3938a8c806e0085fee755f17d79c13f3b94d25c47a1a8aea269
MATLAB
7,226
268
function hh = myErrorbar(varargin) %MYERRORBAR Adds errorbars to existing plot (unlike errorbar.m, which creates a new plot, and allows only bars for y values) % MYERRORBAR(X,Y,L,U) adds error bars to the graph of vector X vs. vector Y with % error bars specified by the vectors L and U. L and U contain the % ...
fd702ab002222d8b7b753b7084afe88f1606f9224c10a82f515ab4bd5ac2a351
MATLAB
7,229
245
function spm_run_bms_vis(varargin) % Show results for Bayesian Model Selection Maps % SPM job execution function % takes a harvested job data structure (or no input) and calls SPM % functions to show results from Bayesian Model Selection of % Log. Evidence Maps % % Input: % Varargin - can be harvested job data stru...
e693e9aaa37086b9a11080f6a78dbe452b6d15d6a565be4fd1ec3b10d7b8d343
MATLAB
7,232
286
function [postdata,ppobj] = RunPostProcessing_HeatmapData(hmdir,varargin) ncores = feature('numcores'); if isdeployed, fprintf('Starting RunPostProcessing_HeatmapData, ncores = %d...\n',ncores); end savefile = ''; trxfile = ''; nframes = []; lblfile = ''; expname = ''; expdir = ''; nviews = 1; npts = []; d = 2; sca...
e7c303c6e26480fea4f659c38fff83cba88dccf7ddab68ef0c04710c35812d7c
MATLAB
7,232
245
addpath('../generic/'); addpath(genpath('../az_matlab_files/')); %% ndatasets = 8; names = {'all','Tin','Tout','Min_C','Min_i','allButTin','allButTinOut'}; AUC = nan(ndatasets, length(names)); for idataset = 1:ndatasets dt_ms = 25; % 100 % dt_ms = 50; dataset = idataset; dat = get_data(dt_ms,[]...
cbeab5be9c69cba299159f0c1aa6092221e632e629878ee9b60bca25e3a65fc7
MATLAB
7,234
214
function [R, Rm] = rotate_3D(V, mode, theta, u, angle_unit) %% rotate_3D : function to compute the rotation of a vector or an array of vectors in 2D or 3D space. % % Author && support : nicolas.douillet (at) free.fr, 2017-2020. % % % Syntax % R = rotate_3D(V, mode, theta); % R = rotate_3D(V, mode, theta, u); %...
67e3a61368638945fca22dd0376b54171e47fb4a054324aa6047414a22f5f1d1
MATLAB
7,238
183
function [s, cfg] = ft_statfun_depsamplesFunivariate(cfg, dat, design) % FT_STATFUN_DEPSAMPLESFUNIIVARIATE calculates the univariate repeated-mesures ANOVA % on the biological data (the dependent variable), using the information on % the independent variable (ivar) in design. % % Use this function by calling one of th...
d077bde95fa5b17a5ac030cca7725a023e2f9c70a976421c143d19460d53a815
MATLAB
7,239
183
function [s, cfg] = ft_statfun_depsamplesFunivariate(cfg, dat, design) % FT_STATFUN_DEPSAMPLESFUNIIVARIATE calculates the univariate repeated-mesures ANOVA % on the biological data (the dependent variable), using the information on % the independent variable (ivar) in design. % % Use this function by calling one of th...