This doesn’t fix the general problem with thread safety that your patch to 
Transform::GetInverse exposed, but I believe it will fix the problem with 
BRAINSTools test regressions.  I’m testing that now.

It addresses (partially) the thread safety issue in the specific case of using 
a SpatialObject as a mask in the registration framework.  Instead of computing 
the inverse at every invocation of SpatialObject::IsInside,  it only computes 
it when the transform it depends on (the IndexToWorldTransform) .

Since a mask object (or any SpatialObject) is will not change its WorldToIndex 
transform during registration, the patch remove the crash due to more than one 
thread modifying the transform at the same time. It also removes potentially 
hundreds of thousands of calls to Transform::GetInverse() which can only 
improve performance.

I wonder why this simple-minded optimization never showed up on anyone’s radar 
before.

The topic in Gerrit is here:  http://review.source.kitware.com/#/c/17779/

It is also in the BRAINSia git fork of ITK: 
https://github.com/BRAINSia/ITK/tree/SpatialObjectInternalInverse



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the 
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and 
may be legally privileged.  If you are not the intended recipient, you are 
hereby notified that any retention, dissemination, distribution, or copying of 
this communication is strictly prohibited.  Please reply to the sender that you 
have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
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://kitware.com/products/protraining.php

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://public.kitware.com/mailman/listinfo/insight-developers

Reply via email to