antsImageTypeCast: Cast images to either a passed pixeltype or the most precise...

View source: R/antsImageTypeCast.R

antsImageTypeCastR Documentation

Cast images to either a passed pixeltype or the most precise of the inputs

Description

Cast images to either a passed pixeltype or the most precise of the inputs

Usage

antsImageTypeCast(imageList, pixeltype = NA)

Arguments

imageList

list of images

pixeltype

to cast to

Value

list of antsImages

Author(s)

J Duda

Examples


img <- antsImageRead(getANTsRData("rand")) %>% resampleImage(c(32, 32))
img2 <- antsImageRead(getANTsRData("rand"), pixeltype = "double") %>%
  resampleImage(c(32, 32))
allDoubles <- antsImageTypeCast(list(img, img2))
floats <- antsImageTypeCast(list(img))
pixeltype(img) <- "unsigned int"
ints <- antsImageTypeCast(list(img))


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