When using mitkImageStatisticsCalculator with a PlanarFigure to define a ROI, there is a severe offset bug.
If the right border of a pixel is included in the ROI, it is completely used for masking.
That means if I have a ROI that encircles one pixel but does not cross the right border to the next pixel I have no statistics.
If this ROI contains 99% of the pixel on the right of the first pixel, this second pixel will NOT be considered in the statistics.
If this ROI contains 1% of the pixel on the left side (only the righternmost 1%), this pixel is completely considered by the statistics.
The most accurate way to fix this would be to make the statistics calculation work correctly on sub-pixel level.
However, this would mean immense workload and will not be done in the near future.
The quick-fix / improvement would be to use a pixel for statistics calculation as soon as the planarFigure crosses the center of the pixel. This would fix the false behaviour mentioned above.