[vtkusers] The vtkImageConstantPad

David Gobbi david.gobbi at gmail.com
Wed Jun 23 08:10:35 EDT 2010


In order to pad on the left, you must adjust the image Origin and
Extent at the same time.  This can be done with
vtkImageChangeInformation, if you know the image spacing ahead of
time:

translator = vtkImageChangeInformartion();
translator.ExtentTranslation(padx, pady, padz);
translator.OriginTranslation(-padx*xspacing, -pady*yspacing, -padz*zspacing)

pad = vtkImagePadFilter()
pad.SetInputConnection(translator.GetOutputPort())
etcetera.

In all honesty, though, someone should add an option to
vtkImagePadFilter so that it can shift the image and pad it at the
same time.

  David


On Tue, Jun 22, 2010 at 10:55 PM, Darshan Pai <darshanpai at gmail.com> wrote:
> I want to use pad the MRI data with zero values . Now vtkImageConstantPad
> does what I need but it adds the constant only at the Positive ends of the
> dimension . Can I pad the data so that constant can be added to the zero
> ends .
>
> Regards
> Darshan
>
> _______________________________________________
> 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