itk tutorial presentation slides-946

63
Introduction to ITK Segmentation The Insight Consortium presented by Josh Cates Scientific Computing and Imaging Institute University of Utah

Upload: kitware-kitware

Post on 15-Jan-2015

4.165 views

Category:

Technology


0 download

DESCRIPTION

http://hdl.handle.net/1926/161

TRANSCRIPT

Page 1: ITK Tutorial Presentation Slides-946

Introduction to ITK Segmentation

The Insight Consortiumpresented byJosh Cates

Scientific Computing and Imaging InstituteUniversity of Utah

Page 2: ITK Tutorial Presentation Slides-946

Session Objectives• Review some important

considerations when using ITK filters

• Overview of low-level image processing filters

– denoising / scale space– feature extraction

• Overview some common segmentation filters

– connected component– pixel classification– watersheds– level-set methods

• Brief introduction to image processing “frameworks” in ITK

• See examples – simple command line– full applications with user

interaction

Page 3: ITK Tutorial Presentation Slides-946

Important Facts about ITK Filters

1. Most filters are N dimensional

2. Many filters run multi-threaded

3. Filters are implemented within frameworks

4. Most filters are documented

5. Filters are regression tested

6. Data type matters

7. Pixel spacing matters

8. Filters are not full applications

9. Filters require parameter tuning

Page 4: ITK Tutorial Presentation Slides-946

Raw Data

Big Picture: The Role of ITK Filters

Filteringlinear

nonlinear

FeatureExtraction

differential geom.

edge detection

Segmentationregion growing

watershedslevel-sets

Visualizationbinary volume

mesheslabeled image

implicit surfaces

Dataflow architecture: ITK filters fit together to produce segmentation applications.

Pre

proc

essi

ng Moral: ITK segmentation filters are not complete applications – components in a pipeline.

Page 5: ITK Tutorial Presentation Slides-946

Big Picture: The Role of ITK Filters

Raw Data

Filtering

FeatureExtraction

Segmentation Visualization

UserInterface

Page 6: ITK Tutorial Presentation Slides-946

Where to go to really learn to use the filters

http://www.itk.orgDoxygen Manual PagesSoftware Guide

Algorithm descriptionsTutorials for using algorithms

Theory BookInsight into Images, Terry Yoo, ed.

Users Mailing ListCVS Repositories:

Insight/ExamplesInsightApplications

Page 7: ITK Tutorial Presentation Slides-946

What is an ITK Image?

Templated over data type

May be vector-valued

Templated over dimensionality

Spacing, origin & orientation information

Pixels may be addressed directly or through an assortment of iterators

Interpolators may also be used

In general, implemented as a flat, C++ array

Buffers may be imported & exported

LargestPossibleRegion

BufferedRegion

RequestedRegion

Page 8: ITK Tutorial Presentation Slides-946

Thresholding

BinaryThresholdImageFilter

Page 9: ITK Tutorial Presentation Slides-946

Thresholding

ThresholdImageFilter

Page 10: ITK Tutorial Presentation Slides-946

Intensity Transformations

CastImageFilter

RescaleIntensityImageFilter

ShiftScaleImageFilter

NormalizeImageFilter

SigmoidImageFilter

Page 11: ITK Tutorial Presentation Slides-946

Intensity Transformations

SigmoidImageFilter

Page 12: ITK Tutorial Presentation Slides-946

Image Morphology

BinaryErodeImageFilter

BinaryDilateImageFilter

Page 13: ITK Tutorial Presentation Slides-946

Image Morphology

GrayscaleErodeImageFilter

GrayscaleDilateImageFilter

Page 14: ITK Tutorial Presentation Slides-946

Edge Detection & Feature ExtractionCannyEdgeDetectionImageFilter

LaplacianImageFilter

GradientMagnitudeImageFilter

Page 15: ITK Tutorial Presentation Slides-946

Edge Detection & Feature Extraction

GradientMagnitudeRecursiveGaussianImageFilter

Page 16: ITK Tutorial Presentation Slides-946

Edge Detection & Feature Extraction

DerivativeImageFilter

Page 17: ITK Tutorial Presentation Slides-946

Image Denoising: Linear

MeanImageFilter

Page 18: ITK Tutorial Presentation Slides-946

