Skip to content

error number of segment #244

@pdeman

Description

@pdeman

I am trying to open dicom segmentation storage on slicer using quantitative reporting and for some of the dicom I get an error (which is strange because all are generated exactly the same way, but it can open some but not all).

here is the error message:

DICOM plugin failed to load '3DSegmentation IRC' as a 'DICOMSegmentation'.
Traceback (most recent call last):
File "C:\Program Files\Slicer 4.10.1\lib\Slicer-4.10\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 867, in proceedWithReferencedLoadablesSelection
loadSuccess = plugin.load(loadable)
File "C:/Users/xxx/AppData/Roaming/NA-MIC/Extensions-27931/QuantitativeReporting/lib/Slicer-4.10/qt-scripted-modules/DICOMSegmentationPlugin.py", line 220, in load
self._createSegmentationNode(loadable, segmentLabelNodes)
File "C:/Users/xxx/AppData/Roaming/NA-MIC/Extensions-27931/QuantitativeReporting/lib/Slicer-4.10/qt-scripted-modules/DICOMSegmentationPlugin.py", line 228, in _createSegmentationNode
self._importSegmentAndRemoveLabel(segmentLabelNode, segmentationNode)
File "C:/Users/xxx/AppData/Roaming/NA-MIC/Extensions-27931/QuantitativeReporting/lib/Slicer-4.10/qt-scripted-modules/DICOMSegmentationPlugin.py", line 244, in _importSegmentAndRemoveLabel
segment = segmentation.GetNthSegment(segmentation.GetNumberOfSegments() - 1)
OverflowError: GetNthSegment argument 1: can't convert negative value to unsigned long

Could not load: Segmentation IRC as a DICOMSegmentation

and indeed segmentation.GetNumberOfSegment() return 0.
while when I open it using dcmtk and do:

segdoc->getNumberOfSegments();

it returns 1 as expected.
here are two dicom segmentation file:
https://drive.google.com/open?id=1arh8tRaMCyx6qPbwFYd5p_0LIRzXvXtR
one is loadable, the other one not.
I don't get why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions