<HTML>
<HEAD>
<TITLE>Convert Rigid3DTransform To VersorRigid3DTransform</TITLE>
</HEAD>
<BODY><P><FONT face="Lucida Console">
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello All,<BR>
<BR>
I have a program that generates rho, phi, theta rotation euler angles, and I can easily generate the rotation matrix for creating the Rigid3DTransform.<BR>
<BR>
I now need to c</SPAN></FONT><FONT SIZE="1"><FONT FACE="Lucida Grande"><SPAN STYLE='font-size:10px'>onvert Rigid3DTransform to VersorRigid3DTransform so that I can initialize a mutual information registration with it. <BR>
<BR>
Could anyone provide some advice on how to perform this conversion?<BR>
<BR>
Thanks,<BR>
Hans<BR>
<BR>
PS: The following code does not work.<BR>
===========================<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>typedef itk::Rigid3DTransform&lt;double&gt; RigidTransformType;<BR>
typedef itk::VersorRigid3DTransform&lt;double&gt; VersorTransformType;<BR>
<BR>
VersorTransformType::Pointer ConvertToVersorRigid3D(RigidTransformType::Pointer RT)<BR>
{<BR>
&nbsp;&nbsp;VersorTransformType::Pointer VT=VersorTransformType::New();<BR>
&nbsp;&nbsp;VT-&gt;SetFixedParameters(RT-&gt;GetFixedParameters());<BR>
<BR>
&nbsp;&nbsp;itk::Matrix&lt;double,3,3&gt; R=RT-&gt;GetRotationMatrix();<BR>
&nbsp;&nbsp;RigidTransformType::TranslationType T=RT-&gt;GetTranslation();<BR>
<BR>
&nbsp;&nbsp;VersorTransformType::ParametersType p;<BR>
&nbsp;&nbsp;p.SetSize(6);<BR>
&nbsp;&nbsp;itk::Versor&lt;double&gt; v;<BR>
&nbsp;&nbsp;v.Set(R);<BR>
&nbsp;&nbsp;//Get the first 3 elements of the versor;<BR>
&nbsp;&nbsp;p[0]=v.GetRight()[0];<BR>
&nbsp;&nbsp;p[1]=v.GetRight()[1];<BR>
&nbsp;&nbsp;p[2]=v.GetRight()[2];<BR>
&nbsp;&nbsp;p[3]=T[0];<BR>
&nbsp;&nbsp;p[4]=T[1];<BR>
&nbsp;&nbsp;p[5]=T[2];<BR>
&nbsp;&nbsp;VT-&gt;SetParameters(p);<BR>
&nbsp;&nbsp;return VT;<BR>
}<BR>
<BR>
<BR>
</SPAN></FONT>
</FONT></P>
<P><FONT face="Lucida Console" color=#808080 size=1>Notice: This UI Health Care 
e-mail (including attachments) is covered by the Electronic Communications 
Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally 
privileged.&nbsp; If you are not the intended recipient, you are hereby notified 
that any retention, dissemination, distribution, or copying of this 
communication is strictly prohibited.&nbsp; Please reply to the sender that you 
have received the message in error, then delete it.&nbsp; Thank you.</FONT></P>
<P><FONT face="Lucida Console"></FONT></P></BODY>
</HTML>