Image Denoising: Linear

MedianImageFilter

Page 19: ITK Tutorial Presentation Slides-946

Image Denoising: LinearBinomialBlurImageFilter

RecursiveGaussianImageFilter

DiscreteGaussianImageFilter

Page 20: ITK Tutorial Presentation Slides-946

Image Denoising: Nonlinear

BilateralImageFilter

CurvatureFlowImageFilter

GradientAnisotropicDiffusionImageFilter

CurvatureAnisotropicDiffusionImageFilter

Page 21: ITK Tutorial Presentation Slides-946

Image Denoising: Nonlinear

VectorGradientAnisotropicDiffusionImageFilter

VectorCurvatureAnisotropicDiffusionImageFilter

Page 22: ITK Tutorial Presentation Slides-946

Linear Diffusion

Destroys and moves edges

Page 23: ITK Tutorial Presentation Slides-946

Nonlinear Diffusion

Preserves Edges

Page 24: ITK Tutorial Presentation Slides-946

Geometric Transformations

TransformImageFilter

Page 25: ITK Tutorial Presentation Slides-946

Remember

Filters generalize to N dimensions

Filters “work” on arbitrary data types, but only some data types make sense

Filters are implemented within extensible frameworks

Page 26: ITK Tutorial Presentation Slides-946

Image Neighborhood Framework

Neighborhood is a set of pixels local adjacent to one another

Used to implement algorithms where result at pixel i is based on some computation within the neighborhood of i

Iterators abstract the API for working with a neighborhood of pixels in arbitrary dimensions

Operators are applied to image neighborhood to perform various calculations

Boundary conditions are handled automatically

Page 27: ITK Tutorial Presentation Slides-946

Neighborhood Iterator Framework

Page 28: ITK Tutorial Presentation Slides-946

Neighborhood Iterators

Page 29: ITK Tutorial Presentation Slides-946

ITK Segmentation Algorithms

Classification / Thresholding

Region Growing

Watersheds

Level-set Methods

“Hybrid” Methods

Page 30: ITK Tutorial Presentation Slides-946

Statistical Pattern ClassificationIdea

Find disjoint regions in a feature spaceClassify image pixels according to feature vectors

ClassifierMultiple membership functions (each represents one

possible class) return scores from feature vectorsDecision rule based on scores

Implemented using the ITK statistics subsystem (framework)

Page 31: ITK Tutorial Presentation Slides-946

Statistical Pattern Classification Framework1. Measurement vectors are input to membership functions

2. Membership functions feed scores to decision rule

3. Decision rule compares scores and returns a class label

Data Container(Test)

•Sample•Image

Membership Function(+)

Classifier

Decision Rule

Data Container(Classification Result)

•Membership Sample•Classified Image

Parameter Estimator(+)

Data Container(+)Training

Page 32: ITK Tutorial Presentation Slides-946

Segmentation of gene expression images of the mouse brain at the Allen Institute for Brain Science, Seattle WA*

Designed with ITK componentsItk::ImageModelEstimatorBase & related classes

itk::Statistics::MembershipFunctionBase & related classes

itk::DecisionRuleBase & related classes

Other filters: morphological, connected component labeling, threshold filters etc.

RequirementsModular design / code reuse

Careful memory usage (each 2D image is on the order of 150 MPixels)

Robust and adaptable to change in image quality

*Courtesy of Dr. Lydia Ng, Allen Institute for Brain Science, www.brainatlas.org.

Classifier Framework Example

Page 33: ITK Tutorial Presentation Slides-946

Classifier Framework Example

(a) (b) (c)(a) (b) (c)

(a) Original ISH stained image; (b) heat map representing the membership

values of each pixel representing expression, and (c) the final threshold

mask generated from the heat map

Page 34: ITK Tutorial Presentation Slides-946

Region Growing

IdeaStart with set of seed pixels – regionIteratively include neighboring pixels that satisfy membership

criteria

Membership criteria – similarity based metricsIntensity interval, Regional statistics

AlgorithmsSimple to complex variationsEasy to write using ND neighborhood tools

Several strategiesConnected Threshold, Otsu Threshold, Neighborhood

Connected, (Vector) Confidence Connected, Isolated Connected

