ITK Introduction and Overview Spring 2006 - PowerPoint PPT Presentation

1 / 69
About This Presentation
Title:

ITK Introduction and Overview Spring 2006

Description:

Original Contract was Approximately $10 Million over 3 years ... Mailing lists, Discussion forum, Wiki. Tcons. Documentation. Releases ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 70
Provided by: nam4
Category:

less

Transcript and Presenter's Notes

Title: ITK Introduction and Overview Spring 2006


1
ITK Introduction and Overview Spring 2006
2
Topics
  • What Is ITK
  • History
  • Features
  • Software Engineering Methodology

3
ITK History
  • Sponsored by the National Library of Medicine as
    part of the Visible Human Project
  • Original Contract was Approximately 10 Million
    over 3 years
  • All dedicated to Implementing Existing Algorithms
  • Currently Only Maintenance Funding from NLM
    (mostly to Kitware)
  • Ongoing Development by User Community
  • ITK is a Major Part of the NA-MIC Kit

4
Why ITK
  • Provide a Standard Implementation of State of the
    Art Segmentation and Registration Algorithms
  • BSD Style Licensing
  • Compatible with Commercialization and Academic
    Research
  • Modern Object Oriented Design
  • Cross Platform
  • Windows, Mac, Linux, Irix, AIX, Solaris
  • Run-Time Efficiency
  • Multi-threaded, Generic (Templated)
  • Carefully Engineered for Stability
  • Regression Testing
  • Documentation

5
ITK in Practice
  • ITK Only Recently Added Direction Cosine
    Information to Images
  • Supported in Most I/O
  • Not Supported in Most Filters or Registration
  • C Learning Curve Very Steep
  • Generic Programming Means Very Little Run Time
    Flexibility
  • Code is Compiled to Support Just One Data Type

6
Mr. ITK
  • Many of the following ITK slides were developed
    by Luis Ibanez of Kitware
  • Once you see Luis role in ITK, youll know that
    the following is more than appropriate

Image courtesy Kitware, Inc.
7
Scope of ITK
  • Image Processing
  • Segmentation
  • Registration
  • No Graphical User Interface (GUI)
  • No Visualization

8
ITK Sponsors
The National Institute for Dental and
Craniofacial Research
The National Science Foundation
The National Institute of Neurological Disorders
and Stroke
9
ITK Developers
10
ITK Developers
indicates a subcontractor.
11
ITK by the Numbers
  • March 2000
  • First code check-in
  • 1300
  • of nightly builds
  • 1062
  • tests run nightly
  • 41
  • of platforms ( software hardware )
  • 700
  • of classes
  • 1600
  • of files with code

12
ITK by the Numbers
  • 400K
  • of lines of code
  • 100K
  • of lines of test code
  • 35K
  • of lines of examples
  • 150K
  • of lines of Applications
  • 240
  • weekly t-cons
  • 50
  • unique developers

13
ITK by the Numbers
  • 1032
  • of users subscribed to the mailing-list
  • 400
  • of emails posted monthly to the users-list
  • 819
  • of pages in the Software Guide PDF document
  • 1800
  • of monthly hits to the URL of the Software
    Guide PDF
  • 1900
  • of monthly hits to the URL of the Tutorial PDF
  • 2400
  • of monthly hits to the source code files (.zip
    .tar.gz)

14
Example ITK Program
  • include "itkImage.h"
  • include "itkImageFileReader.h"
  • include "itkGradientMagnitudeImageFilter.h"
  • int main( int argc, char argv )
  • typedef itkImageltunsigned short,2gt
    ImageType
  • typedef itkImageFileReaderltImageTypegt
    ReaderType
  • typedef itkGradientMagnitudeImageFilterlt
  • ImageType,ImageTypegt FilterType
  • ReaderTypePointer reader ReaderTypeNew()
  • FilterTypePointer filter FilterTypeNew()
  • reader-gtSetFileName( argv1 )
  • filter-gtSetInput( reader-gtGetOutput() )
  • filter-gtUpdate()
  • return 0

15
Documentation Resources
http//www.itk.org/ItkSoftwareGuide.pdf
http//www.itk.org/Doxygen/html/index.html
  • Follow the link Alphabetical List
  • Follow the link Groups
  • Post to the insight-users mailing list

16
(No Transcript)
17
(No Transcript)
18
(No Transcript)
19
The ITK Software Guide is freely available as a
PDF document at www.itk.org/
ItkSoftwareGuide.pdfIts paper version can be
ordered from Amazon.com and from Kitwares
e-store.
20
Useful Code in ITK
  • Coding Infrastructure
  • I/O
  • Numerics
  • Based on VNL (Vision Numerics Library)
  • Image Processing
  • Convolutions, Non-Linear, Anisotropic
  • Segmentation
  • Registration

