sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
ad02513ad99a6763d0d913722c7cd607afdba944c61de65a586c94806f356942 | MATLAB | 6,340 | 135 | % Name: Robert Kim
% Date: 05-14-2023
% Email: robert.f.kim@gmail.com
% Script to plot example CEBRA trajectories for anti- vs. pro-DMS task in the
% 2-modality DMS RNN. Produces panels for Fig. 2h and Fig. 2i.
%
% Inputs (see ../cebra_for_matlab.ipynb for how these are generated):
% <model_dir>/<*_cebra.mat> with re... |
5f60ce15e665c77ba346094edd12d8cb1f46cfd9e56050f9ab964945acaa48db | MATLAB | 6,344 | 142 | % This walkthrough calculates Bayes Factors for a voxel-wise brain map using a Bayesian t-test approach.
% Bayesian t-tests
% -----------------------------------------------------------------
% We use the BF Bayes' Factor Matlab toolbox, based on:
%
% Rouder et al., 2009 % one-sample t-test, t1smpbf.m
% ... |
63867909e56420ae2ea6238a4b9fbc0ad21130ac82a78d731bacdfd3f505ff79 | MATLAB | 6,346 | 139 | function eucli_dist = CBIG_ArealMSHBM_component_distance(lh_labels, rh_labels, mesh, num_parcel)
% eucli_dist = CBIG_ArealMSHBM_component_distance(lh_labels, rh_labels, mesh, num_parcel)
%
% This script will compute the Euclidean distances between distributed components for each
% parcel of a given parcellation <... |
6505990c673077d88da1e28e7714b3fc5af25f77807cc52dfef0a1fe6894eb75 | MATLAB | 6,346 | 164 | function CBIG_ArealMSHBM_generate_ini_params(seed_mesh, targ_mesh, lh_labels, rh_labels, out_dir)
% CBIG_ArealMSHBM_generate_ini_params(seed_mesh, targ_mesh, lh_labels, rh_labels, out_dir)
% This function will be used to generate initialization parameters. We will
% apply a given group-level parcellation on group aver... |
de5d8d714303f79f24bed2a59fec118b6da7da0bbcd478bc9cd82c5beb7b8691 | MATLAB | 6,347 | 163 | %% Applying masks and writing image data to disk
% One common operation in neuroimaging is masking. Masking is defining a set
% of voxels to include or exclude from analysis or presentation. Some uses
% include:
%
% * Apply a generous brain mask to store only in-brain voxels, saving space,
% (CANlab data objects do ... |
ae6fb51f401f6ef95be420a1814834f3fcc0a7b1b46a861ca425cdd46db25b1c | MATLAB | 6,357 | 164 | function res = concat(thedata,ymd,trllength,driver)
% Run this for behavior + imaging data for CEM.
% First, navigate to the folder containing the folders of data you want to
% concatenate.
% example args: thedata = 'apr2623_f3e4'
% ymd = '230426'
% trllength = 127
% dr... |
b2ce3d0769f81e27e45e32784720cf257a6f2a0fc1944d4401ff27d78964b1ff | MATLAB | 6,360 | 164 | function res = concatCEM(thedata,ymd,trllength,driver)
% Run this for behavior + imaging data for CEM.
% First, navigate to the folder containing the folders of data you want to
% concatenate.
% example args: thedata = 'apr2623_f3e4'
% ymd = '230426'
% trllength = 127
% ... |
a20d20608afa624783439526b8e181fa80266609be06b35b3fbd1a6df6a49cbc | MATLAB | 6,362 | 201 | function [h,a] = PlotDistribution2(var1,var2,varargin)
%PlotDistribution2 - Plot bivariate data along with respective distributions.
%
% USAGE
%
% [h,a] = PlotDistribution2(var1,var2,<options>)
%
% Using cell arrays will overlay variable pairs.
%
% var1 variable 1
% var2 variable 2
% ... |
0e8eddb6002d609e56c74b17cbc8823bbb4d12114a5a7ba47cdfbefe4de9dd07 | MATLAB | 6,363 | 268 | %%%%%%%%%%%%%%%%%%%
%% Zicheng Yang CCMU
%% Version: calcium imaging data analysis
%%%%%%%%%%%%%%%%%%%
%%
clear all;
close all;
% load files
actfile ='file.xlsx';
cafile ='file.xlsx';
% parameters
Fs = 100;
Ts = 1/Fs;
correctCue =2;
Vvoffset=42;
pre_time = 3;
trial_time = 15;
ntrialperse... |
8f12aa56d6cc839130681b2e5141cea0da203be7a9e4979f9d9f54d431f66535 | MATLAB | 6,364 | 206 | function ea_make_standalone(outdir)
% Under development
%
% Compile Lead-DBS as a standalone executable using the MATLAB compiler
% http://www.mathworks.com/products/compiler/
%
% This will generate a standalone program, which can be run
% outside MATLAB, and therefore does not use up a MATLAB licence.
%
%% Lead i... |
281268ebeab01774cc235f512aa0099aaeb01fdd2c6eaee0cce2ae0565ce11c3 | MATLAB | 6,367 | 192 | function PlotColorMap(data,dimm,varargin)
%PlotColorMap - Plot a color map.
%
% Plot a color map (e.g. the firing field of a place cell).
%
% USAGE
%
% PlotColorMap(data,dimm,<options>)
%
% data data
% dimm optional luminance map
% <options> optional list of property-value pairs ... |
77a3ccd8123f2cc2cf6d2dbfcc66629f89905c2c74a40a3a871c4187f187bb42 | MATLAB | 6,372 | 199 | function palm_icodown(varargin)
% Downsample a data-per-vertex (DPV), data-per-face (DPF),
% surface (SRF), or surfvol (MGH/MGZ) from a higher-order tessellated
% icosahedron to a lower order one. Note that the file must have been
% derived from either FreeSurfer or Brainder tools. It may not work
% if the vertices fol... |
a4288119537edbd485b4b26b565d099231e5670d6ac6ad61b7da1422ab660acd | MATLAB | 6,372 | 163 | %% WORDSTATES - convert single time bin states to words
% Converts single time bin states to words (joint vector valued state
% combinations). For instance, the state time sequence [1,1,2] is
% distinguished from [1,2,2]. Note, wordstates will reduce the total number
% of time bins in the StatesRaster. Trial based data... |
81b5060a358603516de2cdc1046ce5119144ba1ead663ddccb6404313a725d41 | MATLAB | 6,375 | 186 | function biopac_binary2(fname)
% Usage biopac_binary2(fname)
% biopac_binary.m
%
% #AS156 - AcqKnowledge File Format for Windows/PC Updated Updated 060805
% http://www.biopac.com/AppNotes/app156FileFormat/FileFormat.htm
%
% Simple m-file for loading samples of named channels from AcqKnowledge ACQ files. ... |
5c444319a74c1155ef5f29c341f67fa10dfaf0a5aadc8b8ba74274ee63ead65c | MATLAB | 6,380 | 144 | function [C,phi,S12,S1,S2,t,f,confC,phistd,Cerr]=cohgramc(data1,data2,movingwin,params)
% Multi-taper time-frequency coherence,cross-spectrum and individual spectra - continuous processes
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,confC,phistd,Cerr]=cohgramc(data1,data2,movingwin,params)
% Input:
% Note units have to be cons... |
b00306aeb3969e8dd9c0e78a5a940c63ad3d3bff7434693602abfecc1fb5db04 | MATLAB | 6,382 | 171 | function h = approxonGui()
gui = createInterface();
params = load('logLinModParams.mat'); % loads PW, D, T for 3V
gui.model = @(x,y)( exp(params.a*log(x) + params.b*log(y) + params.c));
% Now update the GUI with the current data
redrawDemo();
h = gui.Window;
movegui(h, 'center')
set(h, 'Visible', 'on')
%----------... |
c1d29e91ed3c5198647841105e897189759ee21027e948eb660b21c8b8365e96 | MATLAB | 6,382 | 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 ... |
0b1ea2cca3e6d8e88dd9d520af26c24aacea446eb1c2bebc2506d0075ed59ebb | MATLAB | 6,384 | 207 | %MRSTRUCT_INIT create new mrStruct.
% mrStruct = mrstruct_init(typeStr,checkinDataAy,propertiesMrStruct)
%
% Function creates a new mrStruct of the type specified by typeStr.
% typeStr = {image,imageEchos,volume,volumeEchos,series2D,series2DEchos,
% spectrum,spectrum1D,spectrum2D,spectrum3D} (required).
%
% che... |
0c51f82c64b8d5dd70f451373c379885b8ca72615c65a7ca3fd94ee04fc14c4a | MATLAB | 6,385 | 188 | % Iterations over different thresholds, tens and cis parameter values.
% Plotting success and max E-level heatmaps shown in Figure 6
% To speed up comment line 71 in
% SOP_multicell_LI_adapted_weighted_with_trigger_PerimSave.mat before
% running this script to avoid saving simulations movies for each
% iteration
cl... |
19e4fb2b12962351efff16613ed4d1663d755ead4d76ab5e8e4562bda0b715ad | MATLAB | 6,387 | 234 | function varargout=ea_genvat_fastfield(varargin)
useSI = 1;
if nargin==5
S=varargin{2};
side=varargin{3};
options=varargin{4};
stimname=varargin{5};
elseif nargin==6
S=varargin{2};
side=varargin{3};
options=varargin{4};
stimname=varargin{5};
resultfig=varargin{6};
% lgfigure=va... |
4215c1d2fa1b51eb4b51a266b4738237c5f931418e2817aacb579f1c1905a6c6 | MATLAB | 6,387 | 244 | % apshiftfix.m: Function to fix slice shift in s-fMRI
% Need to think about ghosting later
% Requires Matlab Image Processing Toolbox
%
% [V shifts] = apshiftfix(fnamein, fnameout, showplots, ctrslice, slabwidth, ...
% ignoreshift, fixslices, ignoreslices)
%
% Inputs:
% fnamein - Name... |
87549caafe371591d6efc7aaac0fbb88feb5c525cd9061a4eb5f7c325cf216d0 | MATLAB | 6,389 | 143 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% demo_eigenmode_visualization.m
%%%
%%% MATLAB script to demonstrate how to visualize surface and volume
%%% eigenmodes
%%%
%%% NOTE 1: The script can also be used to visualize other types of surface
%%% eigenmodes (e.g., connectom... |
07b3be960fcdce5a62f98c9442aed37e845a665767d247248d011c9b767b8ab3 | MATLAB | 6,391 | 186 | function [comod ] = bz_PhaseAmpCouplingByAmp(lfp,sig1band,sig2band,varargin)
% [comod] = bz_PhaseAmpCouplingByAmp(lfp,sig1band,sig2band,varargin)
%calculates phase amplitude coupling between the phase of signal 1 and the
%amplitude of signal 2, with respect to the amplitude of signal 1.
%
%
%%INPUT
% lfp ... |
1927ec24cb3549b18161558b29a7841f6b4cca74ac5e20499b1272ea45282a9d | MATLAB | 6,391 | 172 | classdef (Abstract) ea_conda
methods (Static)
function path = install_path(custompath)
if exist('custompath', 'var') && ~isempty(custompath)
% custom installation path
path = custompath;
ea_setprefs('conda.install_path', path, 'user');
... |
afd6f421ab7025e740725bcabeb3d2102f36ace3da1a98987807b57121226db2 | MATLAB | 6,391 | 212 | function [blurim] = aacam(focusmode,param1,param2,iparam,updown)
%AACAM, A Matlab Camera Model for Depth of Field
% blurim = AACAM(focusmode, param1, param2, iparam, updown)
% Simulate depth of field in the current figure and axis, return an RGB
% image.
%
% focusmode = 'LR'
% param1 is L (focal length) and... |
1d6faa99476393a0aafeee216994661003faa3eee7ac69ebb3b8043001ac72e9 | MATLAB | 6,394 | 192 | function obj = subsasgn(obj,subs,dat)
% Overloaded subsasgn function for file_array objects
%__________________________________________________________________________
% Copyright (C) 2005-2013 Wellcome Trust Centre for Neuroimaging
%
% $Id: subsasgn.m 6522 2015-08-14 18:55:42Z john $
if isempty(subs), return; end
... |
c738faba729064966313cdc06a16dfbbec247bb1b07666ec167196f25389ed45 | MATLAB | 6,399 | 177 | function [stampsel, glist, funcsel, neusel,ifcircular, fmodel,...
fmodel_Independent,fmodel_Coefficients,fmodel_startpoint, dosave] = ...
prepFitting(handles, ttlabel, varsel, mainfig_pos)
dosave = 0;
fmodel = '';
funcsel = 1;
ifcircular = 0;
neusel = [];
fmodel_Independent = '';
fm... |
69c7c17c22fab3a2cac40b73bae69aaa63404d0b3e09ef0b1b56d0b57f4b2c73 | MATLAB | 6,400 | 165 | function ea_calc_biophysical_lg(M, options, selection, selectedConn, selectedParc, handles)
% handles not necessary for most cases (just for patient specific fMRI).
for pt=selection
% set pt specific options
[options.root, options.patientname] = fileparts(M.patient.list{pt});
options.root = [options.root,... |
98e1b66c5d23bc796c8769180320dcb7501a48b60cff44d1e33a238cae24c7f1 | MATLAB | 6,411 | 146 | function LCN12_realign2_dy_PET(PET_masked,PET_filename,filename_sum5min,frame_5min,threshold_translation,threshold_rotation)
% This function will realign dynamic PET images by realignment of masked
% dynamic PET and it will be applied to the original dynamic PET images.
% If measured from the start of the injection,... |
d4cd73afee991327563fff960e4f44b8291d2bb66e93bc22f67e422fd249ea17 | MATLAB | 6,411 | 163 | %To combine smooth muscle response
%concatenation of response over time across animals (ex 150x 5)
StimSM=[];
allnames={
'Tser4777_res_cfr2.mat'
'Tser4798_res_cfr2.mat'
'Tser5078_res_cfr.mat'
};
groupname='StimSM';
all_rr1a_micronsSM=[];
all_rr1aSEM_micronsSM=[];
all_rr1a_percentSM=[];
all_rr1aSEM_percentSM=[];
al... |
97d91f26cb58b3235577c96dac72fb7957c174bdba49ba4e7cbf665314014e30 | MATLAB | 6,421 | 192 | % caliper() - Measure a set of spatial components of a given data epoch relative to
% a reference epoch and decomposition.
% Usage:
% >> [amp,window]=caliper(newepoch,refepoch,weights,compnums,filtnums,times,'noplot');
%
% Inputs:
% newepoch = (nchannels,ntimes) new data epoch
% refepoch = a (nch... |
f2ff4f75fabc64b2cff0e766fbbb4698a71fc19b173c38a7d8f40feb4f98813d | MATLAB | 6,426 | 231 | function hm=plotmesh(node,varargin)
%
% hm=plotmesh(node,face,elem,opt)
%
% plot surface and volumetric meshes
%
% author: Qianqian Fang <fangq at nmr.mgh.harvard.edu>
%
% input:
% node: a node coordinate list, 3 columns for x/y/z; if node has a
% 4th column, it will be used to set the color at each ... |
dbcf19d5eaa4530bd562be1f54eef770033b45d23bf166385969da4a81f5bf6a | MATLAB | 6,430 | 193 | % Minimize sidelobe level of an array with arbitrary 2-D geometry
% "Convex optimization examples" lecture notes (EE364) by S. Boyd
% "Antenna array pattern synthesis via convex optimization"
% by H. Lebret and S. Boyd
% (figures are generated)
%
% Designs an antenna array such that:
% - it minimizes sidelobe level out... |
8dcf93811da73c9775441d63589ffbccc68b98dab172dbbf9b86069a8846b7b2 | MATLAB | 6,432 | 140 | function [likelihood, results, label] = CBIG_hMRF_adapt_tau(params, label, full_corr_mat, lh_mask, rh_mask,...
avg_mesh, Neighborhood, Smooth_cost, tau, i, likelihood, results)
% [likelihood, results, label] = CBIG_hMRF_adapt_tau(params, label, full_corr_mat, lh_mask, rh_mask,...
% avg_mesh, Neighborhood, Smooth_co... |
ca0b329b07eb8b590ef185706ea6209ba91a54459408e426610181f450f1875e | MATLAB | 6,433 | 151 | function sout = cvx_precision( flag )
%CVX_PRECISION Controls CVX solver precision.
% The CVX_PRECISION command controls the precision-related stopping criteria
% for the numerical solver. Up to 3 precision levels can be specified:
% 0 <= PBEST <= PHIGH <= PLOW << 1.
% --- PBEST: the solver's ... |
709fb1f94791d4c1cd3708990fd5b869c9a516bf949dc6446aedd02c04977cad | MATLAB | 6,435 | 147 | function [tracksReformat] = reformatSplitsMergesKeepLongerLivedSegment(tracksIn)
% REFORMATSPLITSMERGESKEEPLONGERLIVEDSEGMENT reformats compound tracks so that shorter-lived segments merge with or split from longer-lived segments
%
% SYNOPSIS [tracksReformat] = reformatSplitsMergesKeepLongerLivedSegment(tracksIn)
%
% I... |
9bd741c199a4b4982aaee63dc5b46707ef428b64b802545c85f9d32f4a2dc52c | MATLAB | 6,436 | 161 | function [ S, f, Serr ]= mtspectrumc_unequal_length_trials( data, movingwin, params, sMarkers )
% This routine computes the multi-taper spectrum for a given set of unequal length segments. It is
% based on modifications to the Chronux routines. The segments are continuously structured in the
% data matrix, with the s... |
26a88dd39eab7fadbc293c3af2357de9295e1fde2cb17c7f2339477923a15f12 | MATLAB | 6,446 | 168 | % textgui() - make sliding vertical window. This window contain text
% with optional function calls at each line.
%
% Usage:
% >> textgui( commandnames, helparray, 'key', 'val' ...);
%
% Inputs:
% commandnames - name of the commands. Either char array or cell
% array of char. All style ... |
01a64c517047b79ded7e02ffacd466c054709f7469f613538becfd983ec904bf | MATLAB | 6,448 | 188 | % Name: Robert Kim
% Email: robert.f.kim@gmail.com
% svm_decoding_lesion.m
% Description: Per-neuron SVM decoding of the instruction signal (pro vs.
% anti) for the LESIONED two-layer one-modality (instr) RNNs. Same setup as
% svm_decoding.m but with the layer-1 (sensory) inhibitory-to-inhibitory
% submatrix zeroed out... |
4cf6a80dff6248c59e3de1ee38253f2e44408fa9a77cd5f402e848c7fcf49d9d | MATLAB | 6,452 | 157 | function boot_results = myPLS_bootstrapping(X0,Y0,U,V,S,grouping,pls_opts)
% This function computes bootstrap resampling with replacement on X and Y,
% with option to either ignore or account for groups (e.g. diagnosis).
% The PLS analysis is re-computed for each bootstrap sample.
%
% Inputs:
% - X0 : N ... |
a5487198ee2062d6047845fb618ebd269a3959cf290a18fac4517efe3b381e7b | MATLAB | 6,458 | 155 | function [ADC,FA,VectorF,DifT,S0]=DTI(DTIdata,parameters)
% This function will perform DTI calculations on a certain
% DTI dataset.
%
% [ADC,FA,VectorF,DifT]=DTI(DTIdata,parameters)
%
% DTIdata: A struct containing DTIdata(i).VoxelData, DTIdata(i).Gradient
% and DTIdata(i).Bvalue of all the DTI datasets
% pa... |
b60c7f7c9be5e2daa26d7900a1bdb8446f64a3e574c953e73bf2492440cc50d7 | MATLAB | 6,460 | 137 | function [components, variance, correlation_matrix, names] = cross_disorder_effect(varargin)
%
% Usage:
% [components, variance, ~, names] = cross_disorder_effect(varargin)
% [~, ~, correlation_matrix, names] = cross_disorder_effect(varargin)
%
% Description:
% Cross-disorder effect (authors: @boyongpark, @sarath... |
05bfcf54aed01fa5e89884333426a9428c57e39fb48228d04bed105f0777aa0a | MATLAB | 6,468 | 186 | function [pntr, trir, texr] = refine(pnt, tri, method, texture, varargin)
% REFINE a 3D surface that is described by a triangulation
%
% Use as
% [pnt, tri] = refine(pnt, tri)
% [pnt, tri] = refine(pnt, tri, 'banks')
% [pnt, tri] = refine(pnt, tri, 'updown', numtri)
% [pnt, tri, text... |
b3ba4b86d8ef471d525328bec74656117c6466ce388ff1e9eddf385d440f9951 | MATLAB | 6,468 | 173 | function affinefile = ea_flirtbbr(varargin)
% Wrapper for FSL FLIRT BBR registration
fixedimage = varargin{1};
movingimage = varargin{2};
outputimage = varargin{3};
if nargin >= 4
writeoutmat = varargin{4};
else
writeoutmat = 1;
end
if nargin >= 5
if isempty(varargin{5}) % [] or {} or ''
otherfil... |
d97b80ae4cbd93acc296586efed920306ff215918ff170479ebc014f7a65a3d4 | MATLAB | 6,469 | 175 | function [ sessionInfo ] = bz_sessionInfoGUI( sessionInfo,MODE )
%A gui for editing buzcode sessionInfo structures. Right now it just adds
%region data, but will be expanded soon.
%
%INPUTS
% sessionInfo a buzcode sessionInfo structure (see wiki) to edit
% MODE (optional) - a field to edit
% ... |
64fd81370dacba30dd93e2979f0000acc8bf69e027e6728cc657205d461c9678 | MATLAB | 6,474 | 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... |
b8a4d374d875191435fba60ea168a2cac9b759263b1cd57e40d24dd6105603ce | MATLAB | 6,474 | 159 | function [allTemplates, emptyUnits_idx, duplicateSpikes_idx, spikeTimes_samples, spikeTemplates, templateAmplitudes, ...
pcFeatures, rawWaveformsFull, rawWaveformsPeakChan, signalToNoiseRatio, maxChannels] = ...
removeDuplicateSpikes(spikeTimes_samples, spikeTemplates, templateAmplitudes, ...
pcFeatures, ra... |
bc2a82c1109abe345667e9466224ff24a5e066416893ee8c9e0e44b888cf7e16 | MATLAB | 6,475 | 152 | classdef max_correlation_coefficient_CL_circular
% max_correlation_coefficient_CL is a classifier object (CL)
% that learns a mean population vector (template) for each class from the
% training data. When the classifier is tested, the correlation coefficient
% is calculated between a test point and each of the ... |
fb7105c9d43bedc2e8be4403001d7f3a49d4d0fe2701fe1cd13c37ed41ea0397 | MATLAB | 6,481 | 185 | % rsfit() - find p value for a given value in a given distribution
% using Ramberg-Schmeiser distribution
%
% Usage: >> p = rsfit(x, val)
% >> [p c l chi2] = rsfit(x, val, plot)
%
% Input:
% x - [float array] accumulation values
% val - [float] value to test
% plot - [0|1|2] plot fit. Using... |
34618e8d647edbab2b89628199713225d350d9b9188c15299afacae1fd2d0d62 | MATLAB | 6,484 | 196 | %% Example 1 of running special word retrieval model (SWR)
%
%%
% Choose the dataset
dataset = 1; % 1 = psych review abstracts 2 = NIPS papers
if (dataset == 1)
% Set the hyperparameters
GAMMA = [ 0.01 0.01 0.01 ];
BURNIN = 20; % the number of iterations
NS = 100; % number of s... |
e71c5aca40d514d22cd0bb6990e9096fc3dcc29565664c0074296864995ecb8f | MATLAB | 6,493 | 160 | %% Stimulus evoked response under geometric and hybrid connectivity
clear; clc;
% Load model parameters
loadparam;
% Compute timestep and grid spacing
dx = topology.L / topology.Nx;
dt = topology.T / topology.Nt;
% Create discrete connectome of 50 uniformly sampled FNPs
num_fnps = 50;
rng(1, "twister");
a_array = z... |
f6a8a9772f57455a52547aea2f3a813373a120709e44db5c66e3df266228a13d | MATLAB | 6,494 | 232 | % Save NIFTI or ANALYZE dataset that is loaded by "load_untouch_nii.m".
% The output image format and file extension will be the same as the
% input one (NIFTI.nii, NIFTI.img or ANALYZE.img). Therefore, any file
% extension that you specified will be ignored.
%
% Usage: save_untouch_nii(nii, filename)
%
% nii -... |
ac529e2372dadddffd6fe181d23be55c52cfa226b0bf99cb0ecef111f1c3570b | MATLAB | 6,495 | 193 | %%***************************************************************
%% linsysolve: solve linear system to get dy, and direction
%% corresponding to unrestricted variables.
%%
%% [xx,coeff,L,resnrm] = linsysolve(schur,UU,EE,Bmat,rhs);
%%
%% child functions: mybicgstable.m
%%
%% SDPT3: version 3.1
%% Copyright ... |
5ec05eaf18110c4e62838e2ee6941962ef498a2c28e33ff1dcacd1367d356c73 | MATLAB | 6,497 | 211 | function [mode_activity, sim_activity] = model_BOLD_balloon(eig_vec, ext_input, param, method)
% model_BOLD_balloon.m
%
% Simulate BOLD balloon model on a surface using eigenmodes.
%
% Inputs: eig_vec : eigenvectors (eigenmodes) [V x num_modes]
% V = number of vertices
% ... |
86ce2ef5341af53b65624cdff73139180f240f0531ed369d32fd3fafa38b5f18 | MATLAB | 6,500 | 176 | function [ behavior ] = bz_ConcatenateBehavior( behaviorName, basePath, varargin)
%[ behavior ] = bz_ConcatenateBehavior( behaviorName, basePath)
%Concatenates buzcode behavior.mat files from subfolders, using the
%MergePoints from bz_ConcatenateDats. Automatically adjusts timestamps from
%each of the subfiles to refl... |
f0f9a5ea4d3fbaf283fed0d9a18b176de1dd6b141a8100880494c078ee466e00 | MATLAB | 6,503 | 147 | % check quality metric and apram names
[qMetric, param] = bc.qm.prettify_names(qMetric, param);
%get memmap
loadRawTraces = 0; %hard coded for now - we can't currently load in chunks of raw data & it was not that useful
if exist('loadRawTraces', 'var')
if loadRawTraces
bc.viz.getRawMemMap;
else
... |
6990097fed6ca626b8acf5710b0ba9e252e600b05b5f55a34b278d22da65204c | MATLAB | 6,504 | 148 | function [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr)
% Multi-taper time-frequency spectrum - point process times
%
% Usage:
%
% [S,t,f,R,Serr]=mtspecgrampt(data,movingwin,params,fscorr)
% Input:
% data (structure array of spike times with dimension channels/trials;
% ... |
a3b2f37b8a9a35caeca5ad0bf8682fcda216535f56cce3085ead03fe7e79dbf0 | MATLAB | 6,505 | 195 | function [S_sample,BO,BD,biomassScaleFactor] = splineBiomassMCMC(T,BMD,sigma_biomass_est,params,numReplicates)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically re... |
a943bdb9a5c70cc0419a3ed4b886d06fd8aff4e6381cc67d6d2593ea9cded2cb | MATLAB | 6,514 | 155 | function [fibcell,vals,usedidx]=ea_explorer_visualizefibers(obj)
sides={'right','left'};
%% Thresholding Part
fibcell=obj.results.(ea_conn2connid(obj.connectome)).fibcell;
if obj.thresholding.showsignificantonly
obj.recentmodel.fibers.sigvals=ea_explorer_corrsignan(obj.recentmodel.fibers.vals,obj.recentmodel.fiber... |
bf199a52b5d054f7c222f521290c8721861416610ce29fc34058fdf8809e0831 | MATLAB | 6,514 | 165 | % eeg_time2prev() - returns a vector giving, for each event of specified ("target") type(s),
% the delay (in ms) since the preceding event (if any) of specified
% ("previous") type(s). Requires the EEG.urevent structure, plus
% EEG.event().urevent pointers to it.... |
f6bb7296f75dcd5db84467fa6d2ad4cc78095710007d3e62ee70a575f8e018ad | MATLAB | 6,517 | 147 | function CBIG_ArealMSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% CBIG_MSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% This function will generate functional connectivity profiles for a
% specific subject in a specific session. A split flag can be passed in if
% ... |
7c17cb49cdc78fe102f21adb27d4f1e62268e5d17818588b26939fb78bf2b383 | MATLAB | 6,524 | 141 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
14b22834b00846b0252c8328677821e1e30670a8ac6a06a695a89dd9d6dc8254 | MATLAB | 6,525 | 174 | function [spectrogram,t,f] = MTPointSpectrogram(times,varargin)
%MTPointSpectrogram - Compute point process spectrogram by multi-taper estimation.
%
% The spectrogram is computed using the <a href="http://www.chronux.org">chronux</a> toolbox.
%
% USAGE
%
% [spectrogram,t,f] = MTPointSpectrogram(times,<options>)
%... |
8a4e7cd392e5535da8e860a860a936a49c2cb52b35119b1a1add5ffbbbc570df | MATLAB | 6,526 | 263 | function resComb = mu_combine_granger_pt_ratios(resRatios, opts)
%MU_COMBINE_GRANGER_PT_RATIOS Combine ratio-level permutation GC results.
%
% resRatios{i}.dGC_obs : nChanCmb x nFWin x nTWin
% resRatios{i}.dGC_perm : nChanCmb x nFWin x nTWin x nPerm
%
% This version is robust to MATLAB's trailing singleton dimension c... |
2d7e54da9c3c8d253c93b028290f42b93656dee1d85957a35efdd46079d8c59f | MATLAB | 6,527 | 153 | function varargout = impexp_run_nifti2mrstruct(cmd, varargin)
% Template function to implement callbacks for an cfg_exbranch. The calling
% syntax is
% varargout = impexp_run_nifti2mrstruct(cmd, varargin)
% where cmd is one of
% 'run' - out = impexp_run_nifti2mrstruct('run', job)
% Run a job, and retu... |
d3fd9864e6f1e1661796958e8c93ef69a1d4ce96ef7840a840085b61e841046b | MATLAB | 6,529 | 191 | function[fluordata,fluordata_red,fluordata_diff,ROIs,redtemps]= pooldirections(headpath,fileexpnum,imskip,expskip,deltamode,FrameRate)
% point towards wherever the experiment data for matlab
%control is and then pool across experiments for all ROIs
%then will be able to average across individual ROIs for multiple tr... |
3fb6f0ac211e4e1d0bc3299a8f32f2beac3d3b6a43e9c8ff321c5d09d7806b42 | MATLAB | 6,530 | 198 | function hfig = ea_tightfig(hfig)
% tightfigadv (Tight Figure Advanced): Alters a figure so that it has the
% minimum size necessary to enclose all axes in the figure without excess
% space around them.
%
% tightfigadv is inspired ny tightfig and contains improvements and bug
% fixes for HG2, colorbars, legends and man... |
631044ded918bc6ff65f366695562fc19f609ba8db623757696fc31788620092 | MATLAB | 6,530 | 202 | % rmart() - Remove eye artifacts from EEG data using regression with
% multiple time lags. Each channel is first made mean-zero.
% After JL Kenemans et al., Psychophysiology 28:114-21, 1991.
%
% Usage: >> rmart('datafile','outfile',nchans,chanlist,eogchan,[threshold])
% Example: >> rmart('noisy.... |
5bea27dec1eee4e9525b09d0d7fa6a9f7242edc3fe31520c7dcd91652a4b390c | MATLAB | 6,540 | 178 | function condColocAnalysisPt2Pt2BlobMLMD(MLMD,detectedChannels, blobChannel,varargin)
%CONDCOLOCANALYSISPT2PT2BlobMLMD run conditional colocalization analysis for 2 punctate objects and 1 non-punctate object.
%
%SYNOPSIS condColocAnalysisPt2Pt2BlobMLMD(MLMD,detectedChannels,blobChannel,varargin)
%
% Function will run ... |
c5296cb2251c55bc76d7de2478223f0fb34e3a262566004146a622a78789054f | MATLAB | 6,540 | 186 | function [assignment,cost] = munkres(costMat)
% MUNKRES Munkres (Hungarian) Algorithm for Linear Assignment Problem.
%
% [ASSIGN,COST] = munkres(COSTMAT) returns the optimal column indices,
% ASSIGN assigned to each row and the minimum COST based on the assignment
% problem represented by the COSTMAT, where the... |
aabdd9f0b7810a06f26ac27b4aaa78d763b122444d894fb50dc6e4d62b579247 | MATLAB | 6,542 | 156 | function [maskListClass,imgErodedMask] = classifyMaskGrid(maskFolderList, varargin)
%CLASSIFYMASKGRID: takes cell masks and return classifications of cell edge and center regions per box in user-defined grid
%
%SYNOPSIS: [maskListClass,imgErodedMask] = classifyMaskGrid(maskFolderList, varargin)
%
%INPUT: Required. mask... |
c3628780960aec5b185f7484d118e1f10ce2410448086b89b4a10592517a9bb4 | MATLAB | 6,542 | 186 | function [PITerms] = PID(CountsMat,SourcesMat,SetsMat,TransMat)
%PID calculates the partial information decomposition.
% [PITerms] = PID(CountsMat,SourcesMat,SetsMat,TransMat) is an array that
% contains the partial information terms. It requires several arrays that
% are calculated using PIDLattice. This program... |
9ba463c72f38afb5b6ab9ed226bd1bc045d10a1ae2d5bd95eebc242c14cfcd2b | MATLAB | 6,543 | 153 | function [Z, discretized_Z] = CBIG_ASDf_FC2doc(corr_mat, regressors, dx_info, cohort_label, output_dir, output_name)
% [Z, discretized_Z] = CBIG_ASDf_FC2doc(corr_mat, regressors, dx_info, cohort_label, output_dir, output_name)
%
% Convert FC matrix to "documents" to be used as inputs to polarLDA
% model for model para... |
ebf47028803dd4186ea7e738333a97236f9d1a7d55e17b3fcebf1b41a338401f | MATLAB | 6,545 | 144 | function [C,phi,S12,S1,S2,t,f,confC,phistd,Cerr]=cohgramc(data1,data2,movingwin,params)
% Multi-taper time-frequency coherence,cross-spectrum and individual spectra - continuous processes
%
% Usage:
%
% [C,phi,S12,S1,S2,t,f,confC,phistd,Cerr]=cohgramc(data1,data2,movingwin,params)
% Input:
% Note units have to ... |
6c010d6dd87237cb709de857ef09abb24c4e8bc90ab1c0d9900243fa978143b6 | MATLAB | 6,556 | 148 | function CBIG_MSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% CBIG_MSHBM_generate_profiles(seed_mesh,targ_mesh,out_dir,sub,sess,split_flag)
% This function will generate functional connectivity profiles for a
% specific subject in a specific session. A split flag can be passed in if
% the u... |
54694a3187f8f09af0f7ded6d4a55c0f2cd14e19fcfd777ee18c4798fe1ce978 | MATLAB | 6,570 | 160 | function [ DetectionReview ] = DetectionReview(obj,event )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%obj = findobj('tag','EventExplorerMaster');
FO = guidata(obj);
%% Select the time windows to look at
%User input for this
numwins = 30; %number of windows to look at. determine... |
4fe6c36b66b86f18aa63418fe24d9f9af06f020723c58f4050b5687930a60686 | MATLAB | 6,572 | 148 | function [unitType, unitType_string] = getQualityUnitType(param, qMetric, savePath)
% JF, Classify units into good/mua/noise/non-somatic
% ------
% Inputs
% ------
% param: struct containing paramaters for classification
% qMetric: struct containing fields of size nUnits x 1
% ------
% Outputs
% ------
% unit... |
d8888fd53ac923753dd06822d6ebab7091718cd749e1d55d8f66970ae7023a01 | MATLAB | 6,596 | 194 | classdef Myvar
% Standard format for time-varying measurements not defined elsewhere in
% the CMBHOME package. Allows the storage and retrieval of time-varying
% variables measured at arbitary timescales.
%
% Variables will be interpolated to the same time scale as root.fs_video
% and will undergo epoch filtering just... |
6567d33dffc2f4afa3b81445d8b01410c408447bc6cad05a3c12c1f7320e3610 | MATLAB | 6,606 | 253 | function [pval table] = circ_hktest(alpha, idp, idq, inter, fn)
%
% [pval, stats] = circ_hktest(alpha, idp, idq, inter, fn)
% Parametric two-way ANOVA for circular data with interations.
%
% Input:
% alpha angles in radians
% idp indicates the level of factor 1 (1:p)
% idq indicates ... |
4a7b55077bb20907756ae203823adeff29c8556f2bf29a164fd1fcf42a5cb599 | MATLAB | 6,608 | 185 | function [spectrogram,t,f] = MTSpectrogram(lfp,varargin)
%MTSpectrogram - Compute LFP spectrogram by multi-taper estimation.
%
% The spectrogram is computed using the <a href="http://www.chronux.org">chronux</a> toolbox.
%
% USAGE
%
% [spectrogram,t,f] = MTSpectrogram(lfp,<options>)
%
% lfp wide-ban... |
8c43a75fe76fab9f6da7b6d3a831631ab18d3c77ca757e503993eb50a321ee55 | MATLAB | 6,609 | 195 | % eventlock() - DEPRECATED: Please use eegalign() instead.
% eventlock() - Time lock data epochs to specified event frames or event x-values.
% Use to timelock existing data epochs to reaction times or other events
%
% Usage:
% >> [dataout,medval,shiftframes] = eventlock(data,frames,eventframes,medval);
... |
9e6952455135f58806473f9145e5a74a35ea8c10f6d4bc163d0e964c736add11 | MATLAB | 6,610 | 156 | %
% This is a calling routine to test & check out the power spectrum &
% spectrogram routines for unequal segment lengths. In addition, use it
% to compare with Chronux routines when segments are of equal length.
%
clear all;
gram = 0 ; % 0=spectra, 1=coherence
chronux = 0; % 1=compare, 0=don't
line = 0;
nSamples =... |
4d356300a0910e18488606216f6b02349c85f18f79d0d87bfaf5efd3b2a8bbe3 | MATLAB | 6,611 | 188 | % eegrej() - reject/excise arbitrary periods from continuous EEG data
% (e.g., EEG.data).
%
% Usage:
% >> [outdata newt newevents boundevents] = ...
% eegrej( indata, regions, timelength, eventlatencies);
%
% Inputs:
% indata - input data (channels, frames). If indata is a string,
% ... |
2b93f108d3b9e6b6b4eedcc5e0cd2a5a3ca3ef7050c1fbf6cc1abec39f86b775 | MATLAB | 6,613 | 208 | function [f_peak, power_ratio] = IntrinsicFrequency_merge(self, cel, print_to_screen, speed_thresh, varargin)
% Intrinsic frequency of a unit
%
% ARGUMENTS
%
% cel [tetrode index, cell index] in Session object root
% print_to_screen 0 or 1 (0) plots analysis
% speed_thresh ... |
2e85246cab4ce6c24698a7446ac433fafb5981462993151bc18212fb27439c24 | MATLAB | 6,614 | 160 | % function [ seqOfEventsReform, clustHistoryReform] = reformSeqOfEventsFromMerge2split(seqOfEvents,segmentMerge,segmentSplit,rowMergeSplit,clustHistory)
%
% Copyright (C) 2022, Jaqaman Lab - UTSouthwestern
%
% This file is part of SMI-FSM.
%
% SMI-FSM is free software: you can redistribute it and/or modify
% it under... |
f8e1d5f6459ed005a23dffbd8e40c5cb2611c7027e7bbafe7a5740b7a554fe6b | MATLAB | 6,615 | 263 | function res = plotPE_TFRBandStats(cwtres, f, t, opts)
%PLOTPE_TFRBANDSTATS Plot band-specific deviant-minus-standard TFR statistics.
%
% Usage:
% res = plotPE_TFRBandStats(cwtres, f, t);
%
% Inputs:
% cwtres : 5 x 1 cell, each cell is nCh x nFreq x nTime CWT magnitude
% f : nFreq x 1 or 1 x nFreq frequency ... |
02373e1f8f914ca6d6eb508dbfcf50ab7ece1ee1a9b59dd742cc8056a742ea34 | MATLAB | 6,627 | 161 | function [ S, f, Serr ]= mtspectrumc_unequal_length_trials( data, movingwin, params, sMarkers )
% This routine computes the multi-taper spectrum for a given set of unequal length segments. It is
% based on modifications to the Chronux routines. The segments are continuously structured in the
% data matrix, with t... |
31b5dc35a94832772034bc88c7d3305f93163f6ae58e3979c0ca220ed5e1d5da | MATLAB | 6,633 | 201 | function ea_spm_apply_normalization(options)
% Apply SPM based normalization to pre-op anchor and post-op images
% Use INVERSE deformation for normalization (Push method in SPM)
deformation = [options.subj.norm.transform.inverseBaseName, 'spm.nii'];
input{1} = options.subj.coreg.anat.preop.(options.subj.AnchorModalit... |
17bbddbe3ed971464bf8227e6045ac4dd9041b2d0782365ed0aaa22ec5f37b32 | MATLAB | 6,639 | 120 | function [results, params] = CBIG_hMRF_wrapper_generate_homotopic_parcellation(lhrh_avg_file, output_folder, varargin)
% [results, params] = CBIG_hMRF_wrapper_generate_homotopic_parcellation(lhrh_avg_file, output_folder, varargin)
%
% This is the wrapper function to set up and run the clustering algorithm based on the ... |
af8460aaf146ba4f9d4366c5ffc2dc8a13c241d6e8d723942497489751d063fa | MATLAB | 6,644 | 183 | function [vertices, label, colortable] = read_annotation(filename, varargin)
%
% NAME
%
% function [vertices, label, colortable] = ...
% read_annotation(filename [, verbosity])
%
% ARGUMENTS
% INPUT
% filename string name of annotation file to read
%
% O... |
68110a10d88ef8e417a9b4b01e4a312338864a38ad116ce4853b2f315a34cb7a | MATLAB | 6,649 | 194 | classdef HBox < uix.Box
%uix.HBox Horizontal box
%
% b = uix.HBox(p1,v1,p2,v2,...) constructs a horizontal box and sets
% parameter p1 to value v1, etc.
%
% A horizontal box lays out contents from left to right.
%
% See also: uix.VBox, uix.Grid, uix.HButtonBox, uix.HBoxFlex
... |
9a246a5993e1e975bb163c1641ae47e915d24996c5e94e8ab33f36733231dbbe | MATLAB | 6,650 | 183 | function [vertices, label, colortable] = read_annotation(filename, varargin)
%
% NAME
%
% function [vertices, label, colortable] = ...
% read_annotation(filename [, verbosity])
%
% ARGUMENTS
% INPUT
% filename string name of annotation file to read
%
% O... |
ce3101db6fb3f3f221def19a08433952d2541bc70f2ebc562ba19cad0e6be7c4 | MATLAB | 6,655 | 130 | function [lh_output_file,rh_output_file]=CBIG_gwMRF_build_time_matrix(input_fullpaths,output_path,start_idx,end_idx,fsaverage,lh_output_file,rh_output_file)
% This function concatenates timeseries data from several subjects
% Possible inputs for our current setting:
%
% Input
%
% - input_full... |
96d25c67be341a880a9c2a0ab79557f3025f493a9504b873e6427b3c14ab3fb0 | MATLAB | 6,657 | 176 | % std_interp() - interpolate, if needed, a list of named data channels
% for all datasets included in a STUDY. Currently assumes
% that all channels have uniform locations across datasets.
%
% Usage: >> [STUDY ALLEEG] = std_interp(STUDY, ALLEEG, chans, method);
%
% Inputs:
% STU... |
49c9af00626514eff645ac84c95b127ff6b0d9decf283f85509ee70cfbe8d886 | MATLAB | 6,663 | 188 | classdef Panel < uix.mixin.Container
%uix.mixin.Panel Panel mixin
%
% uix.mixin.Panel is a mixin class used by panels to provide various
% properties and template methods.
% Copyright 2009-2015 The MathWorks, Inc.
% $Revision: 1435 $ $Date: 2016-11-17 17:50:34 +0000 (Thu, 17 Nov 2016) ... |
55deeb8de82a2998055588260550526913c6bb7f49b04f6da6679c51adc50de8 | MATLAB | 6,674 | 224 | classdef TabPanel < uix.TabPanel
%TabPanel Show one element inside a tabbed panel
%
% obj = uiextras.TabPanel() creates a panel with tabs along one edge
% to allow selection between the different child objects contained.
%
% obj = uiextras.TabPanel(param,value,...) also sets one or more
... |
11af160bf7ee8ea5dac87718c1d69e9f87374690444d077c0aa2bb61c7849283 | MATLAB | 6,681 | 194 | classdef VBox < uix.Box
%uix.VBox Vertical box
%
% b = uix.VBox(p1,v1,p2,v2,...) constructs a vertical box and sets
% parameter p1 to value v1, etc.
%
% A vertical box lays out contents from top to bottom.
%
% See also: uix.HBox, uix.Grid, uix.VButtonBox, uix.VBoxFlex
% Co... |
036a36e40517c736fe391e2ee408277b336ebde291e56dc54ba969f87de64d84 | MATLAB | 6,682 | 192 | function ts = run_periodic(topology,homparam,hetparam,stim)
% RUN with ZERO TRIVIAL CONDITIONS: phi(r,0) = phi_t(r,0) = 0;
% Periodic boundary conditions
% Takes in input of model parameters, timesteps and lengthsteps.
% Returns timeseries at each point.
% List of step-size inputs (topology)
% T: time domain [... |
b112aecb39940771760f6addd9eb7864b9bde9c3294c6c998ab9f241026ae7f5 | MATLAB | 6,683 | 140 | function hfig = UImovieplayer(data, Fs, frame)
%UImovieplayer Show a 3-D matrix as an XY-T movie.
% UImovieplayer(DATA), for a M x N x P matrix DATA, creates a new figure
% and shows the frames DATA(:,:,k), 1 <= k <= P, as a movie.
%
% UImovieplayer(DATA, Fs) specifies the temporal sampling rate of the
% ... |
71cbf90b1396acddabc3f63dad90f1b71d448df6e2c707dda2a870111aaf55fd | MATLAB | 6,692 | 195 | function install_sdpt3( varargin )
%SDPT3 installation script
%
% Heavy rewrite by Michael C. Grant, pulled from similar work on SeDuMi.
%
need_rebuild = any( strcmp( varargin, '-rebuild' ) );
no_path = any( strcmp( varargin, '-nopath' ) );
targets64={...
'mexMatvec', 'mexProd2', 'mexProd2nz', 'mexexpand', 'mexi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.