<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>

<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005>Karthik,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=482401714-19052005>Thank 
you (and Luis) very much.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=482401714-19052005>I have 
it working now.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005>Sincerely,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005>John.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=482401714-19052005></SPAN></FONT>&nbsp;</DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Karthik Krishnan 
  [mailto:Karthik.Krishnan@kitware.com]<BR><B>Sent:</B> Thursday, May 19, 2005 
  9:58 AM<BR><B>To:</B> Woo, John<BR><B>Cc:</B> '''insight-users@itk.org' ' 
  '<BR><B>Subject:</B> Re: [Insight-users] ImageRegistration2 
  problem.<BR><BR></FONT></DIV>Woo, John wrote: 
  <BLOCKQUOTE 
  cite=mid42FCFDF5F1C63145AF772BC187CBE0C101E3CE7E@UPHSEX08.uphs.upenn.edu 
  type="cite">
    <META content="MS Exchange Server version 5.5.2658.24" name=Generator>
    <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.&nbsp; 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.&nbsp; It is modeled 
    after the "HelloWorld" example.&nbsp; 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?&nbsp; 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>&nbsp; 
    INCLUDE(${ITK_USE_FILE})</FONT> <BR><FONT size=2>ELSE(ITK_FOUND)</FONT> 
    <BR><FONT size=2>&nbsp; MESSAGE(FATAL_ERROR</FONT> <BR><FONT 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Cannot build 
    without ITK.&nbsp; 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: ''<A class=moz-txt-link-abbreviated 
    href="mailto:insight-users@itk.org">insight-users@itk.org</A>' '</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>&nbsp;&nbsp;&nbsp;&nbsp; Insight/Testing/Code/Common/</FONT> 
    <BR><FONT 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; Regards,</FONT> </P><BR>
    <P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis</FONT> 
    </P><BR><BR><BR>
    <P><FONT size=2>--------------------</FONT> <BR><FONT size=2>Woo, John 
    wrote:</FONT> </P>
    <P><FONT size=2>&gt; Luis,</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; Thank you for responding.&nbsp; However, I am still having 
    problems.</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; I 
    downloaded a newer version of itk using cvs.</FONT> <BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; Now when I run ImageRegistration2, it seems to 
    go through 200</FONT> <BR><FONT size=2>iterations,</FONT> <BR><FONT 
    size=2>&gt; each with output:</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt;&nbsp; 2.23973e-07&nbsp; [0,0]</FONT> <BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; You are probably correct, that the metric seems 
    to be computed </FONT><BR><FONT size=2>&gt; incorrectly.&nbsp; Since the 
    nightly tests are ok, this suggests that the </FONT><BR><FONT size=2>&gt; 
    problem is not with the code, but perhaps with my system.&nbsp; However, I 
    </FONT><BR><FONT size=2>&gt; have tried this on two different PCs.</FONT> 
    <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; Anyone encouter a similar 
    problem?&nbsp; Perhaps I am missing a random</FONT> <BR><FONT size=2>number 
    </FONT><BR><FONT size=2>&gt; generator in Cygwin?</FONT> <BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; - John.</FONT> <BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    -----Original Message-----</FONT> <BR><FONT size=2>&gt; From: Luis 
    Ibanez</FONT> <BR><FONT size=2>&gt; To: Woo, John</FONT> <BR><FONT 
    size=2>&gt; Cc: '<A class=moz-txt-link-abbreviated 
    href="mailto:insight-users@itk.org">insight-users@itk.org</A>'</FONT> 
    <BR><FONT size=2>&gt; Sent: 5/17/2005 8:25 PM</FONT> <BR><FONT size=2>&gt; 
    Subject: Re: [Insight-users] ImageRegistration2 problem.</FONT> <BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; Hi 
    John,</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; Cygwin used has a problem for running the 
    random number</FONT> <BR><FONT size=2>&gt; generator that is used by the 
    Mutual Information metric.</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; This has been fixed now.</FONT> <BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; The 
    example:</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    ImageRegistration2</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    is tested nightly</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt;</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>&gt; 
    Examples_Registration_ImageRegistration2Test.html</FONT> <BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; and it is consistently passing in 
    all platforms.</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; The 
    typical output that you should see is in Cygwing is:</FONT> <BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt;</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>&gt;</FONT> <BR><FONT 
    size=2>-0500-Nightly/Results/__Examples_Registration_ImageRegistration2Test.htm</FONT> 
    <BR><FONT size=2>&gt; l</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; number 
    of samples = 567</FONT> <BR><FONT size=2>&gt; 0&nbsp;&nbsp; 
    0.291543&nbsp;&nbsp; [0.105135, 0.090224]</FONT> <BR><FONT size=2>&gt; 
    1&nbsp;&nbsp; 0.260628&nbsp;&nbsp; [0.161649, 0.157256]</FONT> <BR><FONT 
    size=2>&gt; 2&nbsp;&nbsp; 0.270509&nbsp;&nbsp; [0.320506, 0.209221]</FONT> 
    <BR><FONT size=2>&gt; 3&nbsp;&nbsp; 0.316618&nbsp;&nbsp; [0.422436, 
    0.283459]</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    ...</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    198&nbsp;&nbsp; 0.607511&nbsp;&nbsp; [12.9989, 16.8214]</FONT> <BR><FONT 
    size=2>&gt; 199&nbsp;&nbsp; 0.603641&nbsp;&nbsp; [13.0552, 16.9111]</FONT> 
    <BR><FONT size=2>&gt; Result =</FONT> <BR><FONT size=2>&gt;&nbsp;&nbsp; 
    Translation X = 13.0552</FONT> <BR><FONT size=2>&gt;&nbsp;&nbsp; Translation 
    Y = 16.9111</FONT> <BR><FONT size=2>&gt;&nbsp;&nbsp; 
    Iterations&nbsp;&nbsp;&nbsp; = 200</FONT> <BR><FONT size=2>&gt;&nbsp;&nbsp; 
    Metric value&nbsp; = 0.603641</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; You should 
    probably update your version</FONT> <BR><FONT size=2>&gt; of ITK in order 
    to&nbsp; use CVS.</FONT> <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; Regards,</FONT> 
    <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Luis</FONT> 
    <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    ------------------------------------------------------------------</FONT> 
    <BR><FONT size=2>&gt; Woo, John wrote:</FONT> <BR><FONT size=2>&gt; 
    </FONT><BR><FONT size=2>&gt;&nbsp; &gt; Hi, I'm a new user to ITK.</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; I 
    have succeeded in running ImageRegistration1 and</FONT> <BR><FONT 
    size=2>ImageRegistration3</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; with their 
    respective Example data.</FONT> <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt; However, I cannot seem to run 
    ImageRegistration2 (MI Registration)</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; 
    correctly with BrainT1SliceBorder20.png and</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt; BrainProtonDensitySliceShifted13x17y.png.</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; It 
    seems to compile ok.&nbsp; However, when running, it seems to give a</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt; Result of</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; Result 
    =</FONT> <BR><FONT size=2>&gt;&nbsp; &gt;&nbsp; Translation X = 0</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;&nbsp; Translation Y = 0</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt;&nbsp; Iterations&nbsp;&nbsp;&nbsp; = 200</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;&nbsp; Metric value&nbsp; = 
    2.5398e-06.</FONT> <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt; It seems that all 200 iterations have values 
    of</FONT> <BR><FONT size=2>&gt;&nbsp; &gt;&nbsp; 
    2.5398e-06&nbsp;&nbsp;&nbsp; [0, 0]</FONT> <BR><FONT size=2>&gt;&nbsp; 
    &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; Am I doing something 
    incorrectly?&nbsp; I am running ITK on Cygwin on a</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt; Windows platform.</FONT> <BR><FONT size=2>&gt;&nbsp; 
    &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; - John.</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;</FONT> 
    <BR><FONT 
    size=2>------------------------------------------------------------------------</FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt;</FONT> <BR><FONT size=2>&gt;&nbsp; &gt; 
    _______________________________________________</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt; Insight-users mailing list</FONT> <BR><FONT 
    size=2>&gt;&nbsp; &gt; <A class=moz-txt-link-abbreviated 
    href="mailto:Insight-users@itk.org">Insight-users@itk.org</A></FONT> 
    <BR><FONT size=2>&gt;&nbsp; &gt; <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>&gt; </FONT><BR><FONT size=2>&gt; </FONT><BR><FONT 
    size=2>&gt; </FONT><BR><FONT size=2>&gt;</FONT> <BR><FONT 
    size=2>------------------------------------------------------------------------</FONT> 
    <BR><FONT size=2>&gt; </FONT><BR><FONT size=2>&gt; 
    _______________________________________________</FONT> <BR><FONT size=2>&gt; 
    Insight-users mailing list</FONT> <BR><FONT size=2>&gt; <A 
    class=moz-txt-link-abbreviated 
    href="mailto:Insight-users@itk.org">Insight-users@itk.org</A></FONT> 
    <BR><FONT size=2>&gt; <A 
    href="http://www.itk.org/mailman/listinfo/insight-users" 
    target=_blank>http://www.itk.org/mailman/listinfo/insight-users</A></FONT> 
    </P><BR><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
Insight-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:Insight-users@itk.org">Insight-users@itk.org</A>
<A class=moz-txt-link-freetext href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A>
  </PRE></BLOCKQUOTE>John,<BR><BR>As Luis mentioned, you should re-seed on 
  cygwin. This is infact done in the tests explicitly outside the source code. 
  Look at the Examples/Registration/CMakeLists.txt . ImageRegistration2.cxx is 
  strung through the test driver through RegistrationExamples.cxx. The very 
  first line of this file is<BR><BR>vnl_sample_reseed(8775070);<BR><BR>That 
  explains the test running fine through ctest&nbsp; not when you use the same 
  example in your source code.<BR><BR>This is needed to produce consistent 
  results for nightly testing, <BR>You could add that line to your source code 
  (running on cygwin explicitly before any calls to the random iterator are 
  made). The MutualInformationImageToImageMetric uses one. There is an API on 
  the metrics so you could all them instead as soon as you instantiate 
  one.<BR>See<BR><BR>MutualInformationImageToImageMetric&lt;TFixedImage,TMovingImage&gt;::ReinitializeSeed()<BR><BR>The 
  reason why this isn't added to the constructor is to produce consistent 
  nightly 
results.<BR><BR>Thanks<BR>Regards<BR>Karthik<BR></BLOCKQUOTE></BODY></HTML>