imageListToMatrix: Read Images into a Matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

Read images into rows of a matrix.

Usage

1
imageListToMatrix(imageList, mask)

Arguments

imageList

A character vector containing a list of image files to read, in order - these are image objects, not file names.

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, Avants B

See Also

matrixToImages, getMask

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

  imageFNList <- list.files("./", pattern = glob2rx("testView*.nii.gz"), full.names = TRUE)
  
  imageList<-list()
  for ( fn in imageFNList ) 
    imageList<-lappend( imageList, antsImageRead( fn, 3 ) )

  mask <- antsImageRead("/mnt/data/masks/brainmask.nii.gz",3)

  mat <- imageListToMatrix(imageList, mask)


## End(Not run)

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