For some reason, the scanner of one of our client produces negative (depth) spacing. We often see [0.3, 0.3, -0.3] or [0.8, 0.8, -0.8], etc. We know that a nagative spacing is not normal, but that's what the scanner gives!
As you know, MITK don't really like negative spacing. We can see in mitkImage.h, line 366, two conditions that are of interest to us.
for (j = 0; j < itkDimMax3; ++j)
{
if (spacing[j] < -mitk::eps && j == 2 && m_Dimensions[2] == 1) { // BIG comment about DICOM slices MITK_ERROR << "..."; spacing[j] = -spacing[j]; } else if (spacing[j] < mitk::eps) { MITK_ERROR << "..."; spacing[j] = 1.0; }
}
Sadly, in our case, we always go in the else where the spacing is set to 1.0. I don't see how this could be considered a good idea. I consider this as a bug. It gives really long image when the width and height spacing are < 1.0 AND the real spacing is lost. We could guess its value using the width and height spacing but it would only be a guess.
Of course, I'm not aware of everything that's behind this code, but I would suggest keeping only one removing the [strange] condition "m_Dimensions[2] == 1"
if (spacing[j] < -mitk::eps && j == 2)
{
spacing[j] = -spacing[j];
}
Thanks for your time.