#' @rdname pixdim-methods
#' @title Extract Image pixdim attribute
#' @description Gets pixdim from an antsImage
#'
#' @aliases pixdim,antsImage-method
#' @param object is an antsImage
#'
#' @importFrom oro.nifti pixdim
#' @importMethodsFrom oro.nifti pixdim
#'
#' @return Vector of numeric values
#' @export
#' @examples
#' library(ANTsRCore)
#' fn <- getANTsRData( "r16" )
#' fi <- antsImageRead( fn )
#' pixdim(fi)
setMethod("pixdim", signature(object = "antsImage"), function(object){
pdim = c(0, antsGetSpacing(object))
pdim = c(pdim, rep(1, length = max(0, 8 - length(pdim))))
return(pdim)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.