<DIV>Thank you Xiaodong, Junyi and Luis,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I change the metric of imageRegistration8 from MeanSquareImageToImageMetric to MattesMutualInformationImageToImageMetric and it runs&nbsp;no more than&nbsp;2 minutes! Thank you very much!</DIV>
<DIV>&nbsp;</DIV>
<DIV>However, I have other problem :(.</DIV>
<DIV>I would like to know how to convert VersorRigid3DTransform to vtkTransform.</DIV>
<DIV>I have displayed the Fixed and the Moving Image using VTK. Now, what I want to do is I would send all the versors and translations from VersorRigid3DTransform to vtkTransform from each iteration of the registration process, so that the Moving Image is moved showing the registration process&nbsp;from each iteration.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have one class that inherits itk::Command and has Execute method. Inside this method, I call:</DIV>
<DIV>&nbsp;</DIV>
<DIV>pTransform-&gt;RotateX(optimizer-&gt;GetCurrentPosition()[0])</DIV>
<DIV>pTransform-&gt;RotateY(optimizer-&gt;GetCurrentPosition()[1])</DIV>
<DIV>pTransform-&gt;RotateZ(optimizer-&gt;GetCurrentPosition()[2])</DIV>
<DIV>pTransform-&gt;Translate(optimizer-&gt;GetCurrentPosition()[3],</DIV>
<DIV>optimizer-&gt;GetCurrentPosition()[4],</DIV>
<DIV>optimizer-&gt;GetCurrentPosition()[5])</DIV>
<DIV>&nbsp;</DIV>
<DIV>pTransform is of type vtkTransform*.</DIV>
<DIV>But this code give wrong transformation.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have also tried to set the optimizer-&gt;GetCurrentPosition() values to vtkMatrix4x4 and then call :</DIV>
<DIV>pTransform-&gt;SetMatrix(theMatrix) </DIV>
<DIV>but this gives me also wrong transformation. "theMatrix" is of type vtkMatrix4x4.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any hint would be really appreciated.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best regards,</DIV>
<DIV>.Tanya.</DIV>
<DIV><BR><BR><B><I>Tao, Xiaodong (Research)" &lt;taox@research.ge.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1515" name=GENERATOR>
<DIV><FONT face=Arial size=2><SPAN class=472375612-30092005><STRONG>Tanya,</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=472375612-30092005><STRONG></STRONG></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=+0><SPAN class=472375612-30092005><FONT face=Arial size=2><STRONG>ImageRegistration8 uses MeanSquaresImageToImageMetric and VersorRigid3DTransform for registration. This combination may work well for images acquired for&nbsp;the same subject using the same modality, in&nbsp;which case,&nbsp;two images&nbsp;can be aligned using a rigid transform (same subject), and corresponding points in the&nbsp;moving image and &nbsp;the fixed image have same intensity (same modality). For your application, you are registering a PET image with an MRI image. You may want to&nbsp;try one of the mutual information based image to image metric to get more accurate result, such as </STRONG></FONT>
<P><FONT face=Arial><FONT size=2><STRONG>itkNormalizedMutualInformationHistogramImageToImageMetri<SPAN class=472375612-30092005>c </SPAN></STRONG><SPAN class=472375612-30092005><STRONG>or </STRONG></SPAN></FONT></FONT><SPAN class=472375612-30092005><FONT face=Arial size=2><STRONG>itkMattesMutualInformationImageToImageMetric</STRONG></FONT></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>There are a few examples showing how to used these metrics.</FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>The MeanSquaresImageToImageMetric&nbsp;is also one of the reasons that the program takes long time to run, since at each iterattion, it transforms and interpolates ALL points in the Fixed image region in order to compute the metric. When you use itkNormalizedMutualInformationHistogramImageToImageMetri<SPAN class=472375612-30092005>c </SPAN><SPAN class=472375612-30092005><STRONG>or </STRONG></SPAN><SPAN class=472375612-30092005><FONT face=Arial size=2><STRONG>MattesMutualInformationImageToImageMetric, you can always control the running time by setting the number of samples in the fixed image region for metric computation.</STRONG></FONT></SPAN></FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2>If you still want to use <SPAN class=472375612-30092005><FONT face=Arial size=2><STRONG>ImageRegistration8, you can use the PET image (which has fewer voxels than the MRI image) as the fixed image to cut down the running time.</STRONG></FONT></SPAN></FONT></SPAN></STRONG></P>
<P><STRONG><SPAN class=472375612-30092005><FONT face=Arial size=2><SPAN class=472375612-30092005>Xiaodong</SPAN></FONT></SPAN></STRONG></P></SPAN></SPAN></FONT><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> insight-users-bounces+taox=research.ge.com@itk.org [mailto:insight-users-bounces+taox=research.ge.com@itk.org]<B>On Behalf Of </B>Tanya S<BR><B>Sent:</B> Thursday, September 29, 2005 11:34 PM<BR><B>To:</B> Luis Ibanez; insight-users@itk.org<BR><B>Subject:</B> Re: [Insight-users] ImageRegistration8 takes 2 hours 45 menit!<BR><BR></FONT></DIV>
<BLOCKQUOTE>
<DIV>Hi Luis,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have tried to run imageRegistration8 for Release version and it took 21 minutes :((. My machine spesification and the image size&nbsp;are the same as what I wrote on my last email (email attached). </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks beforehand for your answer.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best regards,</DIV>
<DIV>.Tanya.<BR><BR><B><I>Tanya S &lt;tanya_lll@yahoo.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV><BR>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<P>Hi Luis, thanks a lot for answering my question.</P>
<P>Below are the detail of my machine:<BR><BR><EM>1) In what type of machine did you run this code ?</EM></P>
<P>Intel Pentium 4 2.4 GHz<BR><EM>2) What operating system ?</EM></P>
<P>Windows 2000<BR><EM>3) What compiler ?</EM></P>
<P>Microsoft Visual C++ 6.0</P>
<P><EM>4) Did you build it for "Release" ?</EM></P>
<P>No, it was Debug version.<BR></P>
<P>The size of the images are :<BR>- MRI image</P>
<P>Dimension:256, 256, 168</P>
<P>Voxel size(mm): 0.86,0.86, 1.5</P>
<P>The .img&nbsp;file is 21,500 KB</P>
<P><BR>- PET image</P>
<P>Dimension: 128, 128, 94</P>
<P>Voxel size(mm): 2.0, 2.0, 3.0</P>
<P>the .img file is 3,000 KB<BR></P>
<P>Maybe I should try for Release. I ll tell you&nbsp;how it works in Release version.<BR></P>
<P>Thanks again,</P>
<P>.Tanya.<BR><BR>-----------------<BR>Tanya S wrote:<BR>&gt; Dear all,<BR>&gt; <BR>&gt; I would like to start doing registration using ITK. I run the sample: <BR>&gt; ImageRegistration8 for registering two Analyze head images, i.e:<BR>&gt; - MRI image(Dimension:256, 256, 168 and Voxel size(mm): 0.86,0.86, 1.5)<BR>&gt; - PET image(Dimension: 128, 128, 94 and Voxel size(mm): 2.0, 2.0, 3.0)<BR>&gt; <BR>&gt; The registration process takes around 2 hours and 45 minutes with <BR>&gt; non-accurate result :(.<BR>&gt; <BR>&gt; I would like to ask why does it take so long and how to make it faster?<BR>&gt; <BR>&gt; Any hint would be really appreciated.<BR>&gt; <BR>&gt; Best regards,<BR>&gt; .Tanya.<BR>&gt; <BR><BR></P></BLOCKQUOTE></DIV>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A> to the Hurricane Katrina relief effort. _______________________________________________<BR>Insight-users mailing list<BR>Insight-users@itk.org<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A> to the Hurricane Katrina relief effort. </BLOCKQUOTE>_______________________________________________<BR>Insight-users mailing list<BR>Insight-users@itk.org<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></BLOCKQUOTE><p>
                <hr size=1>Yahoo! for Good<br> 
<a href="http://store.yahoo.com/redcross-donate3/">Click here to donate</a> to the Hurricane Katrina relief effort.