Learn R Programming

neurobase (version 1.32.4)

write_nifti: General NIfTI Writer

Description

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

Usage

write_nifti(nim, filename, ...)

Value

Output from NIfTI writer

Arguments

nim

Container for NIfTI Image

filename

Filename of image to be written out

...

additional arguments, to be passed to writeNifti or writenii

Examples

Run this code
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)

Run the code above in your browser using DataLab