[Insight-users] how to install the latest ITK 3.2.0 and make it work with VTK5.0.3

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 27 10:33:25 EDT 2007


Hi Ocean Spring,


1) It is normal for TRY_COMPILE commands to fail in some
    platforms. This is a mechanism intended to discover
    the capabilities of your compiler.

    You don't need to worry about those messages.


2) Building ITK may take different amounts of time, depending
    on your selections (Release/Debug) and the capabilities of
    your machine. Is is ok if you find that it took 20 or 30
    minutes to build instead of 15 minutes.

    How long did it take for you to build ITK ?

    It is also normal for the build process to use the 100% of
    your CPU. It is one of those cases in which you take advantage
    of all that you paid for that processor   :-)


3) EXECUTABLE_OUTPUT_PATH is the directory where you want to
    copy all the executables after they are build. This is optional,
    and if you don't set it, CMake will send the executables to a
    "bin" subdirectory of your ITK binary directory.


4) The file itkImageToVTKImageFilter.h is located in the directory:

          InsightApplications/Auxiliary/vtk

    simply copy the file from that directory into the directory of
    your project. The add a CMake command:

        INCLUDE_DIRECTORIES(  ${CMAKE_CURRENT_SOURCE_DIR}  )

    That will add the source code directory of your project to the
    list of directories to search for header files.

    NOTE: that you must also copy the files:

               itkVTKImageToImageFilter.h
               itkVTKImageToImageFilter.txx
               itkImageToVTKImageFilter.h
               itkImageToVTKImageFilter.txx



5) You are not forced to use CMake, *BUT*, keep in mind that
    using CMake will make your life *A LOT* easier.

    Besides, CMake is now found as a standard component in almost all
    Linux distributions, and it has been adopted as the configuration
    tool of the KDE project.

    Using CMake is the best way to go.


6) Yes, there are Tcl examples in ITK.

~/src/Insight/Examples
$ find . -name "*.tcl"
./Filtering/BinaryDilateImageFilter.tcl
./Filtering/BinaryErodeImageFilter.tcl
./Filtering/BinaryThresholdImageFilter.tcl
./Filtering/CannyEdgeDetectionImageFilter.tcl
./Filtering/CastImageFilter.tcl
./Filtering/CurvatureAnisotropicDiffusionImageFilter.tcl
./Filtering/CurvatureFlowImageFilter.tcl
./Filtering/GradientAnisotropicDiffusionImageFilter.tcl
./Filtering/MeanImageFilter.tcl
./Filtering/MedianImageFilter.tcl
./Filtering/SigmoidImageFilter.tcl
./Filtering/ThresholdImageFilter.tcl
./IO/DicomSliceRead.tcl
./Registration/ImageRegistration3.tcl
./Registration/ImageRegistration4.tcl
./Registration/ImageRegistration5.tcl
./Segmentation/VoronoiSegmentation.tcl
./Segmentation/WatershedSegmentation1.tcl
find: ./Statistics/CVS: Permission denied
./Visualization/CannyEdgeDetectionImageFilterConnectVTKITK.tcl



If you are interested in Tcl wrapping you may
want to use WrapITK. This system is described in the
following article in the Insight Journal, and since
the publication of the paper, the system has been
integrated with ITK:

   http://insight-journal.org/dspace/handle/1926/188




Regards,


     Luis



