This function reads files in NIfTI-1 or NIfTI-2 format into R, using the
standard NIfTI C library. It extends the equivalent function from the
RNifti
package with source and target image parameters.
readNifti(file, source = NULL, target = NULL, internal = FALSE)
An array or internal image, with class "niftiImage"
, and
possibly also "internalImage"
.
A character vector of file names.
If the specified file
contains a transformation,
these parameters can be used to specify the associated source and target
images, which are stored in attributes of the same name. Only used if
file
is of unit length.
Logical value. If FALSE
(the default), an array
of class "niftiImage"
, containing the image pixel or voxel values,
will be returned. If TRUE
, the return value will be an object of
class "internalImage"
, which contains only minimal metadata about
the image. Either way, the return value has an attribute which points to a
C data structure containing the full image.
Jon Clayden <code@clayden.org>