[vtkusers] volume rendering performance

Lisa Avila lisa.avila at kitware.com
Thu Mar 9 14:45:01 EST 2006


Just for clarification:

If you are using vtkImageData as input, you should use a subclass of 
vtkVolumeMapper to render it. Here are the varieties:

vtkVolumeRayCastMapper: this is a ray caster that works with single 
component vtkImageData with a scalar type of unsigned char or unsigned 
short. It is the oldest of the volume mappers, and is generally the 
slowest. It does perform calculations in floating point, and it does have 
an easy way to subclass the specific "ray cast function" if you want to do 
something special along the ray (VTK contains functions for composite, MIP, 
and isosurface, but you could write one to compute an x-ray, or the median 
value, or whatever)

vtkVolumeTextureMapper2D: this mapper also supports on unsigned char or 
unsigned short single component data. It will use 2D texture mapping 
(pretty much available on every computer now) to render the volume. You 
will get popping artifacts as you rotate around (switch major viewing 
direction)

vtkFixedPointVolumeRayCastMapper: this is a replacement for 
vtkVolumeRayCastMapper. It will render any data type, with up to four 
components. The calculations are performed in fixed point for added 
performance, and space leaping is used to skip empty regions.

vtkVolumeTextureMapper3D: if your graphics card supports 3D texture 
mapping, then this mapper can be used to render your volume. Note: the 
volume will be resampled to a power of two small enough to fit on the 
graphics card (in most cases I believe this is limited to 256x256x128 total 
voxels)

If you have vtkUnstructuredGrid as input, then you should use a subclass of 
vtkUnstructuredGridVolumeMapper to render it. Of those, the 
vtkProjectedTetrahedraMapper is by far the fastest, although the other two 
provide more accurate results.

I am surprised by the quotes of "30 minutes per frame" for rendering. My 
best guess is that the data is too large to fit into memory and some 
serious swapping is occurring, or perhaps the sample distance is set to 
something ridiculously small compared to the data spacing. Rendering times 
for a typical medical data set (short data, one component, 512x512x200) 
rendered into a 512x512 window with a sample distance of about 1/2 the 
average sample spacing typically range from a few seconds up to perhaps a 
minute depending on the transfer function used  (more empty space / 
surface-like rendering == faster rendering) Using the built-in LOD 
functionality in either of the ray cast volume mappers you can achieve 
interactive rendering rates by trading image quality (number of rays 
actually cast) for performance.


Lisa





