Main Content

deleteContour

Delete ROI sequence from ROI data

Since R2020a

Description

example

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.

Examples

collapse all

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

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.

contourIn = dicomContours(info);

Display the ROIs property of the dicomContours object.

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

Delete the ROI sequence specified by ROI number 2.

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

    ROIs: [1x5 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=1×5 table
    Number          Name          ContourData    GeometricType       Color    
    ______    ________________    ___________    _____________    ____________

      1       {'Body_Contour'}    {90x1 cell}     {90x1 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.

Version History

Introduced in R2020a