[vtkusers] vtkImageReslice question

David Gobbi david.gobbi at gmail.com
Thu Dec 17 11:36:09 EST 2009


Check the WholeExtent of the output from reslice.  By default, the
size of the OutputExtent is set to be large enough to fully contain
the transformed input Extent.  Try to imagine a rotated cube inside of
larger enclosing cube.  The volume of the outer cube can be many times
larger than that of the inner cube, especially for rotations of 45
degrees.

You need to set the OutputExtent of reslice to something reasonable
for your application.  Don't rely on the default output extent.  If
you are doing the reslicing so that you can view individual slices,
then set the output extent to just a single slice.

I'm not sure whether you are guilty of this, but I've seen several
people who use ImageReslice to rotate the whole volume, and then use
VOI or ImageClip or ImageActor to extract slices in the three
directions (axial, sagittal, coronal).  This is bad design, because
one of two things will happen: 1) on each render, each view requests a
different update extent, which forces reslice to re-execute on each
and every render. 2) if reslice.UpdateWholeExtent() is called, the
unnecessary re-executions don't occur, but a lot of memory is used.
The proper way to use reslice is to use one reslice per view
orientation.

   David


On Thu, Dec 17, 2009 at 9:00 AM, Andreas Brüning <mail-andi at web.de> wrote:
> Hello,
>
> ich have a problem when i use vtkImageReslice on a very large volume. Sometimes when i don't have enough memory for the reslice operation the global warningwindow appears. In there is written that vtk is unable to allocate an amount of memory. After this my program crashes immediately and i would like to catch this before it crashes. Is there a way get a notification when there is not enough memory? (maybe a callback function)
>
> Thanks in advance
> Andi



More information about the vtkusers mailing list