[vtkusers] Rotating image data

Lic. José M. Rodriguez Bacallao jmrbcu at gmail.com
Fri Jul 9 09:52:29 EDT 2010


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
-----------------------------------------------------------------



More information about the vtkusers mailing list