ITK/Release 4/Modularization/Prototype/Tutorial: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 57: Line 57:
In the created itk-complete directory: ".gitsubmodule" file contains all submodules' urls; "itk-depends" module contains the dependencies among the modules and cmake codes to configure the superproject according to the dependencies. You will also see empty directories created for the seven modules.  
In the created itk-complete directory: ".gitsubmodule" file contains all submodules' urls; "itk-depends" module contains the dependencies among the modules and cmake codes to configure the superproject according to the dependencies. You will also see empty directories created for the seven modules.  


Download toy modular ITK modules using [ https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial git submodule] :
Download toy modular ITK modules using [http://www.itk.org/Wiki/ITK_Release_4/Modularization/Prototype/Tutorial#Reference git submodule] :
  # enter the itk-complete directory  
  # enter the itk-complete directory  
  cd itk-complete
  cd itk-complete
Line 81: Line 81:
   git clone git://kwsource.kitwarein.com/itk/app-itk-complete.git
   git clone git://kwsource.kitwarein.com/itk/app-itk-complete.git
    
    
  # cmake configure and generate
   cd /bin/app-itk-complete
   cd /bin/app-itk-complete
   ccmake /src/app-itk-complete
   ccmake /src/app-itk-complete
    
 
   make
   # build and test
   make test


== Method B: itk-optional ==
== Method B: itk-optional ==

Revision as of 03:00, 5 November 2010

Overview

  • Toy modular ITK design

This tutorial demonstrates the prototype of modularized ITK with a toy example containing seven modules and a testing application. The seven library modules are:

 * itk-vnl (a subset of numeric libraries of VXL),
 * kwsys (a supporting library for system information/tools ? ?),
 * itk-common (core classes, macro definitions, typedefs, and other software constructs central to ITK),
 * itk-io-common (classes that support the reading and writing of data),
 * nrrdio (third-party library),
 * itk-io-nrrd (itk wrapper of nrrdio).
 * itk-zlib (zlib library wrapped up for nirrdio)

The application "test-itk-nrrd" module contains one test program that reads and writes images in Nrrd format.

  • CMake prototyping

To enable ITK developers download and configure the whole modularized ITK package, we designed several cmake magics to serve the modularized ITK . The major challenge is to manage dependencies between the modules. Two strategies using CMake have been proposed so far and both are demonstrated in this tutorial. A classic CMake approach is to use "add_subdirectory" to include each module in correct order according to their dependencies. Git submodule is used to obtain all the modules all together with specific versions. Here we refer this approach as "itk-complete" approach (Method A). Another approach is to use the state-of-the-art cmake function "add_export_project" to automate the process of pulling selected modules from their repositories and building them. Users can select the specific modules they need for their applications from the cmake gui.We refer to this second approach as "itk-optional" approach (Method B).

Requirements

  • A computer with a network connection
  • A build environment (gcc / VS)
  • CMake 2.8.2 installed([1])
  • Git 1.7.x.x installed ([2])

Approaches

Module-by-module

The repositories of the seven modules in the toy modular ITK are listed as follows. They can be build separately with manually specified (via cmake) paths for their required depending modules.

#itk-vnl
  git://kwsource.kitwarein.com/itk/itk-vnl.git
#itksys
 git://kwsource.kitwarein.com/itk/itksys.git
#itk-zlib
 git://kwsource.kitwarein.com/itk/itk-zlib.git
#nrrdio
  git://kwsource.kitwarein.com/itk/nrrdio.git
#itk-common
 git://kwsource.kitwarein.com/itk/itk-common.git
#itk-io-common
 git://kwsource.kitwarein.com/itk/itk-io-common.git
#itk-io-nrrd
 git://kwsource.kitwarein.com/itk/itk-io-nrrd.git

Tests of each modules can be found on the dashboard:

http://www.cdash.org/CDash/index.php?project=Insight#ITKv4_Modularization

Method A: itk-complete

Download the itk-complete superproject package to the source directory (/src) using Git :

git clone git://kwsource.kitwarein.com/itk/itk-complete.git

In the created itk-complete directory: ".gitsubmodule" file contains all submodules' urls; "itk-depends" module contains the dependencies among the modules and cmake codes to configure the superproject according to the dependencies. You will also see empty directories created for the seven modules.

Download toy modular ITK modules using git submodule :

# enter the itk-complete directory 
cd itk-complete
# add the submodule repository URLs
git submodule init
# clone the repositories and check out the commits specified in the superproject
git submodule update 

Now you have all the source codes ready for building the toy modular ITK.

Build itk-complete project in the build directory (/bin):

#CMake configure and generate
cd /bin/itk-complete
ccmake /src/itk-complete

#compile
make

Till now you have successfully build the modular ITK project from source codes. Their dependencies are automatically configured according to the predefined dependencies in the package.

Test itk-complete with an example application:

 # get the test package app-itk-complete
 git clone git://kwsource.kitwarein.com/itk/app-itk-complete.git
 
 # cmake configure and generate
 cd /bin/app-itk-complete
 ccmake /src/app-itk-complete
 # build and test
 make test

Method B: itk-optional

Download the itk-optional package using Git to the source directory (/src):

git clone git://kwsource.kitwarein.com/itk/itk-optional.git

Download the dependency module :

# download to the itk-optional directory 
cd itk-optional
git clone git://kwsource.kitwarein.com/itk/itk-depends.git

Build itk-complete project in the build directory (/bin):

#CMake configure and generate
cd /bin/itk-optional
ccmake /src/itk-optional

#compile and build
make

Test itk-complete with an example application:

 # get the test package app-itk-optional
 git clone git://kwsource.kitwarein.com/itk/app-itk-optional.git
 
 cd /bin/app-itk-optional
 ccmake /src/app-itk-optional
 
 make

CDash Tests

url for the nightly run


Tests with MIDAS data

The testing data in this tutorial are all stored remotely in MIDAS.

http://midas.kitware.com/

CMake command ... midas_ctest() automatically obtain the data from MIDAS server according to a midas_key file associate with the data.

Reference

 https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial