You are on page 1of 76

rsHRF: A Toolbox for Resting State HRF

Deconvolution and Connectivity Analysis


(MATLAB)

Manual
Version 2.3

https://www.nitrc.org/projects/rshrf

Guo-Rong WU
e-mail: guorongwu@swu.edu.cn

Sofie Van Den Bossche


e-mail: Sofie.VanDenBossche@ugent.be

Daniele Marinazzo
e-mail: daniele.marinazzo@ugent.be

October 10, 2020


Contents

OVERVIEW ....................................................................................................................................... 2
GENERAL.......................................................................................................................................... 3
Input data ..................................................................................................................................................... 3
Statistical analysis (second-level analyses) .................................................................................................. 3
Display (voxel-wise HRF visualization) .......................................................................................................... 3
FAQ................................................................................................................................................................ 4
Help resources .............................................................................................................................................. 4
Version information ..................................................................................................................................... 4
GETTING STARTED .............................................................................................................................. 5
Download ...................................................................................................................................................... 5
Installation .................................................................................................................................................... 5
Start the toolbox (SPM Plugin) ...................................................................................................................... 6
Resting State HRF .......................................................................................................................................... 7
Connectivity Analysis ..................................................................................................................................... 7
DATA PROCESSING EXAMPLES ................................................................................................................ 8
Demo data..................................................................................................................................................... 8
Batch interfaces and demo matlabbatch jobs .............................................................................................. 9
o Voxel-wise HRF estimation, deconvolution and connectivity analysis ................................................. 9
o Vertex-wise HRF estimation, deconvolution and connectivity analysis ............................................. 20
o (Volume) ROI-wise HRF estimation, deconvolution and connectivity analysis .................................. 28
o (Surface) ROI-wise HRF estimation, deconvolution and connectivity analysis .................................. 35
o Signals based HRF estimation, deconvolution and connectivity analysis .......................................... 43
o Voxel-wise connectivity analysis ........................................................................................................ 48
o Vertex-wise connectivity analysis ...................................................................................................... 52
o (Volume) ROI-wise connectivity analysis ........................................................................................... 54
o (Surface) ROI-wise connectivity analysis............................................................................................ 57
o Signals based connectivity analysis ................................................................................................... 59
o Display ............................................................................................................................................... 62
Standalone demo codes .............................................................................................................................. 65
o rsHRF_demo_temporal_basis.m........................................................................................................ 65
o rsHRF_demo_FIR_sFIR.m ................................................................................................................... 67
o rsHRF_demo_impulseest.m ............................................................................................................... 69
o rsHRF_demo_voxel_calcium.m .......................................................................................................... 71
THIRD-PARTY CODE ........................................................................................................................... 74
REFERENCE ..................................................................................................................................... 75

1
Overview
rsHRF is a Matlab/Python-based cross-platform software for the computation, display, and
analysis of resting-state hemodynamic response function (HRF).
rsHRF is aimed to retrieve the onsets of pseudo-events triggering a hemodynamic response
from resting-state hemodynamic signal (e.g. BOLD-fMRI). It is based on point process theory
(Tagliazucchi et al., 2012) and fits a model to retrieve the optimal lag between the events and
the HRF onset, as well as the HRF shape, using the basis function sets (Wu et al., 2013; Wu &
Marinazzo, 2015; Wu & Marinazzo, 2016). There are a number of basis function sets available
in rsHRF, including “informed” basis set (canonical HRF with its delay and dispersion
derivatives), Gamma functions, Fourier set (Hanning), (smoothed) Finite Impulse Response
(FIR), and the nonparametric impulse response function.
Once that the HRF has been retrieved, it can be deconvolved from the time series (for
example to improve lag-based connectivity estimates), or one can map the shape parameters
everywhere in the brain (including white matter), and use it as a pathophysiological indicator.
Input can be 2D GIfTI, or 3D/4D NIfTI images, but also on time series matrices/vectors.
The output are three HRF shape parameters (response height, time to peak, full width at half
maximum) for each voxel/vertex/ROI, plus the deconvolved time series, and the number of
retrieved pseudo-events.
In the rsHRF MATLAB version, brain connectivity analysis (seed to voxels/vertices, ROI to ROI
analysis) can be further performed using the (partial) correlation (Pearson/Spearman) and
Granger causality methods (Pairwise GC, partially conditioned GC, Conditional GC).

2
General
Input data
In order to perform HRF/connectivity analyses using this toolbox you will need:
Resting-state functional data. Either 2D Surface (GIfTI), 3D/4D Volume (NIfTI), or time series
(text/mat) can be analysed.
ROI definitions. for regions of interest (ROIs) based HRF/connectivity analysis, ROIs can be
defined from mask images, MNI coordinates (or native space coordinates), or multiple-label
images.

The following basic information should be defined before HRF analysis:


• Denoising: remove possible confounds in the resting-state hemodynamic signal,
including motion, physiological and other noise sources;
• HRF basis function: informed basis function, Gamma functions, Fourier set (Hanning),
(smooth) Finite impulse response, nonparametric impulse response;
• Duration of HRF;
• Minimum/maximum time delay;
• Microtime resolution for onset estimation;
• Serial correlation model (AR model);
• Threshold for point process detection;
• Temporal mask to exclude spurious events;

The brain connectivity analysis (seed based or ROI to ROI connectivity) can be further
performed based on the signal with/without HRF deconvolution.

Statistical analysis (second-level analyses)


• With the 3dMVM function embedded in AFNI, one can even run a multivariate analysis
in which the three HRF parameters are modelled as multiple, simultaneous response
variables (Chen, Adleman, Saad, Leibenluft, & Cox, 2014).
• The Matlab code of multivariate analysis of variance (manova.m) can be used for
statistical analysis of HRF parameters (e.g. ROI-wise HRFs). There are four different
methods provided in manova.m: Wilks’ lambda, Pillai’s trace, Hotelling-Lawley trace,
Roy’s maximum root statistic.
• …

Display (voxel-wise HRF visualization)


The HRF viewer (rsHRF_viewer.m) is designed to visualize the HRF shape at the voxel/ROI
level with a statistical image (3D NIfTI) and HRF results (mat-file generated from rsHRF SPM
plugin). For the moment, the rsHRF viewer only works with voxel-wise HRF results.

3
FAQ
1. Should the input data be standardized (i.e. z-scored) a priori?
No, the standardization of the resting-state fMRI BOLD signal has already been included in
the code.

2. Should the input data already be denoised?


The input data consists of voxelwise/vertexwise resting-state fMRI BOLD signal, which you
can already preprocess according to your favourite recipe; however, the rsHRF toolbox also
provides the following denoising steps implemented in the SPM plugin:
• nuisance variable regression;
• polynomial detrending;
• band-pass filter (e.g. 0.01 - 0.1 Hz);
• despiking.
It is also possible to use a temporal mask to exclude some time points using the temporal
mask for event detection included in the SPM plugin.

3. Voxel-/vertex-wise or ROI analysis?


The rsHRF toolbox consists of two main analysis options: 1) rsHRF retrieval and deconvolution
and 2) connectivity analysis. Both analyses are supported on either the voxels/vertex or ROIs-
volume levels.
The rsHRF retrieval and deconvolution is advised at the voxel level when possible, in order to
avoid deviation from the mean in case of inhomogeneities within ROIs.
However, outlier removal is only legit when conducting a whole-brain analysis (3D volume).

Help resources
Forums for RS-HRF: https://www.nitrc.org/forum/?group_id=1304

Version information
The historical modification information was summarized in rsHRF_update_log.txt, with a
more detailed description in Github: https://github.com/compneuro-
da/rsHRF/blob/update/documentation/manual/01_History%26Development.md

4
Getting started
Download
rsHRF and demo data can be downloaded from:
https://github.com/compneuro-da/rsHRF
&
www.nitrc.projects/rshrf

Installation
Copy or extract the whole folder “rsHRF” into the SPM toolbox directory. The folder
“spm/toolbox/rsHRF” should now contain all m-files, matlabbatch job files (SPM plugin) as
well as a subfolder named “demo-code”, containing the demo codes (MATLAB Standalone).
This will allow you to start the program directly from the SPM user interface via the toolbox
button on the GUI.
Note: run the rsHRF_install_SPM.m script in the MATLAB Command Window, all scripts within
the downloaded rsHRF folder will be copied into a folder named ‘rsHRF’ located in the
path/to/spm/toolbox/ folder.

5
Start the toolbox (SPM Plugin)
Via GUI
o Click on toolbox and then select “rsHRF” from the drop-down menu.
o Or, Click Batch, SPM→ Tools → rsHRF

