Image Analysis The Basics Dr Steve Barre6 April 2016 Image Analysis The Basics PHYS871 Clinical Imaging ApplicaBons
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 1
Image Analysis The Basics
Dr Steve Barre6 April 2016
Image Analysis The Basics
PHYS871 Clinical Imaging ApplicaBons
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 2
IntroducBon
Image Processing
Image Analysis
Kernel Filters Rank Filters
Fourier Techniques Par4cle Analysis
Fourier Filters
Specialist Solu4ons
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 3
Image Display
/ Image Display
An image is a 2-‐dimensional collec4on of pixel values that can be displayed or printed by assigning a shade of grey (or colour) to every pixel value.
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 4
Image Display An image is a 2-‐dimensional collec4on of pixel values that can be displayed or printed by assigning a shade of grey (or colour) to every pixel value.
/ Image Display
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 5
SpaBal CalibraBon For image analysis to produce meaningful results, the spa4al calibra4on of the image must be known. If the data acquisi4on parameters can be read from the image (or parameter) file then the spa4al calibra4on of the image can be determined.
For simplicity and clarity, spa4al calibra4on will not be indicated on subsequent images.
/ Image Display / Calibra4on
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 6
SPM Image Display With Scanning Probe Microscope images there is no guarantee that the sample surface is level (so that the z values of the image are, on average, the same across the image).
Raw image data A[er compensa4ng for 4lt
/ SPM Image Display
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 7
SPM Image Display By trea4ng each scan line of an SPM image independently, anomalous jumps in the apparent height of the image (produced, for example, in STMs by abrupt changes in the tunnelling condi4ons) can be corrected for.
Raw image Compensated for 4lt Line-‐by-‐line compensa4on
/ SPM Image Display
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 8
Image Processing Image processing means changing all or some of the pixel values in an image, usually with the aim of making some feature(s) of the image more easily ‘visible’.
The most trivial example would include changing the colour used to represent each pixel value — the look-‐up table (LUT).
default greyscale increased contrast
/ Image Processing / LUT
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 9
Image Processing The LUT does not have to be a linear, or even monotonic. A non-‐linear mapping between pixel value and displayed colour can o[en reveal unexpected detail in the image.
default greyscale zebra greyscale
/ Image Processing / LUT
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 10
Image Processing Changing the LUT is reversible, as it is only the mapping between pixel values and display colours that is changed.
Taking a differen4al – replacing each pixel with the value of the local differen4al of the surface with respect to some direc4on – is irreversible in the sense that integra4ng doesn’t (necessarily) get you your original image back.
greys → z values greys → ∂z/∂x values
/ Image Processing
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 11
Kernel Filters Processing is o[en carried out using a kernel filter which uses an n x n matrix of numbers. The kernel matrix is applied to every pixel in an image in turn.
The elements of the kernel matrix are mul4plica4on values that are applied to a target pixel and its neighbouring pixels. The target pixel is replaced with the normalised sum of these products, and then the process is repeated for the next (overlapping) set of pixels.
1 1 1
1 1 1
1 1 1
Central value in matrix aligned with target pixel
1 1 1
1 1 1
1 1 1
/ Image Processing / Kernel Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 12
Kernel Filters The simplest kernel filters use 3 x 3 matrices...
1 1 1
1 4 1
1 1 1
smooth
-‐1 -‐1 -‐1
-‐1 9 -‐1
-‐1 -‐1 -‐ 1
sharpen
-‐2 -‐1 0
-‐1 0 1
0 1 2
gradient
original image
/ Image Processing / Kernel Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 13
Kernel Filters An edge detec4on filter (or Sobel filter) does exactly what it says it does.
original image Sobel filtered
[ Note that the image was pre-‐processed so that the filter picked out the islands clearly. Also, the filtered image had the contrast increased and the background grey filled in. ]
/ Image Processing / Kernel Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 14
Rank Filters Processing using a rank filter uses the same idea of an n x n neighbourhood of pixel values, but without the matrix of numbers used with kernel filters.
1 2 3 4 5 6 7 8 9
/ Image Processing / Rank Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 15
Rank Filters Rank filters can be used to remove isolated pixels that are significantly brighter or darker than their neighbours. A median filter can be a very effec4ve noise reduc4on filter.
image + ar4ficial noise median filtered
/ Image Processing / Rank Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 16
Fourier Filters Processing using Fourier filters involves calcula4on of the image’s frequency components.
IFFT
FFT
/ Image Processing / Fourier Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 17
Fourier Filters Here’s an easy way to ‘clean’ a surface.
original image Fourier filtered
/ Image Processing / Fourier Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 18
Fourier Filters Even when the signal–to–noise ra4o is lousy, Fourier filtering can extract the signal.
original image
signal
noise
/ Image Processing / Fourier Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 19
Fourier Filters Fourier filters can be even more powerful if the symmetry of the surface is exploited.
FFT
IFFT Select Fourier components with 10 -‐ fold symmetry
/ Image Processing / Fourier Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 20
Fourier Filters Although features lacking 10 -‐ fold rota4onal symmetry (such as the randomly dispersed contamina4on) have been effec4vely removed from the image, the correspondence between the original image and the Fourier filtered image can s4ll be seen.
original image Fourier filtered
/ Image Processing / Fourier Filters
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 21
Image Analysis Image analysis means extrac4ng quan4ta4ve informa4on that is derived from the pixel values in an image.
Rather than being used as an intermediate step in image processing, the FFT can be a valuable source of quan4ta4ve informa4on.
original image Fourier transform strongest components
The FFT maxima occur at a spa4al frequency of 2.33 per µm (→ period = 0.43 µm).
/ Image Analysis
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 22
ParBcle Analysis The name par4cle analysis should not be taken too literally. The ‘par4cles’ can be any features that can be separated from the background by thresholding.
original image thresholded
Note that an image may require pre-‐processing to ensure that the intensity (height) of features of interest are above a threshold and all ‘background clumer’ is below.
/ Par4cle Analysis
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 23
Thresholding Thresholding will not work effec4vely if the features of interest are on a varying background.
Senng the threshold at the appropriate level may require some care.
/ Par4cle Analysis / Thresholding
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 24
ParBcle Analysis
Mean nearest neighbour distance = 13 ± 5 nm Nearest neighbour lies in azimuthal direc4on 83° (anisotropy = 0.19)
... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ...
Size Area Height
/ Par4cle Analysis
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 25
Specialist Analysis When “seeing the wood for the trees”, or in this case the adsorbate for the substrate, computers can find the task much harder than an eye/brain combina4on.
The property of the DNA strands that allows them to be separated from the background clumer is their curvature (the second differen4al of height wrt transverse distance).
/ Specialist Analysis / Enhancing DNA
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 26
Specialist Analysis
0.25
1.18
Can the extent of ‘entanglement’ be quan4fied?
/ Specialist Analysis / Enhancing DNA
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 27
Image Analysis If you'd like to know more about the principles behind digital image processing and image analysis, or maybe you want to get your teeth into some of the maths, then try…
/ Further Reading
The examples used have been drawn from the field of earth sciences rather than medical sciences, but the same principles apply.
ISBN: 978-‐3-‐642-‐10342-‐1 DOI: 10.1007/978-‐3-‐642-‐10343-‐8 eBook: hmp://link.springer.com.ezproxy.liv.ac.uk/book/10.1007/978-‐3-‐642-‐10343-‐8
PHYS871 Clinical Imaging Applica4ons / Image Analysis — The Basics 28
Acknowledgements
Johanne Holly Meningitis Fund
Liverpool School of Tropical Medicine
Caltech Czech Academy of Sciences Washington State University University of Würzburg
Thanks to
for use of their SEM, SFM and STM images and to
for supporting image analysis projects