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

BUG: Fix shared labelmap bugs in SegmentComparison/SegmentMorphology #155

Closed Sunderlandkyl closed 3 years ago

Sunderlandkyl commented 3 years ago

In SegmentComparison/SegmentMorphology, the vtkSlicerSegmentationsModuleLogic::GetSegmentBinaryLabelmapRepresentation function was used to get the binary labelmaps. This function returns the internal "shared" representation of the segments, rather than the individual segment labelmap. This caused issues in SegmentComparison/SegmentMorphology, which expected only a single segment in each labelmap.

Fixed by changing vtkSlicerSegmentationsModuleLogic::GetSegmentBinaryLabelmapRepresentation to vtkSegmentationNode::GetBinaryLabelmapRepresentation, which retrieves the individual non-shared labelmap for each representation.