Via command line


Make sure that the directory of the m-files is included in the MATLAB search path. Then type
‘rsHRF’ or ‘rsHRF conn’ in the MATLAB prompt.
Command Window:
>> rsHRF >> rsHRF conn
Or
>> rsHRF(‘conn’)

6
The following Main-menu should appear in an additional window:

Resting State HRF Connectivity Analysis


o Voxels o Voxels
Voxel-wise HRF estimation, Voxel-wise connectivity analysis (NIfTI
deconvolution and connectivity analysis files, 3D/4D volumes)
(NIfTI files, 3D/4D volumes) o Vertices
o Vertices Vertex-wise connectivity analysis (GIfTI
Vertex-wise HRF estimation, files, 2D surfaces)
deconvolution and connectivity analysis o ROIs-volume
(GIfTI files, 2D surfaces) ROI-wise connectivity analysis (NIfTI
o ROIs-volume files, 3D/4D volumes)
ROI-wise HRF estimation, deconvolution o ROIs-surface
and connectivity analysis (NIfTI files, 3D/4D ROI-wise connectivity analysis (GIfTI
volumes) files, 2D surfaces)
o ROIs-surface
ROI-wise HRF estimation, deconvolution o Signals
and connectivity analysis (GIfTI files, 2D Signals based connectivity analysis
surfaces) (text/mat files)
o Signals
Signals based HRF estimation,
deconvolution and connectivity analysis
(text/mat files)
o Display
HRF Visualization

7
Data processing examples
Demo data
The demo data (one subject, sub-10171) was from ‘UCLA Consortium for Neuropsychiatric
Phenomics LA5c Study’, can be download from www.nitrc.projects/rshrf .

This data has been preprocessed by fMRIPrep and described in


o Gorgolewski KJ, Durnez J and Poldrack RA. Preprocessed Consortium for
Neuropsychiatric Phenomics dataset. F1000Research 2017, 6:1262
https://doi.org/10.12688/f1000research.11964.2

Generate file for nuisance variable regression


>> dat=spm_load('D:\sub-10171\func\sub-10171_task-rest_bold_confounds.tsv');
>> nuisance=[dat.aCompCor00, dat.aCompCor01, dat.aCompCor02, dat.aCompCor03,
dat.aCompCor04, dat.aCompCor05, dat.X, dat.Y, dat.Z, dat.RotX, dat.RotY, dat.RotZ];
>> save('D:\sub-10171\func\nuisance.txt','nuisance','-ascii')
>> rp = [dat.X, dat.Y, dat.Z, dat.RotX, dat.RotY, dat.RotZ];
>> save('D:\sub-10171\func\rp.txt','rp','-ascii')
Temporal mask
>> FD = dat.FramewiseDisplacement; FD(1)=0;
>> Temporal_Mask = double(FD<0.3); % [1 1 1 0 1 1 …. ]; only for GUI input

The atlas files for ROIs analysis can be downloaded from


AAL3.nii https://www.gin.cnrs.fr/en/tools/aal/
Yeo 7 networks ftp://surfer.nmr.mgh.harvard.edu/pub/data/Yeo_JNe
urophysiol11_MNI152.zip
Schaefer-2018: https://github.com/ThomasYeoLab/CBIG/
Posterior cingulate (surface ROI) converted from
\freesurfer\subjects\fsaverage5\label\lh.aparc.annot

8
Batch interfaces and demo matlabbatch jobs
o Voxel-wise HRF estimation, deconvolution and connectivity analysis
The voxels-wise based analysis module in the matlabbatch is called by clicking the ‘Voxels’
button in the main menu.

9
Demo jobs
Batch Editor → Load Batch

Job 1: \spm12\toolbox\rsHRF\demo_jobs\vox_hrf_canon2dd_deconv_job1_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• HRF basis function: informed basis function;
• Duration of HRF: 32s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 2, i.e. TR/2 = 2/2=1s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• HRF parameter outlier will be removed and replaced by surrounding values.
• HRF computation only inside the ‘*brainmask.nii’
• The HRF parameters, and deconvolved data will be saved in NIfTI files.

10
Job1 results:

File Name Description


Deconv_RAW_FILE_NAME.nii HRF deconvolved data
Deconv_RAW_FILE_NAME_FWHM.nii HRF parameter FWHM/width
Deconv_RAW_FILE_NAME_Height.nii HRF parameter response height
HRF parameter response height
Deconv_RAW_FILE_NAME_Height_PSC.nii
(percent signal change, PSC)
Deconv_RAW_FILE_NAME_Time2peak.nii HRF parameter time to peak
Deconv_RAW_FILE_NAME_event_number.nii estimated BOLD event number
Outlier removed and Inpainted (Olrm)
Deconv_RAW_FILE_NAME_Olrm.nii HRF deconvolved data
Deconv_RAW_FILE_NAME_Olrm_FWHM.nii HRF parameter width
Deconv_RAW_FILE_NAME_Olrm_Height.nii HRF parameter response height
HRF parameter response height
Deconv_RAW_FILE_NAME_Olrm_Height_PSC.nii
(percent signal change, PSC)
Deconv_RAW_FILE_NAME_Olrm_Time2peak.nii HRF parameter time to peak
Deconv_RAW_FILE_NAME_outlier_NAN.nii detected outlier (value=1)
Mat-files
Deconv_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
RAW_FILE_NAME = sub-10171_task-rest_bold_space-MNI152NLin2009cAsym_preproc

>> load('Deconv_ RAW_FILE_NAME_preproc_hrf.mat')


>> figure('color','w');subplot(1,2,1);
plot(para.dt*[1:size(bf,1)],bf);title('Basis functions'); xlabel('Time(s)');xlim([0 para.len])
>> subplot(1,2,2);
plot(para.dt*[1:size(bf,1)],hrfa(:,[1:10]));title('HRF'); xlabel('Time(s)');xlim([0 para.len])

11
hrf.mat
Variable Description
V0 NIfTI header information
smask_ind matrix index of analysis mask
event_number number of detected spontaneous events
event_bold: timing information of spontaneous events
PARA HRF parameters: 1st row: Response Height;
2nd row: Time to peak; 3rd row: Width at half peak
para input parameters for HRF estimation

hrfa All HRF


bf HRF basis function
beta_hrf beta_hrf = [beta coefficients; estimated lag]
i.e. hrfa = bf*beta_hrf(1:size(bf,2),:);
%HRF baseline value for PSC calculation.
hrf_baseline = beta_hrf(1+size(bf,2),:);
id_rm index of removed outliers
HeightPSC_rm: response height ( percent signal change, PSC), outlier removed
PARA_rm HRF parameters, outlier removed
event_number_rm: number of detected spontaneous events, outlier removed

12
Job 2: \spm12\toolbox\rsHRF\demo_jobs\vox_hrf_gamma_job2_v23.mat
• Denoising: (1) remove motion (rp.txt), physiological confounds (top 5 principle
components from CSF and white matter, here we only select voxels with value > 0.9
in covariate images for nuisance regression), Linear Polynomial detrending; (2) Band-
pass filter (0.01~0.1 Hz); (3) Despking.
• HRF basis function: 4 Gamma functions;
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 4, i.e. TR/4 = 2/4=0.5s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: no;
• Do not perform HRF deconvolution.
• HRF parameter outlier will be removed and replaced by surrounding values.
• HRF computation only inside the ‘*brainmask.nii’
• The HRF parameters will be saved in NIfTI files.

13
Job2 results:

Job 3: \spm12\toolbox\rsHRF\demo_jobs\vox_deconv_job2_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• HRF basis function: 3 Gamma functions;
• Duration of HRF: 32s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 4, i.e. TR/4 = 2/4=0.5s ;
• Serial correlation model: none;
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: no;
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• HRF parameter outlier will be removed and replaced by surrounding values.
• HRF computation only inside the 'E:\spm12\toolbox\rsHRF\demo_jobs\AAL3.nii’
• Which first? (c)
o (a) First denoise then generate ROI signal
o (b) First generate ROI signal then denoise
o (c) No ROI analysis (default)
▪ if ROI analysis was included, it will automatedly change to (b) <-- (Job3).
• Connectivity analysis:
o (1) Functional connectivity (FC) : seed to voxels analysis.
▪ Data: denoised BOLD and deconvolved BOLD
▪ seed of interest information defined as: [x, y, z, radius]

