[vtkusers] vtkReslice

David Gobbi dgobbi at irus.rri.on.ca
Wed Nov 22 09:44:40 EST 2000


Hi Amit,

The default OutputSpacing of vtkImageReslice is (1.0, 1.0, 1.0),
so unless the input data has this same spacing then the image will
be resampled add a lower/higher resolution.

When you use vtkImageReslice you should usually set the
OutputSpacing, OutputOrigin and OutputExtent explicitly.

Another warning: when you apply a transformation, the transformation
is applied around point (0, 0, 0) in the image.  If you kept the
original (MR/CT) scanner coordinates when you loaded the image into
VTK, then (0, 0, 0) will usually be somewhere near the centre of the
image.  Otherwise, (0, 0, 0) will be in the lower, left, rear corner
of the image unless you explicity set the ImageReader->DataSpacing when
you read it in.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Sat, 22 Jul 2000, amit saxena wrote:

> Hi,
>
>    I have a 3D dataset (extent 0-512,0-512,0-20) which I had shrunk
> usink vtkShrink3D. I got the extent as 0-63, 0-63, 0-8 as per my
> expectaions. But when I passed the data to imageResliceFilter,it just
> made the extent bigger to 0-504,0-504,0-18.This happens even if I have
> no transform function set for ImageReslice. Can anybody please help me
> why this is happening and how to solve this. My code looks something
> like this :
>
> Function(vtkImageData *data) {
>     ...
>     ...
>     vtkReslice *reslice = vtkReslice::New();
>    reslice->SetInput(data);
>
>    vtkImageViewer *viewer = vtkImageViewer::New();
>    viewer->setInput(reslice->GetOutput());
>    viewer->Render();
>    ...
>    ...
> }
>
> when I give data as the input to viewer I get the right result , but
> with reslice the size is bigger.
>
> Amit
>





More information about the vtkusers mailing list