Locked History Attachments

ChangeRequests/2401

Summary of bug description

  • actual behaviour: Image origin in index coords is shifted by 0.5 unit. World coordinates are not displayed at all any more.
  • expected behaviour: Image origin should be at top left of imag. Also display world coordinates.

Cause of the bug

In Image geometries, Voxel origin is in the middle of the voxel by definition. This is not respected by WorldToImage calculation in Geometry3D, as well as in IndexToWorld.

World coordinates are simply not issued.

Proposed solution

When the WorldToIndex calculation is performed for an image (variable IsImageGeometry = true), add 0.5 to the coordinate after conversion to index coordinates to represent the center shift.

When the IndexToWorld calculation is performed for an image (variable IsImageGeometry = true), subtract 0.5 from the coordinate before conversion to world coordinates to represent the center shift.

Also show world coords in the status bar.

Affected classes

mitkGeometry3D.cpp

mitkGeometry3DTest.cpp

How will the bugfix get tested?

Automatically in the mitkGeometry3DTest unit test; check if IndexToWorld(WorldToIndex(point) results in the starting value; both for geometries with "ImageGeometry" set, and without. In a graphical test, one could manually check if the 0,0,0 point is really in the image corner.