Just helpful wrapper to convert to array and then take values for which mask is 1

ants.extract(img, mask)

Arguments

img

image either in array or class antsImage

mask

binary image either in array or class antsImage

Value

Numeric vector