Kitware Source Feature Article: January 2010

Exporting Contours to DICOM-RTSTRUCT
The “radiotherapy structure set” (RTSTRUCT) object of the DICOM standard is used for the transfer of patient structures and related data, between the devices found within and outside the radiotherapy department. It contains mainly the information for regions of interest (ROIs) and points of interest (e.g., dose reference points). In many cases, rather than manually drawing these ROIs on the CT images, one can indeed benefit from the wealth of automated segmentation algorithms available in ITK. But at present, it is not possible to export the ROIs obtained from ITK to RTSTRUCT format. In order to bridge this gap, we have developed a framework for exporting contour data to RTSTRUCT [1].

RTSTRUCT
The mandatory modules contained by the RTSTRUCT are presented in Table 1. These modules are grouped based on the type of information entity that they represent. Here is a brief description of each of these modules:

  1. “Patient Module” specifies the attributes that describe and identify the patient who is the subject of a diagnostic study. This module contains attributes of the patient that are needed for diagnostic interpretation of the image and are common for all studies performed on the patient.
  2. “General Study Module” specifies the attributes that describe and identify the study performed upon the patient.
  3. “RT Series Module” has been created to satisfy the requirements of the standard DICOM query/retrieve model.
  4. “General Equipment Module” specifies the attributes that identify and describe the piece of equipment that produced a series of composite instances.
  5. “Structure Set Module” defines a set of areas of significance. Each area can be associated with a frame of reference and zero or more images. Information which can be transferred with each ROI includes geometrical and display parameters, and generation technique.
  6. “ROI Contour Module” is used to define the ROI as a set of contours. Each ROI contains a sequence of one or more contours, where a contour is either a single point (for a point ROI) or more than one point (representing an open or closed polygon).
  7. “RT ROI Observations Module” specifies the identification and interpretation of an ROI specified in the Structure Set and ROI Contour modules, and “SOP (Service-Object Pair) Common Module” defines the attributes which are required for proper functioning and identification of the associated SOP Instances. They do not specify semantics about the real-world object represented by the IOD.

[2] contains a comprehensive documentation of the DICOM standard covering all the modules. Refer to [1] for a brief summary of the RTSTRUCT.

RTSTRUCT Mandatory Modules
Table 1: Mandatory Modules of RTSTRUCT.

Implementation
Figure 1 illustrates the pipeline that we use for exporting the automated segmentation results to RTSTRUCT format. It mainly contains three steps: Automated Segmentation, Mask to Contour Conversion and RTSTRUCT-Exporter.

Pipeline Block Diagram
Figure 1: Block diagram illustrating the pipeline for exporting the automated segmentation results to RTSTRUCT.

  • Automated Segmentation: The input DICOM CT images are converted into a convenient image format (if required) and an automated segmentation is performed using ITK or similar tools. The output ROIs from this tool should be a mask. There can be multiple masks corresponding to different structures of interest and the current program indeed allows for the export of multiple masks. It is also possible to export the ROIs obtained on images that are cropped along z-axis; in such cases, the information of starting-slice-number and the number of slices used should be later passed to the RTSTRUCT-exporter module. The output of this module is passed to the “mask to contour converter”.
  • Mask to Contour Conversion: We first extract axial slices of the mask using ExtractImageFilter of ITK. We then use the ContourExtractor2DImageFilter [3] from ITK, for obtaining contours on each of these slices. We finally create an output text file containing the information of total number of contours, coordinates of each contour-point along with the corresponding slice number, number of contour points for each contour and type of geometry of each contour (open or closed).
  • RTSTRUCT-Exporter: Exporting the contours to RTSTRUCT format requires the implementation of RTSTRUCT-Writer. We implemented this in a class called “RTSTRUCTIO”. For creating instances of RTSTRUCTIO objects using an object factory, “RTSTRUCTIOFactory” class is also implemented. Refer to [1] for a detailed description of class-design and key implementation issues.

The inputs to the RTSTRUCT-Exporter are:

  • An axial slice of the DICOM CT image of the patient (for extracting the information that is common to both CT image and RTSTRUCT, as described in [1]).
  • Output(s) of the “Mask to Contour Converter” (multiple contours can be exported, as described in [1]).
  • Few additional inputs like starting slice number with respect to the original image, total number of slices to be considered, ROI interpreted types and the colors to be assigned to each ROI.

All of these parameters are passed to the RTSTRUCT-Exporter through a text file.

