Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SliceGeometry3D initialisation fix for non-image geometries
For non-image geometries the origin of the first slice and the origin of the 3D volume does not match. The origin of the 2D planes is at the bottom-left corner of their bottom-left pixel, but along the z axis they must be at the middle of a 3D voxel. The origin of the 3D volume, however, should be in the bottom-left-back corner of the bottom-left-back voxel. That means that the origin of the first 2D slice is half voxel far from the origin of the 3D volume along the the direction that is orthogonal to the 2D plane. The 2D geometries must be in the middle of voxel (e.g. they are used for the crosshair planes) and this is currently done correctly. However, the origin of the 3D volume is now the same as the origin of the first slice what is wrong, and causes various problems. This fix sets the correct offset for the translation matrix of the 3D geometry. The offset is the same as the offset of the first plane geometry minus half spacing along the direction orthogonal to the plane. Conflicts: Core/Code/DataManagement/mitkSlicedGeometry3D.cpp Signed-off-by: Miklos Espak <m.espak@ucl.ac.uk>
- Loading branch information
Showing
1 changed file
with
48 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters