Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Medical Imaging ITK.

Slides:



Advertisements
Similar presentations
NA-MIC National Alliance for Medical Image Computing ITK Workshop October 5-8, 2005 Software Design.
Advertisements

ITK Architecture Kitware Inc.. ITK Basics C++ Generic Programming Data Pipeline Multi-threading Streaming Exceptions Events / Observers Tcl, Python and.
Getting Started with ITK + VTK
ITK-Overview Insight Software Consortium. What is ITK Image Processing Segmentation Registration No Graphical User Interface (GUI) No Visualization.
NA-MIC National Alliance for Medical Image Computing ITK Workshop October 5-8, 2005 Writing a New ITK Filter.
Methods in Image Analysis 2004, Damion Shelton 1 ITK Lecture 4 Images in ITK Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering.
Images in ITK JG, DS, HJ. Data storage in ITK 2 ITK separates storage of data from the actions you can perform on data The DataObject class is the base.
This work by John Galeotti and Damion Shelton, © , was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative.
This work by John Galeotti and Damion Shelton, © , was made possible in part by NIH NLM contract# HHSN P, and is licensed under a Creative.
1 ITK Lecture 7 - Writing Filters, Part 1 Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods.
Methods in Image Analysis 2004, Damion Shelton 1 ITK Lecture 6 - The Pipeline Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering.
National Alliance for Medical Image Computing ITK The Image Segmentation and Registration Toolkit Julien Jomier Kitware Inc.
Writing a Good Program 6. Pointers and Arrays
CSci 6971: Image Registration Lecture 6: Getting Started with ITK January 30, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
Rossella Lau Lecture 8, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 8: Polymorphism & C++ pointer  Inheritance.
Introduction to ITK Casey Goodlett (with help from others as listed in references)
1 ITK Lecture 4 Images in ITK Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image Analysis.
1 ITK Lecture 2 A brief C++ review Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
Review of C++ Programming Part II Sheng-Fang Huang.
OOP Languages: Java vs C++
CSC – Java Programming II Lecture 9 January 30, 2002.
Getting Started with ITK in Python Language
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Research Methods in Computer Science Lecture: Research.
Programming Languages and Paradigms Object-Oriented Programming.
GPU Acceleration in ITK v4
Image Registration Lecture 7: Getting Started with ITK March 15, 2005 Prof. Charlene Tsai.
Beyond the Visualization Pipeline Werner Benger 1, Marcel Ritter, Georg Ritter, Wolfram Schoor 1 Scientific Visualization Group Center for Computation.
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Data Structure: List.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Custom Templatized Data Structures.
CS352-Week 2. Topics Heap allocation References Pointers.
NA-MIC National Alliance for Medical Image Computing Slicer3 and the NA-MIC kit Sonia Pujol, Ph.D. Instructor of Radiology Surgical Planning.
How to Install ITK ? (Insight Segmentation and Registration Toolkit) Prepared by: Hussain Rahman MS (CS) 1 st semester Supervised.
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Data Structure: Introduction.
Programming Languages and Paradigms Object-Oriented Programming (Part II)
CSE 332: C++ Type Programming: Associated Types, Typedefs and Traits A General Look at Type Programming in C++ Associated types (the idea) –Let you associate.
Programming Languages and Paradigms Object-Oriented Programming.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
ITK Input/Output Kitware Inc.. Overview IO Factory Mechanism Image File IO Transform File IO SpatialObject File IO Logger.
Programming into Slicer3. Sonia Pujol, Ph.D., Harvard Medical School -1- National Alliance for Medical Image Computing Programming into Slicer3 Sonia Pujol,
1 ITK Lecture 8 - Neighborhoods Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
Pointers OVERVIEW.
ITK Introduction and Overview Spring Topics  What Is ITK History Features  Software Engineering Methodology.
C++ Programming Part 2 Michael Griffiths Corporate Information and Computing Services The University of Sheffield
Slicer3 for developers – S.Pujol -1- National Alliance for Medical Image Computing Slicer3 Course for developers Sonia Pujol, Ph.D. Surgical Planning Laboratory.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
Homework due Test the random number generator Create a 1D array of n ints Fill the array with random numbers between 0 and 100 Compute and report the average.
OOP using C Abstract data types How to accomplish the task??? Requirements Details Input, output, process Specify each task in terms of input.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
1 ITK Lecture 6 - The Pipeline Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image Analysis.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
1 ITK Lecture 5 Intro to Iterators Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring Term, 2006 Methods in Image.
ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic.
Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader.
Distortion Correction ECE 6276 Project Review Team 5: Basit Memon Foti Kacani Jason Haedt Jin Joo Lee Peter Karasev.
Object-Oriented Programming (OOP) and C++
Advanced Programming Constants, Declarations, and Definitions Derived Data Types.
ITK Statistical Classification Kitware Inc.. Statistical Classification Multiple Components Images K-Means Markov Random Fields.
National Alliance for Medical Image Computing Slicer3 Plugins Common architecture for interactive and batch processing.
NA-MIC National Alliance for Medical Image Computing Three ways to use the NA-MIC kit Sonia Pujol, Ph.D. Instructor of Radiology Surgical.
Insight Toolkit Introduction Luis Ibáñez William Schroeder Insight Software Consortium.
Eine By: Avinash Reddy 09/29/2016.
CMPE Data Structures and Algorithms in C++ September 14 Class Meeting
ITK-Overview Insight Software Consortium.
ITK Architecture Kitware Inc..
Lecture 16 Images in ITK Methods in Medical Image Analysis - Spring (CMU ECE) : (CMU BME) : BioE 2630 (Pitt) Dr. John Galeotti Based.
Lecture 19 ITK’s Path Framework
ITK Workshop Software Design October 5-8, 2005.
CS410 – Software Engineering Lecture #5: C++ Basics III
Presentation transcript:

Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Medical Imaging ITK

