ITK/Deprecation Procedure

From KitwarePublic
< ITK
Revision as of 15:03, 12 June 2011 by Daviddoria (talk | contribs) (moved ITK Deprecation Procedure to ITK/Deprecation Procedure: Conform to namespace policy)
Jump to navigationJump to search


This page describes the procedure to be followed when deprecating code from ITK.

The overall procedure involves the following:

  • Use itkLegacyMacros
  • Leave the deprecated methods for one release
  • Remove at the next release.


Example

KernelTransforms case

In the KernelTransforms we replaced the method

  Matrix & ComputeG();

with the method

  void ComputeG( Matrix & m );


Insertion of Legacy Macros

In the headers

 /**
  * \deprecated in ITK 3.6, please use void ComputeG(vector,gmatrix) instead.
  */
 itkLegacyMacro( virtual const GMatrixType & ComputeG(const InputVectorType& landmarkVector) const );

In the function bodies

 /**
  * This method has been deprecated as of ITK 3.6.
  * Please use the method: void ComputeG(vector,gmatrix) instead.
  */
 #if !defined(ITK_LEGACY_REMOVE)
 template <class TScalarType, unsigned int NDimensions>
 const typename ElasticBodyReciprocalSplineKernelTransform<TScalarType, NDimensions>::GMatrixType &
 ElasticBodyReciprocalSplineKernelTransform<TScalarType, NDimensions>::
 ComputeG( const InputVectorType & ) const
 {
   itkLegacyReplaceBodyMacro(itkElasticBodyReciprocalSplineKernelTransform::ComputeG_vector,
     3.6,itkElasticBodyReciprocalSplineKernelTransform::ComputeG_vector_gmatrix);
   return this->m_GMatrix;
 }
 #endif

Timeline Example

  Class A : method X   is candidate for deprecation


  Timeline
  June 2012:   Release ITK-9-2
  July 2012:   Decision to deprecate method A::X()
  Aug  2012:   Insert itkLegacyMacros around A::X()
  Sept 2012:   Release ITK-9-4
  Nov  2012:   Fully remove the method A::X()
  Dec  2012:   Release ITK-9-6