14
▪ two seeds: [10 -62 61 4;
-52 -63 5 5].
o (2~4) Granger Causality (GC): ROI to ROI analysis.
▪ Data: denoised BOLD and deconvolved BOLD
▪ (2). pairwise GC, model order = 1;
▪ (3). Conditional GC; model order = 1; only for deconvolved BOLD data.
▪ (4). Partially Conditioned GC; model order=1; fixed number of
conditional variables = 6, maximum number of conditional variables =
8 (which can be used for information gain plot).
o (5) Functional connectivity (FC) : ROI to ROI analysis.
▪ Data: deconvolved BOLD
▪ 14 sphere ROIs + 164 ROIs from atlas (AAL3, 164 ROIs are arranged in
ascending order according to their label in AAL3 --- see AAL3.nii.txt for
label information)

ROI index Matrix index ROI information Label

19 969x1 do… ‘E:\spm12\toolbox\rsHRF\demo_jobs\AAL3.nii,1’ 5


15
16
• Job3 results:

File Name Description


Seed to Voxels
Conn_1_RAW_FILE_NAME_Z_Pearson.nii Seed FC
Conn_1_RAW_FILE_NAME_SeedInfo_Pearson.mat ‘Z_Pearson’ --Fisher's z transformed
Conn_1_RAW_FILE_NAME_corr_Pearson.nii Pearson correlation coefficient,
‘corr_Pearson’ --Pearson correlation
coefficient) ,
based on the denoised BOLD data
‘SeedInfo’ -- seed information
([10 -62 61 4]):

Conn_1_RAW_FILE_NAME_deconv_Olrm_Z_Pearson.nii Seed FC
Conn_1_RAW_FILE_NAME_deconv_Olrm_corr_Pearson.nii ‘deconv_Olrm’ -- based on the
Conn_1_RAW_FILE_NAME_deconv_Olrm_SeedInfo_Pearson.mat deconvolved (outlier removed) BOLD
data
Conn_1_RAW_FILE_NAME_deconv_Z_Pearson.nii Seed ([10 -62 61 4]) FC
Conn_1_RAW_FILE_NAME_deconv_corr_Pearson.nii ‘deconv’ -- based on the deconvolved
Conn_1_RAW_FILE_NAME_deconv_SeedInfo_Pearson.mat BOLD data
Conn_2_RAW_FILE_NAME_Z_Pearson.nii
Conn_2_RAW_FILE_NAME_corr_Pearson.nii
Conn_2_RAW_FILE_NAME_SeedInfo_Pearson.mat
Conn_2_RAW_FILE_NAME_deconv_Olrm_Z_Pearson.nii
Conn_2_RAW_FILE_NAME_deconv_Olrm_corr_Pearson.nii Seed ([-52 -63 5 5]]) FC
Conn_2_RAW_FILE_NAME_deconv_Olrm_SeedInfo_Pearson.mat
Conn_2_RAW_FILE_NAME_deconv_Z_Pearson.nii
Conn_2_RAW_FILE_NAME_deconv_corr_Pearson.nii
Conn_2_RAW_FILE_NAME_deconv_SeedInfo_Pearson.mat
ROI to ROI
Conn_RAW_FILE_NAME_PWGC.mat
Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d,
which is considered to be
approximately normal.
(Geweke 1982)

17
Conn_RAW_FILE_NAME_deconv_CGC.mat
Conditional GC
In variable M:
GC_Matrix: GC Value
pval_Matrix: p-value (F-test)
variable roiid : ROI information
ROI 1:
sphere radius 4mm, center at [10 -62 61]

ROI 1:
sphere radius 4mm, center at [29 -5 54]

Conn_RAW_FILE_NAME_PCGC.mat Partially Conditioned GC


GC_Matrix: GC Value
pval_Matrix: p-value (F-test)
condition_id: (nvar x ndmax)
index of conditional variables,
information_gain:
mutual information gain1

(Marinazzo et al. 2012; Wu et al. 2013)


Conn_RAW_FILE_NAME_deconv_Corr_Pearson.mat

Matric_r: Pearson correlation


coefficient) ,
Matrix_z: Fisher's z transformed
Pearson correlation coefficient,
Matric_pval: p-value (t-test)

Conn_RAW_FILE_NAME_deconv_Olrm_Corr_Pearson.mat
Conn_RAW_FILE_NAME_deconv_Olrm_CGC.mat
GC
Conn_RAW_FILE_NAME_deconv_Olrm_PCGC.mat

Deconv_RAW_FILE_NAME_outlier_NAN.nii detected outlier (value=1)

18
Mat-files
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
RAW_FILE_NAME = sub-10171_task-rest_bold_space-MNI152NLin2009cAsym_preproc
1
plot(diff(M.information_gain')); xlabel('n_d'); ylabel('\Delta y')

19
o Vertex-wise HRF estimation, deconvolution and connectivity analysis

The vertex-wise based analysis module in the matlabbatch is called by clicking the
‘Vertices’ button in the main menu.

20
Demo jobs
Batch Editor → Load Batch

Job 4: \spm12\toolbox\rsHRF\demo_jobs\vertex_hrf_canon2dd_deconv_job4_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• HRF basis function: informed basis function;
• Duration of HRF: 32s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 2, i.e. TR/5 = 2/5=0.4s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• Explicit Mask: none.
• The HRF parameters, and deconvolved data will be saved in GIfTI files.

21
• Job4 results:

File Name Description


Deconv_RAW_FILE_NAME.gii HRF deconvolved data
Deconv_RAW_FILE_NAME_FWHM.gii HRF parameter FWHM/width
Deconv_RAW_FILE_NAME_Height.gii HRF parameter response height
HRF parameter response height
Deconv_RAW_FILE_NAME_Height_PSC.gii
(percent signal change, PSC)
Deconv_RAW_FILE_NAME_Time2peak.gii HRF parameter time to peak
Deconv_RAW_FILE_NAME_event_number.gii estimated BOLD event number
Mat-files
Deconv_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.L.func

>> load('Deconv_ RAW_FILE_NAME_hrf.mat')


>> figure('color','w');subplot(1,2,1);
plot(para.dt*[1:size(bf,1)],bf);
title('Basis functions'); xlabel('Time(s)');xlim([0 para.len])
>> subplot(1,2,2);
plot(para.dt*[1:size(bf,1)],hrfa(:,[1000:1010]));
title('HRF'); xlabel('Time(s)');xlim([0 para.len])

22
hrf.mat
Variable Description
V0

smask_ind matrix index of analysis mask


event_number number of detected spontaneous events
event_bold: timing information of spontaneous events
PARA HRF parameters: 1st row: Response Height;
2nd row: Time to peak; 3rd row: Width at half peak
para input parameters for HRF estimation

hrfa All HRF


bf HRF basis function
beta_hrf beta_hrf = [beta coefficients; estimated lag]
i.e. hrfa = bf*beta_hrf(1:size(bf,2),:);
%HRF baseline value for PSC calculation.
hrf_baseline = beta_hrf(1+size(bf,2),:);

23
Job 5: \spm12\toolbox\rsHRF\demo_jobs\vertex_hrf_gamma_deconv_FC_job5_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• HRF basis function: 3 Gamma functions;
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 1, i.e. TR = 2 s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• Explicit Mask: none.
• The HRF parameters, and deconvolved data will be saved in GIfTI files.
• Which first? First denoise then generate ROI signal
• Connectivity analysis:
o (1) Functional connectivity (FC) : seed to vertices analysis.
▪ Data: denoised BOLD and deconvolved BOLD
▪ seed of interest: posterior cingulate
o (2) Functional connectivity (FC) : ROI to ROI analysis.
▪ Data: denoised BOLD and deconvolved BOLD
▪ 200 ROI from atlas (Schaefer-2018, 200 ROIs are arranged in ascending
order according to their label in atlas file)
o (3) Granger causality (GC) : ROI to ROI analysis.
▪ Data: deconvolved BOLD
▪ 7 ROIs from atlas (Yeo-2011, 7 ROIs are arranged in ascending order
according to their label in atlas file)

24
25
• Job5 results:

File Name Description


Seed to Vertices
Conn_1_RAW_FILE_NAME_Z_Spearman.gii Seed (posterior cingulate) FC
Conn_1_RAW_FILE_NAME_SeedInfo_Spearman.mat ‘_Z_ Spearman’ --Fisher's z transformed
Spearman correlation coefficient,
Conn_1_RAW_FILE_NAME_corr_Spearman.gii ‘_corr_ Spearman’ -- Spearman
correlation coefficient) ,
based on the denoised BOLD data
‘SeedInfo’ Seed information:

Conn_1_RAW_FILE_NAME_deconv_Z_Spearman.gii Seed (posterior cingulate) FC


Conn_1_RAW_FILE_NAME_deconv_corr_Spearman.gii ‘_deconv’ -- based on the deconvolved
Conn_1_RAW_FILE_NAME_deconv_SeedInfo_Spearman.mat BOLD data
ROI to ROI
Conn_RAW_FILE_NAME_deconv_CGC.mat

Conditional GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)