Credit Some of the slides are taken from the presenation of Jean-Loïc Rose Other contributers are cited at the end. University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 2

Installing ITK  Download InsightTookit zip from  Download CMake installer from  Install CMake  Unzip InsightToolkit to folder  Run CMake set PATH\InsightToolkit as source code folder  Set PATH\InsightToolkit bin as where to build binaries  Disable BUILD_EXAMPLES and BUILD_TESTING  Click Configure button University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 3

Installing ITK (part 2)  Open ITK.dsw in binary build directory  Select Active Configuration to ALL_BUILD – Win32 RelWithDebInfo  Click Build  Wait minutes University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 4

Build Sample Program  Unzip itkdemo.zip to some folder  Run CMake same as for ITK  For ITK_DIR set binary directory  Open itkdemp.dsw in Visual Studio  Itkdemo.exe University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 5

Contents  What is ITK  Background  Concepts  Data representations  Images and regions  Pixel access in ITK  Developer’s guide  Access pixel data  How to write a filter University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 6

ITK Basics  Image Processing and Analysis Toolkit  No visualization (VTK recommended)  Does not include GUI framework  Designed for Medical Imaging Applications  In general algorithms work in N-dimensions University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 7

Catalog of ITK Features  Image IO  Image processing  Canny Edge  Hough Transform (lines/ellipsoids)  Variable Conductance Diffusion  Geometry IO/representation/processing (Spatial Objects)  Statistics  Registration/Segmentation  Numerics  Optimizers  Finite Element Simulation University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 8

How code using ITK is written  Mostly in C++  Heavily templated/generic programming like STL  Multi-threading capable  Pipeline architecture 1.Build Pipeline 2.Execute pipeline  CMake used as build system Reader Image File Gaussian Image Writer File University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 9

   Follow the link Alphabetical List  Follow the link Groups  Post to the insight-users mailing list How to find what you need ? University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 10

How to integrate ITK ITK Image Processing C++ Glue code Visualization OpenGL, VTK GUI MFC, QT, BBTK, wxWin University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 11

Concepts  Data Pipeline  Smart Pointers  C++ Generic Programming (Templates) University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 12

Concepts (I) Pipeline architecture Image Filter Image Filter  Data pipeline Image University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 13

Concepts (I) Pipeline architecture  Pipeline architecture 1.Build Pipeline 2.Execute pipeline Reader Image File Gaussian Image Writer File University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 14

Concepts (II) An aside: Smart pointer  In C++ you typically allocate memory with new and desallocate it with delete  Smart pointers get around this problem by allocating and deallocating memory for you  You do not explicitly delete objects in ITK, this occurs automatically when they go out of scope  Since you can’t forget to delete objects, you can’t leak memory memory leak Cat* pCat = new Cat; pCat->Meaow(); delete pCat; University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 15

… … … … … … … … … … Concepts (III) C++ generic programming  Generic programming is a method of organizing libraries consisting of generic—or reusable—  Abstraction of Types and Behaviors Example: STL Standard Template Library std::vector … … … … … … … … … … … … … … … … … … … … University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 16

Concepts (III) C++ generic programming Template ? Pixel type (char, int, …) Dimension (2D, 3D, …) University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 17

