Functions for creating MriImage objects from data, including other images.
All of these functions use data from arrays or MriImage
objects to
create a new MriImage
object. asMriImage
is the basic fucntion
for creating an object from its constituents: an array of voxel values and
some metadata (and/or a template image).
asMriImage(data, templateImage = nilObject(), imageDims = NA,
voxelDims = NA, voxelDimUnits = NA, origin = NA, tags = NA,
reordered = NA)extractMriImage(image, dim, loc)
trimMriImage(image, clearance = 4, indices = NULL)
reorderMriImage(image)
An MriImage
object.
An array of pixel/voxel data.
An optional MriImage
object, to be used as a
metadata template.
Metadata for
the new image object. These values override any from the metadata object
or data array. See MriImage
class documentation for
details.
An MriImage
object.
The dimension and location along that dimension for which data should be extracted.
The number of voxels' clearance left around a trimmed image.
A list of indices to keep along each dimension. Determined
from the specified clearance
if NULL
.
Jon Clayden
extractMriImage
reduces the dimensionality of the source image by
one, by extracting a single ``slice'' of data along one dimension.
trimMriImage
trims empty space from the edges of an image, reducing
the dimensions of the image and thus avoiding the storage of lots of zeroes.
reorderMriImage
reorders the image data (and corresponding metadata)
to the LAS convention, an operation which is usually performed when an
image is read from file.
Please cite the following reference when using TractoR in your work:
J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. https://www.jstatsoft.org/v44/i08/.
MriImage