View source: R/estimate_template.R
estimate_template | R Documentation |
Estimate template for Template ICA based on fMRI data
estimate_template(
BOLD,
BOLD2 = NULL,
GICA,
mask = NULL,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
TR = NULL,
hpf = 0.01,
GSR = FALSE,
Q2 = 0,
Q2_max = 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_template.cifti(
BOLD,
BOLD2 = NULL,
GICA,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
TR = NULL,
hpf = 0.01,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
brainstructures = "all",
resamp_res = resamp_res,
keep_S = FALSE,
keep_FC = FALSE,
FC = FALSE,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
estimate_template.gifti(
BOLD,
BOLD2 = NULL,
GICA,
inds = NULL,
scale = c("local", "global", "none"),
scale_sm_surfL = NULL,
scale_sm_surfR = NULL,
scale_sm_FWHM = 2,
TR = NULL,
hpf = 0.01,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
brainstructures = "all",
keep_S = FALSE,
keep_FC = FALSE,
FC = FALSE,
varTol = 1e-06,
maskTol = 0.1,
missingTol = 0.1,
usePar = FALSE,
wb_path = NULL,
verbose = TRUE
)
estimate_template.nifti(
BOLD,
BOLD2 = NULL,
GICA,
inds = NULL,
scale = c("local", "global", "none"),
TR = NULL,
hpf = 0.01,
GSR = FALSE,
Q2 = 0,
Q2_max = NULL,
mask = NULL,
keep_S = FALSE,
keep_FC = FALSE,
FC = FALSE,
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 |
GICA |
Group ICA maps in a format compatible with New: can also be a parcellation in CIFTI format (other formats to be implemented in the future). The parcellation should have the same locations 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 group ICs to include in the template. If
If |
scale |
|
scale_sm_surfL , scale_sm_surfR , scale_sm_FWHM |
Only applies if
If If To create a |
TR |
The temporal resolution of the data, i.e. the time between volumes,
in seconds. |
hpf |
The frequency at which to apply a highpass filter to the data
during pre-processing, in Hertz. Default: The highpass filter serves to detrend the data, since low-frequency variance is associated with noise. Highpass filtering is accomplished by nuisance regression of discrete cosine transform (DCT) bases. Note the |
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 |
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 template? Default: |
FC_nPivots |
Number of pivots to use in Cholesky-based FC template estimation. Set to zero to skip Cholesky-based FC template 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 GICA
) must
be in the same spatial resolution.
A list: the template
and var_decomp
with entries in
matrix format; the mask
of locations without template 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 template
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 template results, and
for CIFTI-format data use plot
to plot the template mean and variance
estimates. Use export_template
to save the templates 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)})
GICA <- mU
estimate_template(BOLD=BOLD, GICA=mU, FC_nSamp=2000)
## Not run:
estimate_template(
run1_cifti_fnames, run2_cifti_fnames,
gICA_cifti_fname, brainstructures="all",
scale="global", TR=0.71, Q2=NULL, varTol=10
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.