470 likes | 696 Views
ITK Applications. Jean-Loïc Rose CREATIS-LRMN. Image applications. Morphology filtering. Watershed. Registration. Threshold. applications. Region growing. Classification. Levelset. Contents. ITK Segmentation Methods Region Growing Watershed Level Sets
E N D
ITK Applications Jean-Loïc Rose CREATIS-LRMN
Image applications Morphology filtering Watershed Registration Threshold applications Region growing Classification Levelset
Contents • ITK Segmentation Methods • Region Growing • Watershed • Level Sets • ITK Registration Methods • Statistics • Histogram • Classification
Segmentation Methods: Overview • Region Growing • ConnectedThreshold • ConfidenceConnected • IsolatedConnected • Watersheds • Level Sets • FastMarching • ShapeDetection • GeodesicActiveContours • ThresholdSegmentation • CannySegmentationLevelSet
Segmentation Methods: Overview • Region Growing • ConnectedThreshold • ConfidenceConnected • IsolatedConnected • Watersheds • Level Sets • FastMarching • ShapeDetection • GeodesicActiveContours • ThresholdSegmentation • CannySegmentationLevelSet
Upper bound Seed Lower bound Connected threshold Intensity Seed Point
Connected threshold typedefitk::Image< unsigned char, 2 > ImageType; ImageType::IndexType seed= {{123,235}}; typedefitk::ConnectedThresholdImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput( reader->GetOutput() ); filter->SetLower( 155 ); filter->SetUpper( 235 ); filter->SetSeed( seed); filter->Update( );
Connected threshold (b) (c) (d) a b c d
Upper bound Mean Lower bound Confidence Connected Intensity Seed Point
Confidence Connected typedefitk::Image< unsigned char, 2 > ImageType; ImageType::IndexType seed= {{123,235}}; typedefitk::ConfidenceConnectedImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput( reader->GetOutput() ); filter->SetMultiplier( 1.5 ); filter->SetNumberOfIterations( 5 ); filter->SetInitialNeighborhoodRadius( 2 ); filter->SetReplaceValue( 255 ); filter->SetSeed( seed); filter->Update( ); … writer->SetInput( filter->GetOutput() ); writer->Update();
Confidence Connected (b) (c) (d) a b c d
Seed 2 UpperValueLimit Isolated Value Seed 1 Lower Isolated Connected Intensity 2 Seed Points
Isolated Connected typedefitk::Image< unsigned char, 2 > ImageType; ImageType::IndexType index1= {{123,235}}; ImageType::IndexType index2= {{236,189}}; typedefitk::IsolatedConnectedImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput( reader->GetOutput() ); filter->SetLower( 155 ); filter->SetUpperValueLimit( 235 ); filter->SetReplaceValue( 255 ); filter->SetSeed1( index1); filter->SetSeed2( index2); filter->Update( );
Isolated Connected segmentation result Input image smoothing image itk::CurvatureFlowImageFilter
Segmentation Methods: Overview • Region Growing • ConnectedThreshold • ConfidenceConnected • IsolatedConnected • Watersheds • Level Sets • FastMarching • ShapeDetection • GeodesicActiveContours • ThresholdSegmentation • CannySegmentationLevelSet
Water Level Watershed Concept Intensity
Watershed Segmentation typedefitk::Image< float, 2 > ImageType; typedefitk::GradientMagnitudeImageFilter < ImageType, ImageType > GradientType; GradientType::Pointer gradient = GradientType::New(); gradient->SetInput( reader->GetOutput() ); gradient->Update( ); typedefitk::WatershedImageFilter< ImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput( gradient->GetOutput() ); filter->SetThreshold( 0.001 ); filter->SetLevel( 0.15 ); filter->Update( );
Segmentation Methods: Overview • Region Growing • ConnectedThreshold • ConfidenceConnected • IsolatedConnected • Watersheds • Level Sets • FastMarching • ShapeDetection • GeodesicActiveContours • ThresholdSegmentation • CannySegmentationLevelSet
Anisotropic diffusion Gradient magintude Sigmoid filter Fast Marching Sigmoid FastMarchingImageFilter Input Gradient Magnitude Speed Image Output
Anisotropic diffusion Gradient magintude Sigmoid filter Fast Marching Δx Δx = V . Δt FastMarchingImageFilter Input Speed Image Time-Crossing Map Output
FastMarchingImageFilter typedefitk::Image< float, 2 > ImageType; typedefitk::FastMarchingImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer fastmarching = FilterType::New(); fastmarching->SetInput( speedImage ); fastmarching->SetOutputSize( speedImage->GetBufferedRegion().GetSize() ); fastmarching->SetStoppingValue( 100.0 ); fastmarching->SetSeed( seeds ); fastmarching->Update(); typedef FilterType::NodeContainer NodeContainer; typedef FilterType::NodeType NodeType; NodeContainer::Pointer seeds = NodeContainer::New(); seeds->Initialize(); NodeType seed; seed.SetValue( 0.0 ); seed.SetIndex( index ); seeds->InsertElement( 0, seed );
FastMarchingImageFilter (a) (b) (c) (d) a b c d
Gradient Sigmoid Input Image Gradient Magnitude output LevelSet Input Feature Feature Image Shape Detection Input LevelSet Threshold Smooth Rescale Binary Mask Positive LevelSet Balanced [-0.5,0.5] Shape Detection Malladi et al (1995)
Shape Detection Malladi et al (1995) typedefitk::Image< float, 2 > ImageType; typedefitk::ShapeDetectionLevelSetImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer shapeDetection = FilterType::New(); shapeDetection->SetInput( inputLevelSet ); shapeDetection->SetFeatureImage( SpeedImage ); shapeDetection->SetPropagationScaling( 1.0 ); shapeDetection->SetCurvatureScaling( 0.05 ); shapeDetection->SetMaximumRMSError( 0.001 ); shapeDetection->SetMaximumIterations( 400 ); shapeDetection->Update();
Shape Detection Malladi et al (1995) (a) (b) (c) (d) a b c d
ZeroSet Displacement Geodesic Active Contours Caselles et al (1997) Intensity Profile X axis Advection term added
Geodesic Active Contours Caselles et al (1997) • addition of a third advection term which attracts the level set to the object boundaries. Vector Field Computed Internally
Geodesic Active Contours Caselles et al (1997) typedefitk::Image< float, 2 > ImageType; typedefitk::GeodesicActiveContourLevelSetImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer geodesicActiveContour = FilterType::New(); geodesicActiveContour->SetInput( inputLevelSet ); geodesicActiveContour->SetFeatureImage( SpeedImage ); geodesicActiveContour->SetPropagationScaling( 1.0 ); geodesicActiveContour->SetCurvatureScaling( 0.05 ); geodesicActiveContour->SetAdvectionScaling( 8.0 ); geodesicActiveContour->SetMaximumRMSError( 0.001 ); geodesicActiveContour->SetMaximumIterations( 400 ); geodesicActiveContour->Update();
Geodesic Active Contours Caselles et al (1997) (a) (b) (c) (d) a b c d
Canny-Edge Level Set • Advection term added controlled by edges Canny edges attract the zero set
Canny-Edge Level Set typedefitk::Image< float, 2 > ImageType; typedefitk::CannySegmentationLevelSetImageFilter < ImageType, ImageType > FilterType; FilterType::Pointer cannySegmentation = FilterType::New(); cannySegmentation->SetInput( inputLevelSet ); cannySegmentation->SetFeatureImage( inputImage); cannySegmentation->SetPropagationScaling( 0.0 ); cannySegmentation->SetCurvatureScaling( 1.0 ); cannySegmentation->SetAdvectionScaling( 2.0 ); // Canny edges cannySegmentation->SetMaximumRMSError( 0.01 ); cannySegmentation->SetMaximumIterations( 400 ); cannySegmentation->SetThreshold( 2.0 ); cannySegmentation->SetVariance( 1.0 ); cannySegmentation->SetIsoSurface( 127.0 ); cannySegmentation->SetUseNegativeFeraturesOn( ); cannySegmentation->Update();
Canny-Edge Level Set Original prior Step 15 Convergence
Contents • ITK Segmentation Methods • Region Growing • Watershed • Level Sets • ITK Registration Methods • Statistics • Histogram • Classification
Basic registration in ITK • Image registration is the process of determining the spatial transform that maps points from one image to homologous points on a object in the second image. • In ITK, registration is performed within a framework of pluggable components that can easily be interchanged.
MRI-T2 PET 128 x 128 pixels 256 x 256 pixels Basic registration in ITK Moving Image ? Fixed Image ? Images provided as part of the project: “Retrospective Image Registration Evaluation”, NIH, Project No. 8R01EB002124-03, Principal Investigator, J. Michael Fitzpatrick, Vanderbilt University, Nashville, TN.
Fixed image Metric Optimizer Interpolator Transform Moving image Registration in ITK pixels fitness value pixels transform parameters pixels points
Registration in ITK • Transform: represents the spatial mapping of points from the fixed image space to points in the moving image space. • Interpolator: is used to evaluate moving image intensities at non-grid positions. • Metric: provides a measure of how well the fixed image is matched by the transformed moving image. • Optimizer: This measure forms the quantitative criterion to be optimized by the optimizer over the search space defined by the parameters of the transform.
Registration in ITK • Toolbox overview
Registration in ITK • Toolbox overview
Registration in ITK: Overview Multi-Resolution Multi-Modality Registration Point Set Deformable registration
Contents • ITK Segmentation Methods • Region Growing • Watershed • Level Sets • ITK Registration Methods • Statistics • Statistics applied to image • Classification
Statistics: Overview • Statistics applied to image • Images histograms • Entropy • Mutual information • Classification • k-d Tree based k-Means Clustering • k-Means classification • Bayesian plug-in classifier • Classification using Markov Random Field
Conclusion • Very useful for rapid prototyping • Strongly growing community and code base • Problems: • Very complex • Overhead -> higher run-times • Still under development
Insight Toolkit Advanced Course Enjoy yourself !
References • http://www.itk.org/ItkSoftwareGuide.pdf • http://www.itk.org/Doxygen/html/index.html • http://www.itk.org/HTML/Tutorials.htm