[Insight-users] ImageRegistration2 problem.
Karthik Krishnan
Karthik.Krishnan at kitware.com
Thu May 19 09:57:50 EDT 2005
Woo, John wrote:
> Hi, Luis.
>
> I discovered how to run some of the tests using "ctest -V".
>
> In particular, when the ImageRegistration2Test is run, the output
> seems to be ok! (i.e. converges to 13,17)
>
> This is quite strange. It suggests that it is not the code, nor my
> Cygwin system, but rather my implementation of the ImageRegistration2
> code.
>
> 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.
>
> Can you see a problem? Thanks again for your help.
>
> Sincerely, John.
>
> p.s. I will try to run the itkImageRandomIteratorTest.cxx tomorrow.
>
> ************************************
>
> # This project is designed to be built outside the Insight source tree.
> PROJECT(ImageRegistration2)
>
> # Find ITK.
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
> INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
> MESSAGE(FATAL_ERROR
> "Cannot build without ITK. Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
>
> ADD_EXECUTABLE(ImageRegistration2 ImageRegistration2.cxx )
>
> TARGET_LINK_LIBRARIES(ImageRegistration2 ITKNumerics ITKIO)
>
> ***************************************************
>
>
>
>
> -----Original Message-----
> From: Luis Ibanez
> To: Woo, John
> Cc: ''insight-users at itk.org' '
> Sent: 5/18/2005 9:42 PM
> Subject: Re: [Insight-users] ImageRegistration2 problem.
>
>
>
> Hi John,
>
>
>
> Thanks for your report.
>
>
> You can easily verify if the random number generator is
> working in your system or not.
>
>
>
> You simply need to take the file
>
>
> Insight/Testing/Code/Common/
> itkImageRandomIteratorTest.cxx
>
>
> and build it as an independent project.
>
>
>
> You run it and.... it will tell you is the random
> number generation works or not.
>
>
>
> For instructions on how to create an isolated ITK
> project, please look at the Tutorial sessions:
>
>
> http://www.itk.org/HTML/Tutorials.htm
>
> In particular to:
>
> http://www.itk.org/CourseWare/Training/GettingStartedI-WebPage/index.htm
>
>
>
>
>
> Regards,
>
>
> Luis
>
>
>
>
> --------------------
> Woo, John wrote:
>
> > Luis,
> >
> > Thank you for responding. However, I am still having problems.
> >
> > I downloaded a newer version of itk using cvs.
> >
> > Now when I run ImageRegistration2, it seems to go through 200
> iterations,
> > each with output:
> >
> > 2.23973e-07 [0,0]
> >
> > You are probably correct, that the metric seems to be computed
> > incorrectly. Since the nightly tests are ok, this suggests that the
> > problem is not with the code, but perhaps with my system. However, I
> > have tried this on two different PCs.
> >
> > Anyone encouter a similar problem? Perhaps I am missing a random
> number
> > generator in Cygwin?
> >
> > - John.
> >
> >
> > -----Original Message-----
> > From: Luis Ibanez
> > To: Woo, John
> > Cc: 'insight-users at itk.org'
> > Sent: 5/17/2005 8:25 PM
> > Subject: Re: [Insight-users] ImageRegistration2 problem.
> >
> >
> > Hi John,
> >
> >
> > Cygwin used has a problem for running the random number
> > generator that is used by the Mutual Information metric.
> >
> > This has been fixed now.
> >
> >
> > The example:
> >
> > ImageRegistration2
> >
> > is tested nightly
> >
> >
> http://www.itk.org/Testing/Dashboard/20050517-0500-Nightly/TestDetail/__
> > Examples_Registration_ImageRegistration2Test.html
> >
> > and it is consistently passing in all platforms.
> >
> > The typical output that you should see is in Cygwing is:
> >
> >
> http://www.itk.org/Testing/Sites/dash14.kitware/Win32-cygwin331/20050517
> >
> -0500-Nightly/Results/__Examples_Registration_ImageRegistration2Test.htm
> > l
> >
> >
> >
> > number of samples = 567
> > 0 0.291543 [0.105135, 0.090224]
> > 1 0.260628 [0.161649, 0.157256]
> > 2 0.270509 [0.320506, 0.209221]
> > 3 0.316618 [0.422436, 0.283459]
> >
> > ...
> >
> > 198 0.607511 [12.9989, 16.8214]
> > 199 0.603641 [13.0552, 16.9111]
> > Result =
> > Translation X = 13.0552
> > Translation Y = 16.9111
> > Iterations = 200
> > Metric value = 0.603641
> >
> >
> >
> >
> >
> > You should probably update your version
> > of ITK in order to use CVS.
> >
> >
> >
> > Regards,
> >
> >
> >
> > Luis
> >
> >
> >
> > ------------------------------------------------------------------
> > Woo, John wrote:
> >
> > > Hi, I'm a new user to ITK.
> > >
> > > I have succeeded in running ImageRegistration1 and
> ImageRegistration3
> > > with their respective Example data.
> > >
> > > However, I cannot seem to run ImageRegistration2 (MI Registration)
> > > correctly with BrainT1SliceBorder20.png and
> > > BrainProtonDensitySliceShifted13x17y.png.
> > >
> > > It seems to compile ok. However, when running, it seems to give a
> > > Result of
> > >
> > > Result =
> > > Translation X = 0
> > > Translation Y = 0
> > > Iterations = 200
> > > Metric value = 2.5398e-06.
> > >
> > > It seems that all 200 iterations have values of
> > > 2.5398e-06 [0, 0]
> > >
> > > Am I doing something incorrectly? I am running ITK on Cygwin on a
> > > Windows platform.
> > >
> > > - John.
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
John,
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
vnl_sample_reseed(8775070);
That explains the test running fine through ctest not when you use the
same example in your source code.
This is needed to produce consistent results for nightly testing,
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.
See
MutualInformationImageToImageMetric<TFixedImage,TMovingImage>::ReinitializeSeed()
The reason why this isn't added to the constructor is to produce
consistent nightly results.
Thanks
Regards
Karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050519/e161a879/attachment.html
More information about the Insight-users
mailing list