[Insight-users] Re: Building and running examples

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 24 15:31:43 EDT 2005


Hi hbk,

Yes, most of the image registration examples use
the resample image filter. Therefore you may need
to link with ITKBasicFilters.

Note that you don't need to add ITKNumerics to the
list of libraries because ITKCommon depends on
ITKNumerics, and ITKBasicFilters depends on ITKCommon.

CMake will take care of adding libraries in dependencies
to your link list.

If you still find any problems, please post
to the list the error messages that you are
getting.


   Thanks


      Luis



------------
hbk wrote:
> This is my cmake file:
> 
> PROJECT( myProject )
> 
> 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(ImageRegistration ImageRegistration1.cxx )
> TARGET_LINK_LIBRARIES(ImageRegistration ITKNumerics ITKIO)
> 
> 
> 
> ADD_EXECUTABLE(test TestRegistration.cxx)
> TARGET_LINK_LIBRARIES(test ITKNumerics ITKIO)
> 
> 
> 
> ADD_EXECUTABLE(res ResampleImageFilter.cxx)
> TARGET_LINK_LIBRARIES(res ITKNumerics ITKIO)
> 
> 
> ADD_EXECUTABLE(mi ImageRegistration2.cxx)
> TARGET_LINK_LIBRARIES(mi ITKNumerics ITKIO)
> 
> 
> ADD_EXECUTABLE(rg5 ImageRegistration5.cxx)
> TARGET_LINK_LIBRARIES(rg5 ITKNumerics ITKIO)
> 
> ADD_EXECUTABLE(reg3 ImageRegistration3.cxx)
> TARGET_LINK_LIBRARIES(reg3 ITKNumerics ITKIO)
> 
> Do you mean I must change the ITKNumerics to ITKBasicFilters?
> Thanks.
> 
> 
> 
> 
> 2005/10/1, Vincent A. Magnotta <vincent-magnotta at uiowa.edu>:
> 
>>Hong,
>>
>>If I was going to build an example separate from ITK (i.e. outside of
>>the ITK build) I would create a new directory called something like:
>>
>>C:\Program Files\Examples\RegistrationTest
>>
>>and copy the file ImageRegistrationX.cxx into this directory. I would
>>then create a CMakeLists.txt file similar to
>>
>>-------------------------
>>PROJECT(ImageRegistrationX)
>>
>>FIND_PACKAGE(ITK)
>>IF(ITK_FOUND)
>>  INCLUDE(${ITK_USE_FILE})
>>ELSE(ITK_FOUND)
>>  MESSAGE(FATAL_ERROR
>>            "Cannot build my program without ITK.  Please set ITK_DIR.")
>>ENDIF(ITK_FOUND)
>>
>>ADD_EXECUTABLE(ImageRegistrationX ImageRegistrationX.cxx )
>>TARGET_LINK_LIBRARIES(ImageRegistrationX ITKCommon ITKBasicFilters
>>ITKIO)
>>
>>-----------------------------------
>>
>>I would then run cmake and build into a new binary directory like
>>C:\Program Files\Examples\RegistrationTest-Build
>>
>>Vince
>>
>>
>>On Fri, 2005-09-30 at 10:31, Xiang, Hong wrote:
>>
>>>Hello Vincent, hbk and Tanya,
>>>
>>>I saw your messages on building and running ImageRegistrationX.cxx on Windows.
>>>I'm learning to use ITK and have a quick question that you may have seen before:
>>>
>>>I tried to configure and build from source directory (C:\Program
>>>Files\InsightToolkit-2.2.0\Examples\Registration) to a binary directory
>>>(C:\Program Files\InsightToolkit-2.2.0\Testing\Registration_BIN). During "build
>>>ALL_BUILD", I saw error messages below:
>>>
>>>C:\Program
>>>Files\InsightToolkit-2.2.0\Examples\Registration\RegistrationExamples.cxx(11):
>>>fatal error C1083: Cannot open include file: 'vnl/vnl_sample.h': No such file or
>>>directory
>>>C:\Program
>>>Files\InsightToolkit-2.2.0\Examples\Registration\MultiResImageRegistration2.cxx(
>>>55): fatal error C1083: Cannot open include file: 'itkAffineTransform.h': No
>>>such file or directory
>>>C:\Program
>>>Files\InsightToolkit-2.2.0\Examples\Registration\ImageRegistration8.cxx(50):
>>>fatal error C1083: Cannot open include file: 'itkImageRegistrationMethod.h': No
>>>such file or directory
>>>
>>>etc. Do you see what I might be doing wrong?
>>>
>>>Thanks and best regards,
>>>
>>>Hong
>>>
>>
>>--
>>Assistant Professor
>>Department of Radiology
>>0453-D JCP
>>200 Hawkins Drive
>>Iowa City, IA 52242
>>E-mail: vincent-magnotta at uiowa.edu
>>Phone: 319-356-8255
>>Fax: 319-353-6275
>>Website: http://www.radiology.uiowa.edu
>>
>>
> 
> 
> 



More information about the Insight-users mailing list