21
ITK Basics
  • C Generic Programming
  • Data Pipeline
  • Multi-threading
  • Streaming
  • Exceptions
  • Events / Observers
  • Tcl, Python and Java wrapping

22
Generic Programming
Example STL Standard Template Library
Abstraction of Types and Behaviors
stdvectorlt T gt
stdvectorlt int gt stdvectorlt double
gt stdvectorlt char gt stdvectorlt Point
gt stdvectorlt Image gt
23
itkImage
itkImagelt PixelType , Dimension gt
itkImagelt char , 2 gt itkImagelt char , 3 gt
itkImagelt char , 4 gt itkImagelt float , 2 gt
itkImagelt RGB , 3 gt itkImagelt unsigned short
, 2 gt itkImagelt itkVectorltfloat,2gt , 2 gt
24
namespaces
Avoid naming collisions
itk itkStatistics itkfem itkfemitpac
k itkbio
25
Your favorite keyword
typedef
typedef itkImagelt char , 2 gt
ImageType typedef itkImageFilterlt ImageType ,
ImageType gt FilterType
otherwise... itkImageFilterlt Imagelt char , 2 gt
, Imagelt char , 2 gt gt
FilterType
26
Smart Pointers
Object
counter0
counter1
counter2
counter3
Self - Delete
27
SmartPointers
typedef itkImagelt char , 2 gt
ImageType typedef itkImageFilterlt ImageType ,
ImageType gt FilterType
FilterTypePointer filter FilterTypeNew() I
mageTypePointer image filter-gtGetOutput()
Pointer notation filter-gtUpdate()
NO NEED FOR filter-gtDelete()
28
Const Correctness
Knowing constancy is Insight. Not knowing
constancy leads to disaster.
Tao Te Ching, XVI. Lao Tsu
29
Const Smart Pointers
typedef itkImagelt char , 2 gt
ImageType typedef itkImageFilterlt ImageType ,
ImageType gt FilterType
FilterTypePointer filter FilterTypeNew() I
mageTypeConstPointer image filter-gtGetOutput()

Can only invoke const methods image-gtGetSpacing
()
Compiler error for non-const methods image-gtSetS
pacing ( spacing )
30
Creating an Image
typedef itkImagelt char , 3 gt
ImageType ImageTypePointer image
ImageTypeNew() ImageTypeSizeType
size size 0 512 // x direction size 1
512 // y direction size 2 50 // z
direction ImageTypeIndexType start start 0
0 // x direction start 1 0 // y
direction start 2 0 // z direction
31
Creating an Image
ImageTypeRegionType region region.SetSize(
size ) region.SetIndex( start ) image-gtSetRegio
ns( region ) image-gtAllocate() image-gtFillBuffer
( 0 ) ImageTypeSpacingType spacing spacing
0 0.83 // x direction spacing 1 0.83
// y direction spacing 2 2.15 // z
direction image-gtSetSpacing( spacing )
32
Streaming
Processing Large Images
Output Image
Input Image
Filter
33
Image Regions
34
Data Pipeline
35
Simple Image IO
36
Simple Image IO
Loadable Factories
37
Simple Image IO
include itkImage.h include itkImageFileReader
.h include itkImageFileWriter.h typedef
itkImagelt char , 2 gt ImageType typedef
itkImageFileReaderlt ImageType gt
ReaderType typedef itkImageFileWriterlt
ImageType gt WriterType ReaderTypePointer
reader ReaderTypeNew() WriterTypePointer
writer WriterTypeNew() reader-gtSetFileName
( inputImage.dcm ) // DICOM writer-gtSetFi
leName( outputImage.hdr ) //
Analyze writer-gtSetInput( reader-gtGetOutput()
) writer-gtUpdate()
38
Segmentation Overview
  • Region Growing
  • ConfidenceConnected
  • ConnectedThreshold
  • IsolatedConnected
  • Watersheds
  • Level Sets
  • FastMarching
  • ShapeDetection
  • GeodesicActiveContours
  • ThresholdSegmentation
  • CannySegmentationLevelSet

39
Example Confidence Connected
Seed Point Radius
40
  • / /class ConfidenceConnectedImageFilter
  • /brief Segment pixels with similar statistics
    using connectivity
  • This filter extracts a connected set of pixels
    whose pixel
  • intensities are consistent with the pixel
    statistics of a seed
  • point. The mean and variance across a
    neighborhood (8-connected,
  • 26-connected, etc.) are calculated for a seed
    point. Then
  • pixels connected to this seed point whose
    values are within
  • the confidence interval for the seed point are
    grouped. The
  • width of the confidence interval is controlled
    by the "Multiplier"
  • variable (the confidence interval is the mean
    plus or minus
  • the "Multiplier" times the standard
    deviation). If the intensity
  • variations across a segment were gaussian, a
    "Multiplier" setting
  • of 2.5 would define a confidence interval wide
    enough to capture
  • 99 of samples in the segment.
  • After this initial segmentation is calculated,
    the mean and
  • variance are re-calculated. All the pixels in
    the previous
  • segmentation are used to calculate the mean
    the standard deviation

