Page MenuHomePhabricator

mitkClippedSurfaceBoundsCalculator does not work correctly for reformatted view-directions
Closed, ResolvedPublic

Description

When calculating the intersection of a PlaneGeometry with an image-Geometry3D using the ClippedSurfaceBoundsCalculator the result is wrong if the plane is not parallel to the original slices of the image.

The problem is in the rounding of the index-coordinates. The interaction-points on the first slice (index == 0) actually have a index-coordinate of -0.5. This is fine as 0.0 is the center of the pixel, so -0.5 is the lower edge of the pixel.

However, the rounding turns this -0.5 to -1, which is not a valid index-coordinate (is more or less valid, but makes no sense in this context).

A simple solution would be to check the validity of the resulting index-coordinates and correct them if need be:

  • lower value cannot be less than 0
  • upper value cannot be more than dimension of image in each direction

Furthermore, an additional method should be implemented that is given a set of Point3Ds in world-coordinates. The result shall be the intersection point of this pointcloud with the image.

Event Timeline

New remote branch pushed: bug-13809-corrected-bounds-clipping

I have fixed the false behaviour as described in the Description and the Wiki Specification-Page.

I also added the new input-method for clipping the image-geometry with a given point-cloud.

I also extended the unit-test

Andi, should this be part of the release? This is an isolated fix that corrects a broken function, which is actually not used by any core classes that I am aware of.

Doesn't look like this is affecting any of the release classes. And anyway this fix looks good :-)
Granting release fix flag

[c2650d]: Merge branch 'bug-13809-corrected-bounds-clipping'

Merged commits:

2012-11-29 10:27:30 Markus Engel [008660]
extended ClippedSurfaceBoundsCalculatorTest


2012-11-29 10:27:12 Markus Engel [d9dafb]
fixed rounding error in ClippedSurfaceBoundsCalculator, added new input-method

The changes have been integrated into master. This is done...