Difference between revisions of "ITK/Release 4/Modularization/Add an external module (external module)"

From KitwarePublic
Jump to navigationJump to search
(Created page with "* Add a module(internal module) An example is Lesion Sizing Toolkit: [http://public.kitware.com/LesionSizingKit/index.php/Users/...")
 
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
* [[ITK_Release_4/Modularization/ Add a module|Add a module(internal module)]]
=== Synopsis ===


An External Module is distributed outside the ITK main repository, but it could be built into ITK as a module once downloaded into the local copy of ITK source tree.


An example is Lesion Sizing Toolkit:
=== Organization ===
[http://public.kitware.com/LesionSizingKit/index.php/Users/Build_LST_as_ITK_module Lesion Sizing Toolkit Wiki]
 
The organization of an External Module should be the same as an Internal Module:
[[ITK_Release_4/Modularization/ Add a module|Add a module (Internal Module)]]
 
To build an External Module, users download it into a local copy of ITK source tree under: ''ITK/Modules/External/''. Then simply rerun the CMake step to configure the new External Module together with other enabled ITK modules.
 
 
==== External Module Template ====
 
Here is a module template for your convenience to build your own module (thanks to Bradley Lowekamp), along with instructions:
* https://github.com/blowekamp/itkExternalTemplate
 
 
==== Testing data ====
 
Testing data, such an input and baseline images, are typically kept outside of the Git repository to keep the repository small.
 
The ITK method for handling test data is the [[ITK/Git/Develop/Data#ExternalData | CMake/ExternalData]] method, where MD5 hashes of the data are stored in the repository, then the files corresponding to the hashes are fetched at build time from a list of data servers.  These data servers can be an Apache server you have at your webhost, a [http://midasplatform.org/ Midas server], a Dropbox account, an Amazon S3 account, a Rackspace Cloud File account, etc.
 
To use the ExternalData mechanism with your own data server:
 
# Add testing data references in you ''test/CMakeLists.txt'' as you normally would, i.e. use '''itk_add_test''' and with '''DATA{Baseline/image.mha}'''.
# As usual, copy the image to its location specified within ''DATA{}''.
# As usual, next time ''cmake'' is executed, a message will appear like: ''Linked Modules/External/ITKMyNewModule/test/Baseline/image.mha.md5 to ExternalData MD5/a3519cb25bb2afeda999378a2f8103cc''
# Copy the file ''test/Baseline/.ExternalData_MD5_a3519cb25bb2afeda999378a2f8103cc'' to a location on your publically available data server, such as ''http://www.example.com/ITKExternalData/MD5/a3519cb25bb2afeda999378a2f8103cc''.
# In your ITK CMake configuration, set the value of ''ExternalData_URL_TEMPLATES'' to ''http://www.example.com/ITKExternalData/%(algo)/%(hash)''
 
=== Community dissemination ===
 
An example is demonstrated in the Lesion Sizing Toolkit: [http://public.kitware.com/LesionSizingKit/index.php/Users/Build_LST_as_ITK_module Lesion Sizing Toolkit Wiki]
 
Once you have your External Module, you can make it available as a [[ITK/Policy_and_Procedures_for_Adding_Remote_Modules| Remote Module]] so it has broader exposure to the ITK community.

Latest revision as of 17:07, 17 September 2013

Synopsis

An External Module is distributed outside the ITK main repository, but it could be built into ITK as a module once downloaded into the local copy of ITK source tree.

Organization

The organization of an External Module should be the same as an Internal Module: Add a module (Internal Module)

To build an External Module, users download it into a local copy of ITK source tree under: ITK/Modules/External/. Then simply rerun the CMake step to configure the new External Module together with other enabled ITK modules.


External Module Template

Here is a module template for your convenience to build your own module (thanks to Bradley Lowekamp), along with instructions:

* https://github.com/blowekamp/itkExternalTemplate


Testing data

Testing data, such an input and baseline images, are typically kept outside of the Git repository to keep the repository small.

The ITK method for handling test data is the CMake/ExternalData method, where MD5 hashes of the data are stored in the repository, then the files corresponding to the hashes are fetched at build time from a list of data servers. These data servers can be an Apache server you have at your webhost, a Midas server, a Dropbox account, an Amazon S3 account, a Rackspace Cloud File account, etc.

To use the ExternalData mechanism with your own data server:

  1. Add testing data references in you test/CMakeLists.txt as you normally would, i.e. use itk_add_test and with DATA{Baseline/image.mha}.
  2. As usual, copy the image to its location specified within DATA{}.
  3. As usual, next time cmake is executed, a message will appear like: Linked Modules/External/ITKMyNewModule/test/Baseline/image.mha.md5 to ExternalData MD5/a3519cb25bb2afeda999378a2f8103cc
  4. Copy the file test/Baseline/.ExternalData_MD5_a3519cb25bb2afeda999378a2f8103cc to a location on your publically available data server, such as http://www.example.com/ITKExternalData/MD5/a3519cb25bb2afeda999378a2f8103cc.
  5. In your ITK CMake configuration, set the value of ExternalData_URL_TEMPLATES to http://www.example.com/ITKExternalData/%(algo)/%(hash)

Community dissemination

An example is demonstrated in the Lesion Sizing Toolkit: Lesion Sizing Toolkit Wiki

Once you have your External Module, you can make it available as a Remote Module so it has broader exposure to the ITK community.