Page MenuHomePhabricator

CreateDistanceImageFromSurfaceFilter does not work correctly on rotated MRI Images
Closed, ResolvedPublic


The CreateDistanceImageFromSurfaceFilter currently does not correctly support rotated MRI Images as the distanceImage that is created is aligned to the world-geometry:

origin: 0,0,0
direction: 1,1,1

After the interpolation a Surface is created from the distanceImage. This Surface is also world-aligned but has an extent that is slightly larger than one slice of the original image. Thus it's possible that a contour on a single slice will cause the segmentation to be extended to a neighboring slice as well.

When you have a rotated MR-Image, the world-aligned surface will span several slices and you will see bits of segementation that look cut-off.

The easiest way to fix this is to give the CreateDistanceImageFromSurfaceFilter the reference-image. That is the image on which the segmentation is performed. Using this information, the filter can correctly initialize the distance-image with the correct position and orientation.

Event Timeline

New remote branch pushed: bug-13992-correct-interpolation-on-rotated-image

The currently working version has been comitted with hash 686629bc3ca85376f91f1ced36457e0dcf5abe09 in branch 'bug-13992-correct-interpolation-on-rotated-image'.

I am aware that this version of the branch is not yet fit to be integrated into master. There have been quite a few changes that have to be checked.

As this does not seem to be issue when using the CreateDistanceImageFromSurfaceFilter in the segmentation bundle, I don't think this fix is relevant for the MITK Release 2012-12.

Andreas, can you take a look at the changes and comment? Thanks

Here's a little update on what we have actually done to correct the interpolation on rotated MRI images:

  • I have added the possibility to define a reference image on the CreateDistanceImageFromSurfaceFilter
    • This should usually be the mitkImage on which the segmentation is created
  • The empty distance image is then initialized according to the geometry of the reference image (origin and direction)
  • The extent of the distance image is calculated in index coordinates which are then transformed into world coordinates and are increased by 2 index coordinates in all directions
  • Each input point in world coordinates (defined by input surfaces) is transformed into index coordinates of the distance image to set correct distance

These changes make sure that the resulting distance image is correctly positioned and oriented in the world space and that the interpolation result is correct on rotated MRI images.

This could be a candidate fix for the upcoming release...

This problem has been solved with the changes made in T15439.