Page MenuHomePhabricator

Voxel value indicator in workbench is broken
Closed, ResolvedPublic

Description

The value indicator on the bottom right below the render windows should show the voxel value at the current crosshair location of the selected image.
Currently it always shows the value at this coordinates of the first image in the data manager, regardless of visibility and selection status.

Revisions and Commits

Event Timeline

We just need to call mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(this->GetDataStorage()); in void QmitkDataManagerView::NodeChanged(const mitk::DataNode* /*node*/) to solve the problem.
Even for large images, the reinit is suitable in terms of performance.
Eventually, we could add an option in Preferences --> DataManager (Call global reinit if node is changed).
@kislinsk @goch What do you think?

Please bear in mind that the overridden NodeChanged-function (from QmitkAbstractView) is called very often (e.g. when the node name changed). So you might rather consider the slot NodeSelectionChanged, which is connected to the selection model of the underlying QTreeView.

Additionally: Should the value indicator really show the value at the current crosshair location of the selected image or rather, of the currently visible image in the render window? I think the later, and there is a difference between those states.

As far as I am aware prior behaviour was showing the value of the topmost visible image at a given point. So if you have multiple images at different locations in the world geometry you would not get "No image information at this position" if you happen to set the crosshair at a location which is out of bounds for the topmost image.

goch triaged this task as Normal priority.Feb 1 2018, 2:43 PM

Talked with @kalali. We propose the following solution:
in QmitkDataStorageTreeModel:

signals:
  void nodeVisibilityChanged();

in QmitkDataManagerView:

connect(m_NodeTreeModel, &QmitkDataStorageTreeModel::nodeVisibilityChanged, this, &QmitkDataManagerView::OnNodeVisibilityChanged);

void QmitkDataManagerView::OnNodeVisibilityChanged(){
  mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(this->GetDataStorage());
}

So, we ensure that the Reinit() is only done if the visibility is changed (and not if the node is changed otherwise)

Also, add in the Preferences DataManager:

  • Call global reinit if node visibility is changed

We implemented the suggested approach but changed the call to InitializeViewsByBoundingObjects. We tested the behavior when using InitializeViews() (and not InitializeViewsByBoundingObjects(DataStorage)) and it worked as well. The advantage is that the user will not get distracted by the render windows being changed due to a new bounding box. However, the render windows will show the new correct pixel values of the visible nodes.
The former bounding box will not be updated. As this might also be not the best option for some users (bounding box may be too big for the visible images) we still suggest to add the data manager preference: Call global reinit if node visibility is changed.

The error was somewhere else and did not have anything to do with the correct view initialization (InitializeViews).

To solve this problem, we had to modify commit 7eab2a2235df. TopLayerNode can only be a visible node. For this we had to add the BaseRenderer parameter again (see commit 31ea4ed22473).

However, the function to update the status bar does also exist in QmitkImageNavigatorView. Here, the old (working) version does still exist. We should merge both and put it as a single function somewhere else, e.g. in the data storage class. This will be handled in T24173.

The idea from above, to add the data manager preference: Call global reinit if node visibility is changed will be handled in T24174.

kalali added a revision: Restricted Differential Revision.Feb 2 2018, 4:26 PM