Main Content

deleteContour

Delete ROI sequence from ROI data

Since R2020a

Description

contourOut = deleteContour(contourIn,number) deletes one or more region of interest (ROI) sequences extracted from a DICOM-RT structure set file. Specify each sequence to delete by the ROI number number.

Use the deleteContour function to delete an ROI sequence from the ROIs property of a dicomContours object. You can then use the convertToInfo function to export the new ROI data to the structure set and ROI contour modules of DICOM metadata.

example

Examples

collapse all

Read the DICOM metadata from a DICOM-RT structure set file.

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.

contourIn = dicomContours(info);

Display the ROIs property of the dicomContours object.

contourIn.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}

Delete the ROI sequence specified by ROI number 2.

contourOut = deleteContour(contourIn,2)
contourOut = 
  dicomContours with properties:

    ROIs: [3x5 table]

Display the ROIs property of the output dicomContours object. You can use the convertToInfo function to export the modified ROI data to a DICOM-RT structure set file.

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

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

Input Arguments

collapse all

Input ROI data, specified as a dicomContours object.

ROI number, specified as a numeric scalar or vector. Specifying a vector of ROI numbers deletes multiple ROI sequences.

The ROI number is specified in the Number column of the table returned by the ROIs property of the dicomContours object.

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

Output Arguments

collapse all

Output ROI data, returned as a dicomContours object.

Extended Capabilities

Version History

Introduced in R2020a

expand all