[Insight-users] Registration in ITK and visualization in VTK - transform questions

Luis Ibanez luis.ibanez at kitware.com
Mon Sep 3 18:01:22 EDT 2007


Hi Michael,

1) Yes both ITK and VTK use right-hand coordinate systems,

2) ITK does not perform visualization,

    there is no screen,
    there is no left
    there is no top

      the reference system *IS* the reference system

    BTW in VTK, there is no "left" either, since for that
    to make sense you must specify where do you assume that
    you located your camera in space, in what direction you
    are locking at, and what is the Up vector of the camera.

3) Again...

    there is no "Left".

    the system *is* right handed,...

    so

    *IF* you position your camera (head)

            in location (0,0,100),
            looking at point (0,0,0) and
            using an Up vector (0,1,0),

     THEN

           you will "see" the positive X-axis
           pointing towards the "right"
           you will "see" the positive Y-axis
           pointing towards the "up" direction
           and the positive Z-axis pointing
           out of the screen towars your eye.


4) NO, you don't need to rotate anything,
    the coordinate system IS the coordinate system,
    they are compatible between ITK and VTK.

    You are probably confused if you have loaded images
    in ITK and the same images in VTK. They will appear
    with the Y axis reflected. This is a historical issue
    and relates to the fact that for display purposes
    in computer graphics there is a tendency to align
    the camera in such a way that the positive Y axis is
    pointing down.

    All that assumption becomes irrelevant once you realize
    the *YOU* must define the position and orientation of
    the camera.

5) ITK Transform do not have a notion of physical to image space.
    They are PhysicalSpace TO PhysicalSpace.

6) YES, here you arrived to a correct conclusion
    but through *wrong* arguments.


----

    Please,

            FORGET ALL YOUR REASONING
            IT CLOUDS YOUR VISION

    Go back to the basics, it is actually quite simple.

    There is a right-handed coordinate system,
    the same in ITK and VTK.

    You must put your camera in a location in space,
    (defined in term of that coordinate system)
    aim the camera to a point in space
    (defined in term of that coordinate system)
    orient the camera to have a vertical direction
    (defined in term of that coordinate system)


    Then you can start populating your scene.


    It looks like you are doing Image Registration
    and somehow displaying the results using VTK.


    Maybe you should tell us more about the real
    problem that you are trying to solve....



      Thanks



         Luis



------------------------
Michael Schildt wrote:
> Hello, I wrote this question a cupple of days ago at vtk-userlist, but
> no answers yet. Maybe someone here can clarify some issues.
> 
> Best requards,
>    M. Schildt
> 
> Michael Schildt schrieb:
> 
>> Hi!
>>
>> Seems nobody is willing or beeing able to answer my questions. In the 
>> meantime i have read all threads related to "vtk itk transform", the 
>> VTK book transformsections and in the ITK-Guide too. And it is still 
>> confusing me. But i present the facts i collected. Maybe someone can 
>> comment on them, please.
>>
>> 1) ITK and VTK, both using right-hand coordinate systems ?
>> 2) For ITK the x-axis goes to the left, the y-axis to the top and the 
>> z-axis to the front ?
>> 3) For VTK the x-axis goes to the left, the y-axis to the bottom and 
>> the z-axis to the back ?
>> 4) That means a 180° rotation (of the vtkCamera) around the x-axis 
>> will align both coordinate systems ?
>> 5) in ITK transforms the physical to image space, while vtk transforms 
>> actor(image) to physical space ?
>> 6) So most of the time, in ITK i use the inverse of the vtk transform, 
>> and vice versa ?
>>
>> Best Requards,
>>    Michael Schildt
>>
>> Michael Schildt schrieb:
>>
>>> Hello Everybody!
>>>
>>> I want to display the progress of a intermodal 3D registration with 
>>> an centered affine transform. So every iteration I catch the 
>>> intermediate transform parameters and want to display them with VTK. 
>>> It was mentioned often that way but i didn't find any concrete example.
>>>
>>>       // get transform parameter in ITK
>>>      AffineType::InputPointType C = transform->GetCenter();
>>>      AffineType::MatrixType M = transform->GetMatrix();
>>>      AffineType::OutputVectorType T = transform->GetTranslation();
>>>
>>> I visualize the two datasets via outline filter as suggested in the 
>>> ITK documentation. But I ren into some issues because of the 
>>> different coordinate systems ITK(mathematical convetion - origin in 
>>> the lower left corner) and VTK (graphical convention - origin in the 
>>> upper left corner) are using:
>>>
>>> 1. I flipped the y-axis of both images using ITKs flip filter. By 
>>> that the origin's y coordinate changes too, but that is not intended 
>>> or is it?
>>> 2. How to convert efficiently between the two coordinate systems for 
>>> the affine transform - perhaps just inverting the y-axis?
>>> 3. Related to 2. question how to put the data from ITK (center, 
>>> translation, matrix) into the VTK AffineTransform? I would build a 
>>> VTK 4x4 Matrix from the ITK 3x3 matrix + transform. But how to 
>>> integrade the center of rotation and scaling?
>>>
>>> At the Moment I set Origin and Translation only:
>>>
>>>    // vtk set transform parameter
>>>    // moving is a vtkActor
>>>      moving->SetOrigin(C[0],C[1],C[2]);
>>>      moving->SetPosition(T[0],T[1],T[2]);
>>>      renderwin->Render();
>>>
>>> Greetings,
>>>    Michael Schildt
>>>
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list