Initial Conditions:
The range of scale is very little.
Scaling will give good results in the range from approximately
0.95 to 1.15. Results can be seen in the figure below.
|
0.9 |
0.95 |
1 |
1.1 |
1.2 |
|
 |
 |
|
|
 |
|
# Iteration = 37 |
# Iteration = 43 |
# Iteration = 39 |
# Iteration = 55 |
# Iteration = 45 |
|
M = 0.8527 |
M = 0.9487 |
M=0.948 |
M=0.9487 |
M=0.639538 |
The range of
rotations is from approximately -10 to 10 degrees.
Although the metric is above 90% but the ellipse is not fitted well
in my opinion.
|
-12 |
-10 |
5 |
10 |
12 |
|
 
|
 |
 |
 |
 
|
|
# Iteration = 113 |
# Iteration = 44 |
# Iteration = 44 |
# Iteration = 46 |
# Iteration = 105 |
|
M=0.916 |
M=0.93 |
M=0.94487 |
M=0.9290 |
M=0.927 |
The range of
translations on the X-axis is was very large. It ranged from
approximately 40 to 160. Samples between x=35 and x=61 were also
tested but are not shown here.
|
X=35 |
X=61 |
X=101 |
X=121 |
X=141 |
X=162 |
|
 |
 |
 |
 |
 |
 |
|
# Iteration =112 |
# Iteration = 94 |
# Iteration = 51 |
# Iteration = 33 |
# Iteration = 61 |
# Iteration = 89 |
|
M=0.85 |
M=0.948874 |
M=0.948786 |
M=0.948798 |
M=0.948715 |
M=0.86 |
The range of
translations on the Y-axis is from approximately 52 to
185.
|
Y =50 |
Y=109 |
Y= 159 |
Y=184 |
Y=189 |
|
 |
 |
 |
 |
 |
|
# Iteration = 90 |
# Iteration = 59 |
# Iteration =54 |
# Iteration = 105 |
# Iteration= |
|
M=0.852 |
M=0.948779 |
M=0.9487 |
M=0.9488 |
M=0. 8606 |
Two sample outputs of the ones tested can be
seen here .One is close to the upper boundaries and the other is out
of lower boundaries.
|
[1,0,152,179] |
[0.9,5,39,50] |
|
 |
 |
|
# Iteration = 139 |
# Iteration = 131 |
|
M=0.93 |
M=0.85 |
Why the eclipse
stopped? The reason that the eclipse gets stuck is that it falls
in local minima (or maxima in this case). As can be seen from the
figures below, the eclipse is correctly fitted on one corner (or a
region) of the brain and skull. This is a local maxima. In order to
get out of it requires that it's metric decrease a significant
amount in order to "jump out" of the local maxima. In other word the
number of dark pixels will decrease and the white pixels will
increase, which will cause the metric value to decrease. But the
program will not do because it's maximizing, that that's why it gets
stuck.
Optimizers:
I used the OnePlusOneEvolutionary-Optimizer.
This Optimizer stimulates the biological evolution of a set of
samples in the search space.
Did the algorithm
reach convergence faster? No it didn't. It
took a lot more time for the metric value to reach a stable
condition. I had to limit the number of iterations of the optimizer
for the program to stop at some point. I am defining its performance
as its computation time and the final result together. If the inputs
initial conditions were within a good range .
Did the optimizer perform the same?
No, it performed differently in the range of
translations bounded before with the other optimizer. The range
became narrower. Two sample outputs can be seen below:
|
Translations |
[111,139] |
[51,129] |
|
New Optimizer |
 |
 |
|
M=0.77 |
M=0.67 |
|
Old Optimizer |
 |
 |
|
M=0.9487 |
M=0.948874 |
Bandwidth:
What happens to
the range of transformation parameters? I did not see an
increase in the range of initial transformations. This can be seen
in the table below. I tested a range of initial conditions near the
boundaries of the original condition and the results did not look
good. Below is a sample of the tested ranges.
|
[1,0,111,129] :
original range |
|
Bandwidth = 1 |
5 |
10 |
15 (original) |
20 |
25 |
|
 |
 |
 |
 |
 |
 |
