error number of segment
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.
Thank you for sharing the sample dataset!
It appears that the "IRC" segmentation does not have any non-zero voxels, and this is why no segments are created. It does have one "segment" as defined by DICOM, but all of the frames in that segment are blank, that is why in Slicer no segments are initialized.