-------------------
Ocean Spring wrote:
> Hello All
>  
> i just download ITK and want to compile and do some programs with it. i 
> refer all kinds of starting-up tutorials,
> but all those are not up-to-date. i have problems occurred duiring my 
> compilation process. below i describe what i did and please someone 
> kindly diagnose my steps.
>  
>  
> my OS : Windows XP
> my compiler: MSVC 6.0
> Cmake is 2.4 patch 7
>  
> what i did are
>  
> 1) unpack the InsightToolkit-3.2.0.zip to my C: drive with folder name 
> C:\InsightToolkit-3.2.0
> 2) create a C:\ITK for keep the output files
>  
> 3) in the Cmake
>     source : C:\InsightToolkit-3.2.0
>     binary:   C:\ITK
>    press configure, it took quite a while, then i noticed in my C:\ITK 
> has a CMakeError.log, i opened and i saw loads of error messages.
>  
> here is a snapshot of the error messages
>  
> ============
> 
> Performing Test VCL_HAS_EXPORT failed with the following output:
> --------------------Configuration: cmTryCompileExec - Win32 
> Debug--------------------
> 
> Compiling...
> 
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
> 
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> 
> cl /MDd /W3 /GR /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D 
> "cmTryCompileExec_EXPORTS" /D "_WINDOWS" /D "NOMINMAX" /D 
> "VCL_HAS_EXPORT" /D "_MBCS" /D CMAKE_INTDIR=\"Debug\" /Fo"Debug/" 
> /Fd"Debug/" /FD /GZ   /Zm1000  /GZ  /TP /c
> 
>    
> "C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx"
> 
> vxl_platform_tests.cxx
> 
> C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx(25) 
> : error C2143: syntax error : missing ';' before ''template<''
> 
> C:\InsightToolkit-3.2.0\Utilities\vxl\config\cmake\config\vxl_platform_tests.cxx(25) 
> : error C2501: 'export' : missing storage-class or type specifiers
> 
> Error executing cl.exe.
> 
>  
> 
> cmTryCompileExec.exe - 2 error(s), 0 warning(s)
> 
> ============
>  
>  
>  
> 4) in the Cmake there are only 4 cache variables:
>     BUILD_EXAMPLES                                   OFF
>     BUILD_SHARE_LIBRARIES                       OFF
>     BUILD_TESTING                                       OFF
>     CMAKE_INSTAL_PREFIX                          C:\program files\ITK
>  
> i OFFed those variables , b'coz someone in his/her tutorial said it will 
> speed up the building process. well so be it...
>  
> i did check the checkbox to see advance values, but just for 
> observation. i did not find anything like ITK_USE_VTK, since my primary 
> objective is to use ITK with VTK.  since i am not quite sure all these 
> variables then i just leave it as default.
>  
>  
> 5)press OK, then wait serveral second......
>  
> 6) find the ITK.dsw in the C:\ITK folder and open it with MS studio 6.0.
>  
> 7) in the MSVC 6.0 tool tar i clicked "Build" then "Set Active 
> Configuration" i chose Win32 Release for ALL_BUILD classes
>  
> 8) then press F7 start to build ITK.  the compilation process took 100% 
> of my CPU, and it does not seem like what others said just 15 minutes. 
> it took more than that on my pc(Centrino 1.6Ghz 533FSB)
>  
>  
> 9)wait and wait.... then it finished.
>  
> 10) to test whether ITK itself can work properly. copy the 
> C:\InsightToolkit-3.2.0\Examples\Installation out  and run CMake again
>      source C:\somewhere\Installation
>      binary  C:\somewhere\Hellobin
>   
> everything leave as default. but i wonder what "EXECUTABLE_OUTPUT_PATH" 
> for ??? anyway i leave it blank as it is...
>  configure and then ok.
>  
> 11) go to the C:\somewhere\Hellobin  and find the HelloWorld.dsw. load 
> it in MSVC and build in release and then in 
> C:\somewhere\Hellobin\release  i found HelloWorld.exe so i run it .."ITK 
> Hello World !".BINGO!!... so far so good. it worked fine for this 
> testing program. therefore i assume my ITK was compiled successfully.
>  
>  
>  
> then how to make ITK work with VTK
>  
> i take the example from well-known GettingStarted-II.pdf
>  
> code
> ===========
> 
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "C:\Documents and 
> Settings\panz\Desktop\vitkbin\itkImageToVTKImageFilter.h"
> #include "vtkImageViewer.h"
> #include "vtkRenderWindowInteractor.h"
> int main( int argc, char **argv) {
> typedef itk::Image<unsigned short,2> ImageType;
> typedef itk::ImageFileReader<ImageType> ReaderType;
> typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
> 
> ReaderType::Pointer reader= ReaderType::New();
> ConnectorType::Pointer connector= ConnectorType::New();
> 
> reader->SetFileName(argv[1]);
> connector->SetInput(reader->GetOutput());
> vtkImageViewer* viewer= vtkImageViewer::New();
> vtkRenderWindowInteractor* 
> renderWindowInteractor=vtkRenderWindowInteractor::New();
> viewer->SetupInteractor( renderWindowInteractor);
> viewer->SetInput( connector->GetOutput() );
> viewer->Render();
> viewer->SetColorWindow( 255);
> viewer->SetColorLevel( 128);
> renderWindowInteractor->Start();
> return 0;
> }
> 
> ===========
>  
> can not make it work since it can not find itkImageToVTKImageFilter.h
> as refer
> " Where to find itkImageToVTKImageFilter.h"
> http://public.kitware.com/pipermail/insight-users/2004-July/009669.html 
> <http://public.kitware.com/pipermail/insight-users/2004-July/009669.html>
>  
> i copied all necessary to project source code folder but still can not i 
> have to specify the absolute path to itkImageToVTKImageFilter.h.
>  
> how can i fix this ?
>  
>  
> i did refer some material like
>  
> "Howto build itk with vtk4.0 and cmake ? "
> http://public.kitware.com/pipermail/insight-users/2002-May/000438.html 
> <http://public.kitware.com/pipermail/insight-users/2002-May/000438.html> 
> but i just find it too much out-dated.
>  
> <http://public.kitware.com/pipermail/insight-users/2004-July/009669.html> 
>  
>  during this process i did meet project such as
>  fatal error LNK1181 "ITKBasicFilters.lib" can not be found... then in 
> the VC6.0 tooltar   tools/options/directory there, you need to set the 
> included libraries.
>  
> i believe this would help some beginner to start to use latest ITK and VTK.
>  
> and ITK guru again, please give me some explanation to the questions i 
> asked during the process....
>  
> and i also want to know...
> 1)to do some VTK+ITK programming in C++ , to make thing convenient, is 
> CMake a must?
>  
> 2) is there any tcl/tk examples in ITK. since i learn VTK by tcl, now i 
> want to continue exploring ITK with tcl, please give me some suggestions 
> on this.
>  
>  
> sorry for this long email.
>  
> thank you
>  
> Yours
> Ocean
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list