diff --git a/Utilities/ITK/Code/BasicFilters/itkTernaryFunctorImageFilter.txx b/Utilities/ITK/Code/BasicFilters/itkTernaryFunctorImageFilter.txx index 9b12bab5f0b6b0710cfc96c2baaeec58a6e6c7b2..a86eb79992b02d39463c5394cf29ace0d2ff9fd7 100644 --- a/Utilities/ITK/Code/BasicFilters/itkTernaryFunctorImageFilter.txx +++ b/Utilities/ITK/Code/BasicFilters/itkTernaryFunctorImageFilter.txx @@ -46,7 +46,7 @@ TernaryFunctorImageFilter<TInputImage1,TInputImage2,TInputImage3,TOutputImage,TF ::SetInput1( const TInputImage1 *image1 ) { // The ProcessObject is not const-correct so the const_cast is required here - SetNthInput( 0, const_cast<TInputImage1 *>( image1 ) ); + this->SetNthInput( 0, const_cast<TInputImage1 *>( image1 ) ); } /** @@ -59,7 +59,7 @@ TernaryFunctorImageFilter<TInputImage1,TInputImage2,TInputImage3,TOutputImage,TF ::SetInput2( const TInputImage2 *image2 ) { // The ProcessObject is not const-correct so the const_cast is required here - SetNthInput( 1, const_cast<TInputImage2 *>( image2 ) ); + this->SetNthInput( 1, const_cast<TInputImage2 *>( image2 ) ); } /** @@ -72,7 +72,7 @@ TernaryFunctorImageFilter<TInputImage1,TInputImage2,TInputImage3,TOutputImage,TF ::SetInput3( const TInputImage3 *image3 ) { // The ProcessObject is not const-correct so the const_cast is required here - SetNthInput( 2, const_cast<TInputImage3 *>( image3 ) ); + this->SetNthInput( 2, const_cast<TInputImage3 *>( image3 ) ); } /** diff --git a/Utilities/ITK/Code/Common/itkKLMSegmentationBorder.h b/Utilities/ITK/Code/Common/itkKLMSegmentationBorder.h index 3d74c32500b1134dc3a22a597871f16a2b6740fc..18e339ba67bb999ae09789748116114d5e725ad1 100644 --- a/Utilities/ITK/Code/Common/itkKLMSegmentationBorder.h +++ b/Utilities/ITK/Code/Common/itkKLMSegmentationBorder.h @@ -81,11 +81,11 @@ public: bool operator> (const KLMDynamicBorderArray<TBorder>* rhs) const { - if( m_Pointer->GetLambda() == rhs.m_Pointer->GetLambda() ) + if( m_Pointer->GetLambda() == rhs->m_Pointer->GetLambda() ) { if( m_Pointer->GetLambda() < 0 ) { - return ( m_Pointer > rhs.m_Pointer ); + return ( m_Pointer > rhs->m_Pointer ); } else { @@ -100,13 +100,13 @@ public: static_cast< double>(m_Pointer->GetRegion2()->GetRegionBorderSize() )); double v2 = vnl_math_max( - static_cast< double>(rhs.m_Pointer->GetRegion1()->GetRegionBorderSize()), - static_cast< double>(rhs.m_Pointer->GetRegion2()->GetRegionBorderSize()) ); + static_cast< double>(rhs->m_Pointer->GetRegion1()->GetRegionBorderSize()), + static_cast< double>(rhs->m_Pointer->GetRegion2()->GetRegionBorderSize()) ); return ( v1 > v2 ); } } - return(m_Pointer->GetLambda() > rhs.m_Pointer->GetLambda() ); + return(m_Pointer->GetLambda() > rhs->m_Pointer->GetLambda() ); } TBorder *m_Pointer; diff --git a/Utilities/ITK/Code/Common/itkParametricPath.txx b/Utilities/ITK/Code/Common/itkParametricPath.txx index 31acb95a7c908d08f45a9ebc3e0aa1d24626210b..71bf1e99681d8c5403bf5ff05c60f0508ce7f8ab 100644 --- a/Utilities/ITK/Code/Common/itkParametricPath.txx +++ b/Utilities/ITK/Code/Common/itkParametricPath.txx @@ -43,7 +43,7 @@ ParametricPath<VDimension> ContinuousIndexType continuousIndex; IndexType index; - continuousIndex = Evaluate( input ); + continuousIndex = this->Evaluate( input ); // Round each coordinate to the nearest integer value for( unsigned int i=0; i<VDimension; i++ ) @@ -134,7 +134,7 @@ ParametricPath<VDimension> inputStepSize = this->EndOfInput() - input; } - return ( Evaluate(input + inputStepSize) - Evaluate(input) ) / inputStepSize; + return ( this->Evaluate(input + inputStepSize) - this->Evaluate(input) ) / inputStepSize; } template<unsigned int VDimension> diff --git a/Utilities/ITK/Code/Common/itkSize.h b/Utilities/ITK/Code/Common/itkSize.h index e06cd041d55f1b3c1e94cc0636647126d8ae7ed0..601b7daa88189913d7e914994e708fc0f55dc365 100644 --- a/Utilities/ITK/Code/Common/itkSize.h +++ b/Utilities/ITK/Code/Common/itkSize.h @@ -18,6 +18,7 @@ #define __itkSize_h #include "itkMacro.h" +#include <cstring> namespace itk { diff --git a/Utilities/ITK/Code/IO/itkConvertPixelBuffer.txx b/Utilities/ITK/Code/IO/itkConvertPixelBuffer.txx index 5976db4b70ed7dd2fe32a66b2a4366ae08b5f1d6..10ade71cc2012d9a90fb1489a52d25352f9f7e04 100644 --- a/Utilities/ITK/Code/IO/itkConvertPixelBuffer.txx +++ b/Utilities/ITK/Code/IO/itkConvertPixelBuffer.txx @@ -594,6 +594,32 @@ ConvertPixelBuffer<InputPixelType, OutputPixelType, OutputConvertTraits> } } +/* To be able to convert transparently*/ + +template<typename InputType, typename OutputType> +OutputType +SpecialCast(const std::complex<InputType>& in, const OutputType& itkNotUsed(dummy)) +{ + typedef typename itk::NumericTraits<std::complex<InputType> >::RealType RealType; + typedef typename itk::NumericTraits<std::complex<InputType> >::ScalarRealType ScalarRealType; + + RealType inReal( static_cast<ScalarRealType>(in.real()), static_cast<ScalarRealType>(in.imag()) ); + + return static_cast < OutputType >( vcl_abs(inReal) ); +} + +template<typename InputType, typename OutputType> +std::complex<OutputType> +SpecialCast(const std::complex<InputType>& in, const std::complex<OutputType>& itkNotUsed(dummy)) +{ + typedef typename itk::NumericTraits<std::complex<InputType> >::RealType RealType; + typedef typename itk::NumericTraits<std::complex<InputType> >::ScalarRealType ScalarRealType; + + RealType inReal( static_cast<ScalarRealType>(in.real()), static_cast<ScalarRealType>(in.imag()) ); + + return static_cast < std::complex<OutputType> >( inReal ); +} + template < typename InputPixelType, typename OutputPixelType, class OutputConvertTraits @@ -717,32 +743,6 @@ ConvertPixelBuffer<InputPixelType, OutputPixelType, OutputConvertTraits> } } -/* To be able to convert transparently*/ - -template<typename InputType, typename OutputType> -OutputType -SpecialCast(const std::complex<InputType>& in, const OutputType& itkNotUsed(dummy)) -{ - typedef typename itk::NumericTraits<std::complex<InputType> >::RealType RealType; - typedef typename itk::NumericTraits<std::complex<InputType> >::ScalarRealType ScalarRealType; - - RealType inReal( static_cast<ScalarRealType>(in.real()), static_cast<ScalarRealType>(in.imag()) ); - - return static_cast < OutputType >( vcl_abs(inReal) ); -} - -template<typename InputType, typename OutputType> -std::complex<OutputType> -SpecialCast(const std::complex<InputType>& in, const std::complex<OutputType>& itkNotUsed(dummy)) -{ - typedef typename itk::NumericTraits<std::complex<InputType> >::RealType RealType; - typedef typename itk::NumericTraits<std::complex<InputType> >::ScalarRealType ScalarRealType; - - RealType inReal( static_cast<ScalarRealType>(in.real()), static_cast<ScalarRealType>(in.imag()) ); - - return static_cast < std::complex<OutputType> >( inReal ); -} - template < typename InputPixelType, typename OutputPixelType, class OutputConvertTraits > diff --git a/Utilities/ITK/Code/Numerics/Statistics/itkWeightedCentroidKdTreeGenerator.txx b/Utilities/ITK/Code/Numerics/Statistics/itkWeightedCentroidKdTreeGenerator.txx index 7a976786f11c748996564c7004c44e3e67bbd343..615bac130830ca2fc9fa75a7d37d8a45b0899d9d 100644 --- a/Utilities/ITK/Code/Numerics/Statistics/itkWeightedCentroidKdTreeGenerator.txx +++ b/Utilities/ITK/Code/Numerics/Statistics/itkWeightedCentroidKdTreeGenerator.txx @@ -117,13 +117,13 @@ WeightedCentroidKdTreeGenerator< TSample > upperBound[partitionDimension] = partitionValue; const unsigned int beginLeftIndex = beginIndex; const unsigned int endLeftIndex = medianIndex; - KdTreeNodeType* left = GenerateTreeLoop(beginLeftIndex, endLeftIndex, lowerBound, upperBound, level + 1); + KdTreeNodeType* left = this->GenerateTreeLoop(beginLeftIndex, endLeftIndex, lowerBound, upperBound, level + 1); upperBound[partitionDimension] = dimensionUpperBound; lowerBound[partitionDimension] = partitionValue; const unsigned int beginRightIndex = medianIndex+1; const unsigned int endRighIndex = endIndex; - KdTreeNodeType* right = GenerateTreeLoop(beginRightIndex, endRighIndex, lowerBound, upperBound, level + 1); + KdTreeNodeType* right = this->GenerateTreeLoop(beginRightIndex, endRighIndex, lowerBound, upperBound, level + 1); lowerBound[partitionDimension] = dimensionLowerBound; diff --git a/Utilities/ITK/Code/Review/itkMRCImageIO.h b/Utilities/ITK/Code/Review/itkMRCImageIO.h index cfd44fdf0aa3368260eaa3821605c1e6d64c9878..867e29145bec2065f6d1c677f70e91ccf68f41c8 100644 --- a/Utilities/ITK/Code/Review/itkMRCImageIO.h +++ b/Utilities/ITK/Code/Review/itkMRCImageIO.h @@ -20,6 +20,7 @@ #include "itkStreamingImageIOBase.h" #include "itkMRCHeaderObject.h" +#include "itkGenericUtilities.h" #include <numeric> namespace itk @@ -127,7 +128,7 @@ private: // this could be replaced with std::min_element and // std::max_element, but that is slighlty less efficient std::pair<ConstPixelPointer, ConstPixelPointer> mm = - min_max_element(bufferBegin, bufferEnd); + itk::min_max_element(bufferBegin, bufferEnd); double mean = std::accumulate( bufferBegin, bufferEnd, double(0.0) ) / std::distance( bufferBegin, bufferEnd );