Open an image, create a segmentation. Check the binary property on the image, then uncheck it on the segmentation. As a consequence, both images will be in the segmentation image selector, while none being in the patient image selector.
The problem is located in the OnBinaryPropertyChanged() method, which is called only upon unchecking the segmentation binary property. The patient image uninentionally goes to the segmentation image selector due to its binary property. Then, the function returns prior to consideration of the segmentation image binary property swap.
[2c4d38]: Merge branch 'bug-18167-InconsistentStateOfImageSelector'
2015-09-30 14:33:32 Michael Brehler [875f39]
removed isBinary from if condition that avoids the correct addition of the property observer
Reopen: The current solution leads to a crash when a planar figure node is inserted into the DatStorage.
- open an image
- open both SegmentationView and Measurement
- select measurement view and add some planar figure --> IMMEDIATE CRASH in the QmitkSegmentationView::NodeAdded method
It is because of the removal of the ( isBinary ) check in the if() condition for adding the observer.
: Merge branch 'bug-18167-InconsistentImageSelectorState-REVERT'
2015-10-14 16:49:13 Jan Hering [36f1a2]
Revert commit [875f39] merged on 30-09-2015
- the removed "isBinary" check causes a multiple crashes when handling with non-image objects (planar figures, fibertracts etc.) while the SegmentationView is opened somewhare.
Sorry, but I had to revert the change in QmitkSegmentationView since the initial fix makes the MITK Diffusion application unusable, and also as described above a crash in MITK Workbench with planar figures can be easily provoked.