[Insight-users] How to set Arbitrary Center of Rotation

Daniel Blezek Blezek.Daniel at mayo.edu
Thu May 7 13:05:13 EDT 2009


Mike,

  As I sent the note, I realized that you may have the idea.  More
practically, you can use itkCenteredAffineTransform.h or
itkCenteredEuler3DTransform.txx.  The center of rotation is encoded in the
parameters, but (I believe) part of the optimization process.  You can set
the optimizer weights appropriately to restrict the center from changing.

For itkCenteredEuler3DTransform, the .txx file states above the
SetParameters call:

// p[0:2] = rotations about x, y and z axes
// p[3:5} = center of rotation
// p[6:8] = translation
So p[3] - p[5] are the center of rotation (not sure if it's in voxel or
spatial dimensions).

So a fair initialization vector might be
P = {0, 0, 0, cx, cy, cz, 0, 0, 0};

Does this help?
-dan


On 5/7/09 11:57 AM, "Mike Jackson" <mike.jackson at bluequartz.net> wrote:

> Thanks for the help. I do understand conceptually what needs to be
> done how ever transforming that into code is another feat to do. I'll
> take another look through the ITK users guide to see what code
> examples I can come up with.
> 
> Cheers
> Mike
> 
> On Thu, May 7, 2009 at 10:00 AM, Daniel Blezek <Blezek.Daniel at mayo.edu> wrote:
>> Hi Mike,
>> 
>>  I usually think of this as a composition of three homogeneous transforms.
>> If we let C be the point you'd like to rotate around, and T_{R} be the
>> rotation you want to apply.
>> 
>> T_{all} = T_{C} * T_{R} * T_{-C}
>> 
>> Any point in homogeneous form can be multiplied as:
>> 
>> P' = T_{all} * P
>> 
>> This will first shift the image so it's origin is at the point C, then
>> rotate about the point, and finally undo the first translation.  The
>> operations are applied in a right to left order.  (Forgive me if this was
>> pedantic).
>> 
>> Best regards,
>> -dan
>> 
>> 
>> On 5/6/09 3:52 PM, "Mike Jackson" <mike.jackson at bluequartz.net> wrote:
>> 
>>> I am trying to register  a pair of images. There is a rotation
>>> involved and I know (through manual means) that the center of rotation
>>> is somewhere in the upper left of the image. What registration methods
>>> would support this type of rotation? I have been working through the
>>> Centered2DRegistration code to try and understand what is going on. It
>>> would seem like I just need to apply an initial translation to the
>>> images to get the upper left corner of the image into the "middle" of
>>> the registration space? Is that correct?
>>> 
>>> Thanks
>> 
>> --
>> Daniel Blezek, PhD
>> Medical Imaging Informatics Innovation Center
>> 
>> P 127 or (77) 8 8886
>> T 507 538 8886
>> E blezek.daniel at mayo.edu
>> 
>> Mayo Clinic
>> 200 First St. S.W.
>> Harwick SL-44
>> Rochester, MN 55905
>> mayoclinic.org
>> 
>> 
>> 

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org




More information about the Insight-users mailing list