sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
132f8304563dce6d4ef11368b4c4b8cbe4652c9691eed6b40ef059c785b348c8 | MATLAB | 8,922 | 251 | % MFX Multifrontal factorization.
%
% This is an implementation of the nested dissection multifrontal method in
% the style of the recursive skeletonization factorization; indeed, both can
% be viewed in the same algorithmic framework, with the former specialized to
% sparse matrices and the latter to stru... |
5a311d49439e01d8af0c4ef39a802b2feae6f645ec309183389a18e60ec6cf1c | MATLAB | 8,928 | 193 | function [ titleStr, settings, results ] = createSequenceVariable( dataview, settings )
% This function creates a sequence-variable. A sequence variable assigns
% a successor to each datapoint (the next datapoint in the sequence).
%
% Typically sequences are used to connect datapoints with their se... |
fd5e1033d5c34410d0fe8b756072c4ccbf0ff528d20d8651dfe2f49a9b47d1e5 | MATLAB | 8,935 | 243 | function check_processing_status(data_folder,varargin)
% Check df of basepaths for processing steps required for analysis
%
% input:
% df: csv containing basepaths for checking
% output:
% saves session_check.csv to savepath indicating missing items from
% basepath with 1 being found and 0 being not found.
... |
22311524a71dbec3f2111c7640382c17252c93157427981899a460db91ef0e66 | MATLAB | 8,936 | 210 | function s=exp2fit(t,f,caseval,lsq_val,options)
% exp2fit solves the non-linear least squares problem exact
% and using it as a start guess in a least square method
% in cases with noise, of the specific exponential functions:
% --- caseval = 1 ----
% f=s1+s2*exp(-t/s3)
%
% --- caseval = 2 (general case,... |
3ef044e3a162a4a123278935addd5cf9aacb1c8e644f4d2587bdc309df406e3e | MATLAB | 8,936 | 253 | function M = elliptopefactory(n, k)
% Manifold of n-by-n psd matrices of rank k with unit diagonal elements.
%
% function M = elliptopefactory(n, k)
%
% A point X on the manifold is parameterized as YY^T where Y is a matrix of
% size nxk. As such, X is symmetric, positive semidefinite. We restrict to
% full-rank... |
70f0086c4f432ad38dac34b84926c1246959df0b3949618fc4471d91ef0df13d | MATLAB | 8,942 | 220 | function [cfg, artifact] = ft_artifact_clip(cfg, data)
% FT_ARTIFACT_CLIP scans the data segments of interest for channels that clip. These
% artifacts are detected by the signal being completely flat for a given amount of
% time.
%
% Use as
% [cfg, artifact] = ft_artifact_clip(cfg)
% with the configuration options
... |
e9ebe2668574f3b1c777e6fda1b06eda17be25cfef28f0fe58aaff1f6b3b867f | MATLAB | 8,951 | 426 | clear
clc
% This M-file creates an animation of individual muscles as well as the equivalent muscles, including joint moments and velocities displayed as a circular array.
f = 0;
cmap = [[0 1 0]; [0 0 1]; [0 1 1]; ...
[0.4940 0.1840 0.5560]; [0.4660 0.6740 0.1880]; ...
[0.3010 0.7450 0.9330]; [0.6350... |
ae7a9d6c5d14db633e375c3ac0de6935118f72edf757b91d7e69f79163db6f3c | MATLAB | 8,956 | 233 | function [predictor_maps, predictor_labels] = fcn_generate_CommModel_Predictors_wy(sc_matrix, coords, opts)
% FCN_GENERATE_COMMMODEL_PREDICTORS_WY Build selected communication-model predictor maps.
%
% This version accepts GUI-selected predictors and generates only the selected
% communication-model maps. The output la... |
b6c5d6166db407c817ea84a8812873346dad716fff8a8f651506ef155db04532 | MATLAB | 8,957 | 193 | function visualize_result(pos, tri, varargin)
% input
% pos: num_voxel * 3
% tri: num_tri * 3
% varargin:
% value:
% source -- the ground truth, the index of the patch location
% FaceAlpha -- the alpha for the value
%... |
f8acaa7fc9f4ca43ce1723171815418a4812be5edd48ac95ac8abf41fcdd582c | MATLAB | 8,959 | 251 | % 2nd step of the multivariate moderation model framework:
%%% Determination of the optimal number of principal components %%%
% The idea here is to reduce the fMRI contrast in the chosen voxels
% to a number of principal components and use them in a multivariate regression.
% The optimal number of principal componen... |
11317adbf3368696d0389a113b19eb528a369cfbf9d29ccb35dd526a6ebc33e7 | MATLAB | 8,965 | 233 | function [] = plot_ground_truth_global_remapped(folders,method,option)
total_number{1}(1:3) = 0;
total_number{2}(1:3) = 0;
for nfolder = 1:5
for nshuffle = 1:2
cd(folders{nfolder})
if nshuffle == 2
cd 100_global_remapped_shuffles
number_of_global_remapped_... |
a7219a656d0d350e735cb96398a909d813539465b7fc91bec88db5bb8310560f | MATLAB | 8,970 | 329 | function [x,X,n_sq_x,n_sq_y,ind_orig,ind_x,ind_y] = extract_grid(I,wintx,winty,fc,cc,kc,dX,dY,xr,yr,click_mode);
if nargin < 11,
click_mode = 0;
end;
if nargin < 10,
xr = [];
yr = [];
end;
map = gray(256);
minI = min(I(:));
maxI = max(I(:));
Id = 255*(I - minI)/(maxI - minI);
figure(2);
image(Id);
c... |
cd2f1cc6aaf42f328d63c28d8f91c0f6de66522b697db84248d6bfbd6f386b29 | MATLAB | 8,970 | 245 | function [vhdr] = 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
% vhdr = read_brainvision_vhdr(filename)
%
% See also READ_BRAINVISION_EEG, READ_BRAINVISION_VMRK
% Copyright (C) 2003-2019, Robert Ooste... |
a59a01be29a3ec8326740319051848d7bea99b957a427b69bb655b5efe46cab0 | MATLAB | 8,971 | 366 | function [ fp fn tp matchlist fplist fnlist ] = ...
wlProc_evalEventsVsTruthBinned(evtruth, evtest, bandlim, snrlim, ...
comparefunc, binsecs, huntbins)
% function [ fp fn tp matchlist fplist fnlist ] = ...
% wlProc_evalEventsVsTruthBinned(evtruth, evtest, bandlim, snrlim, ...
% comparefunc, binsecs, huntb... |
acb686174a3dea407e029458b7b4ae6eebdd3f3ed144c4dbefd43fc2bc4d4885 | MATLAB | 8,975 | 216 | % PopulateResponseVariables.m
% Sarah West
% 6/6/22
% Run with RunAnalysis, on each mouse. Not doing anything fancy with the
% input loops because this is a very specific use-case function.
function [parameters] = PopulateResponseVariables_forFluorescence(parameters)
MessageToUser('Populating ', parameters);
... |
04c29a5d6e06e1f74add25556ed689c81f3e1004262b7cc020f16d4ecbe3892d | MATLAB | 8,977 | 300 | function [DCM] = vba2dcm(posterior,out,DCM,TR)
% maps VBA inversion output to DCM structure
% function [DCM] = vba2dcm(posterior,out,DCM,TR)
% IN:
% - posterior/out: I/O structures of VBA inversion.
% - DCM: original DCM structure (see spm_dcm_specify.m). If empty, it is
% created with default arguments.
% - TR... |
921ddfbdc84fee3758e05b934ef3c35d915ba8b5c004d65c8d49ee9a7d6f7067 | MATLAB | 8,978 | 230 | function [resliced] = ft_volumereslice(cfg, mri)
% FT_VOLUMERESLICE flips, permutes, interpolates and reslices a volume along the
% principal axes of the coordinate system according to a specified resolution.
%
% Use as
% mri = ft_volumereslice(cfg, mri)
% where the input MRI should be a single anatomical or functio... |
55c25a7f83cbb60fc16936628620d3b2f875a65e40b587f7b0f2d20f44e65348 | MATLAB | 8,981 | 290 | function [ CF ] = Cost_Function (xopt)
NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat');
NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial;
G = 2; % Muscle Group Number (G = 1 to 9)
x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.a1;
x0(2) = Nine... |
c4b3347fcdd6330ced623011d2393d2b26dcb1b68654cc1f54183ae38d3f834a | MATLAB | 8,987 | 247 | %% MVGC demo
%
% Demonstrates typical usage of the MVGC toolbox on generated VAR data for a
% 5-node network with known causal structure (see <var5_test.html |var5_test|>).
% Estimates a VAR model and calculates time- and frequency-domain
% pairwise-conditional Granger causalities (also known as the "causal graph").
% ... |
55be5278afa5b1e8fd96fcd6eca1fac75333aab92b5a29aa9d656a02c617bb13 | MATLAB | 8,990 | 279 | function mesh = prepare_mesh_headshape(cfg)
% PREPARE_MESH_HEADSHAPE
%
% Configuration options:
% cfg.headshape = a filename containing headshape, a Nx3 matrix with surface
% points, or a structure with a single or multiple boundaries
% cfg.smooth = a scalar indicating the number of non-... |
e6a7b4de8cee66ba6cc98f6445ca94917402b2cd04992f1196b785e435cc4510 | MATLAB | 8,996 | 214 | function [cfg, movement] = ft_detect_movement(cfg, data)
% FT_SACCADE_DETECTION performs detection of movements such as saccades and
% microsaccades, but also joystick movements, from time series data over multiple
% trials. Different methods for detecting movements are implemented, which are
% described in detail bel... |
d2af0cb3b1e980af88419599c61850e249bae8da6622a6c3fb90749057feb939 | MATLAB | 9,002 | 223 |
function [LCM_CorrectedTable] = LCM_Met_Quant_MD_V2(LCM_Table,TE,TR,LCM_w_CONC) %will have to rename file name for the function to work
%% Inputs
% LCM_Table - structure with the LCModel outputs and the fGM, fWM and fCSF
% added from Gannet (or however)
% TR/TE - from acquisition
% LCM_w_CONC - the water conce... |
e5626f70b93b40ce3e86569d076ce2b6523574d20420c879ea884ca68060b425 | MATLAB | 9,005 | 219 | function EEG = myEpoching(EEG, varargin)
% EEG = myEpoching(EEG, varargin)
% wrapper function for epoching data. calls pop_creabasiceventlist,
% pop_binlister, pop_epochbin. It can either baseline to a period within
% the epoch defined (using eeglab), or can baseline to a period within a
% separate epoch (using separat... |
df062d2f004b1b05204fa7c205c35006b21252c0d1c44dcada945411a8cf00ea | MATLAB | 9,011 | 239 | %% for making figure of all narrowband TWs detected with GP analysis.
% plots LFP, narrowband LFP, raster of deteted waves, and histogram of wave
% times
clear;clc
dataPaths{1} = 'D:\Grids\S1-Baclofen\2022-04-19_Baclofen\3-baseline';
dataPaths{2} = 'D:\Grids\S1-Baclofen\2022-04-21_Baclofen-Attempt\1-baseline';
... |
6f891240020c6457b80c56ad37fe8eeaf6b1cba805eb0efcda28176c3d14b192 | MATLAB | 9,014 | 252 | %% Prediction Likelihood
%
% Produces a violin plot of the supplied field of the errorStruct. Each
%value within the error field is treated as an observation, and the
%distribution of errors gives shape to the violin. The mean and median of
%the violin/distribution is co-plotted.
%
%This script may be used for... |
e98bd88498e8bbc2adee1ce772301392821056dd1355fc014e6c56ea92622f3c | MATLAB | 9,016 | 287 | function [ CF ] = Cost_Function (xopt)
NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat');
NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial;
G = 1; % Muscle Group Number (G = 1 to 9)
x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.a1;
x0(2) = NineMu... |
ba6d99ddeb9e9bde7f2c64e251e20dfbf5d959ed423a68476ed8cfa5117d5a25 | MATLAB | 9,017 | 286 | function [ CF ] = Cost_Function (xopt)
NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat');
NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial;
G = 8; % Muscle Group Number (G = 1 to 9)
x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.a1;
x0(2) = NineMu... |
33e44b00361bdee3a1215d41c263561ebd3d569defbe492a80cac9a05e66daa6 | MATLAB | 9,018 | 232 | function results = predict_selectededges(datadir, kerneldir, resultsdir, varN, iterN)
% results = predict_selectededges(datadir, kerneldir, resultsdir, varN, iterN)
%
% Selected Edges method for predicting from time-averaged FC matrices, as
% described in Rosenberg et al. 2018 & Shen et al. 2018
% main prediction part ... |
af80df861adc5a6585b90b7a1c489f438388f2506375d57dd8127352e1794807 | MATLAB | 9,019 | 220 |
tiling_info_xy = [tiling_info.x_tiles, tiling_info.y_tiles];
clear center_points
cnetertile_x = round(tiling_info.x_tiles./2);
cnetertile_y = round(tiling_info.y_tiles./2);
[center_points.x, center_points.y] = ind2sub(tiling_info_xy,find(ones(tiling_info.x_tiles, tiling_info.y_tiles)));
center_points.xxx = (... |
cfe1493aaccfcb37d60fc74b4d9536013cce6d876b62e7880d2a47a23bd7d940 | MATLAB | 9,022 | 258 | addpath(genpath('Utils'))
addpath(genpath([pwd '/PlottingFunctions']));
clear;
DMD_folder = ['D:\Dropbox\Bhandawatlab_Drexel Dropbox\Bhandawat_Lab_Transfer\' ...
'Liangyu\Lateral Horn Project\DMD Experiments\'];
meta.behaviorPath = DMD_folder;
meta.stimulusPath = [DMD_folder '\Stimulus Files\'];
meta.DLC.s... |
0a63f9528ea7225a9faf9958ad8c4d2bfd7875290afab222efa4e2cfe983a85f | MATLAB | 9,025 | 248 | % ID Interpolative decomposition.
%
% [SK,RD,T] = ID(A,KMAX) produces a structure-preserving approximation of A
% of rank K = MIN(KMAX,RANK(A)) via the skeleton and redundant indices SK and
% RD, respectively, and an interpolation matrix T such that
% A(:,RD) = A(:,SK)*T + E, where LENGTH(SK) = K and NORM(... |
f79eed851412616b96a22b092e87b0c2bf1bc23be8ee427fca1f1edf0dcf0d78 | MATLAB | 9,028 | 250 |
%__________________________________________________________________________
% violin_2.m - Simple violin_2 plot using matlab default kernel density estimation
% Last update: 10/2015
%__________________________________________________________________________
% This function creates violin_2 plots based on kernel densit... |
018024a12389a494654c935257a259194c04fdb83ef89751accefa7f05613c36 | MATLAB | 9,031 | 226 | function [data, varargout] = femdata_stnd_BLT(mesh, varargin)
% FEMDATA_STND_FD Calculates data (phase and amplitude) for a given standard
% mesh at a given frequency (Hz). Outputs phase and amplitude in the
% structure DATA.
%
% SYNTAX:
% [DATA] = FEMDATA_STND_FD(MESH, FREQUENCY)
% [DATA] = FEMDATA_STND_FD(MESH... |
1f194577dcea4472478a2034ce2a795daa5eadcd6dfeb41e0d202912fb789728 | MATLAB | 9,031 | 279 | function [centers,mincenter,mindist,q2,quality] = kmeansElkan(data,initcenters,method)
% Kmeans clustering using Elkan's triangle inequality speedup
% output: final centers
% input: data points and initial centers
% if initcenters is a number k, create k centers and start with these
% otherwise, use centers given ... |
621ae3bc600b8e2fec3d09147625617f43e872e7018410dcb64f628578652587 | MATLAB | 9,031 | 244 | function LEDNN_autoestimate_weight_positions(filename,shi,saveflag)
if(nargin<3)
saveflag = 1;
end
inf = h5info(filename);
%%
transform = NaN;
corners_out = zeros(320,320,8,8);
zeros_out = zeros(320,320,8,8);
ones_out = zeros(320,320,8,8);
for i = 1:8
for j = 1:8
corners_out(:,:,i,j) = loa... |
c96cc18bb8f4dd87199a9b3aeb15a242825ba72a7a89e8cf831640e817351403 | MATLAB | 9,039 | 197 | function [mri, hdr] = read_ctf_mri(filename)
% READ_CTF_MRI reads header and image data from a CTF version 2.2 MRI file
%
% Use as
% [mri, hdr] = read_ctf_mri(filename)
%
% See also READ_CTF_MRI4
% Copyright (C) 2003-2010 Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% f... |
e8a9d7181106387c6c1d8814128e6583ed28b92041df2e66e7eaa01b647fe9af | MATLAB | 9,043 | 274 | function [sens] = ft_appendsens(cfg, varargin)
% FT_APPENDSENS concatenates multiple sensor definitions that have been processed
% separately.
%
% Use as
% combined = ft_appendsens(cfg, sens1, sens2, ...)
%
% A call to FT_APPENDSENS results in the label, pos and ori fields to be
% concatenated, and the tra matrix to... |
b4fbed4b52184d59ba5a7f398c0db1cd43c16db3bb10a75d6bd361833c271388 | MATLAB | 9,047 | 236 | function [mesh, cfg] = ft_prepare_mesh(cfg, data)
% FT_PREPARE_MESH creates a triangulated surface mesh or tetrahedral/hexahedral
% volume mesh that can be used as geometrical description for a volume conduction
% model. The mesh can either be created manually from anatomical MRI data or can be
% generated starting fr... |
fd454c38e189e794369f9624694a1a007551e9c37035bbf7088703c49bcac744 | MATLAB | 9,049 | 274 | function [sens] = ft_appendsens(cfg, varargin)
% FT_APPENDSENS concatenates multiple sensor definitions that have been processed
% separately.
%
% Use as
% combined = ft_appendsens(cfg, sens1, sens2, ...)
%
% A call to FT_APPENDSENS results in the label, pos and ori fields to be
% concatenated, and the tra matrix to... |
8dc8baa7c4a1a6fdba61f0828d747524543fd0517052e5ee4d1ce2777824010c | MATLAB | 9,052 | 239 | function [pages] = viewSensors(rawdata, subj_location, numView)
try
has_subj_ind = isempty(subj_location);
catch
warning('subj_location poorly defined (viewSensors)')
subj_location = 1;
end
% set defaults
if nargin < 3 || isempty(numView)
numView = 10; % default 10 sensor plots per page
elseif ... |
2a2bcd7196964bc17aaeec2f6578ae349d385942eea098a0abe2750fe87e62ed | MATLAB | 9,059 | 222 | function [FCBrain, GHeader] = y_SCA_Surf(AllVolume, ROIDef, OutputName, AMaskFilename, IsMultipleLabel, ROISelectedIndex, GHeader, CUTNUMBER)
% [FCBrain, GHeader] = y_SCA_Surf(AllVolume, ROIDef, OutputName, AMaskFilename, IsMultipleLabel, ROISelectedIndex, GHeader, CUTNUMBER)
% Calculate Functional Connectivity by Seed... |
3c36320f4735d064b6d561456a2fe1e560d4343aaa5ccaa5a79884b5be1703d3 | MATLAB | 9,062 | 234 | function grad = yokogawa2grad_new(hdr)
% YOKOGAWA2GRAD_NEW 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 new "yokogawa_meg_reader"
% toolbox.
%
% See also FT_READ_HEADER, CTF2GRAD, BTI2GRAD, FIF2GRAD... |
059cfa15bb9edbefb2b86996c6ac3746fd767903a6cbd7721b133133d90569b7 | MATLAB | 9,067 | 282 | function matlab2markdown(infile, outfile, varargin)
% MATLAB2MARKDOWN converts a MATLAB script or function to Markdown format. All
% comments are converted to text, comment lines starting with %% are converted to
% headings, sections with code are properly formatted, and words that appear in bold,
% italic or monospac... |
af743f18f4f4e68e2401b9e67575de2d23ed568fca7088ec11899c3d6c1f7524 | MATLAB | 9,078 | 271 | % Plots preplay decoding results from shuffling cell identities
%
% The script runShuffledDecoding.m generates the files this script plots.
%% Choose which varied decode parameter result to analyze
shuffleToPlot = "singleClusterCells";
%% Load results
switch shuffleToPlot
case "clusterIndependent"
var... |
b11237cf04558905d962def24dda7b1ead76ba5a5b07e969f61ff6194bb14a08 | MATLAB | 9,082 | 204 | function [ titleStr, settings, results ] = tsneOnCurrentSelection( dataview, settings )
% Embed points in current pointfilter using
% <a href="matlab:web('https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding', '-browser')">(Barnes-Hut-)t-SNE</a>.
%
% PCA-dimensions can be 0 (n... |
4c85926b132d1a4e9804581635ace6d461e09de17bf4a56572b5e58c55fb142c | MATLAB | 9,089 | 296 | function [B,ndx,dbg] = natsortfiles(A,rgx,varargin)
% Natural-order / alphanumeric sort of filenames or foldernames.
%
% (c) 2014-2022 Stephen Cobeldick
%
% Sorts text by character code and by number value. File/folder names, file
% extensions, and path directories (if supplied) are sorted separately to
% ensure that s... |
483904b8acf9784620cbf66ed2f12c6e571c5afcf4deef321e5aaf3857643bc1 | MATLAB | 9,091 | 214 | function [inside] = ft_inside_headmodel(dippos, headmodel, varargin)
% FT_INSIDE_HEADMODEL locates dipole locations inside/outside the source
% compartment of a volume conductor model.
%
% Use as
% [inside] = ft_inside_headmodel(dippos, headmodel, ...)
%
% The input should be
% dippos = Nx3 matrix with dipole... |
5ebf7862c7ad03ac7451d0ddd187896c7bd2f3f255d57b85fee10eac6b417cc2 | MATLAB | 9,094 | 214 | function [inside] = ft_inside_vol(dippos, headmodel, varargin)
% FT_INSIDE_VOL locates dipole locations inside/outside the source
% compartment of a volume conductor model.
%
% Use as
% [inside] = ft_inside_vol(dippos, headmodel, ...)
%
% The input should be
% dippos = Nx3 matrix with dipole positions
% hea... |
1bf4d187de515b1bf2c1af58d04508d42d9be5a571dbd1ae9c0a25b7f500c6ec | MATLAB | 9,096 | 280 | function logDat = SleepLogREM(hsdfFile, varargin)
% This identifies SWS and sleep spindle episodes using ECoG (eeg) and EMG
% signals recorded in an hsdf file (i.e., low-pass filtererd and downsampled
% version of hsd file). Based on Robert Schmidt's "return_Spindle_episodes"
% used for Nico's Arky paper.
% This also... |
552414c680771931de11b6123bb253c359a1731c08021bf54c14d20539273bc8 | MATLAB | 9,096 | 342 | function [xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk,dxpdalpha] = project_points2(X,om,T,f,c,k,alpha)
%project_points2.m
%
%[xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk] = project_points2(X,om,T,f,c,k,alpha)
%
%Projects a 3D structure onto the image plane.
%
%INPUT: X: 3D structure in the world coordinate frame (3xN matrix for N points)... |
904833e8420f3867b659bf1152e39438db3e8338a93cceb60591a2aa829bccb2 | MATLAB | 9,096 | 143 | function [PixelMax_Output] = Multi_Modality_PixelMax(...
myPool,OS,CorrAmp_Output,ImagingInfo,EventDetectionSettings,MarkerSetInfo,DisplayOn,EpisodeNumber,MappingLabel)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%... |
de22f7f7da10661d1af9012b3522b564376aa758ff80476481210efadbbf3102 | MATLAB | 9,096 | 228 | function [stat] = ft_freqstatistics(cfg, varargin)
% FT_FREQSTATISTICS computes significance probabilities and/or critical
% values of a parametric statistical test or a non-parametric permutation
% test.
%
% Use as
% [stat] = ft_freqstatistics(cfg, freq1, freq2, ...)
% where the input data is the result from FT_FRE... |
0aff41611c9e4732c5ef6fdb83931965585ca8e42f1c41eb91423e4d60209a66 | MATLAB | 9,097 | 214 | function [ALFFBrain_AllWindow, fALFFBrain_AllWindow, Header] = y_alff_falff_Window(WindowSize, WindowStep, WindowType, AllVolume,ASamplePeriod, HighCutoff, LowCutoff, AMaskFilename, AResultFilename, TemporalMask, ScrubbingMethod, Header, CUTNUMBER)
% Calculate dynamic ALFF and fALFF
% FORMAT [ALFFBrain_AllWindow, ... |
2b44a8fa6f209014ed14afa343c4bddd597c8667fd9956fc6e4f9a3ce8f743de | MATLAB | 9,098 | 259 | function [nn,ctrs] = myhist3(varargin)
% almost the same as Matlab's hist3, except it can take weights.
i = find(strcmpi(varargin,'weights'));
if ~isempty(i),
weights = varargin{i(end)+1};
varargin([i,i+1]) = [];
end
[cax,args,nargs] = axescheck(varargin{:});
if nargs < 1
error('stats:hist3:TooFewInputs', 'R... |
5dfc0393e0f222ec6a39094a001132a4b34364ecd9aa539ca4591fc7a9915a25 | MATLAB | 9,100 | 251 | function [data] = ft_rejectcomponent(cfg, comp, data)
% FT_REJECTCOMPONENT backprojects an ICA (or similar) decomposition to the
% channel level after removing the independent components that contain
% the artifacts. This function does not automatically detect the artifact
% components, you will have to do that yourse... |
f238921010ecd10e5515e60e599c5c7c17a5ae6a4e8558cb254503421dcf47e8 | MATLAB | 9,100 | 254 | % AUTHORSHIP
% Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
% Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com>
% Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu>
% Provided by the Herzenberg Lab at Stanford University
% License: BSD 3 clause
%
classdef ToolB... |
12a9ff4cde280d7951b168751be73dcf94ef96d4176e6cc6e0be881c80c03724 | MATLAB | 9,102 | 271 | function C = convnFast( A, B, shape )
% Fast convolution, replacement for both conv2 and convn.
%
% See conv2 or convn for more information on convolution in general.
%
% This works as a replacement for both conv2 and convn. Basically,
% performs convolution in either the frequency or spatial domain, depending
% on wh... |
05ec6ad3fe5825cffae519bb568afeb75d6217f98eb576b4b048f112905011d5 | MATLAB | 9,109 | 241 | function edited = WaveformSettings(waveformPanel, varargin)
handles.waveformPanel = waveformPanel;
handles.figure = dialog(...
'Units', 'points', ...
'Name', 'Waveform Settings', ...
'Position', [100, 100, 350, 256], ...
'Visible', 'off', ...
'WindowKeyPressFcn', @(h... |
0cc9fe8ace6f653c2289e72a38563c751ff44f1e96c913dd3eea22ecd28450d2 | MATLAB | 9,114 | 255 | function Y = ft_inv(X, varargin)
% FT_INV computes a matrix inverse with optional regularization.
%
% Use as
% Y = ft_inv(X, ...)
%
% Additional options should be specified in key-value pairs and can be
% method = string, method for inversion and regularization (see below).
% The default method is ... |
0db2c3c16bb777fa1077f9f7ea1a30749fdd4d269361078da9d65c29d75a11c4 | MATLAB | 9,116 | 225 | function edited = DifferenceSettings(differenceDetector, varargin)
handles.detector = differenceDetector;
handles.reporters = differenceDetector.controller.reporters;
if length(handles.reporters) < 2
msgbox('You must annotate, detect or import other features before you can detect their differen... |
41d3ac275c673687c6062c5e9ac8a554b42475ea0ef1c724c56b4ec7e1181b53 | MATLAB | 9,116 | 121 | function opts = palm_defaults
% Set up PALM defaults.
%
% _____________________________________
% Anderson M. Winkler
% FMRIB / University of Oxford
% Oct/2014
% http://brainder.org
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% PALM -- Permutation Analysis of Linear Models
% Copyright (C... |
cfdb7aa3e5311289ac20b0a762ae01f0e7cb406c7d0737f20300ecbc2dd47065 | MATLAB | 9,116 | 237 | function [x, info, options] = stochasticgradient(problem, x, options)
% Stochastic gradient (SG) minimization algorithm for Manopt.
%
% function [x, info, options] = stochasticgradient(problem)
% function [x, info, options] = stochasticgradient(problem, x0)
% function [x, info, options] = stochasticgradient(proble... |
9cd750bb3eed5a3b8d0ea4fecbf2e5b7d6a4ac03c52e2e37579734eb533b80df | MATLAB | 9,117 | 249 | %% MVGC demo
%
% Demonstrates typical usage of the MVGC toolbox on generated VAR data for a
% 5-node network with known causal structure (see <var5_test.html |var5_test|>).
% Estimates a VAR model and calculates time- and frequency-domain
% pairwise-conditional Granger causalities (also known as the "causal graph").
% ... |
4f278ca7b498cb728c14ba852a271f8f12fcb6636198764d2dc74aa8586c5e5a | MATLAB | 9,130 | 235 | function [stat] = ft_timelockstatistics(cfg, varargin)
% FT_TIMELOCKSTATISTICS computes significance probabilities and/or critical values of a parametric statistical test
% or a non-parametric permutation test.
%
% Use as
% [stat] = ft_timelockstatistics(cfg, timelock1, timelock2, ...)
% where the input data is the... |
4a619a439d76e9f6f059714d2d8344ed1492d6a60c0dd13200f4df70fd54c7ac | MATLAB | 9,133 | 191 | function source = parseDspaceArgs(dataArgs, inputNames, idxOfFirstArgument)
% Internal function used by dspace().
%
%
%
%<PRE>
% This file is part of dspace-core.
%
% Copyright (C) 2020 University Zurich, Sepp Kollmorgen
%
% This program is free software: you can redistribute... |
40b1ee2edb46d55356ef2353e0a6632114b9f0d26fffd2eb7fd32663718dbae2 | MATLAB | 9,136 | 247 | function ft_plot_lay(lay, varargin)
% FT_PLOT_LAY plots a two-dimensional layout
%
% Use as
% ft_plot_lay(layout, ...)
% where the layout is a FieldTrip structure obtained from FT_PREPARE_LAYOUT.
%
% Additional options should be specified in key-value pairs and can be
% 'chanindx' = list of channels to plot (de... |
8dc3f2fc390329fb4ebcf503d516c11f88c3d780bcc6c2f3ec7ae736ccffd819 | MATLAB | 9,145 | 331 |
load('/Users/Goody/Neuro/ExSeq/exseq20170524/exseqautoframe7_transcriptsAndPunctaSet.mat')
loadParameters;
%%
num_paths = 1000;
path_indices = randi(length(transcript_objects),num_paths,1)';
%Pre-initialize the cell arrray
total_number_of_pixels =num_paths*100*20;
fprintf('Makign CSV of %i rows\n',total_number_... |
7dcc5f86ba74f0562b394808a2d51c5d1df51cdb84fdbda6bb9a9dd5f9dccbd0 | MATLAB | 9,151 | 247 | function Perm_Mixed_LCS_Figs2(dataOut,IM,B,params)
% This function is the same as Perm_Mixed_LCS_Figs except that it does not
% plot the block-wise FPR values. Also, it plots the FPR-p-vals for both
% Chi-squared and HG to see dynamic range
if ~exist('B','var'),B=1;end
Pth=0.05./B;
PthMcN=0.05;
[NNidx,Tidx,TNidx]=IM2i... |
e20dacdc7b3e45c5f5383ee2f6cfc9a1c964b8726493b955da35c84561d3edb2 | MATLAB | 9,152 | 239 | function hdr = read_yokogawa_header_new(filename)
% READ_YOKOGAWA_HEADER_NEW reads the header information from continuous,
% epoched or averaged MEG data that has been generated by the Yokogawa
% MEG system and software and allows that data to be used in combination
% with FieldTrip.
%
% Use as
% [hdr] = read_yokogaw... |
2ff0c9879a87db116efbcd09b749db81887b7e08b01e69c1f8e1c022a51b079d | MATLAB | 9,164 | 141 | function [header, data] = read_mrc(file)
% ------------------------------------------------------------------------
% Author: Chang Qiao
% Email: qc17@mails.tsinghua.edu.cn
% Date : 2020/5/15
% ------------------------------------------------------------------------
handle = fopen(file,'r');
header = int32(... |
63f00f3eba996f96ed8a193bf30775be4170ccf20c5a782d0b3f80e2f3c4a16e | MATLAB | 9,164 | 229 | %% Fisher kernel: Example
%
% Examples for constructing Fisher kernels from HMMs for use in prediction
% models
%
% This script uses synthetic data we have generated for illustrative
% purposes and made available on OSF (Project page:
% https://osf.io/8qcyj/?view_only=119c38072a724e0091db5ba377935666).
% Instead of ... |
b33dd502ac34536394af8123f84a8158f250e80a14d5ca2688fb99bbcc30ffb7 | MATLAB | 9,167 | 311 | function [b,a,N] = fir1n(N,Wn,varargin)
%FIR1 FIR filter design using the window method.
% B = FIR1(N,Wn) designs an N'th order lowpass FIR digital filter
% and returns the filter coefficients in length N+1 vector B.
% The cut-off frequency Wn must be between 0 < Wn < 1.0, with 1.0
% corresponding to half th... |
a6015d9c33d90397ed7f0ba512b80a5110f0bee349f1654ae6ca637bb078cc8e | MATLAB | 9,168 | 154 | function PARAMS = display_Prototype( subjectName, subjectID, scanNum, protoRun )
% (c) Coraline Rinn Iordan 10/2017, 02/2018, 03/2018, 04/2018
%
% Flips on given timing! Flips TR-locked!
% Total Length: 11m 22.5sec = 682.5 secs = 341 TRs
if nargin < 1, error( 'Must provide subject name.' ); end
% Load latest version... |
5f385b50f8eac3c7dcd024cb2c4c370c59462612859ff766a63cac079f91aca9 | MATLAB | 9,170 | 195 | % AUTHORSHIP
% Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
% Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com>
% Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu>
% Provided by the Herzenberg Lab at Stanford University
% License: BSD 3 clause
classdef Merge <... |
195380685aad0c874b1f156045ffaeb63bedb424b624dc2d29fc010367a9967b | MATLAB | 9,172 | 192 | function [PFresults, allResults] = run_param_decode(PFSpikeTimes_paramPoint, preplaySpikeTimes_paramPoint, data_path, paramSetInds, ithParamSet, varargin)
% [PFresults, allResults] = run_param_decode(PFSpikeTimes_paramPoint, preplaySpikeTimes_paramPoint, data_path, paramSetInds, ithParamSet)
%
% Runs analysis and Bayes... |
d0c301ba2143eedd1c2507309b06172ec046eb390461908a8a83dc88feb9ff88 | MATLAB | 9,172 | 268 | %% validate DataCells
% Having built the xtData and the ppData, ensure that the fields
% used in SDO analysis are well defined; Limited cell-structure correction.
%
% NOTE: Not recommended. Use 'xtData' and 'ppData' classes to avoid
% issues with validations.
%
% PREREQUISITES:
% SAT.ppDataHolder_new()
% S... |
9ce9e0e7a881d087a3cc90524e3ea810c7ca6524a07d158ebcbac65f18132074 | MATLAB | 9,175 | 244 | function varargout = w_ThrdQCScore(varargin)
% W_THRDQCSCORE MATLAB code for w_ThrdQCScore.fig
% W_THRDQCSCORE, by itself, creates a new W_THRDQCSCORE or raises the existing
% singleton*.
%
% H = W_THRDQCSCORE returns the handle to a new W_THRDQCSCORE or the handle to
% the existing singleton*.
%
% ... |
aa0302fcef746bc8759423bece27f307811f0cfa75e2938bc012659a7cac5424 | MATLAB | 9,175 | 319 | % this script displays the voltage trace from the .wcp file from a patched cell
% it cuts the trace off at imaging end
% gets the min/max PSP of each wcp trace
% counts the images
% applies a gaussian filter to data
% returns the counted images, image puff starts on, image puff ends on, Vm,
% i_hold and the PSPs for ea... |
4c6d48044aea37ce086b3cdbf37e0879bae30f87cc39cba96f1467d26619c65a | MATLAB | 9,176 | 1 | % TSPARSE Flexibly extracts information from sequences of time-stamped
% data found by TSmatch. Usually called as a helper function by
% TStrialstat or TSsessionstat. The computations are done either by
% some (usually simple) Matlab code passed in as text or by a custom
% helper function (for more complex c... |
c9e3503097fcf19f9e47a8ffcc4bbd4b405880ab1d9995a29ea6436b8c94a01e | MATLAB | 9,177 | 349 | function [xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk,dxpdalpha,Zave] = project_points_weak(X,om,T,f,c,k,alpha,Zave)
%project_points_weak.m
%
%[xp,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk] = project_points_weak(X,om,T,f,c,k,alpha)
%
%Projects a 3D structure onto the image plane. Weak perspective model used.
%
%INPUT: X: 3D structure in t... |
b2b8cc99572868fd3e4c819124bf2ab615f40acbd3dc70db7174558ce558491c | MATLAB | 9,182 | 271 | function varargout=xwt(x,y,varargin)
%% Cross wavelet transform
% Creates a figure of cross wavelet power in units of
% normalized variance.
%
% USAGE: [Wxy,period,scale,coi,sig95]=xwt(x,y,[,settings])
%
% x & y: two time series
% Wxy: the cross wavelet transform of x against y
% period: a vector of "Fourier" periods a... |
8ccbe86c2b3bd932e0e317a99bdee25a2eefe1c4d5498c51356a7f47c99e5daa | MATLAB | 9,184 | 335 | function trx = ReadMWTBlobFile(filename,trx,id)
% multiple files input, then call recursively
if iscell(filename),
if nargin < 2,
trx = [];
end
if nargin < 3,
id = [];
end
for i1 = 1:numel(filename),
trx = ReadMWTBlobFile(filename{i1},trx,id);
end
return;
end
nparams = 10;
nspinepts = 11;
co... |
1dfbbc26b0e757afd3b60a3d6e483209f7c9087a185581803f71f90d7e06e557 | MATLAB | 9,193 | 300 | function p = fire(m)
%FIRE Blue-Purple Hot colormap
%
% FIRE(M) returns an M-by-3 matrix containing a "fire" colormap.
% FIRE, by itself, is the same length as the current figure's
% colormap. If no figure exists, MATLAB creates one.
%
% To add this colormap as a default map, use 'addpath' with the
% directory cont... |
b30253f9a33473c3e5e269f14512dac0ed308a249e656793cd9455d8ce112cdb | MATLAB | 9,199 | 156 | function PARAMS = display_Prototype( subjectName, subjectID, scanNum, protoRun )
% (c) Coraline Rinn Iordan 10/2017, 02/2018, 03/2018, 04/2018
%
% Flips on given timing! Flips TR-locked!
% Total Length: 11m 22.5sec = 682.5 secs = 341 TRs
if nargin < 1, error( 'Must provide subject name.' ); end
% Load latest version... |
ca88ae8e99d0292a50770910212cc323e2ebd01e3d7e63068bb15620fe15f343 | MATLAB | 9,202 | 223 | classdef pointCloudDetector < surfaceDetection.surfaceDetector
% This is not a detector, it rather reads a previously detected point
% cloud and assembles it into a detector object.
%
% The point cloud should be Npoints rows and 3 columns. CSV or txt are
% currently supported.
%
% optio... |
b570e979a622bc43198b45d7b930d40c04abb1f4e586ca5d5bbb6093655d9d7b | MATLAB | 9,206 | 228 | function [agg_table] = collect_results(resultsdir, options)
% [agg_table] = collect_results(resultsdir, options)
%
% assemble results from all methods & runs into tables for stats testing &
% figures
% Tables are written out as csv
%
% Input:
% resultsdir: (output) directory for results to be written
% options: struct ... |
e9ab0bc4a4ffb0c998b1bd115ff890f26e12e6d5f7235cf539013126e0fad518 | MATLAB | 9,207 | 265 | function CBIG_Plot_Schaefer400_17NetworksRearrCorrMat_WhiteGrid(lh2lhcorrmat, ...
lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix)
% CBIG_Plot_Schaefer400_17NetworksRearrCorrMat_WhiteGrid(lh2lhcorrmat, ...
% lh2rhcorrmat, rh2rhcorrmat, scalelim, filename_prefix)
% Example : CBIG_Plot17NetworksRearrCorrMat... |
cc28f318ab79b444ae358d2cfc4db2c254cf356d76198f7ec9201a48f7e29718 | MATLAB | 9,215 | 241 | function [bnd, cfg] = ft_prepare_mesh(cfg, mri)
% FT_PREPARE_MESH creates a triangulated surface mesh for the volume
% conduction model. The mesh can either be selected manually from raw
% mri data or can be generated starting from a segmented volume
% information stored in the mri structure. FT_PREPARE_MESH can be us... |
d9e03cd0df54a06010fec052e0e256e88724498f86d1167e303b3cac2f79a098 | MATLAB | 9,215 | 284 | %% WRAPPER for analyzing multi-ExR 5xFAD vs. WT data %%
% Accompanies the manuscript by Kang*, Schroeder* et al., 2023
% Last modified by Margaret Schroeder on 5/21/23
% Image processing up to this point:
% - background subtraction in Fiji and
% - registration using modified ExSeq pipeline
% - manual ROI id... |
b03260612cd66d89a3bb5d442efe925c4571266d194df35482fbf15df9d5e064 | MATLAB | 9,240 | 187 | function chns = chnsCompute( I, varargin )
% Compute channel features at a single scale given an input image.
%
% Compute the channel features as described in:
% P. Dollár, Z. Tu, P. Perona and S. Belongie
% "Integral Channel Features", BMVC 2009.
% Channel features have proven very effective in sliding window object... |
56b95291ef43a7c1d8fc232508985065771af52103a7c7bf0c65bdfbbd329658 | MATLAB | 9,255 | 247 | function ft_plot_layout(layout, varargin)
% FT_PLOT_LAYOUT plots a two-dimensional channel layout
%
% Use as
% ft_plot_layout(layout, ...)
% where the layout is a FieldTrip structure obtained from FT_PREPARE_LAYOUT.
%
% Additional options should be specified in key-value pairs and can be
% 'chanindx' = list of ... |
49dbfd80f7ac6f53158526d0fe3d1643b6e0ffeaaf26b3d11af9d1cdb57b34b4 | MATLAB | 9,256 | 186 | %% Decription
% This example uses the media and geometry of example 4 and serves to
% illustrate how the deposition criteria minMediumIdxToConsider and
% maxMediumIdxToConsider work. See also examples 8 and 19.
%
% minMediumIdxToConsider and maxMediumIdxToConsider specify the minimum and
% maximum medium index that th... |
d647743dfd8724500bb01f0317f91699f54e97fbede319227050267a275b0e6d | MATLAB | 9,258 | 249 | function [data, posterior, out] = demo_Kalman4bandits (data)
% // VBA toolbox //////////////////////////////////////////////////////////
%
% [data, posterior, out] = demo_Kalman4bandits (data)
%
% Demo of a multi-armed bandit task as described eg. in:
% Daw et al. (2006) Cortical substrates for exploratory decisions in... |
de2940f410246e9cbce051682dbcb6adfc883d2459f180156fc06e99f76fb593 | MATLAB | 9,265 | 233 | classdef SBFMFFile < handle
properties (SetAccess=private)
version
end
properties
path % The path to the SBFMF file.
differenceMode
frameRate = [] % The frame rate for fixed rate movies.
frameCount = 0 %... |
2e0c851fed72f6959e702e32afb673b7be91a95fd7ad27aa2c41888e897824c3 | MATLAB | 9,266 | 245 | function [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord)
% READ_NEURALYNX_NCS reads a single continuous channel file
%
% Use as
% [ncs] = read_neuralynx_ncs(filename)
% [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord)
% Copyright (C) 2005-2007, Robert Oostenveld
%
% This file is part of Field... |
c2ba6f83afbaa2f4e2a35ef110ed0a2a57c6c9179d2eb5ca34d608798bf5a10c | MATLAB | 9,269 | 240 | function [imgPair] = imageRegistrationWorkflow(imgPair)
% imgPair must contain at least the fields moving.input and static.input,
% which are the matrices containing input images
% output imgPair is a structure with all relevant results from operations in
% this function
% moving.mask is the same size as moving.win... |
dba0e8a3aac3d0fd8c482ee7da32718c6169005a76db57254474817a37ff8685 | MATLAB | 9,277 | 274 | function [hfigs,savenames] = PlotExamplePredictions(varargin)
[gtdata,gtimdata,nets,legendnames,ptcolors,exptype,...
conddata,labeltypes,datatypes,...
figpos,savedir,savenames,dosavefig,...
reseed,nexamples_random,nexamples_disagree,...
ms,lw,textcolor,lObj,errnets,doAlignCoordSystem] = myparse(varargin,'gtdat... |
2250a0b85e9f4055eb3b495e615e8781a4fb7c8eb8a897157dff048ef6af17f6 | MATLAB | 9,281 | 245 | function [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord)
% READ_NEURALYNX_NCS reads a single continuous channel file
%
% Use as
% [ncs] = read_neuralynx_ncs(filename)
% [ncs] = read_neuralynx_ncs(filename, begrecord, endrecord)
% Copyright (C) 2005-2007, Robert Oostenveld
%
% This file is part of Field... |
557940c28df1322d8964d1e385efce9c9d6cf01c6c859253df07785359bd366e | MATLAB | 9,281 | 230 | function [stat] = ft_freqstatistics(cfg, varargin)
% FT_FREQSTATISTICS computes significance probabilities and/or critical
% values of a parametric statistical test or a non-parametric permutation
% test.
%
% Use as
% [stat] = ft_freqstatistics(cfg, freq1, freq2, ...)
% where the input data is the result from FT_FRE... |
8fd2ccfba7be954a77ca7db2684f8bfe950007b5e3cd62f540859ec23661cb91 | MATLAB | 9,281 | 226 |
function [output, Greg] = dftregistration(buf1ft,buf2ft,usfac)
% function [output Greg] = dftregistration(buf1ft,buf2ft,usfac);
% Efficient subpixel image registration by crosscorrelation. This code
% gives the same precision as the FFT upsampled cross correlation in a
% small fraction of the computation time and wit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.