Skip to content

Commit

Permalink
STYLE: Remove legacy code for ITKv5 starting
Browse files Browse the repository at this point in the history
Remove all itkLegacyMacro code to reduce
future maintenance burdens.

Change-Id: I1cbf2fd2206d492b6e0898ee38b016bc833b4b33
  • Loading branch information
hjmjohnson committed Jan 6, 2018
1 parent 8cd2517 commit 01580b3
Show file tree
Hide file tree
Showing 55 changed files with 97 additions and 1,295 deletions.
97 changes: 97 additions & 0 deletions Documentation/Migration/RemoveLegacyCode.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Change SYSTEM "https://itk.org/migrationv4/ITKMigration.dtd">

<!--**
**
** RemoveLegacyCode.xml
**
** Please, make sure this file validates the following w3c test before committing it: http://validator.w3.org
**-->
<Change>
<!--**
** Title for the online migration page
**-->
<Title>
Remove Legacy Code
</Title>

<!--**
** The author of the change
**-->
<Author>
b'Hans Johnson'
</Author>

<!--**
** Date of creation for the XML document
**-->
<Date>
2017-12-12
</Date>

<!--**
** Plain text description of the change
** Extracted from git commit messages
**-->
<Description>
<![CDATA[
Remove Legacy Code.
]]>
</Description>

<!--**
** Sample code snippets
** Extracted from git diff of changed files in Examples and Testing
**-->
<SampleCode>
<Old>
<![CDATA[
]]>
</Old>

<New>
<![CDATA[
]]>
</New>

</SampleCode>

<!--**
** The change-ids for all commits in the topic branch
**-->
<Gerrit-ChangeId>
</Gerrit-ChangeId>

<!--**
** List of all changed files from the topic branch
**-->
<FileList>
b''
</FileList>

<!--**
** If the migration can be accomplished by a simple string
** substitution, then use the following construct to define
** the substitution rule.
**
** <MigrationFix-Automatic>
** <Old>
** <![CDATA[MipsleledName]]>
** </Old>
** <New>
** <![CDATA[MisspelledName]]>
** </New>
** </MigrationFix-Automatic>
**-->

<!--**
** If the migration can NOT be accomplished by a simple string
** substitution, but potential problem spots can be identified,
** use the following construct to define a migration flag rule.
**
** <MigrationFix-Manual>
** OldFunctionName
** </MigrationFix-Manual>
**-->

</Change>
12 changes: 0 additions & 12 deletions Modules/Core/Common/include/itkCovariantVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ class ITK_TEMPLATE_EXPORT CovariantVector:public FixedArray< T, NVectorDimension
/** Get a vnl_vector with a copy of the internal memory block. */
vnl_vector< T > GetVnlVector() const;

/** Set a vnl_vector_ref referencing the same memory block.
* \deprecated Use SetVnlVector() instead. */
itkLegacyMacro(void Set_vnl_vector(const vnl_vector< T > &));

/** Get a vnl_vector_ref referencing the same memory block.
* \deprecated Use GetVnlVector() instead. */
itkLegacyMacro(vnl_vector_ref< T > Get_vnl_vector(void));

/** Get a vnl_vector with a copy of the internal memory block.
* \deprecated Use GetVnlVector() instead. */
itkLegacyMacro(vnl_vector< T > Get_vnl_vector(void) const);

/** Default constructor. */
CovariantVector():BaseArray() {}

Expand Down
33 changes: 0 additions & 33 deletions Modules/Core/Common/include/itkCovariantVector.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,39 +214,6 @@ CovariantVector< T, NVectorDimension >
const_cast< T * >( this->GetDataPointer() ) );
}

#if !defined(ITK_LEGACY_REMOVE)
template< typename T, unsigned int NVectorDimension >
void
CovariantVector< T, NVectorDimension >
::Set_vnl_vector(const vnl_vector< T > & v)
{
for ( unsigned int i = 0; i < v.size(); i++ )
{
( *this )[i] = v(i);
}
}

template< typename T, unsigned int NVectorDimension >
vnl_vector_ref< T >
CovariantVector< T, NVectorDimension >
::Get_vnl_vector(void)
{
return vnl_vector_ref< T >( NVectorDimension, this->GetDataPointer() );
}

template< typename T, unsigned int NVectorDimension >
vnl_vector< T >
CovariantVector< T, NVectorDimension >
::Get_vnl_vector(void) const
{
// Return a vector_ref<>. This will be automatically converted to a
// vnl_vector<>. We have to use a const_cast<> which would normally
// be prohibited in a const method, but it is safe to do here
// because the cast to vnl_vector<> will ultimately copy the data.
return vnl_vector_ref< T >( NVectorDimension,
const_cast< T * >( this->GetDataPointer() ) );
}
#endif
} // end namespace itk

#endif
16 changes: 0 additions & 16 deletions Modules/Core/Common/include/itkImageConstIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,25 +330,13 @@ class ITK_TEMPLATE_EXPORT ImageConstIterator
const PixelType & Value(void) const
{ return *( m_Buffer + m_Offset ); }