Contents  What is ITK  Background  Concepts  Data representations  Images and regions  Pixel access in ITK  Developer’s guide  Access pixel data  How to write a filter ITK Features Data representations Filtering Applications University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 18

Data storage in ITK  ITK separates storage of data from the actions you can perform on data  The DataObject class is the base class for the major “containers” into which you can place data  Images: N-d rectilinear grids of regularly sampled data  Meshes: N-d collections of points linked together into cells (e.g. triangles) University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 19

Class hierarchy itk::DataObject itk::Object itk::ImageBase itk::Image itk::PointSet itk::Mesh University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 20

Images and regions  ITK was designed to allow analysis of very large images, even images that far exceed the available RAM of a computer  For this reason, ITK distinguishes between an entire image and the part which is actually resident in memory or requested by an algorithm University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 21

Images and regions Algorithms only process a region of an image that sits inside the current buffer  The BufferedRegion is the portion of image in physical memory  The RequestedRegion is the portion of image to be processed  The LargestPossibleRegion describes the entire dataset LargestPossibleRegion::Index BufferedRegion::Index RequestedRegion::Index RequestedRegion::Size BufferedRegion::Size LargestPossibleRegion::Size University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 22

Images are templated  Image ITK  Example Pixel type Dimensionality (value) Unsigned char, 2 itk::Image itk::Image, 2 > University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 23

Images and regions  The favorite keyword  Declaring an image type  We can now use ImageType in place of the full class name, a nice convenience  Remember that names ending in “Type” are types, not variables or class names typedef itk::Image ImageType; typedef University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 24

Images and regions  Creating an image pointer  An image is created by invoking the New() operator from the corresponding image type and assigning the result to a SmartPointer. Pointer is typedef in itk::Image Macro “big New” typedef itk::Image ImageType; ImageType::Pointer image = ImageType::New(); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 25

Images and regions  Creating an image  Classes can have typedefs as members. In this case, SizeType is a public member of itk::Image. typedef itk::Image ImageType; ImageType::Pointer image = ImageType::New(); ImageType::SizeType size; size[0] = 512; // x direction size[1] = 512; // y direction ImageType::IndexType start; start[0] = 0; // x direction start[1] = 0; // y direction University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 26

 Creating the region of an image Images and regions typedef itk::Image ImageType; ImageType::Pointer image = ImageType::New(); ImageType::SizeType size = {{512,512}}; ImageType::IndexType start = {{0,0}}; // Initialize region parameter ImageType::RegionType region; region.SetSize( size ); region.SetIndex( start ); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 27

typedef itk::Image ImageType; ImageType::Pointer image = ImageType::New(); ImageType::SizeType size = {{512,512}}; ImageType::IndexType start = {{0,0}}; // Initialize region parameter ImageType::RegionType region; region.SetSize( size ); region.SetIndex( start ); // Allocate image image->SetRegions( region ); image->Allocate( ); image->FillBuffer( 0 ); Images and regions  Allocate The SetRegions function sets all 3 regions to the same region and Allocate sets aside memory for the image. University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 28

Image features Data space vs. “physical” space Image IO University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 29

Data space vs. “physical” space  Data space is an N-d array with integer indices, indexed from 0 to (L i - 1)  e.g. pixel (3,0,5) in 3D space  Physical space relates to data space by defining the origin and spacing of the image University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 30

Data space vs. “physical” space  Spacing: We can specify spacing by calling the SetSpacing() function in Image.  Origin: Similarly, we can set the image origin ImageType::SpacingType spacing; spacing[0] = 0.83; // x direction spacing[1] = 2.15; // y direction Image->SetSpacing( spacing ); ImageType::IndexType origin; origin[0] = 0.83; // x direction origin[1] = 2.15; // y direction Image->SetIndex( origin ); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 31

Data space vs. “physical” space  The image class contains a number of convenience methods to convert between pixel indices and physical positions (as stored in the Point class) typedef itk::Image ImageType; ImageType::PointType point; // Physical space ImageType::PixelType pixelIndex; // Data space image->TransformPhysicalPointToIndex( point, pixelIndex ); image->TransformIndexToPhysicalPoint( pixelIndex, point ); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 32

ITK Image IO CustomImageIO Image File ImageFileReader Image PNGImageIO VTKImageIODICOMImageIOGIPLImageIO MetaImageIOAnalyzeImageIO Loadable Factories University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 33

ITK Image IO Image File ImageFileReader Image Filter Image File ImageFileWriter Image University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 34

ITK Image IO #include “itkImageFileReader.h” #include “itkImageFileWriter.h” int main() { typedef itk::Image ImageType; typedef itk::ImageFileReader ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFilename( inputFilename ); reader->Update( ); // reader->Update( ); typedef itk::ImageFileWiter WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput( reader->GetOutput( ) ); writer->SetFilename( outputFilename ); writer->Update( ); } University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 35

