[Insight-users] itk::BSplineDeformableTransform BulkTransform

Luis Ibanez luis.ibanez at kitware.com
Mon Feb 8 11:07:41 EST 2010


Hi Jef


Thanks for filing the bug report.
I just assigned it to myself.


About your questions:

1) Yes, the Bulk Transform must be cloned for the
    same reasons that the main transform is cloned.
    Some operations are not thread safe.

2)  Out of the top of my head, I would expect that
     calls to TransformPoint() in Transforms derived
     from MatrixOffsetTransformBase should be thread-safe.

     HOWEVER: I would STRONGLY discourage
     you from counting on that.

     Additionally, New derived classes may add features
     that are not thread-safe.  So it is safer if you treat the
     Transform classes as not thread-safe in general.


  Thanks


         Luis


-------------------------------------------------------------------------
On Mon, Feb 8, 2010 at 9:55 AM, jef vdmb <jvdmb at hotmail.com> wrote:
> Hi Luis,
>
>
>> Passing the parameters of the Bulk transform via the FixedParameters,
>> may not be enough. We need to clone the bulk transform as well,
>> and note that the Bulk transform could be any type of transform,
>> (including another BSplineDeformable transform), although in practice,
>> most of the time we use an AffineTransform.
>>
> I had not considered this possibility. The reason we need to clone the
> bulktransform as well, is because it is potentially not thread-safe either?
> Just to make sure: any calls to TransformPoint() of a transform derived
> from MatrixOffsetTransformBase is threadsafe, right?
>
>> Could you please log a bug in the Bug tracker and assign it to me ?
>> http://public.kitware.com/Bug/my_view_page.php
>
> I reported the issue on the bugtracker and mentioned I had discussed this
> with you as "Additional Information" (I didn't see any option allowing me to
> assign it to you).
> Thank you very much for clearing that up!
> Jef
>
>> Many Thanks,
>>
>>
>> Luis
>>
>>
>> ------------------------------------------------------------------------
>> On Tue, Feb 2, 2010 at 9:53 AM, jef vdmb <jvdmb at hotmail.com> wrote:
>> > Hi,
>> >
>> > I noticed something during a registration using the
>> > itk::BSplineDeformableTransform involving a bulk transform.
>> >
>> > I am working with the optimized (threaded) framework, available in the
>> > review section. Since the transform is not threadsafe, copies of the
>> > transform are made by ImageToImageMetric. As such, the transform should
>> > provide a function GetFixedParametes() and GetParameters(), both
>> > returning
>> > an array of doubles,  wich allow to synchronize the copies with the
>> > original
>> > transform object.
>> >
>> > Unless I missed something it would seem the bulk transform has not been
>> > included in the FixedParameters array, and is not passed in another way
>> > to
>> > the transform copies. This leads to inconsistent copies of the transform
>> > in
>> > the respective threads: the first has the bulk but the copies don't.
>> >
>> > Regards,
>> > Jef
>> >
>> > PS:
>> >
>> > One way to pass the bulk is to include in the array of doubles
>> > m_FixedParameters. A quick workaround I am using for now is to cast the
>> > the
>> > member m_BulkTransform (this time defined as a c++ pointer rather then a
>> > SmartPointer) to double in GetFixedParameters()
>> >
>> >  this->m_FixedParameters[?]= (double)((size_t) m_BulkTransform;
>> > ...
>> > And inversely, casting it back to a pointer in SetFixedParameters()....
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > ________________________________
>> > Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign
>> > up
>> > now.
>> > _____________________________________
>> > 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
>> >
>> >
>
> ________________________________
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up
> now.


More information about the Insight-users mailing list