maskImage.Rd
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.
maskImage(img.in, img.mask, level = 1, binarize = FALSE)
An object of type antsImage.
myimg <- antsImageRead(getANTsRData("r16"))
mask <- getMask(myimg)
myimg.mask <- maskImage(myimg, mask, 3)
myimg.mask <- maskImage(myimg, mask)
seg <- kmeansSegmentation(myimg, 3)
myimg.mask <- maskImage(myimg, seg$segmentation, c(1, 3))