readDVH | R Documentation |
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.
readDVH(x,
type=c("Eclipse", "Cadplan", "Masterplan",
"Pinnacle", "Monaco", "HiArt",
"RayStation", "ProSoma", "PRIMO",
"Mirada"),
planInfo=FALSE, courseAsID=FALSE, add, ...)
x |
|
type |
|
planInfo |
Experimental: Either |
courseAsID |
|
add |
|
... |
Additional arguments passed on to |
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, the date is stored as a character string.
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 date
patName
- a character string for patient name
patID
- a character string for patient ID
doseRx
- a character string like "50.4Gy"
for prescription dose in the same dose unit as used in the DVHs
structVol
- a named character vector like c("PTV"=750, "LUNG"=1250)
giving the absolute structure volumes with names equal to structure names
volumeUnit
- 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.csv
variable "Filename"
. They should look like
NumberOfDimensions = 2;
NumberOfPoints = 431;
Points[] ={
0,0
10,0
...
4000,100
};
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:
dvh
matrix
- cumulative DVH values
dvhDiff
matrix
- differential DVH values, only created a) if original file contained a differential DVH or b) by convertDVH
patID
character
string - patient ID
date
character
string - date of DVH export
type
character
string - cumulative or differential DVH
plan
character
string - plan name
course
character
string - course - currently Eclipse only
structure
character
string - structure name
structVol
numeric
- structure volume
doseUnit
character
string - measurement unit dose
volumeUnit
character
string - measurement unit volume
doseRx
numeric
- prescription dose
isoDoseRx
numeric
- iso-dose percentage
doseMin
numeric
- minimum dose from DVH file
doseMax
numeric
- maximum dose from DVH file
doseAvg
numeric
- average dose from DVH file
doseMed
numeric
- median dose from DVH file
doseSD
numeric
- dose standard deviation from DVH file
Sys.glob
,
readLines
,
print.DVHs
,
showDVH
,
getMetric
,
checkConstraint
,
convertDVH
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.