41
Confidence Connected
typedef itkImagelt unsigned char , 2 gt
ImageType typedef itkConfidenceConnectedImage
Filterlt ImageType, ImageType gt
FilterType FilterTypePointer filter
FilterTypeNew() filter-gtSetMultiplier( 1.5 )
filter-gtSetNumberOfIterations( 5 )
filter-gtSetInitialNeighborhoodRadius ( 2 )
filter-gtSetReplaceValue( 255 )
FilterTypeIndexType index index0 123
index1 235 filter-gtSetSeed( index
) filter-gtSetInput( reader-gtGetOutput() )
writer-gtSetInput( filter-gtGetOutput() )
writer-gtUpdate()
42
Registration Overview
  • Image Resampling
  • Registration Framework
  • Multi-Modality
  • Multi-Resolution
  • Deformable registration

43
Components
Registration Method
FixedImage
Metric
Optimizer
Interpolator
MovingImage
Transform
44
Image Metrics
  • Mean Squares
  • Normalized Correlation
  • Mean Reciprocal Square Difference
  • Mutual Information- Viola-Wells- Mattes-
    Histogram based- Histogram normalized

45
Transforms
  • Translation
  • Scaling
  • Rotation
  • Rigid3D
  • Rigid2D
  • Affine
  • BSplines
  • Splines TPS, EBS, VS

46
Optimizers
  • Gradient Descent
  • Regular Step Gradient Descent
  • Conjugate Gradient
  • Levenberg-Marquardt
  • One plus One Evolutionary Algorithm

47
Interpolators
  • Nearest Neighbor
  • Linear
  • BSpline

48
ITK Software Methodology
  • Based on Best Practices for Distributed
    Development
  • Built on Open Source Tools
  • Adopted by NA-MIC

49
NAMIC Software Process
Dan Blezek Jim Miller Bill Lorensen
50
Extreme Programming
51
NAMIC Process
  • Light weight
  • Based on Extreme Programming
  • High intensity cycle
  • Design
  • Test
  • Implement
  • Supported with web-enabled tools
  • Automated testing integrated with the software
    development

52
Software Process
  • Design Process
  • Coding Standards
  • Testing
  • Bug Tracker
  • Communication
  • Mailing lists, Discussion forum, Wiki
  • Tcons
  • Documentation
  • Releases

53
Design Process
  • Take the time to design a good API
  • Plan for future use
  • Plan for future extension
  • Two routes
  • Code something, check it in
  • Others will tear it down make it better
  • Put together a strawman
  • Solicit ideas, implement

54
Coding Standards
  • Follow the packages rules
  • ITK has certain coding standards
  • Style guidelines
  • Naming conventions
  • Macros

55
Testing
  • If it isnt tested, its broken.
  • Tests
  • Ensure your code works
  • Documents expected results
  • Others free to change

56
Bug Tracker
  • Bugs assigned / taken by developers
  • Tracks progress to releases
  • Captures feature requests
  • Communication mechanism

57
Documentation
  • Doxygen
  • Automatic API documentation
  • Algorithm references
  • Implementation details
  • Books / Manuals
  • Insight Book

58
Communication
  • Email lists
  • Discussion forum
  • Wiki
  • Tcon

59
Extreme Programming
  • Compression of standard analyze, design,
    implement, test cycle into a continuous process

60
Daily Testing Is The Key
  • Testing anchors the development process (Dart)
  • Developers monitor the testing dashboard
    constantly
  • Problems are identified and fixed immediately
  • Developers receive e-mail if theyBreak the
    Build

61
Daily rhythm
  • Design, implement algorithm
  • write regression test
  • check it in

62
Dart
  • Testing
  • Reports
  • Dashboards
  • Central site for state of the system
  • Updates
  • Builds
  • Test
  • Coverage

63
(No Transcript)
64
(No Transcript)
65
Someone broke the build!
66
(No Transcript)
67
The Big Bat of Quality
68
Bill Yogi Lorensen
69
Conculsion ITK for BIRN
  • For BIRN Developers
  • Nice set of imaging code
  • Open and freely reusable
  • For the BIRN Community
  • Benchmark of multi-site collaboration on
    large-scale engineering effort
Write a Comment
User Comments (0)
About PowerShow.com