[vtkusers] fastest way to precache orthogonal slices of a volume?

David Gobbi dgobbi at imaging.robarts.ca
Tue Jan 28 20:18:18 EST 2003


Hi Glen,

A lot of people are doing this with vtkImagePlaneWidget (in the CVS
version of VTK) or you can use vtkImageReslice (which has been around
forever) to extract the desired slice.  Both should be fast enough for
your needs.  Using SetScalars() like you mention below is not the way to
go if you want to take advantage of the VTK pipeline.

I cache all the data in whatever vtkImageData object I'm extracting
the slices from, using

  data->UpdateInformation();
  data->SetUpdateExtent(data->GetWholeExtent());
  data->Update();

This ensures that the whole volume (not just a portion of it) is
cached in the data object.  You should be able to get the speed
you want without cacheing a separate set of slices for each
direction.

 - David

-- 
  David Gobbi, MSc                dgobbi at imaging.robarts.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario


On Wed, 29 Jan 2003 Glen.Coates at csiro.au wrote:

> Hi,
>
> I'm writing an application in which the user sees orthogonal slices
> through a volume (of CT data).  The user is able to 'move' the slice
> through the volume within its limits to see the cross section at different
> places.  I'm trying to find the fastest way to implement this.
>
> At the moment, for each axis I'm storing the pixel data for every possible
> slice as a separate vtkDataArray*, and then for each user-movable slice
> there is a vtkActor*, vtkDataSetMapper*, and vtkStructuredPoints*, and as
> the slice is moved through the volume, I simply do a
> GetPointData()->SetScalars() on the structured points object to select the
> correct set of scalars for that part of the volume.
>
> Is this the best way to be doing this?  If not (as I expect), how can I
> make this more efficient, because performance at the moment is below par
> for the application I am seeking.
>
>




More information about the vtkusers mailing list