Page MenuHomePhabricator

'OnSelectionChanged' of 'Single'Segmentation plugin does not work anymore
Closed, ResolvedPublic

Description

This is due to the change induced by T22572.
The plugin checks for its active state (see 'OnSelectionChanged' of 'QmitkSegmentationView.cpp'). Only if it's activated the changed selection events are processed further (e.g. for automatic node selection).
Since the active state is no longer set, 'OnSelectionChanged' does not work anymore.

Event Timeline

I'm not sure if it was the right decision to sacrifice the working segmentation plugin for the still experimental multi label segmentation. We should consider fixing this in time or even reverting your fix for now until there's a solution that'll work for both plugins.

kislinsk raised the priority of this task from Normal to High.May 18 2017, 12:59 PM

What do you mean by sacrificing? The auto-selection mode of the segmentation plugin did not work before, since the plugin was changed to be a subclass of QmitkAbstractView instead of QmitkFunctionality.
This leads to the 'IsActivated'-function to always return false.

So it has nothing to to with any changes of the multi label segmentation plugin, just with T22572: Migrate plugins from deprecated org.mitk.gui.qt.common.legacy dependency to org.mitk.gui.qt.common? Sorry, I misunderstood this task then.

You're right. This is just something I discovered while using the latest master and testing the interaction of both auto-selection modes.

EDIT: As I look closer, I see that this is something that may affect several different actions of the segmentation plugin. Each time a selection changes (and this also happens if a new segmentation was created, if the selection of the combo box changes etc.) the plugin asks itself if it is activated. Since 'm_Activated' is never set to true, all selection events won't be processed.
--> So this is not limited to the auto-selection mode.

kalali renamed this task from Auto-selection mode of 'Single'Segmentation plugin does not work anymore to 'OnSelectionChanged' of 'Single'Segmentation plugin does not work anymore.May 18 2017, 1:29 PM
kalali updated the task description. (Show Details)

Yeah, the problem is most probably the two methods Activated() and Deactivated() which are currently completely disabled. I'll take a look at that soon.

UPDATE:
We looked into the segmentation plugin, the acitvated/deactivated function etc.:
First, we removed the 'IsActivated()'-function, since this is not a base-function of QmitkAbstractView (but was a base-function of QmitkFunctionality). This 'IsActivated'-function was introduced by the PullRequest (T22572). The function was only used at one point inside the 'OnSelectionChanged' and at the current point we could not find any advantages to keep it.

In 'Activated()' and 'Deactivated()' we found some commented functionality (commented due to the fact that it was somehow necessary but not mapped correctly anyways). We transferred the important parts to the constructor and destructor of the class. Further, we implemented an additional function "NodeChanged( )" which handles a visibility check / binary check of the current working node (this was formerly done with callbacks).
By initializing the toolmanager in the 'CreateQtPartControl'-function we could fix the error (display: "'Create new segmentation' button should never be clickable unless a patient image is selected...").

Open:
We further need to investigate why the initial patient node is set in the combo box.
We also need to understand why unchecking and checking (visible/invisible) segmentation nodes in the datamanager does not always correctly enable or disable the segmentation tools (which we wanted to achieve by introducing the NodeChanged()-function).

Since this is all GUI-stuff, we need to update the Segmentation-Plugin-Checklist for manual testing.

EDIT: This is still under progress so no pushed branch so far.

We discarded to implement the NodeChanged() functionality and kept the callbacks, which we extended to be correctly set for all image nodes (as written above: "unchecking and checking (visible/invisible) segmentation nodes in the datamanager does not always correctly enable or disable the segmentation tools").
We had to change the initialization of the tool manager, since the SelectionModel of the abstract view was needed but was not set at this time.

Segmentation plugin is now usable again, minor different behaviors compared to the previous state of the segmentation plugin may have something to do with the QmitkAbstractView (instead of QmitkFunctionality). Feel free to report bugs.

kalali claimed this task.