You are on page 1of 62

Advanced Medical Image Processing

Image Analysis
Advanced Medical Image Processing
Q&A Session Q&A Session
Data flow in image processing
Segmentation, classification g
Histogram, how to highlight structures
What is a linear filter, examples (smoothing, gradients)
Advanced Medical Image Processing
Questions Questions
improve image quality
remove noise
deblur image
highlight interesting information
vessels vessels
bones
nodules, cancer, lesions
diagnostic support
find possible lesions, cancer: classification
measure volume, area, diameter measure volume, area, diameter
measure density
Advanced Medical Image Processing
How is image processing done ?
Advanced Medical Image Processing
Image Processing Image Processing
for the nave user
standard programs like Photoshop, Gimp, g
for experts but no programmers:
IDL, Khoros, VGStudioMax,
for programmers for programmers
Matlab, (Mathematica, Maple), .
for specialists (complicated algorithms and data structures)
C++, Java (and their image processing toolboxes)
Advanced Medical Image Processing
Data Flow in Image Processing Data Flow in Image Processing
raw data raw data
image formation, gain correction
image improvement
low level
i i
denoising
image processing
reconstruction
high level
i i
segmentation, classification
tracking visualization
image processing
(computer vision)
tracking, visualization
Advanced Medical Image Processing
Segmentation, Classification Segmentation, Classification
Definition: Segmentation
Segmentation is the assignment of pixels/voxels to a region. All
elements of the same region have similar properties (gray values within elements of the same region have similar properties (gray values, within
a boundary etc.)
Definition: Classification
Cl ifi ti i th i t f i l t i t l Classification is the assignment of image elements or regions to real-
world objects
Examples:
S: assign all elements above a gray value threshold to a region
S: assign all elements within a closed boundary to a region
S: assign all elements of vessel like structures to the same region S: assign all elements of vessel like structures to the same region
C: assign pixels to liver
C: assign pixels to blood vessels
Advanced Medical Image Processing
Example (CT) Example (CT)
Original Image Denoised Image
Segmentation by
Thresholding
Advanced Medical Image Processing
Example (CT) Example (CT)
Original Image
Segmentation
(objects above threshold)
Classification
(liver)
error error
Advanced Medical Image Processing
Low-Level Image Processing Low Level Image Processing
Image Correction
Image Improvement, Denoising
raw data
g g
Image Reconstruction
(Tomography, Deblurring, ...)
image formation, gain correction
image improvement
denoising
t ti reconstruction
segmentation, classification g ,
tracking, visualization
Advanced Medical Image Processing
Image Correction Image Correction
detectors
brightness variation g
noise
sensitivity
defect detector elements defect detector elements
distortion correction
e.g. image intensifiers: earth magnetic field deforms image
rectification (e.g. ultrasound)
http://www.kardiologiapolska.pl/upload/fba6838d24ae8ef14cce382ac8abbc9d.jpg
Advanced Medical Image Processing
Comment Comment
For detectors it is typically assumed that we have a linear relation between
physical parameter and measured signal
Offset: typically, there is a threshold before a signal is generated, this
can vary between detector pixels
Gain: the sensitivity of pixels may change y p y g
Detector calibration has to repeated at defined intervals due to degrading of
materials
Defect pixel detection is an extra operation (not within this frame) Defect pixel detection is an extra operation (not within this frame)
Advanced Medical Image Processing
Image Improvement Image Improvement
brightness correction due to non-homogenous illumination
contrast enhancement
remo al of small ninteresting objects removal of small, uninteresting objects
removing artifacts if possible
http://www.reindeergraphics.com/foveapro/adjust.shtml
Denoising
smoothing images
removing noise using noise model
Advanced Medical Image Processing
Reconstruction Reconstruction
MRI: Fourier transform of image:
apply inverse Fourier transform y
CT: apply inverse Radon transform to generate a volume from projections
Thermography: solve inverse problem to obtain temperature distribution in
body from surface data body from surface data
Deblurring: remove blur from image
Advanced Medical Image Processing
Describing Images Describing Images
Deterministic Images
Discrete representation by 2D (or
higher dimensional) array of gray
[0,255] ] Image[x][y e
g ) y g y
(color) values.
Stochastic Images
Image is sample of a random g p
process
Histogram
Gray value distribution
frequency
y
gray value
Advanced Medical Image Processing
1. Image Improvement 1. Image Improvement
Point based image processing (In the spatial domain)
Histogram analysis g y
Point operations
Linear Filters (In the frequency domain)
Fourier Transforms Fourier Transforms
LTI systems
Non-linear Filters
Advanced Medical Image Processing
1.1. Point Based Image Processing 1.1. Point Based Image Processing
Histogram Analysis Histogram Analysis
Point Operations
Advanced Medical Image Processing
1.1.1. Histogram Analysis 1.1.1. Histogram Analysis
freq enc distrib tion of gra al es frequency distribution of gray values
gray value
Advanced Medical Image Processing
Examples Examples
Original Images Histograms
Advanced Medical Image Processing
Point Operations Point Operations
Processing:
Given original image f(x,y)
Let g be the mapping bet een gra al es of inp t to o tp t Let g be the mapping between gray values of input to output
The output image is thus h(x,y) = g(f(x,y))
g() can be realized by a look-up-table (LUT)
The input gray value is the address
The output gray value is the contents at this address
input output
Advanced Medical Image Processing
Histogram Based Operations Histogram Based Operations
Contrast stretching: maximum value:
2
B
-1
( )
B
a[m, n] min(a)
b[m, n] 2 1
( ) i ( )

