Title: Medical Image Processing
1Medical Image Processing
- By Andy Haas
- Advisor Dr. Steven Damelin
2Problem
- The specific problem this project deals with is
finding nerve clusters in an ultrasound image. - Variation of patient anatomies may create
difficulties for the clinician when trying to
locate nerves and nerve clusters.
3Purpose
- Create software that accurately identifies nerves
in an ultrasound image.
4Dealing with Texture
- To create software that identifies nerves, we
assume that nerves have a unique texture. - To the untrained eye, an ultrasound image has
very few discernable features. - Using MatLab, we can essentially zoom in on an
image and look at the grayscale value of every
pixel to see if there are patterns that arise
from the Regions-of-Interest. - Regions-of-Interest or ROI are the areas that a
clinician identifies as nerve clusters.
5Process
- Collect Samples and get clinicians to identify
ROI - Extract ROI using MatLab
- Break ROI into smaller patches
- Find statistical measures of patches that will
define the texture of nerve clusters - Detect nerve clusters in unmarked images by
breaking up an entire unmarked image into
patches, find the statistical measures of those
patches, and mark the ones that resemble the
patches from our ROIs.
6Process
- Collect samples and have an expert clinician
manually identify the nerve clusters, or ROI.
7Process
- Extraction of Region-of-Interest.
- How does MatLab process images?
- There is a command in MatLab imread(NameOfImage
) that allows us to break down an entire image
into an (m x n x 3) matrix, where m and n is the
resolution of the image. The 3rd dimension
represents the three RGB values. ( Red / Green /
Blue ) - In this case, the image we are looking at is
called 20060726_orbach6_ax1.tiff - and is a 379 by 476 pixel image.
- So if we type
- Imgimread('20060726_orbach6_ax1.tiff')
- into MatLab, we get a 379 by 476 by 3 matrix
called Img, where the range of the values are
from 0 to 255.
8Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
9Process
- Extraction of Regions-of-Interest.
- The Contour is the boundary of the ROI.
- In the Img, the ROI is marked by a very
specific yellow. The RGB value of this yellow is
(251, 225, 1). To create the Contour, we make a
new zero-matrix the same size as Img,
(379,476). We then make an If statement that
places a 1 in all the matrix entries that have
RGB values equal to (251, 225, 1).
Contour
10Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
ROI
11Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
1st Dilation
12Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
1-194-417-7
1-194-417-7
9th Dilation
13Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
20th Dilation
14Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
31st Dilation
15Process
- Extraction of Regions-of-Interest.
- Get the contour.
- Insert Seeds.
- Dilate the seeds repeatedly, negating the parts
of the new dilation that overlap with the
contour. Repeat dilations until the last
dilation is the same as the previous dilation.
62nd Dilation
16Process
- Break ROI into smaller patches
- Now MatLab has a map that tells it where the
nerve clusters are in our image. Remember this
is still in a marked image so we arent close to
solving the problem yet. - Convert the whole image to grayscale so we arent
dealing with the 3rd dimension, RGB, anymore.
This is done by taking the mean of the three RGB
values. - In this project, we are using 5x5 patches, which
means we are looking at a box of 25 pixels. - For this particular image, there are 2,911 5x5
different patches we can fit within the ROI. - We now have a (5x5x2,911) array of grayscale
patches.
17Process
- Break ROI into smaller patches
18Process
How do we define texture using statistical
measures?
19Process
- Find Statistical Measures of Patches
- A GLCM is a matrix that is calculated by how
often a pixel with grayscale value i occurs
horizontally adjacent to a pixel with value j.
20Process
- Find Statistical Measures of Patches
- A Gray level Co-Occurrence Matrix (GLCM)
- is a matrix that is calculated by how often a
pixel with grayscale value i occurs horizontally
adjacent to a pixel with grayscale value j. - The range of the image is scaled from
- 0 255 to 1 8
Patch
Scaled Patch
21Process
- Find Statistical Measures of Patches
- Example Find the GLCM of the patch.
Patch
Scaled Patch
22Process
- Find Statistical Measures of Patches
- Properties of GLCMs to note
- The entries in the diagonal represent no change
from one pixel to the next. - As you move farther from the diagonal, it
indicates greater contrast. - The most contrast are those in the top right and
bottom left corners of the GLCM entries (1,8)
and (8,1).
23Process
- Find Statistical Measures of Patches
- Gray Co-Props is a tool used for evaluating a
GLCM. It is comprised of four properties
contrast, correlation, energy, and homogeneity. - The value of these four properties describes the
GLCM, and in turn, our ROI. - To find these four properties, first turn all
the elements of the GLCM into probabilities so
that the sum of its elements is equal to 1.
24Process
- Find Statistical Measures of Patches
- i represents the GLCM row
- j represents the GLCM column
- p(i,j) represents the probability of the i,j
entry
Contrast
Energy
Correlation
Homogeneity
25Process
- Find Statistical Measures of Patches
- Contrast returns a measure of the intensity
contrast between a pixel and its neighbor over
the whole patch.
Range 0 (size(GLCM,1)-1)2 Contrast is 0
for a constant image. A patch that goes from 1
to 8 and 8 to 1 repeatedly will have the maximum
contrast.
26Process
- Find Statistical Measures of Patches
- Correlation Returns a measure of how correlated
a pixel is to its neighbor over the whole patch.
Range -1 1 Correlation is 1 for a perfectly
positively correlated image. Correlation is -1
for a perfectly negatively correlated image.
Correlation is NaN for a constant image.
27Process
- Find Statistical Measures of Patches
- Energy Returns the sum of squared elements in
the GLCM.
Range 0 1 Energy is 1 for a constant
image. As energy gets closer to zero, it
indicates an increase of change from one pixel to
the next.
28Process
- Find Statistical Measures of Patches
- Homogeneity Returns a value that measure the
closeness of the distribution of elements in the
GLCM to the GLCM diagonal.
Range 0 1 Homogeneity is 1 for a diagonal
GLCM. Homogeneity is a measure of smoothness.
29Process
- Example Find the co-props
GLCM sum of elements equals 1
1 2 3 4 5 6 7 8
GLCM
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
30Process
- Find Statistical Measures of Patches
- Contrast returns a measure of the intensity
contrast between a pixel and its neighbor over
the whole patch.
Range 0 (size(GLCM,1)-1)2 Contrast is 0
for a constant image. A patch that goes from 1
to 8 and 8 to 1 repeatedly will have the maximum
contrast.
31Process
- Find Statistical Measures of Patches
- Contrast returns a measure of the intensity
contrast between a pixel and its neighbor over
the whole patch.
7/4 or 1.75
32Process
- Find Statistical Measures of Patches
- Energy Returns the sum of squared elements in
the GLCM.
Range 0 1 Energy is 1 for a constant
image. As energy gets closer to zero, it
indicates an increase of change from one pixel to
the next.
33Process
- Find Statistical Measures of Patches
- Energy Returns the sum of squared elements in
the GLCM.
38/400 Or .095
34Process
- Find Statistical Measures of Patches
- Homogeneity Returns a value that measure the
closeness of the distribution of elements in the
GLCM to the GLCM diagonal.
Range 0 1 Homogeneity is 1 for a diagonal
GLCM. Homogeneity is a measure of smoothness.
35Process
- Find Statistical Measures of Patches
- Homogeneity Returns a value that measure the
closeness of the distribution of elements in the
GLCM to the GLCM diagonal.
143/240 Or .5958