sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
3d0a56fd291a5c63def3ffd6b1638dc685cbc51a56b0b44220e7a0cc4db5aaee | MATLAB | 5,371 | 157 | function varargout = process_nst_glm_contrast_ttest( varargin )
% process_nst_compute_ttest
% Compute a ttest according to a spm-like constrast vector using
% t = cB / sqrt( c Cov(B) c^T )
%
% B, cov(B) and the corresponding degrree of freedom are estimated inprocess_nst_compute_glm.
%
%
% @=======================... |
4bc05217fb089916e89af0c0a6b7ccd83dceafbb8d4e5349d38e73f3a2059773 | MATLAB | 5,384 | 153 | function BCCT_Mod_matrixcomputemain(Parameter)
pathfiles = which('BCCT.m');
[path nam ext] = fileparts(pathfiles);
Outputdir = Parameter.Outputdir;
RealCompPara.Outputdir = Outputdir;
Inputdir = Parameter.Inputdir;
RealCompPara.Inputdir = Inputdir;
SeedROItype = Parameter.SeedROItype;
RealCompPara.SeedROItype =... |
144c0630a4e90f9d8cadf520d06af49eff345917d9bed5d04df9932238ef2cfe | MATLAB | 5,401 | 134 | function res = tc_perform_eegfmri_regression(selected_data, ROIs, freqs, weighted, parcor, skip_prestim, eeg_control, fmri_control, varargin)
if ischar(selected_data)
load(selected_data)
end
if ~isempty(eeg_control)
eeg_control_times = eeg_control;
end
%%
early_only = false;
if ~isempty(varargin)
hemis = v... |
7fc6cefbd32c636fb6ae09d3acebf77bf3cdd757ebe34d854808d699ef834ad1 | MATLAB | 5,405 | 142 | %% Preprocessing EEG and Respiration Data for new data
% This script processes EEG and respiration data for the 17 participants
% from the new dataset. The original dataset was already preprocessed. It
% performs preprocessing steps as described in Park et al. (2020). The
% Fieldtrip toolbox is required.
% Final output... |
4f8daf512d87ee6547b2a383bc21ec14ca536e62efdab94dd19490153584ef11 | MATLAB | 5,421 | 185 | function [normsig,sigPks,siglocs,bPks,blocs,APDs,...
ampalt,loadalt,apdalt,...
smalllocs,biglocs,smallPks,bigPks,smallloads_t,bigloads_t,smallloads,bigloads] = alfn(Fluo,framerate,Pks,locs,before,after,tfilt,apd);
% Function for calcualting alternan paramaters from single pixel trace
% Chris O'... |
f24a3f32ad3a2197c7b1b36a71e7f3fb7d2c15b50cadcd0d4434af9a367d6068 | MATLAB | 5,428 | 174 | function status = run_bipolar_qc(rootPath, exclusionFile, subjectIDs, opts)
% apply_bipolar_qc_and_merge_ratings
%
% Apply bipolar channel exclusions and embed day-level ratings.
%
% INPUT
% rootPath : root data directory
% exclusionFile : CSV file with columns:
% Subject, Day, Exc... |
ca925b2ece542ed207cbe7cec96128bbf58a4f485f879c57cf1a85ffc71c7876 | MATLAB | 5,444 | 153 | function jds_rippleTriggeredWaveletREM(animalprefixlist, days)
%JDS_RIPPLETRIGGEREDWAVELETREM Ripple-triggered wavelet spectrogram in REM.
% jds_rippleTriggeredWaveletREM(animalprefixlist, days) computes the
% session-z-scored Morlet wavelet spectrogram around cortical REM ripple
% onsets on the ctxriptet with th... |
aabf4a8218cd4fbbbdd62744be8aa1ca970c519b224ac8ff6cfc4dd968c78f78 | MATLAB | 5,454 | 140 | function stat = pl_permtest(data,varargin)
% Performs a permutation test on 'data' for difference against 0.
% For a difference against any mean value m (e.g. baseline decoding accuracy 50), use input: data - m.
% The test returns the statistical map (using the requested 'statistic'),
% the pvalue statistical ma... |
1b021bf78b494654134959ffa036c660c7eac3a972e6934e9d82c334f2087c96 | MATLAB | 5,472 | 132 | clear;close all;clc
%% Simulation Parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Module Parameters
mpool=1000; %total number of motors shared by modules
cpool=750; %total number of clutches shared by modules
totact=10^5; %t... |
8ce2c39f5435064921888be31c3ef7fbe8831b1259307a9c0180dde16ce92820 | MATLAB | 5,477 | 156 | function BCCT_MatrixGCshow_coef_GUI(RESshow,outdir,enhanind,Coltype,PVALT,Pvalused,orders)
% load(indir);
[mpat,mnam,mext] = fileparts(which('BCCT_MatrixGCshow_coef_GUI.m'));
load(fullfile(mpat,'gray.mat'));
load(fullfile(mpat,'MatColormap','mycolormap.mat'));
GCAorder = size(RESshow,2);
for iorder = 1:GCAord... |
c712afd0acd0d82b9ac00e645ca67320db240a771103b76d24944e224b62e32d | MATLAB | 5,487 | 182 | function [pos,unit]=getpos(h,fmt,href,opt)
% GETPOS Get graphics object position in a flexible way.
% GETPOS(H,FMT) gets the position property of graphics object
% with handle H, according to FMT that can be expressed using different
% units. H must have a "Position" property.
%
% FMT is a char array containin... |
49d2b105777bbe6af09bbeb250c9d7ee07cdde73f1b4e3badb9bdfa4c127a5b1 | MATLAB | 5,503 | 156 | function jds_thetaPowerThetaIEI(animalprefixlist)
%JDS_THETAPOWERTHETAIEI Theta inter-peak intervals in phasic vs tonic REM.
% jds_thetaPowerThetaIEI(animalprefixlist) bandpasses CA1 riptet LFP in
% the theta band, finds theta peaks from the averaged signal, and
% compares mean inter-peak intervals within phasic ... |
08655b27c1086aaffd7f402b86b226b6ee1791efcd1afeaa6a72216cd24a3fe9 | MATLAB | 5,508 | 154 | function varargout = process_nst_export_nirs( varargin )
% @=============================================================================
% This software is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2013 Brainstorm by the University of Southern California
% This sof... |
892b7d5453a5312de0a88c257bd3d8b86f92bbbc8ce768111287e6a1aaebbc17 | MATLAB | 5,508 | 158 | function [c,ceq,gradc,gradceq] = nonlconAnalytic(x,tolIsotropy,gMax,integralConstraint,targetTensor,tolMaxwell,signs, useMaxNorm, motionCompensation, dt)
%NONLCONANALYTIC evaluates the nonlinear constraints and their gradients.
q = x(1:end-1);
s = x(end);
N = length(q)/3;
Q = reshape(q,[N 3]);
% Remove action on axes... |
7ff82687a50a7c1c023539c033213b6ee8c548e625240bb4e8399ba20f5f60ff | MATLAB | 5,511 | 183 |
function [map,meann,alll,onedev,vari,SE] = ttpnew(t1,t2,framerate,t,maskedimage,imagestack,avbeat,outs,cmin,cmax,tfilt,before,apdblopt,apdblnum)
% Function for calculating ttp
% Chris O'Shea and Ting Yue Yu, University of Birmingham
% Maintained by Chris O'Shea - Email CXO531@bham.ac.uk for any queries
% Relea... |
6cdcc2d5c68eeb0766ad99d21fbb4edf38d0400cd05c6a2da10fd695ba60fe51 | MATLAB | 5,525 | 72 | function ggg = maskload(filename, startRow, endRow)
% function for applying loaded map (generated automatically from MatLab)
% Chris O'Shea and Ting Yue Yu, University of Birmingham
% Maintained by Chris O'Shea - Email CXO531@bham.ac.uk for any queries
% Release Date -
% For licence information, Please see '... |
4d6e8d9f1d5acf72c38f7fd49e5b1821f78e8a22a7d3c8f9cb688e80c4fce291 | MATLAB | 5,530 | 141 | % -------------------------------------------------------------------------
% Script: make_figureS2.m
%
% Description:
% This script generates Figure S2 for the manuscript, comparing the
% circular distribution of respiratory phases in two datasets: original
% (Park et al., 2020) and newly collected data. The compariso... |
3cdb87e8bcc84c2b78881b9dd6040a9c9481f654140433f0271265545433251c | MATLAB | 5,532 | 194 | %% UNG2
seq=getgenpept('P13051')
aacount(seq,'chart','bar')
molweight(seq)
isoelectric(seq)
%% Danio rerio
DRA=fastaread('C:\Users\animeshs\Google Drive\DANRE.fasta\DANRE.fasta');
%% brain specific protein list http://www.uniprot.org/uniprot/?query=organism%3A%22danio+rerio%22+AND+tissue%3Abrain&sort=s... |
758c12cfae93b7066540f0bd734e8e9dc5ddf68d6c78e873c5061de32b220de3 | MATLAB | 5,544 | 207 | % Load NIFTI header extension after its header is loaded using load_nii_hdr.
%
% Usage: ext = load_nii_ext(filename)
%
% filename - NIFTI file name.
%
% Returned values:
%
% ext - Structure of NIFTI header extension, which includes num_ext,
% and all the extended header sections in the header extens... |
7ac4c26d27b346a541c971d6cbadcea9e29fb286f87b179643a61b6b6e4966c9 | MATLAB | 5,550 | 203 | %%
clear all; clc;
root_dir = 'H:\newdata';
out_dir = [root_dir, '\rename'];
cd(root_dir);
data_list = dir('*.set');
for di = 1:length(data_list)
EEG = pop_loadset('filename', data_list(di).name, 'filepath', root_dir);
% Extract event fields
mffkey_tar1 = {EEG.event.mffkey_tar1};
mffkey_tar2 = {EEG.eve... |
19d7e9d305957a888b9c7c57ed676348b1e448a936fa9d286fa0804e06599a0c | MATLAB | 5,563 | 134 | classdef MbllTest < matlab.unittest.TestCase
properties
tmp_dir
end
methods(TestMethodSetup)
function setup(testCase)
tmpd = tempname;
mkdir(tmpd);
testCase.tmp_dir = tmpd;
utest_bst_setup();
end
end
methods(TestM... |
f3919dc6d899031596e6d47e5d9ed0ce83a6df713e8db3fea78090c901e4ed70 | MATLAB | 5,574 | 149 | function EigenVectors_VoxelSpace(data_dir,save_dir,leida_dir,selectedK)
%
% This function loads the fMRI signal in each voxel of a brain template.
% Resizes the template to the 10mm MNI space. Computes the fMRI phase
% leading eigenvectors for each TR for all participants. Then computes the
% mean leading eigenvector f... |
591e5f169fd3cb7b211f69eac2f9bfc023d49bf6caf2e94a7851432729c0aa43 | MATLAB | 5,579 | 141 | function montage_info = nst_montage_info_from_bst_channels(channel_def, channel_flags)
%% Explode channel data according to pairs, sources and detectors
% Args
% - channel_def: struct array
% Definition of channels as given by brainstorm (see db_template('channeldesc'))
% [- channel_flags]: 1D array of int
... |
6635ed2dfeca7d8b9d9d2ae20d7292b9abb623a698e0a76f4307e43de958aff6 | MATLAB | 5,596 | 210 | %% List of monoisotopic mass of fragments for inclusion/exclusion input to Elite orbitrap
fo='X:\Results\Alexey\peptides.txt';
fw=[fo,'.pepmonoisomasslist','.txt'];
peph=fopen(fo);
pep=textscan(peph,'%s');
pepw = fopen(fw,'w');
em=0.0005485799094;
pm=1.007276466812;
pepmol=zeros(size(pep{1},1),1);
for... |
a1a249d470d5000172ce5f0a95075e36befea2939240b9a58fef9b36d58c88c9 | MATLAB | 5,613 | 237 | function [num_images,rect,mask,im,I,boundaries,camopt,frame1,fluoim,rois,n] = OMimload(fname,cropchoice,quinnieopt,threshop,threshman,rect,inversion,camopt,fluo_opt,roinum,roisum)
% Function for taking raw image file and applying thersholding, final
% output - regradless of input, will be uint16 mask.
% Chris O'She... |
52b007ab7994b40835fce6ccf6e5a83db4f93a4fa4b06c313a64c2a39b142125 | MATLAB | 5,615 | 151 | function shape_classification_dendrogram_graph(data)
classes = data.classes;
for k = 1:size(classes,1)
colors{k} = unique(cell2mat(classes{k,4}));
end
colors = unique(vertcat(colors{:}));
c_map = colormap(jet);
c_map = interp1(1:256,c_map,linspace(1,256,max(colors)));
if size(classes,1)<1000
parame... |
fd6e29b35b6c85cc22325743f3fad0b2836ad644d897af1136640bfc4b7fda64 | MATLAB | 5,617 | 137 | function Plot_Centroid_Pyramid(data_dir,cond,parcellation,n_areas,cortex_dir)
%
% Plot of the rendered centroids on cortical space and overlap with Yeo
% functional brain networks (Yeo et al. 2011)
%
% INPUT:
% data_dir directory where the centroids obtained for each clustering
% solution are saved
%... |
acce80b128ebe7cde2f51bf79bc79cabf3b4b5989b7452efa8f5a8cd80d7fafd | MATLAB | 5,620 | 158 | function [Pq,tpath,plq,qstop,allpths,util] = findpaths(CIJ,sources,qmax,savepths)
%FINDPATHS Network paths
%
% [Pq,tpath,plq,qstop,allpths,util] = findpaths(CIJ,sources,qmax,savepths);
%
% Paths are sequences of linked nodes, that never visit a single node
% more than once. This function finds all paths that... |
7e98055f01b61e44c749e46e45af5b046c5359061d7c56c432be351460b3efc0 | MATLAB | 5,624 | 175 | function [conatTLdata, concatRerefdata, collectedTLdata, collectedRerefdata] = eegPreprocessing(parameterSettingsPreProc)
%% [conatTLdata, concatRerefdata, collectedTLdata, collectedRerefdata] = eegPreprocessing(parameterSettings)
% unwrap structure to function workspace
tc_struct2ws('caller', parameterSettingsPreProc... |
865d9d0b51a29c41d4081f236bad0da4dc28872da5dc640ecef5d634d1a6f190 | MATLAB | 5,626 | 120 | %% FREQUENCY DOMAIN MVAR ANALYSIS WITH INSTANTANEOUS EFFECTS
% REFERENCE: Luca Faes and Giandomenico Nollo (2011). Multivariate Frequency Domain Analysis of Causal Interactions in Physiological Time Series,
% Biomedical Engineering, Trends in Electronics, Communications and Software, Anthony N. Laskovski (Ed.), ISBN:... |
1b303fd39a8662fb793ddbdd3ad27aac98b1d274944f6c46a5a016b843b917cd | MATLAB | 5,628 | 115 | function O = FromCoordMatrix_2_3DNifti_8mm_LBPD_D( S )
O = [];
% It translates LBPD coordinates (8mm) from matrix (3559 voxels) into a 3D
% configuration normally used to generate nifti images with brain template.
% INPUT: -S.data: data (voxels x ROIs (time-points))
% -S.fname: path and ... |
20336076777cbd880097abadcd4c15f74cc3a8249c31a8eed74cc4ecd0f421b6 | MATLAB | 5,633 | 141 | %% Fig 2c
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG2_DATA);
fontsize = 8;
set(groot,'DefaultTextInterpreter','tex',...
'DefaultAxesTickLabelInterpreter','tex',...
'DefaultLegendInterpreter','tex',...
'DefaultTextFontName','Arial',...
'D... |
83a131b066d653507c79678f56e80e300f975d0d72e4fa2208429ed26ff489ec | MATLAB | 5,635 | 251 | % Return orientation of the current image:
% orient is orientation 1x3 matrix, in that:
% Three elements represent: [x y z]
% Element value: 1 - Left to Right; 2 - Posterior to Anterior;
% 3 - Inferior to Superior; 4 - Right to Left;
% 5 - Anterior to Posterior; 6 - Superior to Inferior;
% e.g.:
% Standard... |
a27e3f0d93529fd94baf11f5240aad30c5a454e58fa2f5c41a8fdebe76e02225 | MATLAB | 5,644 | 157 | %% Fig 2G (threshold-only)
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG2_DATA);
fontsize = 8;
set(groot,'DefaultTextInterpreter','tex', ...
'DefaultAxesTickLabelInterpreter','tex', ...
'DefaultLegendInterpreter','tex', ...
'DefaultTextFontName','Ari... |
b39cd25419da05e9d3fe5bea865d9615a562cf25682e145f3b6437f563005d20 | MATLAB | 5,645 | 158 | function [] = waveform_plotting_local(S)
% It plots waveform for multiple conditions (one group of participants).
% Typically used for plotting time series of MEG channel/source, locally.
% INPUTS:
% -S.data: Data that you want to plot
% ROIs (sens... |
401db526b730341aad4215f07fb48d74d37ac5654b266a48de4a696df9d5cd6e | MATLAB | 5,647 | 118 | % -------------------------------------------------------------------------
% Script: make_figureS4.m
%
% Description:
% This script generates Figure S4 for the manuscript, illustrating the
% impact of removing a single outlier (single trial, or single participant).
%
% The figure contains:
% - Three bar plots (Fig... |
02916c2ac38301ee17a076df217bcb8ffb88d2ffa09853bc9e051c5b1bb7f4f4 | MATLAB | 5,665 | 210 | % Make ANALYZE 7.5 data structure specified by a 3D or 4D matrix.
% Optional parameters can also be included, such as: voxel_size,
% origin, datatype, and description.
%
% Once the ANALYZE structure is made, it can be saved into ANALYZE 7.5
% format data file using "save_untouch_nii" command (for more de... |
2770153ec3db3a596cab1eb2f4f076f966cbe0ebf12ac5f8b3e6903d2f9b9368 | MATLAB | 5,687 | 196 | function T = build_connectivity_longtable(rootPath, subjectIDs, opts)
% build_connectivity_epoch_longtable
%
% Compute epoch-level connectivity (PLV + coherence) and output a
% long-format table for statistical modeling.
%
% INPUT
% rootPath : root data directory
% subjectIDs : cell array of subject IDs... |
71c82b62d91c05bd941f0a0ac6fcceca56d73aa9b6db9196af144d05d022149f | MATLAB | 5,703 | 154 | function varargout = process_nst_combine_masks( varargin )
% @=============================================================================
% This function is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2017 University of Southern California & McGill University
% This ... |
7d5b885c482dfe868ecb078d59b83fc0550a4994f3c64cfa8dce586280267d2c | MATLAB | 5,712 | 63 | function paths = mipp_getDataPaths(id)
switch id
case 2
onam = 'Mouse_002';
fn_rare = '\\uw.lu.se\research\LU22A1004-msf_fsz\Common\DATA\MIPCART pilot\Pilot MRI/MouseExternalRT_PilotJune2022\221021\20221021_091729_220210_JS_221006_mouse_2_time3_1_28\NII\010_1_Bruker_RARE_MAGNITUDE.nii.gz';
... |
3c0a53e5cd977edce892e2772402f807b9abff0e5e6177f8cab7d4191e559da6 | MATLAB | 5,720 | 212 |
%% MANUAL SCRIPT! %%
%% RUN SECTION BY SECTION %%
clc
clear
cd("/Users/pelinozsezer/Documents/Science/Radboud/RGS-Project/code/ripples/data/waveforms")
%% SECTION 1 - Prepare Data
%% VEH
% cluster 1
load('waveforms_cluster1_veh.mat');
GC_cluster1_veh = waveforms_cluster1_raw_veh(:,1);
GC_Bp_cluster1_veh ... |
ccedb5883c119db757d5ebaa06e5aeb4820925cbd7905db39fba068ff4f580fd | MATLAB | 5,737 | 144 | function nst_tutorial_tapping(tutorial_dir, reports_dir)
% TUTORIAL_INTRODUCTION: Script that runs the tutorial on basic NIRS data
% processing (finger tapping experiment).
% See http://neuroimage.usc.edu/brainstorm/Tutorials/NIRSFingerTapping
%
% INPUTS:
% - tutorial_dir: Directory where the sample_nirs.zip file ... |
5dc3024df0f7f02cd80f308349c1ff5b781d0e950a551069aba03cf344307d99 | MATLAB | 5,749 | 102 | function O = Replay_Long(labell)
O = [];
if labell == 1
load('/scratch7/MINDLAB2022_MEG-EncodingMusicSeq/gemma/decoding/Localizer_19_20time.mat'); %time in seconds
list_TG = dir(['/scratch7/MINDLAB2022_MEG-EncodingMusicSeq/gemma/decoding/Localizer_1_2/TG*']); %list of TG files
dummean = zeros(length(time... |
f3c185e4a040cd6431dbf25ba11de0543df046c3ad35623ad2c6aec2397d415d | MATLAB | 5,750 | 166 | % This script visualizes the different neuron groups based on their firing
% rates. This is done for both treatments.
%% Loading Data
load('RGS_Session_1.mat')
% load('RGS_Pyr_S1_No_Rn3.mat')
load('Vehicle_Session_1.mat')
Pyr_RGS=RGS14_Session_1.Pyramidal_Cells;
Pyr_Veh=Vehicle_Session_1.Pyramidal_Cells;
%% Corre... |
3599ada36f599395f667adabab9416539ef356ba87ef3574e77cfc75098b1a9c | MATLAB | 5,753 | 152 | function colors = distinguishable_colors(n_colors,bg,func)
% DISTINGUISHABLE_COLORS: pick colors that are maximally perceptually distinct
%
% When plotting a set of lines, you may want to distinguish them by color.
% By default, Matlab chooses a small set of colors and cycles among them,
% and so if you have more than ... |
7f4bd284f0d761d52871555a17e0b843818ecf80a6323b4799d6a4b05b1dd10e | MATLAB | 5,755 | 176 | %% NEARESTNEIGHBOUR Demonstration
% This (publishable) script |nndemo.m| demonstrates the features of the
% nearestneighbour function.
%
% Example: Open this file in an editor (in Matlab 7+) and press publish to
% generate the html document
%% Summary
% |nearestneighbour| computes nearest neighbours to a set o... |
9952bf8e4e4f921229094243a8d1387033717e357fa708a86ffc8417517d4b15 | MATLAB | 5,770 | 173 | %% SFig2E - Number of neurons: Control vs Behavioral at 5 µA (800 µm truncation)
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG2_DATA);
fontsize = 8;
set(groot,'DefaultTextInterpreter','tex', ...
'DefaultAxesTickLabelInterpreter','tex', ...
'DefaultLegendInterp... |
5002cc885adaba9ae6b9370126af7685de5bbea438537de8635a3eb6f4d2bdbf | MATLAB | 5,774 | 154 | function varargout = process_nst_glm_contrast_mask( varargin )
% @=============================================================================
% This function is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2017 University of Southern California & McGill University
% T... |
8605c0143b01702eeda5ed470bcfd070b22a691d9eb312580cc105f2c285ab85 | MATLAB | 5,774 | 136 | function model = random( ran, fix, strran, strfix, ranisvar );
%Makes a fixed and random effects term into a mixed effects model.
%
% Usage: model = random( ran [,fix [,strran [,strfix [,ranisvar]]] );
%
% Internally a random consists of two terms that describe linear models for
% the mean and the variance. The... |
7c0e0c120fc040edb09819be54a5cff02bca5f08d1871676f32cd0a854b39c6c | MATLAB | 5,775 | 136 | function [C_pos,C_neg,Ctot_pos,Ctot_neg] = clustering_coef_wu_sign(W,coef_type)
%CLUSTERING_COEF_WU_SIGN Multiple generalizations of the clustering coefficient
%
% [C_pos,C_neg,Ctot_pos,Ctot_neg] = clustering_coef_wu_sign(W,coef_type);
%
% The weighted clustering coefficient is the average weight or inten... |
1e29c0a2b57adbb4164e13dbccd5a8a04dac8356da7b11ce17a7c2560205c268 | MATLAB | 5,776 | 161 | function Plot_K_V1_VoxelSpace(leida_dir,selectedK,parcellation)
%
% Plot the mean centroids computed in MNI 10mm voxel space.
%
% INPUT:
% leida_dir directory where LEiDA results are stored
% selectedK K defined by the user
% parcellation parcellation template used to segment the brain
%
% OUTPUT:
% .fig/.png ... |
fcae8df268a8d69960e68ee09c0a208eea0fc72bc361ec67af488feb7e075761 | MATLAB | 5,791 | 164 | function [ surf, ab ] = SurfStatReadSurf1( filename, ab, numfields );
%Reads coordinates and triangles from a single .obj or FreeSurfer file.
%
% Usage: [ surf, ab ] = SurfStatReadSurf1( filename [,ab [,numfields ]] );
%
% filename = .obj or FreeSurfer file name.
% ab = 'a' for ASCII or 'b' for binary. If it ... |
a384ba6041ee3867195d80d16d39aff8a22c2248898742aae92fe95a6c252d07 | MATLAB | 5,798 | 160 | function slm = SurfStatT( slm, contrast );
%T statistics for a contrast in a univariate or multivariate model.
%
% Usage: slm = SurfStatT( slm, contrast );
%
% slm.X = n x p design matrix.
% slm.V = n x n x q variance matrix bases, normalised so that
% mean(diag(slm.V))=1. If absent, assumes q... |
54a3f5a442ffb231d84515501078e71016c1e2c716ee8bdfa22b2c186fb402d4 | MATLAB | 5,811 | 167 | function [swr_hpc,swr_pfc,s_hpc,s_pfc,V_hpc,V_pfc,signal2_hpc,signal2_pfc,sd_swr, M_multiplets, Mx_multiplets, multiplets,Mono_hpc,Mono_pfc]=swr_check_thr(HPC,PFC,states,ss,D1,D2)
continuous_timestamps=[(0:length(HPC)-1)/1000];
%Ignore NaNs
if sum(isnan(PFC))~=0 || sum(isnan(HPC))~=0
HPC(isnan(HPC)) ... |
34fe8876c76b95dfa13cee175dbd174e6f16c1b18893c9bc18a51550a437ad2c | MATLAB | 5,816 | 187 | function [data,vol] = SurfStatReadVol(filenames,mask,step,dirname,maxmem);
%Reads volumetric files in MINC, ANALYZE, NIFTI or AFNI format.
%
% Usage: [ data, vol ] = SurfStatReadVol( filenames [,mask [,step ...
% [,dirname [, maxmem ] ] ] ] ).
%
% filenames = file name with extension .mnc, .... |
e89137d34dd2c0945f1e798df85a8f31b240d795707bd82a82a1eaed08c479bb | MATLAB | 5,834 | 187 | %% THEORETICAL COEFFICIENTS FOR SIMULATED MVAR PROCESSES
function [Bm,B0,Sw]=simuMVARcoeff(caso);
error(nargchk(0,1,nargin));
if nargin < 1, caso=1; end % default simulation 1
switch caso
case {1} % theoretical example 1 book chapter
M=4;
pmax=2; % maximum lag
r1=0.9; f1=0.1; % osc... |
dd0f81b7924e2a094aad843ff972744d27dffd2b9c01ae4090b5d903d9735d29 | MATLAB | 5,839 | 165 | function varargout = process_nst_remove_ssc( varargin )
% @=============================================================================
% This software is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2013 Brainstorm by the University of Southern California
% This soft... |
9f6cdfc123b0b739347e2176210be824b3326dcd7f90a0ba6650acc078fbe503 | MATLAB | 5,842 | 100 | function h = esa(m)
%ESA Color map providing ESA corporate design colours.
% ESA(M) returns an M-by-3 matrix of the colormap.
% ESA, by itself, is the same length as the current colormap.
%
% For example, to reset the colormap of the current figure:
%
% colormap(esa)
%
% See also HOT, HS... |
feafd918541f37cd4ea43f4285d7abc667e30d0a62ca476cb1c7c2e35ec77d4a | MATLAB | 5,842 | 147 | function [stat] = pl_permtest2(data1,data2,varargin)
% Performs a 2-sample permutation test data1 versus data2 for difference against means.
%
% stat = pl_permtest2(data1,data2) uses default values
%
% stat = pl_permtest2(data1,data2,'param1',val1,'param2',val2,...) specifies one or
% more of the following ... |
e1c5dfe2574a81699445a3087f513dc500ff3e53241060be6c58b20f33174dfe | MATLAB | 5,845 | 153 | function jds_CA1PFCRippleCoactivityREMShifters(animalprefixlist)
%JDS_CA1PFCRIPPLECOACTIVITYREMSHIFTERS Ripple cofiring of theta-phase shifters vs nonshifters.
% jds_CA1PFCRippleCoactivityREMShifters(animalprefixlist) computes z-scored
% CA1-PFC pairwise cofiring within REM chain cortical ripples separately
% for... |
7dd5b52096117af71430c1c5d375a867e3beabcdf9a260365942fc1f2ab77a46 | MATLAB | 5,859 | 123 | function feature_signals = d_fmri_feature_signals_per_layer(parameters)
%% feature_signals = c_feature_signals_per_layer(mainpath, subject)
%mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..';
tc_struct2ws('caller', parameters.main);
%% parameters
tc_struct2ws('caller', parame... |
88f5553c8c197bd7eeb073f6137da28f3736e84900500f23551a1ad95f137625 | MATLAB | 5,891 | 153 | % Inputs:
% xy - array containing [x,y] positions of localizations in columns 1 & 2.
% If more columns are present, it is assumed that column 3 is the
% voronoi area corresponding to each localization
% It is assumed that the units of [x,y] are in pixels, but this can
% be adjusted using... |
992bd02e363a122b2b274cf0dbe3aa3502c24fa4d356ad132142bf1b009b015b | MATLAB | 5,907 | 156 | function delta = FindDeltaWavesRGS14(filtered,k)
%FindDeltaWaves - Find cortical delta waves (1-6Hz waves).
%
% USAGE
%
% delta = FindDeltaWaves(filtered,<options>)
%
% filtered delta-band filtered LFP <a href="matlab:help samples">samples</a> (one channel). This must
% be restricted to ... |
c46bfa8123aa60b0d19f1c4f6449a2706a9c8bf1361d891348ebdda05bb0ba56 | MATLAB | 5,910 | 207 | function [t,df,p,m]=t_matrix(ca,pf,tf,pv,dfc);
%% [t,df,p,m]=t_matrix(ca,pf,tf,pv,dfc);
%%
%% ca = matrix or cell array of data
%% pf = paired flag
%% tf = one-tailed flag
%% pv = pooled variance for unpaired t
%% dfc = Welch-Satterthwaite correction for unequal vars
% leading diagonal of T-matrix is a one-sample t a... |
5b94f56b92dbb9700861c36cb66dbf43cb158b70c1aacc04ab0a5fce3cd3d23e | MATLAB | 5,927 | 150 | classdef ProjectionTest < matlab.unittest.TestCase
properties
tmp_dir
end
methods(TestMethodSetup)
function setup(testCase)
tmpd = tempname;
mkdir(tmpd);
testCase.tmp_dir = tmpd;
utest_bst_setup();
end
end
methods... |
fa5f6de663472e3871c7e4f5f83ce638110574771b025ba2b1744abebe97b754 | MATLAB | 5,938 | 163 | % Open the preprocessed EEG files and label the note events
% Other m-files required:
% EEGLAB toolbox https://github.com/sccn/eeglab
% Author: Cameron Hassall, Department of Psychology, MacEwan University
% email address: hassallc@macewan.ca
% Website: http://www.cameronhassall.com
% Folders
if ispc
... |
f93afac8f79cbcd72321abcdfe7208e994e6eafc9855083dab539278b172fafc | MATLAB | 5,942 | 132 | function [paths,area,numActiv,evPathLength,pathStepsAll,pathStepsTimes] = ...
activationPaths(GlobalEventsTime,GloEvMat,varList,cellMap)
% This function builds the activation paths for all global events in one
% recording session
% ----------------------------------------------------------------------- %
% *** Inpu... |
e82747a3e3a557e6f7241e675a9be1f687a96b630a8701143b97a645a3fe1dcc | MATLAB | 5,945 | 181 | % colourScale 'r' (red), 'g' (green), 'b' (blue), 'y' (yellow), 'm'
% (magenta), 'c' (cyan), 'h' hot, 'p' pink, 'j' jet
function [image, maxValue, minValue] = colouriseData(data, positiveScaleColour, minValue, maxValue, negativeScaleColour, quant)
numBits = 2^16;
image = zeros(size(data, 1), size(data, 2), 3, '... |
0f6481626843994cb3d313bf8c8ce87e46b28f84203113350740b12a7eabbe6b | MATLAB | 5,946 | 168 | % The aim of this script is to examine the coherence between HPC and PFC
% during the REM states as part of rgs14 project
clear all; close all; clc
% parameters for the analysis
srate = 1000;
winsize = 1*srate; % Equivalent to 1s
overlap = 0.8*winsize; ... |
bd3ba9188ec83194fc7adad0a405a5293e7c70183b03780c0bd38431e6617cca | MATLAB | 5,955 | 164 | function [ surf, ab ] = SurfStatReadSurf1( filename, ab, numfields );
%Reads coordinates and triangles from a single .obj or FreeSurfer file.
%
% Usage: [ surf, ab ] = SurfStatReadSurf1( filename [,ab [,numfields ]] );
%
% filename = .obj or FreeSurfer file name.
% ab = 'a' for ASCII or 'b' for binary.... |
e0b467f6c9342be28b200cc651b3ed8205859d7fe3a00779de565d29546a362a | MATLAB | 5,967 | 140 | function spt_jump_length_histogram(data)
input_values = inputdlg({'minimum number of jumps:','maximum displacement (um):','number of bins:'},'',1,{'4','3','100'});
if isempty(input_values)==1
return
else
min_no_of_jumbs = str2double(input_values{1});
maximum_displacement = str2double(input_val... |
ef9b1b51b5b2078c0191291deead3e295f8953cc4ab13abd9c4022404d5204a2 | MATLAB | 5,968 | 130 | %% FREQUENCY DOMAIN MVAR ANALYSIS
% REFERENCE: Luca Faes and Giandomenico Nollo (2011). Multivariate Frequency Domain Analysis of Causal Interactions in Physiological Time Series,
% Biomedical Engineering, Trends in Electronics, Communications and Software, Anthony N. Laskovski (Ed.), ISBN: 978-953-307-475-7, InTech,... |
16b3dbadd6f3869fb1389b5e030866203e5a611bbdb7999a3c0fa166f1fec6c1 | MATLAB | 5,970 | 179 | % MATLAB Demodulation Script for Fiber Photometry Data
% This script processes .lvm files from fiber photometry recordings to extract
% control and signal channels and calculate dF/F
%
% Author: Veleanu Maxime - Adapted from Yaroslav Sych
% Last Updated: 05/01/2025
%
% Usage:
% 1. Set the dirPath variable to point... |
295c92465a667778b889367fe04c31174ce9ad9447361183ee182adee5c5016a | MATLAB | 5,971 | 153 | function Plot_K_3Dbrain(data_dir,save_dir,selectedK,parcellation)
%
% Plot the centroids in a 3D glass brain indicating their overlap with the
% networks defined by Yeo et al., (2011).
%
% INPUT:
% data_dir directory where LEiDA results are stored
% save_dir directory to save results for selected optimal K
% ... |
4abf1b615965b92e55c7b28dc8c87147addf801549037709358405c2142052be | MATLAB | 5,978 | 137 |
%% Version 2019-03-03: Minor update
% *New network models*
%
% * navigation_wu.m: Navigation of connectivity length matrix guided by
% nodal distance
% * quasi_idempotence.m: Connection matrix quasi-idempotence
%
% *Bug fixes and/or code improvements*
% * gateway_coef_sign.m: Bugfix, change in handling of weighted... |
3655611e1f5447c37ba8ca557b4a76c6c47abffcd17197bfa3b32b43a323ce21 | MATLAB | 5,984 | 194 | function data_bundle = loc_list_gravitational_clustering(data)
answer = inputdlg({'Enter Search Radius:','Number of Clusters:'},'Input',[1 50],{'0.001','50'});
if isempty(answer)~=1
gamma = str2double(answer{1});
k = str2double(answer{2});
for i=1:length(data)
data_bundle{i} = loc_list_grvitat... |
0a30fc2a858d78be22173f698ae7fa4db876c89aafe1f47efd60993c4d6dd4c6 | MATLAB | 6,001 | 163 | function [ ] = IFC_plotting_LBPD_D( S )
% It plots IFC matrices, either difference between conditions or matrices after
% statistics, or matrices of a single condition, allowing to do some
% subaveraging.
% PLease note that if you have very few time-points t (like 2-10) you should
% try to ask the function to plot a ... |
19341ebc6bf19336cccc101acb9587938eb4e868a5ec252b930650908afd4e5c | MATLAB | 6,030 | 122 | function obj = prepareTensorWithFixBin(obj, window, binWidth, neus2consider, conds2consider)
% PREPARETENSORWITHFIXBIN - Prepare tensor with fixed-width binning
%
% INPUTS:
% obj - RecordedData object
% window - [start(s), alignment_marker, end(s)] (numeric v... |
266e2e0f91400c27456d3eba752184d33fc4a05759b15b55d867361e503065a6 | MATLAB | 6,036 | 140 | function [O] = GED_single_subject_singletrial_outlier(S)
O = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Loads a single subject, computed GED on it and store the data in a .mat file
% the covariance matrix is computed on each trial independently. Outliers
% are removed both... |
18c403abbf500373059c96822ed684f911d9639147d7195670620225dcea8b38 | MATLAB | 6,073 | 125 | %%
if ~(exist('mainpath','var') && exist('setup_sel','var'))
clearvars
% current working directory needs to be /path/to/scripts
mainpath = pwd;
setup_sel = sprintf('%s/../subjectData/all/eeg-fMRI/setups/b_5_d_contrast_t_000_025.mat', mainpath);
else
clearvars -except mainpath setup_sel
end
cd
addpat... |
bfea164a3f147603c988df4757398d1a72e04ea0064685c9a6fc9801125cb723 | MATLAB | 6,076 | 162 | function nirs_sig_corr = nst_spline_correction(nirs_sig, t, mvtWin_samples,smooth )
%% Motion correction algorithm based on spline interpolation
% Scholkmann, F., Spichtig, S., Muehlemann, T., & Wolf, M. (2010).
% How to detect and reduce movement artifacts in near-infrared imaging
% using moving standard deviati... |
ee12f82ad4f503e3c1a1fc086fe1d7ad3909105724c74bcff2af8f8fffbfccef | MATLAB | 6,090 | 146 | function [envelope] = cal_envelope(cfg, audiodata)
%--------------------------------------------------------------------------
% Till Habersetzer, 26.06.2025
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
% Last Update; 04.07.2025
%
% Description:
% Extracts an envelope from an audio s... |
970602aded8f062faaeae846d265f3e4323f4d202104905f5ceeaab74cc08408 | MATLAB | 6,115 | 171 | % Current working directory needs to be /path/to/scripts
mainpath=pwd;
addpath([mainpath filesep 'toolboxes' filesep 'tc_functions'])
addpath([mainpath filesep 'fmriRegAnalysis'])
%%
dimord = {'corrtype_Pspec_Pacti_roi_subject'};
header_pieces = {'specPos', 'unspecPos', 'specNeg', 'unspecNeg'};
[row, col] = find(triu(... |
d1ac4587115e64337bf930dc834d57c0b9bb2a16085358ec5a64f17bcf8c2791 | MATLAB | 6,120 | 140 | function seg_data = Corregister_func_anat_3(functional4D,structural,structural_seg,cor,tool)
addpath('/home/user/matlab/spm12');
output = struct;
[d, f, e] = fileparts(structural_seg);
output.rstructural_seg = [d filesep 'r' f e];
if exist(output.rstructural_seg,'file')
disp('Coregistration already performed');
... |
e9b53952841626c8cb836ac0b78a1b67da5734c9a2dc36bc655e12df8ff062c4 | MATLAB | 6,125 | 137 | function [ Imag, Smag, Igrad, Sgrad ] = MEG_sensors_combining_magclustsign_LBPD_D( GRAD_clust, MAG_clust_pos, MAG_clust_neg )
% It calculates the temporal similarities between gradiometers and positive and negative
% magnetometer clusters outputted by MEG_sensors_MonteCarlosim_LBPD_D.m.
% The temporal similarities is ... |
fea18f763c2dc60b43632cc30a254553a8281647424e217a8f62a934e5940590 | MATLAB | 6,130 | 144 | function Parcellate_ABIDE_func_preproc(data_dir,info_file,save_dir,parcellation,n_areas)
%
% Parcellate the ABIDE functional preprocessed files and save the files
% with the tag of the condition appended to the file name.
%
% INPUT:
% data_dir directory where the .nii.gz files with the ABIDE data are
% ... |
8757269b4e842dfbca5de14d607270f146ff40d200d2d1fe226301a6021df0f2 | MATLAB | 6,131 | 148 | classdef NetworkAtlas < nla.DeepCopyable
% Network atlas (also known as infomap)
% Defines ROI positions/information and networks
%
% :param name: The name of the atlas
% :param net_names: N\ :sub:`nets`\ x 1 matrix. The names of the networks
% :param ROI_key: N\ :sub:`ROIs`\ x 2 matrix. First... |
e29bbfe239af8cf1ff042df0eb7e1994a459a359423763db8f996c1711f831f0 | MATLAB | 6,131 | 155 | function [scalar_dipmom] = constrained_dipolfitting(cfg,data)
%--------------------------------------------------------------------------
% Till Habersetzer (10.02.2022)
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
%
% This function performs dipolfitting for two dipoles. It computes sc... |
608073653000fc03b7046cb624c49b738ccd1916043a0036fd96426a128a2049 | MATLAB | 6,132 | 184 | %% DICS full brain
if ~exist('mainpath','var')
clearvars
thisSubject = 'S2';
skipLeadfield = 1;
% current working directory needs to be /path/to/scripts
mainpath= pwd;
else
clearvars -except mainpath thisSubject
end
addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip'])
addpath([mainpath ... |
b439d485201d7643c6ced39aa8c3983337b22b1876e08e9291af70d6129088b0 | MATLAB | 6,150 | 120 | classdef NetworkTestsTestCase < matlab.unittest.TestCase
properties
root_path
network_atlas
network_test_options
edge_test_options
edge_test_result
tests
end
methods (TestClassSetup)
function loadInputData(testCase)
import nla.Tri... |
aa84ed980c159e3b2ae3fcc11eefc0c452d9b894b370d3acf07501f5f5b9c878 | MATLAB | 6,158 | 165 | function [w, A, C, sbc, fpe, th]=arfit(v, pmin, pmax, selector, no_const)
%ARFIT Stepwise least squares estimation of multivariate AR model.
%
% [w,A,C,SBC,FPE,th]=ARFIT(v,pmin,pmax) produces estimates of the
% parameters of a multivariate AR model of order p,
%
% v(k,:)' = w' + A1*v(k-1,:)' +...+ Ap*v(k-p,:)' +... |
4c0f0e9523ba84af9cab70a1ac732d6683867fe100ef02763a98884a828a716f | MATLAB | 6,166 | 135 | function obj = prepareTensorWithVariableBin(obj, window, expectedBinWidth, neus2consider, conds2consider)
% PREPARETENSORWITHVARIABLEBIN - Prepare tensor with epoch-adaptive binning
%
% INPUTS:
% obj - RecordedData object
% window - [start_marker, end_marker]... |
ae44122a84673017e44eb4ec2e6f7e504cd4379deef042033c55cdbb036db6a1 | MATLAB | 6,168 | 136 | function E = efficiency_wei(W, local)
%EFFICIENCY_WEI Global efficiency, local efficiency.
%
% Eglob = efficiency_wei(W);
% Eloc = efficiency_wei(W,2);
%
% The global efficiency is the average of inverse shortest path length,
% and is inversely related to the characteristic path length.
%
% The l... |
3c82fd57177c0e4e09ebdaeaec3d055d415eb358206eb04062c3a0a87fdcfff8 | MATLAB | 6,219 | 118 | function idx = From3DNifti_OrMNICoords_2_CoordMatrix_8mm_LBPD_D( S )
% It translates the voxels of a 3D brain nifti image or sets of MNI coordinates
% (8mm) in LBPD coordinates (matrix with 3559 voxels).
% INPUT: -S.input: 1 = MNI coordinates, e.g. [-45 -32 6];
% 2 = AAL ROIs e.... |
e8d750fd9ba7c10a2e7ef0ebc3a8284dd15a94f61119965a8c692872a90c67e9 | MATLAB | 6,230 | 207 | function varargout=gifread(filepath,varargin)
% GIFREAD(FILEPATH, {KEYWORDS})
% reads all frames of an animated gif into a 4-D image array
%
% FILEPATH: full path and filename
% KEYWORDS are as follows
% 'native' or 'imagemagick' specify the file read method (default 'native')
% 'imag... |
0d375b5955be1c41bcb45cd65d1e4e03f09225f71d4381d6792661b835ccabd8 | MATLAB | 6,259 | 199 | function [X,ndx,dbg] = natsortfiles(X,rgx,varargin)
% Alphanumeric / Natural-Order sort a cell array of filenames/filepaths (1xN char).
%
% (c) 2014-2020 Stephen Cobeldick
%
% Alphanumeric sort of a cell array of filenames or foldernames, i.e. sort
% the names by character order and by the values of any numbers within ... |
bcd88b64ee47da59de532d34abf1b28860c743c80b760064df02587fce289b56 | MATLAB | 6,279 | 189 | function setpos(h,fmt,href)
% SETPOS Set graphics object position in a flexible way.
% SETPOS(H,FMT) sets the position property of graphics object
% with handle H, according to FMT that can be expressed using different
% units. H must have a "Position' property.
%
% FMT is a char array containing 4 strings sep... |
5c8f65224d00f2e94c8c4fa8a426f6b84ad4c97acf2f882c4b29c358925f14c7 | MATLAB | 6,295 | 150 | function M=link_communities(W,type_clustering)
%LINK_COMMUNITIES Optimal overlapping community structure
%
% M = link_communities(W)
% M = link_communities(W,'complete');
%
% The optimal community structure is a subdivision of the network into
% groups of nodes which have a high number of within-group conne... |
5128e7439fa39a139f174913192e24e5d8b856bb12152163d893b3ac367c5825 | MATLAB | 6,310 | 132 | function Final_Var=Ripple_Analysis_All(Input_WFM, Treatment_String_Lower_Case)
% The goal of this function is to compute firing activity in NREM sleep that occurred around the time of a SW ripple.
%
% It implicitly uses Milan Bogers' ripple-timestamps variable that has three columns: Start, End and Peak Ripple Times(... |
ec1d09026707666109d3a11541b066f1ab6437071662ba6bcfb8f496ddef976b | MATLAB | 6,311 | 168 | function varargout = pdftops(cmd)
%PDFTOPS Calls a local pdftops executable with the input command
%
% Example:
% [status result] = pdftops(cmd)
%
% Attempts to locate a pdftops executable, finally asking the user to
% specify the directory pdftops was installed into. The resulting path is
% stored for futur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.