R/fslvol.R

Defines functions fslvol

Documented in fslvol

#' @title FSL Volume in mL (or cubic centimeters)
#' @description This function wraps \code{\link{fslsum}} and 
#' \code{\link{voxdim}}
#' @param file (character) filename of image to be checked
#' @param ... options passed to \code{\link{fslsum}}
#' @return Numeric value of volume in mL
#' @note This may be approximate due to rounding
#' @export
fslvol <- function(file, ...){
  file = checkimg(file)
  res = fslsum(file, ...)
  
  vdim = prod(voxdim(file))
  vol = res * vdim / 1000
  return(vol)
}

Try the fslr package in your browser

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

fslr documentation built on Aug. 25, 2022, 5:07 p.m.