<br>Hi Mengda,<br><br>This cloning of the Transform is done in the Metric <br>because ITK Transforms are not thread-safe.<br><br>Therefore the same instance of the Transform object<br>can not be safely shared among multiple threads<br>
<br><br>In particular, the method that computes the Jacobian,<br>in the Transforms is not thread safe, because it uses <br>a member variable that is there only for the purpose <br>of caching data.<br><br><br> Regards,<br>
<br><br> Luis <br><br><br>----------------------------------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Thu, Sep 9, 2010 at 7:00 PM, Mengda Wu <span dir="ltr"><<a href="mailto:wumengda@gmail.com">wumengda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br><br> I am looking at the code in itkImageToImageMetric.txx (latest version in git). I have a question why each thread needs to have a<br>
seperate copy of the transform (variable m_ThreaderTransform[i]). Why not use a single one as in thread 0 (variable m_Transform)? Should<br>
all transforms be the same at all times? Or, they can be changed by the optimizer in each thread and thus we need synchronize<br>wtih SynchronizeTransforms().<br><br> Any clarification or document of the multi-threading strategy of ITK's metric and optimizer is greatly welcomed.<br>
<br>Thanks,<br><font color="#888888">Mengda<br>
</font><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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.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></div><br>