| readDVH {DVHmetrics} | R Documentation |
Read DVH text files
Description
Reads single or multiple DVH text files as exported from Varian Eclipse(TM), CadPlan(TM), OnCentra MasterPlan(TM), Philipps Pinnacle3 (TM), Elekta Monaco (TM), Tomo HiArt (TM), RaySearch Labs RayStation (TM), or Medcom ProSoma (TM). Supports cumulative and differential DVHs.
Usage
readDVH(x,
type=c("Eclipse", "Cadplan", "Masterplan",
"Pinnacle", "Monaco", "HiArt",
"RayStation", "ProSoma", "PRIMO"),
planInfo=FALSE, courseAsID=FALSE, add, ...)
Arguments
x |
|
type |
|
planInfo |
Experimental: Either |
courseAsID |
|
add |
|
... |
Additional arguments passed on to |
Details
Absolute dose values need to be given in Gy, cGy, or eV/g for uncalibrated dose in DVHs exported by PRIMO. Absolute volume values need to be given in in cm^3.
Differential DVHs are automatically converted to cumulative DVHs, but the differential DVH information is kept.
Sum plans are supported.
For Eclipse starting with version 13, the date format is locale dependent as it uses words for day and month. Importing those dates as class Date requires that the correct locale is set (see Sys.setlocale), and that files containing accents are read using the correct encoding (see above). Otherwise, date is stored as a character string.
For RayStation, only cumulative DVHs with absolute volume are currently supported. Volume is assumed to be measured in cm^3.
For files with absolute volume exported from Masterplan and Tomo HiArt, you can specify volume_from_dvh=TRUE if the structure volume should be guessed from the maximal volume given in the DVH for each structure.
Since files from HiArt, ProSoma and PRIMO do not contain info on patient ID, the current workaround is to generate a random ID.
To export data from Tomo HiArt, copy to clipboard and then save to file from a text editor. Support for Tomo HiArt files is currently limited to those with absolute dose. Please send an anonymized sample file if you need to read files with relative dose. You can provide a list hiart with more information about patients and structures. The list should have one component for each file you import. Each component itself has to be a named list with optional components
date- a character string like"2022-01-16"for the datepatName- a character string for patient namepatID- a character string for patient IDdoseRx- a character string like"50.4Gy"for prescription dose in the same dose unit as used in the DVHsstructVol- a named character vector likec("PTV"=750, "LUNG"=1250)giving the absolute structure volumes with names equal to structure namesvolumeUnit- a character string, either"CC"or"cm3", for the structure volume unit)
The same approach can be used for RayStation files with a list raystation.
Pinnacle3 files have to be exported using its own scripting facility such that information from one patient is contained in one directory. A suitable export script is available on request from the package authors. The directory layout for one patient has to be as follows (experimental, likely to change in future versions):
Files (CSV format with column headers):
DoseInfo.csv(variables"PrescriptionDose cGy","NumberOfFractions","Dosis cGy")PatInfo.csv(variables"LastName","FirstName","MedicalRecordNumber")PlanInfo.csv(variable"PlanName")
Directory:
Data:Info.csv(variables"Filename","RegionOfInterestName","DoseMin cGy","DoseMax cGy","DoseMean cGy","Volume ccm")DVH1.csv, DVH2.csv, ... - the actual DVH data files with names defined in
Info.csvvariable"Filename". They should look likeNumberOfDimensions = 2; NumberOfPoints = 431; Points[] ={ 0,0 10,0 ... 4000,100 };
Value
Returns an object of class DVHLstLst. This is a list (one component with class DVHLst for each original file from one patient) of lists (each component is an object of class DVHs). A DVHs object is a list with the following components:
dvhmatrix- cumulative DVH valuesdvhDiffmatrix- differential DVH values, only created a) if original file contained a differential DVH or b) byconvertDVHpatIDcharacterstring - patient IDdatecharacterstring - date of DVH exporttypecharacterstring - cumulative or differential DVHplancharacterstring - plan namecoursecharacterstring - course - currently Eclipse onlystructurecharacterstring - structure namestructVolnumeric- structure volumedoseUnitcharacterstring - measurement unit dosevolumeUnitcharacterstring - measurement unit volumedoseRxnumeric- prescription doseisoDoseRxnumeric- iso-dose percentagedoseMinnumeric- minimum dose from DVH filedoseMaxnumeric- maximum dose from DVH filedoseAvgnumeric- average dose from DVH filedoseMednumeric- median dose from DVH filedoseSDnumeric- dose standard deviation from DVH file
See Also
Sys.glob,
readLines,
print.DVHs,
showDVH,
getMetric,
checkConstraint,
convertDVH
Examples
## Not run:
# pick DVH files interactively
res <- readDVH()
res
# read all txt files in subdirectory DVH
res <- readDVH("DVH/*.txt", type="Eclipse")
res
## End(Not run)