Page MenuHomePhabricator

Unsetting all volume rendering properties crashes MitkDiffusion/MitkWorkbench
Closed, ResolvedPublic

Description

In the workbench, switch on volume rendering in properties view, then uncheck the useGPU checkbox => crash:

!41.736! [VtkGenericWarning] WARNING: Generic Warning: In /home/mhettich/MITKsuperbitch/ep/src/VTK/Rendering/Volume/vtkRayCastImageDisplayHelper.cxx, line 20
Error: no override found for 'vtkRayCastImageDisplayHelper'.
Abort (core dumped)
134

MITK Version is the master-branch as of 2016-10-05 (today).

So I think we need to define a default case in the Module
or make sure exactly 1 checkbox is selected there (Does Qt have radiobuttons?) in the Plugin or GUI.
Nope, 'twas a missing factory macro define for vtk.

Event Timeline

hettich updated the task description. (Show Details)
hettich updated the task description. (Show Details)Oct 5 2016, 5:43 PM
hettich added a comment.EditedOct 14 2016, 2:32 PM

Seems to be a VTK problem.

CPU is used by default.

m_Controls->m_RenderMode->setCurrentIndex( mode )

enum RenderMode
{
  RM_CPU_COMPOSITE_RAYCAST = 0,
  RM_CPU_MIP_RAYCAST       = 1,
  RM_GPU_COMPOSITE_SLICING = 2,
  RM_GPU_COMPOSITE_RAYCAST = 3,
  RM_GPU_MIP_RAYCAST       = 4
};
hettich added a comment.EditedOct 17 2016, 5:47 PM
(gdb) f 0
#0  vtkFixedPointVolumeRayCastMapper::vtkFixedPointVolumeRayCastMapper (this=0x42712a0)
    at /home/mhettich/MITKsuperbitch/ep/src/VTK/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.cxx:717
717	  this->ImageDisplayHelper->PreMultipliedColorsOn();
(gdb) l
712	  // did we render last time (so we can check if it is changing)
713	  this->CurrentScalars = NULL;
714	  this->PreviousScalars = NULL;
715	
716	  this->ImageDisplayHelper  = vtkRayCastImageDisplayHelper::New();
717	  this->ImageDisplayHelper->PreMultipliedColorsOn();
718	  this->ImageDisplayHelper->SetPixelScale( 2.0 );
719	
720	  // This is the min max volume used for space leaping. Each 4x4x4 cell from
721	  // the original input volume has three values per component - a minimum scalar
(gdb) p ImageDisplayHelper
$1 = (vtkRayCastImageDisplayHelper *) 0x0
(gdb) p this->ImageDisplayHelper
$2 = (vtkRayCastImageDisplayHelper *) 0x0
nolden raised the priority of this task from Low to High.Oct 18 2016, 11:21 AM

www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines

this is where the fun begins. where should this missing define be located?

hettich lowered the priority of this task from High to Low.EditedOct 26 2016, 5:39 PM

According to @kolbch, mitk's volume rendering code will be removed and the rendering backend replaced, soon-ish.
VTK now can do all that stuff, and more.

hettich claimed this task.EditedOct 28 2016, 5:31 PM

It works:

diff --git a/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp b/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
index 117e91f..bc7b96b 100644
--- a/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
+++ b/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
@@ -18,6 +18,9 @@ See LICENSE.txt or http://www.mitk.org for details.
 #define GPU_WARN MITK_WARN("mapper.vr")
 #define GPU_ERROR MITK_ERROR("mapper.vr")
 
+#include <vtkAutoInit.h>
+VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
+
 #include "mitkGPUVolumeMapper3D.h"
 
 #include "mitkDataNode.h"
hettich closed this task as Resolved.EditedOct 28 2016, 7:20 PM
diff --git a/Modules/MapperExt/CMakeLists.txt b/Modules/MapperExt/CMakeLists.txt
index aa04ecb..f233bbd 100644
--- a/Modules/MapperExt/CMakeLists.txt
+++ b/Modules/MapperExt/CMakeLists.txt
@@ -2,5 +2,8 @@ MITK_CREATE_MODULE(DEPENDS MitkDataTypesExt MitkLegacyGL
                    WARNINGS_AS_ERRORS
                   )
 
+find_package(VTK)
+include(${VTK_USE_FILE})
+
 add_subdirectory(test)

This might work, too, maybe I test it later.

@hettich You know that you can format and syntax-highlight code in Phabricator, right? :-)

diff --git a/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp b/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
index 117e91f..bc7b96b 100644

a/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
+++ b/Modules/MapperExt/src/mitkGPUVolumeMapper3D.cpp
@@ -18,6 +18,9 @@ See LICENSE.txt or http://www.mitk.org for details.
#define GPU_WARN MITK_WARN("mapper.vr")
#define GPU_ERROR MITK_ERROR("mapper.vr")

+#include <vtkAutoInit.h>
+VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
+
#include "mitkGPUVolumeMapper3D.h"

#include "mitkDataNode.h"
hettich updated the task description. (Show Details)Dec 19 2016, 12:50 PM