[vtkusers] Faster slice display
David Gobbi
dgobbi at irus.rri.ca
Mon Jun 18 14:26:35 EDT 2001
Hi Todd,
Things to watch are:
1) make sure double-bufferring is on (makes a huge difference)
2) make sure that your OpenGL driver/card combination includes
accelerated image rendering -- many PCs don't. E.g. The nVidia cards
have only supported accelerated image rendering since the GeForce
series, on the nVidia TNT the image rendering is dead slow.
3) call 'reader.Update()' just after you read the image to ensure
that all slices are loaded into memory
You can take a look at a couple examples:
vtk/contrib/examplesPython/SliceViewer.py
vtk/python/vtkSliceViewerWidget.py
If you want to speed things up, the easiest thing is just to set
the reslice InterpolationMode to NearestNeighbor, this should provide
about a factor of two speedup. Changing the size of the input volume
actually won't make much difference to the speed. It's the size of the
output slice and the interpolation mode that matter.
Also, do not use "RotateX(90)" etc. to change the slice viewing direction
by 90 degrees, if you take a look at the matrix that is produced
you will notice that there are small roundoff errors. If you want
a matrix that permutes the axes, then use SetElement() to build that
matrix exactly. Because of the way that vtkImageReslice works, this
can result in huge differences in performance -- extracting slices that
are lined up with the axes is much faster than extracting oblique slices.
- David
--
David Gobbi, MSc dgobbi at irus.rri.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
On Mon, 18 Jun 2001, TJ Wilkinson wrote:
> I am working with vtkImageWindow, vtkImager, vtkActor2D, vtkMapper, etc,
> to try and display 2D volumes slicewise. I am using vtkImageReader to
> read the volumes.
>
> I would like to be able to pan through the slices faster than the simple
> pipeline ImageReader->Mapper->Actor->>Imager seems to allow. I would like
> to view a low-res version of the volume if it is possible to do it on the
> fly.
>
> Is there some way in VTK to buffer slices for faster viewing, or to load a
> low-res version of a volume into some array for fast viewing?
>
> Thanks.
>
> Todd
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list