Page MenuHomePhabricator

Fix inconsistent point representations (as spheres) in 2D and 3D
Closed, ResolvedPublic

Description

When rendering a mitk::PointSet using

  • 2D: CIRCLE representation
  • 3D: default representation

circle/spheres will not be rendered with the right shape and/or size

  • 3D: if the PointSet has a non-isotropic geometry attached
  • 2D: if rendering is initialized to a non-isotropic "world geometry" (e.g. because a non-isotropic image is the only one loaded)

Images and more in-detail description of the issues has been discussed here:
http://sourceforge.net/p/mitk/mailman/mitk-users/thread/55C9BF93.1050508%40mint-medical.de/#msg34364009

I found the reasons for this in the code and fixed it as following:

  • documentation: clarify that "point size" is meant as a diameter in world coordinates
  • 2D: fix the modifications that were already done on the glyph transform (remove scaling)
  • 3D: calculate local-to-world transformed point positions during scene creation. Do not apply a global transform after spheres have been created.

For manual testing, you can do the following:

  • load Pic3D.nrrd (spacing 1 1 3)
  • create a new PointSet using the "PointSet Interaction" Plugin
  • create some points
  • set the 2D representation to CIRCLE, size 9
  • set the 3D representation to point size 9
  • zoom in, observe the sizes of the circles in 2D and 3D. A sphere/circle should measure 3 voxels in height, 9 in width/height. With sufficient image contrast this can easily be counted

pointsets_rendering_diameters.jpg (461×733 px, 35 KB)

Event Timeline

User maleike has pushed new remote branch:

bug-19241-consistent-point-sizes-in-rendering

(In reply to Git Admin from comment #1)

User maleike has pushed new remote branch:

bug-19241-consistent-point-sizes-in-rendering

I test-integrated this, it would merge into the 2015.02 branch. In master, somebody made an identical change regarding redefining the "size" from int to float. Same logic, different expressions. This could easily be resolved when merging.

Let me know if there is something wrong with the change.

Did you execute the rendering tests with your changes applied?

(In reply to Stefan Kislinskiy from comment #3)

Did you execute the rendering tests with your changes applied?

I did when implementing. By now I got merge conflicts, however, so I'll try to resolve them and re-run tests. I'll keep you updated.

User maleike has pushed new remote branch:

bug-19241-for-MASTER

I now prepared branch bug-19241-for-MASTER which included another branch by Eric Heim on PointSets. This new branch solves most merge conflicts, the rest is trivial.

I test-integrated bug-19241-for-MASTER into master and executed all tests that contain "Render" or "Mapper" in their name. Only two passed that have nothing to do with PointSets, so I count them as configuration errors:

107 - mitkPlaneGeometryDataMapper2DTest (Failed)
109 - mitkSurfaceVtkMapper2DTest (Failed)

A manual test as described in the original description also showed that the functionality I intended in this bug works fine now and Eric's "vertex rendering" function also seems to be fine.

I'll go ahead and integrate the changes once they compile locally on both Linux and Windows

[b24394]: Merge branch 'bug-19241-for-MASTER'

Merged commits:

2015-09-16 11:46:02 Daniel Maleike [b781b2]
Fix gcc warnings/error


2015-09-16 10:55:23 Daniel Maleike [fd0588]
Remove update that seems not needed


2015-09-16 09:39:05 Daniel Maleike [9765b4]
Merge branch 'bug-19225-pointsetrendering' into bug-19241-for-MASTER

Conflicts:
Modules/Core/include/mitkPointSetVtkMapper2D.h
Modules/Core/src/Rendering/mitkPointSetVtkMapper2D.cpp
Modules/Core/src/Rendering/mitkPointSetVtkMapper3D.cpp


2015-08-18 17:10:02 Daniel Maleike [d2544b]
FIX git handling issues, some code was missing / displaced


2015-08-14 15:50:04 Daniel Maleike [284d02]
Clarify documentation on point size

Conflicts:
Modules/Core/include/mitkPointSetVtkMapper3D.h


2015-08-14 15:02:14 Daniel Maleike [8eb400]
Apply transform on point positions only (not on spheres etc.), adapt contour construction


2015-08-14 11:16:11 Daniel Maleike [014e5e]
Fix size of point representations, document "point 2D size" property

[b218fa]: Merge branch 'bug-19241-for-MASTER'

Merged commits:

2015-09-16 12:12:50 Daniel Maleike [c19bf6]
COMP: Fix narrowing warning

[3e5996]: Merge branch 'bug-19241-for-MASTER'

Merged commits:

2015-09-16 13:07:19 Daniel Maleike [a3c18f]
COMP: Fix TextOverlay3D tests

[d80d56]: Merge branch 'bug-19241-for-MASTER'

Merged commits:

2015-09-16 14:00:33 Daniel Maleike [04b8c8]
COMP: update test reference

[f15ec8]: Merge branch 'bug-19241-for-MASTER'

Merged commits:

2015-09-16 15:12:44 Daniel Maleike [87a774]
COMP: temp. deactivate failing test

Integration seemed fine to me. Unfortunately, even after fixes, the continuous dartclient on the Mac platform generates slightly different test images for test mitkLabelOverlay3DRendering2DTest.

Since I don't have access to a Mac machine, I deactivated the test temporarily, and asked for help. I cannot explain those platform specific differences and am curious to find the reason for them.

Andreas volunteered to create a Mac specific alternative screenshot reference for the failing tests. Assigning to him for this purpose.

[7bd001]: Merge branch 'bug-19241-reactivate-overlay-test-for-mac'

Merged commits:

2015-10-12 08:42:17 Andreas Fetzer [0abce3]
Reactivated test for mac again

[8ccc33]: Merge branch 'bug-19241-update-testdata-for-osx'

Merged commits:

2015-10-12 11:15:59 Andreas Fetzer [d2fed7]
COMP Updated MITK-Data for os x overlay test

Ok, Andreas added a Mac dartclient specific reference image, tests are passing now on this platform, too.