[vtkusers] vtkImageResample, vtkImageReslice and WholeExtent

David Gobbi david.gobbi at gmail.com
Thu Apr 12 08:52:50 EDT 2012


Hi Ian,

Most of the vtkImageReslice methods are not applicable to
vtkImageResample.  In truth, vtkImageResample should not be subclassed
from vtkImageReslice, it wasn't ever meant to be used to reorient
images.

Use vtkImageReslice to reorient and resample the image in a single
step.  For your purposes, it is probably best to ignore
vtkImageResample altogether.

 - David


On Thu, Apr 12, 2012 at 2:55 AM, ianl <ilindsay at insigniamedical.co.uk> wrote:
> Hi all,
>
> Can anyone shed any light on this one. I am using vtkImageResample to
> resample and re-orientate a volume of image data. The resulting output
> extents don't seem to get re-orientated - ie they are the same as the input
> extents if the image resample scaling is 1. It is my understanding that if
> AutoCropOutput (on vtkImageReslice, vtkImageResample's base class) is set on
> and TransformInputSampling is set on, the original extents are permuted
> through the reslice axes.
>
> I have done a bit of investigation, and it seems that
> vtkImageReslice::GetAutoCroppedOutputBounds() never gets called when using
> the resample derived class as vtkImageResample overrides RequestInformation
> which does not seem to take this into account.
>
> I have read elsewhere that it is best to set output extent, origin and
> spacing externally, rather than rely on the default calculation. However,
> all I would do to calculate the extents is take the original eight corner
> points, run them through the relevent transforms and work out their max and
> min extents on each axis to get an enclosing volume. This seems to be more
> or less what GetAutoCroppedOutputBounds is doing, so I might as well leave
> it as the default setting.
>
> If I do the re-orientate with vtkImageReslice then the resample as separate
> steps, all is fine and the output extent seems correct.
>
> Is this behaviour by design or is this a possible bug? I am using a VTK 5.10
> build from a couple of months ago rather than the release candidate, so this
> may have been addressed, although I have not spotted a specific fix for it
> in the logs.
>
> Thanks,
> Ian Lindsay
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageResample-vtkImageReslice-and-WholeExtent-tp5635028p5635028.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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