[Insight-users] no. of iterations in 3D registration...

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 19 18:39:04 EDT 2006


   Hi Shahab

  Thanks for posting the trace of the registration.

  You are right, the plot indicates that the metric value is increasing
  monotonically after iteration # 21.

  One possible explanation is that the two images are reducing their
  region of overlap and as a result the number of pixels considered for
  the mean are diminishing. Since the mean square value is computed by
  adding the squared differences of intensity on the pixels in the
  overlapping region and then dividing this value by the number of
  pixels, your images may be in a situation where the number of pixels
  in the overlapping region diminishes faster than the differences in
  intensities of the remaining pixels.

  For example, if the most similar pixels are in the region that is
  moving out of the overlap, then the value of the Metric will increase.

  Since the value of the metric derivative used by the optimizer is
  computed using a rule chain that composes the Image gradient with
  the Jacobian of the transform, this derivative cannot anticipate
  the losses in value that can arise from the reduction in the region
  overlap.


  If you want to check if this is what is happening in your case, you
  may want to resample the moving image using several of the intermediate
  transform. That should illustrate whether there is a progressive
  reduction of overlap or not.

  Another alternative is to modify the code of the MeansSquared metric
  and print out the values of the m_NumberOfPixelCounted variable in
  line 107 of the file


            Insight/Code/Algorithms/
                     itkMeanSquaresImageToImageMetric.txx



   Please let us know what you find,


     Thanks



        Luis