Page 35: ITK Tutorial Presentation Slides-946

Confidence Connected Filter

Threshold based region growing

Mean and standard deviation of region determine upper and lower thresholds

Recomputes thresholds at intervals

Compute and of region

Flood fill with threshold interval

kk

Repeat N times

Page 36: ITK Tutorial Presentation Slides-946

Region Growing Segmentation

ConfidenceConnectedImageFilter

smoothing iterations 5smoothing time step 0.125

C.C. multiplier 2.5C.C. iterations 5

white matter(60,116)

original ventricle(81,112)

gray matter(107,69)

Page 37: ITK Tutorial Presentation Slides-946

Region Growing Segmentation

VectorConfidenceConnectedImageFilter

Page 38: ITK Tutorial Presentation Slides-946

Watershed Segmentation

Image treated as a topological relief map – intensity represents height

Gradient descent defines segmented regionsSet of all pixels whose paths of steepest descent terminate

in same local minimum

Bounded by image features

“No parameters”

Page 39: ITK Tutorial Presentation Slides-946

ITK Watershed Transform

Image (filtered) Feature Extraction“Edge Map”

Watershed Transform Wat

ersh

ed D

epth

Page 40: ITK Tutorial Presentation Slides-946

The Oversegmentation Problem

Watershed transform produces too many regionsOne per local minimum

Especially in noisy or highly detailed data

To alleviate oversegmentationHierarchical approach – merge adjacent regions according

to increasing watershed depthA. P. Mangan, R. T. Whitaker, Partitioning 3D surface

meshes using watershed segmentation, IEEE Transactions on Visualization and Computer Graphics 5 (4) (1999) 308–321.

Page 41: ITK Tutorial Presentation Slides-946

Watersheds Hierarchy

Initial Watershed Transform

Wat

ersh

ed D

epth

Thr

esho

ld

Boolean OperationsOn Sub-trees(e.g. user interaction)

Ove

rseg

men

ted

Und

erse

gmen

ted

= basin

Watershed Transform Wat

ersh

ed D

epth

Enforce minimum watershed depthsat successively higher levels.

Page 42: ITK Tutorial Presentation Slides-946

Example: Watersheds GUI

3D isosurface rendering

Data with overlayWatershed

transformSegmentation

in progress

Sliders manipulate watershed depth

and position in the hierarchy.

Wa

ters

he

d D

ep

th T

hre

sh

old

InsightApplications/SegmentationEditor

Page 43: ITK Tutorial Presentation Slides-946

Example: Watersheds GUI

Page 44: ITK Tutorial Presentation Slides-946

Example: Watersheds GUI

Data Hand contour Watersheds

Eyeball

Optic nerves

Page 45: ITK Tutorial Presentation Slides-946

LevelSet Surface Modeling Theory

kth Level Set: set of all points of value k

Embed N dimensional surface as ZERO level set of N+1 dim. volume

Model N dim. surface movement as evolving wavefront – forward differences solution to PDE

Page 46: ITK Tutorial Presentation Slides-946

Segmentation Using Level Sets

Define speed term(s) to go to zero at edges – data fitting term

Surface motion/speed based on intensity-based features

Solve the level-set equation where

Page 47: ITK Tutorial Presentation Slides-946

PDE Solver Framework

PurposeNonlinear image processing – e.g. anisotropic diffusion

Moving wave fronts – level set models

Deformable registration

Generic frameworkSeparate solvers from equations – interchangeable code

objects

Page 48: ITK Tutorial Presentation Slides-946

PDE Solver Hierarchy

Dense

Finite DifferenceSolver

Sparse

NarrowBand

Diffusion

Other Solvers

Finite DifferenceFunction

Diffusion

LevelSet

Other Functions

Aniso. Diff Curv.

Limited

Segment.

ThreadedSparse

4th Order

DeformableRegistration

Page 49: ITK Tutorial Presentation Slides-946

Constructing a PDE Filter

InputImage

OutputImage

(Filtered)

Solver Object Subclass

FunctionObject

Parameters

Page 50: ITK Tutorial Presentation Slides-946

LevelSet Segmentation Framework

User-Defined LS Seg. Filter

Level-Set Segmentation Filter

Finite Difference Solver

CurvatureFunction

