Main Content

plotContour

Plot ROI contour data in DICOM-RT structure set

Description

example

plotContour(contour) plots one or more region of interest (ROI) contour data stored in the dicomContours object.

example

plotContour(contour,number) plots only the ROI contour data with the specified ROI number number.

example

plotContour(___,ax) plots ROI contour data in the axes specified by ax. The option ax can precede any of the input argument combinations in the previous syntaxes.

example

h = plotContour(___) returns the graphics object handles for the plot. You can use h to query and modify the properties of the plot. h is a group object. For more information on group object properties, see Group Properties

Examples

collapse all

Read DICOM metadata from DICOM-RT structure set files.

info = dicominfo('rtstruct.dcm');

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

contour = dicomContours(info);

Display the ROIs property of the dicomContours object.

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

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

Plot all the ROI contour data in the object.

figure
plotContour(contour)

Figure contains an axes object. The axes object contains 111 objects of type line.

You can also plot a specific ROI contour data, selecting it by its ROI number. Plot ROI contour data specified by ROI number 1.

figure
plotContour(contour,1)

Figure contains an axes object. The axes object contains 90 objects of type line.

Read DICOM metadata from DICOM-RT structure set files.

info = dicominfo('rtstruct.dcm');

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

contour = dicomContours(info);

Create a 2-by-2 tiled chart layout to display multiple plots on a figure window.

figure('Position',[1 1 700 700])
tiledlayout(2,2)

Create an axes object by using the nexttile function. The axes span across first two columns of the tiled chart layout. Plot all the ROI contour data on these axes.

ax1 = nexttile(1,[1,2]);
plotContour(contour,ax1)
title('ROI Contour Data')

Create a second axes object and plot ROI contour data specified by ROI number 1.

ax2 = nexttile;
plotContour(contour,1,ax2)
title('ROI Contour Data of ROI Number 1')

Create a third axes object and plot ROI contour data specified by ROI number 2.

ax3 = nexttile;
plotContour(contour,2,ax3)
title('ROI Contour Data of ROI Number 2')

Figure contains 3 axes objects. Axes object 1 with title ROI Contour Data contains 111 objects of type line. Axes object 2 with title ROI Contour Data of ROI Number 1 contains 90 objects of type line. Axes object 3 with title ROI Contour Data of ROI Number 2 contains 21 objects of type line.

Read DICOM metadata from DICOM-RT structure set files.

info = dicominfo('rtstruct.dcm');

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

contour = dicomContours(info);

Plot the ROI contour data and get the parent axes. The returned parent axes is a hggroup object with separate handles for each ROI contour plot.

h = plotContour(contour)
h = 
  2x1 Group array:

  Group    (Body_Contour)
  Group    (Tumor_Contour)

Add text descriptions for each ROI contour plot by using the returned handles.

text(290,0,-400,'\leftarrow ROI number 1','Parent',h(1))
text(90,0,-500,'\leftarrow ROI number 2','FontWeight','Bold','Parent',h(2))

Figure contains an axes object. The axes object contains 113 objects of type line, text.

Input Arguments

collapse all

ROI data, specified as dicomContours object.

ROI number, specified as a scalar or vector. Specifying a vector plots multiple contour sequences.

The ROI number is the identification number of the ROI in the ROIs property of the dicomContours object.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Target axes, specified as a handle object returned by axes or gca.

Output Arguments

collapse all

Graphics object handle, returned as hggroup object or an array of hggroup objects. If you specify ax, h is a child of the axes ax. Otherwise, h is a child of the current axes.

Introduced in R2020a