Learn R Programming

neuroim (version 0.0.6)

writeVolume: Generic function to write a 3D image volume to disk

Description

Generic function to write a 3D image volume to disk

Usage

writeVolume(x, fileName, format, dataType)
"writeVolume"(x, fileName)
"writeVolume"(x, fileName)
"writeVolume"(x, fileName, format)
"writeVolume"(x, fileName, dataType)

Arguments

x
an image object, typically a BrainVolume instance.
fileName
output file name
format
file format string. Since "NIFTI" is the only currently supported format, this parameter can be safely ignored and omitted.
dataType
output data type, If specified should be a character vector of: "BINARY", "UBYTE", "SHORT", "INT", "FLOAT", "DOUBLE". Otherwise output format will be inferred from R the datatype of the image.

Details

The output format will be inferred from file extension.

The output format will be inferred from file extension. writeVolume(x, "out.nii") outputs a NIFTI file. writeVolume(x, "out.nii.gz") outputs a gzipped NIFTI file. No other file output formats are currently supported.

Examples

Run this code

bvol <- BrainVolume(array(0, c(10,10,10)), BrainSpace(c(10,10,10), c(1,1,1)))
## Not run: 
# writeVolume(bvol, "out.nii")
# writeVolume(bvol, "out.nii.gz")
# ## End(Not run)

Run the code above in your browser using DataLab