Skip to content

Commit

Permalink
Merge topic 'STYLE_LinearInterpolateImageFunction_Neighbors'
Browse files Browse the repository at this point in the history
452126b STYLE: Removed LinearInterpolateImageFunction::m_Neighbors
  • Loading branch information
thewtex authored and kwrobot committed Sep 4, 2018
2 parents cac022a + 452126b commit b2f5227
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ class ITK_TEMPLATE_EXPORT LinearInterpolateImageFunction:
void PrintSelf(std::ostream & os, Indent indent) const override;

private:
/** Number of neighbors used in the interpolation */
static const unsigned long m_Neighbors;

struct DispatchBase {};
template< unsigned int >
struct Dispatch: public DispatchBase {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@

namespace itk
{

// Define the number of neighbors
template< typename TInputImage, typename TCoordRep >
const unsigned long
LinearInterpolateImageFunction< TInputImage, TCoordRep >
::m_Neighbors = 1 << TInputImage::ImageDimension;


template< typename TInputImage, typename TCoordRep >
LinearInterpolateImageFunction< TInputImage, TCoordRep >
::LinearInterpolateImageFunction()
Expand Down Expand Up @@ -80,7 +72,10 @@ LinearInterpolateImageFunction< TInputImage, TCoordRep >

Concept::Detail::UniqueType< typename NumericTraits< InputPixelType >::ScalarRealType >();

for ( unsigned int counter = 0; counter < m_Neighbors; ++counter )
// Number of neighbors used in the interpolation
constexpr unsigned long numberOfNeighbors = 1 << TInputImage::ImageDimension;

for ( unsigned int counter = 0; counter < numberOfNeighbors; ++counter )
{
InternalComputationType overlap = 1.0; // Fraction overlap
unsigned int upper = counter; // Each bit indicates upper/lower neighbour
Expand Down

0 comments on commit b2f5227

Please sign in to comment.