|
# Iteration = 48 |
# Iteration = 46 |
# Iteration = 51 |
# Iteration = 39 |
# Iteration = 41 |
# Iteration = 37 |
|
M=0.9865 |
M=0.929 |
M=0.9472 |
M=0.948 |
M=0.9349 |
M=0.91 |
|
[1,12,162,189] : a
wider range with rotation |
|
 |
 |
 |
No Image! |
 |
 |
|
# Iteration = 105 |
# Iteration = 135 |
# Iteration = 285 |
# Iteration = 330 |
# Iteration = 85 |
# Iteration = 126 |
|
M=0.96 |
M=0.89 |
M=0.928 |
M=0.927 |
M=0.857 |
M=0.859 |
|
[0.9, 0, 35,50] : a
wider range with scale |
|
 |
 |
 |
 |
 |
 |
|
# Iteration = 223 |
# Iteration = 193 |
# Iteration = 139 |
# Iteration = 139 |
# Iteration = 140 |
# Iteration = 40 |
|
M=0.96 |
M=0.86 |
M=0.87 |
M=0.85 |
M=0.85 |
M=0.85 |
As the bandwidth
increases the number of iterations increases and decreases (this can
be seen in the graph below). But in general it has a decreasing
trend.

Also, the metric value of the changes in
bandwidth can also be seen below. As in the # of iterations, this
also increases and decreases. But it won't increase back to the high
metric value as in bandwidths 10 and 15.

This amount is not that significant in ideal
initial conditions. But in a wider range of transformations and
rotations, a major increase can be seen in the number of iterations.
The graph above shows a comparison of the original transformation
parameters compared to a wider range sample as the bandwidth
increase. Also, as the bandwidth increases the number of iterations
also increases. If the bandwidth is small the eclipse latches
on to the dark pixels at first. In other words the priority, is
latching to the darker pixels then to the white ones. This can be
seen in the images provided for this section.
Part 2:
Input : input image name Output: an output image
name
The program first
thresholds the image at intensity 100 using the
ThresholdImageFilter. The output of this image is another image
which basically keeps the pixels with intensities higher than 100
and throws the rest out. Then the program finds the bounding box
around the image. By having the bounding box, it is easy to compute
the scale and translation of the image, having the data of the
original image ( I compute everything relative to the center of the
bounding box) The output of the program (on the last line) states
the initial estimates as:
[scale,rotation,x_translation,y_translatin]
Giving these initial
conditions to the reg.exe program will cause the eclipse to initial
start at a very good position and scale. The source code can be
found in the directory named Part2. The program is called
estimate.cxx and the relative CMakeLists.txt is provided for
convenience. The program prints
out correct initial conditions as far as I have tested and should
cause no problem. Below are the results of the program on the images
provided.
|
|
Scaled image |
Translated image |
Scaled and translated
image |
|
Eclipse fitted correctly |
 |
No Image
See note below |
 |
|
# of iterations |
44 |
45 |
29 |
|
Metric Value |
0.953 |
0.946 |
0.91 |
|
Output of estimate.exe |
[1.19,0,132.5,158] |
[1,0,165.5,182] |
[0.6,0,96.5,109.5] |
Note:
The resulting image for the translated image would suddenly
disappear at the last iteration, but I could see the eclipse fitted
correctly through the run. I couldn't get a snapshot while the
program was running.
Part 3:
The program starts off the hierarchical fitting
with sigma=15. With sigma=25, my computer executed very very slowly
towards the end and I couldn't see the actual images. So my program
starts with sigma=15 and at each level decreases sigma by step=2.
Note that the brain images on the display screen are not seen
as smoothed differently. I did not change the display image
but the registration does it's computation on the newly less blurred
image and all computations are right. Also, while running
the program in order to go to the next level you must press "q"
in order to finish the previous level.
|
Level 0 |
Level 1 |
Level 2 |
Level 3 |
Level 4 |
|
 |
 |
 |
 |
 |
|
Sigma = 15 |
Sigma = 12 |
| |