CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004 - PowerPoint PPT Presentation

About This Presentation
Title:

CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004

Description:

CSci 6971: Image Registration. Lecture 8: Image Resampling. February 3, 2004 ... Investigator, J. Michael Fitzpatrick, Vanderbilt University, Nashville, TN. ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 66
Provided by: sysa155
Learn more at: http://www.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: CSci 6971: Image Registration Lecture 8: Image Resampling February 3, 2004


1
CSci 6971 Image Registration Lecture 8 Image
ResamplingFebruary 3, 2004
Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware
2
Why Resampling ?
Resamplingis the Essence of Intensity
BasedImage Registration
3
What is an Image ?
An Image is a sampling of a continuous field
using a discrete grid
4
Image Origin Spacing
Spacing (Sx)
Spacing (Sy)
Origin (Ox,Oy)
5
Image Sampling Grid
Spacing (Sx)
Spacing (Sy)
Origin (Ox,Oy)
6
Image Pixel
Spacing (Sx)
Pixel Value
Pixel Region
Spacing (Sy)
Origin (Ox,Oy)
7
Image Indices
Spacing (Sx)
Pixel Index
0,7
4,7
0,6
0,5
0,4
0,3
0,2
Spacing (Sy)
0,1
0,0
1,0
2,0
3,0
4,0
5,0
Origin (Ox,Oy)
8
Index to Physical Coordinates
Spacing (Sx)
Pixel Index
0,7
4,7
0,6
0,5
P0 Index0 x Spacing0 Origin0
P1 Index1 x Spacing1 Origin1
0,4
Index0 floor( ( P0 - Origin0 ) /
Spacing0 0.5 )
0,3
Index1 floor( ( P1 - Origin1 ) /
Spacing1 0.5 )
0,2
Spacing (Sy)
0,1
0,0
1,0
2,0
3,0
4,0
5,0
Origin (Ox,Oy)
9
Image Region
Spacing (Sx)
Pixel Value
Image Region
Pixel Region
Spacing (Sy)
Origin (Ox,Oy)
10
Image Region
Spacing (Sx)
Region Size
Image Region
3,5
Starting Index
2,3
Spacing (Sy)
Origin (Ox,Oy)
11
Basic Resampling
ResamplingTrivial Cases
12
Sub-Sampling by Half
Spacing (Sx)
Image Region
Spacing (Sy)
Origin (Ox,Oy)
13
Sub-Sampling by Half
New Spacing Sx
New Spacing Sy
New Origin (Ox,Oy)
Origin (Ox,Oy)
14
Super-Sampling by Double
Spacing ( Sx/2 )
Spacing (Sx)
Spacing ( Sy/2 )
Image Region
Spacing (Sy)
Origin (Ox,Oy)
15
Super-Sampling by Double
New Spacing Sx
New Origin (Ox,Oy)
Origin (Ox,Oy)
16
Resampling in ITK
itkResampleImageFilter
17
Resampling in ITK
Origin
Spacing
Region Size
Resample Filter
Region Start
Transform
Interpolator
18
Resample Image Filter
include "itkImage.h" include "itkResampleImageFi
lter.h" include "itkIdentityTransform.h include
"itkLinearInterpolateImageFunction.h" typedef
itkImagelt char, 2 gt ImageType ImageTypePoin
ter inputImage GetImageSomeHow() typedef
itkResampleImageFilterlt ImageType gt
FilterType FilterTypePointer resampler
FilterTypeNew() ImageTypeSizeType
size size0 200 size1 300 ImageTypeIn
dexType start start0 0 start1 0
19
Resample Image Filter
ImageTypePointType origin origin0 10.0
// millimeters origin1 25.5 //
millimeters ImageTypeSpacingType spacing
spacing0 2.0 // millimeters spacing1
1.5 // millimeters resampler-gtSetOutputSpacing(
spacing ) resampler-gtSetOutputOrigin( origin
) resampler-gtSetSize( size ) resampler-gtSetOutp
utStartIndex( start ) resampler-gtSetDefaultPixel
Value( 100 ) resampler-gtSetInput( inputImage )
20
Resample Image Filter
typedef itkLinearInterpolateImageFunctionlt
ImageType,
double gt
InterpolatorType InterpolatorTypePointer
interpolator InterpolatorTypeNew() typedef
itkTranslationTransformlt double, 2 gt
TransformType TransformTypePointer transform
TransformTypeNew() transform-gtSetIdentity()
resampler-gtSetInterpolator( interpolator
) resampler-gtSetTransform( transform
) resampler-gtUpdate() const ImageType
outputImage resampler-gtGetOutput()
21
Basic Registration
RegistrationBasics
22
Coordinate System Conversions
23
Things I will not do
24
Fixed Image Moving Image
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
26
Quiz 1
Images from the same patient
Moving Image ? Fixed Image ?
Images provided as part of the project
Retrospective Image Registration Evaluation,
NIH, Project No. 8R01EB002124-03, Principal
Investigator, J. Michael Fitzpatrick, Vanderbilt
University, Nashville, TN.
27
Quiz 2
Images from the same patient
What scale factor ?
  • 2.0
  • 1.0
  • 0.5

