CSci 6971: Image Registration Lecture 6: Getting Started with ITK January 30, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,

Slides:



Advertisements
Similar presentations
Building Open Science Communities
Advertisements

Doxygen. Links
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.
Slicer3 for developers – Sonia Pujol, Ph.D. -1- National Alliance for Medical Image Computing Programming into Slicer3 Sonia Pujol, Ph.D. Surgical Planning.
Programming into Slicer3. Sonia Pujol, Ph.D., Harvard Medical School National Alliance for Medical Image Computing ©2010,ARR
NA-MIC National Alliance for Medical Image Computing National Alliance for Medical Image Computing: NAMIC Ron Kikinis, M.D.
CPSC 441 TUTORIAL – JANUARY 16, 2012 TA: MARYAM ELAHI INTRODUCTION TO C.
1 Welcome to the Insight Toolkit! ITK Lecture 1 - Getting Started Methods in Image Analysis CMU Robotics Institute U. Pitt Bioengineering 2630 Spring.
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.
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
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 Commons.
National Alliance for Medical Image Computing ITK The Image Segmentation and Registration Toolkit Julien Jomier Kitware Inc.
National Alliance for Medical Image Computing User Desktop Slicer 3.0 Architecure AlgorithmsITKVTK Slicer Modules VTK Apps Using ITK.
CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
Introduction to ITK Casey Goodlett (with help from others as listed in references)
NA-MIC National Alliance for Medical Image Computing Slicer Custom Modules Steve Pieper, PhD.
Software Process, CMake, Dashboards, CPack Bill Hoffman Kitware, Inc.
Software Process for Distributed Teams KITWARE, Inc.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
NA-MIC National Alliance for Medical Image Computing IGT Software Design and Process Bill Lorensen GE Research.
Getting Started with ITK in Python Language
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.
1 INF160 IS Development Environments AUBG, COS dept Lecture 06 Title: Dev Env: Code::Blocks (Extract from Syllabus) Reference:
NA-MIC National Alliance for Medical Image Computing NA-MIC Software Engineering Bill Lorensen GE Research NA-MIC Engineering Core PI.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
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.
FLTK Tutorial.
Software Toolkits Building Communities Luis Ibáñez KITWARE, Inc.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Community Software Engineering Practices and Principles A Case Study of the Open Source Insight Toolkit (ITK) Terry Yoo (National Library of Medicine),
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,
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
Image Registration Lecture 11: VXL March 29, 2005 Prof. Charlene Tsai.
SimITK and SimVTK: ITK and VTK in Simulink DG Gobbi, P Mousavi, KM Li, J Xiang, A Campigotto, A LaPointe, G Fichtinger, P Abolmaesumi Medical Image Analysis.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
William Schroeder, Ph.D. §, Andy Cedilnik §, Sebastien Barré, Ph.D. §, William Lorensen ‡, James Miller, Ph.D. ‡, Daniel Blezek, Ph.D. ‡ § Kitware Inc.,
NA-MIC National Alliance for Medical Image Computing Core 1b – Engineering Software Process Stephen R. Aylward Kitware, Inc.
ITK Introduction and Overview Spring Topics  What Is ITK History Features  Software Engineering Methodology.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Copyright © 2008 Siemens Corporate Research – All rights reserved1/12 eXtensible Imaging Platform (Xip) Sylvain Jaume – Sep 2008 Siemens Corporate Research.
GUI With GTK+ Under Linux Fanfan Xiong. Introduction GTK+ (GIMP toolkit) : A library for creating graphical user interfaces(GUI) Two examples developed.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Slicer3 for developers – S.Pujol -1- National Alliance for Medical Image Computing Slicer3 Course for developers Sonia Pujol, Ph.D. Surgical Planning Laboratory.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
C++ / G4MICE Course Session 1 - Introduction Edit text files in a UNIX environment. Use the g++ compiler to compile a single C++ file. Understand the C++
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
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.
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.
SimTK 1.0 Workshop Downloads Jack Middleton March 20, 2008.
The Insight Toolkit Case Study Dr. Luis Ibanez, Kitware /
Insight Toolkit Introduction Luis Ibáñez William Schroeder Insight Software Consortium.
Lecture 4 Getting Started with ITK!
National Library of Medicine Segmentation and Registration Toolkit
ITK-Overview Insight Software Consortium.
ITK Architecture Kitware Inc..
ITK Workshop Software Design October 5-8, 2005.
Lecture 4 Getting Started with ITK!
Makefile Assignment Create a file called f1.cpp. It should contain the following function: int squareIt ( int x ) { //insert code to calc and return the.
SPL – PS1 Introduction to C++.
Presentation transcript:

CSci 6971: Image Registration Lecture 6: Getting Started with ITK January 30, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware

Image RegistrationLecture 6 2 Overview of Course Software  Insight Toolkit (ITK)  NLM funded project to develop open-source medical image processing, segmentation and registration libraries  Consortium of 3 companies and 3 universities with 6 more universities as subcontractors  VXL (Vision X Libraries), where X is a place-holder for names such as “image”, “numerics”  Developed as volunteer effort by computer vision researchers at GE and several universities  Insight Toolkit (ITK)  NLM funded project to develop open-source medical image processing, segmentation and registration libraries  Consortium of 3 companies and 3 universities with 6 more universities as subcontractors  VXL (Vision X Libraries), where X is a place-holder for names such as “image”, “numerics”  Developed as volunteer effort by computer vision researchers at GE and several universities

Image RegistrationLecture 6 3 CenSSIS Registration Tool Suite  Exploit ITK  3D representations, processing algorithms, etc.  Intensity-based registration  Extensive examples and documentation  CenSSIS development currently using VXL  Significant, novel feature-based algorithms developed using VXL  Base library for robust estimation and other feature-based representations  Working together  Some shared libraries already exist (numerics)  Code can be compiled and linked, so that objects and functions from ITK and VXL can work together.  BUT, do need to learn parts of two libraries  Exploit ITK  3D representations, processing algorithms, etc.  Intensity-based registration  Extensive examples and documentation  CenSSIS development currently using VXL  Significant, novel feature-based algorithms developed using VXL  Base library for robust estimation and other feature-based representations  Working together  Some shared libraries already exist (numerics)  Code can be compiled and linked, so that objects and functions from ITK and VXL can work together.  BUT, do need to learn parts of two libraries

Image RegistrationLecture 6 4 Moving Forward In This Course  CD distributed  ITK, Cmake, VXL  Does not yet contain the feature-based registration library  Lectures 6-10  ITK and intensity-based registration  Lectures  Rensselaer registration library will be delivered and used for feature-based registration  HW exercises will explore both toolkits  Either can be used for large programming project  Choice should be individual and depend on the chosen project.  CD distributed  ITK, Cmake, VXL  Does not yet contain the feature-based registration library  Lectures 6-10  ITK and intensity-based registration  Lectures  Rensselaer registration library will be delivered and used for feature-based registration  HW exercises will explore both toolkits  Either can be used for large programming project  Choice should be individual and depend on the chosen project.

Image RegistrationLecture 6 5 The Insight Toolkit The Segmentation and Registration Toolkit

Image RegistrationLecture 6 6 What is ITK ?  Image Processing  Segmentation  Registration  No Graphical User Interface (GUI)  No Visualization

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

Image RegistrationLecture 6 8 ITK Developers

Image RegistrationLecture 6 9 ITK Developers * indicates a subcontractor.

Image RegistrationLecture 6 10 ITK by the Numbers  March 2000  First code check-in  1000  # of nightly builds  718  tests run nightly  21  # of platforms ( software + hardware )  700  # of classes  1600  # of files with code

Image RegistrationLecture 6 11 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  160  weekly t-cons  50  unique developers

Image RegistrationLecture 6 12 ITK by the Numbers  500  # of users subscribed to the mailing-list  300  # of s posted monthly to the users-list  565  # 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)

Image RegistrationLecture 6 13 The Insight Toolkit Starting with ITK

Image RegistrationLecture 6 14 Integrating ITK in your application C++ Glue Code ITK Image Processing GUI {MFC,Qt, wxWin FLTK} Visualization {OpenGL, VTK}

Image RegistrationLecture 6 15 What do I need ? C++ Compiler gcc 2.95 – 3.3 Visual C Visual C VC Intel 5.0 IRIX CC Borland 5.0 Mac - gcc CMake

Image RegistrationLecture 6 16 Downloading ITK Live on the Edge CVS Stability Release tar files Insight.tgz CVS anonymous

Image RegistrationLecture 6 17 Copying ITK from the CD /Source/ InsightToolkit zip InsightToolkit tar.gz

Image RegistrationLecture 6 18 Downloading CMake ITK Requires Latest CMake Release Get the Binaries Install Binaries

Image RegistrationLecture 6 19 Installing CMake from the CD /CMake/ cmake tar.gz cmake x86-win.zip cmake x86-linux.tar.gz CMakeSetup183.exe

Image RegistrationLecture 6 20 Configuring ITK Source Tree ITK Common Algorithms BasicFilter Numerics IO ITKb Common Algorithms BasicFilter Numerics IO Binary Tree Recommended ! Out Source Build In Source Build

Image RegistrationLecture 6 21 Configuring ITK – MS-Windows  Run CMake  Select the SOURCE directory  Select the BINARY directory  Select your Compiler

Image RegistrationLecture 6 22 Configuring ITK – MS-Windows

Image RegistrationLecture 6 23 Configuring ITK – MS-Windows  Disable BUILD_EXAMPLES  Disable BUILD_SHARED_LIBS  Disable BUILD_TESTING  Click “Configure” to configure  Click “OK” to generate project files

Image RegistrationLecture 6 24 Configuring ITK – Unix  Create the BINARY directory (mkdir)  Change directory to the BINARY directory (cd)  Set the environment variables CC and CXX setenv CC /usr/bin/gcc; setenv CXX /usr/bin/g++ OR export CC=/usr/bin/gcc; export CXX=/usr/bin/g++  Type ccmake with argument the SOURCE directory

Image RegistrationLecture 6 25 Configuring ITK – Unix

Image RegistrationLecture 6 26 Configuring ITK – Unix  Disable BUILD_EXAMPLES  Disable BUILD_SHARED_LIBS  Disable BUILD_TESTING  Type “c” to configure  Type “g” to generate the Makefiles  Type “make” to start building

Image RegistrationLecture 6 27 Building ITK

Image RegistrationLecture 6 28 Building ITK  Open ITK.dsw in the Binary Directory  Select ALL_BUILD project  Build it …It will take about 15 minutes …

Image RegistrationLecture 6 29 Building ITK

Image RegistrationLecture 6 30 Building ITK  Open ITK.sln in the Binary Directory  Select ALL_BUILD project  Build it …It will take about 15 minutes …

Image RegistrationLecture 6 31 Building ITK  Most of ITK classes are C++ Templates  Basic libraries are small they only contain non-templated classes  Basic libraries are built in about 15 min

Image RegistrationLecture 6 32 Verifying the Built Libraries will be found in In MS-Windows ITK_BINARY / bin / { Debug, Release } In UNIX ITK_BINARY / bin /

Image RegistrationLecture 6 33 Verifying the Built  ITKCommon  ITKBasicFilters  ITKAlgorithms  ITKNumerics  ITKFEM The following libraries should be there  ITKIO  ITKStatistics  ITKMetaIO  itkpng  itkzlib

Image RegistrationLecture 6 34 Using ITK – Hello World Copy “HelloWorld.cxx” “CMakeLists.txt” from the Examples/Installation Directory into another directory Run CMake Select Source Dir Select Binary Dir

Image RegistrationLecture 6 35 Using ITK – Hello World

Image RegistrationLecture 6 36 Using ITK – Hello World

Image RegistrationLecture 6 37 Using ITK – Hello World  Accept the default in CMAKE_BACKBARD_COMPATIBILITY  Leave empty EXECUTABLE_OUTPUT_PATH  Leave empty LIBRARY_OUTPUT_PATH  Set ITK_DIR to the binary directory where ITK was built

Image RegistrationLecture 6 38 Building the HelloWorld Project  Open HelloWorld.dsw (or.sln) generated by CMake  Select ALL_BUILD project  Build it …It will take about 3 seconds …

Image RegistrationLecture 6 39 Using ITK – Hello World

Image RegistrationLecture 6 40 Using ITK – Hello World  Locate the file HelloWorld.exe  Run it…  It should produce the message: ITK Hello World !

Image RegistrationLecture 6 41 Starting Your Own Project  Create a clean new directory  Write a CMakeLists.txt file  Write a simple.cxx file  Configure with CMake  Build  Run

Image RegistrationLecture 6 42 Writing CMakeLists.txt PROJECT( myProject ) FIND_PACKAGE ( ITK ) IF ( ITK_FOUND ) INCLUDE( ${USE_ITK_FILE} ) ENDIF( ITK_FOUND ) ADD_EXECUTABLE( myProject myProject.cxx ) TARGET_LINK_LIBRARIES ( myProject ITKCommon ITKIO)

Image RegistrationLecture 6 43 Writing myProject.cxx #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; }

Image RegistrationLecture 6 44 How to Find What Your Need  Follow the link Alphabetical List  Follow the link Groups  Post to the insight-users mailing list

Image RegistrationLecture 6 45 Doxygen Documentation

Image RegistrationLecture 6 46 Doxygen Groups

Image RegistrationLecture 6 47 Doxygen Alphabetical List

Image RegistrationLecture 6 48 ITK Architecture

Image RegistrationLecture 6 49 ITK Basics  C++ Generic Programming  Data Pipeline  Multi-threading  Streaming  Exceptions  Events / Observers  Tcl and Python wrapping

Image RegistrationLecture 6 50 Generic Programming Example: STL Standard Template Library Abstraction of Types and Behaviors std::vector

Image RegistrationLecture 6 51 ITK Image Class itk::Image itk::Image, 2 >

Image RegistrationLecture 6 52 C++ Namespaces Avoid naming collisions itk:: itk::Statistics:: itk::fem:: itk::fem::itpack itk::bio NEVER DO: using namespace itk; using namespace std;

Image RegistrationLecture 6 53 ITK Most Common Keyword typedef typedef itk::Image ImageType typedef itk::ImageFilter FilterType otherwise... itk::ImageFilter, Image > FilterType

Image RegistrationLecture 6 54 Smart Pointers Object Smart Pointer counter=0counter=1counter=2counter=3 Self - Delete

Image RegistrationLecture 6 55 Smart Pointers typedef itk::Image ImageType typedef itk::ImageFilter FilterType FilterType::Pointer filter = FilterType::New(); ImageType::Pointer image = filter->GetOutput(); NO NEED FOR filter->Delete();

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

Image RegistrationLecture 6 57 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 );

