ITK Introduction and Overview Spring 2006. Topics  What Is ITK History Features  Software Engineering Methodology.

Slides:



Advertisements
Similar presentations
Building Open Science Communities
Advertisements

ITK Architecture Kitware Inc.. ITK Basics C++ Generic Programming Data Pipeline Multi-threading Streaming Exceptions Events / Observers Tcl, Python and.
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 National Alliance for Medical Image Computing: NAMIC Ron Kikinis, M.D.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
Medical Image Registration Kumar Rajamani. Registration Spatial transform that maps points from one image to corresponding points in another image.
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.
National Alliance for Medical Image Computing ITK The Image Segmentation and Registration Toolkit Julien Jomier Kitware Inc.
National Alliance for Medical Image Computing Salt Lake City AHM February, No Respect Danny, Be the Ball.
UI Standards & Tools Khushroo Shaikh.
CSci 6971: Image Registration Lecture 6: Getting Started with ITK January 30, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 4: First Examples January 23, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
1 Chapter 7 IT Infrastructures Business-Driven Technology
CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
A Big Thanks Prof. Jason Bohland Quantitative Neuroscience Laboratory Boston University Dr. Luis Ibanez Open Source Proponent,
National Alliance for Medical Image Computing Registration in Slicer3 Julien Jomier Kitware Inc.
Software Process, CMake, Dashboards, CPack Bill Hoffman Kitware, Inc.
Software Process for Distributed Teams KITWARE, Inc.
Introduction to High-Level Language Programming
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering End-user Platform Steve Pieper Isomics, Inc.
NA-MIC National Alliance for Medical Image Computing IGT Software Design and Process Bill Lorensen GE Research.
William Lorensen GE Research Niskayuna, NY February 12, 2001 Insight Segmentation and Registration Toolkit.
Getting Started with ITK in Python Language
NA-MIC National Alliance for Medical Image Computing NAMIC-Kit Update Will Schroeder Jim Miller Bill Lorensen.
GPU Acceleration in ITK v4
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Medical Imaging ITK.
Image Registration Lecture 7: Getting Started with ITK March 15, 2005 Prof. Charlene Tsai.
Framework for Automated Builds Natalia Ratnikova CHEP’03.
NA-MIC National Alliance for Medical Image Computing The NA-MIC Kit National Alliance for Medical Image Computing.
CPIS 357 Software Quality & Testing
NA-MIC National Alliance for Medical Image Computing NA-MIC Software Engineering Bill Lorensen GE Research NA-MIC Engineering Core PI.
NA-MIC National Alliance for Medical Image Computing Why NITRC Matters to NA-MIC Steve Pieper, PhD.
NA-MIC National Alliance for Medical Image Computing Slicer3 and the NA-MIC kit Sonia Pujol, Ph.D. Instructor of Radiology Surgical Planning.
ITK The Insight Segmentation & Registration Toolkit Martin Urschler Institute for Computer Graphics and Vision Graz University of Technology.
Software Toolkits Building Communities Luis Ibáñez KITWARE, Inc.
EGEE is a project funded by the European Union under contract IST Testing processes Leanne Guy Testing activity manager JRA1 All hands meeting,
Community Software Engineering Practices and Principles A Case Study of the Open Source Insight Toolkit (ITK) Terry Yoo (National Library of Medicine),
NA-MIC National Alliance for Medical Image Computing NA-MIC Core 2 Update: Kitware Will Schroeder Kitware NA-MIC Core 2 PI NA-MIC Core.
7-1 Management Information Systems for the Information Age Copyright 2004 The McGraw-Hill Companies, Inc. All rights reserved Chapter 7 IT Infrastructures.
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,
William Schroeder, Ph.D. §, Andy Cedilnik §, Sebastien Barré, Ph.D. §, William Lorensen ‡, James Miller, Ph.D. ‡, Daniel Blezek, Ph.D. ‡ § Kitware Inc.,
Developing software and hardware in parallel Vladimir Rubanov ISP RAS.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Software Process Stephen R. Aylward Kitware, Inc.
Open Source Software in Image Guided Surgery and New Age of Publishing Luis Ibáñez KITWARE, Inc.
WRITING REPORTS Introduction Section 0 Lecture 1 Slide 1 Lecture 6 Slide 1 INTRODUCTION TO Modern Physics PHYX 2710 Fall 2004 Intermediate 3870 Fall 2015.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
NA-MIC National Alliance for Medical Image Computing The NA-MIC Kit: ITK, VTK, Pipelines, Grids and 3D Slicer as An Open Platform for.
Slicer3 for developers – S.Pujol -1- National Alliance for Medical Image Computing Slicer3 Course for developers Sonia Pujol, Ph.D. Surgical Planning Laboratory.
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Computational Platform Jim Miller GE Research.
ITK Basic Filters Kitware Inc.. ITK Basic Filters Pixel-wise Arithmetic, Casting, Thresholding Mathematical morphology Noise reduction Gaussian, Anisotropic.
Lecture 21: Component-Based Software Engineering
Read a DICOM File typedef unsigned charInputPixelType; const unsigned intInputDimension = 2; typedef itk::Image InputImageType; typedef itk::ImageFileReader.
Advisor : Ku-Yaw Chang Speaker : Ren-Li Shen /6/12.
Anders Nielsen Technical University of Denmark, DTU-Aqua Mark Maunder Inter-American Tropical Tuna Commission An Introduction.
ITK Statistical Classification Kitware Inc.. Statistical Classification Multiple Components Images K-Means Markov Random Fields.
NA-MIC National Alliance for Medical Image Computing Three ways to use the NA-MIC kit Sonia Pujol, Ph.D. Instructor of Radiology Surgical.
NA-MIC National Alliance for Medical Image Computing NAMIC Software Process Dan Blezek Jim Miller Bill Lorensen.
The Insight Toolkit Case Study Dr. Luis Ibanez, Kitware /
Insight Toolkit Introduction Luis Ibáñez William Schroeder Insight Software Consortium.
NA-MIC All Hands Meeting - 1/9/2006
ITK Segmentation Methods
Core 2 Progress Day 1 Salt Lake City
National Library of Medicine Segmentation and Registration Toolkit
ITK-Overview Insight Software Consortium.
NAMIC Software Development Workshop
ITK Architecture Kitware Inc..
What's New in eCognition 9
What's New in eCognition 9
What's New in eCognition 9
Presentation transcript:

