[vtkusers] Faster slice display

TJ Wilkinson tswilkin at fas.harvard.edu
Mon Jun 18 15:56:59 EDT 2001


David-

Thank you for your help.  After implementing your suggestions, I have the
following observations and questions.

Turning double buffering on didn't seem to make much difference.  I was
also not able to successfully run reader->Update().  When you say "right
after you read the image", I am actually not certain about where that
happens.  At what point does the pipeline use the reader to read in data?
It seems obvious that the entire image is not in memory.  If I were to
delete the reader object after the constructor, for example, would I be
able to flit through slices?  

The image sets I am loading are at largest 1024 square with 360 slices.
Simply put, the maximum file size is about 1.3 GB.  The viewer setup I
have now seems to read the last 60 or so slices quickly, while the first
300 are slow.  To me, that says that the last 60 slices may be cached in
some way.

I know you said that the input volume size probably wouldn't matter too
much, but we do have rather large volumes and the performance differences
between volumes make me think that perhaps they are affecting performance.

What I would like to do in order to cope with the large volumes is to load
a 1/4 resolution set (the machines have 1GB of RAM) into some data
structure and use that as the source.  Could you point me in the right
direction?  Is vtkFloatArray an appropriate structure for this task, and
how do I utilize it as a source if it is?

Thank you so much for your prompt responses and knowledgeable advice.

Todd


On Mon, 18 Jun 2001, David Gobbi wrote:

> 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
> >
> 
> 
> _______________________________________________
> 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