/** Return an iterator for the beginning of the region. "Begin"
* is defined as the first pixel in the region.
* \deprecated Use GoToBegin() instead.
*/
itkLegacyMacro(Self Begin(void) const);

/** Move an iterator to the beginning of the region. "Begin" is
* defined as the first pixel in the region. */
void GoToBegin()
{
m_Offset = m_BeginOffset;
}

/** Return an iterator for the end of the region. "End" is defined
* as one pixel past the last pixel of the region.
* \deprecated Use GoToEnd() instead.
*/
itkLegacyMacro(Self End(void) const);

/** Move an iterator to the end of the region. "End" is defined as
* one pixel past the last pixel of the region. */
void GoToEnd()
Expand Down Expand Up @@ -386,8 +374,4 @@ class ITK_TEMPLATE_EXPORT ImageConstIterator
};
} // end namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkImageConstIterator.hxx"
#endif

#endif
66 changes: 0 additions & 66 deletions Modules/Core/Common/include/itkImageConstIterator.hxx

This file was deleted.

8 changes: 0 additions & 8 deletions Modules/Core/Common/include/itkImageConstIteratorWithIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,9 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithIndex
return *m_Position;
}

/** Move an iterator to the beginning of the region.
* \deprecated Use GoToBegin() instead */
itkLegacyMacro(Self Begin(void) const);

/** Move an iterator to the beginning of the region. */
void GoToBegin();

/** Move an iterator to the End of the region.
* \deprecated Use GoToReverseBegin() instead */
itkLegacyMacro(Self End(void) const);

/** Move an iterator to the End of the region. */
void GoToReverseBegin();

Expand Down
30 changes: 0 additions & 30 deletions Modules/Core/Common/include/itkImageConstIteratorWithIndex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -201,36 +201,6 @@ ImageConstIteratorWithIndex< TImage >
m_Position = buffer + offset;
}

#if !defined(ITK_LEGACY_REMOVE)
//----------------------------------------------------------------------------
// Begin() is the first pixel in the region.
//----------------------------------------------------------------------------
template< typename TImage >
ImageConstIteratorWithIndex< TImage >
ImageConstIteratorWithIndex< TImage >
::Begin() const
{
Self it(*this);

it.GoToBegin();
return it;
}

//----------------------------------------------------------------------------
// End() is the last pixel in the region. DEPRECATED
//----------------------------------------------------------------------------
template< typename TImage >
ImageConstIteratorWithIndex< TImage >
ImageConstIteratorWithIndex< TImage >
::End() const
{
Self it(*this);

it.GoToReverseBegin();
return it;
}
#endif

} // end namespace itk

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,9 @@ class ITK_TEMPLATE_EXPORT ImageConstIteratorWithOnlyIndex
m_PositionIndex = ind;
}

/** Move an iterator to the beginning of the region.
* \deprecated Use GoToBegin() instead */
itkLegacyMacro(Self Begin(void) const);

/** Move an iterator to the beginning of the region. */
void GoToBegin();

/** Move an iterator to the End of the region.
* \deprecated Use GoToReverseBegin() instead */
itkLegacyMacro(Self End(void) const);

/** Move an iterator to the End of the region. */
void GoToReverseBegin();

Expand Down
30 changes: 0 additions & 30 deletions Modules/Core/Common/include/itkImageConstIteratorWithOnlyIndex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,36 +156,6 @@ ImageConstIteratorWithOnlyIndex< TImage >
}
}

#if !defined(ITK_LEGACY_REMOVE)
//----------------------------------------------------------------------------
// Begin() is the first pixel in the region.
//----------------------------------------------------------------------------
template< typename TImage >
ImageConstIteratorWithOnlyIndex< TImage >
ImageConstIteratorWithOnlyIndex< TImage >
::Begin() const
{
Self it(*this);

it.GoToBegin();
return it;
}

//----------------------------------------------------------------------------
// End() is the last pixel in the region. DEPRECATED
//----------------------------------------------------------------------------
template< typename TImage >
ImageConstIteratorWithOnlyIndex< TImage >
ImageConstIteratorWithOnlyIndex< TImage >
::End() const
{
Self it(*this);

it.GoToReverseBegin();
return it;
}
#endif

} // end namespace itk

#endif
10 changes: 0 additions & 10 deletions Modules/Core/Common/include/itkImageIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ class ITK_TEMPLATE_EXPORT ImageIterator:public ImageConstIterator< TImage >
return *( const_cast< InternalPixelType * >( this->m_Buffer ) + this->m_Offset );
}

/** Return an iterator for the beginning of the region. "Begin"
* is defined as the first pixel in the region.
* \deprecated Use GoToBegin() instead */
itkLegacyMacro(Self Begin(void) const);

/** Return an iterator for the end of the region. "End" is defined
* as one pixel past the last pixel of the region.
* \deprecated Use GoToEnd() instead */
itkLegacyMacro(Self End(void) const);

/** Get the image that this iterator walks. */
ImageType * GetImage() const
{
Expand Down
Loading

0 comments on commit 01580b3

Please sign in to comment.