Learn R Programming

oro.nifti (version 0.11.4)

magic-methods: Extract Image Attribute magic

Description

Methods that act on the magic field in the NIfTI/ANALYZE header.

Usage

magic(object)

# S4 method for nifti magic(object)

magic(object) <- value

# S4 method for nifti magic(object) <- value

# S4 method for niftiImage magic(object)

# S4 method for niftiImage magic(object) <- value

Arguments

object

is an object of class nifti or anlz.

value

is the value to assign to the magic field.

Author

John Muschelli muschellij2@gmail.com,
Brandon Whitcher bwhitcher@gmail.com

Details

See documentation on the ANALYZE and/or NIfTI data standards for more details.

References

ANALYZE 7.5
http://eeg.sourceforge.net/ANALYZE75.pdf
NIfTI-1
http://nifti.nimh.nih.gov/

Examples

Run this code
file = system.file("extdata", "example.nii.gz", package = "RNifti")
img = RNifti::readNifti(file)
magic(img)
magic(img) = "ni1"
stopifnot(magic(img) == "ni1")
magic(img) = "n+1"
stopifnot(magic(img) == "n+1")
magic(img) = "r" # bad magic
stopifnot(magic(img) == "")

Run the code above in your browser using DataLab