---------------------------
Shahabuddin Ansari wrote:
> Hi Luis,
>  
> Here is a file with metric values which is shows minimum value at 21 
> iteration and the value increases after that. I have also attached a bar 
> plot.
>  
> Thanks!
> Shahab
> 
> */Luis Ibanez <luis.ibanez at kitware.com>/* wrote:
> 
>     Hi Shahab,
> 
>     As long as you set up the optimizer to minimize, the metric should
>     never increase for more than one consecutive iteration. That is,
>     the metric can increase, but then it should decrease in the next
>     iteration.
> 
>     There is a very very small chance that a metric can increase in
>     two consecutive iterations, but it requires a convoluted configuration
>     of the cost function.
> 
>     Can you post a plot of the metric values versus iteration number,
>     just as it is done in the ITK Software Guide examples ?
> 
>     http://www.itk.org/ItkSoftwareGuide.pdf
> 
>     How many iterations to use depends on what kind of optimizer you
>     are using and how large you define the step length (or its equivalent).
> 
>     You may want to look at the tutorial on image registration:
> 
>     at
> 
>     http://www.itk.org/HTML/Tutorials.htm
> 
>     more specifically at
> 
> 
>     http://www.itk.org/CourseWare/Training/RegistrationMethodsOverview.pdf
> 
> 
>     The effect and step length versus number of iterations is also
>     discussed in the Image Registration chapter of the Software Guide.
> 
> 
> 
>     Regards
> 
> 
> 
>     Luis
> 
> 
> 
>     --------------------------
>     Shahabuddin Ansari wrote:
>      > Hello,
>      >
>      > In 3D rigid registration, I am using versor transform, mean square
>      > metric, and linear interpolator. The observation of the final
>     parameters
>      > shows that the metric value first decreases to a minimum and then
>     start
>      > back to increase. In my understanding, it should fluctuate around
>     the
>      > optimal value even the number of iterations are much higher (say
>     200)
>      > then the required. Please commnets (say 50).
>      >
>      > Thanks
>      > Shahab
>      >
> 
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Get on board. You're invited 
> <http://us.rd.yahoo.com/evt=40791/*http://advision.webevents.yahoo.com/handraisers> 
> to try the new Yahoo! Mail Beta.
> 
> 
> ------------------------------------------------------------------------
> 
> 0   10.3625   [0.0116014, -0.0121918, -0.00119096, -5.53783, -1.69604, 34.6841]
> 1   9.43044   [0.0142705, -0.0149614, -0.00075948, -5.47409, -1.68816, 34.7604]
> 2   9.08288   [0.0197749, -0.020453, 0.000546233, -5.50516, -1.75605, 34.825]
> 3   8.6876   [0.024133, -0.0246097, 0.00181044, -5.54592, -1.8337, 34.8715]
> 4   8.44593   [0.0291476, -0.0292486, 0.00368393, -5.55688, -1.91795, 34.9223]
> 5   8.17038   [0.0340221, -0.033975, 0.00649374, -5.5521, -2.01453, 34.9431]
> 6   7.94953   [0.0387475, -0.0386374, 0.00943417, -5.53806, -2.11229, 34.9489]
> 7   7.81131   [0.0429937, -0.0428648, 0.0124496, -5.50974, -2.20721, 34.9517]
> 8   7.64994   [0.0465968, -0.0467885, 0.0157736, -5.47853, -2.29856, 34.9746]
> 9   7.46259   [0.0496968, -0.0504194, 0.0191875, -5.48558, -2.39731, 34.9824]
> 10   7.3135   [0.0526003, -0.0539412, 0.0227939, -5.4673, -2.48019, 35.0339]
> 11   7.18132   [0.0554592, -0.0573873, 0.0264653, -5.48914, -2.57141, 35.0666]
> 12   7.07142   [0.0588068, -0.0613971, 0.0304487, -5.47739, -2.64026, 35.1369]
> 13   6.9831   [0.0604194, -0.0638975, 0.0334511, -5.53973, -2.71303, 35.1096]
> 14   6.95113   [0.0612151, -0.0650397, 0.0345792, -5.51213, -2.71344, 35.1512]
> 15   6.9246   [0.0628079, -0.0676599, 0.0376449, -5.52272, -2.75991, 35.1635]
> 16   6.88858   [0.0640724, -0.0700817, 0.0402461, -5.53753, -2.78742, 35.2018]
> 17   6.85836   [0.0655111, -0.0731247, 0.0433751, -5.56839, -2.82564, 35.2006]
> 18   6.82762   [0.0657304, -0.0737694, 0.0439233, -5.55468, -2.82201, 35.2211]
> 19   6.82238   [0.0664223, -0.075996, 0.0458322, -5.56664, -2.83684, 35.2361]
> 20   6.81175   [0.0667947, -0.0780956, 0.0477564, -5.57365, -2.85359, 35.2523]
> 21   6.80733   [0.0673218, -0.081488, 0.0504472, -5.57194, -2.86487, 35.2728]
> 22   6.8088   [0.0672279, -0.0830072, 0.0516494, -5.55811, -2.88338, 35.2815]
> 23   6.82145   [0.0670265, -0.0848149, 0.053037, -5.56516, -2.90688, 35.2827]
> 24   6.82849   [0.0670301, -0.085266, 0.0532306, -5.55642, -2.90414, 35.2912]
> 25   6.83385   [0.0669098, -0.0858925, 0.0536103, -5.56104, -2.90808, 35.2912]
> 26   6.83579   [0.0668779, -0.0861116, 0.0537179, -5.55881, -2.90855, 35.2932]
> 27   6.83784   [0.0667967, -0.0865719, 0.0539564, -5.55817, -2.9107, 35.2951]
> 28   6.84077   [0.0666992, -0.0869733, 0.0541589, -5.55951, -2.91337, 35.2952]
> 29   6.84251   [0.0666722, -0.0870927, 0.0542117, -5.55846, -2.91342, 35.2963]
> 30   6.84368   [0.0666408, -0.0872204, 0.0542759, -5.55734, -2.91362, 35.2973]
> 31   6.84502   [0.0665984, -0.0873695, 0.0543505, -5.55673, -2.91377, 35.2987]
> 32   6.84653   [0.0665179, -0.0877018, 0.0545204, -5.55666, -2.91463, 35.2998]
> 33   6.84887   [0.0663911, -0.088031, 0.0546932, -5.55705, -2.91539, 35.3008]
> 34   6.85152   [0.0662896, -0.0882988, 0.0548364, -5.5568, -2.91568, 35.3022]
> 35   6.85411   [0.0662639, -0.0883712, 0.0548741, -5.55749, -2.91597, 35.3021]
> 36   6.85436   [0.0662095, -0.0885331, 0.0549547, -5.558, -2.91635, 35.3023]
> 37   6.85543   [0.0661616, -0.088729, 0.0550393, -5.55828, -2.91692, 35.3022]
> 38   6.85627   [0.0661117, -0.0889572, 0.0551376, -5.55804, -2.91733, 35.3019]
> 39   6.85733   [0.0660411, -0.0892009, 0.0552505, -5.55762, -2.91767, 35.302]
> 40   6.8589   [0.065991, -0.0894075, 0.0553395, -5.55705, -2.91785, 35.3018]
> 41   6.85991   [0.0659747, -0.0894821, 0.0553708, -5.55729, -2.9181, 35.3018]
> 42   6.86015   [0.0659563, -0.089563, 0.0554047, -5.55749, -2.91836, 35.302]
> 43   6.86046   [0.065939, -0.0896352, 0.0554353, -5.55762, -2.91858, 35.3022]
> 44   6.86084   [0.0659212, -0.0897091, 0.0554667, -5.55776, -2.91879, 35.3025]
> 45   6.86119   [0.0659031, -0.0897823, 0.0554983, -5.55795, -2.91897, 35.3027]
> 46   6.86155   [0.0658818, -0.0898583, 0.0555357, -5.55806, -2.91918, 35.303]
> 47   6.86203   [0.0658668, -0.089923, 0.0555631, -5.55827, -2.91947, 35.3029]
> 48   6.86226   [0.0658463, -0.0900099, 0.0556003, -5.55837, -2.91976, 35.303]
> 49   6.86267   [0.0658282, -0.0900802, 0.0556309, -5.55838, -2.91994, 35.3034]
> 50   6.86311   [0.0658182, -0.0901245, 0.0556491, -5.55809, -2.92, 35.3036]
> 51   6.86345   [0.065804, -0.0901852, 0.0556745, -5.55784, -2.92013, 35.3038]
> 52   6.86389   [0.0657893, -0.0902505, 0.0557012, -5.55754, -2.92022, 35.304]
> 53   6.86432   [0.0657731, -0.0903197, 0.0557295, -5.5572, -2.92028, 35.3041]
> 54   6.86476   [0.0657473, -0.0904274, 0.0557742, -5.55695, -2.92047, 35.3041]
> 55   6.86529   [0.0657213, -0.0904991, 0.0558167, -5.55672, -2.92057, 35.3043]
> 56   6.86595   [0.0656845, -0.0906037, 0.0558661, -5.5569, -2.92066, 35.3045]
> 57   6.86662   [0.0656552, -0.0907013, 0.0559104, -5.55717, -2.92077, 35.3044]
> 58   6.86703   [0.0656129, -0.0908557, 0.0559799, -5.55733, -2.92076, 35.3045]
> 59   6.86779   [0.0656088, -0.0908725, 0.0559874, -5.55718, -2.92071, 35.3046]
> 60   6.86795   [0.0656038, -0.090892, 0.0559962, -5.55703, -2.92066, 35.3047]
> 61   6.86813   [0.0655979, -0.0909152, 0.0560067, -5.55688, -2.92061, 35.3048]
> 62   6.86831   [0.0655911, -0.0909395, 0.056018, -5.55671, -2.92059, 35.3049]
> 63   6.86851   [0.0655827, -0.0909694, 0.0560319, -5.55655, -2.92058, 35.305]
> 64   6.86875   [0.0655718, -0.0910078, 0.0560498, -5.55639, -2.92057, 35.305]
> 65   6.86902   [0.0655571, -0.0910587, 0.0560736, -5.55626, -2.92058, 35.3051]
> 
> 
> Result = 
>  versor X      = 0.0655571
>  versor Y      = -0.0910587
>  versor Z      = 0.0560736
>  Translation X = -5.55626
>  Translation Y = -2.92058
>  Translation Z = 35.3051
>  Iterations    = 67
>  Metric value  = 6.86939
> Matrix = 
> 0.977128 -0.123201 -0.173327
> 0.0993224 0.985116 -0.140291
> 0.188031 0.119867 0.974821
> 
> Offset = 
> [29.9226, 3.53938, 4.31631]




More information about the Insight-users mailing list