sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
0deaa8773ec9f9f1758b179dfbcd66a37ca28c2d2c11b754ae7f79d4416a44d9 | MATLAB | 11,971 | 176 | clc
clear all
close all
whicheye = input('Please enter left or right to choose eye: ','s')
rawfilepath = input('Enter raw_data location(such as /home/raw_data): ', 's');
processedpath = input('Enter processed_data location(such as /home/processed_data): ', 's');
for user_num = 1:1 %(user_num = 1:48)
for session = 1... |
491a55a23a142db73d21dfa28de48bd3febface048ac5255ed630c4ed0027aa3 | MATLAB | 11,974 | 260 | function out = FC_Surprise(y, whatPrior, memory, numGroups, coarseGrainMethod, numIters, randomSeed)
% FC_Surprise How surprised you would be of the next data point given recent memory.
%
% Coarse-grains the time series, turning it into a sequence of symbols of a
% given alphabet size, numGroups, and quantifies measu... |
ebcbd5e4e3b45c59abc80b435f98564a17f943cb76aed6cc7c235d579c4b391d | MATLAB | 11,984 | 459 | % load original network
NT = NetworkObj('../networks/circlenuchexresv_N20.net',struct('dim',2))
%%
NT.plotNetwork()
hold all
%% set up and mesh single flat perinuclear sheet
% pick out reservoir nodes
resvnodes = [];
for nc = 1:NT.nnode
if (~isempty(NT.nodelabels{nc}))
if (NT.nodelabels{nc}(1)=='R')
... |
8038446b6502afcfffad3e8554a2687e859765becd1adab95dbd1f80b7ba8110 | MATLAB | 11,988 | 365 | %% sepia_read_popup_value(config_txt, str_pattern, action_handle, popup_list)
%
% Input
% --------------
% config_filename : filename of the sepia pipeline configureation file
% h : master handle of SEPIA
%
% Description: Read pipeline configuration in the file back to GUI
%
% Kwok-shing Chan @ DCCN
% k.c... |
203a05fa8fb567701651b779800fcfc34b30cab1a4a3263cafda06d16da38ba1 | MATLAB | 12,005 | 249 | function out = CO_JointNonGaussianity(y, tau, m, theilerWin, maxN)
% CO_JointNonGaussianity Tests for non-Gaussianity of the joint, time-lagged embedding distribution.
%
% Embeds the time series in m dimensions at time delay tau (e.g., the pair
% (x_t,x_{t+tau}) for m=2, or the triple (x_t,x_{t+tau},x_{t+2tau}) for
%... |
6b7b63acd96a0e2a6623def9c2f85c75a94e7adfa93d0be676eb2ce8241b3f7e | MATLAB | 12,009 | 320 | function [ccg,t,tau,c] = CCG(times,id,opt)
%CCG - Compute multiple cross- and auto-correlograms, or cross-covariances
%
% USAGE
%
% [ccg,t,tau,c] = CCG(times,id,<options>)
%
% times times of all events in seconds (see NOTEs); can also be a
% cell array where each cell contain... |
836a1f0b2ba46319e81d4b795255252ea999a6fd129ff00c1bf6bae48633fc95 | MATLAB | 12,022 | 167 | function [ text ] = tapas_BLT_initVisuals(params)
% tapas_BLT_initVisuals initializes Textures for all task relevant images
%
% Inputs:
% params: data storage file
%
% Outputs:
% text: image textures
%
% Set prediction cue images according to experiment mode and cue type
switch params.expMode
case {'train_4', 't... |
381c6ab695f1e48cb5d3f2660f307b5f20d0068ad272c15fee5acd15c49c5cdf | MATLAB | 12,024 | 282 | % POP_REJKURT - rejection of artifact in a dataset using kurtosis
% of activity (i.e. to detect peaky distribution of
% activity).
%
% Usage:
% >> pop_rejkurt( INEEG, typerej) % pop-up interactive window mode
% >> [OUTEEG, locthresh, globthresh, nrej] = ...
% = pop_rejkurt( INEEG, ... |
6fb8ae53d6b7575ea9bb8487fb8dbcd0e4ca948d4313f2bb2073948d65f7afc3 | MATLAB | 12,036 | 345 | %This code computes the analysis presented in Kundert-Obando et al., 2025
%write to clear the code
clear; clc; close all;
%write out all paths
main_path = '';
fix_path = '';
% mask out the skull (nonzero voxels)
mni_mask = niftiread('MNI152_T1_2mm_brain_mask_filled.nii.gz');
brainVox = find(mni_mask>0);
% define... |
fc5ea1b80b64bbdf541173496d37cd22118ebf7892e62f1c33ef9e76cd9f4f2a | MATLAB | 12,038 | 306 | function [variance_proj,cfg] = pca_proj_xgen(dat,theta,task,cfg)
% [variance_proj,cfg] = pca_proj_xgen(dat,theta,task,cfg)
if nargin < 3
help pca_proj_xgen
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,2); % number of M/EEG sensors
nti... |
0b396a7253a7412a9c06b7ea55f35c716d512ec063b427173136ec6975f08dbb | MATLAB | 12,040 | 315 | function [VOLLOCS, LOCS, verbose] = ...
tapas_physio_create_scan_timing_from_gradients_philips(log_files, ...
scan_timing, verbose)
% Extracts slice and volume scan events from gradients timecourse of Philips
% SCANPHYSLOG file
%
% [VOLLOCS, LOCS] = ...
% tapas_physio_create_scan_timing_from_gradients_phili... |
663c0e146ce48f3c9ed684431f282a10aaa92fac7ff777ba92bdcebf0acee08e | MATLAB | 12,043 | 240 | %% extract the beta parameters in each clusters.
% use each mask - mt, mst, hMT on tactile motion Localizer
% take the avg of beta values from the roi
% (1)lmst- motion_beta and (2) lmst -static_beta
% across two runs
clear
subjectList={'sub-001','sub-002','sub-003','sub-004','sub-005','sub-006','sub-007','sub-008'... |
9be92374108d5672197e10d248bc588f70d675c19672948be033b29626c01240 | MATLAB | 12,045 | 409 | function v = hlp_deserialize(m)
% Convert a serialized byte vector back into the corresponding MATLAB data structure.
% Data = hlp_deserialize(Bytes)
%
% In:
% Bytes : a representation of the original data as a byte stream
%
% Out:
% Data : some MATLAB data structure
%
%
% See also:
% hlp_serialize
%
% Examples:
... |
e8c770d89397391c2b8a78b0ad103ea366341755d7b50cb5a12a35b3c729e9fb | MATLAB | 12,045 | 327 | % Time-frequency analysis of power
ft_defaults
clearvars
%% Select data files and event types
%sbj1_session1
cd('Q:/MEG_data/20190724_b64d/190724/');
dataset{1,1} = 'B64D_S1P1.fif';
dataset{1,2} = 'B64D_S1P2.fif';
%sbj1_session2
cd('Q:/MEG_data/20190801_b64d/190801/');
% dataset{1,1} = 'B64D_S2P1.fif';
dataset{1,1} ... |
bd5025fbaa0afc91770cbb25c72cb2b60ae0c62a17bb7342818131b40827dda3 | MATLAB | 12,047 | 338 | function [stat,p,ci,stats,dist] = permuttest(x,m,varargin)
%PERMUTTEST Permutation-based one/paired-sample t-test and Wilcoxon signed-rank test.
% STAT = PERMUTTEST(X) performs a one-sample permutation test based on
% the t-statistic of the hypothesis that the data in X come from a
% distribution with mean zero,... |
62e4e64732e8a99ec006476e1dc7d0f257b1d99783c0a83aad5dfb66789ccdde | MATLAB | 12,048 | 273 | %{
# Retinotopy Sign map
-> map.RetMap
---
sign_map : mediumblob # sign map of the retinotopy
parameters : mediumblob # parameters of the sign map extraction
%}
classdef SignMap < dj.Imported
methods(Access=protected)
function makeTuples(obj,key) %create ref map
... |
21a41c269e1458503e0116dcad0dc45826cd11d96f7bf15080061ffc1b2a17c8 | MATLAB | 12,072 | 294 | % STD_CELL2TABLE - convert cell output to table
%
% Usage:
% >> tab = std_cell2table(xvals, yvals, cellvals, cellinfo, 'key', val)
%
% Inputs:
% xvals - [vector] values along the first axis
% yvals - [vector] values along the second axis (if any)
% cellvals - [cell array] second output of STD_READATA
% cell... |
cfc356e61319a8281be1810208d93a435442138e5360b6066777a79337d33ae0 | MATLAB | 12,075 | 358 | function [E, D] = pcamat(vectors, firstEig, lastEig, s_interactive, ...
s_verbose);
%PCAMAT - Calculates the pca for data
%
% [E, D] = pcamat(vectors, firstEig, lastEig, ...
% interactive, verbose);
%
% Calculates the PCA matrices for given data (row) vectors. Returns
% the eigenvector (E) and diag... |
d36865630f08e56af28047cb208067e040b78f32db0d794b124817545aaab546 | MATLAB | 12,086 | 273 | function out = NL_EmbedKernelPCA(y, tau, m, maxN)
% NL_EmbedKernelPCA Kernel PCA of a time series in an embedding space, vs. linear PCA.
%
% Reconstructs the time series as a time-delay embedding (as in NL_EmbedPCA)
% and performs kernel Principal Components Analysis on the result using an
% RBF kernel, then compares... |
940becc8b02809242d23af2f5ea267d2f6d8f0fb9285cf8d3946b2528b089965 | MATLAB | 12,097 | 335 | function [ subject, data ] = nmri_preproc(subject, params)
%[ subject, data ] = nmri_preproc(subject, params)
%
% This function will do basic preprocessing on one subject
% i.e. trial cutting, filtering and downsampling
% Usually this is the first step of a processing pipeline
%
% subject = subject structure, s... |
d7370eff550d918621d335d3f8fd3637d278b0f8dcec0ad25375fb7cd2933f03 | MATLAB | 12,098 | 384 | function M = fixedrankfactory_3factors_preconditioned(m, n, k)
% Manifold of m-by-n matrices of rank k with three factor quotient geometry.
%
% function M = fixedrankfactory_3factors_preconditioned(m, n, k)
%
% This geometry is tuned to least squares problems such as low-rank matrix
% completion with ell-2 loss.
%
% A ... |
109504badd408c8aed45b4b004cf13eee809a4a3d639788a656c40acae490763 | MATLAB | 12,105 | 274 | function ExportData
global run filename numFact numComb markCallMemory firstGen
global TabuList NumSelectedLog SeriesValues SeriesValuesL
global TopVectors RankSumLog WinScoreLog WinScoreLogL
global NumImproveLog NumConvergLog VectorProxLog VectorProxLog2
global ScoreProxLog TrackProxLog TrackProxLog2 GoodiesP... |
d95c64fd256e2894b25292dffb194414582b61db98580faa1b33a4e241d214b0 | MATLAB | 12,112 | 438 | function [varargout] = rdir(rootdir,varargin)
% util.rdir - Recursive directory listing
%
% D = util.rdir(ROOT)
% D = util.rdir(ROOT, TEST)
% D = util.rdir(ROOT, TEST, RMPATH)
% D = util.rdir(ROOT, TEST, 1)
% D = util.rdir(ROOT, '', ...)
% [D, P] = util.rdir(...)
% util.rdir(...)
%
%
% *Inputs*
%
% * ROOT
%
% u... |
db7a8d230034aab25fe29d6a9ad8ffcaeea066e4ec50ea4f27e3b4b74df3e8f5 | MATLAB | 12,113 | 247 | %% AFM_RegionAnalysis_Mapping_2rois.m by Julia Becker, 14/10/2021
% This script is identical to AFM_RegionAnalysis_Mapping.m other than that
% it allows the user to define two unrelated sets of ROIs. The 'data'
% variable will contain two columns ('roi' and 'roi2'), one for each set of
% annotated ROIs. Th... |
49a62b547efd7c04d690854f0aea777d450522f3cbb78c81c421bb5bc22d9e39 | MATLAB | 12,119 | 281 | %% This file is used to differentiate surface-localized and internalized endocytic pits
%Type 1 is surface-localized
%Type 2 is internalized
clear all;
close all;
clc;
% Parameters for rendering and DBSCAN
epsilon = 0.25; % Maximum distance between points (nm)
minPts = 10; % Minimum number of points per cluster
width... |
c2dbcd63a29cc641625ae55f5804158a122f31a5fd17eaa48025e69ef1e2ee06 | MATLAB | 12,119 | 270 | % POP_EEGTHRESH - reject artifacts by detecting outlier values. This has
% long been a standard method for selecting data to reject.
% Applied either for electrode data or component activations.
% Usage:
% >> pop_eegthresh( INEEG, typerej); % pop-up interactive window
% >> [EEG... |
246113892bb93bca4393ce7c907b30ae2daf7bb597c54f55d6c8981c33576d12 | MATLAB | 12,124 | 359 | function progressbar(varargin)
% Description:
% progressbar() provides an indication of the progress of some task using
% graphics and text. Calling progressbar repeatedly will update the figure and
% automatically estimate the amount of time remaining.
% This implementation of progressbar is intended to be ex... |
49d1809fc548ef85b59d0d196a3727b90777067f17ffb9ea390c8334355d7aa5 | MATLAB | 12,124 | 332 | function multiEchoCombine(tscPath,TE,refPath,sctPath,T2starMethod,weightMethod,fitNoiseFloor,NFnStd,nonlinAlgo)
% multiEchoCombine(tscPath,TE,refPath,sctPath,T2starMethod,weightMethod,fitNoiseFloor,NFnStd,nonlinAlgo)
% This function combines the echoes of a multi-echo image,
% following the procedure of Kundu et al. 20... |
3f9f6fe5344bda0653d4eada603ac046092f78fd6248a11c7546445a265c219a | MATLAB | 12,125 | 302 | function [err, ErrMessage, Info] = CheckBrikHEAD (Info, show_warning_dialogue)
%
% [err, ErrMessage, InfoOut] = CheckBrikHEAD (Info [,show_warning_dialogue])
%
%Purpose:
% Checks to determine if the fields in Info are appropriate AFNI style
%
%
%Input Parameters:
% Info is a structure containing all the Header fi... |
4bf6da3fc4f0270ce6137a2454a9b73c80953f78eaf1f8dd0867f34455f878f0 | MATLAB | 12,130 | 316 | function [R_noise_rois, noise_rois, verbose] = tapas_physio_create_noise_rois_regressors(...
noise_rois, verbose)
% Compute physiological regressors by extracting principal components of
% the preprocessed fMRI time series from anatomically defined noise ROIS (e.g. CSF)
%
% [R_noise_rois, verbose] = tapas_physio_cr... |
1adbcedd975428547bf547d90361f8ec33a8f3669decf41d52184cbc512f8b91 | MATLAB | 12,136 | 217 | function res = arg_sub(varargin)
% Specify an argument of a function which is a structure of sub-arguments.
% Spec = arg_sub(Names,Defaults,Source,Help,Options...)
%
% Delivered to the function as a struct, and visible in the GUI as a an expandable sub-list of
% arguments. A function may have an argument which itself c... |
f74fceee1e95cfc4d5e5ee8be10a70e075475c51b24cf49e6563f10ed188a2c8 | MATLAB | 12,147 | 262 | %% extract the beta parameters in each clusters.
% use each mask - mt, mst, hMT on tactile motion Localizer
% take the avg of beta values from the roi
% (1)lmst- motion_beta and (2) lmst -static_beta
% across two runs
clear
subjectList={'sub-001','sub-002','sub-003','sub-004','sub-005','sub-007','sub-008'...
's... |
bc8b5cd1d9c79238f7710b83437f4371b8162c5b9cede890bd9b9f0e877f0254 | MATLAB | 12,168 | 311 | function SuppFigure_RandomNet(varargin)
%SUPPFIGURE_RANDOMNET Generate supplementary figure for random network analysis
%
% Purpose:
% Creates a figure analyzing random network properties including schematic
% representation, normalization index distributions across different overlap
% conditions, and correlation... |
0a50447070af83756209d204261ef68147236d1cedf39c3bc3bd8c30a0fc748d | MATLAB | 12,171 | 410 | %%
clear;
working_dir = 'G:\CEST-fMRI'; % the actual directory to put the codes
SPM_modified_path = [working_dir,'\scripts\SPM_modified'];
addpath(SPM_modified_path);
ds_dir = [working_dir,'\datasets\exp2']; % directory of datasets
load_dir = [working_dir,'\scripts\loading']; % directory of loading (hrf)
savin... |
7712b8399d662c9b59f1d4d93448138cbe120a1597b9858d5ab8df56af0f237f | MATLAB | 12,175 | 312 | function [spike] = ft_datatype_spike(spike, varargin)
% FT_DATATYPE_SPIKE describes the FieldTrip MATLAB structure for spike data
%
% Spike data is obtained using FT_READ_SPIKE to read files from a Plexon,
% Neuralynx or other animal electrophysiology data acquisition system. It
% is characterised as a sparse point-pr... |
7f355d6137b51187cde0c6c4319d4b4e6df3db58a4287ed5249aab06df62fbfb | MATLAB | 12,175 | 310 | % all OFC decoding. very long runtime. does conditional psth subtraction
function [] = run_decoding_mlb_allofc(dataname,savename, usemlb, shuff2use)
%location of analysis codebase
codepath = '~/projects/constantinoplelab/Analysis/';
rng(101)
% add code paths
addpath(genpath(codepath))
ad... |
61e49d1aaeb50cacc36958b2b0fe2b67bb6e36726226db05ad6d08a36604c270 | MATLAB | 12,179 | 306 | % pop_dipfit_headmodel() - use Fieldtrip functions to generate headmodel
% from anatomical T1 MRI.
%
% Usage:
% >> OUTEEG = pop_dipfit_headmodel( EEG ); % pop up window
% >> OUTEEG = pop_dipfit_headmodel( EEG, mriFile, 'key', 'val' );
%
% Inputs:
% INEEG - input dataset
% mriFile ... |
6f21cfd759365f3e5861702b98c9a919f55f12dded995b2aa5331a0edddb8646 | MATLAB | 12,186 | 274 | % STD_ERPIMAGE - Compute ERP images and save them on disk.
%
% Usage:
% >> std_erpimage( EEG, 'key', 'val', ...);
%
% Inputs:
% EEG - a loaded epoched EEG dataset structure. May be an array
% of such structure containing several datasets.
%
% Optional inputs:
% 'components' - [numeric ve... |
9678082ae259cf4b4fcf51f23f23a0086a9d3b4452245109d8408a237a94bcad | MATLAB | 12,190 | 343 | %This code computes the analysis presented in Rogge-Obando et al., 2024 mediarchive
%Author: Kim Kundert-Obando and Dr. Catie Chang for questions please reach out to me at k.rogge.obando@gmail.com or kim.kundert.obando@vanderbilt.edu
%write to clear the code
clear; clc; close all;
%Load envirionment
loadenv("glob... |
945a0718c7a4380535c14acbf81e36c57eb0e9050d4193f7ea81612570422683 | MATLAB | 12,191 | 438 | function [Model, Info] = linear_sparse_space_vec_sw(X,Y,Model,parm)
% Estimate linear weight matrix for input-output mapping
% Automatic Relevance Prior for each input dimension
% in original input space (not for delay embedding space)
% is imposed to get sparse weight matrix
% Noize variance for ea... |
6f49b030d2b52d2eb6681f0e4cc4374d44ff5b3c192273518082ab1b52ab5754 | MATLAB | 12,195 | 195 | function analyze_communication_subspace_epoch(group, epoch)
close all
clearvars -except group epoch
clc
% Analyze communication subspace in each epoch.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
switch group
case 'control'
load('behavior_control.mat')
load('activit... |
a32e9cb0f7e727f3cccb3e487929e0bd3d8efbee9d986da88baf0f17c540ef29 | MATLAB | 12,196 | 357 | function ExamineXmat(fname, polort, dt, nrun, nmot)
% ExamineXmat([XMAT])
%
% A function to aid in examining the design matrix output by 3dDeconvolve
%
% XMAT: Name of xmat file, such as EA.xmat.1D. If unspecified,
% function will open a file browser to pick one.
% The function will begin by displaying all the... |
ec5993d36d240493c71f94893fa1c2a447022bcdc649e0bfc99cd776b6d0f1aa | MATLAB | 12,200 | 297 | function seq = sero_pulseq_SERO_create_v4(E, opt, lims)
% function seq = sero_pulseq_SERO_create_v4(E, opt, lims)
%
% E is the second generation SERO sampling scheme
% opt contains all pulse sequence settings
% lims are the hardware limitations
if nargin < 2
opt = sero_pulseq_SERO_opt();
end
if nargin < 3
lim... |
0b7b03b2a9039639700c7173ffb29ddeb77a6afa8bd29cc3d0cdf84eebc75ddb | MATLAB | 12,201 | 348 | function ft_write_headshape(filename, mesh, varargin)
% FT_WRITE_HEADSHAPE writes a head surface, cortical sheet or geometrical descrition
% of the volume conduction model or source model to a file for further processing in
% external software.
%
% Use as
% ft_write_headshape(filename, mesh, ...)
% or
% ft_write_h... |
31d19029d28d6cb038c969301a3f97925afd4163ee82315372197c65ff4b57fc | MATLAB | 12,224 | 355 | function update_temporal_parallel(obj, use_parallel, use_c_hat)
%% update the the temporal components for all neurons
% input:
% use_parallel: boolean, do initialization in patch mode or not.
% default(true); we recommend you to set it false only when you want to debug the code.
% use_c_hat: use the previous ... |
4ed32311e9c5d860fd84256c7a0adf36499c9360bb53146e822580dba6b9d698 | MATLAB | 12,231 | 283 | function [rho,sigma,CI95] = fitCARAmodelToRiskyChoices(valRiskyHigh,valRiskyLow,valSafe,chooseRisky)
demo = 0;
if nargin == 0
close all;
demo = 1;
% create 3 subjects, plotted in differnt colours:
rho = [-0.1 0 0.1]'; % !! for rho = 0.5, I get crazy certainty equivalents
name... |
ac4c0758220d74ba85cc30e6cd6ee5c1edf91fb7d351230535e059a727a41705 | MATLAB | 12,242 | 316 | function [C2,cfg] = mahal_iem_trialwise_xgen_avgsigma(dat,theta,task,cfg)
% [distmat,cfg] = mahal_iem_trialwise_xgen_avgsigma(dat,theta,task,cfg)
if nargin < 3
help mahal_iem_trialwise_xgen_avgsigma
error('missing input arguments!')
end
%set options
if (nargin < 3) || (isempty(cfg))
cfg = s... |
ee40ef90c644d4cee67407806b765db6113efd8bfa8810bddd084bea68257b30 | MATLAB | 12,244 | 349 | function [OUT] = permute_mtx(data,varargin)
% [OUT] = permute_mtx(data,[meth],[verbose],[niter],[separator])
%
% tor wager
%
% PERMUTATION TEST FOR STOCHASTIC ASSOCIATION BETWEEN COLUMNS
% OF DATA (Ho)
%
% This function takes as input two matrices,
% an actual matrix of data
% an... |
f6704a74ff021fa024fd7e4c8946cf1d76a2357843158071a59a0897009b8813 | MATLAB | 12,253 | 303 | function [C2,cfg] = mahal_iem_trialwise_xgen_xtime(dat,theta,task,cfg)
% [distmat,cfg] = mahal_iem_trialwise_xgen_xtime(dat,theta,task,cfg)
if nargin < 3
help mahal_iem_trialwise_xgen_xtime
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,... |
4fbddaa670ae2a788182dd85d79552822de95725376a451dfdc89ef950d5c08a | MATLAB | 12,256 | 327 | %script to compress the start, choice, and poke data so that you aren't opening up tons of files
cd('~/projects/ofc/data/PhysiologyData/Christine_OFC_2019')
%savedir = '~/projects/ofc/data/PhysiologyData/Christine_OFC_2019';
[fnames, units, depth, duplicate, rat, days] = getfnames();
savetype = 'published';
switch s... |
e0d62c6b51f2889872b67f85886a00ce049183ecb518f9c1fc2663b3c85b7ee4 | MATLAB | 12,266 | 391 | function icassoGraph(sR, varargin)
%function icassoGraph(sR,['identifier1',value1,'indentifier2',value2,...])
%
%PURPOSE
%
%To visualize the estimate space as a 2D projection and the
%similarities between the estimates as a graph. Estimates are
%presented as black points that are located so that the distances
%between ... |
d2f1c79c5eb8519435039fa6f96185da1a9ed1924d09861dc2eeb89629613a5e | MATLAB | 12,271 | 331 | % code for improved 1/f fit of EEG data (mouse or human)
% requires the following in the path: the Chronux package and the following
% called upon functions: improved_EEG_fit.m, st_fit_EEG.m,
% plot_spectrum_two_groups.m, fg_bootstrap_two_groups.m,
% fg_bootstrap_two_groups_seed.m, and makeseed.m
% requires ... |
6e76e9138705c0af2437aae8023b39a834a3b603eb703b66e99475650ab0e581 | MATLAB | 12,277 | 317 | function [MList, memoryMap] = ReadMasterMoleculeList(varargin)
%--------------------------------------------------------------------------
% MList = ReadMasterMoleculeList(fileInfo, varargin)
% This function loads a .bin file containing a molecule list and converts
% it into a matlab structure. This function only loads... |
19d51a98f1c3dc07f44bb72ffbb9e96cfa4974b564a99e1e33a06e9cabc23cce | MATLAB | 12,289 | 225 | function Burst = LEGENDY_Burst_detectorV2(ISI,fac,sampling_rate,min_length_of_burst,local_length,surprise_cutoff)
% Function Burst = legendy_new3(ISI,fac,sampling_rate,min_length_of_burst,local_length,surprise_cutoff)
% carries out the burst detection algorithm by Legendy and Salcman (J. Neurophysiology 53:926) on
... |
b26298ef7ca11a016205ff1edb9bbae12bd4dacb4fac9ec1e0010191cbf670e1 | MATLAB | 12,306 | 307 | function SuppFigure_BasicResponse(varargin)
%SUPPFIGURE_BASICRESPONSE Generate supplementary figure for basic response properties
%
% Purpose:
% Creates a figure showing basic network response properties including
% spike rasters, firing rate distributions, and correlation analyses
% across different stimulus co... |
cd875c0f74e2eb7441b497f18fff80c055ca617ea887b61d5ee96c19f849fcef | MATLAB | 12,310 | 266 | % PLUGIN_MENU - main function to install EEGLAB plugins
%
% To install plugins from the command line, type in
%
% plugin_askinstall('xxxxxx', [], true); % with xxxx being the name of the plugin
%
% Usage: plugin_menu(PLUGINLIST); % pop up gui
% Copyright (C) 2019 Arnaud Delorme
%
% This file is part of EEGLAB, see htt... |
2ca3d98dcfe24aee3fda3fdbd44fcdda0b4e009d4be0afefd26b646d06006278 | MATLAB | 12,314 | 335 | function [result] = fit_happy_model_Omar_Social(mtx,happyscore,constant)
%assumes that each row of the cell array is a different subject
rptfit = 100; %repeat N times jittering the betas
tempf=fieldnames(mtx);
for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end;
data = mtx;
data.happ... |
aa047d6eaa3e7d90ebe7abe6c6d559255486fa9a9aa5d77f4b7c094d68a68d33 | MATLAB | 12,315 | 280 | function AA_list = anatomicalAreas_getList(listName, groupInfo)
% returns list of anatomical areas based on specification in 'listName'
% each row in the cell array 'AA_list' is 1 anatomical area (AA)
% first column of 'AA_list' is the name of the area
% second column of 'AA_list' is a cell array of strings defining th... |
b85ac5bb726753afebb39fe680d8df47a5c1f7608556bb9b47936508fc474310 | MATLAB | 12,321 | 302 | function ft_write_event(filename, event, varargin)
% FT_WRITE_EVENT writes an event structure to a file, a message daemon listening on a
% network socked, or to another computer connected through the serial port. Note that
% this function is mostly for real-time streaming of events. For most data files on
% disk the w... |
1ababc3360a2a602ccfc30bb3032931d4a42ba6a88b5f88dd6cb025ea1974f7e | MATLAB | 12,339 | 304 | function SuppFigure_Current_Connection_NormInd(varargin)
%SUPPFIGURE_CURRENT_CONNECTION_NORMIND Generate supplementary figure for current-connection vs normalization index
%
% Purpose:
% Creates a figure analyzing the relationship between current types, connection
% numbers, and normalization indices, showing corre... |
fb4b6608639f17d5bd8b4590ecfc9ed74f790e73eb2c1bde429713da39f6406a | MATLAB | 12,339 | 392 | function [neighborsIDs, neighborsSrc, neighborsScore, neighborsDC, neighborsW] = catmos_consensus_neighbors_with_weights(res,i,predVT,predNT,predEPA,predGHS,predLD50,varargin)
%CATMOS_CONSENSUS_NEIGHBORS_WITH_WEIGHTS Select final-consensus neighbors.
%
% Usage:
% [neighborsIDs,neighborsSrc,neighborsScore,neighborsDC,... |
ffed3b9e1d2ac9d93b60ee82e321b9a2f78e9051c6eee22a75dfc150502fe39c | MATLAB | 12,341 | 399 | % Helpful link = http://web.mit.edu/hst.583/www/LABS/lab5b_manual.pdf
% What I need to do - convolve each person's task timeseries with the HRF.
% I can read in each peron's EV text file, make a boxcar function with it,
% convolve it with the HRF, then look at brain states during periods of
% task.
addpath('C:\... |
0d94dc3f358b2d7350866755a8933fa0e54ad1576be34cf23cf3a03256880df5 | MATLAB | 12,346 | 308 | function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r)
% Algorithm to (try to) compute a maximum cut of a graph, via SDP approach.
%
% function x = maxcut(L)
% function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r)
%
% L is the Laplacian matrix describing the graph to cut. The Laplacian of a
% graph is L... |
a78fe1ee6657dc701a176da2671a099a4456ffee31014da0f776501fff2ab2a9 | MATLAB | 12,354 | 192 | function plot_RNN_choice_switch_region_ablation
close all
clear all
clc
% Plot perturbation-induced choice switching in RNNs under region-specific ablations.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
load('RNN_choice_switch_trial_fraction_region_ablation.mat')
switch_trial_fraction_... |
05ec03e3f93fc4173515b60a149de01f1f7fa3aeaf93fe9ed4f856e81e467556 | MATLAB | 12,355 | 336 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells. Fraction of cells are selected
% according to their phase such that grid cells with closer phases are averaged within the same voxels
% and fraction that is selected randomly.
% ... |
56831ed4d2146c2dc53f3a1a0e48b0fd9c043d315b84b4b5cb8ad449269eecce | MATLAB | 12,357 | 261 | function [ResultMaps] = restFC(ADataDir,AMaskFilename, AROIDef,AResultFilename, ACovariablesDef, VorR_tag)
% Functional connectivity
%AROIList would be treated as a mask in which time courses would be averaged to produce a new time course representing the ROI area
% Input:
% ADataDir where the 3d+time dataset stay, ... |
e93698ca0dfa33fd12524692c3c86d371820b92680d8e816a7e5f2accb65d5af | MATLAB | 12,363 | 291 | function DicomHeader = read_dcm_header(fid)
%% dcmHeader = read_dcm_header(fid)
% Reads header information from a DICOM file.
%
% Example:
% dcmHeader = read_dcm_header('file0001.dcm')
%
% Author:
% Dr. Georg Oeltzschner (Johns Hopkins University, 2018-04-24)
% goeltzs1@jhmi.edu
%
% Credits... |
d7b54618f8a33111a50432689156ae084cfcea9bba1a58dfa9074cf78ae37efd | MATLAB | 12,397 | 326 | % EEG_GETEPOCHEVENT - Return dataset event field values for all events
% of one or more specified types
% Usage:
% >> epochval = eeg_getepochevent( EEG );
% >> epochval = eeg_getepochevent( EEG, 'key', 'val');
%
% Inputs:
% EEG - Input dataset
%
% Optional inputs:
% ... |
fa5becc402c4e4fba43d59b501e4c98fbdc8ec1db36ae16f3e98a0ef589a8015 | MATLAB | 12,399 | 318 | function out = NL_GPCorrSum(y, Nref, r, thwin, nbins, embedParams, doTwo)
% NL_GPCorrSum correlation sum scaling by Grassberger-Proccacia algorithm
%
% ---INPUTS:
% y, column vector of time-series data
% Nref, number of (randomly-chosen) reference points (-1: use all points,
% if a decimal, then use this fraction... |
35c05a77261b6042de5b19204ecdebb33011236d2f13e4c13b7282556d6841ca | MATLAB | 12,409 | 294 | function [cmd,C]=surfing_suma_align(varargin)
% Alignment of Freesurfer surfaces to an anatomical volume using AFNI
%
% Necessary parameters:
% action: 'tosuma', 'mapico', 'moresurfs', 'alignoriganat',
% 'applyoriganat', 'all', or ''
% origvolfn: path and filename of original anatomical volume th... |
636342b00d18dc002de907b98fa6e116098637c671c706eab347e3009f60d0bf | MATLAB | 12,428 | 244 | function UnsupervisedClustering_Callback(hObject, eventdata, handles)
% Cluster with k-means or adaptive
finished = 0; % Repeated until
while ~finished
choice = questdlg('Choose clustering method:','Cluster','ARTwarp','Auto Encoder + Contour (recommended)', 'Contour Parameters','Auto Encoder + Contour (recommended... |
56e0b49e0545eb8688142bb3a6ceb5770eb7abd9d25ae7d26dbb525bef011cb0 | MATLAB | 12,433 | 381 | function tf = ft_platform_supports(what, varargin)
% FT_PLATFORM_SUPPORTS returns a boolean indicating whether the current platform
% supports a specific capability
%
% Use as
% status = ft_platform_supports(what)
% or
% status = ft_platform_supports('matlabversion', min_version, max_version)
%
% The following val... |
e794e234f5cd68d699770c3ea3d71d4b716dfb30310b50a4366701b190175b57 | MATLAB | 12,435 | 329 | function TS_PlotDataMatrix(varargin)
% TS_PlotDataMatrix Plot the data matrix.
%
%---EXAMPLE USAGE:
% TS_PlotDataMatrix; % plots clustered data if it exists
% TS_PlotDataMatrix('whatData','norm'); % plots normalized data
%
%---INPUTS:
% whatData: specify 'norm' for normalized data in HCTSA_N.mat, 'cl' for clustered
%... |
e879d55be7c1ff1413caacf9cc90c573a9ba4628cf2d57e79c83f79359d01713 | MATLAB | 12,445 | 387 | function [ subject ] = nmri_project_timecourse(subject, data, params)
%[ subject ] = nmri_project_timecourse(subject, data, params)
%
% This function will do the main processing including
% power @sensor level (for QC)
% source recon
% power @source
% connectivity @source
%
% subject = subject structure, see nmr... |
0bedb2ee9a7a554620469cbc6f033c5e522a2d2c38041bbda7a59f69791e6616 | MATLAB | 12,450 | 318 | function [mante_proj,variance_proj,cfg] = mante_proj_xgen_pv(dat,theta,task,cfg)
% [mante_proj,variance_proj,cfg] = mante_proj_xgen_pv(dat,theta,task,cfg)
if nargin < 3
help mante_proj_xgen
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,... |
9ab3db864d1dfbf44b0dc658763f24f7acb0989aeed4329b5c8f74f1852ab20b | MATLAB | 12,450 | 320 | function [stoixeion_results] = Stoixeion(Spikes,Coord_active,pars)
disp(" # Running SVD analysis ...")
% Find ensembles using SVD method.
% INPUT:
% Spikes: N-by-T binary spike matrix, where N is the number of neurons,
% T is number of frames
% Coord_active: N-by-2 matrix, containing coordinates of corr... |
329b124440fc736d328558f3cd553b2637df714632855dc04ba3d3205af862e7 | MATLAB | 12,452 | 314 | function out = NL_FractalDimensions(y, kmin, kmax, Nref, gstart, gend, past, steps, embedParams, randomSeed)
% NL_FractalDimensions Fractal dimension spectrum, D(q), of a time series.
%
% ---INPUTS:
% y, column vector of time series data
% kmin, minimum number of neighbours for each reference point
% kmax, maximum n... |
ee5c3c491385f2bfa35bf1815e76272dc3e6856ca6efda7b161243cf58f29b17 | MATLAB | 12,455 | 400 | function [info, str] = vl_simplenn_display(net, varargin)
%VL_SIMPLENN_DISPLAY Display the structure of a SimpleNN network.
% VL_SIMPLENN_DISPLAY(NET) prints statistics about the network NET.
%
% INFO = VL_SIMPLENN_DISPLAY(NET) returns instead a structure INFO
% with several statistics for each layer of the netw... |
e5912954ac6d2e6f22ec98104e5d5e5d35051f1a5d80d63c86e62450913de7ba | MATLAB | 12,467 | 276 | function out = EN_MSE(y, scaleRange, m, r, preProcessHow, whatEntropy, numClasses)
% EN_MSE Multiscale entropy of a time series
%
% As per "Multiscale entropy analysis of biological signals",
% Costa, Goldberger and Peng, PRE, 71, 021906 (2005)
% http://physionet.comp.nus.edu.sg/physiotools/mse/papers/pre-2005.pdf
%
%... |
2940ddd192ea43f0d368d073829b84dd7c467482dafeff6e05b7c4697af40a43 | MATLAB | 12,473 | 326 | function out = MF_CompareTestSets(y, theModel, ord, subsetHow, samplep, steps, randomSeed)
% MF_CompareTestSets Robustness of test-set goodness of fit
%
% Robustness is quantified over different samples in the time series from
% fitting a specified time-series model.
%
% Similar to MF_FitSubsegments, except fits the... |
98a0238aa2ac42667b49c37a1d28af6f9783d2ba1f0513e96cbbb8eb3b4f04d4 | MATLAB | 12,475 | 325 | function SuppFigure_WeakCoupling_EIbalance(varargin)
%SUPPFIGURE_WEAKCOUPLING_EIBALANCE Generate supplementary figure for weak coupling E/I balance analysis
%
% Purpose:
% Creates a comprehensive figure showing the relationship between coupling
% strength and excitation-inhibition balance, including balance indices... |
263ba7135a81dee5c43393493d8190bf919d16dc34986960d9d376e0df4ac3f3 | MATLAB | 12,482 | 267 | function cm_data=viridis(m)
cm = [[ 0.26700401, 0.00487433, 0.32941519],
[ 0.26851048, 0.00960483, 0.33542652],
[ 0.26994384, 0.01462494, 0.34137895],
[ 0.27130489, 0.01994186, 0.34726862],
[ 0.27259384, 0.02556309, 0.35309303],
[ 0.27380934, 0.03149748, 0.35885256],
... |
1a0c628bcb1d6de68e8ebb6942735ebedd5fcbaa860eb3357aa392fa2fb36c66 | MATLAB | 12,487 | 363 | function [simResults] = sim_testNBSPredict(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sim_testNBSPredict performs simulation using simulated network data.
% It is used to test prediction performance of the NBS-Predict and
% alternative algorithms (elastic net, lasso, p-valu... |
699db9d770b298a27ed0881c40f907308b85e8f39666b26b9502b3d3cece8eca | MATLAB | 12,491 | 286 | % POP_JOINTPROB - reject artifacts in an EEG dataset using joint
% probability of the recorded electrode or component
% activities observed at each time point. e.g., Observing
% large absolute values at most electrodes or components
% is impro... |
aa7f4768236c1ebf4ccb3269f8454994c44649012181cd3e7750a69253cba514 | MATLAB | 12,497 | 148 | function summary_stats = load_summary_stats(disorder)
%
% Usage:
% summary_stats = load_summary_stats(disorder)
%
% Description:
% Outputs summary statistics for a given disorder (author: @saratheriver)
%
% Inputs:
% disorder ({'22q', 'adhd', 'asd', 'bipolar', 'depression', 'epilepsy',
% 'ocd', 'schizophrenia... |
ed7db61a187f023bd36cc4a056b044310db7715d2ad33736dea6210b27d9b62e | MATLAB | 12,497 | 230 | % POP_ERPPARAMS - Set plotting and statistics parameters for cluster ERP
% plotting
% Usage:
% >> STUDY = pop_erpparams(STUDY, 'key', 'val');
%
% Inputs:
% STUDY - EEGLAB STUDY set
%
% Input:
% 'topotime' - [real] Plot ERP scalp maps at one specific latency (ms).
% ... |
646fa67e73dc14b709123bd3021b12349cd5e1e6983e9896bb46e8f7a18f0245 | MATLAB | 12,501 | 301 | function figureMDSArrangement(RDM, userOptions, localOptions)
% FUNCTION
% draws a multidimensional scaling (MDS) arrangement reflecting the
% dissimilarity structure of the items whose
% representational dissimilarity matrix is passed in argument RDM.
% the function can draw the MDS result as ... |
72cd5ecf468e0826d1b41ec9b13d762e91416fef4546f889bcd904b15bd1f0b8 | MATLAB | 12,517 | 296 | function [out] = read_ced_son(datafile,varargin)
% READ_CED_SON
%
% [OUT] = read_ced_son(DATAFILE,VARARGIN);
%
% Reads a analog and event data from a CED SON file
% (SON files are created by Spike2 software). Currently, only
% analog channels and event data can be read.
%
% Optional parameter Default
% 'read... |
5dded848cfec4a82382a38ca3ec7551cb818769f6f5bfeab4fa5418f4e5c62fa | MATLAB | 12,540 | 348 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% brain hubs
% set working paths
statdir=[Pathnew,'Forgithub\Code']... |
c8e8c47cec94b70209c3997ca66d74b8d6835f700f12b1bba3f10a4db4f3b4b9 | MATLAB | 12,541 | 374 | function results = runnsdsyntheticbehavioralanalysis(filename,expectedframes,expectedduration,nsdexpfile,crunnum,choicebuttons);
% function results = runnsdsyntheticbehavioralanalysis(filename,expectedframes,expectedduration,nsdexpfile,crunnum,choicebuttons);
%
% <filename> is the .mat file saved from runnsdsynthetic.... |
e97fb8821c49fabba3e0fe1083269f91eb304eca23107468c116b089b3668467 | MATLAB | 12,544 | 430 | function [dmt,clusters,dm,OUT] = dbcontrast2density(DB,u,varargin)
% function [dmt,clusters,dm,OUT] = dbcontrast2density(DB,u,[radius_mm],[testfieldname],[contrast over levels],[con_dens_images])
%
% XYZ is 3-column vector of coordinates
%
% Tor Wager 11/20/04
%
% step 1: read database
% step 2: database2clusters -- g... |
21121307d8b2359fd1cb5d39bbef5f092f927afb7d0f05b67ba9f199552f61f6 | MATLAB | 12,557 | 277 | function out = NL_EmbedCluster(y, tau, m, kMax, maxN)
% NL_EmbedCluster Gaussian-mixture clustering structure in a time-delay embedding space
%
% Reconstructs the time series as a time-delay embedding (as in NL_EmbedPCA,
% NL_EmbedKernelPCA) and fits Gaussian mixture models with a small grid of
% component counts to ... |
40d2b259e513dccae848b0ff3f7ef5422775a5d424e003bd7e06329bf7492e01 | MATLAB | 12,560 | 313 | function align_axislabel_log(~,ax)
% This function first rotates x, y and z labels to the direction of their
% corresponding axes when a rotate operation has finished. So that labels
% will be parallel to axes. Then, moves the axis labels to a proper
% distance from the axes by calling 'axislabel_translation'.
% T... |
de2faed4351629812c496d7d75a61dbf5e3c8c54dfddd3607530541d7c81cb14 | MATLAB | 12,578 | 362 | function [pars,mask, gof] = IVIM_seg(Y,b,lim,blim,disp_prog)
% function [pars,mask, gof] = IVIM_seg(Y,b,lim,blim,disp_prog)
%
% Function for monoexponential or stepwise biexponential fitting to
% diffusion weighted MR data. The size of the input variable lim determines
% the type of fit (monoexponen... |
8bf3e65272808c40953072bd4d093fba7119d9a9ef9e45e84e1bc4d5b0156182 | MATLAB | 12,588 | 362 | function coactPaper_figure01
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
close all
fh=initFig('width',18.6,'height',17,'font','Arial','fontsize',fontsize);
x=14;y=5;
panel_01(x,y,fontsize);
panelLetter2(x-letGapX-4,y-letGapY+2,alphabet(1,labelCase),'fontSize',labelSize,'isBold',l... |
9a10b8cb3df38f6990771097d78d0db9e23f8c6ea88ab905012f1cf3cd8455df | MATLAB | 12,613 | 194 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% FIX FOR BREATHING FILTER DETECTION TASK %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -------------------------------------------------------------------------
% Author: Olivi... |
186d42b48ae7e3ad4f3862d9ee5c4f0fc2215bb46b1ad3b44780d34a40e66662 | MATLAB | 12,615 | 243 | classdef Fast_Tiff_Write < handle
%FAST_TIFF_WRITE Aims to write tiff data quickly on the fly
%by writing the image data first, and end the file with IFD's
%TIFF was published in 1986 by Aldus Corporation. Aldus merged with
%Adobe Systems Incorporated on 1st of September 1994.
%Followin... |
8bd8e721802ef20d46ce8698d3ede8d894ee97a8788261a2deb39168367a7526 | MATLAB | 12,638 | 275 | % pop_firws() - Filter data using windowed sinc FIR filter
%
% Usage:
% >> [EEG, com, b] = pop_firws(EEG); % pop-up window mode
% >> [EEG, com, b] = pop_firws(EEG, 'key1', value1, 'key2', ...
% value2, 'keyn', valuen);
%
% Inputs:
% EEG - EEGLAB EEG structure
% 'fcutoff' - v... |
989ffa438f7ae8cb1ac4cf570ab5fbe1264dc4cf98fc8f25c0aae5585517cf2d | MATLAB | 12,651 | 221 | function analyze_communication_subspace_subspace_similarity_across_time(group)
close all
clearvars -except group
clc
% Analyze communication subspace similarity across time.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
switch group
case 'control'
load('behavior_control.mat')... |
3468323497e441264e6d3ed7ce8dc0c20a5ae2373a7847d3995ce9b7a41f74b0 | MATLAB | 12,659 | 411 | function clnew = dbcluster_meta_meta(varargin)
% clnew = dbcluster_meta_meta(varargin)
%
% Inputs:
%
% clusters structures, one for each meta-analysis
% always followed immediately by DB database structure for the
% meta-analysis
% These structures are the output of database2clusters
%
% cell vector of string myvariabl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.