I have an itk::Transform (specifically an itk::AffineTransform). I would like to know how much this transform rotates the Z-axis - i.e. the angle between (0,0,1) and the result of applying the transform to (0,0,1).
What is the most straight forward way to calculate this? Apply the transform and then calculate the dot product of the result with (0,0,1)? I feel like I am missing a more obvious way.
As you are interested in the effect of the transform on the vector [0,0,1], all you need to do is grab the third column of the matrix returned from GetMatrix(), A_3. The cosine of the angle is A_3[3]/norm(A_3) , using 1 based indexing here.