export_template: Export template

View source: R/export_template.R

export_templateR Documentation

Export template

Description

Export the templates (mean and variance) as separate files for visualization or processing outside of templateICAr.

Usage

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

Arguments

x

The result of estimate_template

out_fname

Use NULL (default) to just return the template objects directly. Otherwise, use a character vector of length 3 or 4 of file path(s) to save the output to: the mean template, the variance template, the variance decomposition, and the FC template if present, in that order. If one file name is provided, it will be appended with "_mean.[file_ext]" for the template mean map, "_var.[file_ext]" for the template 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"

Value

If is.null(out_fname), the templates 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.

Examples

## Not run: 
 tm <- estimate_template(cii1_fnames, cii2_fnames, gICA_fname)
 export_template(tm, out_fname="my_template", var_method="unbiased")

## End(Not run)


templateICAr documentation built on Feb. 16, 2023, 8:14 p.m.