Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error number of segment #244

Open
pdeman opened this issue Sep 17, 2019 · 1 comment
Open

error number of segment #244

pdeman opened this issue Sep 17, 2019 · 1 comment

Comments

@pdeman
Copy link

pdeman commented Sep 17, 2019

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.

@fedorov
Copy link
Member

fedorov commented Sep 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants