Insight Segmentation and Registration Toolkit
ITK | |
---|---|
Basic data
|
|
developer | National Library of Medicine , Kitware Inc. and various universities |
Current version | 5.1.1 |
operating system | Unix derivatives ( Linux , macOS ), Windows |
programming language | C , C ++ , Python |
category | Image processing |
License | Apache 2.0 license |
German speaking | No |
www.itk.org |
The Insight Segmentation and Registration Toolkit (ITK) is an open-source - C ++ - program library for segmentation and registration of images.
General
The development of ITK was started in 1999 by the National Library of Medicine in order to create open class libraries and interfaces for the evaluation of the Visible Human Project . Typical areas of application for ITC are e.g. B. the processing of medical data from computed tomography and magnetic resonance tomography . CMake , which was specially developed for ITK, is used as the build system .
Examples
Smoothing using a Gaussian filter
#include <itkImage.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkDiscreteGaussianImageFilter.h>
int main(int argc, char *argv[])
{
typedef itk::Image<unsigned char, 2> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageFileWriter<ImageType> WriterType;
typedef itk::DiscreteGaussianImageFilter<ImageType, ImageType> GaussianFilterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName("test.jpg");
GaussianFilterType::Pointer smoothFilter = GaussianFilterType::New();
smoothFilter->SetInput(reader->GetOutput());
smoothFilter->SetVariance(3);
WriterType::Pointer writer = WriterType::New();
writer->SetInput(smoothFilter->GetOutput());
writer->SetFileName("smoothImage.png");
try
{
writer->Update();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Region Growing Segmentation
#include <itkImage.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkConnectedThresholdImageFilter.h>
int main(int argc, char *argv[])
{
typedef itk::Image<unsigned char, 3> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageFileWriter<ImageType> WriterType;
typedef itk::ConnectedThresholdImageFilter<ImageType, ImageType> RegionFilterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName("test.nii");
ImageType::IndexType seed;
seed[0] = 142;
seed[1] = 97;
seed[2] = 63;
RegionFilterType::Pointer regionFilter = RegionFilterType::New();
regionFilter->SetInput(reader->GetOutput());
regionFilter->SetSeed(seed);
WriterType::Pointer writer = WriterType::New();
writer->SetInput(regionFilter->GetOutput());
writer->SetFileName("region.nii");
try
{
writer->Update();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
See also
Web links
- www.itk.org (English)
- Home to ICT Tutorials (English)