Images provided as part of the project
Retrospective Image Registration Evaluation,
NIH, Project No. 8R01EB002124-03, Principal
Investigator, J. Michael Fitzpatrick, Vanderbilt
University, Nashville, TN.
28
Things I will not do
29
Security
Airport Security
"Do not accept packages or baggage from unknown
individuals."
Image Security
"Do not accept images or volumes without pixel
spacing."
30
Exercise 1
Output Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Input Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Coordinates ?
Coordinates ?
( 0.0mm , 195.3mm )
( 144.8mm , 195.3mm )
Output Origin
( 35.0mm , 50.0mm )
Coordinates ?
Origin (0,0)
( 144.8mm , 0.0mm )
31
Exercise 1
Output Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Input Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Origin (0,0)
32
Resample Image Filter
include "itkImage.h" include "itkResampleImageFi
lter.h" include "itkIdentityTransform.h" include
"itkNearestNeighborInterpolateImageFunction.h" t
ypedef itkImagelt char, 2 gt ImageType ImageTyp
eConstPointer inputImage reader-gtGetOutput()
typedef itkResampleImageFilterlt ImageType gt
FilterType FilterTypePointer resampler
FilterTypeNew() ImageTypeRegionType region
inputImage-gtGetBufferedRegion() resampler-gtSet
Size( region-gtGetSize() ) resampler-gtSetOutputSta
rtIndex( region-gtGetIndex() ) resampler-gtSetOutp
utSpacing( inputImage-gtGetSpacing() )
33
Resample Image Filter
ImageTypePointType origin origin0 35.0
// millimeters origin1 50.0 //
millimeters resampler-gtSetOutputOrigin( origin
) typedef itkIdentityTransformlt double, 2 gt
TransformType TransformTypePointer transform
TransformTypeNew() resampler-gtSetTransform(
transform ) resampler-gtSetDefaultPixelValue(
100 ) resampler-gtSetInput( inputImage
) writer-gtSetInput( resampler-gtGetOutput()
) writer-gtUpdate()
34
Exercise 1
Output Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Input Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Origin (0,0)
35
Quiz 3
Moving Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Fixed Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Origin (0,0)
Origin (35,50)
36
Things I will not do
37
Quiz 4
Moving Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Fixed Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Origin (0,0)
Origin (0,0)
38
Return to the Source
Output Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Input Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
(35,50)
Origin (0,0)
Origin (0,0)
39
More Resampling
ResamplingLess Trivial Cases
40
Rotation
y
y
Transform
10o
x
x
Fixed
Moving
41
Rotation
y
y
Transform
10o
x
x
Fixed
Moving
42
Rotation
y
y
Transform
10o
x
x
Fixed
Moving
43
Rotation around the Origin
Spacing (Sx)
Spacing (Sy)
Rotation Center
Origin (Ox,Oy)
44
Rotation around the Origin
Spacing (Sx)
Spacing (Sy)
Origin (Ox,Oy)
45
Rotation around the Origin
DefaultPixelValue
Origin (Ox,Oy)
46
Rotation around the Center
y
y
Transform
10o
x
x
Fixed
Moving
47
Rotation around the Center
y
y
Transform
10o
x
x
Fixed
Moving
48
Rotation around the Center
y
y
Transform
10o
x
x
Fixed
Moving
49
Rotation around the Center
y
y
Transform
10o
x
x
Fixed
Moving
50
Rotation around the Center
Spacing (Sx)
RotationCenter
Spacing (Sy)
Origin (Ox,Oy)
51
Rotation around the Center
Spacing (Sx)
Spacing (Sy)
Origin (Ox,Oy)
52
Rotation around the Center
DefaultPixelValue
Origin (Ox,Oy)
53
Resample Image Filter
include "itkImage.h" include "itkResampleImageFi
lter.h" include "itkCenteredRigid2DTransform.h
include "itkNearestNeighborInterpolateImageFunctio
n.h" typedef itkImagelt char, 2 gt
ImageType ImageTypePointer inputImage
GetImageSomeHow() typedef itkResampleImageFil
terlt ImageType gt FilterType FilterTypePointer
resampler FilterTypeNew() ImageTypeSizeTy
pe size size0 200 size1
300 ImageTypeIndexType start start0
0 start1 0
54
Resample Image Filter
ImageTypePointType origin origin0 10.0
// millimeters origin1 25.5 //
millimeters ImageTypeSpacingType spacing
spacing0 2.0 // millimeters spacing1
1.5 // millimeters resampler-gtSetOutputSpacing(
spacing ) resampler-gtSetOutputOrigin( origin
) resampler-gtSetSize( size ) resampler-gtSetOutp
utStartIndex( start ) resampler-gtSetDefaultPixel
Value( 100 ) resampler-gtSetInput( inputImage )
55
Resample Image Filter
typedef itkNearestNeighborInterpolateImageFuncti
onlt ImageType,
double gt
InterpolatorType InterpolatorTypePointer
interpolator InterpolatorTypeNew() resampler
-gtSetInterpolator( interpolator ) typedef
itkCenteredRigid2DTransformlt double, 2 gt
TransformType TransformTypePointer transform
TransformTypeNew() resampler-gtSetTransform(
transform ) TransformTypeInputPointType
center center0 origin0 spacing0
size0 / 2 center1 origin1 spacing1
size1 / 2
56
Resample Image Filter
transform-gtSetCenter( center ) angle 10.0
3.1514 / 180.0 transform-gtSetRotation( angle
) transform-gtComputeOffset() resampler-gtUpdate
() const ImageType outputImage
resampler-gtGetOutput()
57
Scaling
y
y
Transform
10
x
x
Fixed
Moving
58
Scaling
y
y
Transform
10
x
x
Fixed
Moving
59
Scaling
y
y
Transform
10
x
x
Fixed
Moving
60
Scaling
y
y
Transform
10
x
x
Fixed
Moving
61
Resample Image Filter
include "itkImage.h" include "itkResampleImageFi
lter.h" include "itkScaleTransform.h" include
"itkNearestNeighborInterpolateImageFunction.h" ty
pedef itkImagelt char, 2 gt ImageType ImageType
ConstPointer inputImage reader-gtGetOutput()
typedef itkResampleImageFilterlt ImageType gt
FilterType FilterTypePointer resampler
FilterTypeNew() ImageTypeRegionType region
inputImage-gtGetBufferedRegion() resampler-gtSet
Size( region-gtGetSize() ) resampler-gtSetOutputSt
artIndex( region-gtGetIndex() )
62
Resample Image Filter
resampler-gtSetOutputSpacing( inputImage-gtGetSpacin
g() ) resampler-gtSetOutputOrigin(
inputImage-gtGetOrigin() ) typedef
itkScaleTransformlt double, 2 gt
TransformType TransformTypePointer transform
TransformTypeNew() TransformTypeScaleType
scale scale0 1.1 scale1
1.1 transform-gtSetScale( scale
) resampler-gtSetTransform( transform
) resampler-gtSetDefaultPixelValue( 100
) resampler-gtSetInput( inputImage
) writer-gtSetInput( resampler-gtGetOutput()
) writer-gtUpdate()
63
Quiz 5
Moving Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Fixed Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
  • Scale X
  • Scale Y
  • 1.50
  • 0.75

Origin (0,0)
Origin (0,0)
64
Quiz 6
Moving Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
Fixed Image Size 181x217 pixels Spacing 0.8 x
0.9 mm
  • Scale X
  • Scale Y
  • 1.50
  • 0.75

Origin (0,0)
Origin (0,0)
65
End
Enjoy ITK !
Write a Comment
User Comments (0)
About PowerShow.com