Page MenuHomePhabricator

Allow to render small images and shapes correctly
Closed, WontfixPublic

Description

Hi,

When trying to render a small image (<0.04 mm) or small shape (<0.5mm), the 3D redering is not working properly.

For the image, the edge tubes are too big. Do you think it's possible to adjust the radius, depending on the visible bounding box? I found this line of code in mitkGeometry2DDataVtkMapper3D.cpp, but I don't know how to modify it:

// Adjust the radius according to extent
m_EdgeTuber->SetRadius( extent / 450.0 );

For the shape, the cutting planes are not positioned correctly. Could you give me some hints on how to improve this?

I attach you three images

Thanks!
Xavi

Event Timeline

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

Hi,

I've been working on this issue and I found some lines of code that can be changed in order to visualize microscopic images. An example of this kind of images can be downloaded from http://www.insight-journal.org/midas/collection/view/37. It has a resolution of 1nm.

Some lines of code define a constant that is used for the visualization of the data. However, I'm not sure if these changes can affect other parts of code. ¿Could you please give me more details about these consants and how these changes can affect the behaviour of the rest of functionalities?

I've added a patch.

Best,
Xavi

Part 1: mitkVector.cpp

There's a constant called eps that needs to be decreased:

Before:
const mitk::ScalarType mitk::eps = vnl_math::float_eps*100;
const mitk::ScalarType mitk::sqrteps = vnl_math::float_sqrteps;

After:
const mitk::ScalarType mitk::eps = vnl_math::float_eps*0.001;
const mitk::ScalarType mitk::sqrteps = vnl_math::float_sqrteps*0.001;

Part 2: mitkDisplayGeometry.cpp

There's a limit for the mm/display units factor.

Before:
void mitk::DisplayGeometry::SetScaleFactor(mitk::ScalarType mmPerDisplayUnit)
{

if(mmPerDisplayUnit<0.0001) mmPerDisplayUnit=0.0001;

After:
void mitk::DisplayGeometry::SetScaleFactor(mitk::ScalarType mmPerDisplayUnit)
{
// if(mmPerDisplayUnit<0.0001) mmPerDisplayUnit=0.0001;

Part 3: mitkGeometry2DDataVtkMapper3D.cpp

Use spacing of the data to compute tube radius of 3D axis.

Part 4: mitkImageMapper2D.cpp

Avoid bad allocation exception for small images.

Unified patch

kislinsk claimed this task.
kislinsk added a project: Auto-closed.
kislinsk added a subscriber: kislinsk.

Hi there! 🙂

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. 🚑

Best wishes,
The MITK devs

kislinsk removed kislinsk as the assignee of this task.May 26 2020, 12:05 PM
kislinsk removed a subscriber: kislinsk.