R/sizeof_hdr.R

#' @docType methods
#' @rdname sizeof_hdr-methods
#' @title Extract Image sizeof_hdr attribute 
#' @name sizeof_hdr-methods
#' @aliases sizeof_hdr,character-method
#' @import oro.nifti
#' @export
#' @description `sizeof_hdr` method for character types
#' @param object is a filename to pass to \link{fslval}
#' 
setMethod("sizeof_hdr", "character", function(object) { 
  object = path.expand(object)
  stopifnot(file.exists(object))
  res = fslval(object, keyword = "sizeof_hdr", verbose = FALSE)
  res = as.numeric(res)
  return(res)
})
muschellij2/fslr documentation built on Aug. 31, 2022, 8:47 p.m.