Learn R Programming

DVHmetrics (version 0.4.2)

getMeanDVH: Point-wise mean DVH with point-wise SDs

Description

Returns the point-wise mean and median DVH with the point-wise standard deviation for a given list of input DVHs. Other point-wise measures may be calculated as well.

Usage

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

Arguments

x

A single DVH (object of class DVHs), multiple DVHs from one patient/structure (object of class DVHLst), or multiple DVHs from many patients/structures (object of class DVHLstLst). See readDVH.

fun

Named list of functions that should be applied to yield 1 point-wise DVH measure. Functions must have exactly 1 return value.

cumul

logical. Get point-wise mean and SD for cumulative or differential (per unit dose) DVH?

thin

numeric. The number of DVH nodes (dose values) is reduced by 1/thin of the maximum number of nodes in x before interpolating and averaging.

byPat

logical. Relevant if multiple DVHs are given. byPat=TRUE means that for each patient, DVHs for multiple structures are averaged point wise. byPat=FALSE means that for each structure, DVHs for multiple patients averaged point wise.

patID

character vector. Include DVHs for these patients only when calculating mean/SD. If missing, all patients are used. Can be a regular expression with fixed=FALSE, see regex.

structure

character vector. Include DVHs for these structures only when calculating mean/SD. If missing, all structures are used. Can be a regular expression with fixed=FALSE, see regex.

fixed

logical. Use fixed=FALSE for regular expression matching of patID and structure.

returnDVHObj

logical. With returnDVHObj=TRUE, a regular DVH object is returned. In that case, fun may only have one component for calculating either the point-wise mean or median.

Value

By default (returnDVHObj=FALSE) returns a data frame with point-wise mean DVH averaged over structures (byPat=TRUE) or over patients (byPat=FALSE) including the point-wise 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.

Details

Before calculating the point-wise mean and SD, DVHs in x are first linearly interpolated with convertDVH using the same set of nodes.

See Also

showDVH, convertDVH

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab