[Insight-developers] thread safety (or lack) of transforms

Stephen Aylward Stephen.Aylward at Kitware.com
Wed Aug 13 17:53:21 EDT 2008


I believe that transforms (including calls to transform point) cannot
be assumed to be thread safe.

The reason is the kernel transforms as you suggested.  I believe the
thin-plate spline and elastic body spline transforms were the main
problems.

I could be mistaken.
s

On Wed, Aug 13, 2008 at 5:43 PM, Rupert Brooks <rupe.brooks at gmail.com> wrote:
> Hi
>
> A quick question about thread-safety of transforms.  Are transforms
> supposed to be thread safe?  Are specific functions threadsafe and
> others not?
>
> The optimized image metrics are specifically designed to duplicate the
> transform for each thread.  However, the ResampleImageFilter does not
> and neither does the OptResampleImageFilter in the Review directory as
> far as I can tell.  So it appears that the ResampleImageFilter assumes
> threadsafety and the metrics dont.
>
> I suspect that this is because the GetJacobian function is inherently
> not threadsafe, but is not used by the ResampleImageFilter and is used
> by the metrics.
>
> Anyway, my question is - does the TransformPoint method of the
> transforms have to be threadsafe, or should ResampleImageFilter be
> changed?   I ask because I can optimize my modified Kernel transforms
> significantly if i do not keep the TransformPoint threadsafe.  This
> worked in the image metrics, but blew up in the ResampleFilter when i
> tried it.  I was just wondering what the intention was when designing
> the multithreaded registration framework.  Briefly - theres
> calculations done for the TransformPoint that are also done for the
> GetJacobian.  These can be cached, and since the registration
> framework tends to call TransformPoint followed by GetJacobian a lot
> there is a speed gain.  This could potentially apply to other
> transforms, but i cant think of a significant example right off.
>
> Thanks
> Rupert
>
> --
> --------------------------------------------------------------
> Rupert Brooks
> McGill Centre for Intelligent Machines (www.cim.mcgill.ca)
> Ph.D Student, Electrical and Computer Engineering
> http://www.cyberus.ca/~rbrooks
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>



-- 
Stephen R. Aylward, Ph.D.
Chief Medical Scientist
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(518) 371-3971 x300


More information about the Insight-developers mailing list