<br>Hi Serena,<br><br>Thanks for the update.<br><br>This is a long and sad story:<br><br>It goes like this:<br><br>* In the beginning we have ITK optimizers,<br><br>* Then we wanted to expand the number of Optimizers<br>
and decided to write classes that take VNL optimizers<br> and present them as ITK optimzers.<br><br>* We can't insert code in the middle of VNL optimizers,<br> and therefore, we can't directly invoke IterationEvents<br>
that will allow an ITK user to monitor an optimizer by<br> using a Command/Observer<br><br>* The workaround to this limitation was the following <br> trick: Since we also have to wrap ITK cost functions<br> to make them look like VNL cost functions, we setup<br>
a connection between the ITK wrapper of the VNL<br> optimizer and the VNL warpper of the ITK cost function<br> in such a way that *every* time that "GetValue()" or<br> "GetValueAndDerivative()" is called in the Cost Function,<br>
we generate an IterationEvent indirectly.<br><br>* The drawbacks of this method is what you are confronting:<br><br> A) The values that the optimizer can report, has to be<br> cached from previous invocations of the CostFunction<br>
<br> B) Optimizers that perform multiple evaluations of the <br> cost function per iteration, end up reporting multiple<br> IterationEvents per iteration of the optimizer. <br> This is the reason why you get repeated "optimizer<br>
iteration" numbers.<br><br><br>--<br><br>If you want to see the Transform parameters<br>at every iteration you can call the method<br><br><br> std::cout << optimizer->GetCurrentPosition()<br><br><br>
However, when working with BSplines, this<br>is not particularly useful, given that you will <br>get tens, or hundreds of values....<br> <br>For example, your BSpline has (3+3) = 6 <br>nodes along each dimension, for a total of<br>
216 nodes, each one with three deformation<br>values, for a total of 648 parameters.<br><br><br>You are performing optimization in a parametric<br>space of 648 dimensions.... :-)<br><br><br> Regards,<br><br><br> Luis<br>
<br><br>---------------------------------------------------------------------<br><div class="gmail_quote">On Tue, Jun 30, 2009 at 5:38 PM, Serena Fabbri <span dir="ltr"><<a href="mailto:fabbri@u.washington.edu">fabbri@u.washington.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi Luis and All,<br>
<br>
ok, i have replaced optimizer->GetValue() and it gives me numbers different from 0.<br>
I have read in itk::SingleValuedNonLinearVnlOptimizer Class Reference, that it is not up-to-date value of MI...isn't it?<br>
If you look the output, the iterations are 69, but it is repeated several times....so I don't understand very well how many iterations the code does.<br>
Besides......could you suggest me a way to know the parameters values at each iteration?<br>
<br>
Thank you very much.<br>
Serena.<br>
<br>
<br>
-------output-------------------<br>
<br>
gridSizeOnImage [3, 3, 3] gridBorderSize [3, 3, 3] totalGridSIze [6, 6, 6]<br>
gridOriginOffset [87.5, 127.5, 79.5]<br>
gridOrigin [-87.5, -127.5, -79.5]<br>
spacing [87.5, 127.5, 79.5]<br>
numberOfParameters 648<br>
<br>
Starting Registration<br>
Iter 0 CachedValue -0.135285 InfinityNormOfProjectedGradient 0<br>
Iter 0 CachedValue -0.136816 InfinityNormOfProjectedGradient 0<br>
Iter 0 CachedValue -0.136816 InfinityNormOfProjectedGradient 0.000262062<br>
Iter 1 CachedValue -0.138381 InfinityNormOfProjectedGradient 0.000262062<br>
Iter 1 CachedValue -0.138381 InfinityNormOfProjectedGradient 0.000178985<br>
Iter 2 CachedValue -0.139721 InfinityNormOfProjectedGradient 0.000178985<br>
Iter 2 CachedValue -0.139721 InfinityNormOfProjectedGradient 0.000182089<br>
Iter 3 CachedValue -0.141799 InfinityNormOfProjectedGradient 0.000182089<br>
Iter 3 CachedValue -0.141799 InfinityNormOfProjectedGradient 0.000295439<br>
Iter 4 CachedValue -0.140242 InfinityNormOfProjectedGradient 0.000295439<br>
Iter 4 CachedValue -0.142305 InfinityNormOfProjectedGradient 0.000295439<br>
Iter 4 CachedValue -0.142305 InfinityNormOfProjectedGradient 0.000332698<br>
Iter 5 CachedValue -0.144904 InfinityNormOfProjectedGradient 0.000332698<br>
Iter 5 CachedValue -0.144904 InfinityNormOfProjectedGradient 0.000227115<br>
Iter 6 CachedValue -0.143351 InfinityNormOfProjectedGradient 0.000227115<br>
Iter 6 CachedValue -0.145245 InfinityNormOfProjectedGradient 0.000227115<br>
Iter 6 CachedValue -0.145245 InfinityNormOfProjectedGradient 0.000180015<br>
Iter 7 CachedValue -0.145855 InfinityNormOfProjectedGradient 0.000180015<br>
Iter 7 CachedValue -0.145855 InfinityNormOfProjectedGradient 0.000224301<br>
Iter 8 CachedValue -0.146379 InfinityNormOfProjectedGradient 0.000224301<br>
Iter 8 CachedValue -0.146379 InfinityNormOfProjectedGradient 0.000281225<br>
Iter 9 CachedValue -0.146987 InfinityNormOfProjectedGradient 0.000281225<br>
Iter 9 CachedValue -0.146987 InfinityNormOfProjectedGradient 0.000347015<br>
Iter 10 CachedValue -0.148133 InfinityNormOfProjectedGradient 0.000347015<br>
Iter 10 CachedValue -0.148133 InfinityNormOfProjectedGradient 0.000342164<br>
Iter 11 CachedValue -0.149066 InfinityNormOfProjectedGradient 0.000342164<br>
Iter 11 CachedValue -0.149066 InfinityNormOfProjectedGradient 0.000157566<br>
Iter 12 CachedValue -0.149587 InfinityNormOfProjectedGradient 0.000157566<br>
Iter 12 CachedValue -0.149587 InfinityNormOfProjectedGradient 0.000149334<br>
Iter 13 CachedValue -0.149866 InfinityNormOfProjectedGradient 0.000149334<br>
Iter 13 CachedValue -0.15019 InfinityNormOfProjectedGradient 0.000149334<br>
Iter 13 CachedValue -0.15019 InfinityNormOfProjectedGradient 0.000297405<br>
Iter 14 CachedValue -0.149107 InfinityNormOfProjectedGradient 0.000297405<br>
Iter 14 CachedValue -0.150474 InfinityNormOfProjectedGradient 0.000297405<br>
Iter 14 CachedValue -0.150474 InfinityNormOfProjectedGradient 0.000233087<br>
Iter 15 CachedValue -0.150849 InfinityNormOfProjectedGradient 0.000233087<br>
Iter 15 CachedValue -0.150849 InfinityNormOfProjectedGradient 0.000270985<br>
Iter 16 CachedValue -0.151276 InfinityNormOfProjectedGradient 0.000270985<br>
Iter 16 CachedValue -0.151276 InfinityNormOfProjectedGradient 0.000175098<br>
Iter 17 CachedValue -0.151627 InfinityNormOfProjectedGradient 0.000175098<br>
Iter 17 CachedValue -0.151627 InfinityNormOfProjectedGradient 0.000153631<br>
Iter 18 CachedValue -0.151913 InfinityNormOfProjectedGradient 0.000153631<br>
Iter 18 CachedValue -0.151913 InfinityNormOfProjectedGradient 0.000198165<br>
Iter 19 CachedValue -0.153279 InfinityNormOfProjectedGradient 0.000198165<br>
Iter 19 CachedValue -0.153279 InfinityNormOfProjectedGradient 0.000334519<br>
Iter 20 CachedValue -0.154186 InfinityNormOfProjectedGradient 0.000334519<br>
Iter 20 CachedValue -0.154186 InfinityNormOfProjectedGradient 0.000334793<br>
Iter 21 CachedValue -0.154433 InfinityNormOfProjectedGradient 0.000334793<br>
Iter 21 CachedValue -0.154433 InfinityNormOfProjectedGradient 0.000261072<br>
Iter 22 CachedValue -0.154656 InfinityNormOfProjectedGradient 0.000261072<br>
Iter 22 CachedValue -0.154656 InfinityNormOfProjectedGradient 0.000120058<br>
Iter 23 CachedValue -0.154394 InfinityNormOfProjectedGradient 0.000120058<br>
Iter 23 CachedValue -0.154765 InfinityNormOfProjectedGradient 0.000120058<br>
Iter 23 CachedValue -0.154765 InfinityNormOfProjectedGradient 0.000193124<br>
Iter 24 CachedValue -0.15479 InfinityNormOfProjectedGradient 0.000193124<br>
Iter 24 CachedValue -0.15479 InfinityNormOfProjectedGradient 0.000111046<br>
Iter 25 CachedValue -0.155059 InfinityNormOfProjectedGradient 0.000111046<br>
Iter 25 CachedValue -0.155059 InfinityNormOfProjectedGradient 0.000165312<br>
Iter 26 CachedValue -0.155408 InfinityNormOfProjectedGradient 0.000165312<br>
Iter 26 CachedValue -0.155408 InfinityNormOfProjectedGradient 0.000158262<br>
Iter 27 CachedValue -0.155538 InfinityNormOfProjectedGradient 0.000158262<br>
Iter 27 CachedValue -0.155538 InfinityNormOfProjectedGradient 9.14039e-05<br>
Iter 28 CachedValue -0.155862 InfinityNormOfProjectedGradient 9.14039e-05<br>
Iter 28 CachedValue -0.155862 InfinityNormOfProjectedGradient 0.000108369<br>
Iter 29 CachedValue -0.156014 InfinityNormOfProjectedGradient 0.000108369<br>
Iter 29 CachedValue -0.156014 InfinityNormOfProjectedGradient 6.96136e-05<br>
Iter 30 CachedValue -0.15638 InfinityNormOfProjectedGradient 6.96136e-05<br>
Iter 30 CachedValue -0.15638 InfinityNormOfProjectedGradient 0.000175598<br>
Iter 31 CachedValue -0.15675 InfinityNormOfProjectedGradient 0.000175598<br>
Iter 31 CachedValue -0.15675 InfinityNormOfProjectedGradient 0.000178462<br>
Iter 32 CachedValue -0.15615 InfinityNormOfProjectedGradient 0.000178462<br>
Iter 32 CachedValue -0.156785 InfinityNormOfProjectedGradient 0.000178462<br>
Iter 32 CachedValue -0.156785 InfinityNormOfProjectedGradient 0.000165292<br>
Iter 33 CachedValue -0.156698 InfinityNormOfProjectedGradient 0.000165292<br>
Iter 33 CachedValue -0.156865 InfinityNormOfProjectedGradient 0.000165292<br>
Iter 33 CachedValue -0.156865 InfinityNormOfProjectedGradient 0.000192639<br>
Iter 34 CachedValue -0.157443 InfinityNormOfProjectedGradient 0.000192639<br>
Iter 34 CachedValue -0.157443 InfinityNormOfProjectedGradient 0.000130335<br>
Iter 35 CachedValue -0.157959 InfinityNormOfProjectedGradient 0.000130335<br>
Iter 35 CachedValue -0.157959 InfinityNormOfProjectedGradient 0.000112771<br>
Iter 36 CachedValue -0.158003 InfinityNormOfProjectedGradient 0.000112771<br>
Iter 36 CachedValue -0.158003 InfinityNormOfProjectedGradient 0.000134055<br>
Iter 37 CachedValue -0.158288 InfinityNormOfProjectedGradient 0.000134055<br>
Iter 37 CachedValue -0.158288 InfinityNormOfProjectedGradient 6.71128e-05<br>
Iter 38 CachedValue -0.158161 InfinityNormOfProjectedGradient 6.71128e-05<br>
Iter 38 CachedValue -0.158312 InfinityNormOfProjectedGradient 6.71128e-05<br>
Iter 38 CachedValue -0.158312 InfinityNormOfProjectedGradient 7.5438e-05<br>
Iter 39 CachedValue -0.158083 InfinityNormOfProjectedGradient 7.5438e-05<br>
Iter 39 CachedValue -0.158331 InfinityNormOfProjectedGradient 7.5438e-05<br>
Iter 39 CachedValue -0.158331 InfinityNormOfProjectedGradient 5.54456e-05<br>
Iter 40 CachedValue -0.158158 InfinityNormOfProjectedGradient 5.54456e-05<br>
Iter 40 CachedValue -0.158358 InfinityNormOfProjectedGradient 5.54456e-05<br>
Iter 40 CachedValue -0.158358 InfinityNormOfProjectedGradient 7.92771e-05<br>
Iter 41 CachedValue -0.158315 InfinityNormOfProjectedGradient 7.92771e-05<br>
Iter 41 CachedValue -0.158367 InfinityNormOfProjectedGradient 7.92771e-05<br>
Iter 41 CachedValue -0.158367 InfinityNormOfProjectedGradient 7.79648e-05<br>
Iter 42 CachedValue -0.158329 InfinityNormOfProjectedGradient 7.79648e-05<br>
Iter 42 CachedValue -0.158379 InfinityNormOfProjectedGradient 7.79648e-05<br>
Iter 42 CachedValue -0.158379 InfinityNormOfProjectedGradient 8.3058e-05<br>
Iter 43 CachedValue -0.158235 InfinityNormOfProjectedGradient 8.3058e-05<br>
Iter 43 CachedValue -0.158406 InfinityNormOfProjectedGradient 8.3058e-05<br>
Iter 43 CachedValue -0.158406 InfinityNormOfProjectedGradient 6.6516e-05<br>
Iter 44 CachedValue -0.158411 InfinityNormOfProjectedGradient 6.6516e-05<br>
Iter 44 CachedValue -0.158411 InfinityNormOfProjectedGradient 0.000101636<br>
Iter 45 CachedValue -0.158517 InfinityNormOfProjectedGradient 0.000101636<br>
Iter 45 CachedValue -0.158517 InfinityNormOfProjectedGradient 0.000107886<br>
Iter 46 CachedValue -0.158754 InfinityNormOfProjectedGradient 0.000107886<br>
Iter 46 CachedValue -0.158754 InfinityNormOfProjectedGradient 0.000152569<br>
Iter 47 CachedValue -0.158857 InfinityNormOfProjectedGradient 0.000152569<br>
Iter 47 CachedValue -0.158857 InfinityNormOfProjectedGradient 9.54528e-05<br>
Iter 48 CachedValue -0.158938 InfinityNormOfProjectedGradient 9.54528e-05<br>
Iter 48 CachedValue -0.158938 InfinityNormOfProjectedGradient 0.000131167<br>
Iter 49 CachedValue -0.159018 InfinityNormOfProjectedGradient 0.000131167<br>
Iter 49 CachedValue -0.159018 InfinityNormOfProjectedGradient 0.00011672<br>
Iter 50 CachedValue -0.159042 InfinityNormOfProjectedGradient 0.00011672<br>
Iter 50 CachedValue -0.159042 InfinityNormOfProjectedGradient 8.40269e-05<br>
Iter 51 CachedValue -0.159081 InfinityNormOfProjectedGradient 8.40269e-05<br>
Iter 51 CachedValue -0.159081 InfinityNormOfProjectedGradient 0.000105198<br>
Iter 52 CachedValue -0.159252 InfinityNormOfProjectedGradient 0.000105198<br>
Iter 52 CachedValue -0.159252 InfinityNormOfProjectedGradient 9.19912e-05<br>
Iter 53 CachedValue -0.159222 InfinityNormOfProjectedGradient 9.19912e-05<br>
Iter 53 CachedValue -0.159337 InfinityNormOfProjectedGradient 9.19912e-05<br>
Iter 53 CachedValue -0.159337 InfinityNormOfProjectedGradient 0.000107755<br>
Iter 54 CachedValue -0.159442 InfinityNormOfProjectedGradient 0.000107755<br>
Iter 54 CachedValue -0.159442 InfinityNormOfProjectedGradient 0.000197689<br>
Iter 55 CachedValue -0.159526 InfinityNormOfProjectedGradient 0.000197689<br>
Iter 55 CachedValue -0.159526 InfinityNormOfProjectedGradient 0.000102651<br>
Iter 56 CachedValue -0.159619 InfinityNormOfProjectedGradient 0.000102651<br>
Iter 56 CachedValue -0.159619 InfinityNormOfProjectedGradient 4.66383e-05<br>
Iter 57 CachedValue -0.1597 InfinityNormOfProjectedGradient 4.66383e-05<br>
Iter 57 CachedValue -0.1597 InfinityNormOfProjectedGradient 6.57382e-05<br>
Iter 58 CachedValue -0.159817 InfinityNormOfProjectedGradient 6.57382e-05<br>
Iter 58 CachedValue -0.159817 InfinityNormOfProjectedGradient 8.31402e-05<br>
Iter 59 CachedValue -0.1599 InfinityNormOfProjectedGradient 8.31402e-05<br>
Iter 59 CachedValue -0.1599 InfinityNormOfProjectedGradient 7.35979e-05<br>
Iter 60 CachedValue -0.159991 InfinityNormOfProjectedGradient 7.35979e-05<br>
Iter 60 CachedValue -0.159991 InfinityNormOfProjectedGradient 7.34808e-05<br>
Iter 61 CachedValue -0.159807 InfinityNormOfProjectedGradient 7.34808e-05<br>
Iter 61 CachedValue -0.160097 InfinityNormOfProjectedGradient 7.34808e-05<br>
Iter 61 CachedValue -0.160097 InfinityNormOfProjectedGradient 0.000107219<br>
Iter 62 CachedValue -0.160211 InfinityNormOfProjectedGradient 0.000107219<br>
Iter 62 CachedValue -0.160211 InfinityNormOfProjectedGradient 0.000189714<br>
Iter 63 CachedValue -0.160198 InfinityNormOfProjectedGradient 0.000189714<br>
Iter 63 CachedValue -0.160193 InfinityNormOfProjectedGradient 0.000189714<br>
Iter 63 CachedValue -0.160221 InfinityNormOfProjectedGradient 0.000189714<br>
Iter 63 CachedValue -0.160221 InfinityNormOfProjectedGradient 0.000187129<br>
Iter 64 CachedValue -0.160294 InfinityNormOfProjectedGradient 0.000187129<br>
Iter 64 CachedValue -0.160294 InfinityNormOfProjectedGradient 9.65022e-05<br>
Iter 65 CachedValue -0.160348 InfinityNormOfProjectedGradient 9.65022e-05<br>
Iter 65 CachedValue -0.160348 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160151 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160291 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160349 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160289 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160349 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160287 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160349 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160352 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.75378e-05<br>
Iter 66 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.159162 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160283 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160287 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160288 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160288 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54521e-05<br>
Iter 67 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.158687 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160273 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160287 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54736e-05<br>
Iter 68 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160267 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160303 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160289 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Iter 69 CachedValue -0.160354 InfinityNormOfProjectedGradient 6.54687e-05<br>
Probe Tag Starts Stops Time (s)<br>
Registration 1 1 38.5086<div><div></div><div class="h5"><br>
<br>
<br>
<br>
On Tue, 30 Jun 2009, Luis Ibanez wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Serena,<br>
<br>
Why did you replace the<br>
<br>
optimizer->GetCachedValue()<br>
<br>
with<br>
<br>
optimizer->GetValue()<br>
<br>
??<br>
<br>
With the original code<br>
<br>
std::cout << optimizer->GetCurrentIteration() << " ";<br>
std::cout << optimizer->GetCachedValue() << " ";<br>
std::cout << optimizer->GetInfinityNormOfProjectedGradient() <<<br>
std::endl;<br>
<br>
<br>
I get output similar to<br>
<br>
<br>
Starting Registration<br>
0 -0.126569 0<br>
0 -0.128309 0<br>
0 -0.132048 0<br>
0 -0.145772 0<br>
0 -0.206432 0<br>
0 -0.304187 0<br>
0 -0.304187 0.000164939<br>
1 -0.359927 0.000164939<br>
1 -0.359927 0.00022934<br>
2 -0.289385 0.00022934<br>
<br>
when registering the images:<br>
<br>
brainweb165a10f17.mha<br>
brainweb165a10f17Rot20Tx20.mha<br>
<br>
<br>
Could you please restore the original code<br>
and let us know if this time you get non-zero<br>
outputs ?<br>
<br>
<br>
Thanks<br>
<br>
<br>
Luis<br>
<br>
<br>
--------------------------------------------------------------<br>
On Tue, Jun 30, 2009 at 4:00 PM, Serena Fabbri <<a href="mailto:fabbri@u.washington.edu" target="_blank">fabbri@u.washington.edu</a>>wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br>
<br>
I am using DeformableRegistration8 with Mattes Mutual Information and<br>
LBFGSBoptimizer.<br>
I'd like to know how the MI and the parameters change in each iteration. In<br>
the example, class CommandIterationUpdate is implemented and I only add :<br>
<br>
std::cout <<"Iter "<<optimizer->GetCurrentIteration() << " ";<br>
std::cout <<" Metric "<<optimizer->GetValue() << ":";<br>
std::cout <<" Parameters "<<optimizer->GetCurrentPosition() << std::endl;<br>
<br>
I use a Bspline-grid with 3 bound nodes and 3 node in the image and I run<br>
fixed=MRI (176, 256, 160) (1,1,1)mm moving=CT (176, 256, 160) (1,1,1)mm<br>
<br>
The code runs, I get a pretty good registered image but Metric value and<br>
parameters values are always 0.<br>
could anybody point out me where the error is?<br>
are the above instructions wrong?<br>
<br>
<br>
Thanks.<br>
<br>
Serena.<br>
<br>
_____________________________________<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>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br>
</div></div></blockquote></div><br>