write_afni-methods: writeAFNI

Description Usage Arguments Details Value Methods Author(s) References See Also Examples

Description

This function saves a afni-class object to HEAD/BRIK pair in AFNI format.

Usage

1
2
3
4
writeAFNI(nim, ...)

## S4 method for signature 'afni'
writeAFNI(nim, fname, verbose = FALSE, warn = -1)

Arguments

nim

is an object of class afni.

...

Additional variables defined by the method.

fname

is the path and file name to save the AFNI file (.HEAD/BRIK) without the suffix.

verbose

is a logical variable (default = FALSE) that allows text-based feedback during execution of the function.

warn

is a number to regulate the display of warnings (default = -1). See options for more details.

Details

The writeAFNI function utilizes the internal writeBin and writeLines command to write information to header/binary file pair.

Current acceptable data types include

INT16"

DT SIGNED SHORT (16 bits per voxel)

FLOAT32"

DT FLOAT (32 bits per voxel)

"COMPLEX128"

DT COMPLEX (128 bits per voxel)

Value

Nothing.

Methods

nim = "afni"

Write AFNI volume to disk.

nim = "ANY"

Not implemented.

Author(s)

Karsten Tabelow karsten.tabelow@wias-berlin.de

References

AFNI
http://afni.nimh.nih.gov/pub/dist/src/README.attributes

See Also

writeANALYZE, writeNIfTI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Taken from the AFNI Matlab Library
## http://afni.nimh.nih.gov/pub/dist/data/afni_matlab_data.tgz
afni.path <- system.file("afni", package="oro.nifti")
orig <- readAFNI(file.path(afni.path, "ARzs_CW_avvr.DEL+orig"))
fname = file.path(tempdir(), "test-afni-image")
writeAFNI(orig, fname, verbose=TRUE)

data <- readAFNI(fname, verbose=TRUE)
image(orig, zlim=c(0.5,256), oma=rep(2,4), bg="white")
image(data, zlim=c(0.5,256), oma=rep(2,4), bg="white")
abs.err <- abs(data - orig)
image(as(abs.err, "nifti"), zlim=range(0,1), oma=rep(2,4),
      bg="white")

neuroconductor-devel/oro.nifti documentation built on May 6, 2021, 1:49 p.m.