Learn R Programming

BayesBrainMap (version 0.1.3)

export_prior: Export prior

Description

Export the priors (mean, variance, and FC) as separate files for visualization or processing outside of BayesBrainMap.

Usage

export_prior(x, out_fname = NULL, var_method = c("non-negative", "unbiased"))

Value

If is.null(out_fname), the priors in data matrix, "xifti", or "nifti" format, to match the format of the original BOLD data. Otherwise, the paths to the new files specified by out_fname. If prior includes functional connectivity components, the FC prior and its mean and variance will be included.

Arguments

x

The result of estimate_prior

out_fname

Use NULL (default) to just return the prior objects directly. Otherwise, use a character vector of length 3 or 4 of file path(s) to save the output to: the mean prior, the variance prior, the variance decomposition, and the FC prior if present, in that order. If one file name is provided, it will be appended with "_mean.[file_ext]" for the prior mean map, "_var.[file_ext]" for the prior variance map, "_varDecomp.rds" for the variance decomposition, and "_FC.rds" where [file_ext] will be "dscalar.nii" for CIFTI input, "nii" for NIFTI input, and "rds" for data input.

var_method

"non-negative" (default) or "unbiased"

Examples

Run this code
if (FALSE) {
 tm <- estimate_prior(cii1_fnames, cii2_fnames, gICA_fname, usePar=FALSE)
 export_prior(tm, out_fname="my_prior", var_method="unbiased")
}

Run the code above in your browser using DataLab