Example
The DICOM CT image used in this paper is acquired during routine clinical practice at Divisions of Radiotherapy, Fribourg Hospital (HFR) in Switzerland. The image is acquired on GE Medical System (Model: LightSpeedRT16). The size of each slice is 512 × 512 pixels with a spacing of 1.27 mm × 1.27 mm; the inter-slice distance is 2.5 mm. There are 116 slices in total.

Since we are interested only in the first 83 slices of the patient’s image, the original DICOM image is cropped in the Z-direction to contain only these slices, and a new image file (with .mhd extension) is created. The image is then thresholded in selected regions for removing the bed and other immobilization devices. Figure 2 shows the thresholded image. We created separate masks for the external-contour and bones through simple windowing of the image, as shown in Figure 2. These masks are shown in Figures 3 and 4. The contours of these masks are obtained using the “Mask to Contour Convertor”. The contour data, along with a slice of the DICOM CT image and other information, is passed to the RTSTRUCT-Exporter using a parameter-file. Figure 5 shows the resultant RTSTRUCT file superposed over the original DICOM CT image.

Conclusions & Future Work
An ITK implementation of the RTSTRUCT-Exporter is presented. The details of the pipeline used and description of each module in the pipeline is presented. The implementation is validated on a 3D CT image, by exporting the ROIs of the external-contour and bones to RTSTRUCT format.

We would also like to mention the recent work of Dowling et al. [4] that presents a method to do the reverse, i.e., importing the contours from the RTSTRUCT. It would be interesting to integrate these two implementations. RTSTRUCT-Exporter is currently tested only on the DICOM CT images acquired from a GE Medical System (Model: LightSpeedRT16). A thorough testing on more images, acquired from various manufacturers and models, will make it more robust.

3D CT Image
Figure 2: Sagittal, Coronal and Axial views of the 3-D CT image of the Patient. This is a cropped image containing
only the first 83 slices of the original image.


External-Contour CT Image
Figure 3: Sagittal, Coronal and Axial views of the mask for external-contour of the 3-D CT image.

Masks of Bones
Figure 4: Sagittal, Coronal and Axial views of the mask for bones of the 3-D CT image.

Bones and Contours
Figure 5: A screen-shot showing the contours of the external-contour and bones in the RTSTRUCT file,
superposed over the original DICOM CT image.

Acknowledgments
This work is supported in part by the Swiss National Science Foundation under Grant 3252B0-107873, 205321-124797, and by the Center for Biomedical Imaging (CIBM) of the Geneva--Lausanne Universities and the EPFL, as well as the foundations Leenaards and Louis-Jeantet. We thank Dr. A. S. Allal, Dr. Pierre-Alain Tercier and Dr. Pachoud Marc for providing us the data and helping us in testing. We thank Mathieu Malaterre for his valuable suggestions.

References
[1] S. Gorthi, M. Bach Cuadra, and J.-P. Thiran, “Exporting contours to DICOM-RT Structure Set,” Insight Journal, 2009.
     [Online] hdl.handle.net/1926/1521
[2] “DICOM home page.” [Online] http://medical.nema.org/
[3] Z. Pincus, “ContourExtractor2DImageFilter: A subpixel-precision image isocontour extraction filter,” Insight Journal, 2006.
     [Online] hdl.handle.net/1926/165
[4] J. Dowling, M. Malaterre, P. B. Greer, and O. Salvado, “Importing contours to DICOM-RT Structure Sets,” Insight Journal, 2009.
     [Online] hdl.handle.net/10380/3132

Subrahmanyam Gorthi  Subrahmanyam Gorthi is currently pursuing his PhD at Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland. His research interests include medical image registration, segmentation and variational methods in image analysis.

Dr. Meritxell Bach Cuadra  Dr. Meritxell Bach Cuadra is currently with the Signal Processing Core of the Biomedical Imaging Center (CIBM), responsible for signal processing research at the Lausanne University Hospital (CHUV). Her main research interests are related to magnetic resonance (MR) and diffusion MR imaging, atlases, registration, segmentation, and classification.

Dr. Jean-Philippe Thiran  Dr. Jean-Philippe Thiran is currently an Assistant Professor at Swiss Federal Institute of Technology (EPFL), Lausanne, Switzerland. His research interests include image segmentation, prior knowledge integration in image analysis, partial differential equations and variational methods in image analysis, multimodal signal processing, medical image analysis, including multimodal image registration, segmentation, computer-assisted surgery, and diffusion MRI.