cropIndices: crop a sub-image by image indices

View source: R/cropImage.R

cropIndicesR Documentation

crop a sub-image by image indices

Description

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.

Usage

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(s)

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)


stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.