BayesGLM_cifti {BayesfMRI} | R Documentation |
BayesGLM for CIFTI
Description
Performs spatial Bayesian GLM on the cortical surface for fMRI task activation
Usage
BayesGLM_cifti(
cifti_fname,
surfL_fname = NULL,
surfR_fname = NULL,
brainstructures = c("left", "right"),
design = NULL,
onsets = NULL,
TR = NULL,
nuisance = NULL,
dHRF = c(0, 1, 2),
dHRF_as = c("auto", "nuisance", "task"),
hpf = NULL,
DCT = if (is.null(hpf)) {
4
} else {
NULL
},
resamp_res = 10000,
task_names = NULL,
session_names = NULL,
combine_sessions = TRUE,
scale_BOLD = c("auto", "mean", "sd", "none"),
scale_design = TRUE,
Bayes = TRUE,
ar_order = 6,
ar_smooth = 5,
aic = FALSE,
num.threads = 4,
return_INLA = c("trimmed", "full", "minimal"),
verbose = 1,
meanTol = 1e-06,
varTol = 1e-06
)
Arguments
cifti_fname |
fMRI timeseries data in CIFTI format ("*.dtseries.nii").
For single-session analysis this can be a file path to a CIFTI file or a
|
surfL_fname |
Left cortex surface geometry in GIFTI format
("*.surf.gii"). This can be a file path to a GIFTI file or a |
surfR_fname |
Right cortex surface geometry in GIFTI format
("*.surf.gii"). This can be a file path to a GIFTI file or a |
brainstructures |
Character vector indicating which brain structure(s)
to analyze: |
design , onsets , TR |
Either provide
|
nuisance |
(Optional) A |
dHRF , dHRF_as |
Only applicable if Set If |
hpf , DCT |
Add DCT bases to Default: Using at least two DCT bases is as sufficient as using linear and quadratic
drift terms in the design matrix. So if DCT detrending is being used, there
is no need to add linear and quadratic drift terms to |
resamp_res |
The number of vertices to which each cortical surface
should be resampled, or |
task_names |
(Optional) Names of tasks represented in design matrix. |
session_names |
(Optional, and only relevant for multi-session modeling)
Names of each session. Default: |
combine_sessions |
If multiple sessions are provided, should their data be combined and analyzed as a single session? If |
scale_BOLD |
Option for scaling the BOLD response.
|
scale_design |
Scale the design matrix by dividing each column by its
maximum and then subtracting the mean? Default: |
Bayes |
If |
ar_order |
(numeric) Controls prewhitening. If greater than zero, this
should be a number indicating the order of the autoregressive model to use
for prewhitening. If zero, do not prewhiten. Default: |
ar_smooth |
(numeric) FWHM parameter for smoothing the AR model
coefficient estimates for prewhitening. Remember that
|
aic |
Use the AIC to select AR model order between |
num.threads |
The maximum number of threads to use for parallel
computations: prewhitening parameter estimation, and the inla-program model
estimation. Default: |
return_INLA |
Return the INLA model object? (It can be large.) Use
|
verbose |
Should updates be printed? Use |
meanTol , varTol |
Tolerance for mean and variance of each data location.
Locations which do not meet these thresholds are masked out of the analysis.
Default: |
Value
An object of class "BayesGLM_cifti"
: a list with elements
- betas_Bayesian
The task coefficients for the Bayesian model.
- betas_classical
The task coefficients for the classical model.
- GLMs_Bayesian
The entire list of GLM results, except for parameters estimated for the classical model.
- GLMs_classical
Parameters estimated for the classical model from the GLM.
- session_names
The names of the sessions.
- n_sess_orig
The number of sessions (before averaging, if applicable).
- task_names
The task part of the design matrix, after centering and scaling, but before any nuisance regression or prewhitening.
INLA latent fields limit
INLA computation times increase greatly when the number of columns in the
design matrix exceeds five. So if there are more than five tasks, or
three or more tasks each with its temporal derivative being modeled as a
task, BayesGLM
will raise a warning. In cases like the latter, we
recommend modeling the temporal derivatives as nuisance signals using the
nuisance
argument, rather than modeling them as tasks.
Connectome Workbench Requirement
This function uses a system wrapper for the 'wb_command' executable. The user must first download and install the Connectome Workbench, available from https://www.humanconnectome.org/software/get-connectome-workbench .
INLA Requirement
This function requires the INLA
package, which is not a CRAN package.
See https://www.r-inla.org/download-install for easy installation instructions.