[Insight-developers] Question about MIRegistration
Ross Whitaker
whitaker@cs.utah.edu
Thu, 20 Feb 2003 14:52:47 -0700
Hi Folks,
The MIRegistration appliation (3D rigid) spits about a file that looks
like this:
set study1Prefix "/scratch/research/mrangiog/BB"
set study1ByteOrder "BigEndian"
set study1Extent "0 511 0 1039 1 140"
set study1Spacing "1 1 1"
set study2Prefix "/scratch/research/mrangiog/wb"
set study2ByteOrder "BigEndian"
set study2Extent "0 511 0 1039 1 120"
set study2Spacing "1 1 1"
set rotateX 1.18844
set rotateY -0.424268
set rotateZ 0.328555
set translate "16.3099 2.70433 -4.72612"
However, it is not clear how to interpret the rigid transformation
part of this file. One way to go is to look at how it is created.
This would be from the vtk object , aTrans, in the application. The
output is:
fptr << "set rotateX "
<< aTrans->GetOrientation()[0] << std::endl;
fptr << "set rotateY "
<< aTrans->GetOrientation()[1] << std::endl;
fptr << "set rotateZ "
<< aTrans->GetOrientation()[2] << std::endl;
fptr << "set translate \""
<< aTrans->GetPosition()[0] << " "
<< aTrans->GetPosition()[1] << " "
<< aTrans->GetPosition()[2] << "\"" << std::endl;
However, I can't find documentation in VTK (looked at the code and the
on-line docs---not much there). For instance, if these are Euler
angles, what order does the rotation take place in? Is it (XYZ)p or
(ZYX)p (where p is a point vector). Furthermore the VTK gui that
reads and displays the results of this registration reads this file
using the following code:
if {[info exists matrix] == 0} {
eval transform Translate $translate
transform RotateZ $rotateZ
transform RotateX $rotateX
transform RotateY $rotateY
} else {
eval transform SetMatrix $matrix
}
Because the transforms in VTK assume a premultiply, this would imply
that the transformation matrix is built like
TZXYp
That is, rotate around the y axis before the x and the z. This is
very odd. Is this the VTK default. If not, isn't this a bug?
Also, it doesn't say where the origin is. Do I assume that all
transformation occur with the origin located at the pixel position (0,
0, 0)?
Regards,
Ross
--------------------------
Ross T. Whitaker, Assistant Professor
50 S. Central Campus Drive, Rm. 3190
University of Utah
Salt Lake City, UT 84112-9205
voice: 801/587-9549, fax: 801/581-5843
web: www.cs.utah.edu/~whitaker