CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.

Slides:



Advertisements
Similar presentations
ITK Architecture Kitware Inc.. ITK Basics C++ Generic Programming Data Pipeline Multi-threading Streaming Exceptions Events / Observers Tcl, Python and.
Advertisements

ITK Registration Methods
ITK Deformable Registration
ITK Deformable Registration
Lecture 7 2D Transformation. What is a transformation? Exactly what it says - an operation that transforms or changes a shape (line, shape, drawing etc.)
CSci 6971: Image Registration Lecture 14 Distances and Least Squares March 2, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
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.
Do Now:.
National Alliance for Medical Image Computing ITK The Image Segmentation and Registration Toolkit Julien Jomier Kitware Inc.
CSci 6971: Image Registration Lecture 3: Images and Transformations January 20, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
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 26: BSpline Transforms April 20, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
CSci 6971: Image Registration Lecture 4: First Examples January 23, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr.
CSci 6971: Image Registration Lecture 8: Registration Components February 6, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
Original image: 512 pixels by 512 pixels. Probe is the size of 1 pixel. Picture is sampled at every pixel ( samples taken)
CSci 6971: Image Registration Lecture 2: Vectors and Matrices January 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
CSci 6971: Image Registration Lecture 9: Registration Components February 10, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
Medical Image Registration
CSci 6971: Image Registration Lecture 20: Demons Registration April 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
CSci 6971: Image Registration Lecture 10: Registration Components February 13, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 5: Feature-Base Regisration January 27, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
CSci 6971: Image Registration Lecture 16: View-Based Registration March 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart,
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.
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.
Georeferencing Getting maps and satellite images into GIS.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
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.
Image Resampling ASTR 3010 Lecture 21 Textbook 9.4.
SS5305 – Motion Capture Initialization 1. Objectives Camera Setup Data Capture using a Single Camera Data Capture using two Cameras Calibration Calibration.
Unit 5: Geometric Transformations.
CSci 6971: Image Registration Lecture 3: Images and Transformations March 1, 2005 Prof. Charlene Tsai.
ITK Input/Output Kitware Inc.. Overview IO Factory Mechanism Image File IO Transform File IO SpatialObject File IO Logger.
ITK Introduction and Overview Spring Topics  What Is ITK History Features  Software Engineering Methodology.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
GEOMETRIC OPERATIONS. Transformations and directions Affine (linear) transformations Translation, rotation and scaling Non linear (Warping transformations)
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.
4-7 Congruence Transformations. A transformation is an operation that maps an original geometric figure, the preimage, onto anew figure called the image.
Geoprocessing and georeferencing raster data
Image Registration Lecture 9: Registration Components March 22, 2005 Prof. Charlene Tsai.
ITK Statistical Classification Kitware Inc.. Statistical Classification Multiple Components Images K-Means Markov Random Fields.
Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis.
Insight Toolkit Introduction Luis Ibáñez William Schroeder Insight Software Consortium.
ITK Segmentation Methods
Image transformations
Image transformations
Transformations in 3 Dimensions CS /28/2018 Dr. Mark L. Hornick
More Image Manipulation
A movement of a figure in a plane.
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.
Types of operations The types of operations that can be applied to digital images to transform an input image a[m,n] into an output image b[m,n] (or another.
4.1: Congruence and Transformation
SimpleITK Fundamental Concepts
SimpleITK Fundamental Concepts
Introduction to High Performance Computing Lecture 7
ITK Workshop Software Design October 5-8, 2005.
Types of operations The types of operations that can be applied to digital images to transform an input image a[m,n] into an output image b[m,n] (or another.
Resampling.
Introduction to Mathematical tools in used in DIP
SimpleITK Fundamental Concepts
Rotations Day 120 Learning Target:
Rotation Around a Point
Graphics Laboratory Korea University
Presentation transcript:

CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware

Image RegistrationLecture 7 2 Why Resampling ? Resampling is the Essence of Intensity Based Image Registration

Image RegistrationLecture 7 3 What is an Image ? An Image is a sampling of a continuous field using a discrete grid

Image RegistrationLecture 7 4 Image Origin & Spacing Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) x y

Image RegistrationLecture 7 5 Image Sampling Grid Origin (Ox,Oy) Spacing (Sy) Spacing (Sx)

Image RegistrationLecture 7 6 Image Pixel Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Pixel Value Pixel Region

Image RegistrationLecture 7 7 Image Indices Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) [0,0] [1,0][2,0] [3,0][4,0] [5,0] [0,1] [0,2] [0,3] [0,4] [0,5] [4,7] [0,6] [0,7] Pixel Index

