write_nifti: General NIfTI Writer

Description Usage Arguments Value Examples

View source: R/write_nifti.R

Description

Writes out NIfTI files for multiple formats. Currently, for nifti objects and niftiImage objects from RNifti

Usage

1
write_nifti(nim, filename, ...)

Arguments

nim

Container for NIfTI Image

filename

Filename of image to be written out

...

additional arguments, to be passed to writeNifti or writenii

Value

Output from NIfTI writer

Examples

1
2
3
4
5
6
7
8
set.seed(5)
dims = rep(10, 4)
arr = array(rpois(prod(dims), lambda = 2), dim = dims)
nim = oro.nifti::nifti(arr)
tfile = tempfile(fileext = ".nii.gz")
write_nifti(nim, tfile)
rimg = RNifti::readNifti(tfile)
write_nifti(rimg, tfile)

neuroconductor/neurobase documentation built on May 19, 2021, 5:24 a.m.