antsImageClone: Clone an 'antsImage'.

View source: R/antsImageClone.R

antsImageCloneR Documentation

Clone an antsImage.

Description

Clone an image object of S4 class antsImage. N.B.: You cannot use a <- img because the R assignment operator does not deal with the underlying C++ pointers.

Usage

antsImageClone(in_image, out_pixeltype = in_image@pixeltype)

Arguments

in_image

image object of S4 class antsImage to be cloned.

out_pixeltype

C++ datatype to be used to represent the pixels in the output image. Allowed values: double, float, unsigned int, unsigned char.

Value

object of class antsImage

Author(s)

Shrinidhi KL

Examples


img <- antsImageRead(getANTsRData("r16"), 2)
img2 <- antsImageClone(img)
img.int <- antsImageClone(img, "unsigned int")
multi <- antsImageRead(getANTsRData("multi_component_image"))
img <- antsImageRead(getANTsRData("r16"), 2)
m2 <- antsImageClone(multi)


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