imagesToMatrix: Read Images into a Matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

Read images into rows of a matrix.

Usage

1
imagesToMatrix(imageList, mask)

Arguments

imageList

A character vector containing a list of image files to read, in order.

mask

An antsImage containing a binary mask, voxels in the mask are placed in the matrix.

Value

A matrix containing the masked data, the result of calling as.numeric(image, mask) on each input image.

Author(s)

Cook PA

See Also

matrixToImages, getMask

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

  imageList = list.files("/mnt/data/brains", pattern = "\.nii\.gz$", full.names = TRUE)

  mask = getMask("/mnt/data/masks/brainmask.nii.gz")

  mat = imagesToMatrix(imageList, mask)


## End(Not run)

stnava/itkImageR documentation built on May 30, 2019, 7:21 p.m.