Image RegistrationLecture 7 8 Index to Physical Coordinates Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) [0,0] [1,0][2,0] [3,0][4,0] [5,0] [0,1] [0,2] [0,3] [0,4] [0,5] [4,7] [0,6] [0,7] Pixel Index P[0] = Index[0] x Spacing[0] + Origin[0] P[1] = Index[1] x Spacing[1] + Origin[1] Index[0] = floor( ( P[0] - Origin[0] ) / Spacing[0] ) Index[1] = floor( ( P[1] - Origin[1] ) / Spacing[1] )

Image RegistrationLecture 7 9 Image Region Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Pixel Value Pixel Region Image Region

Image RegistrationLecture 7 10 Image Region Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Image Region Starting Index Region Size [2,3] [3,5]

Image RegistrationLecture 7 11 Basic Resampling Resampling Trivial Cases

Image RegistrationLecture 7 12 Sub-Sampling by Half Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Image Region Spacing ( 2 x Sy ) Spacing ( 2 x Sx )

Image RegistrationLecture 7 13 Sub-Sampling by Half Origin (Ox,Oy) New Origin (O’x,O’y) New Spacing S’y New Spacing S’x

Image RegistrationLecture 7 14 Super-Sampling by Double Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Image Region Spacing ( Sy/2 ) Spacing ( Sx/2 )

Image RegistrationLecture 7 15 Super-Sampling by Double Origin (Ox,Oy) New Spacing S’x New Spacing S’y New Origin (O’x,O’y)

Image RegistrationLecture 7 16 Resampling in ITK itk::ResampleImageFilter

Image RegistrationLecture 7 17 Resampling in ITK Transform Interpolator Origin Spacing Region Start Region Size Resample Filter Input Image Output Image

Image RegistrationLecture 7 18 Resample Image Filter #include "itkImage.h" #include "itkResampleImageFilter.h" #include "itkIdentityTransform.h“ #include "itkLinearInterpolateImageFunction.h" typedef itk::Image ImageType; ImageType::Pointer inputImage = GetImageSomeHow(); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer resampler = FilterType::New(); ImageType::SizeType size; size[0] = 200; size[1] = 300; ImageType::IndexType start; start[0] = 0; start[1] = 0;

Image RegistrationLecture 7 19 Resample Image Filter ImageType::PointType origin; origin[0] = 10.0; // millimeters origin[1] = 25.5; // millimeters ImageType::SpacingType spacing; spacing[0] = 2.0; // millimeters spacing[1] = 1.5; // millimeters resampler->SetOutputSpacing( spacing ); resampler->SetOutputOrigin( origin ); resampler->SetSize( size ); resampler->SetOutputStartIndex( start ); resampler->SetDefaultPixelValue( 100 ); resampler->SetInput( inputImage );

Image RegistrationLecture 7 20 Resample Image Filter typedef itk::LinearInterpolateImageFunction InterpolatorType; InterpolatorType::Pointer interpolator = InterpolatorType::New(); typedef itk::TranslationTransform TransformType; TransformType::Pointer transform = TransformType::New(); transform->SetIdentity(); resampler->SetInterpolator( interpolator ); resampler->SetTransform( transform ); resampler->Update(); const ImageType * outputImage = resampler->GetOutput();

Image RegistrationLecture 7 21 Basic Registration Registration Basics

Image RegistrationLecture 7 22 Coordinate System Conversions Image Grid j i y x Physical Coordinates y’ x’ Physical Coordinates Image Grid j i Space Transform x y

Image RegistrationLecture 7 23 Things I will not do… I will not register images in pixel space I will not register images in pix

