MriImage-class {tractor.base} | R Documentation |
The MriImage class
Description
This class represents an MRI image. An object of this class is made up of
some voxel data, stored as a sparse or dense numeric array, and some
metadata, such as the file it was read from, the voxel dimensions, and so
on. The group generic functions Math
, Ops
and
Summary
are defined for this class, as are methods for
coercing to and from a standard array
.
Fields
imageDims
Integer vector of dimensions
voxelDims
Numeric vector of pixel/voxel spacings
voxelDimUnits
Character vector of spatial and/or temporal spacing units. Millimetres and seconds (i.e., c("mm","s")) are typical
source
String naming the file(s) that the image was read from. This is reset to the empty string if the image is modified
origin
Numeric vector giving the spatial coordinate origin
xform
Numeric matrix giving the NIfTI-style xform matrix associated with the image, which indicates its orientation
reordered
Logical value indicating whether the image has been reordered. See
reorderMriImage
tags
Named list of arbitrary DICOM-style tags
data
Sparse or dense array of data, or
NULL
Methods
apply(...)
Apply a function to the margins of the image
binarise()
Binarise the image by setting nonzero values to one
fill(value)
Fill the image with a particular value
find(fun = NULL, ..., array = TRUE)
Find voxels whose values are not zero, or satisfy a function
getDataAtPoint(...)
Obtain the value of the image at a particular point
getMetadata()
Obtain a version of the image with any data removed
getNonzeroIndices(array = TRUE, positiveOnly = FALSE)
Find voxels whose values are not zero
getSlice(dim, loc)
Extract data from a slice of the image along one dimension
getSparseness()
Obtain the proportion of zeroes in the image
getTags(keys = NULL)
Retrieve some or all of the tags stored with the image
getXform(implicit = TRUE)
Retrieve the stored or implicit xform matrix
map(fun, ..., sparse = NULL)
Replace the current data with the result of a function
mask(maskImage)
Mask the image, setting zero voxels in the mask to zero
setData(newData)
Replace the data in the image
setOrigin(newOrigin)
Update the origin of the image
setSource(newSource)
Update the source of the image
setTags(..., merge = FALSE)
Add, replace or merge metadata tags
setXform(newXform)
Update the xform matrix associated with the image
summarise()
Summarise key aspects of the object
threshold(level, defaultValue = 0)
Threshold the image by setting values below the threshold level to zero