26
Conn_RAW_FILE_NAME_Corr_Pearson.mat

Matric_r: Pearson correlation coefficient) ,


Matrix_z: Fisher's z transformed Pearson
correlation coefficient,
Matric_pval: p-value (t-test)

Conn_RAW_FILE_NAME_deconv_Corr_Pearson.mat
Mat-files
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters

27
o (Volume) ROI-wise HRF estimation, deconvolution and connectivity
analysis
The volume based ROI analysis module in the matlabbatch is called by clicking the ‘ROIs-
volume’ button in the main menu.

Figure : matlabbatch GUI for volume based ROI HRF deconvolution.

28
Demo jobs
Batch Editor → Load Batch

Job 6: \spm12\toolbox\rsHRF\demo_jobs\ROI_hrf_canon2dd_deconv_job6_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First denoise then generate ROI signal
• ROI definition:
o atlas image: AAL3.nii
o MNI coordinates+radius(sphere): 264 x 4
• HRF basis function: informed basis function (canonical HRF + time derivative);
• Duration of HRF: 32s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 2, i.e. TR/5 = 2/5=0.4s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• HRF computation only inside the ‘*brainmask.nii’
• The HRF parameters, and deconvolved data will be saved in Mat files.

29
• Job6 results:

File Name Description


Deconv_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv_RAW_FILE_NAME.mat HRF deconvolved BOLD data
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.L.func

>> load('Deconv_ RAW_FILE_NAME_hrf.mat')


>> figure('color','w');subplot(1,2,1); plot(para.dt*[1:size(bf,1)],bf);
title('Basis functions'); xlabel('Time(s)');xlim([0 para.len])
>> subplot(1,2,2); plot(para.dt*[1:size(bf,1)],hrfa(:,[1:428]));
title('HRF'); xlabel('Time(s)');xlim([0 para.len])

hrf.mat
Variable Description
event_number number of detected spontaneous events
event_bold: timing information of spontaneous events
PARA HRF parameters: 1st row: Response Height;
2 row: Time to peak; 3rd row: Width at half peak
nd

para input parameters for HRF estimation

hrfa All HRF


bf HRF basis function
beta_hrf beta_hrf = [beta coefficients; estimated lag]
i.e. hrfa = bf*beta_hrf(1:size(bf,2),:);
%HRF baseline value for PSC calculation.
hrf_baseline = beta_hrf(1+size(bf,2),:);

30
>> load('Deconv_ RAW_FILE_NAME.mat')
>> figure('color','w');plot(zscore(data(:,5)));
>> hold on; plot(zscore(data_deconv(:,5)));legend({'BOLD','Deconvolved BOLD'})

Deconv_RAW_FILE_NAME.mat
Variable Description
data (Denoised) BOLD data
data_deconv HRF deconvolved BOLD Data
roiinfo ROI information:

31
Job7: \spm12\toolbox\rsHRF\demo_jobs\ROI_hrf_gamma_deconv_FC_GC_job7_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First generate ROI signal then denoise
• ROI definition:
o atlas image: AAL3.nii
o MNI coordinates+radius(sphere): 264 x 4
• HRF basis function: 3 Gamma functions;
• Duration of HRF: 32s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 1, i.e. TR = 2 s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• Explicit Mask: none.
• The HRF parameters, and deconvolved data will be saved in mat files.
• Connectivity analysis: ROI to ROI; Data: denoised BOLD and deconvolved BOLD
o (1) Functional connectivity (FC) : Pearson correlation.
o (2) Functional connectivity (FC) : Pearson Partial correlation.
o (3) Granger causality (GC) : Pairwise Granger causality.
o (4) Granger causality (GC) : Conditional Granger causality.

32
33
• Job7 results:
File Name Description

roiid = []; % ROI information was saved in Deconv_RAW_FILE_NAME.mat


ROI to ROI
Conn_RAW_FILE_NAME_CGC.mat
Conn_RAW_FILE_NAME_deconv_CGC.mat
Conditional GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)

Conn_RAW_FILE_NAME_pwGC.mat
Conn_RAW_FILE_NAME_deconv_pwGC.mat Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d, which
is considered to be approximately normal.
(Geweke 1982)

Conn_RAW_FILE_NAME_Corr_Pearson.mat
Conn_RAW_FILE_NAME_Corr_PartialPearson.mat

Matric_r: Pearson correlation coefficient) ,


Matrix_z: Fisher's z transformed Pearson
correlation coefficient,
Matric_pval: p-value (t-test)

Conn_RAW_FILE_NAME_deconv_Corr_Pearson.mat
Conn_RAW_FILE_NAME_deconv_Corr_PartialPearson.mat
Mat-files
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
Deconv_RAW_FILE_NAME.mat HRF deconvolved BOLD data

34
o (Surface) ROI-wise HRF estimation, deconvolution and connectivity
analysis

The surface based ROI analysis module in the matlabbatch is called by clicking the ‘ROIs-
surface’ button in the main menu.

35
Demo jobs
Batch Editor → Load Batch

Job8: \spm12\toolbox\rsHRF\demo_jobs\ROI_vertex_hrf_gamma_deconv_FC_GC_job8.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First generate ROI signal then denoise
• ROI definition:
o atlas mesh: Yeo 7 networks
• HRF basis function: Smooth FIR
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 1, i.e. TR2s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• The HRF parameters, and deconvolved data will be saved in Mat files

36
• Job8 results:

File Name Description


Deconv_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv_RAW_FILE_NAME.mat HRF deconvolved BOLD data
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.R.func

>> load('Deconv_ RAW_FILE_NAME_hrf.mat')


>> figure('color','w'); plot(para.dt*[1:size(hrfa,1)],hrfa);
title('HRF'); xlabel('Time(s)');xlim([0 para.len])

hrf.mat
Variable Description
event_number number of detected spontaneous events
event_bold: timing information of spontaneous events
PARA HRF parameters: 1st row: Response Height;
2nd row: Time to peak; 3rd row: Width at half peak
para input parameters for HRF estimation

hrfa All HRF


beta_hrf beta_hrf = [beta coefficients; estimated lag]
i.e. hrfa = beta_hrf(1:end-2,:);
%HRF baseline value for PSC calculation.
hrf_baseline = beta_hrf(end-1,:);

37
>> load('Deconv_ RAW_FILE_NAME.mat')
>> figure('color','w');plot(zscore(data(:,5)));
>> hold on; plot(zscore(data_deconv(:,5)));legend({'BOLD','Deconvolved BOLD'})

Deconv_RAW_FILE_NAME.mat
Variable Description
data (Denoised) BOLD data
data_deconv HRF deconvolved BOLD Data
roiinfo ROI information:

38
Job9: \spm12\toolbox\rsHRF\demo_jobs\ROI_hrf_FIR_deconv_FC_GC_job9_v23.mat
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First generate ROI signal then denoise
• ROI definition:
o atlas mesh: Yeo 7 networks
• HRF basis function: FIR
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 1, i.e. TR = 2 s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• Explicit Mask: none.
• The HRF parameters, and deconvolved data will be saved in mat files.
• Connectivity analysis: ROI to ROI; Data: denoised BOLD and deconvolved BOLD
o (1) Functional connectivity (FC) : Pearson correlation.
o (2) Granger causality (GC) : Pairwise Granger causality.

39
40
• Job9 results:

File Name Description


Deconv_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv_RAW_FILE_NAME.mat HRF deconvolved BOLD data
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
• RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.R.func

File Name Description

roiid = []; % ROI information was saved in Deconv_RAW_FILE_NAME.mat


ROI to ROI
Conn_RAW_FILE_NAME_pwGC.mat
Conn_RAW_FILE_NAME_deconv_pwGC.mat
Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d, which
is considered to be approximately normal.
(Geweke 1982)

Conn_RAW_FILE_NAME_Corr_Pearson.mat
Conn_RAW_FILE_NAME_deconv_Corr_Pearson.mat

Matric_r: Pearson correlation coefficient) ,


Matrix_z: Fisher's z transformed Pearson
correlation coefficient,
Matric_pval: p-value (t-test)

