convert types to an antsMatrix

as.antsMatrix(object, elementtype = "float", ...)

# S4 method for list
as.antsMatrix(object, elementtype = "float")

# S4 method for data.frame
as.antsMatrix(object, elementtype = "float")

# S4 method for matrix
as.antsMatrix(object, elementtype = "float")

Arguments

object

An object

elementtype

e.g. "float" or "double"

...

other parameters

Examples

as.antsMatrix(matrix(rnorm(10), nrow=2))
#> An object of class "antsMatrix" #> Slot "elementtype": #> [1] "float" #> #> Slot "pointer": #> <pointer: 0x7f9941e29610> #>
mat = matrix(rnorm(10), nrow=2) df = as.data.frame(mat) as.antsMatrix(df)
#> An object of class "antsMatrix" #> Slot "elementtype": #> [1] "float" #> #> Slot "pointer": #> <pointer: 0x7f9941d58fa0> #>
as.antsMatrix(as.list(df))
#> An object of class "antsMatrix" #> Slot "elementtype": #> [1] "float" #> #> Slot "pointer": #> <pointer: 0x7f995cfae370> #>