Page MenuHomePhabricator

Statistic calculation not possible for rotated closed planar figures
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Load image and rotate planes
  • Draw planar polygon
  • Open statistics plugin
  • Select planar polygon in datamanager

You will see the error message
"PF is outside of image bounds"

Might be related to T18350

Event Timeline

The reason for this lies in the mitk::ImageStatisticsCalculator in line 884:

There MITK compares the normal of the planar figure with the axis of the image. If these are not aligned the check fails.

Solution could be: Use ExtractSliceFilter to extract the according 2D slice and perform statistics on that image

The least fix we could provide is to show a more meaningful error message. Right now it says that the PF is outside of the image boundaries but is should be something like statistics is not working for rotated PFs.

Anyway the solution mentioned in the previous comment should be preferred.

In the QmitkImageStatisticsCalculationThread there is already a concept for passing error messages from the calculating thread to the main GUI, however, it was removed in T15359 for some reason. I'm not sure if this concept can be used, so I adapt the default message to be a little more generic as quick fix from
"Planar figure is outside the images bounds."
to
"Planar figure is on a rotated image plane or outside the image bounds."

As the feature never worked, I created a new feature request in T18400 for Andy's proposal.

[28ca1d]: Merge branch 'bug-18384-AdaptingErrorMsgForRotatedPlanarFigures'

Merged commits:

2014-11-05 16:02:05 Thomas Kilgus [9c6d27]
Adapted error message for rotated planar figure statistics.