newMriImageWithData {tractor.base}R Documentation

Functions for creating MriImage objects from data

Description

Functions for creating MriImage objects from data.

Usage

newMriImageWithData(data, metadata)
newMriImageFromTemplate(image, ...)

newMriImageByExtraction(image, dim, loc)
newMriImageByMasking(image, mask)
newMriImageByThresholding(image, level, defaultValue = 0)

newMriImageAsShapeOverlay(type = c("cross", "block"), baseImage, ...)
generateImageDataForShape(type = c("cross", "block"), dim, background = 0, centre = NA, width = NA)

newMriImageWithSimpleFunction(image, fun, ..., newDataType = NULL)
newMriImageWithBinaryFunction(image1, image2, fun, ..., newDataType = NULL)

Arguments

data An array of voxel data.
metadata An MriImageMetadata object.
image, image1, image2 MriImage objects.
dim, loc For newMriImageByExtraction, the dimension and location along that dimension for which data should be extracted. For generateImageDataForShape, dim is the dimensions of the image. newMriImageAsShapeOverlay takes this from the baseImage.
mask An array of mode logical indicating which voxels are in the mask. Must have the same dimensions as the image.
level A numeric value specifying the threshold level.
defaultValue The value of the final image in voxels which are below threshold.
type The shape type to generate. A "block" is a cubic region of the image; a "cross" is the central line of the cube in each dimension.
baseImage The MriImage to use as a base for the overlay.
background The voxel value outside the shape.
centre, width The centre and width of the shape.
newDataType The data type of the new image. If NULL, then the data type is the same as the source image.
fun A function object, taking one or two numeric array parameters, as appropriate.
... For newMriImageFromTemplate, further parameters to newMriImageMetadataFromTemplate. For newMriImageAsShapeOverlay, further parameters to generateImageDataForShape. And for newMriImageWithSimpleFunction and newMriImageWithBinaryFunction, further parameters to fun.

Details

All of these functions use data from arrays or MriImage objects to create a new MriImage object. newMriImageWithData is the basic function for creating an object from its constituents: an array of voxel values and an MriImageMetadata object. newMriImageFromTemplate takes an existing image, with its voxel data, and creates a new image, possibly with modifications to the metadata.

newMriImageByExtraction reduces the dimensionality of the source image by one, by extracting a single "line" of data along one dimension. newMriImageByMasking modifies the data by masking out unwanted voxels, and newMriImageByThresholding by thresholding. newMriImageAsShapeOverlay creates an image which contains a simple shape. newMriImageWithSimpleFunction and newMriImageWithBinaryFunction modify the image data by applying an arbitrary function to it. Any function that can be applied to numeric arrays, and expects one or two arguments, respectively, is suitable for fun.

Value

An MriImage object.

Author(s)

Jon Clayden

See Also

MriImage


[Package tractor.base version 1.3.0 Index]