Learn R Programming

ANTsR (version 1.0)

maskImage: Mask input image by mask image.

Description

Mask an input image by a mask image. If the mask image has multiple labels, it is possible to specify which label(s) to mask at.

Usage

maskImage(img.in, img.mask, level=1, binarize = FALSE )

Arguments

img.in

Input image.

img.mask

Mask or label image.

level

Level at which to mask image.

binarize

binarize the output image

Value

An object of type antsImage.

Examples

Run this code
# NOT RUN {
  myimg <- antsImageRead(getANTsRData("ch2"), 3)
  mylab <- antsImageRead(getANTsRData("ch2a"), 3)
  myimg.mask <- maskImage(myimg, mylab, 3)
  plotANTsImage(myimg.mask, axis=3, slices="90x90x90")
  myimg.mask <- maskImage(myimg, mylab, list( 1,  3, 9 ) )
# }

Run the code above in your browser using DataLab