[vtkusers] Problem using vtkVolumeTextureMapper3D

Vidyadhar vidyadhar at lucidindia.net
Mon Sep 3 08:17:31 EDT 2007


Hi all,
I have problem using vtkVolumeTextureMapper3D class. Originally I developed my volume rendering using VTK 4.2 with Visual Studio 2003. In this, I was using vtkVolumeRayCastMapper. This was later migrated to VTK 5.0 and Visual Studio 2005. I wanted to try, other mappers available in VTK 5.0. My code and update strategy for original mapper migrated without any hitch. It seems to be working with vtkFixedPointVolumeRayCastMapper (I am less interested in using it). First let me outline how I setup my rendering and update it (as in original development that works for ray cast mappers).
1. Create a vtkStructuredPoints object of proper settings (origin,dimension, spacing and scalar type of unsigned short).
2. Fill all scalars with ZERO values (this is for my requirement)
3. Create volume with appropriate volume property, color/opacity transfer functions et cetera.
4. Add it to renderer, renderer to renderwindow.
5. I also have an outline added to renderwindow but I think that does not matter for the problem at hand.
6. RenderWindow becomes visible.
7. Data aquisation and data processing begins.
7. Result of data processing is used to update the structured points and updated volume is rendered. (Updates may happen several times).

Problem I have in using vtkVolumeTextureMapper3D is that the render window remains blank even after all data aquisation and processing is over. Interacting with render window (in case render has not occurred) also does not change the render window's appearance.

In Step 2 above, if I fill the scalars array with some high value then the render window shows rendered volume. As my data updating logic does not update all voxels when processing ends I cannot use this approach as it leaves regions of volume with wrong color.

This viewing related code is in separate class/control that I can use without the data aquisation/processing part. I can read vtkStructuredPoints data from disk file and view it. When I do this the volume displays as expected (resampling done internally is understandable).

I am wondering if this is happening when all scalars are ZEROs, because somewhere the mapper (or some related object) is encountering (possibly) divide by ZERO, going into an invalid state and not regaining valid state.

Is my doubt about divide by ZERO error correct? If so what I can do to avoid this problem? Delayed initialization is one thing that comes to my mind but that makes the code complex. Can anyone suggest me a way out of this situation?

Looking forward to any comments / suggestion from you. Let me know if some additional information is needed before this question can be addressed and I will provide that information.

Thanks and regards

Vidyadhar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070903/aaab1ff1/attachment.htm>


More information about the vtkusers mailing list