Main Content

dicomContours

Extract ROI data from DICOM-RT structure set

Since R2020a

Description

The dicomcontours object extracts and stores region of interest (ROI) data from the metadata in DICOM-RT structure set files. You can use the object functions to add, delete, display, modify, and create masks from this ROI data. For more information, see Object Functions.

Creation

Description

contour = dicomContours(info) creates a dicomCountours object that stores ROI data from the structure set and ROI contour modules of the specified DICOM metadata info.

example

Input Arguments

expand all

DICOM metadata, specified as a structure array. The metadata must correspond to a valid RT structure set file. You can use the dicominfo function to read metadata from DICOM-RT structure set files.

Data Types: struct

Properties

expand all

This property is read-only.

ROI data, returned as an M-by-5 table, where M is the number of ROI sequences defined in the DICOM metadata. The entries in each row of the table define an ROI sequence. The table has these columns.

ColumnDescription
NumberIdentification number of the ROI, returned as a scalar integer. The number references the ROI number in the structure set ROI sequence.
NameName of the ROI, returned as a character vector. The name references the ROI name in the structure set ROI sequence.
ContourData

Points defining the contours of the ROI, returned as a cell array. The number of cells corresponds to the number of slices that are a part of the ROI. The slices can be axial, sagittal, or coronal depending on the patient coordinate system. Each cell contains an N-by-3 matrix with rows of the form [x y z] that specify coordinate data for one slice. N is the number of points in the contour. These coordinates define contours in the patient-based coordinate system.

GeometricType

Geometric type of the contour, returned as a character vector. The value for geometric type can be any of these options:

  • POINT

  • OPEN_PLANAR

  • OPEN_NONPLANAR

  • CLOSED_PLANAR

Color

Display color of the ROI, returned as an RGB triplet [r g b] with values in the range [0, 255].

Data Types: table

Object Functions

addContourAdd ROI sequence to ROI data
convertToInfoWrite ROI data to DICOM metadata
createMaskCreate volumetric mask from dicomContours object
deleteContourDelete ROI sequence from ROI data
plotContourPlot ROI contour data in DICOM-RT structure set

Examples

collapse all

Read DICOM metadata from a DICOM-RT structure set file by using the dicominfo function.

info = dicominfo("RTSTRUCT-VS-SEG-001.dcm");

Extract ROI data from the structure set and ROI contour modules of the DICOM metadata. The output is a dicomContours object that stores the extracted ROI data.

contour = dicomContours(info);

Display the details of the dicomContours object.

contour
contour = 
  dicomContours with properties:

    ROIs: [4x5 table]

Display the ROIs property of the dicomContours object. The ROIs property is a table that contains the extracted ROI data.

contour.ROIs
ans=4×5 table
    Number       Name        ContourData    GeometricType       Color    
    ______    ___________    ___________    _____________    ____________

      1       {'TV'     }    {13x1 cell}     {13x1 cell}     {3x1 double}
      2       {'Cochlea'}    { 5x1 cell}     { 5x1 cell}     {3x1 double}
      3       {'Vol2016'}    {12x1 cell}     {12x1 cell}     {3x1 double}
      4       {'*Skull' }    {79x1 cell}     {79x1 cell}     {3x1 double}

Extended Capabilities

Version History

Introduced in R2020a

expand all