=
( )
[ ]
max(a) min(a)
Advanced Medical Image Processing
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
1.1.2. Point Operations (1) 1.1.2. Point Operations (1)
operations that are pixel-wise (extend the above histogram operations)
for each pixel I, f: resulting gray value g g y
apply operation O: f(i)=O(g(i))
Example:
histogram operation histogram operation
stretching histogram
increasing contrast
intensity correction
brightness correction
gain correction gain correction
thresholding
if g(i) > threshold
f(i) 1 f(i) = 1
otherwise
f(i) = 0
Advanced Medical Image Processing
1 1 2 Point Operations (2) 1.1.2. Point Operations (2)
gray value transformations
window/level transformations on histograms
histogram: representation of frequency of gray values in image histogram: representation of frequency of gray values in image
1. set all gray values below level-window/2 and level + window/2 to 0
2. expand gray value region to 0..max gray value
http://www.radpix.com/help/tool_wl.htm
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Spatial domain methods Spatial domain methods
http://www.vision.ee.ethz.ch/~pcattin/SIP/5-Enhancement.html
Advanced Medical Image Processing
Summary Summary
Where do we apply point-operations?
Everywhere, where only the local gray value has to be adapted y y g y
Better representation of information
Adapt one image to another
Thresholding when fast segmentation (real time) should be realized Thresholding when fast segmentation (real-time) should be realized.
Which is the key element for point operations?
The histogram. Whatever you discuss in point operations, first think
b h hi d l i i about the histogram and learn to interpret it.
What is the weakness of point-operations?
Its what the name says: it only uses local point information, not the y y p
neighborhood or more complex information in the image. Therefore, it
has only limited use. Sophisticated image analysis techniques use these
operators as background operators, not the main operators.
Advanced Medical Image Processing
Linear Filters Linear Filters
Advanced Medical Image Processing
Convolution Convolution
( f * ) k
1
f k
M1

( f * g)[k] =
1
M
f[k p]g[p]
p= 0

1 2 1

1 0 2
3
1 2 1

0 2 5
3 9
Advanced Medical Image Processing
Convolution Convolution
1 2 1
* * *
0 1 2 3 4 3 2 1 1 2 3

E
||
4 8 12 14 12 8 5 5 8
Advanced Medical Image Processing
Convolution in 2D Convolution in 2D
Advanced Medical Image Processing
Interpretation of Convolution Interpretation of Convolution
( )
M 1
2
p 0
error[k] f[k p] g[p]

=
=

( )
p 0
M 1
2 2
p 0
error[k] f [k p] g [p] 2f[k p]g[p]

= +

