"Derived" from T1760:
When loading tiny volume datasets with very small spacing (you can easily achieve this by modifying MHD headers), the 2D and sometimes the 3D displays are rendering nothing or wrongly placed slice intersection lines.
One reason for this seems to be that the vector arithmetic involved here produces vectors with a length below a certain epsilon, and therefore nothing is painted at all.
When commenting out the lines
if ( direction.squared_magnitude() < eps ) return false;
in PlaneGeometry::IntersectionLine(), at least the 2D display problem seems to be solved...
Similarly, SlicedGeometry3D::SetDirectionVector() ignores the passed direction vector if the difference to the previously set vector is below vnl_math::float_sqrteps:
if ( diff.squared_magnitude()>=vnl_math::float_sqrteps ) // Set direction vector ...
Because of this, in some cases the direction is set incorrectly (or not at all) for very small volume datasets.
The underlying problem is the definition of mitk::ScalarType as float. For tiny datasets, the limit of numerical precision is quite quickly reached.
We could:
1.) Use a lower epsilon (mitk::eps ist defined as the floating point epsilon * 100) --> could result in numerical errors (Ivo?)
2.) Increase precision and use double as mitk::ScalarType (I'm not sure if this is a real option!?)
3.) Think of some numerical tricks to get things stable with float (?)
4.) Produce some kind of error message for datasets that are too tiny
Ivo, maybe you can comment on this?