Hi again,<br><br>I've changed my code using RegularStepGradientDescentOptimizer instead of LBFGSBOptimizer.<br><br>Using brain phantom volume, I had good visual results (the moving image is transformed looking like fixed image) with LBFGSBOptimizer, and the final value of the metric was -0.836697.<br>
<br>Starting Registration<br>0 -0.580566 0 0<br>0 -0.580643 0 0<br>0 -0.583835 0 0<br>0 -0.583835 0.000114794 0<br>1 -0.598343 0.000114794 0<br>1 -0.598343 7.34998e-05 0<br>2 -0.617556 7.34998e-05 0<br>
2 -0.617556 0.000133695 0<br>(...)<br>83 -0.836697 0.000103487 0<br>83 -0.836697 0.000103487 0<br>83 -0.836686 0.000103487 0<br>83 -0.836697 0.000103487 0<br>83 -0.836697 0.000103487 0<br>83 -0.836686 0.000103487 0<br>
83 -0.836697 0.000103487 0<br>83 -0.836697 0.000103487 0<br><br>On the other hand, using RegularStepGradientDescentOptimizer the final value of the metric with 800 iterations is -0.638617 and the resampled image is not good and only is deformed in their first and last slices. With MRI prostate volume I had the same problem: the transformation only deforms the first and the last slice of the volume.<br>
<br> Starting Registration<br>0 -0.580566 <br>1 -0.57976 <br>2 -0.579975 <br>3 -0.579813 <br>4 -0.580218 <br>5 -0.580442 <br>(...)<br>793 -0.637725 <br>794 -0.637952 <br>795 -0.637915 <br>796 -0.637942 <br>
797 -0.638316 <br>798 -0.637498 <br>799 -0.638617 <br><br>I've set the stepLength of the optimizer but I haven't achieved better metric values progress in each step of the registration. Also, I don't understand why the output image only is transformed in the first and the last slice.<br>
<br>So, having in consideration that with LBFGSBOptimizer I have good results registering the brain phantom volume, I would like to know how can I tune this optimizer in order to work with MRI prostate images.<br><br>If we need more information about my code, don't doubt to ask me.<br>
<br>Thanks.<br><br>Albert<br><br><div class="gmail_quote">2009/5/12 Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Albert,<br>
<br>
It turned out in practice that the LBFGSBOptimizer is not as superior<br>
as it may have been assumed.<br>
<br>
Lately we have simply used the RegularStepGradientDescentOptimizer<br>
with reasonable results.<br>
<br>
See for example:<br>
<br>
Insight/Examples/Registration/DeformableRegistration15.cxx<br>
<br>
In general,<br>
any claims saying than some component is<br>
<br>
"The Best"<br>
<br>
should be taken with a lot of suspicion.<br>
<br>
<br>
Such claims are good only for publishing papers in traditional<br>
Journals and Conferences that do not exercise reproducibility.<br>
You can not rely on such sources when you are working on<br>
serious applications.<br>
<br>
<br>
Don't hesitate to experiment with other components of the<br>
registration framework.<br>
<br>
In many cases, the challenge is not so much about what components<br>
to use, but about how to fine-tune their parameters for the problem<br>
at hand.<br>
<br>
<br>
Please let us know what you find,<br>
<br>
<br>
Thanks<br>
<br>
<br>
Luis<br>
<br>
<br>
-------------------------<br>
<div><div></div><div class="h5">On Tue, May 12, 2009 at 11:21 AM, Albert Gubern <<a href="mailto:bertkrek@gmail.com">bertkrek@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I've modified the example DeformableRegistration8.cxx in order to do a 3D<br>
> DeformableRegistration. This example uses MattesMutualInformationMetric,<br>
> BSplineDeformableTransform and LBFGSBOptimizer.<br>
><br>
> I tested the code with a brain phantom generated with Matlab. The original<br>
> volume is deformed using Matlab b-spline deformation based on this routine<br>
> <a href="http://www.mathworks.com/matlabcentral/fileexchange/20057" target="_blank">http://www.mathworks.com/matlabcentral/fileexchange/20057</a>, and I want to use<br>
> the deformable registration of ITK to recover the deformation. The next link<br>
> shows two checkerboard of one slice, before and after the succesful<br>
> registration:<br>
> <a href="http://img140.imageshack.us/img140/1831/phantomdeformableregist.png" target="_blank">http://img140.imageshack.us/img140/1831/phantomdeformableregist.png</a>. The<br>
> original volume is set as the fixed image and the deformed phantom as the<br>
> moving.<br>
> - Mostra el text citat -<br>
><br>
> The output of the execution is:<br>
><br>
> Starting Registration<br>
> 0 -0.579387 0 0<br>
> 0 -0.581355 0 0<br>
> 0 -0.584345 0 0<br>
> 0 -0.584345 6.33911e-05 0<br>
> 1 -0.603649 6.33911e-05 0<br>
> 1 -0.603649 6.41689e-05 0<br>
> 2 -0.624884 6.41689e-05 0<br>
> 2 -0.624884 7.76054e-05 0<br>
> 3 -0.638071 7.76054e-05 0<br>
> 3 -0.638071 6.32524e-05 0<br>
> 4 -0.655438 6.32524e-05 0<br>
> 4 -0.655438 7.51525e-05 0<br>
> 5 -0.677776 7.51525e-05 0<br>
> 5 -0.677776 6.37494e-05 0<br>
> 6 -0.696669 6.37494e-05 0<br>
> 6 -0.696669 5.09743e-05 0<br>
> 7 -0.713613 5.09743e-05 0<br>
> 7 -0.713613 5.48518e-05 0<br>
> ... (60 iterations more)<br>
> 67 -0.854863 4.01611e-05 0<br>
> 67 -0.854863 4.01611e-05 0<br>
> 67 -0.854863 4.01611e-05 0<br>
> 67 -0.854863 4.01611e-05 0<br>
> Probe Tag Starts Stops Time (s)<br>
> Registration 1 1 3289.35<br>
><br>
> Next step was to test the same code with prostate MRI images but the<br>
> registration doesn't work. The original volume is a central region of MRI to<br>
> focus the registration on the prostate<br>
> (<a href="http://img145.imageshack.us/img145/200/mrireal.png" target="_blank">http://img145.imageshack.us/img145/200/mrireal.png</a>), and the same<br>
> deformation, that was applied to the phantom test, is used to deform the<br>
> original prostate. The goal of the registration is the same: recovering the<br>
> deformation. The next link is a checkerboard of one slice of the volume to<br>
> show that fixed and moving images look different enough<br>
> (<a href="http://img26.imageshack.us/img26/8905/im011.png" target="_blank">http://img26.imageshack.us/img26/8905/im011.png</a>).<br>
><br>
> In this test the program the registration stops too early doing only few<br>
> iterations and the InfinityNormOfProjectedGradient is always zero:<br>
><br>
> Starting Registration<br>
> 0 -0.742878 0 0<br>
> 0 -0.722791 0 0<br>
> 0 -0.721167 0 0<br>
> 0 -0.721134 0 0<br>
> 0 -0.733701 0 0<br>
> 0 -0.733701 0 0<br>
> 0 -0.742878 0 0<br>
> 0 -0.742878 0.000122748 0<br>
> Probe Tag Starts Stops Time (s)<br>
> Registration 1 1 97.3459<br>
><br>
> I have tested the registration using different values of bins<br>
> (32,64,100,etc), % samples (100, 50, ...), using the original<br>
> (0.46875,0.46875,0.46875) and the unitary spacing, different number of grids<br>
> (from 5 to 50) and the parameters of the LBFGSBOptimizer are the following:<br>
><br>
> double costFunctionconvergenceFactor = 1.e7;<br>
> double projectedGradientTolerance = 1e-6;<br>
> int maxNumberOfIterations = 500;<br>
> int maxNumberOfEvaluations = 500 ;<br>
> int maxNumberOfCorrections = 5;<br>
><br>
> Among other tests, I've also changed the metric to MeanSquareMetric to know<br>
> if mattes mutual information metric is the problem or, separately, the fixed<br>
> and moving image have been binarized to reduce the information of each<br>
> image. The output has been the same.<br>
><br>
> All the tests seem to show that the problem is the optimizer, but I don't<br>
> know how I can solve it because in some posts in the mailing list I've read<br>
> that it is the best optimizer for deformable registration. Should I change<br>
> it for another one (Regular or LBFGS)? Any other idea?<br>
><br>
> Thanks in advance.<br>
><br>
> Albert<br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Albert<br>