SlicerProstate / SliceTracker

SliceTracker is a 3D Slicer extension to support the workflow of MR-guided prostate biopsies.

Home Page:https://slicerprostate.gitbooks.io/slicetracker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SliceTracker breaks when running quick mode after automatic segmentation in Intraop

che85 opened this issue · comments

[CRITICAL][FD] 17.01.2018 11:11:49 [] (unknown:0) - 2018-01-17 11:11:49.549 Slicer[6795:1067692] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
[CRITICAL][Qt] 17.01.2018 11:12:19 [] (unknown:0) - std::string qMRMLSegmentEditorWidgetPrivate::referenceImageGeometry() : Invalid segmentation
[CRITICAL][Qt] 17.01.2018 11:12:19 [] (unknown:0) - bool qMRMLSegmentEditorWidgetPrivate::resetModifierLabelmapToDefault() : Cannot determine default modifierLabelmap geometry
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 356, in onQuickSegmentationFinished
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -     self.processValidQuickSegmentationResult()
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 400, in processValidQuickSegmentationResult
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -     outputLabel = self.logic.labelMapFromSegmentModel(node, self.segmentationNode)
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 550, in labelMapFromSegmentModel
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -     self.surfaceCutLogic.cutSurfaceWithModel(self.inputMarkupNode, self.segmentModelNode)
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SegmentEditorExtraEffects/lib/Slicer-4.9/qt-scripted-modules/SegmentEditorSurfaceCutLib/SegmentEditorEffect.py", line 392, in cutSurfaceWithModel
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) -     modifierLabelmap.GetImageToWorldMatrix(segmentationToSegmentationIjkTransformMatrix)
[CRITICAL][Stream] 17.01.2018 11:12:19 [] (unknown:0) - AttributeError: 'NoneType' object has no attribute 'GetImageToWorldMatrix'
[CRITICAL][FD] 17.01.2018 11:13:15 [] (unknown:0) - 2018-01-17 11:13:15.911 Slicer[6795:1067692] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
[CRITICAL][Qt] 17.01.2018 11:13:19 [] (unknown:0) - std::string qMRMLSegmentEditorWidgetPrivate::referenceImageGeometry() : Invalid segmentation
[CRITICAL][Qt] 17.01.2018 11:13:19 [] (unknown:0) - bool qMRMLSegmentEditorWidgetPrivate::resetModifierLabelmapToDefault() : Cannot determine default modifierLabelmap geometry
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 356, in onQuickSegmentationFinished
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -     self.processValidQuickSegmentationResult()
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 400, in processValidQuickSegmentationResult
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -     outputLabel = self.logic.labelMapFromSegmentModel(node, self.segmentationNode)
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SliceTracker/lib/Slicer-4.9/qt-scripted-modules/SurfaceCutToLabel.py", line 550, in labelMapFromSegmentModel
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -     self.surfaceCutLogic.cutSurfaceWithModel(self.inputMarkupNode, self.segmentModelNode)
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -   File "/Applications/Slicer 5.app/Contents/Extensions-26721/SegmentEditorExtraEffects/lib/Slicer-4.9/qt-scripted-modules/SegmentEditorSurfaceCutLib/SegmentEditorEffect.py", line 392, in cutSurfaceWithModel
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) -     modifierLabelmap.GetImageToWorldMatrix(segmentationToSegmentationIjkTransformMatrix)
[CRITICAL][Stream] 17.01.2018 11:13:19 [] (unknown:0) - AttributeError: 'NoneType' object has no attribute 'GetImageToWorldMatrix'
[CRITICAL][FD] 17.01.2018 11:13:41 [] (unknown:0) - 2018-01-17 11:13:41.911 Slicer[6795:1067692] modalSession has been exited prematurely - check for a reentrant call to endModalSession:

@lassoan Can you tell me, what this modifierLabelmap is doing? In what situations would it be set to None? @Kmacneil0102 Is saying, that this crash appears randomly and is not reproducible.

self.scriptedEffect.defaultModifierLabelmap() returns a reusable image buffer for convenience and performance purposes (segment editor keeps this labelmap in memory between editing operations to reduce the need to reallocate memory).
If there is no master volume, there are no existing segments, or no referenceImageGeometry is specified in the segmentation then it may be NULL.

Great thanks for the hints! I figured out, that when it crashes, the scriptedEffect.parameterSetNode().GetSegmentationNode() is None.

Great! Could you add a check to the effect and send a pull request?

Note that this was not a crash (crash is when the application exits).

@lassoan You are right. Sorry for the confusing naming. Will change it.

I will look into the effect and see if I find other things.

P.S. I think I know how to reproduce it in SliceTracker!

for the reference: this problem was already mentioned in issue #322