Title: USE
1USE
- Xinwei Xue
- 11/07/02
- SCI Institute
2OUTLINE
- Overview
- Software Architecture
- Major Functionalities
- Applications
- Write your applications
- Download Compile
3What is ITK
- C Library for Medical Image Segmentation
Registration - Open Source
- Cross Platform Linux, Irix, Windows, Sun, etc.
- Wrapped with Interpreted Languages
- e.g. Tcl, Python, Java, etc.
4Goals
- Support the Visible Human Project.
- Establish a foundation for future research.
- Create a repository of fundamental algorithms.
- Develop a platform for advanced product
development. - Create conventions for future work.
- Grow a self-sustaining community of software
users and developers.
5ITK Architecture
- Data Flow Architecture
- Update Request Triggers Processing
Application
Data Storage
Update
Source
Process Object
Process Object
Sink
Data Object
Data Object
Data Object
6Architectural Features
- Reference counting (smart pointers)
- Object Factory (plug-in support)
- ObjectTypePointer myObject
ObjectTypeNew() - Event callbacks (command/observer)
- Portable multi-threading
- GenerateData()
- ThreadedGenerateData()
7Architectural Features
- Generic Programming
- Compile-time oriented
- Employs C Templates
- Iterators
- Image Iterators
- Neighborhood Iterators
- Slice Iterators
- Concept of Regions
- Typedef
Largest Possible Region
Buffered Region
Requested Region
8Major Funcationalities
- Segmentation
- Registration
- PDE Solver
- Image Enhancement
- Feature Detection
- Image Transformations
- Other
9Segmentation Tools
- Similarity-Based Segmentation
- Statistical Pattern Classification
- Supervised (Gaussian)
and Unsupervised (Kmeans) - Fuzzy Connectedness
- Region-Based Segmentation
- Watersheds
- Voronoi
- Model-Based Segmentation
- Level-set Based Segmentation
Threshold, Laplacian - Deformable Mesh
- Balloon Force
- Hybrid Segmentation
- Fuzzy connectedness voronoi
10Registration Tools
MultiResolutionRegistrationFramework
ImageRegistrationFramework
PDEBasedRegistration
FEMBasedRegistration
11Components
Registration Method
FixedImage
MovingImage
12Components
- Optimizers
- Gradient Descent
- Regular Step Gradient Descent
- Conjugate Gradient
- Levenberg-Marquardt
- Metrics
- Mutual Information
- Mean Squares
- Normalized Correlation
- Pattern Intensity
- Transform
- Translation
- Scale
- Rotation
- Rigid3D
- Rigid2D
- Affine
- Splines TPS, EBS, VS
- Interpolators
- Nearest neighbor
- Linear
- BSpline
13 PDE Solver Framework
Finite Difference Function
Finite Difference Solver
Level Set
Sparse
Dense
Diffusion
Narrow Band
Segment.
Aniso. Diff
Diffusion
Curv. Limited
Other Functions
Other Solvers
14PDE Filter Structure
Solver Object
Input Image
Output Image (Filtered)
Function Object
Parameters
15Image Enhancement
Morphology Filter
Gaussian Filters
Erode/Dilate Filters
Image Enhancemnet
Anisotropic Diffusion
Binary Filters
Curvature Diffusion
Other Filters
Curvature MinMax Flow
16Low Level Feature Detection
Sobel Edge Detection
Gradient
Thresholding
Feature Detection
Laplacian
Canny Edges
Zero- Crossing
Other Filters
Laplacian of Gaussian
17ITK Applications
18Watershed Segmentation
19Interactive Segmentation
20Multi Field MRI Results
21Start Using ITK
- Image Class
- Related to Image Class
- Region, Size, Index, etc.
- ImageToImageFilterlt TInputImage, TOutputImagegt
- Image Region Iterator
- Neighborhood Neighborhood Iterators
- NeighborhoodIterator
SmartNeighborhoodIterator - RandomAccessNeighhoodIterator
- Neighborhood Operators
- DerivativeOperator, GaussisnOperator,
LaplacianOperator, etc. - Image IO PNG, Raw,VOL,VTK, Dicom, Meta formate
supported -
22 Neighborhood
- Templeted over neighorhood radius, image, and
image region to be processed.
1
0
2
Radius 1
4
3
5
7
6
8
7
6
8
4
3
5
1
0
2
23 Image Declaration Allocation
- typedef itkImageltfloat, 2gt ImageType
- typedef typename ImageTypeRegionType
RegionType - typedef typename ImageTypeSizeType
SizeType - typedef typename ImageTypeIndexType
IndexType - //Creates an image pointer
- ImageTypePointer image
- //Allocating memory for a image
- RegionType region
- SizeType size
- IndexType index
- size0 256 size1 256
- index0 0 index1 0
- region.SetSize(size)
- region.SetIndex(index)
- image-gtSetRegions(region)
- image-gtAllocate( )
24Neighhood Iterators Example
- itkNeighborhoodInnerProductltImageTypegt IP
- itkDerivativeOperatorltImageTypegt operator
- operator-gtSetOrder(1)
- operator-gtSetDirection(0)
- operator-gtCreateDirectional()
-
- itkNeighborhoodIteratorltImageTypegt
iterator(operator-gtGetRadius(), myImage,
myImage-gtGetRequestedRegion()) - iterator.SetToBegin()
- while ( ! iterator.IsAtEnd() )
-
- stdcout ltlt "Derivative at index " ltlt
iterator.GetIndex() ltlt is ltlt IP(iterator,
operator) ltlt stdendl - iterator
-
25Sample Code Fragment For Read/Write
- typedef itkImageltunsigned int, 3gt
ImageType - typedef itkImageFileReaderlt ImageType gt
FileSourceType - typedef itkPNGImageIO
PNGReaderType - typedef itkImageFileWriterlt ImageType gt
FileSinkType - typedef itkPNGImageIO
PNGWriterType - //read
- FileSourceTypePointer fileSource
FileSourceTypeNew() - fileSource-gtSetFileName( inputFileName )
- PNGReaderTypePointer pngReader
PNGReaderTypeNew() - pngReader-gtSetNumberOfDimensions( 3 )
- fileSource-gtSetImageIO( pngReader )
- //write
- FileSinkTypePointer fileSink
FileSinkTypeNew() - PNGWriterTypePointer pngWriter
PNGWriterTypeNew() - fileSink-gtSetImageIO( pngWriter )
- fileSink-gtSetFilePrefix( outputFileName )
- fileSink-gtSetInput( fileSource-gtGetOutput() )
- fileSink-gtUpdate( )
26Calling An Image Filter
include "itkImage.h" include "itkImageFileReader
.h" include "itkGradientMagnitudeImageFilter.h"
int main( int argc, char argv ) typedef
itkImageltunsigned short,2gt ImageType
typedef itkImageFileReaderltImageTypegt
ReaderType typedef itkGradientMagnitudeImageF
ilterlt ImageType,
ImageTypegt FilterType typedef
itkPNGImageIO PNGReaderType
PNGReaderTypePointer pngReader
PNGReaderTypeNew() ReaderTypePointer
reader ReaderTypeNew() FilterTypePointer
filter FilterTypeNew() reader-gtSetFileName(
argv1 ) reader-gtSetImageIO(
filter-gtSetInput( reader-gtGetOutput() )
filter-gtUpdate() return 0
27Get ITK
Depending your building options, you may need
other tools to do a complete build.
28Configure Compile ITK
- mkdir build
- cd build
- ccmake ../Insight
- Make
- See http//www.itk.org/HTML/BuildOptions.htm
- For More Building Options.
29Configure ITK
30(No Transcript)
31(No Transcript)
32Writing myProject.cxx
include "itkImage.h" include "itkImageFileReader
.h" include "itkGradientMagnitudeImageFilter.h"
int main( int argc, char argv ) typedef
itkImageltunsigned short,2gt ImageType
typedef itkImageFileReaderltImageTypegt
ReaderType typedef itkGradientMagnitudeImageF
ilterlt ImageType,ImageTypegt
FilterType typedef itkPNGImageIO
PNGReaderType
PNGReaderTypePointer pngReader
PNGReaderTypeNew() ReaderTypePointer
reader ReaderTypeNew() FilterTypePointer
filter FilterTypeNew()
reader-gtSetFileName( argv1 )
reader-gtSetImageIO( filter-gtSetInput(
reader-gtGetOutput() ) filter-gtUpdate()
return 0
33Meet Problems?
- Join the ITK users email list
- http//www.itk.org/HTML/MailingLists.htm
- Very Helpful!!!
34Reference
- www.itk.org
- Presentations of ITK Meetings
35