create a proper antsImage sub-image by indexing the image with indices. this is similar to but different from array sub-setting in that the resulting sub-image can be decropped back into its place without having to store its original index locations explicitly.

cropIndices(image, lowerind, upperind)

Arguments

image

antsImage to crop

lowerind

vector of lower index, should be length image dimensionality

upperind

vector of upper index, should be length image dimensionality

Value

subimage

Author

Brian B. Avants, Nicholas J. Tustison

Examples


fi <- antsImageRead(getANTsRData("r16"))
cropped <- cropIndices(fi, c(10, 10), c(100, 100))
cropped <- smoothImage(cropped, 5)
decropped <- decropImage(cropped, fi)