national alliance for medical image computing itk the image segmentation and registration toolkit...
TRANSCRIPT
National Alliance for Medical Image Computing http://na-mic.org
ITKThe Image Segmentation and
Registration Toolkit
Julien JomierKitware Inc.
National Alliance for Medical Image Computing http://na-mic.org
What is ITK?
• Open Source (BSD-Like)• Written in C++• Wrapping for Java, Python, Tcl• Cross-Plaform• Image Processing• Segmentation• Registration• No Graphical User Interface (GUI)• No Visualization
National Alliance for Medical Image Computing http://na-mic.org
C++ Glue Code
How to Integrate ITK in your application
ITK
ImageProcessing
GUI
{MFC,Qt,wxWinFLTK}
Visualization
{OpenGL, VTK}
National Alliance for Medical Image Computing http://na-mic.org
ITK Developers
National Alliance for Medical Image Computing http://na-mic.org
Generic Programming
• Example: Standard Template Library• Abstraction of types and behaviors• Templates- itkImage<PixelType,Dimension>- itkImage<unsigned short,3>
Images are N-Dimensional, arbitrary pixel types and dimension and pixel type must be defined at compile time.
National Alliance for Medical Image Computing http://na-mic.org
ReaderImage
FileGaussian
ImageWriter File
The Data Pipeline
• ITK has a Data Pipeline architecture
• Filters are connected together
• The output image is own by each filter
• Computation is performed on demand
National Alliance for Medical Image Computing http://na-mic.org
The Simplest, yet useful ITK program
#include “itkImage.h”
#include “itkImageFileReader.h”
#include “itkMedianImageFilter.h”
#include “itkImageFileWriter.h”
typedef itk::Image< unsigned char , 2 > ImageType;
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef itk::MedianImageFilter< ImageType, ImageType > FilterType;
typedef itk::ImageFileWriter< ImageType > WriterType;
National Alliance for Medical Image Computing http://na-mic.org
The Simplest, yet useful ITK program
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName(“InputImage.png”);
filter->SetInput( reader->GetOutput() );
writer->SetInput( filter->GetOutput() );
writer->SetFileName(“OutputImage.png”);
writer->Update();
National Alliance for Medical Image Computing http://na-mic.org
Basic Filters
• Pixel-wiseArithmetic, Casting, Thresholding
• Mathematical morphology
• Noise reductionGaussian, Anisotropic diffusion
• Derivatives
National Alliance for Medical Image Computing http://na-mic.org
• Region Growing– ConfidenceConnected
– ConnectedThreshold
– IsolatedConnected
• Watersheds
• Level Sets– FastMarching
– ShapeDetection
– GeodesicActiveContours
– ThresholdSegmentation
– CannySegmentationLevelSet
Segmentation Methods
National Alliance for Medical Image Computing http://na-mic.org
Speed Curvature
Zero set, time = t
Zero set, time = t+1
Shape Detection
PDE Includes a curvature term Prevents leaking
National Alliance for Medical Image Computing http://na-mic.org
FeatureImage
Sigmoid
GradientMagnitude
Gradient
InputImage
BinaryMask
Smooth
PositiveLevelSet
Rescale
Balanced[-0.5,0.5]
InputLevelSet
ShapeDetection
InputFeature
Threshold
outputLevelSet
Shape Detection
National Alliance for Medical Image Computing http://na-mic.org
typedef itk::Image< float , 2 > ImageType;typedef itk::ShapeDetectionLevelSetImageFilter< ImageType,
ImageType > FilterType;
FilterType::Pointer shapeDetection = FilterType::New();
shapeDetection->SetInput( inputLevelSet ); shapeDetection->SetFeatureImage( speedImage );
shapeDetection->SetPropagationScaling( 1.0 ); shapeDetection->SetCurvatureScaling( 0.05 );
Shape Detection
National Alliance for Medical Image Computing http://na-mic.org
shapeDetection->SetMaximumRMSError( 0.001 ); shapeDetection->SetMaximumIterations( 400 );
shapeDetection->Update();
std::cout << shapeDetection->GetRMSChange() << std::endl; std::cout << shapeDetection->GetElapsedIterations() << std::endl;
thresholder->SetInput( shapeDetection->GetOutput() ); thresholder->SetLowerThreshold( -1e7 ); thresholder->SetUpperThreshold( 0.0 );
Shape Detection
National Alliance for Medical Image Computing http://na-mic.org
FixedImage
MovingImage
Metric
Transform
Interpolator
Optimizer
Registration Method
Registration Framework
National Alliance for Medical Image Computing http://na-mic.org
ITK Transforms
• Rigid (Quaternion), Similarity, Affine
• Centered transforms
• ThinPlateSpline, ElasticBodySpline, B-Spline
• TransformIO: Matlab, XML, Text
National Alliance for Medical Image Computing http://na-mic.org
ITK Metrics
• MeanSquares, NormalizedCorrellation, GradientDifference
• MutualInformation (Viola-Mattes)
• KullbackLeiblerCompareHistogram
• Model-to-Image metrics:- ICP
National Alliance for Medical Image Computing http://na-mic.org
ITK Optimizers
• Derived from VNL
• GradientDescent, ConjugateGradient, Powel
• Amoeba, One-plus-One, LBFGS(B), LevenbergMarquart
• Use metric value or metric derivative or both.
National Alliance for Medical Image Computing http://na-mic.org
ITK Interpolators
• NearestNeighbor, Linear, BSpline
• WindowedSync
National Alliance for Medical Image Computing http://na-mic.org
Enjoy ITK!
www.itk.org