write.nifti1: Write header and data to a file in NIFTI v1 format.

View source: R/write_nifti1.R

write.nifti1R Documentation

Write header and data to a file in NIFTI v1 format.

Description

Write header and data to a file in NIFTI v1 format.

Usage

write.nifti1(filepath, niidata, niiheader = NULL, ...)

Arguments

filepath

the file to write. The extension should be '.nii' or '.nii.gz'.

niidata

array of numeric or integer data, with up to 7 dimensions. Will be written to the file with the datatype and bitpix specified in the 'niiheader' argument. Set to ‘NULL' and pass a ’niiheader' to write only the header, and remember to adapt 'magic' in the header.

niiheader

an optional NIFTI v1 header that is suitable for the passed 'niidata'. If not given, one will be generated with ni1header.for.data.

...

additional parameters passed to ni1header.for.data. Only used if 'niiheader' is 'NULL'.

See Also

Other nifti1 writers: write.fs.morph.ni1()


freesurferformats documentation built on May 29, 2024, 5:29 a.m.