Given a postprocessed BOLD NIfTI file and one or more atlas images, this function computes the mean timeseries within each ROI and optionally computes ROI-to-ROI correlation matrices.
Arguments
- bold_file
Path to a 4D NIfTI file containing postprocessed BOLD data.
- atlas_files
Character vector of atlas NIfTI files with integer ROI labels.
- out_dir
Directory where output files should be written.
- log_file
If not
NULL
, the log file to which details should be written.- cor_method
Correlation method(s) to use when computing functional connectivity. Supported options include "pearson", "spearman", "kendall", and "cor.shrink". Use "none" to skip correlation computation. Multiple methods may be supplied.
- roi_reduce
Method used to summarize voxel time series within each ROI. Options are "mean" (default), "median", "pca", or "huber".
- brain_mask
Optional brain mask NIfTI file. If
NULL
, a mask is generated by excluding voxels with zero variance across time.- min_vox_per_roi
The minimum number of voxels required for an ROI to be extracted and entered into correlations. If the ROI is smaller than this, it show up as NA in the outputs, keeping the dimensionality of the connectivity matrix consistent across inputs. Default:
5
- save_ts
If
TRUE
, save the ROI time series (aggregated usingroi_reduce
method) to_timeseries.tsv
. files. Useful for running external analyses on the ROIs. Default:TRUE
.- rtoz
If
TRUE
, using Fisher's z (aka atanh) transformation on correlations to make them continuous and unbounded, rather than[0,1]
. The diagonal of the correlation matrices beccomes 15 to approximate the 1.0 correlation, rather than making itInf
.- overwrite
If
TRUE
, overwrite existing timeseries.tsv or connectivity.tsv files.