[Insight-developers] Re: Name of new class : Optimization & Refactoring of Image Registration : Backward / Forward compatibility.

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 19 14:16:57 EDT 2007


Hi Bill,

The files

       itkOptTransform.h
       itkOptTransform.txx

in Insight/Code/Review have been renamed as

      itkThreadSafeTransform.h
      itkThreadSafeTransform.txx


They will have a minor style violation, because
their #ifndef guards will not match the class
name inside, they are matching the filename.
That will be resolved once the file moves into
Code/Common.

One major change is that the ThreadSafeTransform
is not abstract. The itkNewMacro() has been
removed to prevent users from instantiating this
class. We probably should have make it abstract
a while ago.


      Luis


-------------------
Luis Ibanez wrote:
> 
> Hi Bill,
> 
> You are right,
> the class name is not following ITK coding style.
> 
> I'll rename them,..
> we just need to agree in a good new name.
> (more below on what could be a good name).
> 
> 
> ---
> 
> For the background:
> 
> These files are related to the NAC effort the Stephen
> is leading for optimizing the image registration
> framework of ITK. In particular for taking advantage
> of multi-processor platforms.
> 
> These two files are the bridge-head for starting to
> introduce the classes that support the new API of the
> optimized Metrics, while still maintaining backwards
> compatibility with existing components of the image
> registration framework.
> 
> 
> The final purpose of the files:
> 
>              itkOptTransform.h
>              itkOptTransform.txx
> 
> in Insight/Code/Review
> 
> is to replace the current files:
> 
>             itkTransform.h
>             itkTransform.txx
> 
> in Insight/Code/Common
> 
> 
> These new version should be able to operate in a thread-safe
> manner and interact with the optimized versions of Image Metrics
> that Stephen has developed.
> 
> Currently we swap the new files and current files by using the
> CMake Advanced option:
> 
> 
>          ITK_USE_OPTIMIZED_REGISTRATION_METHODS
> 
> and by having conditional #ifdef in the itkTransform to
> #include itkOptTransform files when the CMake variable above
> is turned on.
> 
> The Nightly builds of zion.kitware (GCC 4.1) are going to be
> submitted with this flag ON.
> 
> 
> ---
> 
> 
> Renaming the files is not a problem, However, to make honor to
> what the change actually is, we probably should name them as
> 
>             itkThreadSafeTransform.h
>             itkThreadSafeTransform.txx
> 
> rather than
> 
>             itkOptimizedTransform.h
>             itkOptimizedTransform.txx
> 
> since these transform are simply offering thread-safe versions of
> the methods
> 
>             GetJacobian()
>             TransformPoint()
>             TransformVector()
> 
> 
> instead of offering "faster" or "optimized" version of these
> methods.
> 
> 
> The classes that are actually going to be optimized are the 
> ImageMetrics, Interpolators and the BSplineDeformableTransform.
> 
> 
> The previous API of the Transform method was:
> 
>           GetJacobian( itkPoint )
>           TransformPoint( itkPoint )
>           TransformVector( itkVector )
>           TransformVector( vnlVector )
>           TransformVector( itkCovariantVector )
> 
> The new API is
> 
>           GetJacobian( itkPoint, threadID )
>           TransformPoint( itkPoint, threadID )
>           TransformVector( itkVector, threadID )
>           TransformVector( vnlVector, threadID )
>           TransformVector( itkCovariantVector, threadID )
> 
> The motivation for adding the new API is that some transforms
> use and modify member variabless during the execution of the
> methods above, and that made them non-thread-safe.
> 
> 
> 
> The current challenge is to make sure that Metrics that use
> the new API can interact with transforms that use the old
> API, and that Metrics that use the old API can interact with
> Transforms using the new API.
> 
> 
> This is work in progress.  Any suggestions on how to make
> a smoother introduction of the new classes will be greatly
> appreciated.
> 
> 
>   Thanks
> 
> 
>     Luis
> 
> 
> 
> =======================
> Bill Lorensen wrote:
> 
>> Luis,
>>  
>> Now I see how this will be used. I looked at the rest of your 
>> checkins. However, I still think the class should be renamed.
>>  
>> Bill
>>
>>  
>> On 7/19/07, *Bill Lorensen* <bill.lorensen at gmail.com 
>> <mailto:bill.lorensen at gmail.com>> wrote:
>>
>>     Luis,
>>          I noticed a new class today called itkOptTransfrom. In 
>> general, we
>>     don't use abbreviations in itk. Shouldn't it be called
>>     itkOptimizedTransform? Also, in the header, Self is still defined as
>>     Transform. Is the intent to replace itkTransform with this class?
>>          Bill
>>     
>>
> 


More information about the Insight-developers mailing list