These methods provide shorthand access to metadata elements from the NIfTI header corresponding to an image. The extraction version returns the corresponding element from the result of niftiHeader, while the replacement version calls asNifti to replace it.

# S3 method for niftiImage
$(x, name)

# S3 method for niftiImage
$(x, name) <- value

Arguments

x

A "niftiImage" object, internal or otherwise.

name

A string naming the field required.

value

A new value for the field.

See also

Author

Jon Clayden <code@clayden.org>

Examples

im <- readNifti(system.file("extdata", "example.nii.gz", package="RNifti"))
print(im$descrip)
#> [1] "TractoR NIfTI writer v3.0.0"