“Feature”Image

InitialModel

OutputModel

Finite Difference Solver

Sparse-Field Level-Set Solver

Level SetFunction

ShapeDetectionFunction

Active-ContoursFunction

LaplacianFunction

ThresholdFunction

CannyEdges

Function

Page 51: ITK Tutorial Presentation Slides-946

LevelSet Segmentation Algorithms in ITK

Fast marching

Geodesic active contours

CURVES (vessel segmentation)

Intensity interval (scalar and vector)

Canny edge distance

Laplacian edges

… and more.

Page 52: ITK Tutorial Presentation Slides-946

Example: Threshold based LS SegmentationSpeed function (positive inside object)Similar to confidence connected filter

Points Inside Points OutsidePoints Outside

LowThreshold

HighThreshold

Image IntensityModel Speed

•Lefohn, Kniss, Hansen, Whitaker, “GPU-Based, Interactive, Level-Set Models for Volume Visualization and Analysis”, IEEE Vis 2003•Lefohn, Whitaker, Cates, “Interactive Level-Set Models for Brain Tumor Segmentation”, MICCAI 2003

Page 53: ITK Tutorial Presentation Slides-946

Example: LevelSet Segmentation GUI

Page 54: ITK Tutorial Presentation Slides-946

Multiscale LevelSet 3D Segmentation

Seed surface DataScale

1/4

1/2

1/1

Page 55: ITK Tutorial Presentation Slides-946

Advanced Features in the PDE FrameworkParallel Solvers – Narrowband,

Sparse field

05

101520253035404550

0 20 40 60

SGI Origin 300064 600 Mhz ProcessorsS

peed

up(v

s. 1

p

roce

sso

r

Number of processors

Page 56: ITK Tutorial Presentation Slides-946

4th Order Flow Segmentation Framework

User-Defined LS Seg. Filter

Level-Set Segmentation Filter

Finite Difference Solver

CurvatureFunction

OutputModel

Finite Difference Solver

Sparse-Field Level-Set Solver(Refitting)

SpeedFunction

ShapeDetectionFunction

Active-ContoursFunction

LaPlacianFunction

ThresholdFunction

CannyEdges

Function

Manifold Solver(Normals Processing)

InputImage

InitialModel

Page 57: ITK Tutorial Presentation Slides-946

Segmentation Using 4th Order Flows

Special 4th order solver plugs into LS segmentation framework – no change in function objects.

Speed term only Speed + Anisotropic4th order terms

(not real-time)

Page 58: ITK Tutorial Presentation Slides-946

SNAP Tool

Aimed at clinical users – easy to learn and use

Implements various ITK level set algorithms

Implements both edge-based and region competition geodesic snake methodology

InsightApplications/Snap

Page 59: ITK Tutorial Presentation Slides-946

SNAP Segmentation of the Caudate Nuclei Dialog for setting evolution parameters

SNAP User Interface

Scalpel tool for editing segmentations

SNAP Segmentation Wizard with VCR Controls

Manual Segmentation

InsightApplications/Snap

Page 60: ITK Tutorial Presentation Slides-946

“Hybrid” Segmentation Methods

Apply several algorithms in sequence

Utilize strengths of eachSpeed / accuracy tradeoffs — e.g. connected component

vs. level-sets

Maximize use of information in data — e.g. region based plus boundary based

Page 61: ITK Tutorial Presentation Slides-946

Hybrid Method: Region Growing + Level Sets

Canny LSSegmentati

onFilter

LSImag

e(float)

Image

Confidence

Connected

Initial model

AnisotropicDiffusion

Generate initial model using confidence connected filter

Fit to data using level-set methods – minimize distance to Canny edges

Feature

Image

Page 62: ITK Tutorial Presentation Slides-946

Confidence Connected + LevelSet Result

Initial confidence-connected result

Post-processing with Canny LS segmenter

LS Speed Term: distance from Canny edges

Data: Warfield, Nabavi, Butz, Tuncali, Silverman, “Intraoperative segmentation and nonrigid registration for image guided therapy, in: MICCAI'2000, SpringerVerlag, 2000, pp.176-185.

Page 63: ITK Tutorial Presentation Slides-946

http://www.itk.org

enjoy ITK!