Mat-files
Deconv_RAW_FILE_NAME_job.mat analysis/model parameters
Deconv_RAW_FILE_NAME.mat HRF deconvolved BOLD data

41
42
o Signals based HRF estimation, deconvolution and connectivity analysis

The time series analysis module in the matlabbatch is called by clicking the ‘Signals’ button
in the main menu.

43
Demo jobs
Batch Editor → Load Batch

Job10: \spm12\toolbox\rsHRF\demo_jobs\sig_hrf_gamma_deconv_FC_GC_job10_v23.mat
This job file included three different jobs, the first two for HRF estimation and deconvolution,
the third one further perform connectivity analysis.
(1,2):
• Input Data:
o (1) dat1
o (2) dat1 & dat2
• Denoising: no.
• Which first? No ROI analysis.
• HRF basis function: 3 Gamma functions.
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 4, i.e. TR/4=0.5s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• The HRF parameters, and deconvolved data will be saved in Mat files
3.
• Denoising: no.
• Which first? No ROI analysis.
• HRF basis function: 3 Gamma functions.
• Duration of HRF: 24s;
• Minimum/maximum time delay: 4s, 8s;
• Microtime resolution for onset estimation: 1, i.e. TR2s ;
• Serial correlation model: AR(1);
• Threshold for point process detection: 1, i.e. mean + 1*SD;
• Local peak identification: as a ‘spontaneous’ event, the detected point process (t)
should also be the local peak ( f(t  1)< f(t) & f(t  2)< f(t) ).
• Temporal mask to exclude spurious events: [1 1 1 0 1 1 …. ];
• HRF estimation from denoised data (1,2,3), but HRF deconvolution will be performed
on the denoised data (1) without temporal filtering.
• The HRF parameters, and deconvolved data will be saved in Mat files (prefix: Deconv2).
• Connectivity analysis: ROI to ROI; Data: deconvolved BOLD
o (1) Functional connectivity (FC) : Pearson correlation.
o (2) Granger causality (GC) : Conditional Granger causality.

44
45
• Job10 results:
File Name Description
Deconv_combROI_RAW_FILE_NAME_hrf.mat
Deconv2_ combROI_RAW_FILE_NAME_hrf.mat HRF and HRF parameters
Deconv3_ combROI_RAW_FILE_NAME_hrf.mat
Deconv_ combROI_RAW_FILE_NAME.mat
Deconv2_ combROI_RAW_FILE_NAME.mat HRF deconvolved BOLD data
Deconv3_ combROI_RAW_FILE_NAME.mat
Deconv_ combROI_RAW_FILE_NAME_job.mat
Deconv2_ combROI_RAW_FILE_NAME_job.mat analysis/model parameters
Deconv3_ combROI_RAW_FILE_NAME_job.mat
• RAW_FILE_NAME = sig_preproc

>> load('Deconv_ RAW_FILE_NAME_hrf.mat')


>> figure('color','w');subplot(1,2,1);plot(para.dt*[1:size(bf,1)],bf);title('Basis functions');
xlabel('Time(s)');xlim([0 para.len])
>> subplot(1,2,2);
plot(para.dt*[1:size(bf,1)],hrfa(:,[1:10]));title('HRF');xlabel('Time(s)');xlim([0 para.len])

load('Deconv_ RAW_FILE_NAME_hrf.mat')
Variable Description
event_number number of detected spontaneous events
event_bold: timing information of spontaneous events
PARA HRF parameters: 1st row: Response Height;
2nd row: Time to peak; 3rd row: Width at half peak
para input parameters for HRF estimation

hrfa All HRF


beta_hrf beta_hrf = [beta coefficients; estimated lag]
i.e. hrfa = beta_hrf(1:end-2,:);

46
%HRF baseline value for PSC calculation.
hrf_baseline = beta_hrf(end-1,:);

File Name Description


ROI to ROI (load Deconv2_RAW_FILE_NAME.mat)
Conn_RAW_FILE_NAME_deconv_CGC.mat

Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)

Conn_RAW_FILE_NAME_deconv_Corr_Pearson.mat

Matric_r: Pearson correlation


coefficient) ,
Matrix_z: Fisher's z transformed
Pearson correlation coefficient,
Matric_pval: p-value (t-test)

in rsHRF_global_para.m line 20:


%% Combine all input signals (here are dat1, dat2) for connectivity analysis
para.combine_ROI = 1; (default parameter) para.combine_ROI = 0;
add ‘_combROI_’ in result file names add variable name as postfix in result file
names, e.g. ‘_dat1’, ‘_dat2’

47
o Voxel-wise connectivity analysis

The voxel-wise connectivity analysis module in the matlabbatch is called by clicking the
(rsHRF conn) ‘Voxels’ button in the main menu.

48
Demo jobs
Batch Editor → Load Batch

Job 11: \spm12\toolbox\rsHRF\demo_jobs\vox_seed_FC_GC_job11_v23.mat


• Spatial Smooth: Gaussian kernel [8 8 8]
• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? (c)
o (a) First denoise then generate ROI signal
o (b) First generate ROI signal then denoise
o (c) No ROI analysis (default)
▪ as seed ROI analysis was included, it will change to (b) <-- (Job11).
• Connectivity analysis:
o (1~2) Functional connectivity (FC) : seed to voxels analysis.
▪ (1) Spearman Correlation (2) Pearson Correlation
▪ seed of interest information defined as: [x, y, z, radius]
▪ two seeds: [10 -62 61 4;
-52 -63 5 5].
o (3) Granger Causality (GC): seed to voxels analysis.
▪ pairwise GC, model order = 1;

49
• Job11 results:
File Name Description

RAW_FILE_NAME_conn_job.mat Analysis parameters


Conn2_RAW_FILE_NAME_Seedinfo_Pearson.mat Seed region:
sphere radius 4mm, center at [10 -62 61]
corr_Pearson: Pearson correlation
coefficient ,
Conn2_RAW_FILE_NAME_corr_Pearson.gii Z_Pearson: Fisher's z transformed
Conn2_RAW_FILE_NAME_Z_Pearson.gii Pearson correlation coefficient
Conn*_RAW_FILE_NAME_Seedinfo_Pearson.mat
Conn*_RAW_FILE_NAME_corr_Pearson.nii
Conn*_RAW_FILE_NAME_Z_Pearson.nii
Seed based functional connectivity
Conn*_RAW_FILE_NAME_Seedinfo_Spearman.mat
Conn*_RAW_FILE_NAME_corr_Spearman.nii
Conn*_RAW_FILE_NAME_Z_Spearman.nii
pwGC: Pairwise GC
_order1: Model order = 1
Conn_ RAW_FILE_NAME_SeedInfo_pwGC_order1.mat
inflow = others to seed region
Conn_ RAW_FILE_NAME_inflow_N_pwGC_order1.nii
outflow = seed region to others
Conn_ RAW_FILE_NAME_inflow_pval_pwGC_order1.nii
pval: p-value (F-test)
Conn_ RAW_FILE_NAME_inflow_pwGC_order1.nii
*_N_pwGC: transformed GC
Conn_ RAW_FILE_NAME_outflow_N_pwGC_order1.nii
N: GC value c is transformed into d,
Conn_ RAW_FILE_NAME_outflow_pval_pwGC_order1.nii
which is considered to be
Conn_ RAW_FILE_NAME_outflow_pwGC_order1.nii
approximately normal.
(Geweke 1982)
RAW_FILE_NAME = ssub-10171_task-rest_bold_space-MNI152NLin2009cAsym_preproc

50
51
o Vertex-wise connectivity analysis

The vertex-wise based analysis module in the matlabbatch is called by clicking the (rsHRF
conn) ‘Vertices’ button in the main menu.

Demo jobs
Batch Editor → Load Batch

Job 12: \spm12\toolbox\rsHRF\demo_jobs\vertex_seed_FC_GC_job12_v23.mat


• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? (b)
o (a) First denoise then generate ROI signal
o (b) First generate ROI signal then denoise
o (c) No ROI analysis (default)
• Connectivity analysis:
o Functional connectivity (FC) : seed to vertices analysis.
▪ Pearson Correlation
▪ seed of interest information defined as: mesh atlas
▪ seven seeds: Yeo 7 networks .

52
• Job12 results:
File Name Description

RAW_FILE_NAME_conn_job.mat Analysis parameters