Image typedef  Classes can have typedefs as members. typedef itk::Image ImageType; ImageType::Pointer // Image pointer ImageType::SizeType // Size of image ImageType::IndexType // Index of pixels ImageType::PixelType // Type of pixels ImageType::RegionType // region of pixels ImageType::… University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 36

Contents  What is ITK  Background  Concepts  Data representations  Images and regions  Pixel access in ITK  Developer’s guide  Access pixel data  How to write a filter ITK Features Data representations Filtering Applications University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 37

Pixel access in ITK There are many ways to access pixels in ITK Direct pixel access Iterators - Index in data space - Physical position, in physical space University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 38

Direct pixel access in ITK  The simplest way is to directly address a pixel by knowing either its: The Index object is used to access pixels in an image, in data space ImageType::IndexType pixelIndex; pixelIndex[0] = 27; // x direction pixelIndex[1] = 29; // y direction // To set a pixel ImageType::PixelType pixelValue = 149; Image->SetPixel( pixelIndex, pixelValue ); // To get a pixel ImageType::PixelType pixelValue; pixelValue = Image->GetPixel( pixelIndex ); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 39

Pixel access in ITK with iterators  An iterator is described as walking its iteration region.  There is no restriction on the dimensionality of the image or on the pixel type of the image. University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 40

Pixel access in ITK with iterators  Moving iterators  Accessing data - GoToBegin() - GoToEnd() - operator++() - operator--() - bool IsAtEnd() - bool IsAtBegin() - IndexType GetIndex() - … - PixelType Get() - void Set( PixelType ) University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 41

Pixel access in ITK with iterators  Iteration loops example (1D, 2D, 3D, 4D…)  Example on a volume (500x500x500)  Direct pixel access: s.  Pixel access with iterators:4.48 s. typedef itk::ImageRegionIterator IteratorType; IteratorType it( image, image->GetRequestedRegion() ); for( it.GoToBegin(); !it.IsAtEnd(); it++ ) { std::cout << “Index : ” << it.GetIndex() << std::endl; std::cout << “Value : ” << it.Get() << std::endl; } University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 42

Pixel access in ITK with iterators  Classic image iterators  ImageRegionIterator (basic ITK image iterator)  ImageRegionIteratorWithIndex  Line-by-line iterators  ImageLinearIteratorWithIndex (NextLine(), …)  ImageSliceIteratorWithIndex (NextSlice(), …)  Random iterators  ImageRandomConstIteratorWithIndex  Neighborhood iterator  NeighborhoodIterator University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 43

Pixel access in ITK with iterators  Neighborhood iterator University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 44

Class hierarchy itk::DataObject itk::Object itk::ImageBase itk::Image itk::ProcessObject itk::ImageSource itk::ImageToImageFilter University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 45

Filter typical element Input Image Output Image Filter Parameters typedef itk::ImageToImageFilter FilterType; University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 46

Inplace filter element Input Image Output Image Filter Parameters typedef itk::InPlaceImageFilter FilterType; The output bulk data is the same block of memory as the input bulk data. University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 47

Create an Image Filter namespace itk { template class MyImageFilter : public ImageToImageFilter { public: typedef MyImageFilter Self; typedef ImageToImageFilter Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; itkNewMacro( Self ); itkTypeMacro( MyImageFilter, ImageToImageFilter ); University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 48

Create an Image Filter protected: MyImageFilter() {} virtual ~MyImageFilter() {} virtual void GenerateData() {};// The real work private: MyImageFilter( const Self & ); // purposely not implemented void operator=( const Self & ); // purposely not implemented }; // end of class } // end of namespace itk University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 49

Typical Declarations: Traits and Macros  Traits  Self  Superclass  Pointer  ConstPointer  Macros  NewMacro  TypeMacro University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 50

Create an Image Filter #include “MyImageFilter.h” int main() { typedef itk::Image InputImageType; typedef itk::Image OutputImageType; typedef itk::MyImageFilter< InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New(); Filter->SetInput( reader->GetOuput() ); Filter->Update( ); OutputImageType::Pointer image = Filter->GetOutput( ); } University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 51

References    University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 52

References   ITK CVS Online documentation  ITK 2.0 (preliminary) Software Guide pdf?download   Neurolib tutorial (excellent for research use of ITK) University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 53

The End University Of Malakand | Department of Computer Science | Visual Computing Research Group | Dr. Engr.Sami ur Rahman | 54