Import 2017-06-07 23:51:09: master 9b62a8d2

Author Committer Branch Timestamp Parent
johan.andruejol johan.andruejol master 2017-04-27 15:59:58 master 06ddc074
Changeset

BUG: Fix ConvertDeviceToXYZ() 1 pixel offset

The issue appeared when using an annotation. When the annotation point is
dragged at the bottom of a slice view, the annotation Z position would
jump 1 pixel higher.
For example in the axial view, the Z coordinate of the annotation would
jump from 0.0 to 1.0 (when no module is loaded).

Here is a small python code exerpt that can be used to showcase the bug:

def PrintP1(caller, event):
p1 = [0, 0, 0]
caller.GetPosition1(p1)
print(p1)

ruler = slicer.mrmlScene.AddNode(slicer.vtkMRMLAnnotationRulerNode())
ruler.SetPosition1([0, 0, 0])
ruler.SetPosition2([10, 0, 0])
ruler.AddObserver(vtk.vtkCommand.ModifiedEvent, PrintP1)

Fixing the computation of Z in ConvertDeviceToXYZ() fixes this.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25981 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/DisplayableManager/vtkMRMLAbstractSliceViewDisplayableManager.cxx Diff File
mod - Modules/Loadable/Markups/MRMLDM/vtkMRMLMarkupsDisplayableManager2D.cxx Diff File