sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d71fa1437281177cbc68ad2989622944dac2ad456380f58d7f38b2e162d25472 | MATLAB | 3,723 | 90 | % PLUGUIN_UIUPDATE - support function for plugin_menu
% Copyright (C) 2019 Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following cond... |
f37d2ea6eff012a8a36cd10ef465a12dbe5e24cb05ce69d682478e90bfc83585 | MATLAB | 3,724 | 136 | function coactPaper_tableS03()
close all
height=14.1;
fontsize=6;
fh=initFig('width',18.6,'height',height,'font','Arial','fontsize',fontsize);
panel_01(7)
drawnow()
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS03_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','-r300')
end
function panel_01(fs)
... |
e02964a9f75ea312a6b846bf8caa85306855fcbb81197265155379a6e402ac8a | MATLAB | 3,726 | 104 | function ARTwarp_Plot_Net
% TODO: Rename uimenu variable names to be more descriptive
global NET DATA
h0 = findobj('Tag','ARTwarp');
clf
h1 = uimenu('Parent',h0, ...
'Label','File', ...
'Tag','uimenu1');
h2 = uimenu('Parent',h1, ...
'Callback','ARTwarp_Load_Data(false, "")', ...
'Accelerator','o', ...... |
b237e2ff12723d501f2d76a3350c7c46b6c6f7e6648ebfdbbdc1ae28c8b8c1c2 | MATLAB | 3,730 | 120 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Reproduces Figure 2-figure supplement 2
%
% Visualises behavioural data for fMRI session split by partner identity
%
% Statistical tests can be reproduced by applying one-sample t-tests to
% regression betas: e.g. [H,P,CI,STATS]= ttest(beta.conf... |
c1b5e3cdcb1e29c49f859a50ddaa63e15670f641c621e4a74eac5e09c0fe8d8c | MATLAB | 3,730 | 89 | % [Generalized Eigenvalue De-Artifacting Intrument (GEDAI)]
% PolyForm Noncommercial License 1.0.0
% https://polyformproject.org/licenses/noncommercial/1.0.0
%
% Copyright (C) [2025] Tomas Ros & Abele Michela
% NeuroTuning Lab [ https://github.com/neurotuning ]
% Center for Biomedical Imaging
% ... |
4c5b3724e277c46d4b65c790a43a8d89289bcdcbfaa65fcfcaaa326f80089a94 | MATLAB | 3,732 | 117 | function events = GetEvents(selection,varargin)
%GetEvents - Get events.
%
% USAGE
%
% events = GetEvents(selection,<options>)
%
% selection optional list of event descriptions; see examples below
% <options> optional list of property-value pairs (see table below)
%
% ===========================... |
e39ff3b9b28d6d3e70d54c2e056bca979d5d3ed66d55515f4412ffddab6d6127 | MATLAB | 3,733 | 107 | function reslicedImage = reslice(this, targetGeometry, varargin)
% Reslices image to image geometry of other image using spm_reslice
% Y = MrImageSpm4D()
% resliceImage = Y.reslice(targetGeometry, ...
% 'spmParameterName1', spmParameterValue1, ...
% ...
% 'spmParameterNameN', spmParameterValueN)
%... |
54007a1abfeaf0cc2fcb73d8ec8b225dc55e2f21d643f1fc639491fb18652120 | MATLAB | 3,735 | 107 | function [mvar] = ft_datatype_mvar(mvar, varargin)
% FT_DATATYPE_MVAR describes the FieldTrip MATLAB structure for multi-variate
% autoregressive model data.
%
% The mvar datatype represents multivariate model estimates in the time- or
% in the frequency-domain. This is usually obtained from FT_MVARANALYSIS,
% optiona... |
9de1c76527aa094dda6a7c1c82881c96331fbcc2cd1fda9986038591e1f08f6b | MATLAB | 3,735 | 85 | % STD_CHANGROUP - Create channel groups for plotting.
%
% Usage:
% >> STUDY = std_changroup(STUDY, ALLEEG);
% >> STUDY = std_changroup(STUDY, ALLEEG, chanlocs, 'interp');
% Inputs:
% ALLEEG - Top-level EEGLAB vector of loaded EEG structures for the dataset(s)
% ... |
dd0afdccc5acf4ce8f485ab12bb0e58ffce54c9e6098fd1f7fdef582c133dd75 | MATLAB | 3,737 | 118 | function [results] = raster2ens_by_density(raster,pars)
% raster = N x T binary matrix
% pars is a structure with the following parameters
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method
% for neuronal ensemble detection in spiking neural networks"
% https://www.biorxiv.org/content/10.1... |
44b6e159b6aabaa3b0d7c90ca2738e7fe3c05edeb8e94f5e2c12b3fed698576e | MATLAB | 3,738 | 128 | function [PCuse] = CellsortChoosePCs(fn, mixedfilters)
% [PCuse] = CellsortChoosePCs(fn, mixedfilters)
%
% Allows the user to select which principal components will be kept
% following dimensional reduction.
%
% Inputs:
% fn - movie file name. Must be in TIFF format.
% mixedfilters - N x X matrix of N spatial signa... |
5d91a5a4076b750fc3368e4cacf7b2bac8fd912b1725515b397ae3063a8a1ec8 | MATLAB | 3,738 | 110 | function BF_PlotCorrMat(D_corr,rangeHow,makeFigure)
% BF_PlotCorrMat Visualization of a pairwise similarity matrix
%
% Attempts to determine a set of smaller clusters of objects showing similar
% behavior.
%
%---INPUTS:
% D_corr, a pairwise distance matrix
% rangeHow, the colorbar extent: (i) 'auto' (automatic)
% ... |
5a3d2ddd815bc2d6558af4a8494d49eddb8a43dca0616712fb2d68084cf67221 | MATLAB | 3,739 | 94 | %function [xml, rxml] = LoadXml(FileBase)
%loads the xml file using xmltools (have to have it in the path)
% rxml returns it's original layout - very messy structure but contains all
% the xml file contents.
% xml - is the ouput structure which is backwards compatible to LoadPar
% output, so you can use it instead ..al... |
cc45f1393a38259432dcbd2dfcb0735fd2d0a159c6ffddc877fd29c202967526 | MATLAB | 3,739 | 116 | function [df, err] = tapas_riddersdiff(f, x, varargin)
% Differentiates the function f at point x according to Ridders' method:
%
% Ridders, CJF. (1982). Accurate computation of F'(x) and F'(x) F''(x). Advances in Engineering
% Software, 4(2), 75-6.
%
% INPUT:
% f Function handle of a scalar real fun... |
22fa884e3a05c10e706f8c346862ab4f0ae25653aef5bc9d4790f0e6ab5925b2 | MATLAB | 3,740 | 101 | function LDAresults = doLDA(recordingLevelData, Params, subset_lag)
% Performs linear discriminant analysis (LDA) on network or neuronal
% activity features at a recording level (one row per recording)
% Parameters
% ----------
% recordingLevelData : table
% Params : struct
%
%
% Returns
% -------
% LDAresults : str... |
74962cf4f5ae84dbcdb920ea5253e26c12789cc39022b37e9c73f90fdd2b96c2 | MATLAB | 3,742 | 99 | function this = load(this, inputDataOrFile, varargin)
% Loads Geometry info from affine image header (.nii/.hdr/.img) or Philips
% (par/rec) or a struct of the object save as a .mat file
%
% NOTE: .mat-header files (for 4D niftis) are ignored, since the same voxel
% position is assumed in each volume for MrImage
... |
ecf0c1ad281281a7e51fed4808bd030416891c5538a8b3b356c569e10a27b09b | MATLAB | 3,742 | 102 | % QUESTDLG2 - questdlg function clone with coloring and help for
% EEGLAB.
%
% Usage: same as QUESTDLG
%
% Warning:
% Case of button text and result might be changed by the function
%
% Author: Arnaud Delorme, CNL / Salk Institute, La Jolla, 11 August 2002
%
% See also: INPUTDLG2, ERRORDLG2, SUPERGUI, I... |
7293fb5b8fb265594f1e5c5a175266a27dee8ea903e35bfabf4eba519dd862a4 | MATLAB | 3,743 | 137 | % compute
a1 = load('/Users/kendrick/Dropbox/nsddata/experiments/nsd/nsd_expdesign.mat');
wh = [40 40 32 30 40 32 40 30];
unum = [];
hnum = [];
rec = []; % 8 subjects x 10000 with number of trials for that image
commonset = [];
totaln = 0;
totaltrials = 0;
allshownims = [];
for p=1:8 % loop over subject
temp = a1.... |
74586efdf56facac8f4455787442d060b346a9c1c90e825aa75af7eaf4d8b77d | MATLAB | 3,743 | 170 | function Depth(subjID, task, run)
Screen('Preference', 'SkipSyncTests', 1);
judge = 5;
%Initialization script for TMS expt DEPTH or GLASS PATTERN
%INPUTS
%subjID %e.g., zk___
%run %which run?
%% set up task order
%1 = Coarse
%2 = Coarse Control
%3 = Fine
%4 = Fine Con... |
28b10026b4b9f6ce82468daa7d5161366655ce572f5ef358ac780ac144fe3222 | MATLAB | 3,744 | 98 | % ERPREGOUT - regress out the ERP from the data
%
% Usage:
% newdata = erpregout(data);
% [newdata erp factors] = erpregout(data, tlim, reglim);
%
% Inputs:
% data - [float] 2-D data (times x trials) or 3-D data
% (channels x times x trials).
%
% Optional inputs:
% tlim - [min max] time limits... |
4f8c9a593ecfec10b49ec3f75b4a3ba383cd0fe8922695c1e6c0d116d28007f2 | MATLAB | 3,746 | 101 | %%% 提取指定路径下VOTC ROI分析结果,当前为提取Concept层的结果,计算了是否控制featureRDM的两部分结果,结果已经过**FisherZ**转换
clear;clc;
addpath(genpath('/data0/user/lxguo/Downloads/DPABI_V8.1_240101'));
addpath(genpath('/data0/user/lxguo/Downloads/REST_V1.8_130615'));
addpath('/data0/user/lxguo/Downloads/spm');
load("./featureRDM.mat");
addpath('.... |
3b7805781fc8d9349f64686b7cb7ee7d39b5e551af75bc52a20f556e57436b2f | MATLAB | 3,747 | 158 | function M = spherecomplexfactory(n, m)
% Returns a manifold struct to optimize over unit-norm complex matrices.
%
% function M = spherecomplexfactory(n)
% function M = spherecomplexfactory(n, m)
%
% Manifold of n-by-m complex matrices of unit Frobenius norm.
% By default, m = 1, which corresponds to the unit sphere in... |
5b3b0d11cf7a3bef3145949709189ea30d2376c5a08985721eeaadbcdba94ea9 | MATLAB | 3,747 | 142 | % Batch script for sparse prediction
clear all
% --- training method ID
method_id = 8;
% 1: linear_sparse_space
% 2: linear_sparse_space_vec
% 3: linear_sparse_stepwise
% 4: linear_sparse_stepwise_vec
% 5: linear_sparse_stepwise_aa
% 6: linear_sparse_seq
% 7: linear_stepwise_reg_bayes
% --- Basic Learni... |
5297e581f94c9594f0e72f612578a9fd0f1718772d26738eb971e76325288b9b | MATLAB | 3,748 | 63 | % Start File for LFP_Analysis
% set which analyses to perform
% then set the corresponding start parameters
% before calling LFP_Analysis
%% Which Analysis to Perform (1=yes 0=no)
PhaseLocking = 1;
SpikeFieldCoherence = 1;
OffsetPhaseLocking = 0;
AmplitudeXCorr = 0;
%% Sp... |
b204cb630fc31060011a48b44ec10523293dc82e05a66435cb9167f3c48fc588 | MATLAB | 3,748 | 82 | function out = MD_RawHRVMeas(x)
% MD_RawHRVMeas Poincare plot measures used in HRV analysis.
% HRV: heart rate variability.
%
% Computes the triangular histogram index and Poincare plot measures to a time
% series assumed to measure sequences of consecutive RR intervals measured in
% milliseconds.... |
15abc43bd54537e663715b92de49372e7a49ddadf9a96466e9c20d00614292a9 | MATLAB | 3,749 | 135 | function tapas_uniqc_new_function(varargin)
% tapas_uniqc_new_function creates a new function including header using a template.
% tapas_uniqc_new_function(funname) opens the editor and pastes the content
% of a user-defined template into the file funname.m.
%
% Example
% tapas_uniqc_new_function myfunfun
% ... |
3f2bc887189c3aa02dd98e836105de9cd2f4aaf4543fc36efe616b3f9bafbf09 | MATLAB | 3,749 | 92 | function [cardiac_phase, verbose] = tapas_physio_get_cardiac_phase(...
pulset,scannert, verbose, svolpulse)
% estimates cardiac phases from cardiac pulse data
%
% USAGE
% cardiac_phase = tapas_physio_get_cardiac_phase(pulset,scannert, verbose, svolpulse)
%
% INPUT
% pulset - heart-beat/pulseoxymeter da... |
9feba102c4452436035e9b97e61c71873ad0e5b60715fe58319114cb59ada00a | MATLAB | 3,750 | 118 | % op_creChoFit.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% parsFit=op_creChoFit(in, suppressPlot);
%
% DESCRIPTION:
% Perform a Lorentzian lineshape fit to the creatine resonance in a brain
% proton MRS dataset.
%
% INPUTS:
% in = input data in matlab stucture format.
% suppressPlo... |
167ed5ab7059f0c2d047febe2ae490eb5f6039392b692d7e96a7b5410f2077ec | MATLAB | 3,754 | 99 | function outputImage = tapas_uniqc_recon2image(recon, imageType, varargin)
% Converts ReconstructionData-fields into MrImages, respecting GeometryData
% information (FOV, offcenter, slice thickness)
%
% outputImage = tapas_uniqc_recon2image(recon, imageType, varargin)
%
% NOTE: geometry conversion works only for sing... |
1ef8d5cdd6f3c63abb27f2bc40976ebb610e72088e9e9379cc87490f7252fb77 | MATLAB | 3,754 | 132 | function tapas_uniqc_new_enum(varargin)
% tapas_uniqc_new_enum creates a new enumeration file including header using a template.
% tapas_uniqc_new_enum(funname) opens the editor and pastes the content
% of a user-defined template into the file @funname/funname.m.
%
% Example
% tapas_uniqc_new_enum myfunfun
... |
f7af93531ac8aec4a635ce60c8b79a90e06abc5173ca3e45c29672f6bf20cd85 | MATLAB | 3,755 | 118 | function [filepathVout,filepathRout,summary]=applyChunking(filepathV,filepathR,functionHandle,varargin)
%
% HELP
% Universal operation of chunking on two movies, given the 'functionHandle' that accepts two inputs plus options.
% SYNTAX
%[filepathVoutfilepathRout,summary]= applyChunking(filepathV,filepathR,functionHandl... |
ee236efbb41c38cec9b159919b2181dfd480510daad1b38840eac39afc0f410c | MATLAB | 3,758 | 99 | % BIDS_WRITETIEEGINFOFILE - write tinfo file for iEEG data
%
% Usage:
% bids_writetinfofile(EEG, tinfo, fileOut)
%
% Inputs:
% EEG - [struct] EEGLAB dataset information
% tinfo - [struct] structure containing task information
% notes - [string] notes to store along with the data info
% fileOut - ... |
39ffa3fe98c4e5249df1b3681e30358d7aafa89f7640221b4518a61532c4c2d2 | MATLAB | 3,760 | 102 | function ac = eeg_autocorr_welch(EEG, pct_data)
% clean input cutoff freq
if ~exist('pct_data', 'var') || isempty(pct_data)
pct_data = 100;
end
% setup constants
ncomp = size(EEG.icaweights, 1);
n_points = min(EEG.pnts, EEG.srate * 3);
nfft = 2^nextpow2(n_points * 2 - 1);
cutoff = floor(EEG.pnts / n_points) * n_p... |
7ad80f5b3a59954ca35339ca4447e926765121cc9548aa031b376efbdc4fe098 | MATLAB | 3,760 | 104 | function tapas_hgf_ar1_plotTraj(r)
% Plots the estimated or generated trajectories for the HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_ar1_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2... |
c3c7160441e4b7b49fcd08040cf993737ac3f37dc682cc64d127af1f2ce13812 | MATLAB | 3,760 | 128 | classdef subspace < brca.dot.base
% dot_subspace = brca.dot.subspace()
% Inner product based on a known covariance of the form U*U' + inv(lam*L).
% Such a covariance may have been learned beforehand by BRCA.
properties
Subspace % Principal subspace
Precision = 1 ... |
914a9c745ce154207f629e7baf9c6bfd1db24a1c439ceaf9d5e218cd7f30e45c | MATLAB | 3,761 | 133 | function varargout=getAcceleration(lfpFile,nCh,accCh,saveFile,varargin)
% [spec,t,f]=getAcceleration(lfpFile,nCh,accCh,saveFile,...)
%
% options and defaults
% samplingRate=1250; %1/s
% stopBand=0.1; %Hz
% passBand=1; %Hz
% passRipple=1;
% stopAtten=60; %dB
% detectionInterval=[0,inf]; %in sec
% accPerBit=0.001... |
7623db4d80fd48546a20c17e5ecebdf2e91d48bf8fbfe1429d1048d6ae197e3e | MATLAB | 3,762 | 91 | function [delta_good, E2_good, stages] =...
SerumEstradiol_vs_DARPE(SerumTable, PstructSerum, BstructSerum)
% correlate estradiol expression to DA AUC at largest reward offer cue per session (putative largest RPE)
%set variables for for loop
ratlist = fields(BstructSerum);
deltaAUC_sess_overrats = [];
E2_sess_over... |
df2cf856bf630102424a4b852103e308121557df7a8ea75abdc07899e0ac1ce2 | MATLAB | 3,763 | 106 | function net = fast_rcnn_init(varargin)
%FAST_RCNN_INIT Initialize a Fast-RCNN
% Copyright (C) 2016 Hakan Bilen.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
opts.piecewise = 1;
opts.modelPath = fullfile('data', ... |
336c9b9aabfaff591d9553bc5ab8f07c01fb4d671a2bb8de43ec179cec1a1627 | MATLAB | 3,764 | 71 | %% load libraries
run('set_library_paths.m');
addpath(SPM_PATH); % per spm docs, do not genpath it
addpath(genpath(CANLABTOOLS_PATH));
addpath(genpath(CANLABMASKS_PATH));
%% VARIABLES THAT MUST BE DEFINED BEFORE THE SCRIPT IS SOURCED
% each of these should come in from targets calling script
% path_fmri_data: path to... |
542eda5191b5b892e5e256b4094f07cccb656da285b328783049d4f1ed16efae | MATLAB | 3,764 | 95 | classdef histogramNormalizationTest < matlab.unittest.TestCase
%HISTOGRAMNORMALIZATIONTEST Unit tests for petraToCT.histogramNormalization.
%
% DESCRIPTION:
% Verifies that the image is scaled by the highest-intensity peak
% found among the top-N tallest histogram peaks. This "max(locs)"
... |
ac603565491cd382b56d1e6616e82d41c643873d1f3abe581d0bbcd6ff58f0c0 | MATLAB | 3,764 | 110 | % compute empirical p-vals under the null hypothesis that observed samples
% come from a given surrogate distribution. P-values for Type I error in
% rejecting the null hypothesis are obtained by finding the proportion of
% samples in the distribution that
% (a) are larger than the observed sample (one-sided test)
% (b... |
3ac836a88256aabde11592de2f012dcfc7672b6e31efe8e3863ac743f077b243 | MATLAB | 3,765 | 102 | % EEG_POINT2LAT - convert latency in data points to latency in ms relative
% to the time locking. Used in EEGLAB.
% Usage:
% >> [newlat ] = eeg_point2lat( lat_array, [], srate);
% >> [newlat ] = eeg_point2lat( lat_array, epoch_array,...
% srate, timelimits, ... |
2e32ec3dbb9dd63fe20adb3d55a641e6d50b1c97f3e181858b20c01450738c4f | MATLAB | 3,767 | 95 | % pop_writeeeg - write EEGLAB dataset to disk in EDF/GDF or BDF format
%
% pop_writeeeg( EEG ) % pops up a window
% pop_writeeeg( EEG, filename, 'key', 'val' )
%
% Inputs:
% EEG - EEGLAB dataset
% filename - [string] filename
%
% Optional keys (same as writeeeg):
% 'TYPE' - ['GDF'|'EDF'|'BDF'|'CFWB'... |
b18ff2e2f817b4a46131fc833f926da7cefdc32fa2ba6288ee8e9ea5ec645a68 | MATLAB | 3,767 | 182 | function [] = plotNetworkWideMetrics(NetMet, meanSTTC, maxSTTC, lagval, FN, Params, figFolder)
%{
Parameters
----------
NetMet : struct
meanSTTC :
maxSTTC :
lagval
FN :
Params : struct
Returns
-------
%}
%% figure
p = [50 50 1400 700];
set(0, 'DefaultFigurePosition', p)
if ~isfield(Param... |
2420b1d557a00c96d957c142d6cc0a9c21a54b862e8f2d92c0f1903c15e34305 | MATLAB | 3,769 | 108 | function this = update_geometry_dim_info(this, varargin)
% Updates Image geometry and keeps corresponding dimInfo in sync
%
% Y = MrImage()
% Y.update_geometry_dim_info(varargin)
%
% This is a method of class MrImage.
%
% IN
% dependent 'geometry' or 'dimInfo';
% specifies which of the two image p... |
f01b9765845c675edd2e35bad5a60c034d8349b33a7bc17dfcd18159e0bda0d2 | MATLAB | 3,769 | 116 | function [d2f, err] = tapas_riddersdiff2(f, x, varargin)
% Differentiates the function f *twice* at point x according to Ridders' method:
%
% Ridders, CJF. (1982). Accurate computation of F'(x) and F'(x) F''(x). Advances in Engineering
% Software, 4(2), 75-6.
%
% INPUT:
% f Function handle of a scala... |
f64325642c6031b8fc25523921eaa22a5ae125a6beaad923875a70a5d23997bb | MATLAB | 3,769 | 115 | function varargout = qualisys_tsv(filename, hdr, begsample, endsample, chanindx)
% QUALISYS_TSV reads motion tracking data from a Qualisys tsv file.
%
% Use as
% hdr = qualysis_tsv(filename);
% dat = qualysis_tsv(filename, hdr, begsample, endsample, chanindx);
% evt = qualysis_tsv(filename, hdr);
%
% See also FT... |
4f71e6e8761bc5e27abb78351b82f9f562b1a358fe31cfa4c539377b51d9786d | MATLAB | 3,771 | 108 | % TTEST_CELL - compute paired t-test. Allow fast computation of
% multiple t-test using matrix manipulation.
%
% Usage:
% >> [F df] = ttest_cell( { a b } );
% >> [F df] = ttest_cell(a, b);
%
% Inputs:
% a,b = data consisting of PAIRED arrays to be compared. The last
% dimens... |
5c7f40fb91f557452e94ea8a6bac6cd4f95bb9f59516f742f9f2033a5198d355 | MATLAB | 3,771 | 100 | function tapas_hgf_plotTraj(r)
% Plots the estimated or generated trajectories for the HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013... |
5cd107eb2b6c64f06c63647caf2d3760da41e43f24cb9e52652d3fb8e9cb409b | MATLAB | 3,772 | 128 | function tapas_uniqc_new_class(varargin)
% tapas_uniqc_new_class creates a new class file including header using a template.
% tapas_uniqc_new_class(funname) opens the editor and pastes the content
% of a user-defined template into the file @funname/funname.m.
%
% Example
% tapas_uniqc_new_class myfunfun
% ... |
90b24771bb3def7ed512a796deff3092c30502dcaf7e465d9e8445cbfdc386be | MATLAB | 3,772 | 100 | function tapas_ehgf_plotTraj(r)
% Plots the estimated or generated trajectories for the HGF perceptual model
% Usage example: est = tapas_fitModel(responses, inputs); tapas_hgf_plotTraj(est);
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-202... |
018826796a2076129d3ee8831720677b82c25351cbd0f62e5792d5d2bce4a250 | MATLAB | 3,775 | 110 | function [FIT3D,Residuals,b] = Shim2ndOrder(img,Mask,order)
% dim=Volumenii.hdr.dime.dim(2:4);
dim = size(img);
%% for volume fitting
Indices=find(Mask(:,:,:));
[x1,y1,z1]=ind2sub(size(img(:,:,:)),Indices);
R=img(Indices);
% keyboard
if length(Indices)>(3*order)^2
model=Create_model(x1,y1,z1,dim,order);
% ... |
6b11ea527a787cd0835247a305550b753af78a360cc7030474d32a303ca6d8ae | MATLAB | 3,775 | 89 | % Updates folders and config file
function update_folders(hObject, eventdata, handles)
% Reads current config file
handles.data.loadSettings();
% Backwards compatibility from when there were fewer label shortcuts
if length(handles.data.settings.labels) < length(handles.data.labelShortcuts)
handles.data.settings.l... |
7f7671f44c4aa40605e9a14e3c06ab36e3418de233f16ab18b429b349da59eae | MATLAB | 3,775 | 95 | function TMSsphereROI (MNICenter,ROIRadius,OutDir,SampleImage)
if nargin<2,
error(' Error using ==> at least 2 arguments wanted.');
elseif nargin==2
OutDir=pwd;
elseif nargin==3
[Samplepath, Samplefname, Sampleextension] = fileparts(which('TMStarget')) ;
Samp... |
097e664bb4f0713d9fcfb4673262ae607ccb9fc0493e0b54588786856e739f91 | MATLAB | 3,777 | 122 | function [surfB_values, surfB_dist, nn_vertices, nn_weights ]=nmri_suma_surf2surf_transform(surfA, surfB, surfA_values, nn_vertices, nn_weights )
%nmri_suma_surf2surf_transform(surfA, surfB, surfA_values, nn_vertices, nn_weights )
%
% Transforms a vertex-based parameter/value to a new surface based in the
% shortest di... |
3c0d07b426b8ac0acada4586094384640349e62aedc905e76c673d0a93a7b663 | MATLAB | 3,778 | 117 | % define
sessix = 20;
runix = 1;
sliceix = 42;
epislice = [1 14 27 12 25 10 23 8 21 6 19 4 17 2 15 28 13 26 11 24 9 22 7 20 5 18 3 16 1 14 27 12 25 10 23 8 21 6 19 4 17 2 15 28 13 26 11 24 9 22 7 20 5 18 3 16 1 14 27 12 25 10 23 8 21 6 19 4 17 2 15 28 13 26 11 24 9 22 7 20 5 18 3 16];
offsets = -10:10:0;
% load data
d... |
64a4ea529ec33a99056ef662d77fe9fe64c742229adbe2db6b66404c369329df | MATLAB | 3,778 | 106 | % STD_UNIFORMFILES - Check uniform channel distribution across data files
%
% Usage:
% >> boolval = std_uniformfiles(STUDY, ALLEEG);
%
% Inputs:
% STUDY - EEGLAB STUDY
%
% Outputs:
% boolval - [-1|0|1] 0 if non uniform, 1 if uniform, -1 if error
%
% Authors: Arnaud Delorme, SCCN/UCSD, CERCO/CNRS,... |
160207cdc43a77e234479128a601083db62e4e029b72bd1c90c928b486b148c2 | MATLAB | 3,779 | 115 | % permutations = exhaustivePermutations(n[, cap])
%
% n number of items to be permuted
% cap (optional) stop after finding this many
% permutations each row is a permutation; they'll be in lexicographic order
%
% Cai Wingfield 3-2010
function permutations = exhaustivePermutations(varargin)
% The following algor... |
1bc07034a52822f9d470355ed3aa9efa841d2d1c9ba248ffd75d4365ea9a7462 | MATLAB | 3,782 | 193 |
% Panel can build complex layouts rapidly (reprise of demo 1).
%
% (a) Build the layout from demopanel1, with annotation
% (b) Add the content, so we can see what we're aiming for
% (c) Show labelling of axis groups
% (d) Add appropriate margins for this layout
%% (a)
% create panel
%
% we're going to build a big ... |
466ac9c0ae2cd914f1a3cbe3072c4f7f6c124564c0aa2b39fe7f0a9e43931897 | MATLAB | 3,782 | 83 | function [tapers,pad,Fs,fpass,err,trialave,params]=getparams(params)
% Helper function to convert structure params to variables used by the
% various routines - also performs checks to ensure that parameters are
% defined; returns default values if they are not defined.
%
% Usage: [tapers,pad,Fs,fpass,err,trialave,para... |
7f69b5fc3de88ca21a06b3bc492c80619533e9e90dbec69ff88c3ce17a5087c7 | MATLAB | 3,783 | 97 | function TS_ReIndex(whatData,tsOrOps,overRide)
% TS_ReIndex Reindexes time series or operations in a data file (new unique indices)
%
%---INPUTS:
% whatData, the hctsa dataset to work with (default: 'norm', cf. TS_LoadData)
% tsOrOps, whether to re-index TimeSeries IDs (specify 'ts') or
% Operation IDs (spe... |
bbfdde419de69fca1116fe11e9be695685e0a81d1823ef3482defa592bd35573 | MATLAB | 3,783 | 95 | function checkgradient(problem, x, d)
% Checks the consistency of the cost function and the gradient.
%
% function checkgradient(problem)
% function checkgradient(problem, x)
% function checkgradient(problem, x, d)
%
% checkgradient performs a numerical test to check that the gradient
% defined in the problem structure... |
144f0f6044c2bd2013f6d4fffca5ab28c92558c40df66498c7c86dee2678dda4 | MATLAB | 3,784 | 106 | function res = permutation_expression_null_spin(geneset, expressions, gene_symbols)
% PERMUTATION_EXPRESSION_NULL_BRAIN(GENESET, EXPRESSIONS, GENE_SYMBOLS)
% performs permutation testing to examine in which regions the input gene
% set is overexpressed.
%
% INPUT
% geneset -- a cell array of gene symbols of the gen... |
2d8ffe2c35647e81b357460d06d667da5246c802dae7b73ace7c3e2aded5052d | MATLAB | 3,784 | 104 | function [C,Cproj] = iemcovFunc(dat,theta,thetabasis,foldvar,covtime)
% [C,Cproj] = iemcovFunc(dat,theta,thetabasis,foldvar,covtime)
% dat is channelXtrialXtime, theta is angles (from -pi to pi)
thetabasis = thetabasis(:); %make sure the basis set locations are in a column vector
nChan = length(thetabasis); %nu... |
76260c516f826e8351484096981e2ae723c98a8a2651e23d265c59023b87e2c2 | MATLAB | 3,784 | 83 | function checkboxHandler(src, evt)
% function mouseHandlerHeatMap(src, evt)
%
% Is triggered when the mouse is clicked in the HeatMap figure. Reads
% the current mouse position, translates it to a sensor ID and visualizes
% (if matches unit in sta data) its neighborhood and its activity
%% FETCH PARAMETER
... |
e24e4fd5123f037805a3ccf0525485cbc2ba64b9b31e644d11bb7a0823b308e6 | MATLAB | 3,784 | 102 | function M = euclideansparsefactory(A)
% Returns a manifold struct to optimize over real matrices with given sparsity pattern.
%
% function M = euclideansparsefactory(A)
%
% Returns M, a structure describing the Euclidean space of real matrices
% with a fixed sparsity pattern. This linear manifold is equipped with
% th... |
c5ace6261f1db0ac91f3ff764389a2322a0acf79a028a1ce094175fef319274e | MATLAB | 3,785 | 150 | clear
templength = 0.015; %s
binlength = 0.005; %s
ename{1} = 'ECR';
ename{2} = 'ECU';
figure
load(['unit.mat']);
unitSR = SampleRate;
unit = Data;
load(['Movement onset-E.mat'])
MO = Data;
stampSR = SampleRate;
[hdat,p] = psth_ST(unit,unitSR, MO,stampSR,binlength,-1,3);
subplot(3,4,1),bar(hdat,'k')
anum = [0 1 ... |
3ed0999e9c3b772f7f935055c4f8edd8b5efac65583411bb6593a16cfb7523b9 | MATLAB | 3,791 | 91 |
function [intervals,indices] = SubtractIntervals(intervals1,intervals2,varargin)
%SubtractIntervals - Subtract intervals.
%
% Given two lists of intervals, subtract from each interval in the first
% list its intersection with each of the intervals in the second list.
%
% USAGE
%
% [intervals,indices] = SubtractIn... |
4cfa0e6a6f43b527cac2e53431a19a9783e1b96d3c227d28405c8831735f7c03 | MATLAB | 3,791 | 116 | function [umxSource,umxCoeff,options]=unmixing1D(source,reference,varargin)
% GOAL: Unmix the two signal using various method.
%
% INPUT:
% - source: source trace 'sce' to be unmixed from the reference trace 'ref'.
% - reference:
% - options (as input struct or variable arguments):
% * FrameRate: sa... |
a3cc0f09b76c15a1f4974a8144315bc08c76a3d7bb85baadcdc8b77a77f8d813 | MATLAB | 3,792 | 116 | function output = GetCustomDefaults(current,property,value)
%GetCustomDefaults - Get custom default value for a given function property.
%
% This is an 'internal' function used by FMAToolbox. You should not need
% to use it, unless you are developping new functions for this toolbox.
%
% See Example below.
%
% WARN... |
26c43e0eeba0648e20cf7183ba8272417fee648846e3d3afe51c6b4b9973e762 | MATLAB | 3,793 | 112 | function [ARF,RCF,PE] = mvar_simplified(Y, Pmax)
% MVAR estimates Multi-Variate AutoRegressive model parameters
% Several estimation algorithms are implemented, all estimators
% can handle data with missing values encoded as NaNs.
%
% [AR,RC,PE] = mvar(Y, p);
%
% INPUT:
% Y Multivariate data series
% p Mode... |
c4ea62ef884cf9a2229d6daf6f5bb3b02aa7fb68e8c8717d998cbff1f9658f3d | MATLAB | 3,793 | 119 | function fear_icaReacExcitatory(basename,varargin)
% method used in
% Lopes-dos-Santos et al., 2013 J Neurosci Methods
% Trouche et al., 2016 Nat Neurosci
% Giri et al., 2019 J Neurosci
% basename='~/data/Fear/triple/karmeliet190901/karmeliet190901';
load([basename '.basicMetadata.mat'])
fprintf('%s start %s wit... |
1e4c63a0d4c3e93e1873bf7adca59316acbedfec6b46f6b8ea95dac9dbce4c68 | MATLAB | 3,794 | 133 | %demo for running the clustering pipeline and the gap statistic
%% paths to stuff on local machine
datadir = '~/projects/ofc/data/published/'; %where raw data is stored
%where will feature space data be stored. and where glm fit file is stored
%can change them to be separate directories if you would like
savedir = '/... |
a898c1fe8a35c319e426265ac7ebe6f60b0c20afcb24299d7e55d3465c98cd56 | MATLAB | 3,794 | 92 | % PLUGIN_STATUS- Given the name of a plugin(or part of it), returns
% the status (e.g. [0]not installed, [1]installed)
% Inputs:
% pluginname - {string} Name (or part of it) of plugin of interest
%
% Optional inputs:
% ex... |
9bd9ad9fffc56c9760872202ed813c0bdea49e438ed12d95c0ee058edd090c40 | MATLAB | 3,796 | 123 | function write(hdr,data,filename);
fid=fopen(filename,'w','native');
precision=get_precision(hdr);
hdr.dim.vox_offset=352;
hdr.hist.magic='n+1';
write_hdr(fid,hdr);
fwrite(fid,ones(1,hdr.dim.vox_offset-ftell(fid)),'uint8');
data=data(:);
fwrite(fid,data(:),precision);
fclose(fid);
%%%%
function wr... |
c082f21b22b7cc2c2a88a3bd4173439c1d114053fdda03a0b69b4a615ffb1a54 | MATLAB | 3,796 | 125 | function varargout = split(this, varargin)
% Splits MrDataNd (or MrImage) along splitDims, sets filenames of created splitDataNd
% and optionally saves split images to file.
%
% Y = MrDataNd()
% [splitDataNd, selectionArray] = Y.split('splitDims', {'dimLabelSplit1, ..., dimLabelSplitN}, ...
% ... |
700dc98dbb58325a81f6181901b7e2bc4446ed857135c1d24129f7cb9e3fbce3 | MATLAB | 3,797 | 135 | function BpRF_run_pRF_demo(subj_id, session, mod_name, voxels)
% _
% Estimate Voxel-Wise Population Receptive Field Model
% FORMAT BpRF_run_pRF_demo(subj_id, session, mod_name, voxels)
%
% subj_id - a string, subject ID (e.g. "EDY7")
% session - a string, session name (e.g. "visual")
% mod_name - a strin... |
ee4456df2c9996ad041d8a8781c4b7740cec899da3b6237a312f38ee759460d2 | MATLAB | 3,798 | 114 | function [rphase, pulset, rsampint, rout, resp_max, cumsumh, sumh, h, ...
npulse, dpulse, fh] = tapas_physio_get_respiratory_phase(pulset, rsampint,...
verbose, thresh)
% get_respiratory_phase is a function for creating respiratory phase regressor.
% from physiological monitoring files acquired using spike... |
42014a9771a1891abde52d3dc0f7c133e30522d9c312893aeb0c354fcf1f483c | MATLAB | 3,801 | 159 | function plot_fig4g(datadir)
% Plot time to opt-out regressed against reward delay and reward volume in
% the past 15 trials during mixed blocks, averaged acros rats. Ten trials
% are shown for visualization purposes. N = 16 rats.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be... |
72affa72a92e27ffef00dedee6ad44fef744478733710f0f2f4fd5067eda3590 | MATLAB | 3,801 | 103 | % STD_LIMOERASE - erase LIMO files.
%
% Usage:
% >> std_limoerase(filepath, filename, subjects, designname)
%
% Inputs:
% filepath - [string] STUDY file path
% filename - [string] STUDY file name
% subjects - [cell] list of subject name
% designname - [string] name or number of the design
%
% Au... |
2f9707158a2f63de584347a907725ee0b485f08b7c7f1a0b92c0a5142599755a | MATLAB | 3,802 | 94 | function c = tapas_condhalluc_obs_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the response model used to analyze data from conditioned
% hallucination paradigm by Powers & Corlett
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
30a0660b1f75afc91d46bd1b579e8790499b4fe66ed46dfc6599b64b1e675cba | MATLAB | 3,802 | 136 | % This new example (as of Nov 2012) illustrates using a low resolution
% surface to define the searchlight centers combined with and a high
% resolution surface that delineate the grey matter.
% The advantage is that the script runs a lot faster
% The disadantage is a loss in spatial resolution.
% Unlike the original... |
5741703572b69dda3dbd0f572d9c2104e539b8a4e7551c1a9a6ea97f2dfcb2b4 | MATLAB | 3,809 | 125 | function [R,eff,met]=randmio_und_v2(R, ITERATIONS, metric, plotIterations)
%RANDMIO_UND_V2 Random graph with preserved degree distribution
%
% R = randmio_und_v2(W,ITERATIONS,metric);
% [R eff met]=randmio_und_v2(W, ITERATIONS, metric);
%
% This function randomizes an undirected network, while preservin... |
d082f9b5ca4daa32fc11e5ea2e416a3e50ffbb6ecd5190f9dbdaca75fb31f7c3 | MATLAB | 3,809 | 94 | function [] = plotLines(refdata, reftp, stimdata, stimtp, respdata, resptp, fbdata, fbtp)
% This code reproduces the analyses in the paper
% Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven
% by decision uncertainty and alters serial choice bias.
%
% Permission is hereby granted, free of charge, to an... |
5ac8ed001328b717b616296ee45fe1d4a3215bb431a176bda7f1f925f06fd05d | MATLAB | 3,811 | 81 | % STD_READERP - load ERP measures for data channels or
% for all components of a specified cluster.
% Called by plotting functions
% STD_ENVTOPO, STD_ERPPLOT, STD_ERSPPLOT, ...
% Usage:
% >> [STUDY, datavals, times, setinds, cinds] = ...
% st... |
3386a03a3d07096c07bb2fac888425cc9f919c3ebb1055614dcb38f77d10cf87 | MATLAB | 3,812 | 82 | %% coregist T1Img to mean*.nii
DataDir='/mnt/NCPL09/ReseachPlan/DTIanaly_PD';
[ProgramPath, fileN, extn] = fileparts(which('TMStarget.m'));
sublist = dir([DataDir,filesep,'FunImgAR'])
for sub =4 : length(sublist)
TempImg3 = dir([DataDir,filesep,'FunImgAR',filesep,sublist(sub).name,filesep,'ra*.nii']) ;
[datab headb... |
76161021184a6895231a87568d92efc42cdf063a570577e43e8d2bbc5a1d5601 | MATLAB | 3,812 | 129 | function [X,Pxy,Cxy,F,TFxy]=coherence_v2(x,winsize,noverlap,nfft,fs)
% The function estimates two side Cross Power Spectral Density (CPSD) and Magnitude
% Squared Coherence (MSCOHERE) of multi-channel signal x each with each
% other. Estimation is performed using averaging of segments. The algorithm
% is optimized by m... |
07ea432b8dafe46608365ac1af87936fd4ddaa294920aefc974ee245a482ea29 | MATLAB | 3,814 | 174 | function figure3()
% Create public-facing Figure 3 brain-map panels.
%
% Panels:
% A. Emotion > Control
% B. Arousal positive
% C. Valence negative
%
% This script expects thresholded statistical images that were exported
% from the corresponding second-level SPM analyses using:
% voxel-level p < .001 (uncorrec... |
f6dca3ffbacbe1747c9811091eb79fe7765e5b72d2e97c53e2b046dfcb6bd74a | MATLAB | 3,814 | 82 | %% coregist T1Img to mean*.nii
DataDir='/home/NCPL09/Desktop/weijunjie/real2';
[ProgramPath, fileN, extn] = fileparts(which('TMStarget.m'));
sublist = dir([DataDir,filesep,'FunImgAR'])
for sub = 3 : length(sublist)
TempImg3 = dir([DataDir,filesep,'FunImgAR',filesep,sublist(sub).name,filesep,'ra*.nii']) ;
[datab hea... |
1c829dc039e7eedb120dd514a3113dbb904f3df94e879ec59d9efe230017b95e | MATLAB | 3,815 | 97 | % function varargout =AFQTractValue(DTIdir,T1dir,ALFFdir,imgname)
function [wholebrainFG fg_clean FA MD RD AD] = AFQTractValue(DTIdir,T1dir,ALFFdir,imgname)
%% This funciton was initially written for evaluating the ALFF within each
%% tracts. But it also could extract other measures in any 3-D images, e.g., T1.nii
... |
33aaf5157bd9a3f143253db147ae89d7515bce6e71025914fdb0100a686697ed | MATLAB | 3,815 | 101 | function [VertexNormals,Avertex,Acorner,up,vp]=CalcVertexNormals(FV,N)
%% Summary
%Author: Itzik Ben Shabat
%Last Update: July 2014
%summary: CalcVertexNormals calculates the normals and voronoi areas at each vertex
%INPUT:
%FV - triangle mesh in face vertex structure
%N - face normals
%OUTPUT -
%VertexNorma... |
39e3aa6e70ef7d362534973484d441584f5e5a979f40cbe8d9667a8afd40e20d | MATLAB | 3,816 | 97 | function getTriggers_loca_timesLabels(params)
% extracts trigger times and class labels, saves/updates as 'triggers'
% saves/updates trials (predictor) structure: pred_prc
% with fields:
% .wasSelected = 0,1
% .clzLabel
% .cutPoint
% selected trials for given class are in triggers_clz
% saves 'triggers' & 'pred_p... |
1c5d0c13a36f5592d89a2a9be73e4428c25ac43f4d640985baab1c3fa4a52d74 | MATLAB | 3,817 | 91 | function [this_cnm] = check_num_frames(this_cnm,this_info,this_plane,first_plane_frames,varargin)
temporal_ds_factor = 1;
Fs = 10; % frame rate after resampling
for v = 1:numel(varargin)
if strcmpi(varargin{v},'temporal_ds_factor')
temporal_ds_factor = varargin{v+1};
elseif strcmpi(varargin{v},'Fs... |
a68503f259365236dce86a79bba868c7153219a3063722e52382c52eb0cff06e | MATLAB | 3,821 | 131 | function M = Array2PagedMatrix(A)
%Array2PagedMatrix - Transform an N-dimensional array into a paged matrix.
%
% Vertically concatenate all pages in the array, and add N-1
% columns listing the subscripts for all dimensions except the
% second dimension (which is implicit, since it becomes the
% second dimension o... |
06bcb40ee98e870b095c36ba151744cdcd115da20a45e54892c434f678735cb7 | MATLAB | 3,822 | 92 | function struct = GetStructure(basepath,extension,fieldName)
%getStruct - Load custom data extensions associated with a given session.
% This is a helper function similar to CellExplorer's loadStruct.
% If multiple .mat files match your query, the function will return
% the first one (in alphabetical order).
%
% =... |
7f26fa594c14618ce1ae312cbe809df980efa8c7ebff3baa3021a42d39bf3481 | MATLAB | 3,823 | 114 | %% iEEG activity to .nii
% (c) Jiri, May22
%% load activations in MNI -> chnls_MNI_VAL
% variables: traj, neur, subj
trajVars = {'absVel'};
trajVars_legend = {'speed'};
neurVars = {'hiGamma'};
subjList = msDist_getSubjList('CG_motorSubj');
selTime = 0;
outDir = 'G:\dox\proj_switching_EI\brainNetworks_Yeo7N';
% pa... |
a64961c2481bb951116d2cfdc96ef658d4006f6d6840082bd45bfd63d6384b4f | MATLAB | 3,823 | 100 | % FLOATWRITE - Write data matrix to float file.
%
% Usage: >> floatwrite(data,filename, 'format')
%
% Inputs:
% data - write matrix data to specified file as four-byte floating point numbers.
% filename - name of the file
% 'format' - The option FORMAT argument specifies the storage format as
% ... |
e2715c3a99945f120735470ae32bcc5944b4112565ef26148835574765db435c | MATLAB | 3,823 | 113 | % STRMULTILINE - format a long string as a multi-line string.
%
% Usage:
% >> strout = strmultiline( strin, maxlen, delimiter);
%
% Inputs:
% strin - one-line or several-line string
% maxlen - maximum line length
% delimiter - enter 10 here to separate lines with character 10. Default is
% ... |
7b3cea9ca25dcb0bd6a48d2189f7829f73b09698f22127ed07d15d0087f8aeae | MATLAB | 3,825 | 125 | classdef nifti < brca.format.base
methods
function obj = nifti()
end
function data = read(~,array,index,dimension)
if ischar(array)
array = nifti(array);
end
if isa(array, 'nifti')
array = array.dat;
end
... |
fa2fdd62e126b2e17ebfe6687dc913a392cab15517fad999b8280717a367afc8 | MATLAB | 3,825 | 133 | function step3CreateSLResultsMaps(condition,maps, funcFWHM2Level)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step 2 was smoothing the SL result maps
% Here Step 3 is producing mean classification accuracy
% and standard deviation map
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% maps = 'be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.