Page MenuHomePhabricator

MITK does not support tiny volume datasets (spacing << 0.1mm)
Closed, ResolvedPublic

Description

"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?

Event Timeline

Chaning the mentioned methods involving vector calculations to make them numerically more stable / less likely to be aborted due to epsilon check should fix the problem. Detailed description in Wiki spec page.

[SVN revision 20895]
FIX (#2021): Make handling of tiny image datasets possible (adapted vector calculations, consider spacing for 3D plane edge decoration)

Loading small image datasets works with the above fix.

A persisting problem is that, when loading *very* small datasets (spacing << 0.01mm) and at the same time normally-sized datasets, the application crashes during rendering (in VTK). For this issue, a new T3178 has been opened.

Closing this bug.