[vtkusers] vtkTransform to transform vtkImageData

Jonathan Ruiz Peinado jonathan.ruiz3 at gmail.com
Fri Jun 29 11:15:28 EDT 2012


---------- Forwarded message ----------
From: Jonathan Ruiz Peinado <jonathan.ruiz3 at gmail.com>
Date: 2012/6/29
Subject: Re: [vtkusers] vtkTransform to transform vtkImageData
To: David Doria <daviddoria at gmail.com>


Sure,

I think that I'm not getting the output from vtkTransformFilter correctly,
I did it the simplest way I though to see if I was lucky but seems that is
not that easy.

Thinking a bit more I guess that vtkDataImage has to be built using the
output , but not sure how.

---------------------------------------------------

vtkTransform work_axis_transform = new vtkTransform();
work_axis_transform.Translate(0,0,0);

vtkTransformFilter work_axis = new vtkTransformFilter();
work_axis.SetTransform(work_axis_transform);

work_axis.SetInput(DicomStudio.dicomImage.getOutput());
vtkimageData test = (vtkImageData) work_axis.GetOutputDataObject(0);
test.GetSpacing();
----------------------------------------------------------------------------------------------------------

test.getSpacing(); trying to access to a null pointer.

Thanks.

2012/6/29 David Doria <daviddoria at gmail.com>

> On Fri, Jun 29, 2012 at 10:45 AM, Jonathan Ruiz Peinado
> <jonathan.ruiz3 at gmail.com> wrote:
> > Hi, I need to apply some transformations to a vtkImageData, I though
> that I
> > could use vtkTransform or vtkTransformFilter to setup  the trasnformation
> > put my imageData as input and get the result as the output of
> > vtkTransformFilter, but it's seems not that easy, there's some example
> about
> > it around or something I'm missing.
> >
> > Thanks.
>
> Can you tell us what isn't working? Compiler errors? Incorrect
> results? Also please show the code you are using in a very simple
> example case.
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120629/d027bcf9/attachment.htm>


More information about the vtkusers mailing list