[vtkusers] Custom Mapper - vtkImageMapper3D

Sharmila Subbiah sharmimohan at yahoo.com
Mon May 21 13:27:52 EDT 2012


Hi,
 I am writing two custom classes, 
1)     vtkDerivedImageData derived from vtkmageData
2)     vtkDerivedImageMapper, derived from vtkImageSliceMapper
 
I am using them in the following way:
 
vtkDerivedImageData *derivedImageData = vtkDerivedImageData::New();
 
vtkDerivedImageMapper *derivedMapper = vtkDerivedImageMapper::New();
derivedMapper->SetInput(derivedImageData);
 
vtkImageActor *imageActor = vtkImageActor::New();
imageActor->SetMapper(derivedMapper);
 
When RenderWindow->Render() is called, the following is the callstack:
 
#0  vtkImageMapper3D::GetInput (this=0x10c8d00) at src/Rendering/vtkImageMapper3D.cxx:115
#1  0x00007ffff13add26 in vtkImageActor::GetInput (this=0x10b7ca0) at src/Rendering/vtkImageActor.cxx:85
#2  0x00007ffff13af007 in vtkImageActor::HasTranslucentPolygonalGeometry (this=0x10b7ca0) at src/Rendering/vtkImageActor.cxx:450
#3  0x00007ffff14cf8c9 in vtkRenderer::UpdateGeometry (this=0x10cccd0) at src/Rendering/vtkRenderer.cxx:644
#4  0x00007ffff15dce51 in vtkOpenGLRenderer::DeviceRender (this=0x10cccd0) at src/Rendering/vtkOpenGLRenderer.cxx:249
#5  0x00007ffff14cea30 in vtkRenderer::Render (this=0x10cccd0) at src/Rendering/vtkRenderer.cxx:347
#6  0x00007ffff14cca9a in vtkRendererCollection::Render (this=0xaacb70) at src/Rendering/vtkRendererCollection.cxx:54
#7  0x00007ffff14e3738 in vtkRenderWindow::DoStereoRender (this=0xaac910) at src/Rendering/vtkRenderWindow.cxx:731
#8  0x00007ffff14e361e in vtkRenderWindow::DoFDRender (this=0xaac910) at src/Rendering/vtkRenderWindow.cxx:698
#9  0x00007ffff14e30a7 in vtkRenderWindow::DoAARender (this=0xaac910) at src/Rendering/vtkRenderWindow.cxx:583
#10 0x00007ffff14e2650 in vtkRenderWindow::Render (this=0xaac910) at src/Rendering/vtkRenderWindow.cxx:394
 
The first call in the stack, vtkImageMapper3D::GetInput, returns NULL, and the rendering sequence stops here. My understanding is that setting derivedMapper->SetInput(derivedImageData) takes care of setting vtkImageMapper3D’s input correctly. But looks like it does not work this way.
 
Is there a way to set this vtkMapper3D’s input to the vtkDerivedImageData so that it returns a non-null value. 
 
Any help on this greatly appreciated.
 
Thanks,
Sharmila



More information about the vtkusers mailing list