Image RegistrationLecture 7 24 Fixed Image & Moving Image Fixed Image Grid j i y x Fixed Image Physical Coordinates y’ x’ Moving Image Physical Coordinates Moving Image Grid j i Space Transform

Image RegistrationLecture 7 25 Selecting Moving & Fixed Images In principle the denomination of Fixed Image & Moving Image is arbitrary In practice the moving image is the one that will be resampled into the fixed image coordinate system

Image RegistrationLecture 7 26 Quiz #1 Images provided as part of the project: “Retrospective Image Registration Evaluation”, NIH, Project No. 8R01EB , Principal Investigator, J. Michael Fitzpatrick, Vanderbilt University, Nashville, TN. Images from the same patient 256 x 256 pixels MRI-T2 128 x 128 pixels PET Moving Image ? Fixed Image ?

Image RegistrationLecture 7 27 Quiz #2 Images provided as part of the project: “Retrospective Image Registration Evaluation”, NIH, Project No. 8R01EB , Principal Investigator, J. Michael Fitzpatrick, Vanderbilt University, Nashville, TN. Images from the same patient 256 x 256 pixels MRI-T2 128 x 128 pixels PET Scaling Transform What scale factor ? a)2.0 b)1.0 c)0.5

Image RegistrationLecture 7 28 Things I will not do… I will not register images in pixel space I will not register images in pix

Image RegistrationLecture 7 29 Security "Do not accept packages or baggage from unknown individuals." "Do not accept images or volumes without pixel spacing." Airport Security Image Security

Image RegistrationLecture 7 30 Exercise #1 Input Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Coordinates ? ( 144.8mm, 0.0mm ) Coordinates ? ( 0.0mm, 195.3mm ) Coordinates ? ( 144.8mm, 195.3mm ) Output Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Output Origin ( 35.0mm, 50.0mm )

Image RegistrationLecture 7 31 Exercise #1 Input Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Output Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm

Image RegistrationLecture 7 32 Resample Image Filter #include "itkImage.h" #include "itkResampleImageFilter.h" #include "itkIdentityTransform.h" #include "itkNearestNeighborInterpolateImageFunction.h" typedef itk::Image ImageType; ImageType::ConstPointer inputImage = reader->GetOutput(); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer resampler = FilterType::New(); ImageType::RegionType region = inputImage->GetBufferedRegion(); resampler->SetSize( region->GetSize() ); resampler->SetOutputStartIndex( region->GetIndex() ); resampler->SetOutputSpacing( inputImage->GetSpacing() );

Image RegistrationLecture 7 33 Resample Image Filter ImageType::PointType origin; origin[0] = 35.0; // millimeters origin[1] = 50.0; // millimeters resampler->SetOutputOrigin( origin ); typedef itk::IdentityTransform TransformType; TransformType::Pointer transform = TransformType::New(); resampler->SetTransform( transform ); resampler->SetDefaultPixelValue( 100 ); resampler->SetInput( inputImage ); writer->SetInput( resampler->GetOutput() ); writer->Update();

Image RegistrationLecture 7 34 Exercise #1 Input Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Output Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm

Image RegistrationLecture 7 35 Quiz #3 Fixed Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Moving Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (35,50) Transform ?

Image RegistrationLecture 7 36 Things I will not do… I will not register images in pixel space I will not register images in pix

Image RegistrationLecture 7 37 Quiz #4 Fixed Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Moving Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Transform ?

Image RegistrationLecture 7 38 Return to the Source Input Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Output Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) (35,50) Translation ( -35, -50 )

Image RegistrationLecture 7 39 More Resampling Resampling Less Trivial Cases

Image RegistrationLecture 7 40 Rotation y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 41 Rotation y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 42 Rotation y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 43 Rotation around the Origin Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Rotation Center

Image RegistrationLecture 7 44 Rotation around the Origin Origin (Ox,Oy) Spacing (Sy) Spacing (Sx)

Image RegistrationLecture 7 45 Rotation around the Origin Origin (Ox,Oy) Default Pixel Value

Image RegistrationLecture 7 46 Rotation around the Center y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 47 Rotation around the Center y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 48 Rotation around the Center y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 49 Rotation around the Center y Fixed Transform 10 o x y Moving x

