[vtkusers] Image Rotation Before Blending

Sylvain Jaume sylvain.jaume at kitware.com
Mon Nov 7 14:55:23 EST 2005


Hi Mischa,

The axis of your transform is set to 0,0,0.
Try this: trans.RotateWXYZ(20,1,0,0)
Besides you might need vtkImageChangeInformation to center your image.

Cheers,
Sylvain

Mischa Thesberg wrote:

> I've been fiddling with that but how do I set up the pipeline (or 
> import a transform) that does it.  At the moment I have it working 
> something like this.
>
> slice = vtk.vtkImageReslice
> slice.SetInput(pngReader.GetOutput())
> trans = vtk.vtkTransform
> trans.RotateWXYZ(20,0,0,0)
> slice.SetResliceTransform(trans)
> merge.SetInput(1,slice.GetOutput())
>
> what am I doing wrong?
>
> Sylvain Jaume wrote:
>
>> Hi Mischa,
>>
>> Have a look at vtkImageReslice.
>> You night need vtkImageChangeInformation to recenter your image.
>>
>> Cheers,
>> Sylvain
>>
>> Mischa Thesberg wrote:
>>
>>> Hi,  I am making a program that requires the blending of two images 
>>> using vtkImageBlend.  The first Image is acquired data and the 
>>> second image is a crosshair of sorts that gets overlayed to indicate 
>>> a certain region.  What I want to do is to rotate this second, 
>>> crosshair image (which is composed of a funny little shape near the 
>>> center and the rest is set to transparent) before I merge it with 
>>> the first.  Both images are 508 x 508.  I am wondering what class 
>>> (or combination of classes) is best for this task?  My best guess is 
>>> that there must be some image rotation type filter which then must 
>>> be coupled with a class that lets you reset the images extent (so 
>>> that it is 508 x 508 square again) but I really don't know and I 
>>> find it very difficult to find the right class to do a task in vtk.  
>>> If anyone could tell me which class would be best or can provide any 
>>> advice many thanks in advance.
>>> _______________________________________________
>>> This is the private VTK discussion list. Please keep messages 
>>> on-topic. Check the 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