View source: R/estimate_prior.R
estimate_prior | R Documentation |
Estimate prior for Bayesian brain mapping based on fMRI data
estimate_prior(
BOLD,
BOLD2 = NULL,
template,
mask = NULL,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
nuisance = NULL,
scrub = NULL,
drop_first = 0,
hpf = 0,
TR = NULL,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
covariates = NULL,
brainstructures = "all",
resamp_res = NULL,
keep_S = FALSE,
keep_FC = FALSE,
FC = TRUE,
FC_nPivots = 100,
FC_nSamp = 50000,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
estimate_prior.cifti(
BOLD,
BOLD2 = NULL,
template,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
nuisance = NULL,
scrub = NULL,
drop_first = 0,
hpf = 0,
TR = NULL,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
brainstructures = "all",
resamp_res = resamp_res,
keep_S = FALSE,
keep_FC = FALSE,
FC = TRUE,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
estimate_prior.gifti(
BOLD,
BOLD2 = NULL,
template,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
nuisance = NULL,
scrub = NULL,
drop_first = 0,
hpf = 0,
TR = NULL,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
brainstructures = "all",
keep_S = FALSE,
keep_FC = FALSE,
FC = TRUE,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
estimate_prior.nifti(
BOLD,
BOLD2 = NULL,
template,
inds = NULL,
scale = c("local", "global", "none"),
nuisance = NULL,
scrub = NULL,
drop_first = 0,
hpf = 0,
TR = NULL,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
mask = NULL,
keep_S = FALSE,
keep_FC = FALSE,
FC = TRUE,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
BOLD , BOLD2 |
Vector of subject-level fMRI data in one of the following
formats: CIFTI file paths, If |
template |
Group-level template: either a group ICA (GICA), or a parcellation. A GICA should be provided as a format compatible with A parcellation must be in CIFTI format for use with CIFTI BOLD data (other formats to be implemented in the future). The parcellation should have the same locations as the BOLD and one column, with integer values indicating the parcel to which each location belongs to. Each parcel is modeled as a brain map; instead of the first step of dual regression, the medial timecourse of each parcel is used. |
mask |
Required if |
inds |
Numeric indices of the networks in If |
scale |
|
scale_sm_surfL , scale_sm_surfR , scale_sm_FWHM |
Only applies if
If If To create a |
nuisance |
(Optional) Nuisance matrices to regress from the BOLD data.
Should be a list of matrices, with time along the rows and nuisance signals
along the columns, where each entry corresponds to a Nuisance regression is performed in a simultaneous regression with any spike
regressors from Note that the nuisance matrices should be provided with timepoints matching
the original |
scrub |
(Optional) Numeric vectors of integers giving the indices
of volumes to scrub from the BOLD data. (List the volumes to remove, not the
ones to keep.) Should be a list of such vectors, where each entry
corresponds to a Scrubbing is performed within a nuisance regression by adding a spike regressor to the nuisance design matrix for each volume to scrub. Note that indices are counted beginning with the first index in the
|
drop_first |
(Optional) Number of volumes to drop from the start of each
BOLD session. Default: |
hpf |
The frequency at which to apply a highpass filter to the data
during pre-processing, in Hertz. Default: Note the |
TR |
The temporal resolution of the data, i.e. the time between volumes,
in seconds. |
GSR |
Center BOLD across columns (each image)? This
is equivalent to performing global signal regression. Default:
|
Q2 , Q2_max |
Obtain dual regression estimates after denoising? Denoising is based on modeling and removing nuisance ICs. It may result in a cleaner estimate for smaller datasets, but it may be unnecessary (and time-consuming) for larger datasets. Set If |
covariates |
Subjects by variables numeric matrix of covariates to take
into account for model estimation. Column names should give the name of each
variable. Default: |
brainstructures |
Only applies if the entries of |
resamp_res |
Only applies if the entries of |
keep_S |
Keep the DR estimates of S? If |
keep_FC |
Keep the DR estimates of the FC cor(A)? If |
FC |
Include the functional connectivity prior? Default: |
FC_nPivots |
Number of pivots to use in Cholesky-based FC prior estimation. Set to zero to skip Cholesky-based FC prior estimation. Default: 100. |
FC_nSamp |
Number of FC matrix samples to generate across all pivots. This should be a multiple of FC_nPivots. |
varTol |
Tolerance for variance of each data location. For each scan,
locations which do not meet this threshold are masked out of the analysis.
Default: |
maskTol |
For computing the dual regression results for each subject:
tolerance for number of locations masked out due to low
variance or missing values. If more than this many locations are masked out,
a subject is skipped without calculating dual regression. If |
missingTol |
For computing the variance decomposition across all subjects:
tolerance for number of subjects masked out due to low variance or missing
values at a given location. If more than this many subjects are masked out,
the location's value will be |
usePar , wb_path |
Parallelize the DR computations over subjects? Default:
|
verbose |
Display progress updates? Default: |
All fMRI data (entries in BOLD
and BOLD2
, and template
) must
be in the same spatial resolution.
A list: the prior
and var_decomp
with entries in
matrix format; the mask
of locations without prior values due to
too many low variance or missing values; the function params
such as
the type of scaling and detrending performed; the dat_struct
which can be
used to convert prior
and var_decomp
to "xifti"
or
"nifti"
objects if the BOLD
format was CIFTI or NIFTI data;
and DR results if isTRUE(keep_S)
and/or isTRUE(keep_FC)
.
Use summary
to print a description of the prior results, and
for CIFTI-format data use plot
to plot the prior mean and variance
estimates. Use export_prior
to save the priors to
individual RDS, CIFTI, or NIFTI files (depending on the BOLD
format).
nT <- 21
nV <- 140
nQ <- 6
mU <- matrix(rnorm(nV*nQ), nrow=nV)
mS <- mU %*% diag(seq(nQ, 1)) %*% matrix(rnorm(nQ*nT), nrow=nQ)
BOLD <- list(B1=mS, B2=mS, B3=mS)
BOLD <- lapply(BOLD, function(x){x + rnorm(nV*nT, sd=.05)})
template <- mU
estimate_prior(BOLD=BOLD, template=mU, FC_nSamp=2000, usePar=FALSE)
## Not run:
estimate_prior(
run1_cifti_fnames, run2_cifti_fnames,
gICA_cifti_fname, brainstructures="all",
scale="global", TR=0.71, Q2=NULL, varTol=10,
usePar=FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.