getMeanDVH {DVHmetrics}  R Documentation 
Returns the pointwise mean and median DVH with the pointwise standard deviation for a given list of input DVHs. Other pointwise measures may be calculated as well.
getMeanDVH(x, fun=list(mean=mean, median=median, sd=sd),
cumul=TRUE, thin=1, byPat=TRUE, patID=NULL, structure=NULL,
fixed=TRUE, returnDVHObj=FALSE)
## S3 method for class 'DVHs'
getMeanDVH(x, fun=list(mean=mean, median=median, sd=sd),
cumul=TRUE, thin=1, byPat=TRUE, patID=NULL, structure=NULL,
fixed=TRUE, returnDVHObj=FALSE)
## S3 method for class 'DVHLst'
getMeanDVH(x, fun=list(mean=mean, median=median, sd=sd),
cumul=TRUE, thin=1, byPat=TRUE, patID=NULL, structure=NULL,
fixed=TRUE, returnDVHObj=FALSE)
## S3 method for class 'DVHLstLst'
getMeanDVH(x, fun=list(mean=mean, median=median, sd=sd),
cumul=TRUE, thin=1, byPat=TRUE, patID=NULL, structure=NULL,
fixed=TRUE, returnDVHObj=FALSE)
x 
A single DVH (object of class 
fun 
Named 
cumul 

thin 

byPat 

patID 

structure 

fixed 

returnDVHObj 

Before calculating the pointwise mean and SD, DVHs in x
are first linearly interpolated with convertDVH
using the same set of nodes.
By default (returnDVHObj=FALSE
) returns a data frame with pointwise mean DVH averaged over structures (byPat=TRUE
) or over patients (byPat=FALSE
) including the pointwise standard deviation or other measures as controlled by fun
. With returnDVHObj=TRUE
, a DVH object is returned that is equivalent to a DVH as imported from a file. In particular, functions like showDVH
or getMetric
can be used on such an object.
res1 < getMeanDVH(dataMZ, byPat=TRUE, structure=c("HEART", "AMYOCL"))
head(res1)
# average differential DVHs
# matches patients P123 and P234
res2 < getMeanDVH(dataMZ, fun=list(min=min, max=max),
cumul=FALSE, byPat=FALSE,
patID="23", fixed=FALSE)
head(res2)