ITK Introduction and Overview Spring 2006

Topics  What Is ITK History Features  Software Engineering Methodology

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

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

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

Mr. ITK  Many of the following ITK slides were developed by Luis Ibanez of Kitware  Once you see Luis’ role in ITK, you’ll know that the following is more than appropriate Image courtesy Kitware, Inc.

Scope of ITK Image Processing Segmentation Registration No Graphical User Interface (GUI) No Visualization

ITK Sponsors The National Science Foundation The National Institute for Dental and Craniofacial Research The National Institute of Neurological Disorders and Stroke

ITK Developers

* indicates a subcontractor.

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

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

ITK by the Numbers 1032 – # of users subscribed to the mailing-list 400 – # of s 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)

Example ITK Program #include "itkImage.h" #include "itkImageFileReader.h" #include "itkGradientMagnitudeImageFilter.h" int main( int argc, char **argv ) { typedef itk::Image ImageType; typedef itk::ImageFileReader ReaderType; typedef itk::GradientMagnitudeImageFilter< ImageType,ImageType> FilterType; ReaderType::Pointer reader = ReaderType::New(); FilterType::Pointer filter = FilterType::New(); reader->SetFileName( argv[1] ); filter->SetInput( reader->GetOutput() ); filter->Update(); return 0; }

Documentation Resources Follow the link Alphabetical List Follow the link Groups Post to the insight-users mailing list

The ITK Software Guide is freely available as a PDF document at ItkSoftwareGuide.pdf Its paper version can be ordered from Amazon.com and from Kitware’s e-store.

Useful Code in ITK  Coding Infrastructure  I/O  Numerics Based on VNL (Vision Numerics Library)  Image Processing Convolutions, Non-Linear, Anisotropic…  Segmentation  Registration

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

Generic Programming Example: STL Standard Template Library Abstraction of Types and Behaviors std::vector

itk::Image itk::Image, 2 >

namespaces Avoid naming collisions itk:: itk::Statistics:: itk::fem:: itk::fem::itpack itk::bio

Your favorite keyword typedef typedef itk::Image ImageType typedef itk::ImageFilter FilterType otherwise... itk::ImageFilter, Image > FilterType

Smart Pointers Object Smart Pointer counter=0counter=1counter=2counter=3 Self - Delete

SmartPointers typedef itk::Image ImageType typedef itk::ImageFilter FilterType FilterType::Pointer filter = FilterType::New(); ImageType::Pointer image = filter->GetOutput(); NO NEED FOR filter->Delete(); Pointer notation filter->Update();

Const Correctness Knowing constancy is Insight. Not knowing constancy leads to disaster. Tao Te Ching, XVI. Lao Tsu

Const Smart Pointers typedef itk::Image ImageType typedef itk::ImageFilter FilterType FilterType::Pointer filter = FilterType::New(); ImageType::ConstPointer image = filter->GetOutput(); Can only invoke “const” methods image->GetSpacing (); Compiler error for “non-const” methods image->SetSpacing ( spacing );

Creating an Image typedef itk::Image ImageType ImageType::Pointer image = ImageType::New(); ImageType::SizeType size; size[ 0 ] = 512;// x direction size[ 1 ] = 512;// y direction size[ 2 ] = 50;// z direction ImageType::IndexType start; start[ 0 ] = 0; // x direction start[ 1 ] = 0; // y direction start[ 2 ] = 0; // z direction

