Page MenuHomePhabricator

Image statistics calculation - image and mask alignment too strict
Closed, ResolvedPublic


In mitkImageStatisticsCalculator::InternalCalculateStatisticsMasked the alignment of the mask and the image is checked very strict using mitk::eps.

In some cases this is too strict and can lead to errors. This should be loosened.

Event Timeline

User seitelm has pushed new remote branch:


The pushed branch contains a temporary fix for the problem: instead of using mitk::eps, the image raster alignment and image orientation now must be smaller than 0.001.

This is not a clean solution, but is used for a product release to solve an application error.

TODO: implement a better solution for the issue and integrate the changes into master.

The same applies for the spacing of image and mask.
We have a dataset (image and mask) where the image statistics would be calculated with the last release. However, with the current release, it refuses to calculate the statistics since the spacing differs by a factor of around 10^(-13).

Andreas Fetzer mentioned this could have something to do with the change of ScalarType from float to double.

In case you need it, I can supply the dataset upon request.

Raised importance and severity to make this bug more prominent for the current release.

Updating target milestone.

The exception comes from our own code. There are several checks of the input images resulting into an itkException if a difference occurs. The statistics computation itself is done by the itk::LabelStatisticsImageFilter.

A simple test with different grade of image header information alteration shows, that our own checks are far more restrictive than the ITK filter itself.

Solution proposal:

since the computation is completely done by itk filters, the exceptions from them should be catched ( not done at the moment ) and our own checks can be dropped.

User hering has pushed new remote branch:


[f61d13]: Merge branch 'bug-17121-Statistics-MaskAlignmentFix'

Merged commits:

2015-03-25 16:03:26 Jan Hering [cd95f9]
Fix image mask geometry comparison

  • dropped too restrictive own checks, replaced with checks (exceptions) provided by the filters that

actually compute the statistics

kislinsk edited projects, added MITK (2015-03); removed MITK.Aug 1 2016, 10:48 PM