[vtkusers] Rotating image data

Jothy jothybasu at gmail.com
Fri Jul 9 09:54:10 EDT 2010


I used vtkTransfor mtho rotate a vtkImageData.

Jothy

On Fri, Jul 9, 2010 at 2:52 PM, Lic. José M. Rodriguez Bacallao <
jmrbcu at gmail.com> wrote:

> this may be a silly question:
> 1- which is the correct preffered way to rotate(transform) an image,
> with the camera or with vtkImageReslice?
> 2- does vtkImageReslice change/transform the pixel matrix?
>
>
> On Fri, Jul 9, 2010 at 7:34 AM, Jothy <jothybasu at gmail.com> wrote:
> > Some sort of padding befor rotation should help.
> >
> > Jothy
> >
> > On Fri, Jul 9, 2010 at 12:32 PM, Srinivasa Rao <
> srinivas at rsageventures.com>
> > wrote:
> >>
> >> Hi All,
> >>    I am trying to rotate vtkImageData using vtkTransform and
> >> vtkImageReslice, i used following code to do the job.
> >>
> >> vtkImageData * rotateImage(vtkImageData *data, QPointF center, int
> angle)
> >> {
> >>         vtkTransform *imageTransform = vtkTransform::New();
> >>         imageTransform->PostMultiply();
> >>         imageTransform->Translate(center.x(), center.y(), 0.0);
> >>         imageTransform->RotateZ(angle);
> >>        imageTransform->Translate(-center.x(), -center.y(), 0.0);
> >>         // Now create filter and set previously created transformation
> >>         vtkImageReslice *algo = vtkImageReslice::New();
> >>         algo->SetInput(data);
> >>         algo->SetInformationInput(data);
> >>         algo->SetResliceTransform(imageTransform);
> >>         algo->SetInterpolationModeToLinear();
> >>         algo->Update();
> >>         return algo->GetOutput();
> >> }
> >>
> >> When i try to rotate image data, after rotation the data which is
> outside
> >> the image is getting lost.
> >> Is there a way around to rotate image data without data loss..
> >> thanks in advance.
> >> regards,
> >> srinivas.
> >> _______________________________________________
> >> 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
> >>
> >
> >
> > _______________________________________________
> > 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
> >
> >
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -----------------------------------------------------------------
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -----------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100709/79a0cde8/attachment.htm>


More information about the vtkusers mailing list