as_ANTsImage | R Documentation |
'ANTsImage'
classLoad data as 'ANTsImage'
class
as_ANTsImage(x, strict = FALSE)
x |
data to be converted; this can be an |
strict |
whether |
An 'ANTsImage'
instance; use ants$ANTsImage
to see
the 'Python' documentation
if(interactive() && ants_available()) {
ants <- load_ants()
# Python string
x1 <- ants$get_ants_data('r16')
as_ANTsImage( x1 )
# R character
nii_path <- system.file(package = "RNifti",
"extdata", "example.nii.gz")
as_ANTsImage( nii_path )
# niftiImage object
x2 <- RNifti::readNifti(nii_path)
as_ANTsImage( x2 )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.