[Insight-users] Why each thread has a separate copy of the transform in itkImageToImageMetric
Luis Ibanez
luis.ibanez at kitware.com
Sun Sep 12 13:19:07 EDT 2010
Hi Mengda,
This cloning of the Transform is done in the Metric
because ITK Transforms are not thread-safe.
Therefore the same instance of the Transform object
can not be safely shared among multiple threads
In particular, the method that computes the Jacobian,
in the Transforms is not thread safe, because it uses
a member variable that is there only for the purpose
of caching data.
Regards,
Luis
----------------------------------------------------------------------------------------------------------------------
On Thu, Sep 9, 2010 at 7:00 PM, Mengda Wu <wumengda at gmail.com> wrote:
> Hi all,
>
> I am looking at the code in itkImageToImageMetric.txx (latest version in
> git). I have a question why each thread needs to have a
> seperate copy of the transform (variable m_ThreaderTransform[i]). Why not
> use a single one as in thread 0 (variable m_Transform)? Should
> all transforms be the same at all times? Or, they can be changed by the
> optimizer in each thread and thus we need synchronize
> wtih SynchronizeTransforms().
>
> Any clarification or document of the multi-threading strategy of ITK's
> metric and optimizer is greatly welcomed.
>
> Thanks,
> Mengda
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100912/1c6cdf58/attachment.htm>
More information about the Insight-users
mailing list