Hi motes,<br><br><br>A) One easy way of calling a function at every iteration of the Optimizer,<br> Is to invoke that function from a Command/Observer.<br><br><br>B) Unfortunately, if you plan to make drastic changes in the registration<br>
components, such as changing the number of nodes in a BSpline,<br> you will have to reset and reinitialize the registration at every iteration.<br> This is because there are several arrays whose size depend on the<br>
number of Transform parameters. These arrays will have to be resized<br> if you change the number of parameters in the Transform.<br><br><br><br>C) ITK is OPEN SOURCE :-)<br><br> You are empowered to take the source code of the ITK optimizer of <br>
your choice, copy it under a different name, and at the end of every <br> iteration, call any function you would like.<br><br> The software doesn't impose any restrictions on you.<br><br> Note however, that you are still subject to the issue described in (B).<br>
<br><br>D) As a strategy for registration, changing the number of nodes after<br> *every* iteration, is a bit extreme. I would suggest that you set the<br> number of nodes and run a set of iterations with them (let's say<br>
20 iterations), then you readjust the number of Nodes, and run <br> another set of 20 iterations,.... and so on.<br><br> In this way, the cost of reinitializing the Metric after every change<br> of number of Nodes is amortized across the total number of <br>
iterations.<br><br><br><br><br> Regards,<br><br><br> Luis<br><br><br>----------------------------------------------------------------------<br><div class="gmail_quote">On Thu, Jul 9, 2009 at 12:19 PM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</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;">I know I might have asked this before, but I have tried to be more precise in this post.<br>
<br>Is it possible to write a function that gets executed in each iteration AFTER the call to:<br><br> int start(){<br> try<br>
{<br> registration->Update();<br> }<br> catch( itk::ExceptionObject & err )<br> {<br> std::cerr << "ExceptionObject caught !" << std::endl;<br>
std::cerr << err << std::endl;<br> return -1;<br> }<br> }<br><br>I would like this function to maybe modify the values of the cost function and maybe add more control points to the B-spline grid when doing Deformable transformations.<br>
<br>But is it even possible to do this after the call to update()? The only thing that I found that gives some feedback in each iteration is the different observers. How "closed for modification" is the ITK image registration module after the call to registration.update() with regard to the above details?<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: <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></div><br>