Conn2_RAW_FILE_NAME_Seedinfo_Pearson.mat
Seed region: label=2 in Yeo 7 network
corr_Pearson: Pearson correlation
coefficient ,
Z_Pearson: Fisher's z transformed
Conn2_RAW_FILE_NAME_corr_Pearson.gii Pearson correlation coefficient
Conn2_RAW_FILE_NAME_Z_Pearson.gii
Conn*_RAW_FILE_NAME_Seedinfo_Pearson.mat
Conn*_RAW_FILE_NAME_corr_Pearson.gii Seed based functional connectivity
Conn*_RAW_FILE_NAME_Z_Pearson.gii
RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.L.func

53
o (Volume) ROI-wise connectivity analysis
The volume based ROI analysis module in the matlabbatch is called by clicking the
(rsHRF conn) ‘ROIs-volume’ button in the main menu.

Figure : matlabbatch GUI for volume based ROI connectivity analysis.

54
Demo jobs
Batch Editor → Load Batch

Job 13: \spm12\toolbox\rsHRF\demo_jobs\ROI_FC_GC_job13_v23.mat


• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First generate ROI signal then denoise
• ROI definition:
o atlas image: Yeo 7 networks
o MNI coordinates+radius(sphere): 5 x 4
• Connectivity analysis:
o (1) Pearson Correlation (2)Spearman Correlation
o (3) Pairwise GC (4)Conditional GC (5) Partially conditioned GC

• Job13 results:
File Name Description
RAW_FILE_NAME_conn_job.mat
analysis/model parameters
RAW_FILE_NAME_roinfo.mat
Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
Conn_RAW_FILE_NAME_pwGC.mat
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d,

55
which is considered to be
approximately normal.
(Geweke 1982)

Conn_RAW_FILE_NAME_CGC.mat Conditional GC
In variable M:
GC_Matrix: GC Value
pval_Matrix: p-value (F-test)
variable roiid : ROI information
ROI 1: sphere radius 4mm, center at [10 -
62 61] … ROI 12: sphere radius 4mm,
center at [29 -5 54]
Partially Conditioned GC
GC_Matrix: GC Value
pval_Matrix: p-value (F-test)
condition_id: (nvar x ndmax)
Conn_RAW_FILE_NAME_PCGC.mat
index of conditional variables,
information_gain:
mutual information gain1

(Marinazzo et al. 2012; Wu et al. 2013)


Conn_combROI_RAW_FILE_NAME_Corr_Pearson.mat
Matric_r: Pearson/Spearman
correlation coefficient) ,
Matrix_z: Fisher's z transformed
Pearson correlation coefficient,
Matric_pval: p-value (t-test)
Conn_combROI_RAW_FILE_NAME_Corr_Spearman.mat
RAW_FILE_NAME = sub-10171_task-rest_bold_space-MNI152NLin2009cAsym_preproc
1
plot(diff(M.information_gain')); xlabel('n_d'); ylabel('\Delta y')

56
o (Surface) ROI-wise connectivity analysis

The surface based ROI analysis module in the matlabbatch is called by clicking the (rsHRF
conn) ‘ROIs-surface’ button in the main menu.

Demo jobs
Batch Editor → Load Batch

Job 14: \spm12\toolbox\rsHRF\demo_jobs\vertex_ROI_FC_GC_job14_v23.mat


• Denoising: (1) remove motion, physiological confounds---aCompcor (saved in
nuisance.txt), Linear Polynomial detrending; (2) Band-pass filter (0.01~0.1 Hz); (3)
Despking.
• Which first? First generate ROI signal then denoise
• ROI definition:
o atlas image: Yeo 7 networks
o MNI coordinates+radius(sphere): 5 x 4
• Connectivity analysis:
o (1) Pearson Correlation (2)Spearman Correlation
o (3) Pairwise GC (4)Conditional GC (5) Partially conditioned GC

57
• Job14 results:
File Name Description
RAW_FILE_NAME_conn_job.mat
analysis/model parameters
RAW_FILE_NAME_roinfo.mat
Conn_RAW_FILE_NAME_pwGC.mat Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d,
which is considered to be
approximately normal.
(Geweke 1982)
Conn_RAW_FILE_NAME_Corr_Pearson.mat
Matric_r: Pearson/Spearman
correlation coefficient) ,
Matrix_z: Fisher's z transformed
Pearson correlation coefficient,
Matric_pval: p-value (t-test)

RAW_FILE_NAME = sub-10171_task-rest_bold_space-fsaverage5.L.func

58
o Signals based connectivity analysis

The time series analysis module in the matlabbatch is called by clicking the (rsHRF conn)
‘Signals’ button in the main menu.

59
Demo jobs
Batch Editor → Load Batch

Job15: \spm12\toolbox\rsHRF\demo_jobs\sig _FC_GC_job15_v23.mat


This job file included three different jobs, the first two for HRF estimation and deconvolution,
the third one further perform connectivity analysis.
(1,2):
• Input Data:
o dat2
• Denoising: no.
• Which first? No ROI analysis.
• Connectivity analysis: ROI to ROI
o (1) Functional connectivity (FC) : Spearman correlation.
o (2) Granger causality (GC) : Pairwise Granger causality.

60
• Job15 results:
File Name Description
Conn_combROI_RAW_FILE_NAME_job.mat
Deconv2_combROI_RAW_FILE_NAME_job.mat analysis/model parameters
Deconv3_combROI_RAW_FILE_NAME_job.mat
Conn_RAW_FILE_NAME_pwGC.mat
Pairwise GC
GC_Matrix: GC Value
GC_Matrix(x,y) = GC from x to y
pval_Matrix: p-value (F-test)
GC_Matrix_N: transformed GC
N: GC value c is transformed into d,
which is considered to be
approximately normal.
(Geweke 1982)
Conn_RAW_FILE_NAME_Corr_Pearson.mat

Matric_r: Pearson/Spearman
correlation coefficient) ,
Matrix_z: Fisher's z transformed
Pearson correlation coefficient,
Matric_pval: p-value (t-test)

RAW_FILE_NAME = sig_preproc

61
o Display

The HRF visualization module in the matlabbatch is called by clicking the ‘Display’ button in
the main menu.

62
Demo jobs
Batch Editor → Load Batch

Job15: \spm12\toolbox\rsHRF\demo_jobs\rsHRF_viewer_v23.mat
• Underlay Image: an anatomical image, e.g. E:\spm12\canonical\single_subj_T1.nii:
• Statistical Image: (F)T maps.
• HRF mat-files: HRF mat-files generated in voxel-wise HRF analysis
o Group 1: 27 subjects
o Group 2: 33 subjects

click ‘plot’ to generate one voxel HRF plot


(MNI coordinate: [024 24 26], T-value= 4.787)

63
change ‘Radius’ to generate sphere ROI HRF plot

change MNI coordinate (click on the brain or manually edit the coordinates),
(negative/positive) Threshold, cluster size(Extent), Sphere Radius.

64
Standalone demo codes
Some standalone demo codes were designed for the application on two specific examples,
i.e., a sample voxel from the Human Connectome Project (HCP;
HCP_100307_rfMRI_REST1_LR_Atlas_hp2000_clean_dtseries.mat) and Calcium-BOLD data
(calcium_2Hz_15s_stimulation.mat).

o rsHRF_demo_temporal_basis.m

% Demo code for HRF deconvolution (Temporal Basis Functions)


clc,clear;close all;
%%===========BOLD-fMRI Data========================
load HCP_100307_rfMRI_REST1_LR_Atlas_hp2000_clean_dtseries.mat
nobs=size(bold_sig,1);
TR = .72;
bands=[0.01 0.1]; %bandpass filter lower and upper bound
data = rsHRF_band_filter(bold_sig,TR,bands);
sigma = std(data);

%%===========PARAMETERS========================
para.TR = TR;
BF = {'Canonical HRF (with time derivative)'
'Canonical HRF (with time and dispersion derivatives)'
'Gamma functions'
'Fourier set'
'Fourier set (Hanning)'};
% choose the set of basis functions THIS MUST BE AN INPUT
bf_id = 3; % Gamma functions
para.name = BF{bf_id};
para.order = 3; % for Gamma functions or Fourier set
temporal_mask = []; % without mask, it means temporal_mask = logical(ones(nobs,1)); i.e.
all time points included. nobs: number of observation = size(data,1). if want to exclude the
first 1~5 time points, let temporal_mask(1:5)=0;
% temporal_mask = logical(ones(nobs,1)); temporal_mask(5:15)=0;