( ) ( )
( )
p 0
k M 1 M 1 M 1
2 2
error[k] f [p] g [p] 2 f[k p]g[p]
=
+
= +

( ) ( )
p k p 0 p 0
error[k] const 2(f *g)[k]
= = =
=
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Examples Examples
Low pass
blocks frequencies above a threshold
Amplitude
High pass
blocks frequencies below a threshold
Band pass Band pass
blocks frequencies outside a frequency band
Band blocking
Frequency
blocks frequencies inside frequency band
Advanced Medical Image Processing
Image Example Image Example
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Example Example
1 2 1
| |
Gaussian
1 2 1
1
2 4 2
16
| |
|
|
16
1 2 1
|
|
\ .
1
Edge filter
( )
1
1 1
2

2
Advanced Medical Image Processing
Derivative Filter Derivative Filter
The most simple derivative filter is obtained by the discrete derivative:
right side
( ) ( ) f x x f x + A
1 1
f(x) f(x+1)
right side
left side
0
( ) ( )
'( )
lim
x
f x x f x
f x
x
A
+ A
=
A
( ) ( )
'( )
lim
f x f x x
f x
x
A
=
A
1 1
1 1
f(x-1) f(x)
central
0 x
x
A
A
0
( ) ( )
'( )
2
lim
x
f x x f x x
f x
x
A
+ A A
=
A
1
1 0 1
2

the central difference scheme is obtained by applying left or right hand
derivative and then a smoothing filter of the following type
1
1 1
2
Advanced Medical Image Processing
Derivative Filter Derivative Filter
extended Sobel-Filter in 2D:
1 0 1 1 0 1
1
2 0 2
8
1 0 1

Filter in 3D
1 2 1
1
2 4 2
32
1 2 1 1 2 1
0 0 0
1
0 0 0
32
0 0 0
1 2 1
1
2 4 2
32
1 2 1


0 0 0
1 2 1
Advanced Medical Image Processing
Separable and Recursive Filters Separable and Recursive Filters
a filter H(x,y) is separable if it can be factorized in two filters H(x) applied
after filter H(y)
1 2 1 1
| | | |
( )
1 2 1 1
1 1 1
2 4 2 1 2 1 2
16 4 4
1 2 1 1
| | | |
| |
=
| |
| |
\ . \ .
1 2 1 1
| |
\ . \ .
a filter H(x) can be realized by a recursive filter G(x), if subsequent
application of G(x) on an image gives the same result as applying H(x) on
the image. g
Advanced Medical Image Processing
E l G i Example Gaussian
( ) ( ) ( )
1 1 1
1 2 1 1 1 1 1
4 2 2
=
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
(1 1)
(1 2 1)
0 0 0 0 1 2 1 0 0 0 0 0
0 0 0 0 1 1 0 0 0 0 0 0
0 0 0 1 2 1 0 0 0 0 0 0
(1 1)
(1 2 1)
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Chapt er 3 Chapt er 3
I mage Enhancement in t he
Spat ial Domain
I mage Enhancement in t he
Spat ial Domain
Advanced Medical Image Processing
Discussion Discussion
Problems
large filters should be realized in Fourier space: use convolution g
theorem
problems at boundary of image
boundary points are not transformed boundary points are not transformed
extrapolation of image
restriction of filter window
i di l i i f i l id b d periodical repetition of signal outside boundary
Advanced Medical Image Processing
Examples
Blood Cell Circular Replicate
Symmetric Zero Padding
Advanced Medical Image Processing
id t ll bl k
Circular Replicate
accidentally black
boundary
bl k b d black boundary
Symmetric Zero Padding
Advanced Medical Image Processing
Question Question
why cant we have a linear filter for denoising that keeps the sharp edges?
Advanced Medical Image Processing
Homework Homework
1: generate a 1D sine function and add Gaussian noise to it; apply the
Gaussian filter to it. Plot both the function and its denoised result.
2: take the cameraman image and apply a Gaussian filter with three
methods of boundary handling: circular, symmetric, zero-padding
http://www.math.ust.hk/~masyleung/Teaching/CAS/MATLAB/image/images/ca p y g g g g
meraman.jpg

You might also like