unique.Rd
Overloaded uniqueness operation for antsImage objects
# S3 method for class 'antsImage'
unique(x, incomparables = FALSE, mask = NULL, ...)
is an object of class antsImage
.
a vector of values that cannot be compared.
binary mask of values to subset
additional arguments passed to unique
img <- antsImageRead(getANTsRData("r16"))
img[img > 5] <- 0
sort(unique(img))
#> [1] 0 1 2 3 4 5