Confirmation or undo in Segment Editor?

I’ve just accidentally deleted an hour worth of segmentation by pressing the Remove (-) button instead of the Erase button. I got lost in monotonic segmentation and it just happened. Do you think it would be a good idea to add a pop-up dialog to confirm if the user actually wants to delete a segmentation? And/or extend the function of the Undo button in Segment Editor to be able to bring back the last deleted segmentation?

1 Like

Ouch. Yes, I think an undo at that level makes sense.

Also, in the past I’ve added an autosave feature to support specific workflows.

Undo can restore deleted segments. Can you try again?

It doesn’t restore the deleted segment for me on 4.10.1, but I will download the nightly and try again.

You mean you deleted a segment with in a segmentation wirh the Remove button in the top bar that has (Add/Remove/Show 3D/…)? Or you deleted the segmentation node somehow?

If just a segment, then yes, having undo cover that would be a must. Which should, but maybe there’s a bug? I don’t think a popup would be a good idea.
Sorry for the time you lost because of this.

I just tried it on 4.10.1 and it did restore the deleted segment. Can you check that specific log? It might contain something useful.

Yes, Undo does work in different scenes, but not in the one I’m working on. I will share it. Thanks for trying to reproduce.

Sorry for the large file. I don’t have a smaller one at hand to reproduce.
Just delete the segment and press Undo. It doesn’t do anything, and I don’t see an error or warning message that would explain it. The special thing about this scene is that I didn’t use a master volume, just a ROI, because I’m creating a 3D segmentation from 2D+tracked ultrasound.
https://1drv.ms/u/s!AhiABcbe1DBygrdCxt3piXBo9ZFrfA
Maybe this scene will help find a bug…

I don’t believe scenes contain segment editor undo history, sorry. Is there any error in the log form the session when you accidentally deleted the segment?

The log can be regenerated any time. Just load the scene I linked, remove the segment in Segment Editor, and press Undo. The segment will not come back.

Here is the log:

[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Session start time …: 2019-02-08 12:17:53
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Slicer version …: 4.10.1 (revision 27931) win-amd64 - installed release
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Operating system …: Windows / Professional / (Build 9200) - 64-bit
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Memory …: 32706 MB physical, 53186 MB virtual
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - CPU …: GenuineIntel , 8 cores, 8 logical processors
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - VTK configuration …: OpenGL2 rendering, TBB threading
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Developer mode enabled …: yes
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Prefer executable CLI …: yes
[DEBUG][Qt] 08.02.2019 12:17:53 [] (unknown:0) - Additional module paths …: C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/SlicerOpenIGTLink/lib/Slicer-4.10/qt-loadable-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/SlicerOpenIGTLink/lib/Slicer-4.10/qt-scripted-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/SlicerIGT/lib/Slicer-4.10/qt-loadable-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/SlicerIGT/lib/Slicer-4.10/qt-scripted-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/Sequences/lib/Slicer-4.10/qt-loadable-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/Sequences/lib/Slicer-4.10/qt-scripted-modules, C:/Users/tamas/AppData/Roaming/NA-MIC/Extensions-27931/DebuggingTools/lib/Slicer-4.10/qt-scripted-modules, J:/UsAnnotationExport/LiveFeedbackExtension/LiveFeedbackModule
[DEBUG][Python] 08.02.2019 12:17:57 [Python] (C:\Program Files\Slicer 4.10.1\lib\Slicer-4.10\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: Annotations
[DEBUG][Python] 08.02.2019 12:17:58 [Python] (C:\Program Files\Slicer 4.10.1\lib\Slicer-4.10\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 08.02.2019 12:17:58 [Python] (C:\Program Files\Slicer 4.10.1\lib\Slicer-4.10\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 08.02.2019 12:17:58 [] (unknown:0) - Switch to module: “Welcome”
[INFO][VTK] 08.02.2019 12:20:59 [vtkMRMLVolumeArchetypeStorageNode (0000023D21C5A110)] (D:\D\S\Slicer-4101\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: J:/Data/Bone_Segmentation/Image_Image.nrrd. Dimensions: 512x512x1. Number of components: 1. Pixel type: unsigned char.
[INFO][VTK] 08.02.2019 12:20:59 [vtkMRMLVolumeArchetypeStorageNode (0000023D21C59D50)] (D:\D\S\Slicer-4101\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: J:/Data/Bone_TrainingImagesRecorded/Image_Reference.nrrd. Dimensions: 512x512x1. Number of components: 1. Pixel type: unsigned char.
[INFO][Stream] 08.02.2019 12:20:59 [] (unknown:0) - CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:1
[INFO][VTK] 08.02.2019 12:20:59 [vtkMRMLVolumeArchetypeStorageNode (0000023D21C59B70)] (D:\D\S\Slicer-4101\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: J:/Data/Bone_TrainingImagesRecorded/ScoutScan.nrrd. Dimensions: 27x23x29. Number of components: 1. Pixel type: unsigned char.
[INFO][VTK] 08.02.2019 12:20:59 [vtkMRMLVolumeArchetypeStorageNode (0000023D21C5A2F0)] (D:\D\S\Slicer-4101\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: J:/Data/Bone_TrainingImagesRecorded/liveReconstruction.nrrd. Dimensions: 98x83x105. Number of components: 1. Pixel type: unsigned char.
[INFO][Stream] 08.02.2019 12:20:59 [] (unknown:0) - CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:1
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:21:16 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[DEBUG][Qt] 08.02.2019 12:21:16 [] (unknown:0) - “MRML Scene” Reader has successfully read the file “J:/Data/Bone_Segmentation/2019-01-31-Scene.mrml” “[17.00s]”
[DEBUG][Qt] 08.02.2019 12:22:04 [] (unknown:0) - Switch to module: “SegmentEditor”
[INFO][Stream] 08.02.2019 12:22:04 [] (unknown:0) - C:/Program Files/Slicer 4.10.1/bin/…/lib/Slicer-4.10/qt-scripted-modules\Resources\UI/SegmentEditor.ui
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544
[WARNING][Qt] 08.02.2019 12:22:07 [] (unknown:0) - ctkSliderWidget::setSingleStep() 1 is out of bounds. 173.504 173.583 173.544

@ungi If you load the scene and then just press undo, nothing will happen. This log does not help us. Please find the log that Slicer wrote when you accidentally deleted the segment.

It should basically be the last log file that is significantly larger than the others that you just generated.

I could reproduce the issue, investigating.

You need to delete the segment before pressing Undo.

1 Like

I’ve found the root cause of the issue and fixed it. Thanks for reporting it!

3 Likes