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)
})

Try the fslr package in your browser

Any scripts or data that you put into this service are public.

fslr documentation built on May 29, 2024, 2:31 a.m.