para.T = 3; % magnification factor of temporal grid with respect to TR. i.e. para.T=1 for no
upsampling, para.T=3 for 3x finer grid
para.T0 = 1; % position of the reference slice in bins, on the grid defined by para.T. For
example, if the reference slice is the middle one, then para.T0=fix(para.T/2)
if para.T==1
para.T0 = 1;
end
para.dt = para.TR/para.T; % fine scale time resolution.
para.AR_lag = 1; % AR(1) noise autocorrelation.
para.thr = 1; % (mean+) para.thr*standard deviation threshold to detect event.
para.len = 24; % length of HRF, in seconds
min_onset_search = 4; % minimum delay allowed between event and HRF onset
(seconds)
max_onset_search = 8; % maximum delay allowed between event and HRF onset
(seconds)
para.lag = fix(min_onset_search/para.dt):fix(max_onset_search/para.dt);
%%=============HRF estimation======================

65
tic

[beta_hrf, bf, event_bold] = rsHRF_estimation_temporal_basis(data,para,temporal_mask);


hrfa = bf*beta_hrf(1:size(bf,2),:); %HRF
nvar = size(hrfa,2); PARA = zeros(3,nvar);
for voxel_id=1:nvar
hrf1 = hrfa(:,voxel_id);
PARA(:,voxel_id) = rsHRF_get_HRF_parameters(hrf1,para.dt); % estimate HRF
parameter
end

toc

%%=============HRF deconvolution======================
disp('Deconvolving HRF ...');
tic
T = round(para.len/TR);
if para.T>1
hrfa_TR = resample(hrfa,1,para.T);
else
hrfa_TR = hrfa;
end
hrf=hrfa_TR;

flag_deconv_raw = 0;
if flag_deconv_raw %HRF deconvolution with raw/filtered data
zdata = zscore(bold_sig);
else
zdata = zscore(data);
end
data_deconv = rsHRF_iterative_wiener_deconv(zdata,hrf./sigma);

event_number=length(event_bold{1,1});
toc
disp('Done');

