Page MenuHomePhabricator

Slice index and position not updated on mouse wheel change
Closed, ResolvedPublic

Description

The index and position in the status bar is not updated on a mouse wheel event. Moving the mouse with pressed mouse button leads to an update, but not a wheel event. Update on wheel interaction should be added.

(current svn checkout, probably 3M3 as well)

Event Timeline

To get the statusbar updated on both mouse-wheel and ImageNavigator SpinBox&Slider event a new method to process the update should be called from

mitkSliceNavigationController::SendSlice()

Since the actuall world coordinates of the plane cross won't be available, the position has to be computed:

  • get the slice position and use the renderer to gain access to the data in the datastorage,
  • compute the world coordinates by BaseGeometry::IndexToWorld()

World coordinates of the crosshair position could be acquired by qerrying the datastorage for the planewidget coordinates.

Proposed solution:

  • whenever SendSlice() is called, the SliceNavigationController checks for focus on its associated widget and if widget is in focus sends CrosshairPositionChangedEvent()
  • ImageNavigater send CrosshairPositionChangedEvent whenever the value of some slice-slider or SpinBox changed
  • QmitkStdMultiWidget handles the CrosshairPositionChangedEvent and updates the information shown in the StatusBar

Your solution sounds like you want to end up with two ways to display position/value:

  • StdMultiWidget listening for CrosshairPositionEvent
  • Something (status bar?) listening for PositionEvents

I would prefer throwing away all existing methods and then implement a solution where the statusbar listens to CrosshairPositionEvents, which sounds like exactly the right event.

Did I miss something or does my suggestion sound ok?

BTW: nobody will test this feature unless you do it explicitly.

Our solution as described in the ChangeRequest ( it differs from the proposed solution described in Cooment 2) leads to only one method updating the QmitkStatusBar. The slice navigation controller has to listen to a position event, otherwise it would not be possible to move the crosshair by mouse click.

The additional code for displaying information, which got executed in the same method after the positionevent was handled, is now executed only when handling the CrosshairPositionEvent and also only once per Qt EventLoop.

The attached patch contains the new event for changing crosshair position together with the necessary changes in the StdMultiWidget which handles this event. For more detailed description of the bug see the ChangeRequest.

Can anyone report something about the status of this bug? Perhaps Jan or Daniel?
For now I set its status to confirmed (instead of in progress)

The bug-fix is ready to be merged into the master. The bug-branch with the fix was pushed into an own topic branch.

[a040f5]: Merge branch 'bug-4660-Statusbar-update-on-scrollEvent'

Merged commits:

2011-08-17 17:35:43 Jan Hering [8ea115]
Enhancing documentation of the new class.


2011-08-17 16:40:28 Jan Hering [13da29]
Update StatusBar text on mouse scroll-event

  • NEW CrosshairPositionEvent class
  • QmitkStdMultiWidget is listening to the new Event (fired on scroll)
    • event is handled only once at the end of the Qt EventLoop