SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
126 stars 60 forks source link

Hollowed DICOM RT-structures are not supported #171

Closed brianmanderson closed 1 year ago

brianmanderson commented 3 years ago

Hello,

I'm reaching out due to an issue I've noticed when trying to represent a 'target' structure like the red one shown below, it is not properly represented as hollow. I checked it on 3 other platforms to be sure this likely not an RT-Structure creation issue. image

A jupyter notebook file for downloading DICOM and creating the desired RT structure is referenced here: https://github.com/brianmanderson/Slicer_RT_Target_Issue

Thank you! Brian

lassoan commented 3 years ago

Did you use the keyhole technique to define a structure with hole?

lassoan commented 3 years ago

What you show in the screenshot above is visualization issue of closed surface representation in slice views in older Slicer versions (other views, other representations worked well), and the issue is fixed in current Slicer versions.

image

When the SlicerRT DICOM importer tries to create 3D sense of the data it adds a cap on the open ends of the structures to make it more realistic (in reality structures gradually disappear after the last contour and not end at the last contour). This requires some heuristics (DICOM RTSTRUCT such a terrible file format that requires such heuristics), which seem to fail here, as the endcap is added to the outer perimeter and not to the donut and circle shape separately. Most other software do not offer smooth endcapping, so they are not impacted. I don't know if the heuristics does not work because something is wrong with this structure set or the logic needs refinement.

@Sunderlandkyl

brianmanderson commented 3 years ago

@lassoan Thank you! I did not realize we were using an older version of Slicer, or how the views changed things. We'd originally stayed away from the keyhole technique because of trouble we had with multiple hollowed structures (like the target)

Thank you for the very fast reply and fix!

lassoan commented 3 years ago

The keyhole technique is not optional. Last time I checked it was a few years ago, but then it was required by the DICOM standard. Polygon winding is the common technique in computer graphics for defining what is inside/outside a polygon, but one of the many bad decisions of the DICOM-RT working group was that they chose the keyhole technique instead.

In general, RTSTRUCT is a really, really bad format for representing 3D shapes. I would not even consider it a 3D format, but something like 2.5D, as it is just a collection of 2D contours that can only be assembled to a closed 3D surface with lots of assumptions and heuristics.

I recommend everyone to stay away from it as much as possible and instead use DICOM Segmentation Object for storing segmentations in DICOM.

cpinter commented 3 years ago

Could you add a conversion parameter to enable/disable endcapping (enabled by default)?

Instead of enabling/disabling, or in addition to, I'd add the option to use the simple end-capping in which the first and last contours are simply repeated instead of shrunk. It is much less error-prone in cases like this.

cpinter commented 1 year ago

Closing due to long inactivity.