Page MenuHomePhabricator

Statistics: invalid coordinates of min/max values
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Open Statistics view
  • Load 3D+t image, e.g. E130-Daten/3M3 Demodaten/GeneralTestingData/CT_HeartLarge_3DT.pic.gz
  • Select image node in DataManager

... wait ...

--> Maximum value has only two coordinates, minimum has three, but should be four.

  • Check 'Ignore zero-valued' voxels

... wait ...

--> Minimum has four coordinates now. But the 4th coordinate is obviously out of range!

There were already some issues with min/max coordinates (see T14254).

Event Timeline

The 4th coordinate should not be displayed in the first place because the ImageStatisticsCalculator computes the min and max value for each 3D/2D TimeStep separately.

This part of the bug was introduced by the fix to T14644 where "adaptedImage->GetDimension()" was replaced with "m_Image->GetDimension()". We now fixed it by replacing "m_Image->GetDimension()" with "VImageDimension" (which is the dimension of the 3d/2d Image Slice (=timeStep) that was requested when calling mitk::ExtendedLabelStatisticsCalculator::InternalCalculateStatisticsMasked

imageStatisticsCalculator had:

statistics.SetMinIndex(maxIndex);
statistics.SetMinIndex(minIndex);

instead of

statistics.SetMaxIndex(maxIndex);
statistics.SetMinIndex(minIndex);

(in InternalCalculateStatisticsUnmasked)

and there was additionally some confusion about the length of the coordinates.
Is fixed & should now work properly

User isensee has pushed new remote branch:

bug-19625-Wrong-Coordinates-Of-Min-And-Max-In-ImageStatistics

[f7f8f6]: merged fix to T19625 Merge branch 'bug-19625-Wrong-Coordinates-Of-M

Merged commits:

2016-03-23 14:28:30 Fabian Isensee [186ab3]
fixed T19625, there was some confusion about image dimensions, coordinates (vnl vector sizes) and two times setMinCoordinate (instead of setMin and setMax)

[37b5e7]: Merge branch 'bug-19625-Wrong-Coordinates-Of-Min-And-Max-In-ImageStati

Merged commits:

2016-03-23 17:53:05 Caspar Goch [1e129f]
COMP: Reserve vector of correct size