Page MenuHomePhabricator

Disabling Antialiasing in MITK
Closed, ResolvedPublic

Description

The MitkRenderingTestHelper uses an MitkRenderWindow, whose base class has an VTKRenderWindow. In vtk, Antialiasing is by default enabled and cannot be disabled after initializing. (Method "SetMultiSample(0) has no effect). So we actually deal with a VTK bug here.

A solution would be to provide a second RenderingTestHelper, based on the QVTKWidget.
We need a new QmitkRenderingTestHelper, since Antialiasing is disabled in a QmitkRenderWindow by default (we couldn't identify the exact reason). In order to produce the same results in the RenderingTests and in MITK QMitkMultiWidget, a second RenderingTestHelper should be implemented.

Event Timeline

Thomas and me tested a small example provided by vtk (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowNoUiFile) under Linux: Antialiasing could be disabled easily using method SetMultiSample(0) for both the VtkRenderWindow and the QVTKWidget. It is no Vtk bug under linux, but still it might be a windows issue.

Furthermore, we tested the QTFreeRender under Linux: SetMultiSamples(0) has no effect there. The result is still antialiased.

Thus, we finally assume that it is an MITK bug, since in MITK-independet versions antialiasing could be toggled on and off.

Very high importance, as it often blocks the dashboard. We should take care of this asap! Rendering experts needed...

New remote branch pushed: bug-15756-Disabling-Antialiasing-in-MitkRenderWindow

Wouldn't it make more sense to try forcing defaults in the base class (RenderWindowBase)? It seems as if QmitkRenderWindow is unaffected from your change, which is a bit inconsistent.

Second option: if we only need a consistent setting for testing, there should be a method like SetAntialiasingEnabledOn/Off() and rendering tests / test helpers should call it.

I guess this second option would also be more desirable for application developers, who might like anti-aliasing.

(In reply to Daniel Maleike from comment #5)

Wouldn't it make more sense to try forcing defaults in the base class
(RenderWindowBase)? It seems as if QmitkRenderWindow is unaffected from your
change, which is a bit inconsistent.

Second option: if we only need a consistent setting for testing, there
should be a method like SetAntialiasingEnabledOn/Off() and rendering tests /
test helpers should call it.

I guess this second option would also be more desirable for application
developers, who might like anti-aliasing.

In response to your first concern:
The QmitkRenderWindow has antialiasing disabled by default. We couldn't identify a reason for that. So disabling antialising in the RenderWindow is consistent with the other available Window in MITK. However we can explictely disable it and add that line.

In response to your second concern:
You can only disable the antialiasing at creation of the vtkRenderWindow, so an always-accessible SetMultiSample is not approriate. If someone wants a custom parameterized version of the vtkRenderWindow, one is able to supply it via a 2nd constructor.

[23fb24]: Merge branch 'bug-15756-Disabling-Antialiasing-in-MitkRenderWindow'

Merged commits:

2013-10-30 14:03:34 Sandy Engelhardt [747bad]
SetMultiSample only if vtkRenderWindow needs to be created in constructor


2013-10-09 17:20:50 Sandy Engelhardt [3fcbd2]
Disabling Multisampling in MitkRenderWindow