Image RegistrationLecture 6 58 Data Pipeline Image Filter Image Filter Image Filter

Image RegistrationLecture 6 59 Image Regions LargestPossibleRegion BufferedRegion RequestedRegion

Image RegistrationLecture 6 60 Streaming Output Image Filter Processing Large Images Input Image

Image RegistrationLecture 6 61 Simple Image IO Image File ImageFileReader Image Filter Image File ImageFileWriter

Image RegistrationLecture 6 62 Simple Image IO CustomImageIO Image File ImageFileReader Image PNGImageIO VTKImageIODICOMImageIOGIPLImageIO MetaImageIOAnalyzeImageIO Loadable Factories

Image RegistrationLecture 6 63 Simple Image IO #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();

Image RegistrationLecture 6 64 Exceptions Error Management ITK Layer Application Layer

Image RegistrationLecture 6 65 Exceptions try { filter->Update(); } catch( itk::ExceptionObject & exp ) { std::cerr << exp << std::endl; }

Image RegistrationLecture 6 66 Events and Commands/Observers Itk::Object Itk::Command itk::Command Event

Image RegistrationLecture 6 67 Events Common Events AnyEvent() StartEvent() EndEvent() ProgressEvent() IterationEvent()

Image RegistrationLecture 6 68 Events and Commands/Observers Itk::Object Itk::ProcessObject Itk::FilterXY Itk::Command MyCommand Execute() AddObserver( ) AnyEvent MyEvent

Image RegistrationLecture 6 69 Events and Commands/Observers Itk::Object Itk::ProcessObject Itk::FilterXY Itk::Command Itk::SimpleMemberCommand AddObserver( ) MyClass MethodX() AnyEvent MyEvent

Image RegistrationLecture 6 70 GUI Communication ITK Layer GUI Layer Widget FilterX Callback Command FilterX Widget Observer

Image RegistrationLecture 6 71 End Enjoy ITK !