dicomContours

Extract ROI data from DICOM-RT structure set

Description

The dicomContours function extracts region of interest (ROI) data from the metadata in DICOM-RT structure set files. The function returns a dicomContours object that stores the extracted data. You can use these Object Functions to add, delete, modify, and display ROI data.

Creation

Description

example

contour = dicomContours(info) extracts ROI data from the structure set and ROI contour modules of DICOM metadata info. You can also use the dicominfo function to read metadata from DICOM-RT structure set files.

The dicomContours function creates a dicomContours object with ROI data as its ROIs property.

Input Arguments

expand all

DICOM metadata, specified as a structure array. The metadata must correspond to a valid RT structure set file.

Data Types: struct

Properties

expand all

This property is read-only.

ROI data, returned as a M-by-5 table. The column variables are Number, Name, ContourData, GeometricType, and Color. The entries in each row of the table defines a ROI sequence. M is the number of ROI sequences defined in the DICOM metadata.

Column VariablesDescription
NumberIdentification number of the ROI, specified as a scalar integer. The number references the ROI number in the structure set ROI sequence.
NameName of the ROI, specified as a cell array of character vectors or string scalars. The name references the ROI name in the structure set ROI sequence.
ContourDataPoints defining a contour in the ROI, specified as a cell array. Each cell contains an N-by-3 matrix of the form (x, y, z). These coordinates define a contour in the patient based coordinate system. N is the number of points in a contour.
GeometricTypeGeometric type of the contour, specified as a character vector or a cell array of character vectors. The value for geometric type can be any of the following:
  • POINT

  • OPEN_PLANAR

  • OPEN_NONPLANAR

  • CLOSED_PLANAR

ColorDisplay color of the ROI, specified 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
deleteContourDelete ROI sequence from ROI data
plotContourPlot ROI contour data in DICOM-RT structure set

Examples

collapse all

Read DICOM metadata from DICOM-RT structure set files by using dicominfo function.

info = dicominfo('rtstruct.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: [2×5 table]

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

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

      1       {'Body_Contour' }    {90×1 cell}     {90×1 cell}     {3×1 double}
      2       {'Tumor_Contour'}    {21×1 cell}     {21×1 cell}     {3×1 double}

See Also

Functions

Introduced in R2020a