SimpleITK Apply VersorRigid3DTransform to Image Direction

Hi board,

Is there an easy way to apply a VersorRigid3DTransform to a SimpleITK image direction and get the corresponding transformed image direction?

Another way to state my question might be: Are there easy ways to get the rotation matrix of the VersorRigid3DTransform that would correspond to rotation about the global coordinate system rather than the transform’s center of rotation, so that I can multiply it with the SimpleITK image direction matrix to get a new direction matrix?

The (rotation) matrix for the VersorRigid3DTransform (and all transforms?) corresponds to rotation around the origin (0, 0, 0), so that answers my question.

Hello @Nick_Rubert,

Generally speaking the rotation represented by a VersorRigid3DTransform is not around (0,0,0), it is around an arbitrary center (see documentation on read-the-docs).

As you want to apply the transform to a vector, the location of the center of rotation doesn’t matter. Use the transform’s TransformVector method on the columns of the direction matrix.

1 Like