Learn R Programming

tractor.base (version 2.3.0)

visualisation: Visualise MriImage objects

Description

Visualise MriImage objects noninteractively using an R graphics device. See viewImages for an interactive alternative.

Usage

createCombinedGraphics(images, modes, colourScales, axes = 1:3, sliceLoc = NULL,
                         device = c("internal", "png"), alphaImages = NULL,
                         prefix = "image", zoomFactor = 1, filter = "Mitchell",
                         windowLimits = NULL, clearance = NULL, nColumns = NULL)

createProjectionGraphic(image, axis, device = c("internal", "png"), colourScale = 1, add = FALSE, file = NULL, zoomFactor = 1, filter = "Mitchell", windowLimits = NULL)

createSliceGraphic(image, x = NA, y = NA, z = NA, device = c("internal", "png"), colourScale = 1, add = FALSE, file = NULL, zoomFactor = 1, filter = "Mitchell", windowLimits = NULL)

createContactSheetGraphic(image, axis, device = c("internal", "png"), colourScale = 1, add = FALSE, file = NULL, zoomFactor = 1, filter = "Mitchell", windowLimits = NULL, clearance = NULL, nColumns = NULL)

Arguments

images
A list of MriImage objects.
image
A single MriImage object.
modes
A character vector of the same length as images, each element being "slice" or "projection" (or abbreviations), indicating which type of visualisation should be applied to each image.
colourScale, colourScales
A single colour scale definition, or a list in the plural case. See getColourScale.
axis, axes
A vector of axes along which slice/projection images should be created. 1 is left-right, 2 is anterior-posterior, 3 is superior-inferior.
x, y, z
Integer vectors, each of length 1. Exactly one of these must be specified to indicate the plane of interest.
sliceLoc
Like x, y and z, except that a point in 3 dimensions is specified. Must not be NA for each axis requested.
device
Either "internal" for display on the default graphics device, or "png" for creating PNG format image file(s). Abbreviations are fine.
alphaImages
A list of MriImage objects to be used as transparency masks. Must be the same length as images if not NULL. NULL values in the list indicate no mask.
prefix, file
A file name or prefix (to which "axial", "coronal" or "sagittal" will be added) to be used when device is "png".
zoomFactor
Factor by which to enlarge the image. Applies only when device is "png".
filter
Interpolation filter to be used by ImageMagick.
windowLimits
Numeric vector of length 2 giving the limits of the colour scale, or NULL for limits matching the range of the image data. Passed as the zlim argument to image.
clearance
Number of voxels' clearance to leave around each slice image in the contact sheet. Passed to newMriImageByTrimming.
nColumns
Number of slices per row in the contact sheet grid. If NULL, the function will aim for a square grid.
add
Overlay the graphic on a previous one. Used only when device is "internal".

Value

  • These functions are called for their side effects.

Details

These functions create 2D visualisations of 3D images by slicing or maximum intensity projection.

NB: When the device option is set to "png", ImageMagick is required by these functions.

References

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. http://www.jstatsoft.org/v44/i08/.

See Also

See viewImages for an interactive alternative, and getColourScale for details of how colour scales are specified. Also image, which is used as the underlying plot function.