From: tbaudier Date: Wed, 26 Apr 2017 11:53:15 +0000 (+0200) Subject: Towards c++11 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1e6e00bdcdb79d94c23432f848ba7fdbd057e64c;p=clitk.git Towards c++11 Remove bugs and warnings --- diff --git a/itk/RelativePositionPropImageFilter.h b/itk/RelativePositionPropImageFilter.h index f088c74..c4f0812 100644 --- a/itk/RelativePositionPropImageFilter.h +++ b/itk/RelativePositionPropImageFilter.h @@ -170,7 +170,7 @@ namespace itk } - virtual void GenerateInputRequestedRegion() ITK_OVERRIDE throw(InvalidRequestedRegionError); + virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) ITK_OVERRIDE; void EnlargeOutputRequestedRegion (DataObject * output) ITK_OVERRIDE; protected: @@ -185,7 +185,7 @@ namespace itk m_VerboseProgress = false; } virtual ~RelativePositionPropImageFilter() {} - void PrintSelf(std::ostream& os, Indent indent) ITK_OVERRIDE const; + void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE; //void GenerateThreadedData(const typename TOutputImage::RegionType& outputRegionForThread, int threadId); void GenerateData() ITK_OVERRIDE; diff --git a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h index 62cbf51..45f331e 100644 --- a/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h +++ b/itk/clitkAddRelativePositionConstraintToLabelImageFilter.h @@ -62,7 +62,7 @@ namespace clitk { /** Run-time type information (and related methods). */ itkTypeMacro(AddRelativePositionConstraintToLabelImageFilter, ImageToImageFilter); - FILTERBASE_INIT ITK_OVERRIDE; + FILTERBASE_INIT; /** Some convenient typedefs. */ typedef typename ImageType::ConstPointer ImageConstPointer; diff --git a/itk/clitkExtractSliceFilter.h b/itk/clitkExtractSliceFilter.h index aa0539f..30976ce 100644 --- a/itk/clitkExtractSliceFilter.h +++ b/itk/clitkExtractSliceFilter.h @@ -78,7 +78,7 @@ namespace clitk { /** Run-time type information (and related methods). */ itkTypeMacro(ExtractSliceFilter, ImageToImageFilter); - FILTERBASE_INIT ITK_OVERRIDE; + FILTERBASE_INIT; /** Input : initial image and object */ void SetInput(const ImageType * image) ITK_OVERRIDE; diff --git a/itk/clitkSetBackgroundImageFilter.h b/itk/clitkSetBackgroundImageFilter.h index 739eb0e..37e856c 100644 --- a/itk/clitkSetBackgroundImageFilter.h +++ b/itk/clitkSetBackgroundImageFilter.h @@ -211,7 +211,7 @@ protected: SetBackgroundImageFilter() {} virtual ~SetBackgroundImageFilter() {} - void PrintSelf(std::ostream &os, itk::Indent indent) ITK_OVERRIDE const + void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE { Superclass::PrintSelf(os, indent); os << indent << "OutsideValue: " << this->GetOutsideValue() << std::endl; diff --git a/itk/clitkSliceBySliceRelativePositionFilter.h b/itk/clitkSliceBySliceRelativePositionFilter.h index de4055b..578fcd6 100644 --- a/itk/clitkSliceBySliceRelativePositionFilter.h +++ b/itk/clitkSliceBySliceRelativePositionFilter.h @@ -67,7 +67,7 @@ namespace clitk { typedef typename RelPosFilterType::OrientationTypeEnumeration OrientationTypeEnumeration; /** Input : initial image and object */ - void SetInput(const ImageType * image) ITK_OVERRIDE; + virtual void SetInput(const ImageType * image) ITK_OVERRIDE; void SetInputObject(const ImageType * image); // Options diff --git a/itk/itkBSplineInterpolateImageFunctionWithLUT.h b/itk/itkBSplineInterpolateImageFunctionWithLUT.h index cb3a91e..e92ee7e 100644 --- a/itk/itkBSplineInterpolateImageFunctionWithLUT.h +++ b/itk/itkBSplineInterpolateImageFunctionWithLUT.h @@ -64,14 +64,14 @@ namespace itk { /** Evaluate the function at a ContinuousIndex position. Overwritten for taking LUT into account (RP: multi-threading-compatible version, the threadID is actually ignored) */ - virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index, unsigned int /* threadID */ ) ITK_OVERRIDE const + virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index, unsigned int /* threadID */ ) const ITK_OVERRIDE { return this->EvaluateAtContinuousIndex( index ); } /** Evaluate the function at a ContinuousIndex position. Overwritten for taking LUT into account */ - virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index ) ITK_OVERRIDE const; + virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index ) const ITK_OVERRIDE; /** Static convenient functions to compute BSpline weights for various order, dimension, sampling ... **/ diff --git a/registration/clitkAffineRegistrationGenericFilter.cxx b/registration/clitkAffineRegistrationGenericFilter.cxx index bcf5fd4..f369e05 100644 --- a/registration/clitkAffineRegistrationGenericFilter.cxx +++ b/registration/clitkAffineRegistrationGenericFilter.cxx @@ -45,11 +45,11 @@ public: } // Execute - void Execute(itk::Object *caller, const itk::EventObject & event) { + void Execute(itk::Object *caller, const itk::EventObject & event) ITK_OVERRIDE { Execute( (const itk::Object *)caller, event); } - void Execute(const itk::Object * object, const itk::EventObject & event) { + void Execute(const itk::Object * object, const itk::EventObject & event) ITK_OVERRIDE { if ( !(itk::IterationEvent().CheckEvent( &event )) ) { return; } @@ -108,7 +108,7 @@ public: // Two arguments are passed to the Execute() method: the first // is the pointer to the object which invoked the event and the // second is the event that was invoked. - void Execute(itk::Object * object, const itk::EventObject & event) { + void Execute(itk::Object * object, const itk::EventObject & event) ITK_OVERRIDE { if ( !(itk::IterationEvent().CheckEvent( &event )) ) { return; } @@ -138,7 +138,7 @@ public: } } - void Execute(const itk::Object * , const itk::EventObject & ) { + void Execute(const itk::Object * , const itk::EventObject & ) ITK_OVERRIDE { return; } diff --git a/registration/clitkCorrelationRatioImageToImageMetric.h b/registration/clitkCorrelationRatioImageToImageMetric.h index c8f9d21..04a6a37 100644 --- a/registration/clitkCorrelationRatioImageToImageMetric.h +++ b/registration/clitkCorrelationRatioImageToImageMetric.h @@ -105,18 +105,18 @@ public: * (1) making sure that all the components are present and plugged * together correctly, * (3) allocate memory for bin data structures. */ - virtual void Initialize(void) throw ( ExceptionObject ); + virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE; /** Get the derivatives of the match measure. */ void GetDerivative( const TransformParametersType & parameters, - DerivativeType & derivative ) const; + DerivativeType & derivative ) const ITK_OVERRIDE; /** Get the value for single valued optimizers. */ - MeasureType GetValue( const TransformParametersType & parameters ) const; + MeasureType GetValue( const TransformParametersType & parameters ) const ITK_OVERRIDE; /** Get value and derivatives for multiple valued optimizers. */ void GetValueAndDerivative( const TransformParametersType & parameters, - MeasureType& Value, DerivativeType& Derivative ) const; + MeasureType& Value, DerivativeType& Derivative ) const ITK_OVERRIDE; /** Number of bins to used in the calculation. Typical value is 50. */ itkSetClampMacro( NumberOfBins, unsigned long, diff --git a/registration/clitkLBFGSBOptimizer.h b/registration/clitkLBFGSBOptimizer.h index 7b4052e..c5d8966 100644 --- a/registration/clitkLBFGSBOptimizer.h +++ b/registration/clitkLBFGSBOptimizer.h @@ -93,10 +93,10 @@ public: /** Start optimization with an initial value. */ - void StartOptimization( void ); + virtual void StartOptimization( void ) ITK_OVERRIDE; /** Plug in a Cost Function into the optimizer */ - virtual void SetCostFunction( itk::SingleValuedCostFunction * costFunction ); + virtual void SetCostFunction( itk::SingleValuedCostFunction * costFunction ) ITK_OVERRIDE; /** Set the lower bound value for each variable. */ virtual void SetLowerBound( const BoundValueType & value ); @@ -160,12 +160,12 @@ public: itkGetConstReferenceMacro( InfinityNormOfProjectedGradient, double ); /** Get the reason for termination */ - const std::string GetStopConditionDescription() const; + virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE; protected: LBFGSBOptimizer(); virtual ~LBFGSBOptimizer(); - void PrintSelf(std::ostream& os, itk::Indent indent) const; + void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE; typedef Superclass::CostFunctionAdaptorType CostFunctionAdaptorType; diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetric.h b/registration/clitkOptNormalizedCorrelationImageToImageMetric.h index 242a4a1..46dcae9 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetric.h +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetric.h @@ -95,25 +95,25 @@ public: * (2) uniformly select NumberOfSpatialSamples within * the FixedImageRegion, and * (3) allocate memory for pdf data structures. */ - virtual void Initialize(void) throw ( itk::ExceptionObject ); + virtual void Initialize(void) throw ( itk::ExceptionObject ) ITK_OVERRIDE; /** Get the value. */ - MeasureType GetValue( const ParametersType & parameters ) const; + MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE; /** Get the derivatives of the match measure. */ void GetDerivative( const ParametersType & parameters, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; /** Get the value and derivatives for single valued optimizers. */ void GetValueAndDerivative( const ParametersType & parameters, MeasureType & Value, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; protected: NormalizedCorrelationImageToImageMetric(); virtual ~NormalizedCorrelationImageToImageMetric(); - void PrintSelf(std::ostream& os, itk::Indent indent) const; + void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE; private: @@ -129,7 +129,7 @@ private: inline bool GetValueThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, - double movingImageValue ) const; + double movingImageValue ) const ITK_OVERRIDE; inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, @@ -137,7 +137,7 @@ private: const MovingImagePointType & mappedPoint, double movingImageValue, const ImageDerivativesType & - movingImageGradientValue ) const; + movingImageGradientValue ) const ITK_OVERRIDE; AccumulateType *m_ThreaderSFF, *m_ThreaderSMM, *m_ThreaderSFM, *m_ThreaderSF, *m_ThreaderSM; mutable AccumulateType m_SFF, m_SMM, m_SFM, m_SF, m_SM; diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h index dc7ef9f..24afdbe 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h @@ -95,25 +95,25 @@ public: * (2) uniformly select NumberOfSpatialSamples within * the FixedImageRegion, and * (3) allocate memory for pdf data structures. */ - virtual void Initialize(void) throw ( itk::ExceptionObject ); + virtual void Initialize(void) throw ( itk::ExceptionObject ) ITK_OVERRIDE; /** Get the value. */ - MeasureType GetValue( const ParametersType & parameters ) const; + MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE; /** Get the derivatives of the match measure. */ void GetDerivative( const ParametersType & parameters, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; /** Get the value and derivatives for single valued optimizers. */ void GetValueAndDerivative( const ParametersType & parameters, MeasureType & Value, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; protected: NormalizedCorrelationImageToImageMetricFor3DBLUTFFD(); virtual ~NormalizedCorrelationImageToImageMetricFor3DBLUTFFD(); - void PrintSelf(std::ostream& os, itk::Indent indent) const; + void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE; private: @@ -129,7 +129,7 @@ private: inline bool GetValueThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, - double movingImageValue ) const; + double movingImageValue ) const ITK_OVERRIDE; inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, @@ -137,7 +137,7 @@ private: const MovingImagePointType & mappedPoint, double movingImageValue, const ImageDerivativesType & - movingImageGradientValue ) const; + movingImageGradientValue ) const ITK_OVERRIDE; AccumulateType *m_ThreaderSFF, *m_ThreaderSMM, *m_ThreaderSFM, *m_ThreaderSF, *m_ThreaderSM; mutable AccumulateType m_SFF, m_SMM, m_SFM, m_SF, m_SM; diff --git a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h index 1eaa49a..e914c1f 100644 --- a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h +++ b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h @@ -187,19 +187,19 @@ public: * (2) uniformly select NumberOfSpatialSamples within * the FixedImageRegion, and * (3) allocate memory for pdf data structures. */ - virtual void Initialize(void) throw ( ExceptionObject ); + virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE; /** Get the value. */ - MeasureType GetValue( const ParametersType & parameters ) const; + MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE; /** Get the derivatives of the match measure. */ void GetDerivative( const ParametersType & parameters, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; /** Get the value and derivatives for single valued optimizers. */ void GetValueAndDerivative( const ParametersType & parameters, MeasureType & Value, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; /** Number of bins to used in the histogram. Typical value is 50. */ itkSetClampMacro( NumberOfHistogramBins, unsigned long, @@ -238,7 +238,7 @@ protected: MattesMutualInformationImageToImageMetricFor3DBLUTFFD(); virtual ~MattesMutualInformationImageToImageMetricFor3DBLUTFFD(); - void PrintSelf(std::ostream& os, Indent indent) const; + void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE; private: @@ -330,26 +330,26 @@ private: virtual inline void GetValueThreadPreProcess( unsigned int threadID, - bool withinSampleThread ) const; + bool withinSampleThread ) const ITK_OVERRIDE; virtual inline bool GetValueThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, - double movingImageValue ) const; + double movingImageValue ) const ITK_OVERRIDE; virtual inline void GetValueThreadPostProcess( unsigned int threadID, - bool withinSampleThread ) const; + bool withinSampleThread ) const ITK_OVERRIDE; virtual inline void GetValueAndDerivativeThreadPreProcess( unsigned int threadID, - bool withinSampleThread ) const; + bool withinSampleThread ) const ITK_OVERRIDE; virtual inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, const ImageDerivativesType & - movingImageGradientValue ) const; + movingImageGradientValue ) const ITK_OVERRIDE; virtual inline void GetValueAndDerivativeThreadPostProcess( unsigned int threadID, - bool withinSampleThread ) const; + bool withinSampleThread ) const ITK_OVERRIDE; }; diff --git a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h index 949246d..06ecf29 100644 --- a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h +++ b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h @@ -98,25 +98,25 @@ public: * (2) uniformly select NumberOfSpatialSamples within * the FixedImageRegion, and * (3) allocate memory for pdf data structures. */ - virtual void Initialize(void) throw ( ExceptionObject ); + virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE; /** Get the value. */ - MeasureType GetValue( const ParametersType & parameters ) const; + MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE; /** Get the derivatives of the match measure. */ void GetDerivative( const ParametersType & parameters, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; /** Get the value and derivatives for single valued optimizers. */ void GetValueAndDerivative( const ParametersType & parameters, MeasureType & Value, - DerivativeType & Derivative ) const; + DerivativeType & Derivative ) const ITK_OVERRIDE; protected: MeanSquaresImageToImageMetricFor3DBLUTFFD(); virtual ~MeanSquaresImageToImageMetricFor3DBLUTFFD(); - void PrintSelf(std::ostream& os, Indent indent) const; + void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE; private: @@ -128,14 +128,14 @@ private: inline bool GetValueThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, - double movingImageValue ) const; + double movingImageValue ) const ITK_OVERRIDE; inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, const ImageDerivativesType & - movingImageGradientValue ) const; + movingImageGradientValue ) const ITK_OVERRIDE; MeasureType * m_ThreaderMSE; DerivativeType * m_ThreaderMSEDerivatives;