[Insight-users] Definition of a plane or image frame in VTK/ITK

Thomas - Kuiran Chen chent at cs.queensu.ca
Tue May 25 14:30:43 EDT 2004


Hi,

As this question might be related to both VTK and ITK, so I posted in both forums.

I am having some positional errors when attempting to place an 2D image plane or polydata plane inside the world coordinating system.  All the transforms (in homogeneous 4x4 matrix) were validated in our experimental set ups thus the errors were unlikely from the transforms.

My question is: what exactly is the default origin/frame/coordinating system definition in VTK/ITK for a 2D plane data?  I.e.: in the left-lower corner, left-upper corner, or center of the plane?  According to the VTK UserGuide, I understand for a vtkImageData, the default origin is set to be left-lower corner.  But when I assume the same for a 2D plane (in poly data format), the position in space is always not correct after applying the transforms.

The reason that the frame/origin defintioin is important to us is that the transform we used to transform the 2D image plane to a 3D space is w.r.t a virtual pre-defined image frame in our 2D image.  So in order to apply the transform, all the points in the image plane has to be firstly transformed to this virtual frame then to apply the transform:

VTK/ITK 2D image frame or 2D plane/polydata frame-> Our system defined virtual 2D frame -> apply the transform -> 3D space.

I've tried various ways, and please correct me if there is anything I did wrong or missed, :-).

1. Use texture mapping:
- vtkImageData -> vtkTexture
- vtkPlaneSource -> use vtkTransformPolyData to position the plane (this is the only place to apply the transform, as I am not doing it in the vtkActor)
- vtkActor and vtkPolyDataMapper to finally visualize the data.
Error: The scale (which is included in the same homogeneous matrix) is largely wrong (too small to be even visible).

2. Use vtkImageActor:
- vtkImageReader -> read in the 2D image then apply the transform using ::SetTransform().
- Piped into vtkImageActor for directly visualization
Error:  vtkImageReader seems to be unable to handle the transform (gave file operation errors), and the result is a while plane in the space (therefore no way to exam the scaling or positional accuracy).

3. Use vtkPolyData
- convert vtkImageData to vtkPolyData using vtkImageToPolyDataFilter.
- piped to vtkActor and apply the transform to the vtkActor
Error: this seems to be most satisfactory as the two subject in the scene are greatly aligned but there is visible translation errors still.

I appreciate any advice and help, :-).

Thanks,

Thomas





More information about the Insight-users mailing list