[Insight-users] NMI registration with 1+1 optimizer

Martin Kavec kavec at messi.uku.fi
Sun Nov 28 11:10:49 EST 2004


Hi Luis,

here are further facts of what I am trying to do and where are I am stucked.

I am trying to modify Insight/MultiResMIRegistration to use NMI and OnePlusOne 
optimizer. I am keeping the QuaternionRigidTransform so I assume that I don't 
need to change the scaling factors. I have added observer to the optimizer in 
order to follow the metric evolution.

1) First I changed the metric type to NMI. To initialize it I followed the 
ImageRegistration14.cxx. To test the changes I took high-res T1-weighted MRI 
volume and rotated it 15 degrees in one direction. The output of a 
registration against the original images is following:

Parsing input ...
Fixed image filename: /home/kavec/tmp2/3DNEURO_GD_susan.img
Moving image filename: /home/kavec/tmp2/3DNEURO_GD_susan_rot.img
Permute order: [0, 1, 2]
Flip axes: [0, 0, 0]
Number of levels: 1
Fixed image shrink factors: [4, 4, 4]
Moving image shrink factors: [4, 4, 4]
Number of iterations: [20]
Learning rates: [0.005]
Translation scale: 320
Output filename: /home/kavec/tmp2/3DNEURO_GD_susan_rot_reg.img

Preprocess the images ...
Register the images ...
--- Starting level 0
 No. Iterations: 20 Current value: 0
0   1.16376
[0, 0, 0, 1, 0, 0, 0]
1   1.15109
[2.00355e-05, -0.000194882, -0.00387964, 0.999992, 2.04491, 0.759097, 
-7.48209]
2   1.15341
[0.000128222, -0.000168419, -0.00615945, 0.999981, 2.15908, -0.274014, 
-4.94712]
3   1.15736
[0.000294666, -0.000167528, -0.00887232, 0.999961, 3.46509, -1.44306, 
-3.68314]
4   1.16313
[0.000556291, -0.000101493, -0.0113941, 0.999935, 2.45217, -0.874409, 
-2.42517]
5   1.17055
[0.000736198, -0.000113161, -0.0148656, 0.999889, 2.9343, -0.727809, 
-0.961827]
6   1.17491
[0.000819465, -7.17486e-05, -0.0183074, 0.999832, 3.98991, -0.500121, 
-0.314646]
7   1.16593
[0.000828552, 7.52223e-05, -0.020896, 0.999781, 3.97314, -2.3145, 0.514109]
8   1.17186
[0.000958205, 0.000193753, -0.0232702, 0.999729, 3.26224, -1.17835, 0.0787589]
9   1.15425
[0.0010143, 0.000264836, -0.0262866, 0.999654, 3.39155, 0.226649, -8.89707]
10   1.16168
[0.00124538, 0.000398716, -0.0281219, 0.999604, 3.12542, 0.801431, -7.11111]
11   1.16591
[0.0014234, 0.00052982, -0.0302605, 0.999541, 3.28675, 0.73186, -4.67347]
12   1.17052
[0.00155745, 0.000673006, -0.0326304, 0.999466, 3.96795, -0.058945, -4.05769]
13   1.18623
[0.00175145, 0.000879842, -0.0347695, 0.999393, 3.41615, -0.715412, -0.710667]
14   1.18093
[0.00180792, 0.00101883, -0.0374603, 0.999296, 3.93852, -1.65684, 0.69779]
15   1.18678
[0.00185122, 0.00120244, -0.0397498, 0.999207, 3.60538, 0.14652, 0.00996287]
16   1.18175
[0.00174593, 0.00138008, -0.0423217, 0.999102, 3.80113, -1.18768, -2.84601]
17   1.19244
[0.00200944, 0.00157639, -0.0444541, 0.999008, 3.24901, -0.464544, -0.310266]
18   1.19548
[0.0020072, 0.00170865, -0.0470883, 0.998887, 3.45087, -0.327987, -1.17933]
19   1.19584
[0.00205367, 0.0018991, -0.0494666, 0.998772, 3.92187, 0.158131, 0.171035]
Final parameters: [0.00193741, 0.00217824, -0.0516142, 0.998663, 2.9816, 
-0.0946545, -1.75138]
Overall transform matrix:
0.994662 0.103099 0.00415066
-0.103082 0.994664 -0.0040945
-0.00455066 0.00364479 0.999983

Overall transform offset:
[-9.53886, 13.7479, -1.63716]
Generating output ...

So it seems to to work, though woukd need further parameter adjustments.

2) In the second step I changed the optimizer and initialized it as shown in 
the ImageRegistration14.cxx.  Now on the same two input volumes the 
registration proceeds/stops as follows:

Parsing input ...
Fixed image filename: /home/kavec/tmp2/3DNEURO_GD_susan.img
Moving image filename: /home/kavec/tmp2/3DNEURO_GD_susan.img
Permute order: [0, 1, 2]
Flip axes: [0, 0, 0]
Number of levels: 1
Fixed image shrink factors: [1, 1, 1]
Moving image shrink factors: [1, 1, 1]
Number of iterations: [5]
Learning rates: [0.005]
Translation scale: 320
Output filename: /home/kavec/tmp2/3DNEURO_GD_susan_rot_reg.img

Preprocess the images ...
Register the images ...
--- Starting level 0
 No. Iterations: 0 Current value: 0
Caught an exception:

itk::ExceptionObject (0x810eef8)
Location: "Unknown"
File: /opt/include/InsightToolkit/Algorithms/itkHistogramImageToImageMetric.txx
Line: 255
Description: itk::ERROR: 
NormalizedMutualInformationHistogramImageToImageMetric(0x81003f0): All the 
points mapped to outside of the moving image

Interestingly, there seems to be some interation going on because it takes 
approximately 10 to throw the exception. I checked the code several times and 
also read recent post to the mailing list, where people (Christos Panagiotou 
and Denis Nikitenko) tried to use 1+1 optimizer in registration applications, 
however I haven't found help there either.

I would appreciate a lot your comments. Thanks in advance.

Martin


More information about the Insight-users mailing list