[Insight-users] Registration Example Program

Luis Ibanez luis . ibanez at kitware . com
Tue, 19 Aug 2003 17:48:25 -0400


Hi Dill,


1) There must be a change between the ImageRegistration2.cxx
    in your external directory and the one in

      Insight/Examples/Registration/ImageRegistration2.cxx

    Could you please make a 'diff' and post the result to the list ?

    Something like

    diff myDirectory/ImageRegistration2.cxx
             ~/src/Insight/Examples/Registration/ImageRegistration2.cxx

   (in a single line...)


   I'm guessing that something like a modification in the image
   dimension may have triggered the error that you reported.



2) Your CMakeLists.txt file looks ok,

    You actually don't need to specify all these libraries.
    CMake keeps track of the dependencies in ITK libraries.
    So, for example, by linking with ITKIO, you will get for
    free ITKCommon, itkpng, ITKMetaIO and pthreads.


    You shold be ok by using only ITKIO and ITKBasicFilters


    Note also that by adding "png" you are linking with the
    png library installed in your system, not the one distributed
    in Insight/Utilities. The one distributed with Insight is
    renamed "itkpng".  In any case, you shouldn't need to add it
    to the CMakeLists.txt file, ITKIO should pull it in as a
    dependency.



Please let us know about the diff in (1),


Thanks



   Luis




-------------------
Dill, John wrote:
> I am trying to modify a registration example by making my own directory and
> copying the source code a generating my own CMakeLists file.  But when I try
> to compile, I get this message:
> 
> Building object file ImageRegistration2.o...
> /home/jadill/src/jadtools/MIRigid2DRegistration/ImageRegistration2.cxx: In
> function `int main (int, 
> char **)':
> /home/jadill/src/jadtools/MIRigid2DRegistration/ImageRegistration2.cxx:436:
> no matching function for 
> call to `itk::ResampleImageFilter<main (int, char **)::MovingImageType, main
> (int, char 
> **)::FixedImageType>::SetTransform
> (itk::SmartPointer<itk::TranslationTransform<double, 2> > &)'
> /usr/local/include/InsightToolkit/BasicFilters/itkResampleImageFilter.h:109:
> candidates are: void 
> itk::ResampleImageFilter<TInputImage, TOutputImage>::SetTransform (typename
> itk::Transform<double, 
> itk::ResampleImageFilter<TInputImage, TOutputImage>::ImageDimension, 
> itk::ResampleImageFilter<TInputImage,
> TOutputImage>::ImageDimension>::Pointer) [with TInputImage = main 
> (int, char **)::MovingImageType, TOutputImage = main (int, char
> **)::FixedImageType]
> gmake[1]: *** [ImageRegistration2.o] Error 1
> gmake: *** [default_target] Error 2
> 
> I have just a copy of ImageRegistration2.cxx and it compiles fine and runs
> when its in the Insight source tree.  Here is my CMakeLists.txt file:
> 
> # 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 ITKMetaIO
> ITKBasicFilters ITKCommon VXLNumerics png pthread dl)
> 
> I haven't had any success understanding the problem.  I also don't
> understand why the CMakeLists.txt under Examples/Registration do not have
> all these libraries that I seem to need to correct link time errors (if I
> comment out the offending code).  Any insight would be greatly appreciated.
> Thanks.
> 
> John
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>