<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>RE: [Insight-users] ImageRegistration2 problem.</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi, Luis.</FONT>
</P>
<P><FONT SIZE=2>I discovered how to run some of the tests using "ctest -V".</FONT>
</P>
<P><FONT SIZE=2>In particular, when the ImageRegistration2Test is run, the output</FONT>
<BR><FONT SIZE=2>seems to be ok! (i.e. converges to 13,17)</FONT>
</P>
<P><FONT SIZE=2>This is quite strange. It suggests that it is not the code, nor my Cygwin system, but rather my implementation of the ImageRegistration2 code.</FONT></P>
<P><FONT SIZE=2>I am appending my CMakeLists.txt below. It is modeled after the "HelloWorld" example. The ImageRegistration2.cxx file is copied directly from the source directory into my project directory.</FONT></P>
<P><FONT SIZE=2>Can you see a problem? Thanks again for your help.</FONT>
</P>
<P><FONT SIZE=2>Sincerely, John.</FONT>
</P>
<P><FONT SIZE=2>p.s. I will try to run the itkImageRandomIteratorTest.cxx tomorrow.</FONT>
</P>
<P><FONT SIZE=2>************************************</FONT>
</P>
<P><FONT SIZE=2># This project is designed to be built outside the Insight source tree.</FONT>
<BR><FONT SIZE=2>PROJECT(ImageRegistration2)</FONT>
</P>
<P><FONT SIZE=2># Find ITK.</FONT>
<BR><FONT SIZE=2>FIND_PACKAGE(ITK)</FONT>
<BR><FONT SIZE=2>IF(ITK_FOUND)</FONT>
<BR><FONT SIZE=2> INCLUDE(${ITK_USE_FILE})</FONT>
<BR><FONT SIZE=2>ELSE(ITK_FOUND)</FONT>
<BR><FONT SIZE=2> MESSAGE(FATAL_ERROR</FONT>
<BR><FONT SIZE=2> "Cannot build without ITK. Please set ITK_DIR.")</FONT>
<BR><FONT SIZE=2>ENDIF(ITK_FOUND)</FONT>
</P>
<P><FONT SIZE=2>ADD_EXECUTABLE(ImageRegistration2 ImageRegistration2.cxx )</FONT>
</P>
<P><FONT SIZE=2>TARGET_LINK_LIBRARIES(ImageRegistration2 ITKNumerics ITKIO)</FONT>
</P>
<P><FONT SIZE=2>***************************************************</FONT>
</P>
<BR>
<P><FONT SIZE=2> </FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Luis Ibanez</FONT>
<BR><FONT SIZE=2>To: Woo, John</FONT>
<BR><FONT SIZE=2>Cc: ''insight-users@itk.org' '</FONT>
<BR><FONT SIZE=2>Sent: 5/18/2005 9:42 PM</FONT>
<BR><FONT SIZE=2>Subject: Re: [Insight-users] ImageRegistration2 problem.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Hi John,</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Thanks for your report.</FONT>
</P>
<BR>
<P><FONT SIZE=2>You can easily verify if the random number generator is</FONT>
<BR><FONT SIZE=2>working in your system or not.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>You simply need to take the file</FONT>
</P>
<BR>
<P><FONT SIZE=2> Insight/Testing/Code/Common/</FONT>
<BR><FONT SIZE=2> itkImageRandomIteratorTest.cxx</FONT>
</P>
<BR>
<P><FONT SIZE=2>and build it as an independent project.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>You run it and.... it will tell you is the random</FONT>
<BR><FONT SIZE=2>number generation works or not.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>For instructions on how to create an isolated ITK</FONT>
<BR><FONT SIZE=2>project, please look at the Tutorial sessions:</FONT>
</P>
<BR>
<P><FONT SIZE=2> <A HREF="http://www.itk.org/HTML/Tutorials.htm" TARGET="_blank">http://www.itk.org/HTML/Tutorials.htm</A></FONT>
</P>
<P><FONT SIZE=2>In particular to:</FONT>
</P>
<P><FONT SIZE=2><A HREF="http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm" TARGET="_blank">http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm</A></FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><FONT SIZE=2> Regards,</FONT>
</P>
<BR>
<P><FONT SIZE=2> Luis</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2>--------------------</FONT>
<BR><FONT SIZE=2>Woo, John wrote:</FONT>
</P>
<P><FONT SIZE=2>> Luis,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Thank you for responding. However, I am still having problems.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I downloaded a newer version of itk using cvs.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Now when I run ImageRegistration2, it seems to go through 200</FONT>
<BR><FONT SIZE=2>iterations,</FONT>
<BR><FONT SIZE=2>> each with output:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> 2.23973e-07 [0,0]</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> You are probably correct, that the metric seems to be computed </FONT>
<BR><FONT SIZE=2>> incorrectly. Since the nightly tests are ok, this suggests that the </FONT>
<BR><FONT SIZE=2>> problem is not with the code, but perhaps with my system. However, I </FONT>
<BR><FONT SIZE=2>> have tried this on two different PCs.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Anyone encouter a similar problem? Perhaps I am missing a random</FONT>
<BR><FONT SIZE=2>number </FONT>
<BR><FONT SIZE=2>> generator in Cygwin?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> - John.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Luis Ibanez</FONT>
<BR><FONT SIZE=2>> To: Woo, John</FONT>
<BR><FONT SIZE=2>> Cc: 'insight-users@itk.org'</FONT>
<BR><FONT SIZE=2>> Sent: 5/17/2005 8:25 PM</FONT>
<BR><FONT SIZE=2>> Subject: Re: [Insight-users] ImageRegistration2 problem.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Hi John,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Cygwin used has a problem for running the random number</FONT>
<BR><FONT SIZE=2>> generator that is used by the Mutual Information metric.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> This has been fixed now.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The example:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> ImageRegistration2</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> is tested nightly</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2><A HREF="http://www.itk.org/Testing/Dashboard/20050517-0500-Nightly/TestDetail/__" TARGET="_blank">http://www.itk.org/Testing/Dashboard/20050517-0500-Nightly/TestDetail/__</A></FONT>
<BR><FONT SIZE=2>> Examples_Registration_ImageRegistration2Test.html</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> and it is consistently passing in all platforms.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The typical output that you should see is in Cygwing is:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2><A HREF="http://www.itk.org/Testing/Sites/dash14.kitware/Win32-cygwin331/20050517" TARGET="_blank">http://www.itk.org/Testing/Sites/dash14.kitware/Win32-cygwin331/20050517</A></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>-0500-Nightly/Results/__Examples_Registration_ImageRegistration2Test.htm</FONT>
<BR><FONT SIZE=2>> l</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> number of samples = 567</FONT>
<BR><FONT SIZE=2>> 0 0.291543 [0.105135, 0.090224]</FONT>
<BR><FONT SIZE=2>> 1 0.260628 [0.161649, 0.157256]</FONT>
<BR><FONT SIZE=2>> 2 0.270509 [0.320506, 0.209221]</FONT>
<BR><FONT SIZE=2>> 3 0.316618 [0.422436, 0.283459]</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> ...</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> 198 0.607511 [12.9989, 16.8214]</FONT>
<BR><FONT SIZE=2>> 199 0.603641 [13.0552, 16.9111]</FONT>
<BR><FONT SIZE=2>> Result =</FONT>
<BR><FONT SIZE=2>> Translation X = 13.0552</FONT>
<BR><FONT SIZE=2>> Translation Y = 16.9111</FONT>
<BR><FONT SIZE=2>> Iterations = 200</FONT>
<BR><FONT SIZE=2>> Metric value = 0.603641</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> You should probably update your version</FONT>
<BR><FONT SIZE=2>> of ITK in order to use CVS.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Regards,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Luis</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> ------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> Woo, John wrote:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > Hi, I'm a new user to ITK.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I have succeeded in running ImageRegistration1 and</FONT>
<BR><FONT SIZE=2>ImageRegistration3</FONT>
<BR><FONT SIZE=2>> > with their respective Example data.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > However, I cannot seem to run ImageRegistration2 (MI Registration)</FONT>
<BR><FONT SIZE=2>> > correctly with BrainT1SliceBorder20.png and</FONT>
<BR><FONT SIZE=2>> > BrainProtonDensitySliceShifted13x17y.png.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > It seems to compile ok. However, when running, it seems to give a</FONT>
<BR><FONT SIZE=2>> > Result of</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Result =</FONT>
<BR><FONT SIZE=2>> > Translation X = 0</FONT>
<BR><FONT SIZE=2>> > Translation Y = 0</FONT>
<BR><FONT SIZE=2>> > Iterations = 200</FONT>
<BR><FONT SIZE=2>> > Metric value = 2.5398e-06.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > It seems that all 200 iterations have values of</FONT>
<BR><FONT SIZE=2>> > 2.5398e-06 [0, 0]</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Am I doing something incorrectly? I am running ITK on Cygwin on a</FONT>
<BR><FONT SIZE=2>> > Windows platform.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > - John.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>------------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > _______________________________________________</FONT>
<BR><FONT SIZE=2>> > Insight-users mailing list</FONT>
<BR><FONT SIZE=2>> > Insight-users@itk.org</FONT>
<BR><FONT SIZE=2>> > <A HREF="http://www.itk.org/mailman/listinfo/insight-users" TARGET="_blank">http://www.itk.org/mailman/listinfo/insight-users</A></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>------------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> Insight-users mailing list</FONT>
<BR><FONT SIZE=2>> Insight-users@itk.org</FONT>
<BR><FONT SIZE=2>> <A HREF="http://www.itk.org/mailman/listinfo/insight-users" TARGET="_blank">http://www.itk.org/mailman/listinfo/insight-users</A></FONT>
</P>
<BR>
</BODY>
</HTML>