At 05:52 PM 2/16/2006, Wylie, Brian wrote:
>All,
>
>The vtkProjectedTetrahedraMapper is for unstructured data and using it
>on structured data is not going to work well (that obviously is an
>understatement :)
>
>   Brian Wylie - Org 9227
>   Sandia National Laboratories
>   MS 0822 - Building 880/A1-J
>   (505)844-2238 FAX(505)845-0833
>        ____                  _    __
>       / __ \____  _________ | |  / (_)__ _      __
>      / /_/ / __ `/ ___/ __ `/ | / / / _ \ | /| / /
>     / ____/ /_/ / /  / /_/ /| |/ / /  __/ |/ |/ /
>    /_/    \__,_/_/   \__,_/ |___/_/\___/|__/|__/
>
>                                     Unleash the Beast
>
>
> > -----Original Message-----
> > From: vtkusers-bounces+bnwylie=sandia.gov at vtk.org
> > [mailto:vtkusers-bounces+bnwylie=sandia.gov at vtk.org] On
> > Behalf Of flin at enders.tch.harvard.edu
> > Sent: Thursday, February 16, 2006 2:18 PM
> > To: Mark Wyszomierski
> > Cc: vtkusers at vtk.org
> > Subject: Re: [vtkusers] volume rendering performance
> >
> > Sorry for taking me so long to get back to this.
> >
> > I tried FixedPointRayCastMapper and VolumeTextureMapper3D. I
> > didn't see much improvement with FixedPoint, could that
> > because I don't have dual processors?  or is there something I missed?
> > With VolumeTextureMapper3D, the speed is twice as fast as the
> > RayCastMapper, however, it seems only working for certain
> > type of data ( I created a sphere and a block, only the
> > sphere shows up with 3d texture).
> > Does anyone have some explanation for that?
> >
> > Thanks.
> >
> > /faith
> >
> >
> > > That's really interesting, for me the ProjectedTetra was so time
> > > consuming I ended up rendering only one slice of my volume
> > so I could
> > > at least see some output. I do have many variations in opacity, my
> > > dataset is of a chest (I don't have much 'dead' space around the
> > > organs), so it sounds like this may really be a bad use of
> > > ProjectedTetra.
> > >
> > > All my output is interactive, fixed point/3d texture have
> > been pretty
> > > decent when it comes to responsiveness, except if the
> > camera moves too
> > > close to the volume. The ray cast mapper looks the 'nicest' but it
> > > really takes too long to be used interactively for me. I was hoping
> > > that the responsiveness of ProjectedTetra would be good
> > once ready for
> > > display, but it actually had the worst interactivity out of
> > the bunch,
> > > even with one slice. Besides the opacity issue, I believe
> > the ray cast
> > > mapper etc have built in functions to reduce the quality of the
> > > rendering while the user is interacting, which is very nice.
> > >
> > > Thanks for sharing your experience,
> > > Mark
> > >
> > >
> > >
> > >
> > > On 2/7/06, Randall Hand <randall.hand at gmail.com> wrote:
> > >>
> > >> The last dataset I used was a 512-cube, stored as a vtkImageData I
> > >> believe.  One thing that greatly effects rendering time is
> > the level
> > >> of opacity you have.  in my case, I had large regions of the space
> > >> that were going to be completely transparent (accumulated
> > opacity =
> > >> 0.0), with only a small fireball in the center to render.  If I
> > >> adjusted my transfer function so that larger regions were
> > rendered,
> > >> then the render time increased.
> > >>
> > >> Using a fixed transfer function that rendered only the
> > small portion
> > >> of the dataset I wanted to see, the FixedPoint mapper was
> > abysmal at
> > >> about 30 minutes per frame, and the ProjectedTetra mapper works in
> > >> about 6 minutes (with the DataSetTriangleFilter time
> > included).  All
> > >> of my stuff is non-interactive, being dumped directly to
> > PNG images
> > >> on disk.
> > >>
> > >> On 2/7/06, Mark Wyszomierski <markww at gmail.com> wrote:
> > >> >
> > >> > Hi Randall, Faith,
> > >> >
> > >> > I gave vtkProjectedTetrahedraMapper a try for the first
> > time today
> > >> > but
> > >> I
> > >> > experienced the longest render times with it out of any of the
> > >> > other mappers. I'm wondering what your input data being rendered
> > >> > is? Mine is
> > >> a
> > >> > vtkImageData volume with dimensions of 256x256x56. The
> > fixed point
> > >> mapper or
> > >> > 3d texture mapper give me the fastest results.
> > >> >
> > >> > Mark
> > >> >
> > >> >  On 2/6/06, Randall Hand <randall.hand at gmail.com > wrote:
> > >> > >
> > >> > > I think the best results will actually come from using the
> > >> > > vtkProjectedTetrahedraMapper -
> > >> > > http://www.vtk.org/doc/release/5.0/html/a01919.html
> > >> > >
> > >> > > I've pretty much tried them all.  The
> > vtkVolumeRayCastMapper took
> > >> > > about an hour to generate an image for me, the
> > >> vtkFixedPointRayCastMapper
> > >> > > cut it down to about 30 minutes.  The
> > >> > > vtkProjectedTetrahedraMapper
> > >> takes the
> > >> > > cake, however, at a whopping 5 minutes.
> > Unfortunately, it does
> > >> > > take
> > >> alot
> > >> > > more memory as it requires you to "tetrahedralize" your mesh.
> > >> > >
> > >> > > On 2/6/06, flin at enders.tch.harvard.edu
> > >> > > <flin at enders.tch.harvard.edu
> > >> >
> > >> > > wrote:
> > >> > > >
> > >> > > > Hello all,
> > >> > > >
> > >> > > > I need some advice on how much imporvement the
> > >> > > > vtkFixedPointVolumeRayCastMapper will make vs. regular
> > >> > > > vtkVolumeRayCastMapper ?  I'm doing volume rendering
> > of roughly
> > >> > > > 250x80x150 voxels, and the speed is unacceptable.   Any
> > >> suggestions
> > >> > > > on how
> > >> > > > to speed up?  Specifically, how to use hardware to
> > accelerate it?
> > >> > > >
> > >> > > > Thanks.
> > >> > > >
> > >> > > > /faith
> > >> > > >
> > >> > > >
> > >> > > > _______________________________________________
> > >> > > > This is the private VTK discussion list.
> > >> > > > Please keep messages on-topic. Check the FAQ at:
> > >> http://www.vtk.org/Wiki/VTK_FAQ
> > >> > > >
> > >> > > > Follow this link to subscribe/unsubscribe:
> > >> > > > http://www.vtk.org/mailman/listinfo/vtkusers
> > >> > > >
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Randall Hand
> > >> > > Visualization Scientist,
> > >> > > ERDC-MSRC Vicksburg, MS
> > >> > > Homepage: http://www.yeraze.com
> > >> > > _______________________________________________
> > >> > > This is the private VTK discussion list.
> > >> > > Please keep messages on-topic. Check the FAQ at:
> > >> > > http://www.vtk.org/Wiki/VTK_FAQ
> > >> > > Follow this link to subscribe/unsubscribe:
> > >> > > http://www.vtk.org/mailman/listinfo/vtkusers
> > >> > >
> > >> > >
> > >> > >
> > >> >
> > >>
> > >>
> > >> --
> > >> Randall Hand
> > >> Visualization Scientist,
> > >> ERDC-MSRC Vicksburg, MS
> > >> Homepage: http://www.yeraze.com
> > >>
> > >
> >
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ Follow this link to
> > subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list