R: Creating MriImage objects from data

asMriImage {tractor.base} | R Documentation

## Creating MriImage objects from data

### Description

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).

### Usage

    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)

### Arguments

`data` | An array of pixel/voxel data.
`templateImage` | An optional `MriImage` object, to be used as a metadata template.
`imageDims, voxelDims, voxelDimUnits, origin, tags, reordered` | Metadata for the new image object. These values override any from the metadata object or data array. See `MriImage` class documentation for details.
`image` | An `MriImage` object.
`dim, loc` | The dimension and location along that dimension for which data should be extracted.
`clearance` | The number of voxels' clearance left around a trimmed image.
`indices` | A list of indices to keep along each dimension. Determined from the specified `clearance` if `NULL`.

### Details

`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.

### Value

An `MriImage` object.

### Author(s)

Jon Clayden

### 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

`MriImage`

[Package tractor.base version 3.2.2 Index]