When zooming in the 2D windows the window snaps to a certain point no matter where in the 2D window one clicks to zoom.
A quick workaround is to intialize m_ConstrainZoomingAndPanning with false instead of true in mitkDisplayGeometry.cpp
• goch | |
May 6 2010, 5:11 PM |
F528: Code.patch | |
Jul 15 2010, 2:28 PM |
F527: Bug3982.patch | |
Jun 9 2010, 5:48 PM |
When zooming in the 2D windows the window snaps to a certain point no matter where in the 2D window one clicks to zoom.
A quick workaround is to intialize m_ConstrainZoomingAndPanning with false instead of true in mitkDisplayGeometry.cpp
Xin, looks like you start working on this. Please see T3959. Disabling this feature is not a solution.
The problem is in DisplayGeometry::Zoom, which takes a zoom factor and a point (center of zooming). Internally, the zooming happens in several steps:
Zooming in the sagittal and coronal views works well to the point where one clicks to zoom, but it doesn't work in the transversal view, if one clicks on the upper side of the 2D slices.
Following bugs have been found (and fixed/waiting for corechangerequest):
the "Refit" algorithm first
However if it corrects the ScaleFactor, it still uses Dimensions of the old ScaleFactor to perform the next check.
the original DisplayGeometry::Zoom does only set the origin when setting scalefactor "succeded" (which is defined in terms, that it did not require refitting)
Generally zooming lost its focus due to the refitting algorithm performing panning. This will be fixed by extending the interactor and the event by sending also start world coordinates (and not only the display coordinates)
Thanks for working on this, but there are two little issues with your patch:
First, there is output to std::cout, which should be removed.
Seond, method
bool mitk::DisplayGeometry::Zoom2(ScalarType factor, const Point2D& focusDisplayUnits, const Point2D& focusUnitsInMM )
takes the focus of zooming as display and world coordinates. This is redundant and possibly leads to errors when both values don't correspond. Right, or did I miss something?
Thanks for your comments.
-I removed the outputs.
-method bool mitk::DisplayGeometry::Zoom2(ScalarType factor, const Point2D&
focusDisplayUnits, const Point2D& focusUnitsInMM )
takes the focus of zooming as display and world coordinates. This is not redundant in case, that we performed both panning and zooming. We need the world coordinates to store the focus. Otherwise zooming losts its focus due to panning.