[vtkusers] vtkMultiVolume, vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ClearRemovedInputs() throws SegFault during/after Render
Angelika Ophagen
ophagen at dornheim-medical-images.de
Thu Oct 18 07:17:50 EDT 2018
Hello,
I have a question about using vtkMultiVolume. I am using the nightly-master to
use vtkMultiVolume for a bachelor thesis about multi-modal medical images
rendering possibilities. I get a SegFault as soon as I have removed input
connections of the mapper ports and wonder if there is an error in VTK or if I
am using it wrong.
My simple prototype has no problem - it hardly does a thing, as it is roughly
based on this (https://gitlab.kitware.com/vtk/vtk/blob/nightly-master/
Rendering/Volume/Testing/Cxx/TestGPURayCastMultiVolumeAddRemove.cxx).
But the "real" implementation has problems. It is inside a large code base
with lots of GUI triggers that result in Rendering, so it might be a missing
call to Render or one too many at the wrong time.
(After / While?) Rendering from vtkOpenGLRenderer::UpdateGeometry (https://
gitlab.kitware.com/vtk/vtk/blob/nightly-master/Rendering/OpenGL2/
vtkOpenGLRenderer.cxx#L335), vtkMultiVolume::RenderVolumetricGeometry
(https://gitlab.kitware.com/vtk/vtk/blob/nightly-master/Rendering/Volume/
vtkMultiVolume.cxx#L275) calls its Mapper to Render and
vtkOpenGLGPUVolumeRayCastMapper::GPURender (https://gitlab.kitware.com/vtk/
vtk/blame/b8ab2d693a54024b7e81cb57a32c289cb7dc8314/Rendering/VolumeOpenGL2/
vtkOpenGLGPUVolumeRayCastMapper.cxx#L3324) tries to clear up the removed
inputs here: https://gitlab.kitware.com/vtk/vtk/blame/
b8ab2d693a54024b7e81cb57a32c289cb7dc8314/Rendering/VolumeOpenGL2/
vtkOpenGLGPUVolumeRayCastMapper.cxx#L3162
At that moment input.GradientOpacityTables, input.OpacityTables and
input.RGBTables are vtkSmartPointer with a nullptr as pointed object.
A quick fix is to change the code like so:
if( input.GradientOpacityTables ) input.GradientOpacityTables-
>ReleaseGraphicsResources(win);
But I am concerned I might be masking the symptom of my using vtkMultiVolume
the wrong way. Anybody out there who can help and tell me of a better way to
fix that bug?
Regards,
A. Ophagen
--
Dipl.-Übers. A. Ophagen
Dornheim Medical Images GmbH
Listemannstraße 10, 39104 Magdeburg, Deutschland
WWW: http://www.dornheim-medical-images.de/
E-Mail: info at dornheim-medical-images.de
Tel: +49 (391) 5054 57 0
Geschäftsführer: Lars Dornheim, Jana Dornheim
Eingetragen beim Amtsgericht Stendal, HRB 10737
More information about the vtkusers
mailing list