Image RegistrationLecture 7 50 Rotation around the Center Origin (Ox,Oy) Spacing (Sy) Spacing (Sx) Rotation Center

Image RegistrationLecture 7 51 Rotation around the Center Origin (Ox,Oy) Spacing (Sy) Spacing (Sx)

Image RegistrationLecture 7 52 Rotation around the Center Origin (Ox,Oy) Default Pixel Value

Image RegistrationLecture 7 53 Resample Image Filter #include "itkImage.h" #include "itkResampleImageFilter.h" #include "itkCenteredRigid2DTransform.h“ #include "itkNearestNeighborInterpolateImageFunction.h" typedef itk::Image ImageType; ImageType::Pointer inputImage = GetImageSomeHow(); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer resampler = FilterType::New(); ImageType::SizeType size; size[0] = 200; size[1] = 300; ImageType::IndexType start; start[0] = 0; start[1] = 0;

Image RegistrationLecture 7 54 Resample Image Filter ImageType::PointType origin; origin[0] = 10.0; // millimeters origin[1] = 25.5; // millimeters ImageType::SpacingType spacing; spacing[0] = 2.0; // millimeters spacing[1] = 1.5; // millimeters resampler->SetOutputSpacing( spacing ); resampler->SetOutputOrigin( origin ); resampler->SetSize( size ); resampler->SetOutputStartIndex( start ); resampler->SetDefaultPixelValue( 100 ); resampler->SetInput( inputImage );

Image RegistrationLecture 7 55 Resample Image Filter typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType; InterpolatorType::Pointer interpolator = InterpolatorType::New(); resampler->SetInterpolator( interpolator ); typedef itk::CenteredRigid2DTransform TransformType; TransformType::Pointer transform = TransformType::New(); resampler->SetTransform( transform ); TransformType::InputPointType center; center[0] = origin[0] + spacing[0] * size[0] / 2; center[1] = origin[1] + spacing[1] * size[1] / 2;

Image RegistrationLecture 7 56 Resample Image Filter transform->SetCenter( center ); angle = 10.0 * / 180.0; transform->SetRotation( angle ); transform->ComputeOffset(); resampler->Update(); const ImageType * outputImage = resampler->GetOutput();

Image RegistrationLecture 7 57 Scaling y Fixed Transform 10% x y Moving x

Image RegistrationLecture 7 58 Scaling y Fixed x y Moving x Transform 10%

Image RegistrationLecture 7 59 Scaling y Fixed x y Moving x Transform 10%

Image RegistrationLecture 7 60 Scaling y Fixed x y Moving x Transform 10%

Image RegistrationLecture 7 61 Resample Image Filter #include "itkImage.h" #include "itkResampleImageFilter.h" #include "itkScaleTransform.h" #include "itkNearestNeighborInterpolateImageFunction.h" typedef itk::Image ImageType; ImageType::ConstPointer inputImage = reader->GetOutput(); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer resampler = FilterType::New(); ImageType::RegionType region = inputImage->GetBufferedRegion(); resampler->SetSize( region->GetSize() ); resampler->SetOutputStartIndex( region->GetIndex() );

Image RegistrationLecture 7 62 Resample Image Filter resampler->SetOutputSpacing( inputImage->GetSpacing() ); resampler->SetOutputOrigin( inputImage->GetOrigin() ); typedef itk::ScaleTransform TransformType; TransformType::Pointer transform = TransformType::New(); TransformType::ScaleType scale; scale[0] = 1.1; scale[1] = 1.1; transform->SetScale( scale ); resampler->SetTransform( transform ); resampler->SetDefaultPixelValue( 100 ); resampler->SetInput( inputImage ); writer->SetInput( resampler->GetOutput() ); writer->Update();

Image RegistrationLecture 7 63 Quiz #5 Fixed Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Moving Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Transform ? a)1.50 b) Scale X 2.Scale Y

Image RegistrationLecture 7 64 Quiz #6 Fixed Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Moving Image Size: 181x217 pixels Spacing: 0.8 x 0.9 mm Origin: (0,0) Transform ? a)1.50 b) Scale X 2.Scale Y

Image RegistrationLecture 7 65 End Enjoy ITK !