%% example plots
event_plot=nan(1,nobs);
event_plot(event_bold{1,1})=1;
figure(1);plot((1:length(hrfa(:,1)))*TR/para.T,hrfa(:,1),'b');xlabel('Time (s)')
title(['HRF (',BF{bf_id},')'])
figure(2);plot((1:nobs)*TR,zscore(data(:,1)));
hold on;plot((1:nobs)*TR,zscore(data_deconv(:,1)),'r');
stem((1:nobs)*TR,event_plot,'k');legend('BOLD','Deconvolved BOLD','BOLD
events');xlabel('Time (s)')

66
o rsHRF_demo_FIR_sFIR.m

% Demo code for HRF deconvolution ( (Smooth) Finite Impulse Response estimation)
clc,clear;close all;

%%===========BOLD-fMRI Data========================

load HCP_100307_rfMRI_REST1_LR_Atlas_hp2000_clean_dtseries.mat
nobs=size(bold_sig,1);
TR = .72;
bands=[0.01 0.1]; %bandpass filter lower and upper bound
data = rsHRF_band_filter(bold_sig,TR,bands);
sigma = std(data);
%%===========PARAMETERS========================
para.TR = TR;
BF = {'FIR'
'sFIR'};
bf_id = 1;
para.estimation = BF{bf_id}; % sFIR
temporal_mask = []; % without mask, it means temporal_mask = logical(ones(nobs,1)); i.e.
all time points included. nobs: number of observation = size(data,1). if want to exclude the
first 1~5 time points, let temporal_mask(1:5)=0;
% temporal_mask = logical(ones(nobs,1)); temporal_mask(5:15)=0;
para.T = 1;
para.T0 = 1;
if para.T>1| para.T0>1
para.T = 1; para.T0 = 1;
end
para.dt = para.TR/para.T; % fine scale time resolution.
para.AR_lag = 1; % AR(1) noise autocorrelation.
para.thr = 1; % (mean+) para.thr*standard deviation threshold to detect event.
para.len = 20; % length of HRF, in seconds
min_onset_search = 4; % minimum delay allowed between event and HRF onset
(seconds)
max_onset_search = 8; % maximum delay allowed between event and HRF onset
(seconds)
para.lag = fix(min_onset_search/para.dt):fix(max_onset_search/para.dt);

%%=============HRF estimation======================

tic
[beta_hrf, event_bold] = rsHRF_estimation_FIR(data,para,temporal_mask);
hrfa = beta_hrf(1:end-2,:); %HRF
nvar = size(hrfa,2); PARA = zeros(3,nvar);
for voxel_id=1:nvar
hrf1 = hrfa(:,voxel_id);
PARA(:,voxel_id) = rsHRF_get_HRF_parameters(hrf1,para.dt); % estimate HRF
parameter
end
toc

%%=============HRF deconvolution======================
disp('Deconvolving HRF ...');
tic

67
hrf=hrfa(:,1);

flag_deconv_raw = 1;
if flag_deconv_raw %HRF deconvolution with raw/filtered data
zdata = zscore(bold_sig);
else
zdata = zscore(data);
end
data_deconv = rsHRF_iterative_wiener_deconv(zdata,hrf./sigma);

event_number=length(event_bold{1,1});
toc
disp('Done');

%% example plots
event_plot=nan(1,nobs);
event_plot(event_bold{1,1})=1;
figure(1);plot((1:length(hrfa(:,1)))*TR,hrfa(:,1),'b');xlabel('Time (s)')
title(['HRF (',BF{bf_id},')'])
figure(2);plot((1:nobs)*TR,zscore(data(:,1)));
hold on;plot((1:nobs)*TR,zscore(data_deconv(:,1)),'r');
stem((1:nobs)*TR,event_plot,'k');legend('BOLD','Deconvolved BOLD','BOLD
events');xlabel('Time (s)')

68
o rsHRF_demo_impulseest.m

% Demo code for HRF deconvolution (Nonparametric impulse response estimations)


clc,clear;close all;

%%===========BOLD-fMRI Data========================

load HCP_100307_rfMRI_REST1_LR_Atlas_hp2000_clean_dtseries.mat
bold_sig = double(bold_sig); % double
nobs=size(bold_sig,1);
TR = .72;
bands=[0.01 0.1]; %bandpass filter lower and upper bound
data = rsHRF_band_filter(bold_sig,TR,bands);

%%===========PARAMETERS========================
para.TR = TR;
options = impulseestOptions; % see impulseestOptions.m for help
options.RegularizationKernel = 'none'; %Regularizing kernel, used for regularized
estimates of impulse response for all input-output channels. Regularization reduces
variance of estimated model coefficients and produces a smoother response by trading
variance for bias
para.options = options;
temporal_mask = []; % without mask, it means temporal_mask = logical(ones(nobs,1)); i.e.
all time points included. nobs: number of observation = size(data,1). if want to exclude the
first 1~5 time points, let temporal_mask(1:5)=0;
% temporal_mask = logical(ones(nobs,1)); temporal_mask(5:15)=0;
para.T = 1;
para.T0 = 1;
if para.T>1| para.T0>1
para.T = 1; para.T0 = 1;
end
para.dt = para.TR/para.T; % fine scale time resolution.
para.thr = 1; % (mean+) para.thr*standard deviation threshold to detect event.
para.len = 24; % length of HRF, in seconds
min_onset_search = 5; % minimum delay allowed between event and HRF onset
(seconds)
max_onset_search = 8; % maximum delay allowed between event and HRF onset
(seconds)
para.lag = fix(min_onset_search/para.dt):fix(max_onset_search/para.dt);

%%=============HRF estimation======================
tic
[data,mu,sigma]=zscore(data);
[beta_hrf, event_bold] = rsHRF_estimation_impulseest(data,para);
hrfa = beta_hrf; %HRF
nvar = size(hrfa,2); PARA = zeros(3,nvar);
for voxel_id=1:nvar
hrf1 = hrfa(:,voxel_id);
PARA(:,voxel_id) = rsHRF_get_HRF_parameters(hrf1,para.dt); % estimate HRF
parameter
end
toc
%%=============HRF deconvolution======================
disp('Deconvolving HRF ...');

69
tic
hrf=hrfa(:,1);

flag_deconv_raw = 1;
if flag_deconv_raw %HRF deconvolution with raw/filtered data
zdata = zscore(bold_sig);
else
zdata = data;
end
data_deconv = rsHRF_iterative_wiener_deconv(zdata,hrf);

event_number=length(event_bold{1,1});
toc
disp('Done');

%% example plots
event_plot=nan(1,nobs);
event_plot(event_bold{1,1})=1;
figure(1);plot((1:length(hrfa(:,1)))*TR/para.T,hrfa(:,1),'b');xlabel('Time (s)')
title('HRF (nonparametric impulse response estimation)')
figure(2);plot((1:nobs)*TR,zscore(data(:,1)));
hold on;plot((1:nobs)*TR,zscore(data_deconv(:,1)),'r');
stem((1:nobs)*TR,event_plot,'k');legend('BOLD','Deconvolved BOLD','BOLD
events');xlabel('Time (s)')

70
o rsHRF_demo_voxel_calcium.m

% (Calcium BOLD Data) demo code for HRF deconvolution


clc,clear
%% load calcium data
load('calcium_2Hz_15s_stimulation.mat')

%%===========BOLD-fMRI Data========================
TR = BOLD_time(1);
bands = [0.01 0.1]; %bandpass filter lower and upper bound
data = rsHRF_band_filter(BOLD_calcium',TR,bands);
sigma = std(data);
%%===========PARAMETERS========================
para.TR = TR;

if 1
BF = {'FIR'
'sFIR'};
% choose the set of basis functions THIS MUST BE AN INPUT
bf_id = 1;
para.estimation = BF{bf_id}; % sFIR

para.T = 1;
para.T0 = 1;
if para.T>1| para.T0>1
para.T = 1; para.T0 = 1;
end
flag_FIR = 1;

else

BF = {'Canonical HRF (with time derivative)'


'Canonical HRF (with time and dispersion derivatives)'
'Gamma functions'
'Fourier set'
'Fourier set (Hanning)'};
% choose the set of basis functions THIS MUST BE AN INPUT
bf_id = 2;
para.name = BF{bf_id}; % Gamma functions
para.order = 3; % for Gamma functions or Fourier set

para.T = 1; % magnification factor of temporal grid with respect to TR. i.e. para.T=1 for
no upsampling, para.T=3 for 3x finer grid
para.T0 = 1; % position of the reference slice in bins, on the grid defined by para.T. For
example, if the reference slice is the middle one, then para.T0=fix(para.T/2)
if para.T==1
para.T0 = 1;
end

flag_FIR = 0;
end

71
temporal_mask = []; % without mask, it means temporal_mask = logical(ones(nobs,1)); i.e.
all time points included. nobs: number of observation = size(data,1). if want to exclude the
first 1~5 time points, let temporal_mask(1:5)=0;
% temporal_mask = logical(ones(nobs,1)); temporal_mask(5:15)=0;

para.dt = para.TR/para.T; % fine scale time resolution.


para.AR_lag = 1; % AR(1) noise autocorrelation.
para.thr = 1; % (mean+) para.thr*standard deviation threshold to detect event.

para.len = 24; % length of HRF, in seconds

min_onset_search = 2; % minimum delay allowed between event and HRF onset


(seconds)
max_onset_search = 6; % maximum delay allowed between event and HRF onset
(seconds)
para.lag = fix(min_onset_search/para.dt):fix(max_onset_search/para.dt);

%%=============HRF estimation======================

tic
if flag_FIR
[beta_hrf, event_bold] = rsHRF_estimation_FIR(data,para,temporal_mask,0);
hrfa = beta_hrf(1:end-2,:); %HRF
else
[beta_hrf, bf, event_bold] =
rsHRF_estimation_temporal_basis(data,para,temporal_mask,0);
hrfa = bf*beta_hrf(1:size(bf,2),:); %HRF
end
nvar = size(hrfa,2); PARA = zeros(3,nvar);
for voxel_id=1:nvar
hrf1 = hrfa(:,voxel_id);
PARA(:,voxel_id) = rsHRF_get_HRF_parameters(hrf1,para.dt); % estimate HRF
parameter
end

toc

%%=============HRF deconvolution======================
disp('Deconvolving HRF ...');
tic
T = round(para.len/TR);
if para.T>1
hrfa_TR = resample(hrfa,1,para.T);
else
hrfa_TR = hrfa;
end
hrf=hrfa_TR;

flag_deconv_raw = 1;
if flag_deconv_raw %HRF deconvolution with raw/filtered data
zdata = zscore(BOLD_calcium');
else
zdata = zscore(data);
end

72
data_deconv = rsHRF_iterative_wiener_deconv(zdata,hrf./sigma,100);

event_number=length(event_bold{1,1});
toc
disp('Done');

%% example plots
nobs = size(BOLD_calcium,2);
event_plot=nan(1,nobs);
event_plot(event_bold{1,1})=1;
figure(1);plot((1:length(hrfa(:,1)))*TR/para.T,hrfa(:,1),'b');xlabel('Time (s)')
title(['HRF (',BF{bf_id},')'])
figure('WindowState','maximized');
% plot(BOLD_time,zscore(BOLD_calcium));
hold all;
plot(BOLD_time,zscore(data(:,1)));

plot(BOLD_time,zscore(data_deconv(:,1)),'r');

calcium_time = dt*(0:length(calcium_raw)-1);

plot(calcium_time,zscore(calcium_raw)-5,'g')

stem(trigger_time, trigger_times*0.1, 'y.');


stem((1:nobs)*TR/para.T,event_plot,'k');legend('BOLD(filtered)','Deconvolved
BOLD','calcium','2Hz 15s 2.5mA stimulation','BOLD events');xlabel('Time (s)')
% stem((1:nobs)*TR/para.T,event_plot,'k');legend('BOLD(raw)','Deconvolved
BOLD','calcium','2Hz 15s 2.5mA stimulation','BOLD events');xlabel('Time (s)')

set(gca,'FontSize',15,'FontWeight','Bold');

73
Third-party code
Some parts of the codes are from the third-party toolbox.
o Some HRF basis functions are from SPM toolbox (spm_get_bf.m, spm_hrf.m)
o rsHRF_get_HRF_parameters.m is modified from the HRF Estimation Toolbox
(get_parameters2.m).
o Some subfunctions of rsHRF_mvgc.m are from MVGC Multivariate Granger Causality
MATLAB® Toolbox, including: data_to_autocov.m, autocov_to_var.m, mvgc_pval.m,
mvgc_cdf, dlyap_aitr.m).
o Outliers (detected from HRF parameter response height) are deleted (rsHRF_
deleteoutliers.m) and interpolated (rsHRF_deleteoutliers.m) using deleteoutliers.m
and inpaint_nans3.m.
o The knee_pt.m function is used as an alternative to min() for the rsHRF lag estimation
(rsHRF_knee_pt.m).
o conn_filter.m is a subfunction in rsHRF_band_filter.m for band-pass filtering.

74
Reference
Chen, G., Adleman, N. E., Saad, Z. S., Leibenluft, E., & Cox, R. W. (2014). Applications of
multivariate modeling to neuroimaging group analysis: A comprehensive alternative to
univariate general linear model. NeuroImage, 99, 571-588.
https://doi.org/10.1016/j.neuroimage.2014.06.027
Marinazzo, D., Pellicoro, M., & Stramaglia, S. (2012). Causal information approach to partial
conditioning in multivariate data sets. Computational and mathematical methods in medicine,
2012.
https://doi.org/10.1155/2012/303601
Wu, G. R., Liao, W., Stramaglia, S., Ding, J. R., Chen, H., & Marinazzo, D. (2013). A blind
deconvolution approach to recover effective connectivity brain networks from resting state
fMRI data. Medical Image Analysis, 17(3), 365-374.
https://doi.org/10.1016/j.media.2013.01.003
Wu, G. R., Liao, W., Stramaglia, S., Chen, H., & Marinazzo, D. (2013). Recovering directed
networks in neuroimaging datasets using partially conditioned Granger causality. Brain
connectivity, 3(3), 294-301.
https://doi.org/10.1089/brain.2013.0142
Wu, G. R., & Marinazzo, D. (2015). Retrieving the Hemodynamic Response Function in resting
state fMRI: Methodology and applications.
PeerJ PrePrints. https://peerj.com/preprints/1317
Wu, G. R., & Marinazzo, D. (2016). Sensitivity of the resting-state haemodynamic response
function estimation to autonomic nervous system fluctuations. Philosophical Transactions of
the Royal Society A: Mathematical, Physical and Engineering Sciences, 374(2067), 20150190.
https://doi.org/10.1098/rsta.2015.0190
Geweke, J. (1982). Measurement of linear dependence and feedback between multiple time
series. Journal of the American statistical association, 77(378), 304-313.
https://doi.org/10.1080/01621459.1982.10477803
Tagliazucchi, E., Balenzuela, P., Fraiman, D., & Chialvo, D. R. (2012). Criticality in large-scale
brain fMRI dynamics unveiled by a novel point process analysis. Frontiers in Physiology, 3, 15.
https://doi.org/10.3389/fphys.2012.00015

75

You might also like