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

Description Usage Arguments Details Examples

Description

Generic function to write a 3D image volume to disk

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
writeVolume(x, fileName, format, dataType)

## S4 method for signature 'BrainVolume,character,missing,missing'
writeVolume(x, fileName)

## S4 method for signature 'ClusteredBrainVolume,character,missing,missing'
writeVolume(x,
  fileName)

## S4 method for signature 'BrainVolume,character,character,missing'
writeVolume(x, fileName,
  format)

## S4 method for signature 'BrainVolume,character,missing,character'
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

1
2
3
4
5
6
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)

neuroim documentation built on May 2, 2019, 1:04 p.m.