[vtkusers] vtkImageReslice question

David Gobbi dgobbi at irus.rri.ca
Wed Jun 19 15:41:30 EDT 2002


Hi Mathieu,

The reason for the black border is that vtkImageReslice assumes that
the 'background' grey level beyond the input image border is zero.
So when you use interpolation, the edge pixel of the output image will
contain a certain amount of blackness.

This is easy to fix, for most images you can use

reslice->MirrorOn()

which will essentially duplicate the edge pixels for the purpose of
interpolation.  Or, if the image is an MRI, you should use

reslice->WrapOn()

which will wrap around to the opposite edge of the image when pixels
beyond the edge are needed for the interpolation.

 - David

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

On Wed, 19 Jun 2002, Mathieu Malaterre wrote:

> Hi all,
>   I used vtkImageReslice to generate an anisotropic volume (from a minc
> image). So I did:
>
> reslice = vtkImageReslice()
> reslice.SetInput(reader.GetOutput())
> reslice.SetOutputSpacing(1,1,1)
> reslice.SetInterpolationModeToCubic()
> reslice.Update()
>
> At the end my volume has the good spacing. But when I display it, the
> border are black instead of white ?
> (by border I mean x=0 , y=0 , z=0, x=xmax, y=ymax and z=zmax ). Does
> anyone knows how to avoid this ? Or at least how to remove them ?
>
> thanks
> Mathieu
>




More information about the vtkusers mailing list