ITK Architecture - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

ITK Architecture

Description:

ITK Architecture Kitware Inc. ITK Basics C++ Generic Programming Data Pipeline Multi-threading Streaming Exceptions Events / Observers Tcl, Python and Java wrapping ... – PowerPoint PPT presentation

Number of Views:146
Avg rating:3.0/5.0
Slides: 30
Provided by: wikiNami
Category:
Tags: itk | architecture

less

Transcript and Presenter's Notes

Title: ITK Architecture


1
ITKArchitecture
Kitware Inc.
2
ITK Basics
  • C Generic Programming
  • Data Pipeline
  • Multi-threading
  • Streaming
  • Exceptions
  • Events / Observers
  • Tcl, Python and Java wrapping

3
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
4
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
5
namespaces
Avoid naming collisions
itk itkStatistics itkfem itkfemitpac
k itkbio
6
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
7
Smart Pointers
Object
counter0
counter1
counter2
counter3
Self - Delete
8
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()
9
Const Correctness
Knowing constancy is Insight. Not knowing
constancy leads to disaster.
Tao Te Ching, XVI. Lao Tsu
10
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 )
11
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
12
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 )
13
Exercise 3
14
Streaming
Processing Large Images
Output Image
Input Image
Filter
15
Image Regions
16
Data Pipeline
17
Simple Image IO
18
Simple Image IO
Loadable Factories
19
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()
20
Exceptions
Error Management
Application Layer
ITK Layer
21
Exceptions
try filter-gtUpdate()
catch( itkExceptionObject exp )
stdcerr ltlt exp ltlt stdendl
22
Exercise 4
23
Events and Observers
ItkObject
24
Events and Observers
Common Events AnyEvent() StartEvent() EndEvent
() ProgressEvent() IterationEvent()
25
Events and Observers
Execute()
26
Events and Observers
27
Exercise 5
ProgressEvent()
StartEvent()
EndEvent()
Execute()
28
GUI Communication
GUI Layer
ITK Layer
29
Enjoy ITK !
Write a Comment
User Comments (0)
About PowerShow.com