ITK¶
Description¶
ITK (Insight Segmentation and Registration Toolkit) est une bibliothèque logicielle libre de classes C++ de traitement d'image. Elle contient des algorithmes de recalage d'image, de filtrage et de segmentation. Elle a été créée dans le but d'analyser toute sorte d'images médicales.
Références¶
Versions installées¶
v4.13.0
, sous/sw/lib/itk/4.13.0
, compilé (Release mode
) avec l'interface versvtk 7.1.0
ET plusieurs modules supplémentaires aux modules standards :
[homer@hulk build]$ grep -P "^[Module].+=ON" CMakeCache.txt Module_AnisotropicDiffusionLBR:BOOL=ON Module_HigherOrderAccurateGradient:BOOL=ON Module_ITKVtkGlue:BOOL=ON Module_IsotropicWavelets:BOOL=ON Module_LabelErodeDilate:BOOL=ON Module_MinimalPathExtraction:BOOL=ON Module_MorphologicalContourInterpolation:BOOL=ON Module_MultipleImageIterator:BOOL=ON Module_ParabolicMorphology:BOOL=ON Module_PrincipalComponentsAnalysis:BOOL=ON Module_SplitComponents:BOOL=ON Module_Strain:BOOL=ON Module_SubdivisionQuadEdgeMeshFilter:BOOL=ON Module_VariationalRegistration:BOOL=ON Module_HigherOrderAccurateGradient-MODIFIED:INTERNAL=ON Module_IsotropicWavelets-MODIFIED:INTERNAL=ON Module_LabelErodeDilate-MODIFIED:INTERNAL=ON Module_MinimalPathExtraction-MODIFIED:INTERNAL=ON Module_MorphologicalContourInterpolation-MODIFIED:INTERNAL=ON Module_MultipleImageIterator-MODIFIED:INTERNAL=ON Module_ParabolicMorphology-MODIFIED:INTERNAL=ON Module_PrincipalComponentsAnalysis-MODIFIED:INTERNAL=ON Module_SplitComponents-MODIFIED:INTERNAL=ON Module_Strain-MODIFIED:INTERNAL=ON Module_SubdivisionQuadEdgeMeshFilter-MODIFIED:INTERNAL=ON Module_VariationalRegistration-MODIFIED:INTERNAL=ON
Usage :¶
[homer@thor ~]$ module help lib/itk/4.13.0 ----------- Module Specific Help for 'lib/itk/4.13.0' ------------- modules - loads the ITK library environment This adds /sw/lib/itk/4.13.0/gnu/* to several of the environment variables. Compiled with Release flags, ITKVtkGlue=ON and several additionnal modules (see wiki for more information) Version 4.13.0 [homer@thor ~]$ module add lib/itk/4.13.0
Utilisation¶
- fichier c++ :
myitkAlgo.cxx
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkGradientMagnitudeImageFilter.h"
int main( int argc, char ** argv )
{
if( argc < 2 )
{
std::cerr << "Usage: myitkAlgo filename2Dimage" << std::endl;
return 1;
}
typedef itk::Image< unsigned char, 2 > ImageType;
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef itk::GradientMagnitudeImageFilter<
ImageType, ImageType > FilterType;
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
reader->SetFileName( argv[1] );
filter->SetInput( reader->GetOutput() );
filter->Update();
return 0;
}
- fichier
CMakeLists.txt
:
PROJECT(ITKALGO) # 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(myitkAlgo myitkAlgo.cxx ) TARGET_LINK_LIBRARIES(myitkAlgo ${ITK_LIBRARIES} )
[homer@thor itk_algo]$ module add lib/itk [homer@thor itk_algo]$ mkdir build [homer@thor itk_algo]$ ls build CMakeLists.txt myitkAlgo.cxx [homer@thor itk_algo]$ cd build/ [homer@thor build]$ cmake .. [homer@thor build]$ make [homer@thor build]$ ./myitkAlgo Usage: myitkAlgo filename2Dimage