Creating an Image ImageType::RegionType region; region.SetSize( size ); region.SetIndex( start ); image->SetRegions( region ); image->Allocate(); image->FillBuffer( 0 ); ImageType::SpacingType spacing; spacing[ 0 ] = 0.83; // x direction spacing[ 1 ] = 0.83; // y direction spacing[ 2 ] = 2.15; // z direction image->SetSpacing( spacing );

Output Image Streaming Filter Processing Large Images Input Image

Image Regions LargestPossibleRegion BufferedRegion RequestedRegion

Data Pipeline Image Filter Image Filter Image Filter

Simple Image IO Image File ImageFileReader Image Filter Image File ImageFileWriter

CustomImageIO Simple Image IO Image File ImageFileReader Image PNGImageIO VTKImageIODICOMImageIOGIPLImageIO MetaImageIOAnalyzeImageIO Loadable Factories

#include “itkImage.h” #include “itkImageFileReader.h” #include “itkImageFileWriter.h” typedef itk::Image ImageType; typedef itk::ImageFileReader ReaderType; typedef itk::ImageFileWriter WriterType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( “inputImage.dcm” ); // DICOM writer->SetFileName( “outputImage.hdr” ); // Analyze writer->SetInput( reader->GetOutput() ); writer->Update(); Simple Image IO

Segmentation Overview Region Growing – ConfidenceConnected – ConnectedThreshold – IsolatedConnected Watersheds Level Sets – FastMarching – ShapeDetection – GeodesicActiveContours – ThresholdSegmentation – CannySegmentationLevelSet

Example: Confidence Connected Seed Point + Radius Intensity Mean Lower bound Upper bound X Multiplier Standard Deviation

/** /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 * (as opposed to using the pixels in the neighborhood of the seed * point). The segmentation is then recalculted using these refined * estimates for the mean and variance of the pixel values. This * process is repeated for the specified number of iterations. * Setting the "NumberOfIterations" to zero stops the algorithm * after the initial segmentation from the seed point. * */

typedef itk::Image ImageType; typedef itk::ConfidenceConnectedImageFilter FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetMultiplier( 1.5 ); filter->SetNumberOfIterations( 5 ); filter->SetInitialNeighborhoodRadius ( 2 ); filter->SetReplaceValue( 255 ); FilterType::IndexType index; index[0] = 123; index[1] = 235; filter->SetSeed( index ); filter->SetInput( reader->GetOutput() ); writer->SetInput( filter->GetOutput() ); writer->Update() Confidence Connected

Registration Overview Image Resampling Registration Framework Multi-Modality Multi-Resolution Deformable registration

Components Fixed Image Moving Image Metric Transform Interpolator Optimizer Registration Method

Image Metrics Mean Squares Normalized Correlation Mean Reciprocal Square Difference Mutual Information - Viola-Wells - Mattes - Histogram based - Histogram normalized

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

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

Interpolators Nearest Neighbor Linear BSpline

ITK Software Methodology  Based on “Best Practices” for Distributed Development  Built on Open Source Tools  Adopted by NA-MIC

NA-MIC National Alliance for Medical Image Computing NAMIC Software Process Dan Blezek Jim Miller Bill Lorensen

National Alliance for Medical Image Computing Extreme Programming

National Alliance for Medical Image Computing 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

National Alliance for Medical Image Computing Software Process Design Process Coding Standards Testing Bug Tracker Communication –Mailing lists, Discussion forum, Wiki –Tcons Documentation Releases

National Alliance for Medical Image Computing 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

National Alliance for Medical Image Computing Coding Standards Follow the package’s rules ITK has certain coding standards –Style guidelines –Naming conventions –Macros

National Alliance for Medical Image Computing Testing If it isn’t tested, it’s broken. Tests –Ensure your code works –Documents expected results –Others free to change

National Alliance for Medical Image Computing Bug Tracker Bugs assigned / taken by developers Tracks progress to releases Captures feature requests Communication mechanism

National Alliance for Medical Image Computing Documentation Doxygen –Automatic API documentation –Algorithm references –Implementation details Books / Manuals –Insight Book

National Alliance for Medical Image Computing Communication lists Discussion forum Wiki Tcon

National Alliance for Medical Image Computing Extreme Programming Compression of standard analyze, design, implement, test cycle into a continuous process

National Alliance for Medical Image Computing 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 if they “Break the Build”

National Alliance for Medical Image Computing Daily rhythm Design, implement algorithm write regression test check it in Dart takes over Code is updated, built, tested Guilty parties are blamed Debug/Fix Build breakers are notified Work on cleaning up dashboard Repeat

National Alliance for Medical Image Computing Dart Testing Reports Dashboards Central site for state of the system –Updates –Builds –Test –Coverage

National Alliance for Medical Image Computing

Someone broke the build!

National Alliance for Medical Image Computing

The Big Bat of Quality

National Alliance for Medical Image Computing Bill “Yogi” Lorensen

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