Page MenuHomePhabricator

Redundant function in QmitkAbstractView?
Closed, WontfixPublic

Description

The MatchPoint-Framework gets its input data nodes via the 'GetDataManagerSelection()'-function of the QmitkAbstractView-Base class (so do other plugins, e.g. diffusionimaging, imagecropper, ...).
The selection returned contains the selected nodes from the data manager plugin.

Additionally a "GetCurrentSelection()"-function of the QmitkAbstractView class exists. This functions returns the selection of the active part. In order to return something, this active part has to use its own selection provider.
(Currently as far as I can see only the 'QmitkMatchPointBrowser'-class and the 'QmitkDataManagerView'-class use their own selection provider or use the default selection provider and support this provider with an own selection model.)

Using the RenderWindowManager instead of the DataManager for BlackSwan, we can use our own selection provider for data nodes. Selecting a row / rows in the RenderWindowManager will make the nodes in those rows be the active selection.
The problem is that this changes only the active selection ('GetCurrentSelection()') and not the data manager selection ('GetDataManagerSelection()'). I tried several ways to utilize the QmitkAbstractView-API to send the active data node selection to the data manager selection, but I wasn't satisfied with the solutions.

In order to use the active nodes and not always the data manager nodes, the MatchPoint-Framework needs to get its input data nodes via the "GetCurrentSelection()"-function of the QmitkAbstractView-Base class.
This would make the 'GetDataManagerSelection()'-function superfluous.
One drawback of this could be, that a plugin that uses an own selection provider other than a 'QmitkDataNodeSelectionProvider' cannot access its active selection and a different data node selection.

Event Timeline

kalali renamed this task from MatchPoint retrieves its selection only from the DataManager to Redundant function in QmitkAbstractView?.Feb 16 2017, 5:14 PM
kalali updated the task description. (Show Details)
kalali changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".
kalali changed the edit policy from "Restricted Project (Project)" to "All Users".
kalali added a subscriber: kislinsk.

Using the 'GetCurrentSelection()'-function does not give the data manager selection, if this function is called while the data manager is not active. So using the 'GetCurrentSelection()'-function is not always a substitution for the 'GetDataManagerSelection()"-function.
However, the 'GetDataManagerSelection()'-function should always give the same result as a call to 'OnSelectionChanged' would have been given before.

In the example MatchPoint-Framework the substitution was possible, since the 'GetCurrentSelection()'-function was called inside a call to 'OnSelectionChanged', where the data manager view was still active.

Picked a random view from the extensive list of GetDataManagerSelection() calls and it happened to have three or so calls during button presses, in that case we are probably looking at a situation where the current selection would be empty. So we might need something more generic to allow replacing the data manager and have these kind of views still work.

Question is, if in this cases the returned data manager selection are the same as the data manager selection we get before using 'OnSelectionChanged'. Then the view just needs to keep those selected and changed data nodes for the funcions, where 'GetDataManagerSelection()' is needed (e.g. see QmitkMatchPointBatchProcessor).
So far my investigations say yes.

Set priority to Low because of inactivity.

kislinsk claimed this task.
kislinsk added a project: Auto-closed.

Hi there! 🙂

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. 🚑

Best wishes,
The MITK devs

kislinsk removed kislinsk as the assignee of this task.May 26 2020, 12:05 PM
kislinsk removed a subscriber: kislinsk.