dose volume histograms - cerr/CERR GitHub Wiki

Computing DVHs in CERR

CERR can recompute DVHs as well as display and analyze DVHs that have been imported from treatment planning systems using the RTOG/AAPM protocol.

To compute or analyze a DVH, first access the DVH option under the Metrics menu:

Image:Dvhmenu1m.jpg

This opens the DVH figure. We select the structure and dose distribution to create a new DVH.

Image:Dvhmenu2.png

The columns denote the following:

  • Vol - volume histogram
  • Surf - surface area histogram. Surface points are selected at an interval along polygon structure contours at a distances not more than the parameter optS.DSHMaxPointInterval (in cm) in CERROptions.m.
  • Avg - averages volume and surface area (OK, not my best idea).
  • Abs - Absolute (in cubic cm's) or relative (fractional) volumes.
  • Comp - does the result exist in planC yet?
  • planID - RTOG field, often not used but may refer to one in a series of dose plans.
  • fractionGroupID - RTOG field, often not used but may refer to one in a series of components of a treatment.
  • Dose Index - index within the dose cell array to the dose actually used as the basis for the DVH. If the dose is changed, this is changed to N-A (not applicable).
  • Structure Index - index within the structure cell array to the structure actually used as the basis for the DVH. If the structure is changed, this is changed to N-A (not applicable).
  • dateOfDVH - gives the date of computation if computed within CERR.

Selecting the cumulative plot opens to DVH figure:

Image:DvhPlot3.png

Values on the DVH curve can be interrogated interactively by selecting 'Expanded Options':

Image:dvhPlot4.png

For the selected DVH curve (highlighted with rectangles) various data is given, including the value of the curve at the cursor-defined dose level.

Of course, once a DVH has been generated in CERR, various aspects of the plot can be modified using Matlab tools. To do this, first select 'Edit Plot' from the Tools menu of the figure. Then you can use the mouse to select, for example, the plot axis. Select 'current object properties' under the Edit menu to see and change various figure properties.

Each time a CERR DVH is computed, some basic statistics are output to the Matlab main window. For example:

 -----------------------
 Structure is:  Brain
 Mean dose is:  7.2118
 Total volume is:  1349.1839 cubic cm.
 Max dose is:  67.7931
 Min dose is:  0.18472
 -----------------------

How CERR computes DVHs

For the purpose of DVH computations, CERR makes the fundamental assumption that structures can be approximated as small volumes associated with the image scan. Values associated with DVH computations are computed by sampling doses at voxel centers. I decided early on that CERR should use an algorithm that determines whether the scan plane center of each and every imaging voxel is inside or outside of the associated polygon mask. This requirement has, we believe, always been maintained. Many polygon to mask scan conversion algorithms (in fact, most) do not have this property, and some speed had to be sacrificed to achieve it. DVHs are then computed by associating the volume of each voxel with the dose linearly interpolated for the center of that voxel. Voxels of course fill all space and therefore will therefore be asymetric in the longitudinal direction about the scan plane if the z (longitudinal) spacing changes at that plane. Thus, the algorithm produces voxels categorized like this:

Image:StructureMask.png:

We do not claim this is the 'right' way to compute a DVH. The topic is inherently ambiguous. However, we believe (OK, *I* believe) this method is the most reasonable as it is very unambiguous and is not clearly in error.

The algorithm can 'fail' at a few points if the polygon makes a bend within a voxel and only partly includes the voxel. However, we don't consider this a problem as the polygon uncertainty is clearly on the order of 1 voxel near a bend.

There is no interpolation outside slices that do not have polygon contours. There is a natural jaggedness that comes from using z-defined contours to define truly 3-D volumes. In this version of CERR, structures can also be defined using 3-D meshes, but DVHs are still computed based on polygon contours.

Dosimetric validation of CERR recomputed DVHs

CERR rcomputes DVHs in addition to saving original treatment planning system DVHs. CERR generally keeps all information generated or computed, as it is a research system not a clinical planning system. The accuracy of CERR Version 2 DVH calculations was checked in detail by Konstantin Zakaryan as compared to NOMOS Peacock plans and was reported via a poster display at the AAPM 2003 meeting:

Zakarian C, Deasy J, Blanco A, “Dosimetric validation of CERR version 2” Med Phys 30 (6):1508-1508 (2003). The original poster can be viewed here: [[image:Dosimetric_validation_cerr_zakarian2.pdf]|Poster].

Althouugh agreement for most planning systems examined has been excellent (generally < 1% differences by eye), agreement is not always guaranteed. The poster shows a 10% disagreement compared to a Helax generated DVH based on an anonymized archive supplied by a collaborator. Upon review, we believe this was due to a difference in how the DVHs were actually computed for that particular planning system.

Typical agreement is within 1%, for example this comparison between CERR and Nomos for a H&N plan (the CERR DVH results are plotted as broken lines of the same color as the various structures -- see the poster for details):

Image:dvhnomos4.png

Since then, CERR has been informally checked against a wide-variety of treatment planning systems. We are currently updating this comparison more rigorously versus both Pinnacle and Eclipse.

Programmatic access to DVHs in CERR

Here is an example of accessing DVH data in CERR. First, let's see where things are stored:

 >> global planC
 >> planC{end}
 ans = 
           header: 1
          comment: 2
             scan: 3
       structures: 4
   structureArray: 5
     beamGeometry: 6
             dose: 7
              DVH: 8
      digitalFilm: 9
      CERROptions: 10
            beams: 11
              IVH: 12
      RTTreatment: 13
               IM: 14
        importLog: 15
        planParam: 16
     seedGeometry: 17
           indexS: 18

Now let's index into the DVH cell. Most of the planC cells are struct arrays, meaning there is an array of similar objects that have all the same keywords or 'metadata'. For the DVH array we get the keywords as follows:

 >> planC{planC{end}.DVH}
 ans = 
 1x13 struct array with fields:
   imageNumber
   imageType
   caseNumber
   patientName
   structureName
   doseUnits
   doseType
   volumeType
   numberOfPairs
   maximumNumberPairs
   numberRepresentation
   planIDOfOrigin
   fractionIDOfOrigin
   doseScale
   volumeScale
   dateOfDVH
   DVHMatrix
   doseIndex
   dvhUID
   assocStrUID
   assocDoseUID

Let's take a closer look at the metadata for the first structure:

 >> planC{planC{end}.DVH}(1)
 ans = 
            imageNumber: 80
              imageType: 'DOSE VOLUME HISTOGRAM'
             caseNumber: 'head_neck_ex1_20may03'
            patientName: 'head_neck_ex1_20may03'
          structureName: 'Brain'
              doseUnits: 'GRAYS'
               doseType: 'ABSOLUTE'
             volumeType: 'ABSOLUTE'
          numberOfPairs: 201
     maximumNumberPairs: 1000
   numberRepresentation: 'CHARACTER'
         planIDOfOrigin: 'Display Results'
     fractionIDOfOrigin: ''
              doseScale: ''
            volumeScale: ''
              dateOfDVH: ''
              DVHMatrix: [201x2 double]
              doseIndex: ''
                 dvhUID: 'DH.1772007.8555.447405.7062'
            assocStrUID: 'RS.1772007.8555.447606.8426'
           assocDoseUID: ''

Note that DVHs have unique IDs that allow CERR to correctly associate with a dose distribution and a structure. If the structure changes due to contouring this link is broken and this is explicitly shown in the DVH menu. As shown, it is not known which dose distribution gave rise to this DVH as it was imported. UIDs are not available directly from the DICOM or RTOG input; they are assigned within CERR (I believe this is an oversight in current export protocols.).

 >> planC{planC{end}.DVH}(1).DVHMatrix(1:10,:)
 ans =
        0  675.4759
   0.3694  107.1960
   0.7389   58.7880
   1.1083   40.2720
   1.4778   23.2600
   1.8472   12.8520
   2.2167   10.3840
   2.5861   11.7760
   2.9556    9.2080
   3.3250    9.7840
 >>

Here we have the thing itself: each first column element is the minimum dose of that dose bin, assumed to stretch to the minimum dose of the next bin. Each second column element is the volume, usually in cubic centimeters (cc's) of the volume of the structure with a dose at least as large as the minimum bin dose. The keyword pair .volumeType : 'ABSOLUTE' indicates the volumes are in cc's, rather than relative fractional volumes. Thus, the contoured brain of this (anonymous) patient is 0.675 liters in volume.

Of course, these values can be transferred to a Matlab matrix for further manipulation, for example by invoking:

 >> volVector  = planC{planC{end}.DVH}(1).DVHMatrix(:,1);
 >> doseVector = planC{planC{end}.DVH}(1).DVHMatrix(:,2);