From d8388861b4baecd804c961797734093a0554660b Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 09:42:34 +0200 Subject: [PATCH 01/63] COMP: fix dynamic multithreading to use ITK 5.0 ITK 5.0 uses a different threading model compared to ITK 4.x. DynamicThreadedGenerateData() is the newer variant without threadId, and is the preferred signature, which is called by default. This variant can split the requested region into different number of pieces depending on current multi-processing load, which allows better load balancing. The non-dynamic (also known as classic) ThreadedGenerateData() signature has threadId, and number of pieces to be split into is known in advance. It is activated by calling this->DynamicMultiThreadingOff(); in derived class constructor. OTB_DISABLE_DYNAMIC_MT is a simple macro defined in otbMacro.h that insert this function call *IF* itk version used is 5.0 or above. Sample run-time exception: 2018-06-04 15:30:09 (DEBUG): Caught itk::ExceptionObject during application execution: 2018-06-04 15:30:09 (DEBUG): /usr/src/ports/itk/Modules/Core/Common/src/itkPoolMultiThreader.cxx:202: itk::ERROR: PoolMultiThreader(0xabad1dea): Exception occurred during SingleMethodExecute /home/rashad/local/include/ITK-5.0/itkImageSource.hxx:276: itk::ERROR: ShiftScaleImageFilter(0xabad1deaff): Subclass should override this method!!! If old behavior is desired invoke this->DynamicMultiThreadingOff(); before Update() is called. The best place is in class constructor. --- .../include/otbFunctionToImageFilter.hxx | 2 + Modules/Core/Common/include/otbMacro.h | 46 ++++++++++++++++++- ...ryFunctorNeighborhoodVectorImageFilter.hxx | 2 + ...ctorWithIndexWithOutputSizeImageFilter.hxx | 2 + .../Core/ImageBase/include/otbExtractROI.hxx | 1 + .../ImageBase/include/otbExtractROIBase.hxx | 1 + .../include/otbMultiChannelExtractROI.hxx | 1 + .../otbMultiToMonoChannelExtractROI.hxx | 2 +- ...abelImageToLabelMapWithAdjacencyFilter.hxx | 2 + .../otbDrawLineSpatialObjectFilter.hxx | 3 +- .../otbDrawLineSpatialObjectListFilter.hxx | 3 +- .../otbPointSetToDensityImageFilter.hxx | 3 +- .../otbHorizontalSobelVectorImageFilter.h | 1 + .../otbLineCorrelationDetectorImageFilter.hxx | 1 + .../otbLineRatioDetectorImageFilter.hxx | 1 + ...PixelSuppressionByDirectionImageFilter.hxx | 3 +- .../Edge/include/otbSobelVectorImageFilter.h | 1 + .../otbTouziEdgeDetectorImageFilter.hxx | 1 + .../otbRadiometricMomentsImageFilter.hxx | 1 + .../include/otbSFSTexturesImageFilter.hxx | 3 +- ...otbScalarImageToAdvancedTexturesFilter.hxx | 3 +- ...ScalarImageToHigherOrderTexturesFilter.hxx | 4 +- .../otbScalarImageToPanTexTextureFilter.hxx | 2 + .../otbScalarImageToTexturesFilter.hxx | 2 + .../include/otbCBAMIChangeDetector.h | 2 +- .../include/otbCorrelationChangeDetector.h | 2 +- .../include/otbJoinHistogramMIImageFilter.h | 4 +- .../include/otbMeanDifferenceImageFilter.h | 2 +- ...tivariateAlterationDetectorImageFilter.hxx | 1 + .../Contrast/include/otbApplyGainFilter.hxx | 2 + .../otbCLHistogramEqualizationFilter.hxx | 1 + .../include/otbComputeGainLutFilter.hxx | 5 +- .../include/otbComputeHistoFilter.hxx | 3 +- .../include/otbConvolutionImageFilter.hxx | 1 + .../DEM/include/otbDEMToImageGenerator.hxx | 1 + .../otbEstimateInnerProductPCAImageFilter.hxx | 2 + .../otbLocalActivityVectorImageFilter.h | 2 +- ...aximumAutocorrelationFactorImageFilter.hxx | 1 + ...otbNormalizeInnerProductPCAImageFilter.hxx | 1 + ...tbBinaryFunctorNeighborhoodImageFilter.hxx | 3 +- ...ryFunctorNeighborhoodVectorImageFilter.hxx | 3 ++ .../otbBinaryImageToDensityImageFilter.hxx | 1 + .../include/otbBoxAndWhiskerImageFilter.hxx | 3 +- .../include/otbClampImageFilter.hxx | 2 + .../otbConcatenateVectorImageFilter.hxx | 2 + ...bFunctionWithNeighborhoodToImageFilter.hxx | 1 + .../include/otbGridResampleImageFilter.hxx | 1 + .../include/otbInPlacePassFilter.h | 1 + .../include/otbMatrixImageFilter.hxx | 2 + ...tbNRIBandImagesToOneNComplexBandsImage.hxx | 5 +- .../otbSpectralAngleDistanceImageFilter.hxx | 1 + ...StreamingInnerProductVectorImageFilter.hxx | 1 + ...eamingMatrixTransposeMatrixImageFilter.hxx | 1 + .../include/otbStreamingShrinkImageFilter.hxx | 1 + .../include/otbThresholdVectorImageFilter.hxx | 2 + .../include/otbTileImageFilter.hxx | 5 +- ...tbTwoNRIBandsImageToNComplexBandsImage.hxx | 2 + ...otbUnaryFunctorNeighborhoodImageFilter.hxx | 3 +- ...nctorNeighborhoodWithOffsetImageFilter.hxx | 2 + .../otbUnaryFunctorWithIndexImageFilter.hxx | 2 + ...UnaryImageFunctorWithVectorImageFilter.hxx | 2 + .../otbVectorImageTo3DScalarImageFilter.hxx | 5 +- .../include/otbFrostImageFilter.hxx | 3 +- .../include/otbGammaMAPImageFilter.hxx | 3 +- .../ImageNoise/include/otbKuanImageFilter.hxx | 3 +- .../ImageNoise/include/otbLeeImageFilter.hxx | 2 + .../include/otbBandMathImageFilter.hxx | 1 + .../include/otbMaskMuParserFilter.hxx | 1 + .../include/otbBandMathXImageFilter.hxx | 2 +- ...ltiChannelsPolarimetricSynthesisFilter.hxx | 2 + .../otbMeanShiftSmoothingImageFilter.hxx | 1 + .../include/otbNormalizeVectorImageFilter.hxx | 1 + .../otbStreamingCompareImageFilter.hxx | 1 + ...otbStreamingHistogramVectorImageFilter.hxx | 2 +- .../include/otbStreamingMinMaxImageFilter.hxx | 1 + .../otbStreamingMinMaxVectorImageFilter.hxx | 1 + .../otbStreamingStatisticsImageFilter.hxx | 3 +- ...tbStreamingStatisticsVectorImageFilter.hxx | 1 + .../include/otbVarianceImageFilter.hxx | 2 + .../otbVectorImageToIntensityImageFilter.hxx | 2 +- .../otbVectorImageToMatrixImageFilter.hxx | 1 + .../Wavelet/include/otbSubsampleImageFilter.h | 2 + .../Wavelet/include/otbWaveletFilterBank.hxx | 2 + ...BandsListToWaveletsSynopsisImageFilter.hxx | 4 +- .../include/otbDifferenceImageFilter.hxx | 1 + .../otbDSFusionOfClassifiersImageFilter.hxx | 2 + .../otbImageDimensionalityReductionFilter.hxx | 1 + .../include/otbImageClassificationFilter.hxx | 3 ++ .../otbKMeansImageClassificationFilter.hxx | 2 + .../otbSOMImageClassificationFilter.hxx | 1 + .../include/otbImageToRadianceImageFilter.h | 1 + .../otbRadianceToReflectanceImageFilter.h | 1 + .../otbReflectanceToRadianceImageFilter.h | 1 + ...ectanceToSurfaceReflectanceImageFilter.hxx | 1 + .../include/otbSarDeburstImageFilter.hxx | 5 +- ...SarRadiometricCalibrationToImageFilter.hxx | 2 +- .../include/otbDisparityTranslateFilter.hxx | 3 +- .../otbMultiDisparityMapTo3DFilter.hxx | 1 + .../otbPixelWiseBlockMatchingImageFilter.hxx | 2 + .../otbSubPixelDisparityImageFilter.hxx | 2 + .../include/otbBijectionCoherencyFilter.hxx | 2 + .../include/otbMulti3DMapToDEMFilter.hxx | 1 + .../include/otbLabelToBoundaryImageFilter.h | 3 +- ...ScaleConvexOrConcaveClassificationFilter.h | 1 + 104 files changed, 212 insertions(+), 37 deletions(-) diff --git a/Modules/Core/Common/include/otbFunctionToImageFilter.hxx b/Modules/Core/Common/include/otbFunctionToImageFilter.hxx index 7a35c8dd2f..e79b5f4748 100644 --- a/Modules/Core/Common/include/otbFunctionToImageFilter.hxx +++ b/Modules/Core/Common/include/otbFunctionToImageFilter.hxx @@ -22,6 +22,7 @@ #ifndef otbFunctionToImageFilter_hxx #define otbFunctionToImageFilter_hxx +#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT #include "otbFunctionToImageFilter.h" #include "itkImageRegionConstIterator.h" #include "itkProgressReporter.h" @@ -36,6 +37,7 @@ template FunctionToImageFilter ::FunctionToImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->InPlaceOff(); m_PixelFunction = FunctionType::New(); } diff --git a/Modules/Core/Common/include/otbMacro.h b/Modules/Core/Common/include/otbMacro.h index f83adbe0b6..3c97238991 100644 --- a/Modules/Core/Common/include/otbMacro.h +++ b/Modules/Core/Common/include/otbMacro.h @@ -42,7 +42,51 @@ namespace otb { } // end namespace otb - this is here for documentation purposes - +/* ITK 5.0 uses a different threading model compared to ITK 4.x. + * This has a significant impact on OTB as we make heavy use of itk filters. + * DynamicThreadedGenerateData() is the newer variant without threadId, + * and is the preferred signature, which is called by default. This + * variant can split the requested region into different number of + * pieces depending on current multi-processing load, which allows + * better load balancing. The non-dynamic (also known as classic) + * ThreadedGenerateData() signature has threadId, and number of pieces + * to be split into is known in advance. It is activated by calling + * this->DynamicMultiThreadingOff(); in derived class constructor. + * + * OTB uses ThreadedGenerateData() with threadId and thus required + * to call this->DynamicMultiThreadingOff(); in filter's constructor. + * + * OTB_DISABLE_DYNAMIC_MT is a simple macro that insert this + * function call *IF* itk version used is 5.0 or above. + * This macro expands to empty when OTB is built with ITK 4.x and + * this ease from ITK 4.x to ITK 5.x. Ideally ThreadedGenerateData() function + * everywhere in OTB must be replace with DynamicThreadedGenerateData(). + * This for sure is not a glorified sed command. Usage of function parameter + * threadId (and progress reporter) must be removed as well. + * + * It also leads us into a situation that OTB will no longer work with ITK 4.x. + * We cannot break that until ITK 5.0 is available on all platforms and is well tested. + * As time of writing this patch ITK 5.0 is in alpha release. + * Eventually OTB can move up in direction where it is requires ITK 5.0 or. + * But until things are resolved this macro based compatibility must stay. + * + * Finally please note that OTB_DISABLE_DYNAMIC_MT does not disable multithreading. + * Method or macro name can sometimes cause confusion when reading code. + * + * sample run-time exception: + * ========================= + * 2018-06-04 15:30:09 (DEBUG): Caught itk::ExceptionObject during application execution: + * 2018-06-04 15:30:09 (DEBUG): /usr/src/ports/itk/Modules/Core/Common/src/itkPoolMultiThreader.cxx:202: + * itk::ERROR: PoolMultiThreader(0xabad1dea): Exception occurred during SingleMethodExecute + * /home/rashad/local/include/ITK-5.0/itkImageSource.hxx:276: + * itk::ERROR: ShiftScaleImageFilter(0xabad1deaff): Subclass should override this method!!! + * If old behavior is desired invoke this->DynamicMultiThreadingOff(); before Update() is called. The best place is in class constructor. + */ +#if ITK_VERSION_MAJOR < 5 +#define OTB_DISABLE_DYNAMIC_MT +#else +#define OTB_DISABLE_DYNAMIC_MT this->DynamicMultiThreadingOff(); +#endif #define otbFileContext(x) \ << "file " __FILE__ ", line " << __LINE__<<", " x diff --git a/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx b/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx index 1784ac381f..263e92a754 100644 --- a/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx +++ b/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx @@ -22,6 +22,7 @@ #define otbUnaryFunctorNeighborhoodVectorImageFilter_hxx #include "otbUnaryFunctorNeighborhoodVectorImageFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" #include "itkProgressReporter.h" @@ -36,6 +37,7 @@ template UnaryFunctorNeighborhoodVectorImageFilter ::UnaryFunctorNeighborhoodVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); for ( unsigned int i = 0; i < InputImageDimension; ++i ) diff --git a/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx b/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx index aee8a12256..306093588e 100644 --- a/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx +++ b/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx @@ -24,6 +24,7 @@ #include "otbUnaryFunctorWithIndexWithOutputSizeImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" +#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -34,6 +35,7 @@ template UnaryFunctorWithIndexWithOutputSizeImageFilter ::UnaryFunctorWithIndexWithOutputSizeImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); } template diff --git a/Modules/Core/ImageBase/include/otbExtractROI.hxx b/Modules/Core/ImageBase/include/otbExtractROI.hxx index 932ebe73ae..3625640466 100644 --- a/Modules/Core/ImageBase/include/otbExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbExtractROI.hxx @@ -35,6 +35,7 @@ template ExtractROI ::ExtractROI() //: ExtractROIBase< itk::Image , itk::Image >() { + OTB_DISABLE_DYNAMIC_MT } /** diff --git a/Modules/Core/ImageBase/include/otbExtractROIBase.hxx b/Modules/Core/ImageBase/include/otbExtractROIBase.hxx index 0f4395c1e9..d80bbd1eee 100644 --- a/Modules/Core/ImageBase/include/otbExtractROIBase.hxx +++ b/Modules/Core/ImageBase/include/otbExtractROIBase.hxx @@ -41,6 +41,7 @@ ExtractROIBase m_SizeX(0), m_SizeY(0) { + OTB_DISABLE_DYNAMIC_MT } /** diff --git a/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx b/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx index 5de4891097..a8234471d8 100644 --- a/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx @@ -42,6 +42,7 @@ MultiChannelExtractROI m_LastChannel(0), m_ChannelsKind(0) { + OTB_DISABLE_DYNAMIC_MT ClearChannels(); } diff --git a/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx b/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx index 21f8b5b669..e6adedab14 100644 --- a/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx @@ -34,7 +34,7 @@ MultiToMonoChannelExtractROI ::MultiToMonoChannelExtractROI() : ExtractROIBase, Image >(), m_Channel(1) { - + OTB_DISABLE_DYNAMIC_MT } /** diff --git a/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx b/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx index 906a4fe69d..69335351ab 100644 --- a/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx +++ b/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx @@ -22,6 +22,7 @@ #ifndef otbLabelImageToLabelMapWithAdjacencyFilter_hxx #define otbLabelImageToLabelMapWithAdjacencyFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbLabelImageToLabelMapWithAdjacencyFilter.h" #include "itkNumericTraits.h" #include "itkProgressReporter.h" @@ -34,6 +35,7 @@ template LabelImageToLabelMapWithAdjacencyFilter ::LabelImageToLabelMapWithAdjacencyFilter() { + OTB_DISABLE_DYNAMIC_MT m_BackgroundValue = itk::NumericTraits::NonpositiveMin(); } diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx index 12080e6d6d..96f2aef1f2 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx @@ -27,7 +27,7 @@ #include "itkMacro.h" #include "itkImageRegionIterator.h" #include "itkImageIteratorWithIndex.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -37,6 +37,7 @@ namespace otb template DrawLineSpatialObjectFilter::DrawLineSpatialObjectFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx index 0f8af7bf80..a464e8b2db 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx @@ -22,7 +22,7 @@ #define otbDrawLineSpatialObjectListFilter_hxx #include "otbDrawLineSpatialObjectListFilter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkLineIterator.h" #include "itkDataObject.h" #include "itkImageRegionIterator.h" @@ -37,6 +37,7 @@ template DrawLineSpatialObjectListFilter ::DrawLineSpatialObjectListFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx b/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx index fd5f6c99fb..86d0b005ac 100644 --- a/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx +++ b/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx @@ -24,7 +24,7 @@ #include "otbPointSetToDensityImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { /**--------------------------------------------------------- @@ -34,6 +34,7 @@ template PointSetToDensityImageFilter ::PointSetToDensityImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius = 1; } diff --git a/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h b/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h index 92bd297161..d837d7c6ae 100644 --- a/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h @@ -88,6 +88,7 @@ public: protected: HorizontalSobelVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT typename Superclass::RadiusType radius = {{1, 1}}; this->SetRadius( radius ); } diff --git a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx index 8e325a93c9..f8f6392cf6 100644 --- a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx @@ -41,6 +41,7 @@ template ::LineCorrelationDetectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->m_Radius.Fill(1); this->m_LengthLine = 1; this->m_WidthLine = 0; diff --git a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx index fa70430f64..67688153d5 100644 --- a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx @@ -42,6 +42,7 @@ template ::LineRatioDetectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->m_Radius.Fill(1); this->m_LengthLine = 1; this->m_WidthLine = 0; diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx index e468505fec..ac23633310 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbPixelSuppressionByDirectionImageFilter_hxx #define otbPixelSuppressionByDirectionImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbPixelSuppressionByDirectionImageFilter.h" #include "itkDataObject.h" @@ -42,7 +43,7 @@ namespace otb template PixelSuppressionByDirectionImageFilter::PixelSuppressionByDirectionImageFilter() { - +OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); m_AngularBeam = static_cast(0.); diff --git a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h index 94a31c6fb7..8ed74b4a2c 100644 --- a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h @@ -97,6 +97,7 @@ public: protected: SobelVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT typename Superclass::RadiusType radius = {{1, 1}}; this->SetRadius( radius ); } diff --git a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx index 77f930626b..737590d6f7 100644 --- a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx @@ -41,6 +41,7 @@ namespace otb template TouziEdgeDetectorImageFilter::TouziEdgeDetectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); } diff --git a/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx b/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx index 64027caab9..e4b5320588 100644 --- a/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx +++ b/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx @@ -37,6 +37,7 @@ template RadiometricMomentsImageFilter ::RadiometricMomentsImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); } diff --git a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx index 9127016914..8c37525487 100644 --- a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx +++ b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx @@ -27,7 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" #include "otbMath.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -35,6 +35,7 @@ template SFSTexturesImageFilter ::SFSTexturesImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(6); diff --git a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx index 52d68d939b..fb4453b7fc 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx @@ -28,7 +28,7 @@ #include "itkProgressReporter.h" #include "itkNumericTraits.h" #include - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { template @@ -43,6 +43,7 @@ ScalarImageToAdvancedTexturesFilter , m_SubsampleFactor() , m_SubsampleOffset() { + OTB_DISABLE_DYNAMIC_MT // There are 10 outputs corresponding to the 9 textures indices this->SetNumberOfRequiredOutputs(10); diff --git a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx index 9c842f44b3..61da035954 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbScalarImageToHigherOrderTexturesFilter_hxx #define otbScalarImageToHigherOrderTexturesFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbScalarImageToHigherOrderTexturesFilter.h" #include "itkImageRegionIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -40,9 +41,10 @@ ScalarImageToHigherOrderTexturesFilter m_SubsampleOffset() { // There are 10 outputs corresponding to the 8 textures indices + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredOutputs(10); - // Create the 11 outputs + // Create the 10 outputs this->SetNthOutput(0, OutputImageType::New()); this->SetNthOutput(1, OutputImageType::New()); this->SetNthOutput(2, OutputImageType::New()); diff --git a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx index ce6aba7c14..4681b2a59b 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx @@ -27,6 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" #include "itkNumericTraits.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -37,6 +38,7 @@ ScalarImageToPanTexTextureFilter m_InputImageMinimum(0), m_InputImageMaximum(255) { + OTB_DISABLE_DYNAMIC_MT // There are 1 output corresponding to the Pan Tex texture indice this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx index 3ff2053790..02cc6747bc 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx @@ -30,6 +30,7 @@ #include "itkNumericTraits.h" #include #include +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -45,6 +46,7 @@ ScalarImageToTexturesFilter , m_SubsampleFactor() , m_SubsampleOffset() { + OTB_DISABLE_DYNAMIC_MT // There are 8 outputs corresponding to the 8 textures indices this->SetNumberOfRequiredOutputs(8); diff --git a/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h b/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h index 8faf7c6bd7..15739904c1 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h +++ b/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h @@ -83,7 +83,7 @@ public: itkTypeMacro(CBAMIChangeDetector, SuperClass); protected: - CBAMIChangeDetector() {} + CBAMIChangeDetector() {OTB_DISABLE_DYNAMIC_MT} ~CBAMIChangeDetector() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h b/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h index e39ba7a482..13ae285680 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h +++ b/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h @@ -82,7 +82,7 @@ public: itkTypeMacro(CorrelationChangeDetector, SuperClass); protected: - CorrelationChangeDetector() {} + CorrelationChangeDetector() {OTB_DISABLE_DYNAMIC_MT} ~CorrelationChangeDetector() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h index 3b60293e6d..3c7ffef46e 100644 --- a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h @@ -83,7 +83,9 @@ public: itkTypeMacro(JoinHistogramMIImageFilter, SuperClass); protected: - JoinHistogramMIImageFilter() {} + JoinHistogramMIImageFilter() { +OTB_DISABLE_DYNAMIC_MT + } ~JoinHistogramMIImageFilter() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h index 5bc8d44f4e..649c729833 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h @@ -81,7 +81,7 @@ public: itkTypeMacro(MeanDifferenceImageFilter, SuperClass); protected: - MeanDifferenceImageFilter() {} + MeanDifferenceImageFilter() {OTB_DISABLE_DYNAMIC_MT} ~MeanDifferenceImageFilter() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx index 73fe6bde5d..cc1aa5a606 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx +++ b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx @@ -36,6 +36,7 @@ template MultivariateAlterationDetectorImageFilter ::MultivariateAlterationDetectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); m_CovarianceEstimator = CovarianceEstimatorType::New(); } diff --git a/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx b/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx index 4912bfa205..d264fa1e95 100644 --- a/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx @@ -25,6 +25,7 @@ #include "itkImageRegionIterator.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkContinuousIndex.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include @@ -34,6 +35,7 @@ template ApplyGainFilter < TInputImage , TLut , TOutputImage > ::ApplyGainFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); m_Min = std::numeric_limits< InputPixelType >::quiet_NaN(); m_Max = std::numeric_limits< InputPixelType >::quiet_NaN(); diff --git a/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx b/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx index 356df1b960..c3437a6ed7 100644 --- a/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx @@ -37,6 +37,7 @@ m_ApplyGainFilter ( ApplyGainFilter::New() ) , m_StreamingImageFilter ( StreamingImageFilter::New() ) , m_BufferFilter ( BufferFilter::New() ) { + OTB_DISABLE_DYNAMIC_MT m_Min = std::numeric_limits< InputPixelType >::quiet_NaN(); m_Max = std::numeric_limits< InputPixelType >::quiet_NaN(); m_NbBin = 256; diff --git a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx index 3dbe379877..b1e94450b2 100644 --- a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx @@ -23,7 +23,7 @@ #include "otbComputeGainLutFilter.h" #include "itkImageRegionIterator.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include #include @@ -34,7 +34,8 @@ template < class TInputImage, class TOutputImage > ComputeGainLutFilter < TInputImage , TOutputImage > ::ComputeGainLutFilter() { - m_NbBin = 256; + OTB_DISABLE_DYNAMIC_MT + m_NbBin = 256; m_NbPixel = 0; m_Min = std::numeric_limits< double >::quiet_NaN(); m_Max = std::numeric_limits< double >::quiet_NaN(); diff --git a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx index a5ad85c009..f0755e7547 100644 --- a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx @@ -22,9 +22,9 @@ #define otbComputeHistoFilter_hxx #include "otbComputeHistoFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include - namespace otb { @@ -32,6 +32,7 @@ template ComputeHistoFilter < TInputImage , TOutputImage > ::ComputeHistoFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredOutputs(2); this->SetNthOutput( 0, this->MakeOutput(0) ); this->SetNthOutput( 1, this->MakeOutput(1) ); diff --git a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx index 302b1a0543..0498992eba 100644 --- a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx @@ -38,6 +38,7 @@ template ::ConvolutionImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); m_Filter.SetSize(3 * 3); m_Filter.Fill(1); diff --git a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx index 867632e82b..a2d660cd7a 100644 --- a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx +++ b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx @@ -32,6 +32,7 @@ template DEMToImageGenerator ::DEMToImageGenerator() { + OTB_DISABLE_DYNAMIC_MT m_DEMHandler = DEMHandlerType::Instance(); m_OutputSpacing[0] = 0.0001; m_OutputSpacing[1] = -0.0001; diff --git a/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx index 24cbb84deb..191465daee 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbEstimateInnerProductPCAImageFilter_hxx #define otbEstimateInnerProductPCAImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbEstimateInnerProductPCAImageFilter.h" #include @@ -36,6 +37,7 @@ template EstimateInnerProductPCAImageFilter ::EstimateInnerProductPCAImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_NumberOfPrincipalComponentsRequired = 1; } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h b/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h index 2ba6e47035..18fca03900 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h +++ b/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h @@ -108,7 +108,7 @@ public: itkTypeMacro(LocalActivityVectorImageFilter, ImageToImageFilter); protected: - LocalActivityVectorImageFilter() { } + LocalActivityVectorImageFilter() { OTB_DISABLE_DYNAMIC_MT } ~LocalActivityVectorImageFilter() override { } private: diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx index 2cc202cdbd..0a74b0a6a3 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx @@ -39,6 +39,7 @@ template MaximumAutocorrelationFactorImageFilter ::MaximumAutocorrelationFactorImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_CovarianceEstimator = CovarianceEstimatorType::New(); m_CovarianceEstimatorH = CovarianceEstimatorType::New(); m_CovarianceEstimatorV = CovarianceEstimatorType::New(); diff --git a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx index 699f09e3f1..4c01f9c5f2 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx @@ -36,6 +36,7 @@ template NormalizeInnerProductPCAImageFilter ::NormalizeInnerProductPCAImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); this->InPlaceOff(); diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx index b6e7fc4044..3bbf51a358 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx @@ -25,7 +25,7 @@ #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" #include "itkProgressReporter.h" - +#include "otbMacro.h" namespace otb { @@ -37,6 +37,7 @@ template ::BinaryFunctorNeighborhoodImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); m_Radius.Fill(3); } diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx index ac4d49dc4f..6a1c3d3415 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx @@ -21,6 +21,8 @@ #ifndef otbBinaryFunctorNeighborhoodVectorImageFilter_hxx #define otbBinaryFunctorNeighborhoodVectorImageFilter_hxx +#include "otbMath.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbBinaryFunctorNeighborhoodVectorImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -37,6 +39,7 @@ template ::BinaryFunctorNeighborhoodVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); this->InPlaceOff(); m_Radius = 3; diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx index c6cc7a6625..2f965d3eb9 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx @@ -36,6 +36,7 @@ template BinaryImageToDensityImageFilter ::BinaryImageToDensityImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_NeighborhoodRadius.Fill(1); m_CountFunction = CountFunctionType::New(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx index 9b5da23ba1..28ac0e1815 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx @@ -24,7 +24,7 @@ #include #include - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkConstNeighborhoodIterator.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -39,6 +39,7 @@ template BoxAndWhiskerImageFilter ::BoxAndWhiskerImageFilter () { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); this->InPlaceOn(); diff --git a/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx index b3d8f1ca31..2f3858a9ed 100644 --- a/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx @@ -23,6 +23,7 @@ #define otbClampImageFilter_hxx #include "otbClampImageFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" #include @@ -39,6 +40,7 @@ template ClampImageFilter ::ClampImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Lower = std::numeric_limits < OutputPixelValueType >::lowest(); m_Upper = std::numeric_limits < OutputPixelValueType >::max(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx index 073ba588d1..f05913335a 100644 --- a/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx @@ -22,6 +22,7 @@ #define otbConcatenateVectorImageFilter_hxx #include "otbConcatenateVectorImageFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -35,6 +36,7 @@ ConcatenateVectorImageFilter ::ConcatenateVectorImageFilter() { this->SetNumberOfRequiredInputs(2); + OTB_DISABLE_DYNAMIC_MT } /** * Destructor. diff --git a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx index 9fc4bd2113..a6f15b7d86 100644 --- a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx @@ -35,6 +35,7 @@ template FunctionWithNeighborhoodToImageFilter ::FunctionWithNeighborhoodToImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->InPlaceOff(); this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); diff --git a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx index a954d9854c..34e5cf5a43 100644 --- a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx @@ -47,6 +47,7 @@ GridResampleImageFilter m_Interpolator(), m_ReachableOutputRegion() { + OTB_DISABLE_DYNAMIC_MT // Set linear interpolator as default m_Interpolator = dynamic_cast(DefaultInterpolatorType::New().GetPointer()); diff --git a/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h b/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h index 153a728bb3..2f7f4d5206 100644 --- a/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h @@ -63,6 +63,7 @@ public: protected: InPlacePassFilter() { + OTB_DISABLE_DYNAMIC_MT this->InPlaceOn(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx index ff54cc6607..6ffc8219a6 100644 --- a/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbMatrixImageFilter_hxx #define otbMatrixImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbMatrixImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -34,6 +35,7 @@ namespace otb template MatrixImageFilter::MatrixImageFilter() : m_MatrixByVector(false) { + OTB_DISABLE_DYNAMIC_MT } template diff --git a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx index cff87ef48c..a2bb44f30b 100644 --- a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx @@ -21,6 +21,7 @@ #ifndef otbNRIBandImagesToOneNComplexBandsImage_hxx #define otbNRIBandImagesToOneNComplexBandsImage_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbNRIBandImagesToOneNComplexBandsImage.h" #include "itkImageRegionIterator.h" @@ -28,9 +29,6 @@ #include "itkProgressReporter.h" #include "itkVariableLengthVector.h" - - - namespace otb { @@ -41,6 +39,7 @@ template NRIBandImagesToOneNComplexBandsImage::NRIBandImagesToOneNComplexBandsImage() { //this->SetNumberOfThreads(1); + OTB_DISABLE_DYNAMIC_MT } /** diff --git a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx index fa99a2aea0..94d8cc2923 100644 --- a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx @@ -36,6 +36,7 @@ template SpectralAngleDistanceImageFilter ::SpectralAngleDistanceImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_ReferencePixel = 0; } diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx index a6950f6509..1d4cfe3220 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx @@ -36,6 +36,7 @@ template PersistentInnerProductVectorImageFilter ::PersistentInnerProductVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx index f6719ab12e..c4defa5a4b 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx @@ -35,6 +35,7 @@ template PersistentMatrixTransposeMatrixImageFilter ::PersistentMatrixTransposeMatrixImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); // first output is a copy of the image, DataObject created by diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx index 0da76af598..90e434c8e6 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx @@ -64,6 +64,7 @@ PersistentShrinkImageFilter ::PersistentShrinkImageFilter() : m_ShrinkFactor(10) { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx index 88146169b0..f5efc80a3f 100644 --- a/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx @@ -22,6 +22,7 @@ #ifndef otbThresholdVectorImageFilter_hxx #define otbThresholdVectorImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbThresholdVectorImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" @@ -38,6 +39,7 @@ template ThresholdVectorImageFilter ::ThresholdVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_OutsideValue = itk::NumericTraits::Zero; m_Lower = itk::NumericTraits::NonpositiveMin(); m_Upper = itk::NumericTraits::max(); diff --git a/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx index 6257269507..ea3bceeaad 100644 --- a/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx @@ -23,13 +23,16 @@ #include "otbTileImageFilter.h" #include "itkImageRegionIterator.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { template TileImageFilter ::TileImageFilter() -{} +{ + OTB_DISABLE_DYNAMIC_MT +} template TileImageFilter diff --git a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx index ce4281b448..64d075d8dc 100644 --- a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx @@ -21,6 +21,7 @@ #ifndef otbTwoNRIBandsImageToNComplexBandsImage_hxx #define otbTwoNRIBandsImageToNComplexBandsImage_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbTwoNRIBandsImageToNComplexBandsImage.h" #include "itkImageRegionIterator.h" @@ -40,6 +41,7 @@ namespace otb template TwoNRIBandsImageToNComplexBandsImage::TwoNRIBandsImageToNComplexBandsImage() { + OTB_DISABLE_DYNAMIC_MT //this->SetNumberOfThreads(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx index 273a267e7e..941792900e 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx @@ -27,7 +27,7 @@ #include "itkProgressReporter.h" #include "itkZeroFluxNeumannBoundaryCondition.h" #include "itkNeighborhoodAlgorithm.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { /** @@ -37,6 +37,7 @@ template UnaryFunctorNeighborhoodImageFilter ::UnaryFunctorNeighborhoodImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx index 20ae4caf80..ef1064e283 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbUnaryFunctorNeighborhoodWithOffsetImageFilter_hxx #define otbUnaryFunctorNeighborhoodWithOffsetImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbUnaryFunctorNeighborhoodWithOffsetImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -37,6 +38,7 @@ template UnaryFunctorNeighborhoodWithOffsetImageFilter ::UnaryFunctorNeighborhoodWithOffsetImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); m_Offset.Fill(1); diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx index c125b284f6..b171c146e9 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx @@ -24,6 +24,7 @@ #include "otbUnaryFunctorWithIndexImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -34,6 +35,7 @@ template UnaryFunctorWithIndexImageFilter ::UnaryFunctorWithIndexImageFilter() { +OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); } template diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx index f38dbb9f74..5df19328f4 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx @@ -22,6 +22,7 @@ #define otbUnaryImageFunctorWithVectorImageFilter_hxx #include "otbUnaryImageFunctorWithVectorImageFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -35,6 +36,7 @@ template UnaryImageFunctorWithVectorImageFilter ::UnaryImageFunctorWithVectorImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx index 3481e47f13..9d9af7e699 100644 --- a/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbVectorImageTo3DScalarImageFilter_hxx #define otbVectorImageTo3DScalarImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbVectorImageTo3DScalarImageFilter.h" #include "itkImageRegionConstIterator.h" #include "itkImageSliceIteratorWithIndex.h" @@ -33,7 +34,9 @@ namespace otb template VectorImageTo3DScalarImageFilter ::VectorImageTo3DScalarImageFilter() -{} +{ + OTB_DISABLE_DYNAMIC_MT +} /** Generate output information */ template void diff --git a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx index f372ad59f9..5cc35986db 100644 --- a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -40,6 +40,7 @@ namespace otb template FrostImageFilter::FrostImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); m_Deramp = 2; } diff --git a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx index 2d4b0d663e..88f625f2b9 100644 --- a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -40,6 +40,7 @@ namespace otb template GammaMAPImageFilter::GammaMAPImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx index 68eaf10062..e4614d10ee 100644 --- a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -40,6 +40,7 @@ namespace otb template KuanImageFilter::KuanImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx index 1c4fbadf5e..69c22db03a 100644 --- a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx @@ -23,6 +23,7 @@ #include "otbLeeImageFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkDataObject.h" #include "itkConstNeighborhoodIterator.h" #include "itkNeighborhoodInnerProduct.h" @@ -40,6 +41,7 @@ namespace otb template LeeImageFilter::LeeImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx index 8ac2705032..520dbef344 100644 --- a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx +++ b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx @@ -42,6 +42,7 @@ BandMathImageFilter { //This number will be incremented each time an image //is added over the one minimumrequired + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs( 1 ); this->InPlaceOff(); diff --git a/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx b/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx index 5c0e60b3a3..eb2f490143 100644 --- a/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx +++ b/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx @@ -35,6 +35,7 @@ namespace otb template MaskMuParserFilter::MaskMuParserFilter() { + OTB_DISABLE_DYNAMIC_MT m_UnderflowCount = 0; m_OverflowCount = 0; m_ThreadUnderflow.SetSize(1); diff --git a/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx b/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx index 6092926c7d..26f999ecef 100644 --- a/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx +++ b/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx @@ -48,7 +48,7 @@ BandMathXImageFilter //This number will be incremented each time an image //is added over the one minimumrequired this->SetNumberOfRequiredInputs( 1 ); - + OTB_DISABLE_DYNAMIC_MT m_UnderflowCount = 0; m_OverflowCount = 0; m_ThreadUnderflow.SetSize(1); diff --git a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx index 6a0de27267..e7fe38a6c3 100644 --- a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx +++ b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx @@ -27,6 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" #include "otbMath.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -38,6 +39,7 @@ template MultiChannelsPolarimetricSynthesisFilter ::MultiChannelsPolarimetricSynthesisFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); SetEmissionH(false); diff --git a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx index 8a64b7c860..4a1450e1de 100644 --- a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx @@ -47,6 +47,7 @@ MeanShiftSmoothingImageFilterSetNumberOfRequiredOutputs(4); this->SetNthOutput(0, OutputImageType::New()); this->SetNthOutput(1, OutputSpatialImageType::New()); diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx index 188d892c89..9bcd8ce2c8 100644 --- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx @@ -29,6 +29,7 @@ template < class TInputImage, class TOutputImage > NormalizeVectorImageFilter< TInputImage, TOutputImage > ::NormalizeVectorImageFilter () { + OTB_DISABLE_DYNAMIC_MT m_IsGivenMean = false; m_IsGivenStdDev = false; diff --git a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx index fc9d29ac02..dfab641323 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx @@ -35,6 +35,7 @@ PersistentCompareImageFilter ::PersistentCompareImageFilter() : m_SquareOfDifferences(1), m_AbsoluteValueOfDifferences(1), m_ThreadMinRef(1), m_ThreadMaxRef(1), m_Count(1), m_DiffCount(1), m_PhysicalSpaceCheck(true) { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs( 2 ); // first output is a copy of the image, DataObject created by // superclass diff --git a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx index 7faf8fe795..e64dd6422d 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx @@ -49,7 +49,7 @@ PersistentHistogramVectorImageFilter // just decorators around pixel types and histogram list m_Size.Fill(255); - + OTB_DISABLE_DYNAMIC_MT HistogramListPointerType output = static_cast(this->MakeOutput(1).GetPointer()); this->itk::ProcessObject::SetNthOutput(1, output.GetPointer()); } diff --git a/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx index a3f5fde674..33853a9b66 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx @@ -35,6 +35,7 @@ template PersistentMinMaxImageFilter ::PersistentMinMaxImageFilter() { + OTB_DISABLE_DYNAMIC_MT // TODO : SetNumberOfRequiredOutputs // first output is a copy of the image, DataObject created by diff --git a/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx index 311b01e316..a0afaf35a2 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx @@ -38,6 +38,7 @@ PersistentMinMaxVectorImageFilter : m_NoDataFlag(false), m_NoDataValue(itk::NumericTraits::Zero) { + OTB_DISABLE_DYNAMIC_MT // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx index 1ea91025fc..1d097218dd 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx @@ -40,7 +40,8 @@ PersistentStatisticsImageFilter m_ThreadMax(1), m_IgnoreInfiniteValues(true), m_IgnoreUserDefinedValue(false) - { +{ + OTB_DISABLE_DYNAMIC_MT // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx index cf1d13ff75..41cad2d611 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx @@ -41,6 +41,7 @@ PersistentStreamingStatisticsVectorImageFilter m_IgnoreUserDefinedValue(false), m_UserIgnoredValue(itk::NumericTraits::Zero) { + OTB_DISABLE_DYNAMIC_MT // first output is a copy of the image, DataObject created by // superclass diff --git a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx index 4a36287a0b..d78222efe4 100644 --- a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbVarianceImageFilter_hxx #define otbVarianceImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbVarianceImageFilter.h" #include "itkConstNeighborhoodIterator.h" @@ -37,6 +38,7 @@ template VarianceImageFilter ::VarianceImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Radius.Fill(1); } diff --git a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx index 9b411cdfee..09dac31e8f 100644 --- a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx @@ -36,7 +36,7 @@ template VectorImageToIntensityImageFilter ::VectorImageToIntensityImageFilter() { - +OTB_DISABLE_DYNAMIC_MT } template diff --git a/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx index c92ea88fe7..649b488936 100644 --- a/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx @@ -35,6 +35,7 @@ template PersistentVectorImageToMatrixFilter ::PersistentVectorImageToMatrixFilter() { + OTB_DISABLE_DYNAMIC_MT // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h b/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h index 6fe5288153..8692e1ebeb 100644 --- a/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h +++ b/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h @@ -25,6 +25,7 @@ #include "itkImageToImageFilter.h" #include "itkImage.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT //Just to get the forward/inverse definitions #include "otbWaveletOperatorBase.h" @@ -103,6 +104,7 @@ public: protected: SubsampleImageFilter () { + OTB_DISABLE_DYNAMIC_MT m_SubsampleFactor.Fill(1); } ~SubsampleImageFilter() override {} diff --git a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx index 62c13ef862..db8e556ac3 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx @@ -39,6 +39,7 @@ template WaveletFilterBank ::WaveletFilterBank () { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1); @@ -608,6 +609,7 @@ template WaveletFilterBank ::WaveletFilterBank () { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(1 << InputImageDimension); m_UpSampleFilterFactor = 0; diff --git a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx index 3925a187f9..3cc7c48c9a 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx @@ -33,7 +33,9 @@ namespace otb template WaveletsBandsListToWaveletsSynopsisImageFilter ::WaveletsBandsListToWaveletsSynopsisImageFilter() : m_DecimationRatio(2) -{} +{ +OTB_DISABLE_DYNAMIC_MT +} /** Destructor */ template diff --git a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx index ddd40c5f9c..8193a538b8 100644 --- a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx +++ b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx @@ -37,6 +37,7 @@ template DifferenceImageFilter ::DifferenceImageFilter() { + OTB_DISABLE_DYNAMIC_MT // We require two inputs to execute. this->SetNumberOfRequiredInputs(2); diff --git a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx index 986245968e..aadba17570 100644 --- a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx +++ b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx @@ -27,6 +27,7 @@ #include "itkMetaDataObject.h" #include "otbMetaDataKey.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT namespace otb { @@ -37,6 +38,7 @@ template DSFusionOfClassifiersImageFilter ::DSFusionOfClassifiersImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx index b1aa17a83f..52218076cc 100644 --- a/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx +++ b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx @@ -33,6 +33,7 @@ template ImageDimensionalityReductionFilter ::ImageDimensionalityReductionFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx b/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx index fae939bec8..b6edd7a113 100644 --- a/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx +++ b/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx @@ -22,6 +22,7 @@ #define otbImageClassificationFilter_hxx #include "otbImageClassificationFilter.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -38,7 +39,9 @@ ImageClassificationFilter this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredOutputs(3); + this->SetNthOutput(0,TOutputImage::New()); this->SetNthOutput(1,ConfidenceImageType::New()); this->SetNthOutput(2,ProbaImageType::New()); diff --git a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx index 5951e4d18e..42418fc699 100644 --- a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx +++ b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbKMeansImageClassificationFilter_hxx #define otbKMeansImageClassificationFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbKMeansImageClassificationFilter.h" #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" @@ -34,6 +35,7 @@ template ::KMeansImageClassificationFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); diff --git a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx index 5a3889c302..40de639b8b 100644 --- a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx +++ b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx @@ -34,6 +34,7 @@ template ::SOMImageClassificationFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h index 9b8fed2420..ddde84b475 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h @@ -165,6 +165,7 @@ protected: /** Constructor */ ImageToRadianceImageFilter() { + OTB_DISABLE_DYNAMIC_MT m_Alpha.SetSize(0); m_Beta.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h index ceb356b983..9a0c2fa53f 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h @@ -259,6 +259,7 @@ protected: m_IsSetSolarDistance(false), m_UseClamp(true) { + OTB_DISABLE_DYNAMIC_MT m_SolarIllumination.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h index 3f59b864dc..253686773f 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h @@ -241,6 +241,7 @@ protected: m_IsSetFluxNormalizationCoefficient(false), m_IsSetSolarDistance(false) { + OTB_DISABLE_DYNAMIC_MT m_SolarIllumination.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx index 1dfd7c0ca8..205931782d 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx @@ -38,6 +38,7 @@ ReflectanceToSurfaceReflectanceImageFilter m_IsSetAcquiCorrectionParameters(false), m_UseGenerateParameters(true) { + OTB_DISABLE_DYNAMIC_MT m_AtmosphericRadiativeTerms = AtmosphericRadiativeTermsType::New(); m_AtmoCorrectionParameters = AtmoCorrectionParametersType::New(); m_AcquiCorrectionParameters = AcquiCorrectionParametersType::New(); diff --git a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx index 502c13161c..366797580e 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx @@ -25,6 +25,7 @@ #include "otbSarSensorModelAdapter.h" #include "otbImageKeywordlist.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageScanlineIterator.h" #include "itkImageScanlineConstIterator.h" #include "itkImageRegionIterator.h" @@ -35,7 +36,9 @@ namespace otb // Constructor template SarDeburstImageFilter::SarDeburstImageFilter() : m_LinesRecord(), m_SamplesRecord(), m_OnlyValidSample(false) -{} +{ + OTB_DISABLE_DYNAMIC_MT +} // Needs to be re-implemented since size of output is modified template< class TImage> diff --git a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx index 017bec212c..41944eb6cb 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx @@ -37,7 +37,7 @@ SarRadiometricCalibrationToImageFilter ::SarRadiometricCalibrationToImageFilter() : m_LookupSelected(0) { - + OTB_DISABLE_DYNAMIC_MT } template diff --git a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx index a95c370291..ba9dfb200d 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx @@ -22,7 +22,7 @@ #define otbDisparityTranslateFilter_hxx #include "otbDisparityTranslateFilter.h" - +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "itkImageRegionIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -33,6 +33,7 @@ template ::DisparityTranslateFilter() { + OTB_DISABLE_DYNAMIC_MT m_NoDataValue = -32768; // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(6); diff --git a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx index ed60d5d19d..5ded72b3ba 100644 --- a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx @@ -33,6 +33,7 @@ class TMaskImage, class TResidueImage> MultiDisparityMapTo3DFilter ::MultiDisparityMapTo3DFilter() { + OTB_DISABLE_DYNAMIC_MT // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(3); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx index 2c1ce1af84..65cdec4e11 100644 --- a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbPixelWiseBlockMatchingImageFilter_hxx #define otbPixelWiseBlockMatchingImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbPixelWiseBlockMatchingImageFilter.h" #include "itkProgressReporter.h" #include "itkConstantBoundaryCondition.h" @@ -33,6 +34,7 @@ PixelWiseBlockMatchingImageFilter ::PixelWiseBlockMatchingImageFilter() { + OTB_DISABLE_DYNAMIC_MT // Set the number of inputs this->SetNumberOfRequiredInputs(6); this->SetNumberOfRequiredInputs(2); diff --git a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx index 5a2834ff83..0e9190eb67 100644 --- a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbSubPixelDisparityImageFilter_hxx #define otbSubPixelDisparityImageFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbSubPixelDisparityImageFilter.h" namespace otb @@ -31,6 +32,7 @@ SubPixelDisparityImageFilter ::SubPixelDisparityImageFilter() { + OTB_DISABLE_DYNAMIC_MT // Set the number of required inputs this->SetNumberOfRequiredInputs(3); diff --git a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx index 2876053227..3a73570103 100644 --- a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx +++ b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx @@ -21,6 +21,7 @@ #ifndef otbBijectionCoherencyFilter_hxx #define otbBijectionCoherencyFilter_hxx +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT #include "otbBijectionCoherencyFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" @@ -33,6 +34,7 @@ template BijectionCoherencyFilter ::BijectionCoherencyFilter() { + OTB_DISABLE_DYNAMIC_MT // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(4); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx index 5f659baf36..39ad2ee0bb 100644 --- a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx +++ b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx @@ -33,6 +33,7 @@ namespace otb template Multi3DMapToDEMFilter::Multi3DMapToDEMFilter() { + OTB_DISABLE_DYNAMIC_MT // Set the number of inputs (1 image one optional mask) this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h b/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h index 93c43a52e9..5e0e3db3c2 100644 --- a/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h +++ b/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h @@ -23,7 +23,7 @@ #define otbLabelToBoundaryImageFilter_h #include "otbUnaryFunctorNeighborhoodImageFilter.h" - +#include "otbMacro.h" namespace otb { namespace Functor @@ -96,6 +96,7 @@ public: protected: LabelToBoundaryImageFilter() { + OTB_DISABLE_DYNAMIC_MT this->SetRadius(1); } ~LabelToBoundaryImageFilter() override { } diff --git a/Modules/Segmentation/MorphologicalProfiles/include/otbMultiScaleConvexOrConcaveClassificationFilter.h b/Modules/Segmentation/MorphologicalProfiles/include/otbMultiScaleConvexOrConcaveClassificationFilter.h index 6733c10551..3256245aa2 100644 --- a/Modules/Segmentation/MorphologicalProfiles/include/otbMultiScaleConvexOrConcaveClassificationFilter.h +++ b/Modules/Segmentation/MorphologicalProfiles/include/otbMultiScaleConvexOrConcaveClassificationFilter.h @@ -177,5 +177,6 @@ using MultiScaleConvexOrConcaveClassificationFilter Functor::MultiScaleConvexOrConcaveDecisionRule_tags::max_closing_profile_derivative, Functor::MultiScaleConvexOrConcaveDecisionRule_tags::opening_profile_characteristics, Functor::MultiScaleConvexOrConcaveDecisionRule_tags::closing_profile_characteristics> >; + } // End namespace otb #endif -- GitLab From 3040f107b2211ef205fecf98131d249eab58ba10 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 09:50:14 +0200 Subject: [PATCH 02/63] COMP: include itkMultiThreader.h since ITK 5.0 In ITK 5.0 MultiThreader has been split into a class hierarchy. `itkMultiThreader.h` add an alias called `MultiThreader` for `MultiThreaderBase` class. For this reason we must explicitly include `itkMultiThreader.h` in classes where `itk::MultiThreader` namespace is used before. --- .../Core/ObjectList/include/otbObjectListToObjectListFilter.h | 1 + Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx | 1 + Modules/Filtering/Wavelet/include/otbWaveletTransform.h | 2 ++ .../Sampling/include/otbPersistentSamplingFilterBase.hxx | 1 + Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h index dc3a5bb291..297f504b42 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h @@ -21,6 +21,7 @@ #ifndef otbObjectListToObjectListFilter_h #define otbObjectListToObjectListFilter_h +#include "itkMultiThreader.h" #include "otbObjectListSource.h" namespace otb diff --git a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx index 2b8e32ae45..abc1f124a3 100644 --- a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx +++ b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx @@ -22,6 +22,7 @@ #define otbImageToPointSetFilter_hxx #include "otbImageToPointSetFilter.h" +#include "itkMultiThreader.h" //itk5 - itk4 compat namespace otb { diff --git a/Modules/Filtering/Wavelet/include/otbWaveletTransform.h b/Modules/Filtering/Wavelet/include/otbWaveletTransform.h index 88b89a6dc9..a5d1375b5f 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletTransform.h +++ b/Modules/Filtering/Wavelet/include/otbWaveletTransform.h @@ -29,6 +29,8 @@ #include "otbWaveletGenerator.h" #include "otbWaveletOperatorBase.h" +#include "itkMultiThreader.h" + namespace otb { /** \class WaveletTransform diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx index c49051149d..0f5ae8395d 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx @@ -28,6 +28,7 @@ #include "otbMacro.h" #include "otbStopwatch.h" #include "itkProgressReporter.h" +#include "itkMultiThreader.h" //itk5 - itk4 compat namespace otb { diff --git a/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx b/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx index f8f7fa0f96..aabdd0571c 100644 --- a/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx +++ b/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx @@ -25,7 +25,7 @@ #include "otbImageFileReader.h" #include "otbMPIConfig.h" #include "otbMPIVrtWriter.h" - +#include "itkMultiThreader.h" #include #include -- GitLab From 3654e6cde37134691501b1e82a242e1b111246be Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 09:56:20 +0200 Subject: [PATCH 03/63] ENH: use PlatformMultiThreader with ITK 5.0 Since ITK 5.0 MultiThreader has been split into a class hierarchy. MultiThreader class is marked legacy and will not be available if legacy is set to **OFF**. `PlatformMultiThreader` must be used if filter is using `SpawnThread/TerminateThread`. Note that PlatformMultiThreader is available only with ITK 5.0 or higher. --- Modules/IO/Carto/include/otbCoordinateToName.h | 9 +++++++-- Modules/IO/Carto/src/otbCoordinateToName.cxx | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index f440ae084c..512f5f1dc4 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -23,6 +23,7 @@ #include "itkPoint.h" #include "itkMultiThreader.h" +#include "itkConfigure.h" #include "otbCurlHelperInterface.h" #include "OTBCartoExport.h" #include @@ -62,7 +63,11 @@ public: itkSetMacro(Lon, double); itkSetMacro(Lat, double); - + #if ITK_VERSION_MAJOR > 4 + using PlatformMultiThreader = itk::PlatformMultiThreader; + #else + using PlatformMultiThreader = itk::MultiThreader; + #endif /** * Set the lon/lat only if they are far enough from the current point to * avoid triggering too many updates @@ -147,7 +152,7 @@ private: CurlHelperInterface::Pointer m_Curl; - itk::MultiThreader::Pointer m_Threader; + PlatformMultiThreader::Pointer m_Threader; }; } // namespace otb diff --git a/Modules/IO/Carto/src/otbCoordinateToName.cxx b/Modules/IO/Carto/src/otbCoordinateToName.cxx index 34228aa1eb..18ec9fde88 100644 --- a/Modules/IO/Carto/src/otbCoordinateToName.cxx +++ b/Modules/IO/Carto/src/otbCoordinateToName.cxx @@ -57,7 +57,7 @@ CoordinateToName::CoordinateToName() : m_Curl = CurlHelper::New(); - m_Threader = itk::MultiThreader::New(); + m_Threader = PlatformMultiThreader::New(); m_UpdateDistance = 0.01; //about 1km at equator @@ -80,6 +80,7 @@ bool CoordinateToName::Evaluate() { if (m_Multithread) { + /* SpawnThread should be replace by std::thread in future */ m_Threader->SpawnThread(ThreadFunction, this); } else -- GitLab From dd23f700e2bd66fe35221b2430b50a5c02e7e7a1 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 09:59:06 +0200 Subject: [PATCH 04/63] ENH: add OTB_DISABLE_DYNAMIC_MT for ThirdParty/ITK OTB_DISABLE_DYNAMIC_MT was added in otbMacro.h and using this will impose OTBCommon as dependency on OTBITK module (thirdparty). So to avoid a circular dependency, we insert macro contents directly in two classes in ThirdParty/ITK. --- .../ITK/include/itkTransformToDisplacementFieldSource.hxx | 3 +++ Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.hxx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Modules/ThirdParty/ITK/include/itkTransformToDisplacementFieldSource.hxx b/Modules/ThirdParty/ITK/include/itkTransformToDisplacementFieldSource.hxx index c8db8c9d6f..25c3d43e2b 100644 --- a/Modules/ThirdParty/ITK/include/itkTransformToDisplacementFieldSource.hxx +++ b/Modules/ThirdParty/ITK/include/itkTransformToDisplacementFieldSource.hxx @@ -34,6 +34,9 @@ template< class TOutputImage, class TTransformPrecisionType > TransformToDisplacementFieldSource< TOutputImage, TTransformPrecisionType > ::TransformToDisplacementFieldSource() { + #if ITK_VERSION_MAJOR > 4 + this->DynamicMultiThreadingOff(); + #endif this->m_OutputSpacing.Fill(1.0); this->m_OutputOrigin.Fill(0.0); this->m_OutputDirection.SetIdentity(); diff --git a/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.hxx b/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.hxx index e5872ddce4..4dda6cc9ef 100644 --- a/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.hxx +++ b/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.hxx @@ -31,6 +31,9 @@ template< class TInputImage, class TOutputImage, class TFunction > UnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction > ::UnaryFunctorImageFilter() { + #if ITK_VERSION_MAJOR > 4 + this->DynamicMultiThreadingOff(); + #endif this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); } -- GitLab From 3f22e4b451a56eb70e7819d1d77beae86720258b Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:02:47 +0200 Subject: [PATCH 05/63] COMP: remove ITKNeuralNetworks from required modules ITKNeuralNetworks is no longer a part of ITK core modules since ITK 5.0 OTB works without this module for ITK4 and ITK5. IF a random unofficial remote module uses this module, they can install it separately --- Modules/ThirdParty/ITK/otb-module-init.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/ThirdParty/ITK/otb-module-init.cmake b/Modules/ThirdParty/ITK/otb-module-init.cmake index d5d354ec56..e41f37ba6a 100644 --- a/Modules/ThirdParty/ITK/otb-module-init.cmake +++ b/Modules/ThirdParty/ITK/otb-module-init.cmake @@ -71,7 +71,7 @@ set(OTBITK_ITK_REQUIRED_MODULE_LIST ITKEigen #ITKFEM ITKNarrowBand - ITKNeuralNetworks + #ITKNeuralNetworks #5.0 ITKOptimizers ITKOptimizersv4 ITKPolynomials -- GitLab From 26c5f08c18a5a1d7ea87a301124f7602ae1d9475 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:06:33 +0200 Subject: [PATCH 06/63] COMP: fix usage of itk::LexicographicCompare TODO: we should try to use std::lexicograhpical_compare and avoid ifdef with different version of ITK --- .../otbShapeAttributesLabelMapFilter.h | 19 +++++++++++++++---- .../otbShapeAttributesLabelMapFilter.hxx | 7 ++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h index 5040c40f79..1219115223 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h @@ -22,6 +22,12 @@ #ifndef otbShapeAttributesLabelMapFilter_h #define otbShapeAttributesLabelMapFilter_h +#include "itkConfigure.h" + +#if ITK_VERSION_MAJOR > 4 +#include "itkLexicographicCompare.h" +#endif + #include "otbLabelMapFeaturesFunctorImageFilter.h" #include "otbImage.h" #include "otbPolygon.h" @@ -29,7 +35,6 @@ #include "otbFlusserPathFunction.h" #include "otbSimplifyPathFunctor.h" - namespace otb { @@ -148,9 +153,15 @@ private: typedef itk::Offset<3> Offset3Type; typedef itk::Vector Spacing2Type; typedef itk::Vector Spacing3Type; - typedef std::map MapIntercept2Type; - typedef std::map MapIntercept3Type; - + #if ITK_VERSION_MAJOR > 4 + typedef itk::Functor::LexicographicCompare LexicographicCompare2; + typedef itk::Functor::LexicographicCompare LexicographicCompare3; + #else + typedef typename Offset2Type::LexicographicCompare LexicographicCompare2; + typedef typename Offset3Type::LexicographicCompare LexicographicCompare3; + #endif + typedef std::map MapIntercept2Type; + typedef std::map MapIntercept3Type; template double PerimeterFromInterceptCount( TMapIntercept & intercepts, const TSpacing & spacing ); #if ! defined(ITK_DO_NOT_USE_PERIMETER_SPECIALIZATION) diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx index 085c130b1f..74ceb74bd2 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx @@ -735,7 +735,12 @@ ShapeAttributesLabelObjectFunctor } // a data structure to store the number of intercepts on each direction - typedef typename std::map MapInterceptType; + #if ITK_VERSION_MAJOR > 4 + typedef itk::Functor::LexicographicCompare LexicographicCompare; + #else + typedef typename OffsetType::LexicographicCompare LexicographicCompare; + #endif + typedef typename std::map MapInterceptType; MapInterceptType intercepts; // int nbOfDirections = (int)std::pow( 2.0, (int)ImageDimension ) - 1; // intecepts.resize(nbOfDirections + 1); // code begins at position 1 -- GitLab From 18e8270c6049803fd372ba1e394f3a1884a1e9d0 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:08:54 +0200 Subject: [PATCH 07/63] Wrapping: raise swig minimum version to 3.0 SWIG 3.0 or higher is required with ITK 5.0. This is because older version of swig cannot handle c++11 keywords. swig simply send out a syntax error: /home/rashad/local/include/ITK-5.0/itkFloatTypes.h:30: Error: Syntax error in input(1) If we make minimum version to be 3.0, atleast we get a clear error on configure which is much better than cryptic error messages --- Modules/Wrappers/SWIG/otb-module-init.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/Wrappers/SWIG/otb-module-init.cmake b/Modules/Wrappers/SWIG/otb-module-init.cmake index 0730626d29..f92ed613fb 100644 --- a/Modules/Wrappers/SWIG/otb-module-init.cmake +++ b/Modules/Wrappers/SWIG/otb-module-init.cmake @@ -20,8 +20,9 @@ option ( OTB_WRAP_PYTHON "Wrap Python" OFF ) +<<<<<<< 26c5f08c18a5a1d7ea87a301124f7602ae1d9475 if ( OTB_WRAP_PYTHON ) - find_package ( SWIG REQUIRED ) + find_package ( SWIG 3.0 REQUIRED ) mark_as_advanced(SWIG_DIR) mark_as_advanced(SWIG_EXECUTABLE) mark_as_advanced(SWIG_VERSION) @@ -50,4 +51,4 @@ if ( OTB_WRAP_PYTHON ) message( WARNING "OTB wrappers will be done without support for NumPy (not found).") endif() -endif() \ No newline at end of file +endif() -- GitLab From ec4839eadc4dcf3c873110ec395baef6d896c527 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:13:27 +0200 Subject: [PATCH 08/63] ENH: check for ITK version and not legacy remove ITK_LEGACY_REMOVE has been totally removed from ITK 5 and ITK_FUTURE_LEGACY code has been marked as ITK_LEGACY_REMOVE The above ifdef works with ITK 4.0 and ITK5.0 Note that both ITK4 and ITK5 must be built with ITK_LEGACY_REMOVE=ON until OTB is ready for such a change. --- Modules/Feature/Edge/include/otbLocalHoughFilter.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx index c3813ae207..95a1c90a1c 100644 --- a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx +++ b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx @@ -228,6 +228,7 @@ LocalHoughFilter // --------------------------------------- // Get the list of LineSpatialObject lines // --------------------------------------- + #if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 12) lines = houghFilter->GetLines(m_NumberOfLines); #else -- GitLab From c89f118af1767c3bb9d4604d7539784f49e68c3f Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:31:21 +0200 Subject: [PATCH 09/63] ENH: fix function definition for SetPointSet --- .../Core/PointSet/include/otbPointSetFunction.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Modules/Core/PointSet/include/otbPointSetFunction.h b/Modules/Core/PointSet/include/otbPointSetFunction.h index 818a3ce981..cf892398f5 100644 --- a/Modules/Core/PointSet/include/otbPointSetFunction.h +++ b/Modules/Core/PointSet/include/otbPointSetFunction.h @@ -49,22 +49,22 @@ public: itkTypeMacro(PointSetFunction, itk::SpatialFunction); /** PointSet Type typedef Support*/ - typedef TPointSet PointSetType; - typedef typename PointSetType::ConstPointer PointSetPointerType; - - /** TOutput typedef suppoty*/ + typedef TPointSet PointSetType; + typedef typename PointSetType::Pointer PointSetPointer; + typedef typename PointSetType::ConstPointer PointSetConstPointer; + /** TOutput typedef support*/ typedef TOutput OutputType; /** Set the input image (reimplemented since we need to set the detector input) */ itkGetConstObjectMacro(PointSet, PointSetType); - void SetPointSet(PointSetType * PointSet) + void SetPointSet(PointSetPointer PointSet) { m_PointSet = PointSet; } /** SetPointSet() to maintain the const correctness of the pointset*/ - void SetPointSet(PointSetPointerType PointSet) + void SetPointSet(PointSetConstPointer PointSet) { m_PointSet = PointSet; } @@ -79,7 +79,7 @@ private: PointSetFunction(const Self &) = delete; void operator =(const Self&) = delete; - PointSetPointerType m_PointSet; + PointSetConstPointer m_PointSet; }; -- GitLab From 814fbc4e1b8d7b3e4901a4ffcbcf84917b013844 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:31:59 +0200 Subject: [PATCH 10/63] ENH: NULL -> nullptr --- Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx | 2 +- Modules/MPI/MPIConfig/src/otbMPIConfig.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx index 849eea28a6..2eb7c00626 100644 --- a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx +++ b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx @@ -34,7 +34,7 @@ MultiImageFileWriter::Sink const std::string & fileName): SinkBase(dynamic_cast(inputImage.GetPointer())), m_Writer(otb::ImageFileWriter::New()), - m_ImageIO(NULL) + m_ImageIO(nullptr) { m_Writer->SetFileName(fileName); m_Writer->SetInput(inputImage); diff --git a/Modules/MPI/MPIConfig/src/otbMPIConfig.cxx b/Modules/MPI/MPIConfig/src/otbMPIConfig.cxx index 76a5dbb347..7929f6a96d 100644 --- a/Modules/MPI/MPIConfig/src/otbMPIConfig.cxx +++ b/Modules/MPI/MPIConfig/src/otbMPIConfig.cxx @@ -59,15 +59,15 @@ namespace otb { /** Initialize the singleton */ -MPIConfig::Pointer MPIConfig::m_Singleton = NULL; +MPIConfig::Pointer MPIConfig::m_Singleton = nullptr; MPIConfig::Pointer MPIConfig::Instance() { - if(m_Singleton.GetPointer() == NULL) + if(m_Singleton.GetPointer() == nullptr) { m_Singleton = itk::ObjectFactory::Create(); - if(m_Singleton.GetPointer() == NULL) + if(m_Singleton.GetPointer() == nullptr) { m_Singleton = new MPIConfig; } -- GitLab From 68e168a76c6bad2b5ef6616b6e3ade1805c350e6 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 10:32:33 +0200 Subject: [PATCH 11/63] COMP: missing include for ITK 5.0 --- Examples/BasicFilters/HillShadingExample.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/BasicFilters/HillShadingExample.cxx b/Examples/BasicFilters/HillShadingExample.cxx index 053767bcad..6ad5838e07 100644 --- a/Examples/BasicFilters/HillShadingExample.cxx +++ b/Examples/BasicFilters/HillShadingExample.cxx @@ -30,6 +30,7 @@ #include "otbDEMToImageGenerator.h" #include "otbHillShadingFilter.h" +#include "itkBinaryFunctorImageFilter.h" #include "itkScalarToRGBColormapImageFilter.h" #include "otbReliefColormapFunctor.h" #include "itkMultiplyImageFilter.h" -- GitLab From 603330f07286f69867c7223356d811e324f4e909 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 31 Jul 2018 14:42:09 +0200 Subject: [PATCH 12/63] ENH: missing disable dynamic mt macro --- .../include/otbStreamingHistogramVectorImageFilter.hxx | 3 +-- .../include/otbStreamingStatisticsMapFromLabelImageFilter.hxx | 1 + .../include/otbVectorImageToIntensityImageFilter.hxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx index e64dd6422d..cec3f4b12e 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx @@ -47,9 +47,8 @@ PersistentHistogramVectorImageFilter // // allocate the data objects for the outputs which are // just decorators around pixel types and histogram list - - m_Size.Fill(255); OTB_DISABLE_DYNAMIC_MT + m_Size.Fill(255); HistogramListPointerType output = static_cast(this->MakeOutput(1).GetPointer()); this->itk::ProcessObject::SetNthOutput(1, output.GetPointer()); } diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx index 7a0ecf30e8..42177d9735 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx @@ -42,6 +42,7 @@ PersistentStreamingStatisticsMapFromLabelImageFilter(this->MakeOutput(1).GetPointer()); this->itk::ProcessObject::SetNthOutput(1, output.GetPointer()); diff --git a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx index 09dac31e8f..7854090d09 100644 --- a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx @@ -36,7 +36,7 @@ template VectorImageToIntensityImageFilter ::VectorImageToIntensityImageFilter() { -OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT } template -- GitLab From c9b2b5fc2afe9193ef68ad16db88fa2bcf294900 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 7 Aug 2018 09:06:58 +0200 Subject: [PATCH 13/63] DOC: update copyright --- Modules/Core/Common/include/otbMacro.h | 1 + Modules/IO/Carto/include/otbCoordinateToName.h | 1 + Modules/IO/Carto/src/otbCoordinateToName.cxx | 1 + 3 files changed, 3 insertions(+) diff --git a/Modules/Core/Common/include/otbMacro.h b/Modules/Core/Common/include/otbMacro.h index 3c97238991..d6f2b9ca3e 100644 --- a/Modules/Core/Common/include/otbMacro.h +++ b/Modules/Core/Common/include/otbMacro.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) + * Copyright (C) 2018 CS Systemes d'Information (CS SI) * * This file is part of Orfeo Toolbox * diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index 512f5f1dc4..527bc11d0e 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) + * Copyright (C) 2018 CS Systemes d'Information (CS SI) * * This file is part of Orfeo Toolbox * diff --git a/Modules/IO/Carto/src/otbCoordinateToName.cxx b/Modules/IO/Carto/src/otbCoordinateToName.cxx index 18ec9fde88..3dc7647573 100644 --- a/Modules/IO/Carto/src/otbCoordinateToName.cxx +++ b/Modules/IO/Carto/src/otbCoordinateToName.cxx @@ -1,5 +1,6 @@ /* * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) + * Copyright (C) 2018 CS Systemes d'Information (CS SI) * * This file is part of Orfeo Toolbox * -- GitLab From 1922afdae8fbdc497fb9f88acb9a554fe82cf1ad Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 8 Aug 2018 10:22:29 +0200 Subject: [PATCH 14/63] COMP: remove commented line from module list variable --- Modules/ThirdParty/ITK/otb-module-init.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/ThirdParty/ITK/otb-module-init.cmake b/Modules/ThirdParty/ITK/otb-module-init.cmake index e41f37ba6a..71b4f188a1 100644 --- a/Modules/ThirdParty/ITK/otb-module-init.cmake +++ b/Modules/ThirdParty/ITK/otb-module-init.cmake @@ -71,7 +71,6 @@ set(OTBITK_ITK_REQUIRED_MODULE_LIST ITKEigen #ITKFEM ITKNarrowBand - #ITKNeuralNetworks #5.0 ITKOptimizers ITKOptimizersv4 ITKPolynomials -- GitLab From 61c1cb1c9be9337c197a8bbc7090dc76c7725f09 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 8 Aug 2018 14:02:46 +0200 Subject: [PATCH 15/63] STYLE: resolve nitpick discussion IDE --- Modules/Core/Common/include/otbFunctionToImageFilter.hxx | 4 ++-- .../otbUnaryFunctorNeighborhoodVectorImageFilter.hxx | 4 ++-- .../otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx | 4 ++-- Modules/Core/ImageBase/include/otbExtractROI.hxx | 2 +- Modules/Core/ImageBase/include/otbExtractROIBase.hxx | 2 +- .../Core/ImageBase/include/otbMultiChannelExtractROI.hxx | 2 +- .../ImageBase/include/otbMultiToMonoChannelExtractROI.hxx | 2 +- .../include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx | 4 ++-- .../include/otbDrawLineSpatialObjectFilter.hxx | 4 ++-- .../include/otbDrawLineSpatialObjectListFilter.hxx | 4 ++-- .../Density/include/otbPointSetToDensityImageFilter.hxx | 4 ++-- .../Edge/include/otbHorizontalSobelVectorImageFilter.h | 2 +- .../Edge/include/otbLineCorrelationDetectorImageFilter.hxx | 2 +- .../Edge/include/otbLineRatioDetectorImageFilter.hxx | 2 +- .../include/otbPixelSuppressionByDirectionImageFilter.hxx | 4 ++-- Modules/Feature/Edge/include/otbSobelVectorImageFilter.h | 2 +- .../Edge/include/otbTouziEdgeDetectorImageFilter.hxx | 2 +- .../Moments/include/otbRadiometricMomentsImageFilter.hxx | 2 +- .../Feature/Textures/include/otbSFSTexturesImageFilter.hxx | 4 ++-- .../include/otbScalarImageToAdvancedTexturesFilter.hxx | 4 ++-- .../include/otbScalarImageToHigherOrderTexturesFilter.hxx | 4 ++-- .../include/otbScalarImageToPanTexTextureFilter.hxx | 4 ++-- .../Textures/include/otbScalarImageToTexturesFilter.hxx | 4 ++-- .../ChangeDetection/include/otbCBAMIChangeDetector.h | 2 +- .../ChangeDetection/include/otbCorrelationChangeDetector.h | 2 +- .../ChangeDetection/include/otbJoinHistogramMIImageFilter.h | 2 +- .../ChangeDetection/include/otbMeanDifferenceImageFilter.h | 2 +- .../otbMultivariateAlterationDetectorImageFilter.hxx | 2 +- Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx | 4 ++-- .../Contrast/include/otbCLHistogramEqualizationFilter.hxx | 2 +- .../Filtering/Contrast/include/otbComputeGainLutFilter.hxx | 4 ++-- .../Filtering/Contrast/include/otbComputeHistoFilter.hxx | 4 ++-- .../Convolution/include/otbConvolutionImageFilter.hxx | 2 +- Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx | 2 +- .../include/otbEstimateInnerProductPCAImageFilter.hxx | 4 ++-- .../include/otbLocalActivityVectorImageFilter.h | 2 +- .../include/otbMaximumAutocorrelationFactorImageFilter.hxx | 2 +- .../include/otbNormalizeInnerProductPCAImageFilter.hxx | 2 +- .../include/otbBinaryFunctorNeighborhoodImageFilter.hxx | 2 +- .../otbBinaryFunctorNeighborhoodVectorImageFilter.hxx | 4 ++-- .../include/otbBinaryImageToDensityImageFilter.hxx | 2 +- .../include/otbBoxAndWhiskerImageFilter.hxx | 4 ++-- .../ImageManipulation/include/otbClampImageFilter.hxx | 4 ++-- .../include/otbConcatenateVectorImageFilter.hxx | 4 ++-- .../include/otbFunctionWithNeighborhoodToImageFilter.hxx | 2 +- .../include/otbGridResampleImageFilter.hxx | 2 +- .../ImageManipulation/include/otbInPlacePassFilter.h | 2 +- .../ImageManipulation/include/otbMatrixImageFilter.hxx | 4 ++-- .../include/otbNRIBandImagesToOneNComplexBandsImage.hxx | 4 ++-- .../include/otbSpectralAngleDistanceImageFilter.hxx | 2 +- .../include/otbStreamingInnerProductVectorImageFilter.hxx | 2 +- .../otbStreamingMatrixTransposeMatrixImageFilter.hxx | 2 +- .../include/otbStreamingShrinkImageFilter.hxx | 2 +- .../include/otbThresholdVectorImageFilter.hxx | 4 ++-- .../ImageManipulation/include/otbTileImageFilter.hxx | 4 ++-- .../include/otbTwoNRIBandsImageToNComplexBandsImage.hxx | 4 ++-- .../include/otbUnaryFunctorNeighborhoodImageFilter.hxx | 4 ++-- .../otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx | 4 ++-- .../include/otbUnaryFunctorWithIndexImageFilter.hxx | 4 ++-- .../include/otbUnaryImageFunctorWithVectorImageFilter.hxx | 4 ++-- .../include/otbVectorImageTo3DScalarImageFilter.hxx | 4 ++-- .../Filtering/ImageNoise/include/otbFrostImageFilter.hxx | 4 ++-- .../Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx | 4 ++-- Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx | 4 ++-- Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx | 4 ++-- .../Filtering/MathParser/include/otbBandMathImageFilter.hxx | 2 +- .../Filtering/MathParser/include/otbMaskMuParserFilter.hxx | 2 +- .../MathParserX/include/otbBandMathXImageFilter.hxx | 2 +- .../include/otbMultiChannelsPolarimetricSynthesisFilter.hxx | 4 ++-- .../Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx | 2 +- .../Statistics/include/otbNormalizeVectorImageFilter.hxx | 2 +- .../Statistics/include/otbStreamingCompareImageFilter.hxx | 2 +- .../include/otbStreamingHistogramVectorImageFilter.hxx | 2 +- .../Statistics/include/otbStreamingMinMaxImageFilter.hxx | 2 +- .../include/otbStreamingMinMaxVectorImageFilter.hxx | 2 +- .../include/otbStreamingStatisticsImageFilter.hxx | 2 +- .../otbStreamingStatisticsMapFromLabelImageFilter.hxx | 2 +- .../include/otbStreamingStatisticsVectorImageFilter.hxx | 2 +- .../Filtering/Statistics/include/otbVarianceImageFilter.hxx | 4 ++-- .../include/otbVectorImageToIntensityImageFilter.hxx | 2 +- .../include/otbVectorImageToMatrixImageFilter.hxx | 2 +- Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h | 4 ++-- Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx | 4 ++-- .../otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx | 2 +- Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx | 2 +- .../include/otbDSFusionOfClassifiersImageFilter.hxx | 4 ++-- .../include/otbImageDimensionalityReductionFilter.hxx | 2 +- .../LearningBase/include/otbImageClassificationFilter.hxx | 6 ++---- .../include/otbKMeansImageClassificationFilter.hxx | 4 ++-- .../SOM/include/otbSOMImageClassificationFilter.hxx | 2 +- .../include/otbImageToRadianceImageFilter.h | 2 +- .../include/otbRadianceToReflectanceImageFilter.h | 2 +- .../include/otbReflectanceToRadianceImageFilter.h | 2 +- .../otbReflectanceToSurfaceReflectanceImageFilter.hxx | 2 +- .../SARCalibration/include/otbSarDeburstImageFilter.hxx | 4 ++-- .../include/otbSarRadiometricCalibrationToImageFilter.hxx | 2 +- .../DisparityMap/include/otbDisparityTranslateFilter.hxx | 4 ++-- .../DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx | 2 +- .../include/otbPixelWiseBlockMatchingImageFilter.hxx | 4 ++-- .../include/otbSubPixelDisparityImageFilter.hxx | 4 ++-- .../Stereo/include/otbBijectionCoherencyFilter.hxx | 4 ++-- .../Stereo/include/otbMulti3DMapToDEMFilter.hxx | 2 +- .../Labelling/include/otbLabelToBoundaryImageFilter.h | 2 +- 103 files changed, 150 insertions(+), 152 deletions(-) diff --git a/Modules/Core/Common/include/otbFunctionToImageFilter.hxx b/Modules/Core/Common/include/otbFunctionToImageFilter.hxx index e79b5f4748..5fa0e694aa 100644 --- a/Modules/Core/Common/include/otbFunctionToImageFilter.hxx +++ b/Modules/Core/Common/include/otbFunctionToImageFilter.hxx @@ -22,7 +22,7 @@ #ifndef otbFunctionToImageFilter_hxx #define otbFunctionToImageFilter_hxx -#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT; #include "otbFunctionToImageFilter.h" #include "itkImageRegionConstIterator.h" #include "itkProgressReporter.h" @@ -37,7 +37,7 @@ template FunctionToImageFilter ::FunctionToImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->InPlaceOff(); m_PixelFunction = FunctionType::New(); } diff --git a/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx b/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx index 263e92a754..acb8ccb19d 100644 --- a/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx +++ b/Modules/Core/Common/include/otbUnaryFunctorNeighborhoodVectorImageFilter.hxx @@ -22,7 +22,7 @@ #define otbUnaryFunctorNeighborhoodVectorImageFilter_hxx #include "otbUnaryFunctorNeighborhoodVectorImageFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" #include "itkProgressReporter.h" @@ -37,7 +37,7 @@ template UnaryFunctorNeighborhoodVectorImageFilter ::UnaryFunctorNeighborhoodVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); for ( unsigned int i = 0; i < InputImageDimension; ++i ) diff --git a/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx b/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx index 306093588e..2329b37500 100644 --- a/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx +++ b/Modules/Core/Common/include/otbUnaryFunctorWithIndexWithOutputSizeImageFilter.hxx @@ -24,7 +24,7 @@ #include "otbUnaryFunctorWithIndexWithOutputSizeImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" -#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" // for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -35,7 +35,7 @@ template UnaryFunctorWithIndexWithOutputSizeImageFilter ::UnaryFunctorWithIndexWithOutputSizeImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); } template diff --git a/Modules/Core/ImageBase/include/otbExtractROI.hxx b/Modules/Core/ImageBase/include/otbExtractROI.hxx index 3625640466..d117d1f040 100644 --- a/Modules/Core/ImageBase/include/otbExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbExtractROI.hxx @@ -35,7 +35,7 @@ template ExtractROI ::ExtractROI() //: ExtractROIBase< itk::Image , itk::Image >() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** diff --git a/Modules/Core/ImageBase/include/otbExtractROIBase.hxx b/Modules/Core/ImageBase/include/otbExtractROIBase.hxx index d80bbd1eee..2696be8a4d 100644 --- a/Modules/Core/ImageBase/include/otbExtractROIBase.hxx +++ b/Modules/Core/ImageBase/include/otbExtractROIBase.hxx @@ -41,7 +41,7 @@ ExtractROIBase m_SizeX(0), m_SizeY(0) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** diff --git a/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx b/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx index a8234471d8..d2028c24a8 100644 --- a/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbMultiChannelExtractROI.hxx @@ -42,7 +42,7 @@ MultiChannelExtractROI m_LastChannel(0), m_ChannelsKind(0) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; ClearChannels(); } diff --git a/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx b/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx index e6adedab14..5bdc52ae29 100644 --- a/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx +++ b/Modules/Core/ImageBase/include/otbMultiToMonoChannelExtractROI.hxx @@ -34,7 +34,7 @@ MultiToMonoChannelExtractROI ::MultiToMonoChannelExtractROI() : ExtractROIBase, Image >(), m_Channel(1) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** diff --git a/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx b/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx index 69335351ab..e8e4a045ee 100644 --- a/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx +++ b/Modules/Core/LabelMap/include/otbLabelImageToLabelMapWithAdjacencyFilter.hxx @@ -22,7 +22,7 @@ #ifndef otbLabelImageToLabelMapWithAdjacencyFilter_hxx #define otbLabelImageToLabelMapWithAdjacencyFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbLabelImageToLabelMapWithAdjacencyFilter.h" #include "itkNumericTraits.h" #include "itkProgressReporter.h" @@ -35,7 +35,7 @@ template LabelImageToLabelMapWithAdjacencyFilter ::LabelImageToLabelMapWithAdjacencyFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_BackgroundValue = itk::NumericTraits::NonpositiveMin(); } diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx index 96f2aef1f2..e2c2ec88dd 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectFilter.hxx @@ -27,7 +27,7 @@ #include "itkMacro.h" #include "itkImageRegionIterator.h" #include "itkImageIteratorWithIndex.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -37,7 +37,7 @@ namespace otb template DrawLineSpatialObjectFilter::DrawLineSpatialObjectFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx index a464e8b2db..d8c28afbc4 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx @@ -22,7 +22,7 @@ #define otbDrawLineSpatialObjectListFilter_hxx #include "otbDrawLineSpatialObjectListFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkLineIterator.h" #include "itkDataObject.h" #include "itkImageRegionIterator.h" @@ -37,7 +37,7 @@ template DrawLineSpatialObjectListFilter ::DrawLineSpatialObjectListFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx b/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx index 86d0b005ac..fa3b445d9a 100644 --- a/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx +++ b/Modules/Feature/Density/include/otbPointSetToDensityImageFilter.hxx @@ -24,7 +24,7 @@ #include "otbPointSetToDensityImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { /**--------------------------------------------------------- @@ -34,7 +34,7 @@ template PointSetToDensityImageFilter ::PointSetToDensityImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius = 1; } diff --git a/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h b/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h index d837d7c6ae..1c7e5f14d9 100644 --- a/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbHorizontalSobelVectorImageFilter.h @@ -88,7 +88,7 @@ public: protected: HorizontalSobelVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; typename Superclass::RadiusType radius = {{1, 1}}; this->SetRadius( radius ); } diff --git a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx index f8f6392cf6..d453eba8b6 100644 --- a/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineCorrelationDetectorImageFilter.hxx @@ -41,7 +41,7 @@ template ::LineCorrelationDetectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->m_Radius.Fill(1); this->m_LengthLine = 1; this->m_WidthLine = 0; diff --git a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx index 67688153d5..0c99cd954a 100644 --- a/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbLineRatioDetectorImageFilter.hxx @@ -42,7 +42,7 @@ template ::LineRatioDetectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->m_Radius.Fill(1); this->m_LengthLine = 1; this->m_WidthLine = 0; diff --git a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx index ac23633310..b519c9083d 100644 --- a/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbPixelSuppressionByDirectionImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbPixelSuppressionByDirectionImageFilter_hxx #define otbPixelSuppressionByDirectionImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbPixelSuppressionByDirectionImageFilter.h" #include "itkDataObject.h" @@ -43,7 +43,7 @@ namespace otb template PixelSuppressionByDirectionImageFilter::PixelSuppressionByDirectionImageFilter() { -OTB_DISABLE_DYNAMIC_MT +OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); m_AngularBeam = static_cast(0.); diff --git a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h index 8ed74b4a2c..d44347366f 100644 --- a/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h +++ b/Modules/Feature/Edge/include/otbSobelVectorImageFilter.h @@ -97,7 +97,7 @@ public: protected: SobelVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; typename Superclass::RadiusType radius = {{1, 1}}; this->SetRadius( radius ); } diff --git a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx index 737590d6f7..4bbf74f071 100644 --- a/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbTouziEdgeDetectorImageFilter.hxx @@ -41,7 +41,7 @@ namespace otb template TouziEdgeDetectorImageFilter::TouziEdgeDetectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); } diff --git a/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx b/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx index e4b5320588..46cc283e9f 100644 --- a/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx +++ b/Modules/Feature/Moments/include/otbRadiometricMomentsImageFilter.hxx @@ -37,7 +37,7 @@ template RadiometricMomentsImageFilter ::RadiometricMomentsImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); } diff --git a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx index 8c37525487..04e4101ffe 100644 --- a/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx +++ b/Modules/Feature/Textures/include/otbSFSTexturesImageFilter.hxx @@ -27,7 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" #include "otbMath.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -35,7 +35,7 @@ template SFSTexturesImageFilter ::SFSTexturesImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(6); diff --git a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx index fb4453b7fc..51753ef895 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToAdvancedTexturesFilter.hxx @@ -28,7 +28,7 @@ #include "itkProgressReporter.h" #include "itkNumericTraits.h" #include -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { template @@ -43,7 +43,7 @@ ScalarImageToAdvancedTexturesFilter , m_SubsampleFactor() , m_SubsampleOffset() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // There are 10 outputs corresponding to the 9 textures indices this->SetNumberOfRequiredOutputs(10); diff --git a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx index 61da035954..abd11d8bc1 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToHigherOrderTexturesFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbScalarImageToHigherOrderTexturesFilter_hxx #define otbScalarImageToHigherOrderTexturesFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbScalarImageToHigherOrderTexturesFilter.h" #include "itkImageRegionIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -41,7 +41,7 @@ ScalarImageToHigherOrderTexturesFilter m_SubsampleOffset() { // There are 10 outputs corresponding to the 8 textures indices - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredOutputs(10); // Create the 10 outputs diff --git a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx index 4681b2a59b..6c7d692cc2 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToPanTexTextureFilter.hxx @@ -27,7 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" #include "itkNumericTraits.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -38,7 +38,7 @@ ScalarImageToPanTexTextureFilter m_InputImageMinimum(0), m_InputImageMaximum(255) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // There are 1 output corresponding to the Pan Tex texture indice this->SetNumberOfRequiredOutputs(1); diff --git a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx index 02cc6747bc..c6439e892b 100644 --- a/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx +++ b/Modules/Feature/Textures/include/otbScalarImageToTexturesFilter.hxx @@ -30,7 +30,7 @@ #include "itkNumericTraits.h" #include #include -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -46,7 +46,7 @@ ScalarImageToTexturesFilter , m_SubsampleFactor() , m_SubsampleOffset() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // There are 8 outputs corresponding to the 8 textures indices this->SetNumberOfRequiredOutputs(8); diff --git a/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h b/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h index 15739904c1..24582dee91 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h +++ b/Modules/Filtering/ChangeDetection/include/otbCBAMIChangeDetector.h @@ -83,7 +83,7 @@ public: itkTypeMacro(CBAMIChangeDetector, SuperClass); protected: - CBAMIChangeDetector() {OTB_DISABLE_DYNAMIC_MT} + CBAMIChangeDetector() {OTB_DISABLE_DYNAMIC_MT;} ~CBAMIChangeDetector() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h b/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h index 13ae285680..eb98b0532f 100644 --- a/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h +++ b/Modules/Filtering/ChangeDetection/include/otbCorrelationChangeDetector.h @@ -82,7 +82,7 @@ public: itkTypeMacro(CorrelationChangeDetector, SuperClass); protected: - CorrelationChangeDetector() {OTB_DISABLE_DYNAMIC_MT} + CorrelationChangeDetector() {OTB_DISABLE_DYNAMIC_MT;} ~CorrelationChangeDetector() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h index 3c7ffef46e..87d022233e 100644 --- a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h @@ -84,7 +84,7 @@ public: protected: JoinHistogramMIImageFilter() { -OTB_DISABLE_DYNAMIC_MT +OTB_DISABLE_DYNAMIC_MT; } ~JoinHistogramMIImageFilter() override {} diff --git a/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h index 649c729833..b99a6d5ea4 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbMeanDifferenceImageFilter.h @@ -81,7 +81,7 @@ public: itkTypeMacro(MeanDifferenceImageFilter, SuperClass); protected: - MeanDifferenceImageFilter() {OTB_DISABLE_DYNAMIC_MT} + MeanDifferenceImageFilter() {OTB_DISABLE_DYNAMIC_MT;} ~MeanDifferenceImageFilter() override {} private: diff --git a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx index cc1aa5a606..9d5ec1b9ff 100644 --- a/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx +++ b/Modules/Filtering/ChangeDetection/include/otbMultivariateAlterationDetectorImageFilter.hxx @@ -36,7 +36,7 @@ template MultivariateAlterationDetectorImageFilter ::MultivariateAlterationDetectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); m_CovarianceEstimator = CovarianceEstimatorType::New(); } diff --git a/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx b/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx index d264fa1e95..e39cd69845 100644 --- a/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbApplyGainFilter.hxx @@ -25,7 +25,7 @@ #include "itkImageRegionIterator.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkContinuousIndex.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include @@ -35,7 +35,7 @@ template ApplyGainFilter < TInputImage , TLut , TOutputImage > ::ApplyGainFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); m_Min = std::numeric_limits< InputPixelType >::quiet_NaN(); m_Max = std::numeric_limits< InputPixelType >::quiet_NaN(); diff --git a/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx b/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx index c3437a6ed7..fd0f1ebd67 100644 --- a/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbCLHistogramEqualizationFilter.hxx @@ -37,7 +37,7 @@ m_ApplyGainFilter ( ApplyGainFilter::New() ) , m_StreamingImageFilter ( StreamingImageFilter::New() ) , m_BufferFilter ( BufferFilter::New() ) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Min = std::numeric_limits< InputPixelType >::quiet_NaN(); m_Max = std::numeric_limits< InputPixelType >::quiet_NaN(); m_NbBin = 256; diff --git a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx index b1e94450b2..a5b71573df 100644 --- a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx @@ -23,7 +23,7 @@ #include "otbComputeGainLutFilter.h" #include "itkImageRegionIterator.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include #include @@ -34,7 +34,7 @@ template < class TInputImage, class TOutputImage > ComputeGainLutFilter < TInputImage , TOutputImage > ::ComputeGainLutFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_NbBin = 256; m_NbPixel = 0; m_Min = std::numeric_limits< double >::quiet_NaN(); diff --git a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx index f0755e7547..ed48ea1002 100644 --- a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.hxx @@ -22,7 +22,7 @@ #define otbComputeHistoFilter_hxx #include "otbComputeHistoFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include namespace otb @@ -32,7 +32,7 @@ template ComputeHistoFilter < TInputImage , TOutputImage > ::ComputeHistoFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredOutputs(2); this->SetNthOutput( 0, this->MakeOutput(0) ); this->SetNthOutput( 1, this->MakeOutput(1) ); diff --git a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx index 0498992eba..1be48ea140 100644 --- a/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/otbConvolutionImageFilter.hxx @@ -38,7 +38,7 @@ template ::ConvolutionImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); m_Filter.SetSize(3 * 3); m_Filter.Fill(1); diff --git a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx index a2d660cd7a..7b03807cef 100644 --- a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx +++ b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx @@ -32,7 +32,7 @@ template DEMToImageGenerator ::DEMToImageGenerator() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_DEMHandler = DEMHandlerType::Instance(); m_OutputSpacing[0] = 0.0001; m_OutputSpacing[1] = -0.0001; diff --git a/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx index 191465daee..326bdbd75d 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbEstimateInnerProductPCAImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbEstimateInnerProductPCAImageFilter_hxx #define otbEstimateInnerProductPCAImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbEstimateInnerProductPCAImageFilter.h" #include @@ -37,7 +37,7 @@ template EstimateInnerProductPCAImageFilter ::EstimateInnerProductPCAImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_NumberOfPrincipalComponentsRequired = 1; } diff --git a/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h b/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h index 18fca03900..76684fa322 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h +++ b/Modules/Filtering/DimensionalityReduction/include/otbLocalActivityVectorImageFilter.h @@ -108,7 +108,7 @@ public: itkTypeMacro(LocalActivityVectorImageFilter, ImageToImageFilter); protected: - LocalActivityVectorImageFilter() { OTB_DISABLE_DYNAMIC_MT } + LocalActivityVectorImageFilter() { OTB_DISABLE_DYNAMIC_MT; } ~LocalActivityVectorImageFilter() override { } private: diff --git a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx index 0a74b0a6a3..306df48841 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbMaximumAutocorrelationFactorImageFilter.hxx @@ -39,7 +39,7 @@ template MaximumAutocorrelationFactorImageFilter ::MaximumAutocorrelationFactorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_CovarianceEstimator = CovarianceEstimatorType::New(); m_CovarianceEstimatorH = CovarianceEstimatorType::New(); m_CovarianceEstimatorV = CovarianceEstimatorType::New(); diff --git a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx index 4c01f9c5f2..c90e1452bf 100644 --- a/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx +++ b/Modules/Filtering/DimensionalityReduction/include/otbNormalizeInnerProductPCAImageFilter.hxx @@ -36,7 +36,7 @@ template NormalizeInnerProductPCAImageFilter ::NormalizeInnerProductPCAImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); this->InPlaceOff(); diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx index 3bbf51a358..f97c9af451 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodImageFilter.hxx @@ -37,7 +37,7 @@ template ::BinaryFunctorNeighborhoodImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); m_Radius.Fill(3); } diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx index 6a1c3d3415..c3aab5f514 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryFunctorNeighborhoodVectorImageFilter.hxx @@ -22,7 +22,7 @@ #define otbBinaryFunctorNeighborhoodVectorImageFilter_hxx #include "otbMath.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbBinaryFunctorNeighborhoodVectorImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -39,7 +39,7 @@ template ::BinaryFunctorNeighborhoodVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); this->InPlaceOff(); m_Radius = 3; diff --git a/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx index 2f965d3eb9..5b119e3ec8 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBinaryImageToDensityImageFilter.hxx @@ -36,7 +36,7 @@ template BinaryImageToDensityImageFilter ::BinaryImageToDensityImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_NeighborhoodRadius.Fill(1); m_CountFunction = CountFunctionType::New(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx index 28ac0e1815..7c3935de3b 100644 --- a/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbBoxAndWhiskerImageFilter.hxx @@ -24,7 +24,7 @@ #include #include -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkConstNeighborhoodIterator.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -39,7 +39,7 @@ template BoxAndWhiskerImageFilter ::BoxAndWhiskerImageFilter () { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); this->InPlaceOn(); diff --git a/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx index 2f3858a9ed..7834378f06 100644 --- a/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbClampImageFilter.hxx @@ -23,7 +23,7 @@ #define otbClampImageFilter_hxx #include "otbClampImageFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" #include @@ -40,7 +40,7 @@ template ClampImageFilter ::ClampImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Lower = std::numeric_limits < OutputPixelValueType >::lowest(); m_Upper = std::numeric_limits < OutputPixelValueType >::max(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx index f05913335a..52f95dd1eb 100644 --- a/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbConcatenateVectorImageFilter.hxx @@ -22,7 +22,7 @@ #define otbConcatenateVectorImageFilter_hxx #include "otbConcatenateVectorImageFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -36,7 +36,7 @@ ConcatenateVectorImageFilter ::ConcatenateVectorImageFilter() { this->SetNumberOfRequiredInputs(2); - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** * Destructor. diff --git a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx index a6f15b7d86..c04aed753c 100644 --- a/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbFunctionWithNeighborhoodToImageFilter.hxx @@ -35,7 +35,7 @@ template FunctionWithNeighborhoodToImageFilter ::FunctionWithNeighborhoodToImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->InPlaceOff(); this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); diff --git a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx index 34e5cf5a43..c4069692da 100644 --- a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx @@ -47,7 +47,7 @@ GridResampleImageFilter m_Interpolator(), m_ReachableOutputRegion() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set linear interpolator as default m_Interpolator = dynamic_cast(DefaultInterpolatorType::New().GetPointer()); diff --git a/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h b/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h index 2f7f4d5206..1f01a7286d 100644 --- a/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbInPlacePassFilter.h @@ -63,7 +63,7 @@ public: protected: InPlacePassFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->InPlaceOn(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx index 6ffc8219a6..13b03f292f 100644 --- a/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbMatrixImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbMatrixImageFilter_hxx #define otbMatrixImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbMatrixImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -35,7 +35,7 @@ namespace otb template MatrixImageFilter::MatrixImageFilter() : m_MatrixByVector(false) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } template diff --git a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx index a2bb44f30b..ca596c08a5 100644 --- a/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbNRIBandImagesToOneNComplexBandsImage.hxx @@ -21,7 +21,7 @@ #ifndef otbNRIBandImagesToOneNComplexBandsImage_hxx #define otbNRIBandImagesToOneNComplexBandsImage_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbNRIBandImagesToOneNComplexBandsImage.h" #include "itkImageRegionIterator.h" @@ -39,7 +39,7 @@ template NRIBandImagesToOneNComplexBandsImage::NRIBandImagesToOneNComplexBandsImage() { //this->SetNumberOfThreads(1); - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** diff --git a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx index 94d8cc2923..10269baa5f 100644 --- a/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbSpectralAngleDistanceImageFilter.hxx @@ -36,7 +36,7 @@ template SpectralAngleDistanceImageFilter ::SpectralAngleDistanceImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_ReferencePixel = 0; } diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx index 1d4cfe3220..eceb8a9e58 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingInnerProductVectorImageFilter.hxx @@ -36,7 +36,7 @@ template PersistentInnerProductVectorImageFilter ::PersistentInnerProductVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx index c4defa5a4b..3012201250 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingMatrixTransposeMatrixImageFilter.hxx @@ -35,7 +35,7 @@ template PersistentMatrixTransposeMatrixImageFilter ::PersistentMatrixTransposeMatrixImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); // first output is a copy of the image, DataObject created by diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx index 90e434c8e6..af2ca4ee73 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.hxx @@ -64,7 +64,7 @@ PersistentShrinkImageFilter ::PersistentShrinkImageFilter() : m_ShrinkFactor(10) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredOutputs(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx index f5efc80a3f..c444821a8e 100644 --- a/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbThresholdVectorImageFilter.hxx @@ -22,7 +22,7 @@ #ifndef otbThresholdVectorImageFilter_hxx #define otbThresholdVectorImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbThresholdVectorImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" @@ -39,7 +39,7 @@ template ThresholdVectorImageFilter ::ThresholdVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_OutsideValue = itk::NumericTraits::Zero; m_Lower = itk::NumericTraits::NonpositiveMin(); m_Upper = itk::NumericTraits::max(); diff --git a/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx index ea3bceeaad..834d50ee2b 100644 --- a/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbTileImageFilter.hxx @@ -23,7 +23,7 @@ #include "otbTileImageFilter.h" #include "itkImageRegionIterator.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -31,7 +31,7 @@ template TileImageFilter ::TileImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } template diff --git a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx index 64d075d8dc..fbe290f0b4 100644 --- a/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbTwoNRIBandsImageToNComplexBandsImage.hxx @@ -21,7 +21,7 @@ #ifndef otbTwoNRIBandsImageToNComplexBandsImage_hxx #define otbTwoNRIBandsImageToNComplexBandsImage_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbTwoNRIBandsImageToNComplexBandsImage.h" #include "itkImageRegionIterator.h" @@ -41,7 +41,7 @@ namespace otb template TwoNRIBandsImageToNComplexBandsImage::TwoNRIBandsImageToNComplexBandsImage() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; //this->SetNumberOfThreads(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx index 941792900e..fd7246c43b 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodImageFilter.hxx @@ -27,7 +27,7 @@ #include "itkProgressReporter.h" #include "itkZeroFluxNeumannBoundaryCondition.h" #include "itkNeighborhoodAlgorithm.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { /** @@ -37,7 +37,7 @@ template UnaryFunctorNeighborhoodImageFilter ::UnaryFunctorNeighborhoodImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); } diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx index ef1064e283..69040bf10e 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbUnaryFunctorNeighborhoodWithOffsetImageFilter_hxx #define otbUnaryFunctorNeighborhoodWithOffsetImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbUnaryFunctorNeighborhoodWithOffsetImageFilter.h" #include "itkImageRegionIterator.h" #include "itkNeighborhoodAlgorithm.h" @@ -38,7 +38,7 @@ template UnaryFunctorNeighborhoodWithOffsetImageFilter ::UnaryFunctorNeighborhoodWithOffsetImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); m_Radius.Fill(1); m_Offset.Fill(1); diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx index b171c146e9..9fc82fbd37 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryFunctorWithIndexImageFilter.hxx @@ -24,7 +24,7 @@ #include "otbUnaryFunctorWithIndexImageFilter.h" #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -35,7 +35,7 @@ template UnaryFunctorWithIndexImageFilter ::UnaryFunctorWithIndexImageFilter() { -OTB_DISABLE_DYNAMIC_MT +OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); } template diff --git a/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx index 5df19328f4..b7b87986fd 100644 --- a/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbUnaryImageFunctorWithVectorImageFilter.hxx @@ -22,7 +22,7 @@ #define otbUnaryImageFunctorWithVectorImageFilter_hxx #include "otbUnaryImageFunctorWithVectorImageFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -36,7 +36,7 @@ template UnaryImageFunctorWithVectorImageFilter ::UnaryImageFunctorWithVectorImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); } diff --git a/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx index 9d9af7e699..1eebac8258 100644 --- a/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbVectorImageTo3DScalarImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbVectorImageTo3DScalarImageFilter_hxx #define otbVectorImageTo3DScalarImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbVectorImageTo3DScalarImageFilter.h" #include "itkImageRegionConstIterator.h" #include "itkImageSliceIteratorWithIndex.h" @@ -35,7 +35,7 @@ template VectorImageTo3DScalarImageFilter ::VectorImageTo3DScalarImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } /** Generate output information */ template diff --git a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx index 5cc35986db..97f73331bf 100644 --- a/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbFrostImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -40,7 +40,7 @@ namespace otb template FrostImageFilter::FrostImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); m_Deramp = 2; } diff --git a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx index 88f625f2b9..6dca5adb37 100644 --- a/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbGammaMAPImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -40,7 +40,7 @@ namespace otb template GammaMAPImageFilter::GammaMAPImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx index e4614d10ee..522d9d1395 100644 --- a/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbKuanImageFilter.hxx @@ -30,7 +30,7 @@ #include "itkNeighborhoodAlgorithm.h" #include "itkOffset.h" #include "itkProgressReporter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -40,7 +40,7 @@ namespace otb template KuanImageFilter::KuanImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx index 69c22db03a..86f2526c27 100644 --- a/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx +++ b/Modules/Filtering/ImageNoise/include/otbLeeImageFilter.hxx @@ -23,7 +23,7 @@ #include "otbLeeImageFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkDataObject.h" #include "itkConstNeighborhoodIterator.h" #include "itkNeighborhoodInnerProduct.h" @@ -41,7 +41,7 @@ namespace otb template LeeImageFilter::LeeImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); SetNbLooks(1.0); } diff --git a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx index 520dbef344..3d9ed9a79f 100644 --- a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx +++ b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.hxx @@ -42,7 +42,7 @@ BandMathImageFilter { //This number will be incremented each time an image //is added over the one minimumrequired - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs( 1 ); this->InPlaceOff(); diff --git a/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx b/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx index eb2f490143..ca0047fef3 100644 --- a/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx +++ b/Modules/Filtering/MathParser/include/otbMaskMuParserFilter.hxx @@ -35,7 +35,7 @@ namespace otb template MaskMuParserFilter::MaskMuParserFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_UnderflowCount = 0; m_OverflowCount = 0; m_ThreadUnderflow.SetSize(1); diff --git a/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx b/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx index 26f999ecef..081544d013 100644 --- a/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx +++ b/Modules/Filtering/MathParserX/include/otbBandMathXImageFilter.hxx @@ -48,7 +48,7 @@ BandMathXImageFilter //This number will be incremented each time an image //is added over the one minimumrequired this->SetNumberOfRequiredInputs( 1 ); - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_UnderflowCount = 0; m_OverflowCount = 0; m_ThreadUnderflow.SetSize(1); diff --git a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx index e7fe38a6c3..95cb84239a 100644 --- a/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx +++ b/Modules/Filtering/Polarimetry/include/otbMultiChannelsPolarimetricSynthesisFilter.hxx @@ -27,7 +27,7 @@ #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" #include "otbMath.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -39,7 +39,7 @@ template MultiChannelsPolarimetricSynthesisFilter ::MultiChannelsPolarimetricSynthesisFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); SetEmissionH(false); diff --git a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx index 4a1450e1de..5d9c3d405c 100644 --- a/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/otbMeanShiftSmoothingImageFilter.hxx @@ -47,7 +47,7 @@ MeanShiftSmoothingImageFilterSetNumberOfRequiredOutputs(4); this->SetNthOutput(0, OutputImageType::New()); this->SetNthOutput(1, OutputSpatialImageType::New()); diff --git a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx index 9bcd8ce2c8..f3ec171f46 100644 --- a/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbNormalizeVectorImageFilter.hxx @@ -29,7 +29,7 @@ template < class TInputImage, class TOutputImage > NormalizeVectorImageFilter< TInputImage, TOutputImage > ::NormalizeVectorImageFilter () { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_IsGivenMean = false; m_IsGivenStdDev = false; diff --git a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx index dfab641323..5d123624cf 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingCompareImageFilter.hxx @@ -35,7 +35,7 @@ PersistentCompareImageFilter ::PersistentCompareImageFilter() : m_SquareOfDifferences(1), m_AbsoluteValueOfDifferences(1), m_ThreadMinRef(1), m_ThreadMaxRef(1), m_Count(1), m_DiffCount(1), m_PhysicalSpaceCheck(true) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs( 2 ); // first output is a copy of the image, DataObject created by // superclass diff --git a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx index cec3f4b12e..f3aead936a 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingHistogramVectorImageFilter.hxx @@ -47,7 +47,7 @@ PersistentHistogramVectorImageFilter // // allocate the data objects for the outputs which are // just decorators around pixel types and histogram list - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Size.Fill(255); HistogramListPointerType output = static_cast(this->MakeOutput(1).GetPointer()); this->itk::ProcessObject::SetNthOutput(1, output.GetPointer()); diff --git a/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx index 33853a9b66..0e4c8e5fea 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingMinMaxImageFilter.hxx @@ -35,7 +35,7 @@ template PersistentMinMaxImageFilter ::PersistentMinMaxImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // TODO : SetNumberOfRequiredOutputs // first output is a copy of the image, DataObject created by diff --git a/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx index a0afaf35a2..81a9d90b4f 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingMinMaxVectorImageFilter.hxx @@ -38,7 +38,7 @@ PersistentMinMaxVectorImageFilter : m_NoDataFlag(false), m_NoDataValue(itk::NumericTraits::Zero) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx index 1d097218dd..8dcf397249 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx @@ -41,7 +41,7 @@ PersistentStatisticsImageFilter m_IgnoreInfiniteValues(true), m_IgnoreUserDefinedValue(false) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx index 42177d9735..592c17c66f 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsMapFromLabelImageFilter.hxx @@ -42,7 +42,7 @@ PersistentStreamingStatisticsMapFromLabelImageFilter(this->MakeOutput(1).GetPointer()); this->itk::ProcessObject::SetNthOutput(1, output.GetPointer()); diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx index 41cad2d611..56b1bc98d7 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx @@ -41,7 +41,7 @@ PersistentStreamingStatisticsVectorImageFilter m_IgnoreUserDefinedValue(false), m_UserIgnoredValue(itk::NumericTraits::Zero) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // first output is a copy of the image, DataObject created by // superclass diff --git a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx index d78222efe4..2ea6eaeb00 100644 --- a/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVarianceImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbVarianceImageFilter_hxx #define otbVarianceImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbVarianceImageFilter.h" #include "itkConstNeighborhoodIterator.h" @@ -38,7 +38,7 @@ template VarianceImageFilter ::VarianceImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Radius.Fill(1); } diff --git a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx index 7854090d09..7a28b23356 100644 --- a/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVectorImageToIntensityImageFilter.hxx @@ -36,7 +36,7 @@ template VectorImageToIntensityImageFilter ::VectorImageToIntensityImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } template diff --git a/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx b/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx index 649b488936..34a781d83d 100644 --- a/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbVectorImageToMatrixImageFilter.hxx @@ -35,7 +35,7 @@ template PersistentVectorImageToMatrixFilter ::PersistentVectorImageToMatrixFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // first output is a copy of the image, DataObject created by // superclass // diff --git a/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h b/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h index 8692e1ebeb..e0da51af59 100644 --- a/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h +++ b/Modules/Filtering/Wavelet/include/otbSubsampleImageFilter.h @@ -25,7 +25,7 @@ #include "itkImageToImageFilter.h" #include "itkImage.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; //Just to get the forward/inverse definitions #include "otbWaveletOperatorBase.h" @@ -104,7 +104,7 @@ public: protected: SubsampleImageFilter () { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_SubsampleFactor.Fill(1); } ~SubsampleImageFilter() override {} diff --git a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx index db8e556ac3..b764bfbd06 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletFilterBank.hxx @@ -39,7 +39,7 @@ template WaveletFilterBank ::WaveletFilterBank () { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1); @@ -609,7 +609,7 @@ template WaveletFilterBank ::WaveletFilterBank () { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(1 << InputImageDimension); m_UpSampleFilterFactor = 0; diff --git a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx index 3cc7c48c9a..3400df31d0 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx +++ b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.hxx @@ -34,7 +34,7 @@ template WaveletsBandsListToWaveletsSynopsisImageFilter ::WaveletsBandsListToWaveletsSynopsisImageFilter() : m_DecimationRatio(2) { -OTB_DISABLE_DYNAMIC_MT +OTB_DISABLE_DYNAMIC_MT; } /** Destructor */ diff --git a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx index 8193a538b8..fd93eb1801 100644 --- a/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx +++ b/Modules/IO/TestKernel/include/otbDifferenceImageFilter.hxx @@ -37,7 +37,7 @@ template DifferenceImageFilter ::DifferenceImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // We require two inputs to execute. this->SetNumberOfRequiredInputs(2); diff --git a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx index aadba17570..d38d3e8bfb 100644 --- a/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx +++ b/Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.hxx @@ -27,7 +27,7 @@ #include "itkMetaDataObject.h" #include "otbMetaDataKey.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -38,7 +38,7 @@ template DSFusionOfClassifiersImageFilter ::DSFusionOfClassifiersImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx index 52218076cc..5500f14f16 100644 --- a/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx +++ b/Modules/Learning/DimensionalityReductionLearning/include/otbImageDimensionalityReductionFilter.hxx @@ -33,7 +33,7 @@ template ImageDimensionalityReductionFilter ::ImageDimensionalityReductionFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx b/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx index b6edd7a113..e00385514e 100644 --- a/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx +++ b/Modules/Learning/LearningBase/include/otbImageClassificationFilter.hxx @@ -22,7 +22,7 @@ #define otbImageClassificationFilter_hxx #include "otbImageClassificationFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIterator.h" #include "itkProgressReporter.h" @@ -38,10 +38,8 @@ ImageClassificationFilter this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); - - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredOutputs(3); - this->SetNthOutput(0,TOutputImage::New()); this->SetNthOutput(1,ConfidenceImageType::New()); this->SetNthOutput(2,ProbaImageType::New()); diff --git a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx index 42418fc699..09faf3f510 100644 --- a/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx +++ b/Modules/Learning/LearningBase/include/otbKMeansImageClassificationFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbKMeansImageClassificationFilter_hxx #define otbKMeansImageClassificationFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbKMeansImageClassificationFilter.h" #include "itkImageRegionIterator.h" #include "itkNumericTraits.h" @@ -35,7 +35,7 @@ template ::KMeansImageClassificationFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); diff --git a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx index 40de639b8b..ce666db2cf 100644 --- a/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx +++ b/Modules/Learning/SOM/include/otbSOMImageClassificationFilter.hxx @@ -34,7 +34,7 @@ template ::SOMImageClassificationFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredInputs(1); m_DefaultLabel = itk::NumericTraits::ZeroValue(); diff --git a/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h index ddde84b475..c58c175e10 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbImageToRadianceImageFilter.h @@ -165,7 +165,7 @@ protected: /** Constructor */ ImageToRadianceImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_Alpha.SetSize(0); m_Beta.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h index 9a0c2fa53f..cd6c580165 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbRadianceToReflectanceImageFilter.h @@ -259,7 +259,7 @@ protected: m_IsSetSolarDistance(false), m_UseClamp(true) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_SolarIllumination.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h index 253686773f..f7f294fdf7 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToRadianceImageFilter.h @@ -241,7 +241,7 @@ protected: m_IsSetFluxNormalizationCoefficient(false), m_IsSetSolarDistance(false) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_SolarIllumination.SetSize(0); }; diff --git a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx index 205931782d..0ffd630537 100644 --- a/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx +++ b/Modules/Radiometry/OpticalCalibration/include/otbReflectanceToSurfaceReflectanceImageFilter.hxx @@ -38,7 +38,7 @@ ReflectanceToSurfaceReflectanceImageFilter m_IsSetAcquiCorrectionParameters(false), m_UseGenerateParameters(true) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_AtmosphericRadiativeTerms = AtmosphericRadiativeTermsType::New(); m_AtmoCorrectionParameters = AtmoCorrectionParametersType::New(); m_AcquiCorrectionParameters = AcquiCorrectionParametersType::New(); diff --git a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx index 366797580e..62b6a6b7ba 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarDeburstImageFilter.hxx @@ -25,7 +25,7 @@ #include "otbSarSensorModelAdapter.h" #include "otbImageKeywordlist.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageScanlineIterator.h" #include "itkImageScanlineConstIterator.h" #include "itkImageRegionIterator.h" @@ -37,7 +37,7 @@ namespace otb template SarDeburstImageFilter::SarDeburstImageFilter() : m_LinesRecord(), m_SamplesRecord(), m_OnlyValidSample(false) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } // Needs to be re-implemented since size of output is modified diff --git a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx index 41944eb6cb..4d7c6a4785 100644 --- a/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx +++ b/Modules/Radiometry/SARCalibration/include/otbSarRadiometricCalibrationToImageFilter.hxx @@ -37,7 +37,7 @@ SarRadiometricCalibrationToImageFilter ::SarRadiometricCalibrationToImageFilter() : m_LookupSelected(0) { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; } template diff --git a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx index ba9dfb200d..15b5c1f115 100644 --- a/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.hxx @@ -22,7 +22,7 @@ #define otbDisparityTranslateFilter_hxx #include "otbDisparityTranslateFilter.h" -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "itkImageRegionIteratorWithIndex.h" #include "itkImageRegionIterator.h" @@ -33,7 +33,7 @@ template ::DisparityTranslateFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; m_NoDataValue = -32768; // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(6); diff --git a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx index 5ded72b3ba..1adad66455 100644 --- a/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbMultiDisparityMapTo3DFilter.hxx @@ -33,7 +33,7 @@ class TMaskImage, class TResidueImage> MultiDisparityMapTo3DFilter ::MultiDisparityMapTo3DFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(3); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx index 65cdec4e11..179ed6ac80 100644 --- a/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbPixelWiseBlockMatchingImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbPixelWiseBlockMatchingImageFilter_hxx #define otbPixelWiseBlockMatchingImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbPixelWiseBlockMatchingImageFilter.h" #include "itkProgressReporter.h" #include "itkConstantBoundaryCondition.h" @@ -34,7 +34,7 @@ PixelWiseBlockMatchingImageFilter ::PixelWiseBlockMatchingImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set the number of inputs this->SetNumberOfRequiredInputs(6); this->SetNumberOfRequiredInputs(2); diff --git a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx index 0e9190eb67..d9951b70d5 100644 --- a/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx +++ b/Modules/Registration/DisparityMap/include/otbSubPixelDisparityImageFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbSubPixelDisparityImageFilter_hxx #define otbSubPixelDisparityImageFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbSubPixelDisparityImageFilter.h" namespace otb @@ -32,7 +32,7 @@ SubPixelDisparityImageFilter ::SubPixelDisparityImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set the number of required inputs this->SetNumberOfRequiredInputs(3); diff --git a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx index 3a73570103..d5d49f1d6d 100644 --- a/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx +++ b/Modules/Registration/Stereo/include/otbBijectionCoherencyFilter.hxx @@ -21,7 +21,7 @@ #ifndef otbBijectionCoherencyFilter_hxx #define otbBijectionCoherencyFilter_hxx -#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; #include "otbBijectionCoherencyFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" @@ -34,7 +34,7 @@ template BijectionCoherencyFilter ::BijectionCoherencyFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set the number of inputs (1 moving image by default -> 3 inputs) this->SetNumberOfRequiredInputs(4); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx index 39ad2ee0bb..b2ad220625 100644 --- a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx +++ b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx @@ -33,7 +33,7 @@ namespace otb template Multi3DMapToDEMFilter::Multi3DMapToDEMFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; // Set the number of inputs (1 image one optional mask) this->SetNumberOfIndexedInputs(2); this->SetNumberOfRequiredInputs(1); diff --git a/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h b/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h index 5e0e3db3c2..6a2894643c 100644 --- a/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h +++ b/Modules/Segmentation/Labelling/include/otbLabelToBoundaryImageFilter.h @@ -96,7 +96,7 @@ public: protected: LabelToBoundaryImageFilter() { - OTB_DISABLE_DYNAMIC_MT + OTB_DISABLE_DYNAMIC_MT; this->SetRadius(1); } ~LabelToBoundaryImageFilter() override { } -- GitLab From a5606c236996df87b7aad73b6247f8fc149eb8cf Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 7 Sep 2018 14:03:23 +0200 Subject: [PATCH 16/63] ENH: fix LexicographicalCompare in ITK 4, 5(alpha1, alpha2), 5(master) iktLexicographicCompare.h is new in ITK 5 which was using a templated class until ITK 5 (alpha2) release. It was made "better" by not using template parameter for this class. Initial approach was to use ifdef on ITK_VERSION_MAJOR but that is going to end up in more problems since different itk version with same major have differences. So We copy old class def from ITK4.x and use it directly in one class where it is used --- .../otbShapeAttributesLabelMapFilter.h | 46 +++++++++++++------ .../otbShapeAttributesLabelMapFilter.hxx | 7 +-- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h index 1219115223..a829ea0574 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h @@ -24,10 +24,6 @@ #include "itkConfigure.h" -#if ITK_VERSION_MAJOR > 4 -#include "itkLexicographicCompare.h" -#endif - #include "otbLabelMapFeaturesFunctorImageFilter.h" #include "otbImage.h" #include "otbPolygon.h" @@ -40,6 +36,34 @@ namespace otb namespace Functor { +/** \class OffsetLexicographicCompare + * \brief Order Offset instances lexicographically. + * + * This is a comparison functor suitable for storing Offset instances + * in an STL container. The ordering is total and unique but has + * little geometric meaning. + * This class is copied from ITK 4.12.0 for compatability with ITK 4, 5( alpha2), ITK5 (master) + * \ingroup OTBLabelMap + */ +template< unsigned int VOffsetDimension > +class OffsetLexicographicCompare +{ +public: + bool operator()(itk::Offset< VOffsetDimension > const & l, + itk::Offset< VOffsetDimension > const & r) const + { + for ( unsigned int i = 0; i < VOffsetDimension; ++i ) { + if ( l.GetElement(i) < r.GetElement(i) ) { + return true; + } + else if ( l.GetElement(i) > r.GetElement(i) ) { + return false; + } + } + return false; + } +}; + /** \class ShapeAttributesLabelObjectFunctor * \brief Functor to compute shape attributes of one LabelObject. * @@ -76,6 +100,7 @@ public: itkStaticConstMacro(ImageDimension, unsigned int, TLabelObject::ImageDimension); typedef itk::ImageRegion< TLabelObject::ImageDimension > RegionType; typedef itk::Offset< TLabelObject::ImageDimension > OffsetType; + typedef otb::Functor::OffsetLexicographicCompare OffsetLexicographicCompare; /** Constructor */ ShapeAttributesLabelObjectFunctor(); @@ -153,15 +178,10 @@ private: typedef itk::Offset<3> Offset3Type; typedef itk::Vector Spacing2Type; typedef itk::Vector Spacing3Type; - #if ITK_VERSION_MAJOR > 4 - typedef itk::Functor::LexicographicCompare LexicographicCompare2; - typedef itk::Functor::LexicographicCompare LexicographicCompare3; - #else - typedef typename Offset2Type::LexicographicCompare LexicographicCompare2; - typedef typename Offset3Type::LexicographicCompare LexicographicCompare3; - #endif - typedef std::map MapIntercept2Type; - typedef std::map MapIntercept3Type; + typedef otb::Functor::OffsetLexicographicCompare<2> OffsetLexicographicCompare2; + typedef otb::Functor::OffsetLexicographicCompare<3> OffsetLexicographicCompare3; + typedef std::map MapIntercept2Type; + typedef std::map MapIntercept3Type; template double PerimeterFromInterceptCount( TMapIntercept & intercepts, const TSpacing & spacing ); #if ! defined(ITK_DO_NOT_USE_PERIMETER_SPECIALIZATION) diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx index 74ceb74bd2..ee30f6a134 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx @@ -735,12 +735,7 @@ ShapeAttributesLabelObjectFunctor } // a data structure to store the number of intercepts on each direction - #if ITK_VERSION_MAJOR > 4 - typedef itk::Functor::LexicographicCompare LexicographicCompare; - #else - typedef typename OffsetType::LexicographicCompare LexicographicCompare; - #endif - typedef typename std::map MapInterceptType; + typedef typename std::map MapInterceptType; MapInterceptType intercepts; // int nbOfDirections = (int)std::pow( 2.0, (int)ImageDimension ) - 1; // intecepts.resize(nbOfDirections + 1); // code begins at position 1 -- GitLab From 4ccaa22dd8dd36b44b8fca66a755f93b2b36ab34 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 26 Sep 2018 12:01:41 +0200 Subject: [PATCH 17/63] BUG: do not use Offset::GetElement() --- .../Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h index a829ea0574..abc544888c 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h @@ -53,10 +53,10 @@ public: itk::Offset< VOffsetDimension > const & r) const { for ( unsigned int i = 0; i < VOffsetDimension; ++i ) { - if ( l.GetElement(i) < r.GetElement(i) ) { + if ( l[i] < r[i] ) { return true; } - else if ( l.GetElement(i) > r.GetElement(i) ) { + else if ( l[i] > r[i] ) { return false; } } -- GitLab From 353da0c28c6ccf95f4c131752889ba50f2df0df0 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 27 Sep 2018 15:21:53 +0200 Subject: [PATCH 18/63] WRG: unused variables --- Modules/Filtering/Path/include/otbCompacityPathFunction.hxx | 1 - .../Filtering/Path/include/otbOrientationPathFunction.hxx | 1 - Modules/Filtering/Path/test/otbImageToEdgePathFilter.cxx | 2 -- .../include/otbGCPsToRPCSensorModelImageFilter.hxx | 5 ----- .../SARCalibration/test/otbSarParametricMapFunctionTest.cxx | 2 -- .../Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx | 2 -- .../include/otbStereoSensorModelToElevationMapFilter.hxx | 2 +- .../otbStereorectificationDisplacementFieldSource.hxx | 1 - 8 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx index 3360698d5b..7994ca8a05 100644 --- a/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbCompacityPathFunction.hxx @@ -45,7 +45,6 @@ CompacityPathFunction { VertexListPointer vertexList; VertexType cindex; - VertexType IndexOut; int nbPath; RealType Surface = 0.0; RealType Perimeter = 0.0; diff --git a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx index cb604d60ef..ff4eac938c 100644 --- a/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx +++ b/Modules/Filtering/Path/include/otbOrientationPathFunction.hxx @@ -46,7 +46,6 @@ OrientationPathFunction { VertexListPointer vertexList; VertexType cindex; - VertexType IndexOut; int nbPath; RealType Theta; diff --git a/Modules/Filtering/Path/test/otbImageToEdgePathFilter.cxx b/Modules/Filtering/Path/test/otbImageToEdgePathFilter.cxx index 688bd0fca7..d49188156f 100644 --- a/Modules/Filtering/Path/test/otbImageToEdgePathFilter.cxx +++ b/Modules/Filtering/Path/test/otbImageToEdgePathFilter.cxx @@ -59,12 +59,10 @@ int otbImageToEdgePathFilter(int itkNotUsed(argc), char * argv[]) PathType * outputPath = pathFilter->GetOutput(); - typedef PathType::VertexType VertexType; typedef PathType::VertexListType VertexListType; typedef VertexListType::ConstPointer VertexListTypePointer; VertexListTypePointer vertexList; - VertexType cindex; VertexListTypePointer ptrVertexList = outputPath->GetVertexList(); diff --git a/Modules/Filtering/Projection/include/otbGCPsToRPCSensorModelImageFilter.hxx b/Modules/Filtering/Projection/include/otbGCPsToRPCSensorModelImageFilter.hxx index 22ffe1ad8d..2de1e47fe4 100644 --- a/Modules/Filtering/Projection/include/otbGCPsToRPCSensorModelImageFilter.hxx +++ b/Modules/Filtering/Projection/include/otbGCPsToRPCSensorModelImageFilter.hxx @@ -248,7 +248,6 @@ GCPsToRPCSensorModelImageFilter rsTransform->SetInputKeywordList(m_Keywordlist); rsTransform->InstantiateTransform(); - ContinuousIndexType idFix, idOut; Continuous3DIndexType idOut3D, idTrans3D; Point2DType sensorPoint; @@ -274,10 +273,6 @@ GCPsToRPCSensorModelImageFilter groundPointTemp = rsTransform->TransformPoint(sensorPointTemp); - // Compute Euclidian distance - idFix[0] = sensorPoint[0]; - idFix[1] = sensorPoint[1]; - idOut3D[0] = groundPoint[0]; idOut3D[1] = groundPoint[1]; idOut3D[2] = groundPoint[2]; diff --git a/Modules/Radiometry/SARCalibration/test/otbSarParametricMapFunctionTest.cxx b/Modules/Radiometry/SARCalibration/test/otbSarParametricMapFunctionTest.cxx index 82904e132d..71b68784e3 100644 --- a/Modules/Radiometry/SARCalibration/test/otbSarParametricMapFunctionTest.cxx +++ b/Modules/Radiometry/SARCalibration/test/otbSarParametricMapFunctionTest.cxx @@ -59,8 +59,6 @@ int otbSarParametricMapFunctionTest(int itkNotUsed(argc), char* argv[]) FunctionType::PointType p0; IndexType index; InputPixelType value; - FunctionType::PointType pDst; - p0[0] = static_cast(size[0] / 2.); p0[1] = static_cast(size[1] / 4.); diff --git a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx index b2ad220625..ec0e207599 100644 --- a/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx +++ b/Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.hxx @@ -417,7 +417,6 @@ void Multi3DMapToDEMFilter::GenerateInput typename T3DImage::RegionType mapRegion = imgPtr->GetLargestPossibleRegion(); - itk::ContinuousIndex mapContiIndex; long int maxMapIndex[2] = { 0, 0 }; long int minMapIndex[2] = { 0, 0 }; maxMapIndex[0] = static_cast (mapRegion.GetIndex(0) + mapRegion.GetSize(0)); @@ -570,7 +569,6 @@ void Multi3DMapToDEMFilter::ThreadedGener TOutputDEMImage * outputPtr = this->GetOutput(); typename OutputImageType::PointType pointRef; - typename OutputImageType::PointType pointRefStep; typename OutputImageType::RegionType requestedRegion = outputPtr->GetRequestedRegion(); // typename TOutputDEMImage::SpacingType step = outputPtr->GetSignedSpacing(); diff --git a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx index 45b9a2d347..7b7cd6f6c9 100644 --- a/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx +++ b/Modules/Registration/Stereo/include/otbStereoSensorModelToElevationMapFilter.hxx @@ -398,7 +398,7 @@ StereoSensorModelToElevationFilter while(!outputIt.IsAtEnd() && !inputIt.IsAtEnd()) { // Define some loop variables - typename InputImageType::PointType inPoint, outPoint, currentPoint, optimalPoint; + typename InputImageType::PointType inPoint, outPoint; typename GenericRSTransform3DType::InputPointType in3DPoint, out3DPoint; typename InputImageType::IndexType index; diff --git a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx index ca6b153515..abb6ce8e35 100644 --- a/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx +++ b/Modules/Registration/Stereo/include/otbStereorectificationDisplacementFieldSource.hxx @@ -171,7 +171,6 @@ StereorectificationDisplacementFieldSource if(m_UseDEM) { - RSTransform2DType::InputPointType tmpPoint; localElevation = demHandler->GetHeightAboveEllipsoid(leftToGroundTransform->TransformPoint(m_LeftImage->GetOrigin())); } -- GitLab From 1d9c5c857f8787a59777c6f0ac94f802faa7a8d2 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 27 Sep 2018 15:22:45 +0200 Subject: [PATCH 19/63] ENH: update for itk 4 et 5 alpha1, alpha2, beta1 --- Modules/Core/Common/include/otbMacro.h | 9 +++++++++ .../ObjectList/include/otbObjectListToObjectListFilter.h | 1 + Modules/IO/Carto/include/otbCoordinateToName.h | 1 + .../Sampling/include/otbPersistentSamplingFilterBase.h | 1 + 4 files changed, 12 insertions(+) diff --git a/Modules/Core/Common/include/otbMacro.h b/Modules/Core/Common/include/otbMacro.h index d6f2b9ca3e..fdacd90247 100644 --- a/Modules/Core/Common/include/otbMacro.h +++ b/Modules/Core/Common/include/otbMacro.h @@ -31,6 +31,7 @@ #include "itkMacro.h" #include "itkObject.h" +#include "itkThreadSupport.h" #include "otbConfigure.h" #include "otbLogger.h" @@ -89,6 +90,14 @@ namespace otb #define OTB_DISABLE_DYNAMIC_MT this->DynamicMultiThreadingOff(); #endif +//ITK_THREAD_RETURN_TYPE and ITK_THREAD_RETURN_VALUE bas been changed in ITK5 +// we need to re-exposed to the global namespace to keep the +// use of these items consistent. +#if ITK_VERSION_MAJOR > 4 +#define ITK_THREAD_RETURN_TYPE itk::ITK_THREAD_RETURN_TYPE +#define ITK_THREAD_RETURN_VALUE itk::ITK_THREAD_RETURN_DEFAULT_VALUE +#endif + #define otbFileContext(x) \ << "file " __FILE__ ", line " << __LINE__<<", " x diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h index 297f504b42..bcdb08b450 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h @@ -23,6 +23,7 @@ #include "itkMultiThreader.h" #include "otbObjectListSource.h" +#include "otbMacro.h" //for ITK_THREAD_RETURN_TYPE in ITK5 namespace otb { diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index 527bc11d0e..0b5e30606d 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -27,6 +27,7 @@ #include "itkConfigure.h" #include "otbCurlHelperInterface.h" #include "OTBCartoExport.h" +#include "otbMacro.h" //for ITK_THREAD_RETURN_TYPE in ITK5 #include namespace otb diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h index 552f3224f6..c430cff148 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h @@ -24,6 +24,7 @@ #include "otbPersistentImageFilter.h" #include "otbOGRDataSourceWrapper.h" #include "otbImage.h" +#include "otbMacro.h" //for ITK_THREAD_RETURN_TYPE in ITK5 #include namespace otb -- GitLab From de237568667ff6195e0d1873e6203de9a94dd17b Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 11:53:18 +0200 Subject: [PATCH 20/63] BUG: check for amd64 to find 64bit arch --- CMake/OTBCheckTargetSystemArch.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/OTBCheckTargetSystemArch.cmake b/CMake/OTBCheckTargetSystemArch.cmake index a15ac1e036..522bdc148f 100644 --- a/CMake/OTBCheckTargetSystemArch.cmake +++ b/CMake/OTBCheckTargetSystemArch.cmake @@ -44,10 +44,10 @@ macro(OTB_CHECK_TARGET_SYSTEM_ARCH _RESULT1 _RESULT2) OUTPUT_VARIABLE ov OUTPUT_STRIP_TRAILING_WHITESPACE ) - + set(${_RESULT1} "${ov}") set(${_RESULT2} FALSE) - if("${ov}" STREQUAL "x86_64") + if("${ov}" MATCHES "(x86_64|amd64)") set(${_RESULT2} TRUE) endif() endif() -- GitLab From c3f580078aaf9e1f1e113546502b39b4416e5817 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 11:53:49 +0200 Subject: [PATCH 21/63] BUG: wrong path for download dir (default) --- SuperBuild/CMakeLists.txt | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 4eaa0f1c4a..4cb4ead350 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -25,9 +25,6 @@ project(OTB-SuperBuild) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) - -# Path to additional CMake modules -#MESSAGE(INFO "${CMAKE_SOURCE_DIR}") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake ${CMAKE_SOURCE_DIR}/../CMake @@ -39,17 +36,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") endif() include(ExternalProject) - -# Not needed as OTB Superbuild requires c++14 since version 6.2 -# include(OTBCheckCpp11Keywords) - include(OTBCheckTargetSystemArch) -set(LINUX FALSE) -if( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux") - set(LINUX TRUE) -endif() - option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON) option(BUILD_STATIC_LIBS "Build with static libraries." OFF) option(BUILD_ALWAYS "Always build or install OTB." ON) @@ -91,6 +79,10 @@ find_path(DOWNLOAD_LOCATION HINTS $ENV{DOWNLOAD_LOCATION} "${CMAKE_CURRENT_BINARY_DIR}/Downloads" ) +if(NOT DOWNLOAD_LOCATION) + set(DOWNLOAD_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/Downloads") +endif() + # General options option(OTB_DATA_USE_LARGEINPUT "Use Large inputs images test." OFF) mark_as_advanced(OTB_DATA_USE_LARGEINPUT) @@ -406,15 +398,8 @@ if(FROM_SUPERBUILD_LIST) endforeach() endif() -message(STATUS "OTB_TARGET_SYSTEM_ARCH=${OTB_TARGET_SYSTEM_ARCH}") -message(STATUS "OTB_TARGET_SYSTEM_ARCH_IS_X64=${OTB_TARGET_SYSTEM_ARCH_IS_X64}") - -if(DOWNLOAD_LOCATION) - message(STATUS "DOWNLOAD_LOCATION=${DOWNLOAD_LOCATION}") - message(STATUS "Source archives for dependencies will be taken from '${DOWNLOAD_LOCATION}'") -else() - message(STATUS "DOWNLOAD_LOCATION is not set. We will download all source archives during build!") -endif() - -message(STATUS "SuperBuild will be installed to ${CMAKE_INSTALL_PREFIX}") -message(STATUS "To install to a different directory, re-run cmake -DCMAKE_INSTALL_PREFIX=/your/preferred/path") +message(STATUS "OTB_TARGET_SYSTEM_ARCH_IS_X64 = ${OTB_TARGET_SYSTEM_ARCH_IS_X64}") +message(STATUS "DOWNLOAD_LOCATION = ${DOWNLOAD_LOCATION}") +message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") +message(STATUS "SUPERBUILD_OTB_VERSION = ${SUPERBUILD_OTB_VERSION}") +message("\nCMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator\n") -- GitLab From 0a0e27fa20e181820e989021426109e35ff2c4b2 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 12:00:32 +0200 Subject: [PATCH 22/63] ENH: update ITK to 5.0.b1 --- SuperBuild/CMake/External_itk.cmake | 14 ++--- SuperBuild/patches/ITK/itk-1-fftw-all.diff | 63 +++++++++++-------- .../patches/ITK/itk-2-itktestlib-all.diff | 35 ----------- 3 files changed, 40 insertions(+), 72 deletions(-) delete mode 100644 SuperBuild/patches/ITK/itk-2-itktestlib-all.diff diff --git a/SuperBuild/CMake/External_itk.cmake b/SuperBuild/CMake/External_itk.cmake index 5f26f8ffcb..b4eaa18a5e 100644 --- a/SuperBuild/CMake/External_itk.cmake +++ b/SuperBuild/CMake/External_itk.cmake @@ -22,11 +22,6 @@ INCLUDE_ONCE_MACRO(ITK) SETUP_SUPERBUILD(ITK) -# if(MSVC) -# set(ITK_SB_SRC "C:/Temp/ITK") -# set(ITK_SB_BUILD_DIR ${ITK_SB_SRC}/build) -# endif() - set(ITK_ENABLED_MODULES Common FiniteDifference @@ -84,7 +79,6 @@ set(ITK_ENABLED_MODULES Eigen #FEM NarrowBand - NeuralNetworks Optimizers Optimizersv4 Polynomials @@ -139,15 +133,15 @@ if (WIN32) endif() #variables are later used in packaging -set(SB_ITK_VERSION_MAJOR "4") -set(SB_ITK_VERSION_MINOR "13") +set(SB_ITK_VERSION_MAJOR "5") +set(SB_ITK_VERSION_MINOR "0") set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-${SB_ITK_VERSION_MAJOR}.${SB_ITK_VERSION_MINOR}) ExternalProject_Add(ITK PREFIX ITK - URL "https://sourceforge.net/projects/itk/files/itk/4.13/InsightToolkit-4.13.1.tar.gz" - URL_MD5 c7e229802c4ee64e1b2a6d48b1df67e9 + URL "https://github.com/InsightSoftwareConsortium/ITK/archive/v5.0b01.tar.gz" + URL_MD5 7b4f2259160e4708ec30b385973f9eca SOURCE_DIR ${ITK_SB_SRC} BINARY_DIR ${ITK_SB_BUILD_DIR} INSTALL_DIR ${SB_INSTALL_PREFIX} diff --git a/SuperBuild/patches/ITK/itk-1-fftw-all.diff b/SuperBuild/patches/ITK/itk-1-fftw-all.diff index 8b7769bfb6..ad7ac7e8fe 100644 --- a/SuperBuild/patches/ITK/itk-1-fftw-all.diff +++ b/SuperBuild/patches/ITK/itk-1-fftw-all.diff @@ -1,31 +1,40 @@ -diff -burN InsightToolkit-4.10.0.orig/CMake/FindFFTW.cmake InsightToolkit-4.10.0/CMake/FindFFTW.cmake ---- InsightToolkit-4.10.0.orig/CMake/FindFFTW.cmake 2016-06-16 14:21:15.226203872 +0200 -+++ InsightToolkit-4.10.0/CMake/FindFFTW.cmake 2016-06-16 14:23:48.966202670 +0200 -@@ -35,14 +35,12 @@ - set(FFTW_LIB_SEARCHPATH - ${FFTW_INSTALL_BASE_PATH}/lib - ${FFTW_INSTALL_BASE_PATH}/lib64 -- /usr/lib/fftw -- /usr/local/lib/fftw - ) +diff -burN ITK-5.0b01.orig/CMake/FindFFTW.cmake ITK-5.0b01/CMake/FindFFTW.cmake +--- ITK-5.0b01.orig/CMake/FindFFTW.cmake Wed Oct 3 11:56:29 2018 ++++ ITK-5.0b01/CMake/FindFFTW.cmake Wed Oct 3 11:58:11 2018 +@@ -56,7 +56,7 @@ + ) + endif() - if(ITK_USE_FFTWD) - mark_as_advanced(FFTWD_LIB) -- find_library(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib -- find_library(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib only if compiled with threads support -+ find_library(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Double Precision Lib -+ find_library(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Double Precision Lib only if compiled with threads support +- find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) ++ find_path(FFTW_INCLUDE_PATH fftw3.h NO_DEFAULT_PATH) - if(FFTWD_LIB) - set(FFTWD_FOUND 1) -@@ -55,8 +53,8 @@ + if(FFTW_INCLUDE_PATH) + file(TO_CMAKE_PATH "${FFTW_INCLUDE_PATH}" FFTW_INCLUDE_PATH) +@@ -145,14 +145,11 @@ + get_filename_component(FFTW_INSTALL_BASE_PATH ${FFTW_INCLUDE_PATH} PATH) + set(FFTW_LIB_SEARCHPATH + ${FFTW_INSTALL_BASE_PATH}/lib +- ${FFTW_INSTALL_BASE_PATH}/lib64 +- /usr/lib/fftw +- /usr/local/lib/fftw + ) + if(ITK_USE_FFTWD) + mark_as_advanced(FFTWD_LIB) +- find_library(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib +- find_library(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib only if compiled with threads support ++ find_library(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Double Precision Lib ++ find_library(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Double Precision Lib only if compiled with threads support - if(ITK_USE_FFTWF) - mark_as_advanced(FFTWF_LIB) -- find_library(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib -- find_library(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib only if compiled with threads support -+ find_library(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Single Precision Lib -+ find_library(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Single Precision Lib only if compiled with threads support + if(FFTWD_LIB) + set(FFTWD_FOUND 1) +@@ -167,8 +164,8 @@ - if(FFTWF_LIB) - set(FFTWF_FOUND 1) + if(ITK_USE_FFTWF) + mark_as_advanced(FFTWF_LIB) +- find_library(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib +- find_library(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib only if compiled with threads support ++ find_library(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Single Precision Lib ++ find_library(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH} NO_DEFAULT_PATH) #Single Precision Lib only if compiled with threads support + + if(FFTWF_LIB) + set(FFTWF_FOUND 1) diff --git a/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff b/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff deleted file mode 100644 index dc0b0cbdbb..0000000000 --- a/SuperBuild/patches/ITK/itk-2-itktestlib-all.diff +++ /dev/null @@ -1,35 +0,0 @@ -diff -burN InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/CMakeLists.txt InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/CMakeLists.txt ---- InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/CMakeLists.txt 2017-08-22 11:53:55.960938649 +0200 -+++ InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/CMakeLists.txt 2017-08-22 11:56:07.289820954 +0200 -@@ -18,10 +18,14 @@ - # Retrive the variable type to CACHE. - set(BUILD_EXAMPLES ${BUILD_EXAMPLES} CACHE BOOL "Build the examples from the ITK Software Guide." FORCE) - --foreach(lib itkvcl itkv3p_netlib itktestlib itkvnl itkvnl_algo itknetlib) -+foreach(lib itkvcl itkv3p_netlib itkvnl itkvnl_algo itknetlib) - itk_module_target(${lib} NO_INSTALL) - endforeach() - -+if(BUILD_TESTING) -+ itk_module_target(itktestlib NO_INSTALL) -+endif() -+ - foreach(exe - netlib_integral_test - netlib_lbfgs_example -diff -burN InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt ---- InsightToolkit-4.12.0.orig/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt 2017-08-22 11:53:55.960938649 +0200 -+++ InsightToolkit-4.12.0/Modules/ThirdParty/VNL/src/vxl/core/CMakeLists.txt 2017-08-22 11:56:56.410150930 +0200 -@@ -131,8 +131,10 @@ - set(CORE_VIDEO_FOUND OFF CACHE INTERNAL "VXL core video libraries built") - endif () - --# common test executable --add_subdirectory(testlib) -+# common test executable if testing enabled -+if(BUILD_TESTING) -+ add_subdirectory(testlib) -+endif() - - # Tests that check and output the vxl configuration - # NOTE: some external projects remove the tests directory (aka ITK) -- GitLab From 5211228f8a1ec6feef8f1db4cf13accbf5eedabd Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 13:20:37 +0200 Subject: [PATCH 23/63] ITK_THREAD_RETURN_* is moved to namespace itk in git master --- Modules/Core/Common/include/otbMacro.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Core/Common/include/otbMacro.h b/Modules/Core/Common/include/otbMacro.h index fdacd90247..a63b3b5a58 100644 --- a/Modules/Core/Common/include/otbMacro.h +++ b/Modules/Core/Common/include/otbMacro.h @@ -90,13 +90,15 @@ namespace otb #define OTB_DISABLE_DYNAMIC_MT this->DynamicMultiThreadingOff(); #endif -//ITK_THREAD_RETURN_TYPE and ITK_THREAD_RETURN_VALUE bas been changed in ITK5 +/* +//ITK_THREAD_RETURN_TYPE and ITK_THREAD_RETURN_VALUE bas been changed in ITK5 (master) // we need to re-exposed to the global namespace to keep the // use of these items consistent. #if ITK_VERSION_MAJOR > 4 #define ITK_THREAD_RETURN_TYPE itk::ITK_THREAD_RETURN_TYPE #define ITK_THREAD_RETURN_VALUE itk::ITK_THREAD_RETURN_DEFAULT_VALUE #endif +*/ #define otbFileContext(x) \ << "file " __FILE__ ", line " << __LINE__<<", " x -- GitLab From dbcf980e2798d3bb59ea514ab8bfb32d0fa7c291 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 14:35:52 +0200 Subject: [PATCH 24/63] BUG: min required swig version is 3.0.10 on ubuntu 14.04 LTS system package has swig version 3.0.2 but this give a warning when parsing itkBase.i "Warning 341: The 'using' keyword in type aliasing is not fully supported yet." I had tested swig 3.0.10 (latest is 3.0.12) on windows and linux which does not have this warning and works fine for python and java. Even though this is a "warning" when parsing .i subsequent compilation fails with swig 3.0.x. --- Modules/Wrappers/SWIG/otb-module-init.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/Wrappers/SWIG/otb-module-init.cmake b/Modules/Wrappers/SWIG/otb-module-init.cmake index f92ed613fb..dd7d1cca2a 100644 --- a/Modules/Wrappers/SWIG/otb-module-init.cmake +++ b/Modules/Wrappers/SWIG/otb-module-init.cmake @@ -20,9 +20,8 @@ option ( OTB_WRAP_PYTHON "Wrap Python" OFF ) -<<<<<<< 26c5f08c18a5a1d7ea87a301124f7602ae1d9475 if ( OTB_WRAP_PYTHON ) - find_package ( SWIG 3.0 REQUIRED ) + find_package ( SWIG 3.0.10 REQUIRED ) mark_as_advanced(SWIG_DIR) mark_as_advanced(SWIG_EXECUTABLE) mark_as_advanced(SWIG_VERSION) -- GitLab From bd73615524198bd9a782a2848cba78609fbf20ee Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Wed, 3 Oct 2018 14:49:52 +0200 Subject: [PATCH 25/63] ENH: upgrade cmake min version to 3.10.2 ITK beta1 has cmake min version set to 3.10.2. https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMakeLists.txt So we all have to build superbuild with cmake 3.10.2. Alternative is to ask for a cmake >= 3.10.2 when building ITK. I think this is better path than using an if else. This way all libraries can use same cool features like in ITK project. --- SuperBuild/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 4cb4ead350..78253039d1 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -18,8 +18,7 @@ # limitations under the License. # -cmake_minimum_required(VERSION 3.3.0) - +cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(OTB-SuperBuild) set(CMAKE_CXX_STANDARD 14) -- GitLab From db749762212d6fdbfcb611a2ee6b095e9e3d04fe Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 4 Oct 2018 12:31:31 +0200 Subject: [PATCH 26/63] ENH: set ITKV4_COMPATIBILITY if building ITK5 --- SuperBuild/CMake/External_itk.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SuperBuild/CMake/External_itk.cmake b/SuperBuild/CMake/External_itk.cmake index b4eaa18a5e..c018ecc083 100644 --- a/SuperBuild/CMake/External_itk.cmake +++ b/SuperBuild/CMake/External_itk.cmake @@ -136,6 +136,12 @@ endif() set(SB_ITK_VERSION_MAJOR "5") set(SB_ITK_VERSION_MINOR "0") + +if(SB_ITK_VERSION_MAJOR STREQUAL "5") + list(APPEND ITK_SB_CONFIG + -DITKV4_COMPATIBILITY:BOOL=ON) +endif() + set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-${SB_ITK_VERSION_MAJOR}.${SB_ITK_VERSION_MINOR}) ExternalProject_Add(ITK -- GitLab From 053b1fab441fed2b8810dee6848bc2d7c56518c7 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 4 Oct 2018 12:32:24 +0200 Subject: [PATCH 27/63] BUG: use nullptr --- Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx index 2eb7c00626..901293a472 100644 --- a/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx +++ b/Modules/IO/ImageIO/include/otbMultiImageFileWriter.hxx @@ -45,7 +45,7 @@ MultiImageFileWriter::Sink ::Sink(typename otb::ImageFileWriter::ConstPointer writer): SinkBase(dynamic_cast(writer->GetInput()->GetPointer())), m_Writer(writer), - m_ImageIO(NULL) + m_ImageIO(nullptr) { } -- GitLab From ee83d5ba65504e3eb6c31009eebeae67b890b838 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 5 Oct 2018 16:28:56 +0200 Subject: [PATCH 28/63] Revert "ENH: upgrade cmake min version to 3.10.2" This reverts commit c6f89bb1c1c62a0787605137132f072dad329d62. --- SuperBuild/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 78253039d1..4cb4ead350 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -18,7 +18,8 @@ # limitations under the License. # -cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) +cmake_minimum_required(VERSION 3.3.0) + project(OTB-SuperBuild) set(CMAKE_CXX_STANDARD 14) -- GitLab From 37e20bf15e44cbaae3d7184e63363f6904cf98fe Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 5 Oct 2018 16:30:52 +0200 Subject: [PATCH 29/63] WIP: downgrade cmake version: 3.10.2 -> 3.3.0 --- SuperBuild/patches/ITK/itk-2-cmake33-all.diff | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 SuperBuild/patches/ITK/itk-2-cmake33-all.diff diff --git a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff new file mode 100644 index 0000000000..e412e0c2b0 --- /dev/null +++ b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff @@ -0,0 +1,9 @@ +diff -burN /tmp/ITK-5.0b01.orig/CMakeLists.txt /tmp/ITK-5.0b01/CMakeLists.txt +--- /tmp/ITK-5.0b01.orig/CMakeLists.txt Fri Oct 5 16:27:18 2018 ++++ /tmp/ITK-5.0b01/CMakeLists.txt Fri Oct 5 16:28:35 2018 +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) + + if(CMAKE_CXX_STANDARD EQUAL "98" ) + message(FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported in ITK version 5 and greater.") -- GitLab From 2c0e13be7dc233b4ae51af5715d9c2966cdfc005 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Mon, 8 Oct 2018 09:45:43 +0200 Subject: [PATCH 30/63] COMP: update patch for ITK --- SuperBuild/patches/ITK/itk-2-cmake33-all.diff | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff index e412e0c2b0..74e4010f57 100644 --- a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff +++ b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff @@ -1,9 +1,9 @@ -diff -burN /tmp/ITK-5.0b01.orig/CMakeLists.txt /tmp/ITK-5.0b01/CMakeLists.txt ---- /tmp/ITK-5.0b01.orig/CMakeLists.txt Fri Oct 5 16:27:18 2018 -+++ /tmp/ITK-5.0b01/CMakeLists.txt Fri Oct 5 16:28:35 2018 +diff -burN ITK-5.0b01.orig/CMakeLists.txt ITK-5.0b01/CMakeLists.txt +--- ITK-5.0b01.orig/CMakeLists.txt Mon Oct 8 09:07:50 2018 ++++ ITK-5.0b01/CMakeLists.txt Thu Sep 6 00:23:21 2018 @@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -+cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) +-cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) if(CMAKE_CXX_STANDARD EQUAL "98" ) message(FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported in ITK version 5 and greater.") -- GitLab From a6adbfdb58f32dd85de4a5f7dcf5175bf247880b Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 9 Oct 2018 11:00:15 +0200 Subject: [PATCH 31/63] COMP: update cmake version patch again --- SuperBuild/patches/ITK/itk-2-cmake33-all.diff | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff index 74e4010f57..12a71d4c55 100644 --- a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff +++ b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff @@ -1,9 +1,9 @@ diff -burN ITK-5.0b01.orig/CMakeLists.txt ITK-5.0b01/CMakeLists.txt ---- ITK-5.0b01.orig/CMakeLists.txt Mon Oct 8 09:07:50 2018 -+++ ITK-5.0b01/CMakeLists.txt Thu Sep 6 00:23:21 2018 +--- ITK-5.0b01.orig/CMakeLists.txt Tue Oct 9 10:56:04 2018 ++++ ITK-5.0b01/CMakeLists.txt Tue Oct 9 10:56:44 2018 @@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) -+cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) +-cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) if(CMAKE_CXX_STANDARD EQUAL "98" ) message(FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported in ITK version 5 and greater.") -- GitLab From d4312bdbd3c224ccea34607be441b0cfa7734d74 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Tue, 9 Oct 2018 11:14:29 +0200 Subject: [PATCH 32/63] COMP: remove cmake verison patch for ITK --- SuperBuild/patches/ITK/itk-2-cmake33-all.diff | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 SuperBuild/patches/ITK/itk-2-cmake33-all.diff diff --git a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff b/SuperBuild/patches/ITK/itk-2-cmake33-all.diff deleted file mode 100644 index 12a71d4c55..0000000000 --- a/SuperBuild/patches/ITK/itk-2-cmake33-all.diff +++ /dev/null @@ -1,9 +0,0 @@ -diff -burN ITK-5.0b01.orig/CMakeLists.txt ITK-5.0b01/CMakeLists.txt ---- ITK-5.0b01.orig/CMakeLists.txt Tue Oct 9 10:56:04 2018 -+++ ITK-5.0b01/CMakeLists.txt Tue Oct 9 10:56:44 2018 -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -+cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) - - if(CMAKE_CXX_STANDARD EQUAL "98" ) - message(FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported in ITK version 5 and greater.") -- GitLab From 713700f8575a09a04ee66e07556e4243c9ed8c1a Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 11 Oct 2018 10:41:56 +0200 Subject: [PATCH 33/63] COMP: using 'auto' gives link error Mac OS X 10.10.2 fails at link time when using auto. I do not know "why" this happens on osx 10.10 with AppleClang 6.0. one thing that changed when looking before and after is itk 5.0. And itk has a long history of strange issues when coming to osx. It maybe that or some bug fixed/added in 5.0. error message from osx: ``` Undefined symbols for architecture x86_64: "itk::SmartPointer > >::SmartPointer(itk::SmartPointer > > const&)", referenced from: otb::Wrapper::InputVectorDataListParameter::GetVectorDataList() in otbWrapperInputVectorDataListParameter.cxx.o "itk::SmartPointer > >::SmartPointer(itk::SmartPointer > > const&)", referenced from: otb::Wrapper::InputImageListParameter::GetImageList() in otbWrapperInputImageListParameter.cxx.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [lib/libOTBApplicationEngine-6.7.1.dylib] Error 1 make[4]: *** [Modules/Wrappers/ApplicationEngine/src/CMakeFiles/OTBApplicationEngine.dir/all] Error 2 ``` --- .../ApplicationEngine/include/otbWrapperParameterList.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperParameterList.hxx b/Modules/Wrappers/ApplicationEngine/include/otbWrapperParameterList.hxx index 74967552f2..1b31e39a6e 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperParameterList.hxx +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperParameterList.hxx @@ -384,7 +384,7 @@ ParameterList< T > std::for_each( begin(), end(), - [ this_list, get ]( auto parameter ) -> void + [ this_list, get ]( typename T::Pointer parameter ) -> void { assert( parameter ); assert( parameter==otb::DynamicCast< T >( parameter ) ); -- GitLab From d47c5d81ce77d403e110556b75b24ad73296aebd Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Thu, 11 Oct 2018 17:52:14 +0200 Subject: [PATCH 34/63] COMP: turn off exporting all symbols (msvc) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c162d39a17..a6dd29e868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,7 +220,7 @@ option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON) set(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) if(MSVC) - option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Build OTB with shared libraries." ON) + option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Build OTB with shared libraries." OFF) set(OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ${CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS}) else() set(OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) -- GitLab From b28df2504783fa44447238b3abc21687fba1570d Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 12 Oct 2018 16:05:01 +0200 Subject: [PATCH 35/63] SuperBuild: QWT: log outputs file --- SuperBuild/CMake/External_qwt.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SuperBuild/CMake/External_qwt.cmake b/SuperBuild/CMake/External_qwt.cmake index ba2b41bc24..6690d6f8a6 100644 --- a/SuperBuild/CMake/External_qwt.cmake +++ b/SuperBuild/CMake/External_qwt.cmake @@ -66,9 +66,9 @@ ExternalProject_Add(QWT CONFIGURE_COMMAND ${QWT_SB_CONFIGURE_PROGRAM} ${QWT_SB_SRC}/qwt.pro BUILD_COMMAND ${QWT_SB_MAKE_PROGRAM} INSTALL_COMMAND ${QWT_SB_MAKE_PROGRAM} install - LOG_CONFIGURE 0 - LOG_BUILD 0 - LOG_INSTALL 0 + LOG_CONFIGURE 1 + LOG_BUILD 1 + LOG_INSTALL 1 ) SUPERBUILD_PATCH_SOURCE(QWT) -- GitLab From 34519369baf318c2be86be6abb4adbaaf1bdbea1 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 12 Oct 2018 17:44:47 +0200 Subject: [PATCH 36/63] COMP: disable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS --- CMake/OTBSetStandardCompilerFlags.cmake | 46 +++++++------------------ CMakeLists.txt | 2 +- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/CMake/OTBSetStandardCompilerFlags.cmake b/CMake/OTBSetStandardCompilerFlags.cmake index 6a7cad037a..0065ead5b4 100644 --- a/CMake/OTBSetStandardCompilerFlags.cmake +++ b/CMake/OTBSetStandardCompilerFlags.cmake @@ -190,41 +190,19 @@ macro(check_compiler_platform_flags) endif() endif() - if(WIN32) - # Some libraries (e.g. vxl libs) have no dllexport markup, so we can - # build full shared libraries only with the GNU toolchain. For non - # gnu compilers on windows, only Common is shared. This allows for - # plugin type applications to use a dll for OTBCommon which will contain - # the static for Modified time. - if(CMAKE_COMPILER_IS_GNUCXX) - # CMake adds --enable-all-exports on Cygwin (since Cygwin is - # supposed to be UNIX-like), but we need to add it explicitly for - # a native windows build with the MinGW tools. - if(MINGW) - set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS - "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import") - set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS - "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import") - endif() - else() - if(MSVC) - set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} /MANIFEST:NO") - endif() - # if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then - # BUILD_SHARED_LIBS works as it would on other systems - if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS) - if(BUILD_SHARED_LIBS) - set(OTB_LIBRARY_BUILD_TYPE "SHARED") - else() - set(OTB_LIBRARY_BUILD_TYPE "STATIC") - endif() - # turn off BUILD_SHARED_LIBS as OTB_LIBRARY_BUILD_TYPE - # is used on the libraries that have markup. - set(BUILD_SHARED_LIBS OFF) - endif() - endif() + # CMake adds --enable-all-exports on Cygwin (since Cygwin is + # supposed to be UNIX-like), but we need to add it explicitly for + # a native windows build with the MinGW tools. + if(WIN32 AND MINGW AND CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import") + set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS + "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import") + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import") + elseif(MSVC) + set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} /MANIFEST:NO") endif() + #----------------------------------------------------------------------------- #OTB requires special compiler flags on some platforms. if(CMAKE_COMPILER_IS_GNUCXX) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6dd29e868..fbff7cec37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,7 +220,7 @@ option(BUILD_SHARED_LIBS "Build OTB with shared libraries." ON) set(OTB_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) if(MSVC) - option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Build OTB with shared libraries." OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF CACHE INTERNAL "" ) set(OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ${CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS}) else() set(OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) -- GitLab From c4640e6f3ec6788c5675cb9a3e899971562d0a45 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Fri, 12 Oct 2018 17:46:32 +0200 Subject: [PATCH 37/63] COMP: fix class export to build with cmake 3.10 building OTB with cmake 3.10 fails with "fatal error LNK1189: library limit of 65535 objects exceeded" This is due to export of all symbols using CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS enabled globally. It was easy to use this feature from cmake to avoid adding export macro in lot of classes. This commit fixes issue https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues/1732 and allows to build otb without using WINDOWS_EXPORT_ALL_SYMBOLS It add proper export macro to classes to build OTB. Still there are many other classes left out with old ITK_EXPORT. It can/should be addressed once this branch (itk5 support) is merged to develop. WINDOWS_EXPORT_ALL_SYMBOLS is used for otbsitffast and otb6S using "set_target_properties" --- .../Core/SpatialObjects/include/otbLineSpatialObjectList.h | 2 -- Modules/Feature/Edge/include/otbFillGapsFilter.h | 3 ++- Modules/Feature/Edge/otb-module.cmake | 1 + .../ImageManipulation/include/otbPrintableImageFilter.h | 2 +- .../include/otbStreamingShrinkImageFilter.h | 5 ++--- Modules/Filtering/ImageManipulation/otb-module.cmake | 1 + Modules/Filtering/MathParser/include/otbParser.h | 3 ++- Modules/Filtering/MathParser/otb-module.cmake | 1 + Modules/Filtering/MathParserX/include/otbParserX.h | 3 ++- Modules/Filtering/MathParserX/otb-module.cmake | 1 + Modules/Filtering/Polarimetry/include/otbPolarimetricData.h | 3 ++- Modules/Filtering/Polarimetry/otb-module.cmake | 1 + Modules/Filtering/Statistics/include/otbPatternSampler.h | 3 ++- Modules/Filtering/Statistics/include/otbPeriodicSampler.h | 3 ++- Modules/Filtering/Statistics/include/otbRandomSampler.h | 3 ++- Modules/Filtering/Statistics/include/otbSamplerBase.h | 3 ++- Modules/Filtering/Statistics/otb-module.cmake | 1 + Modules/Filtering/Wavelet/include/otbWaveletGenerator.h | 3 ++- Modules/Filtering/Wavelet/otb-module.cmake | 1 + .../Fusion/Fuzzy/include/otbFuzzyDescriptorsModelManager.h | 4 ++-- Modules/Fusion/Fuzzy/otb-module.cmake | 1 + Modules/IO/Carto/include/otbMapFileProductWriter.h | 3 ++- Modules/IO/Carto/include/otbOSMDataToVectorDataGenerator.h | 1 + .../include/otbExtendedFilenameToReaderOptions.h | 3 ++- .../include/otbExtendedFilenameToWriterOptions.h | 3 ++- Modules/IO/ExtendedFilename/otb-module.cmake | 1 + Modules/IO/IOBSQ/include/otbBSQImageIO.h | 4 ++-- Modules/IO/IOBSQ/include/otbBSQImageIOFactory.h | 4 ++-- Modules/IO/IOBSQ/otb-module.cmake | 1 + Modules/IO/IOLUM/include/otbLUMImageIO.h | 3 ++- Modules/IO/IOLUM/include/otbLUMImageIOFactory.h | 3 ++- Modules/IO/IOLUM/otb-module.cmake | 1 + Modules/IO/IOMSTAR/include/otbMSTARImageIO.h | 3 ++- Modules/IO/IOMSTAR/include/otbMSTARImageIOFactory.h | 3 ++- Modules/IO/IOMSTAR/otb-module.cmake | 1 + Modules/IO/IOONERA/include/otbONERAImageIO.h | 3 ++- Modules/IO/IOONERA/include/otbONERAImageIOFactory.h | 3 ++- Modules/IO/IOONERA/otb-module.cmake | 1 + Modules/IO/IORAD/include/otbRADImageIO.h | 3 ++- Modules/IO/IORAD/include/otbRADImageIOFactory.h | 3 ++- Modules/IO/IORAD/otb-module.cmake | 1 + Modules/IO/VectorDataIO/include/otbVectorDataFileReader.h | 3 ++- Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.h | 3 ++- Modules/IO/VectorDataIO/include/otbVectorDataIOFactory.h | 3 ++- Modules/IO/VectorDataIO/otb-module.cmake | 1 + Modules/ThirdParty/6S/src/CMakeLists.txt | 4 ++++ Modules/ThirdParty/ITK/include/itkImageRegionSplitter.h | 2 +- Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.h | 2 +- Modules/ThirdParty/SiftFast/src/CMakeLists.txt | 3 +++ 49 files changed, 80 insertions(+), 37 deletions(-) diff --git a/Modules/Core/SpatialObjects/include/otbLineSpatialObjectList.h b/Modules/Core/SpatialObjects/include/otbLineSpatialObjectList.h index e0e1e7790a..5b4216b6a8 100644 --- a/Modules/Core/SpatialObjects/include/otbLineSpatialObjectList.h +++ b/Modules/Core/SpatialObjects/include/otbLineSpatialObjectList.h @@ -34,10 +34,8 @@ namespace otb * * \ingroup OTBSpatialObjects */ - class ITK_EXPORT LineSpatialObjectList : public std::list::Pointer>, public itk::DataObject - { public: /** Standard class typedefs. */ diff --git a/Modules/Feature/Edge/include/otbFillGapsFilter.h b/Modules/Feature/Edge/include/otbFillGapsFilter.h index f9af00605d..d93ae1f2e7 100644 --- a/Modules/Feature/Edge/include/otbFillGapsFilter.h +++ b/Modules/Feature/Edge/include/otbFillGapsFilter.h @@ -24,6 +24,7 @@ #include "itkProcessObject.h" #include "otbLineSpatialObjectList.h" +#include "OTBEdgeExport.h" namespace otb { @@ -32,7 +33,7 @@ namespace otb * * \ingroup OTBEdge */ -class ITK_EXPORT FillGapsFilter : public itk::ProcessObject +class OTBEdge_EXPORT FillGapsFilter : public itk::ProcessObject { public: diff --git a/Modules/Feature/Edge/otb-module.cmake b/Modules/Feature/Edge/otb-module.cmake index 3760ff5d23..68a04bb377 100644 --- a/Modules/Feature/Edge/otb-module.cmake +++ b/Modules/Feature/Edge/otb-module.cmake @@ -23,6 +23,7 @@ extraction. users can find classes that implement tools such as Sobel Detector, Line Ratio Detector (SAR images), Hough Transform, and so on.") otb_module(OTBEdge +ENABLE_SHARED DEPENDS OTBCommon OTBConversion diff --git a/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.h index 30f85bb570..95772783b2 100644 --- a/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbPrintableImageFilter.h @@ -119,7 +119,7 @@ protected: **/ template > -class ITK_EXPORT PrintableImageFilter : +class PrintableImageFilter : public itk::ImageToImageFilter > { public: diff --git a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.h index 01710c3a0b..76189ac417 100644 --- a/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbStreamingShrinkImageFilter.h @@ -21,17 +21,16 @@ #ifndef otbStreamingShrinkImageFilter_h #define otbStreamingShrinkImageFilter_h - #include "otbPersistentImageFilter.h" #include "otbPersistentFilterStreamingDecorator.h" - +#include "OTBImageManipulationExport.h" #include "otbStreamingManager.h" #include "otbMacro.h" namespace otb { -class ITK_EXPORT StreamingShrinkImageRegionSplitter : public itk::ImageRegionSplitter<2> +class OTBImageManipulation_EXPORT StreamingShrinkImageRegionSplitter : public itk::ImageRegionSplitter<2> { public: /** Standard class typedefs. */ diff --git a/Modules/Filtering/ImageManipulation/otb-module.cmake b/Modules/Filtering/ImageManipulation/otb-module.cmake index 8d908064ec..577800116d 100644 --- a/Modules/Filtering/ImageManipulation/otb-module.cmake +++ b/Modules/Filtering/ImageManipulation/otb-module.cmake @@ -26,6 +26,7 @@ band, evaluating a ImageFunction onto a source image, generating an image from D data.") otb_module(OTBImageManipulation +ENABLE_SHARED DEPENDS OTBBoostAdapters OTBCommon diff --git a/Modules/Filtering/MathParser/include/otbParser.h b/Modules/Filtering/MathParser/include/otbParser.h index 96038c266c..aa03751f9d 100644 --- a/Modules/Filtering/MathParser/include/otbParser.h +++ b/Modules/Filtering/MathParser/include/otbParser.h @@ -25,6 +25,7 @@ #include "itkObjectFactory.h" #include "otb_muparser.h" +#include "OTBMathParserExport.h" namespace otb { @@ -41,7 +42,7 @@ class ParserImpl; * * \ingroup OTBMathParser */ -class ITK_EXPORT Parser : public itk::LightObject +class OTBMathParser_EXPORT Parser : public itk::LightObject { public: /** Standard class typedefs. */ diff --git a/Modules/Filtering/MathParser/otb-module.cmake b/Modules/Filtering/MathParser/otb-module.cmake index bc4f899c0e..b1acb5cc31 100644 --- a/Modules/Filtering/MathParser/otb-module.cmake +++ b/Modules/Filtering/MathParser/otb-module.cmake @@ -23,6 +23,7 @@ expression to the pixels of an image. Note that classes based on MuParserX have better capabilities than the ones based on MuParser.") otb_module(OTBMathParser +ENABLE_SHARED DEPENDS OTBCommon OTBITK diff --git a/Modules/Filtering/MathParserX/include/otbParserX.h b/Modules/Filtering/MathParserX/include/otbParserX.h index 8530f76b8c..d47730be47 100644 --- a/Modules/Filtering/MathParserX/include/otbParserX.h +++ b/Modules/Filtering/MathParserX/include/otbParserX.h @@ -40,6 +40,7 @@ #else #include "mpParser.h" #endif +#include "OTBMathParserXExport.h" namespace otb { @@ -56,7 +57,7 @@ class ParserXImpl; * * \ingroup OTBMathParserX */ -class ITK_EXPORT ParserX : public itk::LightObject +class OTBMathParserX_EXPORT ParserX : public itk::LightObject { public: /** Standard class typedefs. */ diff --git a/Modules/Filtering/MathParserX/otb-module.cmake b/Modules/Filtering/MathParserX/otb-module.cmake index 4a601e111e..a49a286264 100644 --- a/Modules/Filtering/MathParserX/otb-module.cmake +++ b/Modules/Filtering/MathParserX/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "TODO") otb_module(OTBMathParserX +ENABLE_SHARED DEPENDS OTBCommon OTBITK diff --git a/Modules/Filtering/Polarimetry/include/otbPolarimetricData.h b/Modules/Filtering/Polarimetry/include/otbPolarimetricData.h index 549375d5cd..d93b00964a 100644 --- a/Modules/Filtering/Polarimetry/include/otbPolarimetricData.h +++ b/Modules/Filtering/Polarimetry/include/otbPolarimetricData.h @@ -23,6 +23,7 @@ #include "itkDataObject.h" #include "itkObjectFactory.h" +#include "OTBPolarimetryExport.h" namespace otb { @@ -51,7 +52,7 @@ typedef enum * \ingroup OTBPolarimetry */ -class ITK_EXPORT PolarimetricData : public itk::DataObject +class OTBPolarimetry_EXPORT PolarimetricData : public itk::DataObject { public: diff --git a/Modules/Filtering/Polarimetry/otb-module.cmake b/Modules/Filtering/Polarimetry/otb-module.cmake index 036edbb60f..6d67952659 100644 --- a/Modules/Filtering/Polarimetry/otb-module.cmake +++ b/Modules/Filtering/Polarimetry/otb-module.cmake @@ -26,6 +26,7 @@ representations of a polarisation state, to perform polarimetry synthesis, and s on.") otb_module(OTBPolarimetry +ENABLE_SHARED DEPENDS OTBCommon OTBITK diff --git a/Modules/Filtering/Statistics/include/otbPatternSampler.h b/Modules/Filtering/Statistics/include/otbPatternSampler.h index 45daa2f509..ab847cee59 100644 --- a/Modules/Filtering/Statistics/include/otbPatternSampler.h +++ b/Modules/Filtering/Statistics/include/otbPatternSampler.h @@ -22,6 +22,7 @@ #define otbPatternSampler_h #include "otbSamplerBase.h" +#include "OTBStatisticsExport.h" #include namespace otb @@ -36,7 +37,7 @@ namespace otb * * \ingroup OTBStatistics */ -class ITK_EXPORT PatternSampler : public SamplerBase +class OTBStatistics_EXPORT PatternSampler : public SamplerBase { public: typedef PatternSampler Self; diff --git a/Modules/Filtering/Statistics/include/otbPeriodicSampler.h b/Modules/Filtering/Statistics/include/otbPeriodicSampler.h index f70a019f2f..79a2e6b2cd 100644 --- a/Modules/Filtering/Statistics/include/otbPeriodicSampler.h +++ b/Modules/Filtering/Statistics/include/otbPeriodicSampler.h @@ -22,6 +22,7 @@ #define otbPeriodicSampler_h #include "otbSamplerBase.h" +#include "OTBStatisticsExport.h" namespace otb { @@ -35,7 +36,7 @@ namespace otb * * \ingroup OTBStatistics */ -class ITK_EXPORT PeriodicSampler : public SamplerBase +class OTBStatistics_EXPORT PeriodicSampler : public SamplerBase { public: typedef PeriodicSampler Self; diff --git a/Modules/Filtering/Statistics/include/otbRandomSampler.h b/Modules/Filtering/Statistics/include/otbRandomSampler.h index 6d0a8411a3..1355b80f42 100644 --- a/Modules/Filtering/Statistics/include/otbRandomSampler.h +++ b/Modules/Filtering/Statistics/include/otbRandomSampler.h @@ -22,6 +22,7 @@ #define otbRandomSampler_h #include "otbSamplerBase.h" +#include "OTBStatisticsExport.h" namespace otb { @@ -36,7 +37,7 @@ namespace otb * * \ingroup OTBStatistics */ -class ITK_EXPORT RandomSampler : public SamplerBase +class OTBStatistics_EXPORT RandomSampler : public SamplerBase { public: typedef RandomSampler Self; diff --git a/Modules/Filtering/Statistics/include/otbSamplerBase.h b/Modules/Filtering/Statistics/include/otbSamplerBase.h index 1dc0f328da..2bdd0fa6e5 100644 --- a/Modules/Filtering/Statistics/include/otbSamplerBase.h +++ b/Modules/Filtering/Statistics/include/otbSamplerBase.h @@ -23,6 +23,7 @@ #include "itkObject.h" #include "itkObjectFactory.h" +#include "OTBStatisticsExport.h" namespace otb { @@ -34,7 +35,7 @@ namespace otb * * \ingroup OTBStatistics */ -class ITK_EXPORT SamplerBase : public itk::Object +class OTBStatistics_EXPORT SamplerBase : public itk::Object { public: typedef SamplerBase Self; diff --git a/Modules/Filtering/Statistics/otb-module.cmake b/Modules/Filtering/Statistics/otb-module.cmake index 855eb0b37d..934b57c10b 100644 --- a/Modules/Filtering/Statistics/otb-module.cmake +++ b/Modules/Filtering/Statistics/otb-module.cmake @@ -26,6 +26,7 @@ of the input sample list, and so on. The other part works on images and labelMap and allows the calculation of classical statistics (min max mean histogram).") otb_module(OTBStatistics +ENABLE_SHARED DEPENDS OTBCommon OTBITK diff --git a/Modules/Filtering/Wavelet/include/otbWaveletGenerator.h b/Modules/Filtering/Wavelet/include/otbWaveletGenerator.h index 1c4e492afb..2528f5656e 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletGenerator.h +++ b/Modules/Filtering/Wavelet/include/otbWaveletGenerator.h @@ -26,6 +26,7 @@ #include #include "itkLightObject.h" #include "itkObjectFactory.h" +#include "OTBWaveletExport.h" namespace otb { @@ -61,7 +62,7 @@ enum Wavelet { * \ingroup OTBWavelet */ template -class ITK_EXPORT WaveletGenerator +class OTBWavelet_EXPORT WaveletGenerator : public itk::LightObject { public: diff --git a/Modules/Filtering/Wavelet/otb-module.cmake b/Modules/Filtering/Wavelet/otb-module.cmake index 405672597a..6e881c5df5 100644 --- a/Modules/Filtering/Wavelet/otb-module.cmake +++ b/Modules/Filtering/Wavelet/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "This module contains classes for wavelet analysis.") otb_module(OTBWavelet +ENABLE_SHARED DEPENDS OTBCommon OTBITK diff --git a/Modules/Fusion/Fuzzy/include/otbFuzzyDescriptorsModelManager.h b/Modules/Fusion/Fuzzy/include/otbFuzzyDescriptorsModelManager.h index d4eac61f52..a6746eecb0 100644 --- a/Modules/Fusion/Fuzzy/include/otbFuzzyDescriptorsModelManager.h +++ b/Modules/Fusion/Fuzzy/include/otbFuzzyDescriptorsModelManager.h @@ -24,7 +24,7 @@ #include #include #include - +#include "OTBFuzzyExport.h" namespace otb { @@ -39,7 +39,7 @@ namespace otb { * * \ingroup OTBFuzzy */ - class FuzzyDescriptorsModelManager +class OTBFuzzy_EXPORT FuzzyDescriptorsModelManager { public: /** Standard class typedefs */ diff --git a/Modules/Fusion/Fuzzy/otb-module.cmake b/Modules/Fusion/Fuzzy/otb-module.cmake index b0db872c24..7358164bfc 100644 --- a/Modules/Fusion/Fuzzy/otb-module.cmake +++ b/Modules/Fusion/Fuzzy/otb-module.cmake @@ -25,6 +25,7 @@ membership value for each one of the qualitative values. it also contains classe to handle xml files where are stored several statistics.") otb_module(OTBFuzzy +ENABLE_SHARED DEPENDS OTBCommon OTBTinyXML diff --git a/Modules/IO/Carto/include/otbMapFileProductWriter.h b/Modules/IO/Carto/include/otbMapFileProductWriter.h index 1c1dcb589f..1b95bf2cb9 100644 --- a/Modules/IO/Carto/include/otbMapFileProductWriter.h +++ b/Modules/IO/Carto/include/otbMapFileProductWriter.h @@ -36,6 +36,7 @@ // projection filter #include "otbGenericRSResampleImageFilter.h" +#include "OTBCartoExport.h" #include namespace otb @@ -67,7 +68,7 @@ namespace otb * \ingroup OTBCarto */ template -class ITK_EXPORT MapFileProductWriter : public itk::ProcessObject +class ITK_TEMPLATE_EXPORT MapFileProductWriter : public itk::ProcessObject { public: /** Standard class typedefs. */ diff --git a/Modules/IO/Carto/include/otbOSMDataToVectorDataGenerator.h b/Modules/IO/Carto/include/otbOSMDataToVectorDataGenerator.h index 8f5ebf8eb0..5c9927b61a 100644 --- a/Modules/IO/Carto/include/otbOSMDataToVectorDataGenerator.h +++ b/Modules/IO/Carto/include/otbOSMDataToVectorDataGenerator.h @@ -27,6 +27,7 @@ #include #include "OTBCartoExport.h" +#include "itkMacro.h" #include "otbVectorData.h" #include "otbVectorDataSource.h" diff --git a/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h b/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h index 69ca6e1a40..78992db806 100644 --- a/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h +++ b/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToReaderOptions.h @@ -22,6 +22,7 @@ #define otbExtendedFilenameToReaderOptions_h #include "otbExtendedFilenameHelper.h" +#include "OTBExtendedFilenameExport.h" #include namespace otb @@ -49,7 +50,7 @@ namespace otb * \ingroup OTBExtendedFilename */ -class ITK_EXPORT ExtendedFilenameToReaderOptions : public ExtendedFilenameHelper +class OTBExtendedFilename_EXPORT ExtendedFilenameToReaderOptions : public ExtendedFilenameHelper { public: /** Standard class typedefs. */ diff --git a/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h b/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h index 8cde667b00..526a5d18b5 100644 --- a/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h +++ b/Modules/IO/ExtendedFilename/include/otbExtendedFilenameToWriterOptions.h @@ -23,6 +23,7 @@ #define otbExtendedFilenameToWriterOptions_h #include "otbExtendedFilenameHelper.h" +#include "OTBExtendedFilenameExport.h" #include "otbGDALImageIO.h" #include @@ -44,7 +45,7 @@ namespace otb * \ingroup OTBExtendedFilename */ -class ITK_EXPORT ExtendedFilenameToWriterOptions : public ExtendedFilenameHelper +class OTBExtendedFilename_EXPORT ExtendedFilenameToWriterOptions : public ExtendedFilenameHelper { public: /** Standard class typedefs. */ diff --git a/Modules/IO/ExtendedFilename/otb-module.cmake b/Modules/IO/ExtendedFilename/otb-module.cmake index fccc8bd7fc..dc5b7c995f 100644 --- a/Modules/IO/ExtendedFilename/otb-module.cmake +++ b/Modules/IO/ExtendedFilename/otb-module.cmake @@ -25,6 +25,7 @@ different subdataset or resolution (for multi-resolution data), or manage ortho- product by skipping either geographic or sensor-model information.") otb_module(OTBExtendedFilename +ENABLE_SHARED DEPENDS OTBCommon OTBIOGDAL diff --git a/Modules/IO/IOBSQ/include/otbBSQImageIO.h b/Modules/IO/IOBSQ/include/otbBSQImageIO.h index 79666fbd21..20cd736c09 100644 --- a/Modules/IO/IOBSQ/include/otbBSQImageIO.h +++ b/Modules/IO/IOBSQ/include/otbBSQImageIO.h @@ -26,7 +26,7 @@ #include #include "otbImageIOBase.h" - +#include "OTBIOBSQExport.h" namespace otb { @@ -41,7 +41,7 @@ namespace otb * * \ingroup OTBIOBSQ */ -class ITK_EXPORT BSQImageIO : public otb::ImageIOBase +class OTBIOBSQ_EXPORT BSQImageIO : public otb::ImageIOBase { public: diff --git a/Modules/IO/IOBSQ/include/otbBSQImageIOFactory.h b/Modules/IO/IOBSQ/include/otbBSQImageIOFactory.h index ab557795c2..73eb5cb31e 100644 --- a/Modules/IO/IOBSQ/include/otbBSQImageIOFactory.h +++ b/Modules/IO/IOBSQ/include/otbBSQImageIOFactory.h @@ -22,7 +22,7 @@ #define otbBSQImageIOFactory_h #include "itkObjectFactoryBase.h" - +#include "OTBIOBSQExport.h" namespace otb { /** \class BSQImageIOFactory @@ -30,7 +30,7 @@ namespace otb * * \ingroup OTBIOBSQ */ -class ITK_EXPORT BSQImageIOFactory : public itk::ObjectFactoryBase +class OTBIOBSQ_EXPORT BSQImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IOBSQ/otb-module.cmake b/Modules/IO/IOBSQ/otb-module.cmake index 6dc9fb8416..7c59e5019c 100644 --- a/Modules/IO/IOBSQ/otb-module.cmake +++ b/Modules/IO/IOBSQ/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "This module contains features to read BSQ format images.") otb_module(OTBIOBSQ +ENABLE_SHARED DEPENDS OTBImageBase OTBCommon diff --git a/Modules/IO/IOLUM/include/otbLUMImageIO.h b/Modules/IO/IOLUM/include/otbLUMImageIO.h index 8d5dc2520e..18a049ba14 100644 --- a/Modules/IO/IOLUM/include/otbLUMImageIO.h +++ b/Modules/IO/IOLUM/include/otbLUMImageIO.h @@ -22,6 +22,7 @@ #define otbLUMImageIO_h #include "otbImageIOBase.h" +#include "OTBIOLUMExport.h" #include #include #include @@ -40,7 +41,7 @@ namespace otb * * \ingroup OTBIOLUM */ -class ITK_EXPORT LUMImageIO : public otb::ImageIOBase +class OTBIOLUM_EXPORT LUMImageIO : public otb::ImageIOBase { public: diff --git a/Modules/IO/IOLUM/include/otbLUMImageIOFactory.h b/Modules/IO/IOLUM/include/otbLUMImageIOFactory.h index a1da92d76e..dcc84a750d 100644 --- a/Modules/IO/IOLUM/include/otbLUMImageIOFactory.h +++ b/Modules/IO/IOLUM/include/otbLUMImageIOFactory.h @@ -22,6 +22,7 @@ #define otbLUMImageIOFactory_h #include "itkObjectFactoryBase.h" +#include "OTBIOLUMExport.h" namespace otb { @@ -30,7 +31,7 @@ namespace otb * * \ingroup OTBIOLUM */ -class ITK_EXPORT LUMImageIOFactory : public itk::ObjectFactoryBase +class OTBIOLUM_EXPORT LUMImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IOLUM/otb-module.cmake b/Modules/IO/IOLUM/otb-module.cmake index 586aa8b7c9..2c0e2ea360 100644 --- a/Modules/IO/IOLUM/otb-module.cmake +++ b/Modules/IO/IOLUM/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "This module contains features to read LUM format images.") otb_module(OTBIOLUM +ENABLE_SHARED DEPENDS OTBImageBase OTBCommon diff --git a/Modules/IO/IOMSTAR/include/otbMSTARImageIO.h b/Modules/IO/IOMSTAR/include/otbMSTARImageIO.h index 90170376da..5da108239f 100644 --- a/Modules/IO/IOMSTAR/include/otbMSTARImageIO.h +++ b/Modules/IO/IOMSTAR/include/otbMSTARImageIO.h @@ -22,6 +22,7 @@ #define otbMSTARImageIO_h #include "otbImageIOBase.h" +#include "OTBIOMSTARExport.h" namespace otb { @@ -37,7 +38,7 @@ namespace otb * * \ingroup OTBIOMSTAR */ -class ITK_EXPORT MSTARImageIO : public otb::ImageIOBase +class OTBIOMSTAR_EXPORT MSTARImageIO : public otb::ImageIOBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IOMSTAR/include/otbMSTARImageIOFactory.h b/Modules/IO/IOMSTAR/include/otbMSTARImageIOFactory.h index 7c46acab0c..49d5f03436 100644 --- a/Modules/IO/IOMSTAR/include/otbMSTARImageIOFactory.h +++ b/Modules/IO/IOMSTAR/include/otbMSTARImageIOFactory.h @@ -22,6 +22,7 @@ #define otbMSTARImageIOFactory_h #include "itkObjectFactoryBase.h" +#include "OTBIOMSTARExport.h" namespace otb { @@ -30,7 +31,7 @@ namespace otb * * \ingroup OTBIOMSTAR */ -class ITK_EXPORT MSTARImageIOFactory : public itk::ObjectFactoryBase +class OTBIOMSTAR_EXPORT MSTARImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IOMSTAR/otb-module.cmake b/Modules/IO/IOMSTAR/otb-module.cmake index d6a17f8466..c81795392f 100644 --- a/Modules/IO/IOMSTAR/otb-module.cmake +++ b/Modules/IO/IOMSTAR/otb-module.cmake @@ -22,6 +22,7 @@ set(DOCUMENTATION "This module contains features to read and write MSTAR format images.") otb_module(OTBIOMSTAR +ENABLE_SHARED DEPENDS OTBImageBase OTBCommon diff --git a/Modules/IO/IOONERA/include/otbONERAImageIO.h b/Modules/IO/IOONERA/include/otbONERAImageIO.h index 2634daeb92..e92b4a8dda 100644 --- a/Modules/IO/IOONERA/include/otbONERAImageIO.h +++ b/Modules/IO/IOONERA/include/otbONERAImageIO.h @@ -23,6 +23,7 @@ #include "itkByteSwapper.h" #include "otbImageIOBase.h" +#include "OTBIOONERAExport.h" #include namespace otb @@ -39,7 +40,7 @@ namespace otb * * \ingroup OTBIOONERA */ -class ITK_EXPORT ONERAImageIO : public otb::ImageIOBase +class OTBIOONERA_EXPORT ONERAImageIO : public otb::ImageIOBase { public: diff --git a/Modules/IO/IOONERA/include/otbONERAImageIOFactory.h b/Modules/IO/IOONERA/include/otbONERAImageIOFactory.h index 1c9efec2d5..e54a1e1897 100644 --- a/Modules/IO/IOONERA/include/otbONERAImageIOFactory.h +++ b/Modules/IO/IOONERA/include/otbONERAImageIOFactory.h @@ -22,6 +22,7 @@ #define otbONERAImageIOFactory_h #include "itkObjectFactoryBase.h" +#include "OTBIOONERAExport.h" namespace otb { @@ -30,7 +31,7 @@ namespace otb * * \ingroup OTBIOONERA */ -class ITK_EXPORT ONERAImageIOFactory : public itk::ObjectFactoryBase +class OTBIOONERA_EXPORT ONERAImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IOONERA/otb-module.cmake b/Modules/IO/IOONERA/otb-module.cmake index cc431e1ad5..824e70399a 100644 --- a/Modules/IO/IOONERA/otb-module.cmake +++ b/Modules/IO/IOONERA/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "This module contains features to read ONERA format images.") otb_module(OTBIOONERA +ENABLE_SHARED DEPENDS OTBImageBase OTBCommon diff --git a/Modules/IO/IORAD/include/otbRADImageIO.h b/Modules/IO/IORAD/include/otbRADImageIO.h index 4ae50d1a9e..a21d169ecd 100644 --- a/Modules/IO/IORAD/include/otbRADImageIO.h +++ b/Modules/IO/IORAD/include/otbRADImageIO.h @@ -22,6 +22,7 @@ #define otbRADImageIO_h #include "otbImageIOBase.h" +#include "OTBIORADExport.h" #include #include #include @@ -40,7 +41,7 @@ namespace otb * * \ingroup OTBIORAD */ -class ITK_EXPORT RADImageIO : public otb::ImageIOBase +class OTBIORAD_EXPORT RADImageIO : public otb::ImageIOBase { public: diff --git a/Modules/IO/IORAD/include/otbRADImageIOFactory.h b/Modules/IO/IORAD/include/otbRADImageIOFactory.h index c76a91cefa..f0dc9d90fc 100644 --- a/Modules/IO/IORAD/include/otbRADImageIOFactory.h +++ b/Modules/IO/IORAD/include/otbRADImageIOFactory.h @@ -21,6 +21,7 @@ #ifndef otbRADImageIOFactory_h #define otbRADImageIOFactory_h +#include "OTBIORADExport.h" #include "itkObjectFactoryBase.h" namespace otb @@ -30,7 +31,7 @@ namespace otb * * \ingroup OTBIORAD */ -class ITK_EXPORT RADImageIOFactory : public itk::ObjectFactoryBase +class OTBIORAD_EXPORT RADImageIOFactory : public itk::ObjectFactoryBase { public: /** Standard class typedefs. */ diff --git a/Modules/IO/IORAD/otb-module.cmake b/Modules/IO/IORAD/otb-module.cmake index f5720e90a4..4fb3087c6e 100644 --- a/Modules/IO/IORAD/otb-module.cmake +++ b/Modules/IO/IORAD/otb-module.cmake @@ -21,6 +21,7 @@ set(DOCUMENTATION "This module contains features to read RAD format images.") otb_module(OTBIORAD +ENABLE_SHARED DEPENDS OTBImageBase OTBCommon diff --git a/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.h b/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.h index 200e7c98ae..f82f234b81 100644 --- a/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.h +++ b/Modules/IO/VectorDataIO/include/otbVectorDataFileReader.h @@ -23,6 +23,7 @@ #include "otbVectorDataSource.h" #include "otbVectorDataIOBase.h" +#include "OTBVectorDataIOExport.h" #include namespace otb @@ -90,7 +91,7 @@ public: */ template -class ITK_EXPORT VectorDataFileReader : public VectorDataSource +class ITK_TEMPLATE_EXPORT VectorDataFileReader : public VectorDataSource { public: diff --git a/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.h b/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.h index 9abdfb06fa..0252a3d8c8 100644 --- a/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.h +++ b/Modules/IO/VectorDataIO/include/otbVectorDataFileWriter.h @@ -23,6 +23,7 @@ #include "itkProcessObject.h" #include "itkMacro.h" +#include "OTBVectorDataIOExport.h" #include "otbVectorDataIOBase.h" #include @@ -66,7 +67,7 @@ public: */ template -class ITK_EXPORT VectorDataFileWriter : public itk::ProcessObject +class ITK_TEMPLATE_EXPORT VectorDataFileWriter : public itk::ProcessObject { public: diff --git a/Modules/IO/VectorDataIO/include/otbVectorDataIOFactory.h b/Modules/IO/VectorDataIO/include/otbVectorDataIOFactory.h index a54a7fd40e..a9e89bd800 100644 --- a/Modules/IO/VectorDataIO/include/otbVectorDataIOFactory.h +++ b/Modules/IO/VectorDataIO/include/otbVectorDataIOFactory.h @@ -23,6 +23,7 @@ #include "itkObject.h" #include "otbVectorDataIOBase.h" +#include "OTBVectorDataIOExport.h" namespace otb { @@ -31,7 +32,7 @@ namespace otb * * \ingroup OTBVectorDataIO */ -class ITK_EXPORT VectorDataIOFactory : public itk::Object +class OTBVectorDataIO_EXPORT VectorDataIOFactory : public itk::Object { public: /** Standard class typedefs. */ diff --git a/Modules/IO/VectorDataIO/otb-module.cmake b/Modules/IO/VectorDataIO/otb-module.cmake index dd63bb53b2..9ce1d9fd02 100644 --- a/Modules/IO/VectorDataIO/otb-module.cmake +++ b/Modules/IO/VectorDataIO/otb-module.cmake @@ -23,6 +23,7 @@ writing of vector data (see also VectorDataBase and VectorDataManipulation modules).") otb_module(OTBVectorDataIO +ENABLE_SHARED DEPENDS OTBVectorDataBase OTBIOGDAL diff --git a/Modules/ThirdParty/6S/src/CMakeLists.txt b/Modules/ThirdParty/6S/src/CMakeLists.txt index 2898cca97f..eddfba640e 100644 --- a/Modules/ThirdParty/6S/src/CMakeLists.txt +++ b/Modules/ThirdParty/6S/src/CMakeLists.txt @@ -93,6 +93,10 @@ if(OTB_LIBRARY_PROPERTIES) set_target_properties(otb6S PROPERTIES ${OTB_LIBRARY_PROPERTIES}) endif() +if(MSVC) + set_target_properties(otb6S PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +endif() + # Below "extra" compile flags are needed for proper functioning of 6S # library. Without these flags especially /Oy- OpticalCalibration tests # are failing. the flags are automatially added by VS generator. diff --git a/Modules/ThirdParty/ITK/include/itkImageRegionSplitter.h b/Modules/ThirdParty/ITK/include/itkImageRegionSplitter.h index 8b0b7632d4..6c84c58561 100644 --- a/Modules/ThirdParty/ITK/include/itkImageRegionSplitter.h +++ b/Modules/ThirdParty/ITK/include/itkImageRegionSplitter.h @@ -71,7 +71,7 @@ namespace itk */ template< unsigned int VImageDimension > -class ITK_EXPORT ImageRegionSplitter:public ImageRegionSplitterBase +class ITK_ABI_EXPORT ImageRegionSplitter : public ImageRegionSplitterBase { public: /** Standard class typedefs. */ diff --git a/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.h b/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.h index 694cb0297b..08fbf260d4 100644 --- a/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.h +++ b/Modules/ThirdParty/ITK/include/itkUnaryFunctorImageFilter.h @@ -50,7 +50,7 @@ namespace itk * \ingroup OTBITK */ template< class TInputImage, class TOutputImage, class TFunction > -class ITK_EXPORT UnaryFunctorImageFilter:public InPlaceImageFilter< TInputImage, TOutputImage > +class ITK_TEMPLATE_EXPORT UnaryFunctorImageFilter:public InPlaceImageFilter< TInputImage, TOutputImage > { public: /** Standard class typedefs. */ diff --git a/Modules/ThirdParty/SiftFast/src/CMakeLists.txt b/Modules/ThirdParty/SiftFast/src/CMakeLists.txt index 0718ae262b..809bed1be2 100644 --- a/Modules/ThirdParty/SiftFast/src/CMakeLists.txt +++ b/Modules/ThirdParty/SiftFast/src/CMakeLists.txt @@ -106,6 +106,9 @@ if(OTB_LIBRARY_PROPERTIES) set_target_properties(otbsiftfast PROPERTIES ${OTB_LIBRARY_PROPERTIES}) endif() +if(MSVC) + set_target_properties(otbsiftfast PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +endif() install(TARGETS otbsiftfast EXPORT ${OTB3P_INSTALL_EXPORT_NAME} RUNTIME DESTINATION ${OTB3P_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries -- GitLab From 8f9132835ae29d9c971c2ed41b656ffb1f6b4628 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Mon, 15 Oct 2018 16:58:10 +0200 Subject: [PATCH 38/63] COMP: swig < 3.0.12 fails to generate python bindings upgrade of cmake is due to changes in ITK5 https://dash.orfeo-toolbox.org/viewTest.php?onlyfailed&buildid=337912 https://dash.orfeo-toolbox.org/viewTest.php?onlyfailed&buildid=337993 --- Modules/Wrappers/SWIG/otb-module-init.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Wrappers/SWIG/otb-module-init.cmake b/Modules/Wrappers/SWIG/otb-module-init.cmake index dd7d1cca2a..4307803789 100644 --- a/Modules/Wrappers/SWIG/otb-module-init.cmake +++ b/Modules/Wrappers/SWIG/otb-module-init.cmake @@ -21,7 +21,7 @@ option ( OTB_WRAP_PYTHON "Wrap Python" OFF ) if ( OTB_WRAP_PYTHON ) - find_package ( SWIG 3.0.10 REQUIRED ) + find_package ( SWIG 3.0.12 REQUIRED ) mark_as_advanced(SWIG_DIR) mark_as_advanced(SWIG_EXECUTABLE) mark_as_advanced(SWIG_VERSION) -- GitLab From 0a0f382ea7f148166af618d1b9c0b3e5a5fdff91 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath Date: Mon, 15 Oct 2018 16:59:40 +0200 Subject: [PATCH 39/63] COMP: upgrade cmake min version to 3.10.2 ITK5 had upgraded cmake version to 3.10.2. Due to upgrade of ITK5 in superbuild, OTB must update its cmake minimum verison to 3.10.2 People who compile from source can use cmake 3.1 to build OTB. But when they have to use ITK5 with or without superbuild cmake must be upgraded. Simply changing cmake version in ITK/CMakeLists.txt does not work as there is VNL/vxl/CMakeLists.txt that uses cmake 3.9.0 So there is no easy get away from this "unpleasant" cmake upgrade. --- SuperBuild/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 4cb4ead350..5a36af21a8 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -18,7 +18,7 @@ # limitations under the License. # -cmake_minimum_required(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) project(OTB-SuperBuild) -- GitLab From 55766cdab74529538fdf9f2bca7ab0dd5546054a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:16:06 +0200 Subject: [PATCH 40/63] COMP: compatibility with SplitString return type (std::string/sys.String) --- .../app/otbMultiImageSamplingRate.cxx | 6 +- .../app/otbTrainRegression.cxx | 2 +- Modules/IO/IOGDAL/src/otbGDALImageIO.cxx | 3 +- .../src/otbWrapperApplicationRegistry.cxx | 117 +++++++++++------- .../src/otbWrapperCommandLineLauncher.cxx | 2 +- .../src/otbWrapperCommandLineParser.cxx | 7 +- 6 files changed, 78 insertions(+), 59 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx index eecf74ed45..1e0ef35c2a 100644 --- a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx +++ b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx @@ -238,7 +238,7 @@ private: // constant case 1: { - std::vector parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.constant.nb"),' '); + auto parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.constant.nb"),' '); std::vector countList; for (unsigned int i=0 ; i parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.percent.p"),' '); + auto parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.percent.p"),' '); std::vector percentList; for (unsigned int i=0 ; i parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.total.v"),' '); + auto parts = itksys::SystemTools::SplitString(this->GetParameterString("strategy.total.v"),' '); std::vector totalList; for (unsigned int i=0 ; i words = itksys::SystemTools::SplitString(line,sep); + auto words = itksys::SystemTools::SplitString(line,sep); if (nbCols == 0) { // detect separator and feature size diff --git a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx index 527091e25b..7bd1b608b0 100644 --- a/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx @@ -1703,8 +1703,7 @@ bool GDALImageIO::GetOriginFromGMLBox(std::vector &origin) return false; } - std::vector originValues; - originValues = itksys::SystemTools::SplitString(originTag->GetText(),' ', false); + auto originValues = itksys::SystemTools::SplitString(originTag->GetText(),' ', false); // Compute origin in GDAL convention (the half-pixel shift is applied later) std::istringstream ss0 (originValues[0]); diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx index ebf41589f6..819377047b 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx @@ -24,8 +24,13 @@ #include "itksys/SystemTools.hxx" #include "itkDynamicLoader.h" #include "itkDirectory.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" #include "itkMutexLockHolder.h" +#else +#include +#endif #include @@ -50,7 +55,11 @@ public: if (app && handle) { // mutex lock to ensure thread safety + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(m_Mutex); + #else + std::lock_guard mutexHolder(m_Mutex); + #endif pair.first = app; pair.second = handle; m_Container.push_back(pair); @@ -65,7 +74,11 @@ public: if (app) { // mutex lock to ensure thread safety + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(m_Mutex); + #else + std::lock_guard mutexHolder(m_Mutex); + #endif AppHandleContainerType::iterator it = m_Container.begin(); while (it != m_Container.end()) { @@ -81,7 +94,11 @@ public: /** Release the library handles from applications already deleted */ void ReleaseUnusedHandle() { + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(m_Mutex); + #else + std::lock_guard mutexHolder(m_Mutex); + #endif AppHandleContainerType::iterator it; for (it = m_Container.begin() ; it != m_Container.end() ; ++it) { @@ -111,8 +128,12 @@ public: private: AppHandleContainerType m_Container; - - itk::SimpleMutexLock m_Mutex; + + #if ITK_VERSION_MAJOR < 5 + static itk::SimpleMutexLock m_Mutex; + #else + std::mutex m_Mutex; + #endif }; // static finalizer to close opened libraries static ApplicationPrivateRegistry m_ApplicationPrivateRegistryGlobal; @@ -244,27 +265,27 @@ ApplicationRegistry::CreateApplicationFaster(const std::string& name) #endif std::string otbAppPath = GetApplicationPath(); - std::vector pathList; + if (!otbAppPath.empty()) { - pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); - } - for (unsigned int i=0 ; i pathList; + if (!otbAppPath.empty()) { - pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); - } - for (unsigned int k=0 ; kLoad(pathList[k].c_str())) - { - continue; - } - for (unsigned int i = 0; i < dir->GetNumberOfFiles(); i++) + auto pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); + + for (unsigned int k=0 ; kGetFile(i); - std::string sfilename(filename); - std::string::size_type extPos = sfilename.rfind(appExtension); - std::string::size_type prefixPos = sfilename.find(appPrefix); - - // Check if current file is a shared lib with the right pattern - if (extPos + appExtension.size() == sfilename.size() && - prefixPos == 0) + itk::Directory::Pointer dir = itk::Directory::New(); + if (!dir->Load(pathList[k].c_str())) { - std::string name = sfilename.substr(appPrefix.size(),extPos-appPrefix.size()); - std::string fullpath = pathList[k]; - if (!fullpath.empty() && fullpath[fullpath.size() - 1] != sep) - { - fullpath.push_back(sep); - } - fullpath.append(sfilename); - appli = LoadApplicationFromPath(fullpath,name); - if (appli.IsNotNull()) + continue; + } + for (unsigned int i = 0; i < dir->GetNumberOfFiles(); i++) + { + const char *filename = dir->GetFile(i); + std::string sfilename(filename); + std::string::size_type extPos = sfilename.rfind(appExtension); + std::string::size_type prefixPos = sfilename.find(appPrefix); + + // Check if current file is a shared lib with the right pattern + if (extPos + appExtension.size() == sfilename.size() && + prefixPos == 0) { - appSet.insert(name); + std::string name = sfilename.substr(appPrefix.size(),extPos-appPrefix.size()); + std::string fullpath = pathList[k]; + if (!fullpath.empty() && fullpath[fullpath.size() - 1] != sep) + { + fullpath.push_back(sep); + } + fullpath.append(sfilename); + appli = LoadApplicationFromPath(fullpath,name); + if (appli.IsNotNull()) + { + appSet.insert(name); + } + appli = nullptr; } - appli = nullptr; } } } - if (useFactory) { std::list allobjects = itk::ObjectFactoryBase::CreateAllInstance("otbWrapperApplication"); diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index 728d349b0c..976e766382 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -497,7 +497,7 @@ bool CommandLineLauncher::CheckOutputPathsValidity(const std::string & paramKey) type == ParameterType_OutputFilename) { std::string filename = m_Application->GetParameterString(paramKey); - itksys::String path = itksys::SystemTools::GetFilenamePath(filename); + auto path = itksys::SystemTools::GetFilenamePath(filename); if (path!="" && !itksys::SystemTools::FileIsDirectory(path)) { std::cerr <<"ERROR: Directory doesn't exist : "<< path << std::endl; diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineParser.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineParser.cxx index 4626907639..56529cdc60 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineParser.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineParser.cxx @@ -153,8 +153,7 @@ CommandLineParser::GetPaths( std::vector & paths, const std::string if( tempModPath.size() > 0 ) { - std::vector pathAttribut = itksys::SystemTools::SplitString(tempModPath, ' ', false); - + auto pathAttribut = itksys::SystemTools::SplitString(tempModPath, ' ', false); // Remove " " string element for(unsigned int i=0; i spaceSplitExp = itksys::SystemTools::SplitString(exp, ' ', false); + auto spaceSplitExp = itksys::SystemTools::SplitString(exp, ' ', false); // if the chain is " module", SplitString will return: [ ], [module] for(unsigned int i=0; i 0 ) { - std::vector spaceSplit = itksys::SystemTools::SplitString(tempModKey.substr(0, tempModKey.size()), ' ', false); + auto spaceSplit = itksys::SystemTools::SplitString(tempModKey.substr(0, tempModKey.size()), ' ', false); // Remove " " string element for(unsigned int i=0; i Date: Fri, 21 Jun 2019 17:21:57 +0200 Subject: [PATCH 41/63] COMP: use vcl_legacy_aliases.h for itk v5 vnl compatibility --- Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx | 4 ++++ .../ImageBase/test/otbImagePCAShapeModelEstimatorTest.cxx | 4 ++++ .../LabelMap/include/otbShapeAttributesLabelMapFilter.hxx | 4 ++++ Modules/Core/Metadata/include/otbNoDataHelper.h | 4 ++++ Modules/Feature/Edge/include/otbLineSegmentDetector.hxx | 4 ++++ .../include/otbKullbackLeiblerProfileImageFilter.hxx | 4 ++++ Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx | 4 ++++ .../otbEuclideanDistanceMetricWithMissingValuePow2.hxx | 4 ++++ Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx | 3 +++ .../Filtering/MathParserX/test/otbBandMathXImageFilter.cxx | 4 +++- .../Projection/include/otbVectorDataTransformFilter.hxx | 4 ++++ .../test/otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx | 4 ++++ .../Statistics/include/otbStreamingStatisticsImageFilter.hxx | 4 ++++ .../include/otbStreamingStatisticsVectorImageFilter.hxx | 4 ++++ .../include/otbPolygonCompacityFunctor.h | 4 ++++ Modules/Learning/Markov/include/otbMRFEnergyEdgeFidelity.h | 4 ++++ Modules/Learning/Markov/include/otbMRFEnergyGaussian.h | 4 ++++ .../Markov/include/otbMRFEnergyGaussianClassification.h | 4 ++++ .../DisparityMap/include/otbNCCRegistrationFunction.hxx | 4 ++++ Modules/Visualization/Ice/src/otbGlImageActor.cxx | 4 ++++ 20 files changed, 78 insertions(+), 1 deletion(-) diff --git a/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx b/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx index f72fd72c28..6fd07e96b4 100644 --- a/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx +++ b/Modules/Adapters/OSSIMAdapters/test/otbDEMHandlerTest.cxx @@ -22,6 +22,10 @@ #include "itkMacro.h" #include "otbDEMHandler.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + int otbDEMHandlerTest(int argc, char * argv[]) { if(argc!=9) diff --git a/Modules/Core/ImageBase/test/otbImagePCAShapeModelEstimatorTest.cxx b/Modules/Core/ImageBase/test/otbImagePCAShapeModelEstimatorTest.cxx index c1cdff6be1..4ffcec0d98 100644 --- a/Modules/Core/ImageBase/test/otbImagePCAShapeModelEstimatorTest.cxx +++ b/Modules/Core/ImageBase/test/otbImagePCAShapeModelEstimatorTest.cxx @@ -33,6 +33,10 @@ #include "itkImagePCAShapeModelEstimator.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + //Data definitions #define IMGWIDTH 2 #define IMGHEIGHT 2 diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx index ee30f6a134..80e0209631 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.hxx @@ -36,6 +36,10 @@ #include "otbMacro.h" #include +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { namespace Functor { diff --git a/Modules/Core/Metadata/include/otbNoDataHelper.h b/Modules/Core/Metadata/include/otbNoDataHelper.h index 98cfc7caf1..29d2257a98 100644 --- a/Modules/Core/Metadata/include/otbNoDataHelper.h +++ b/Modules/Core/Metadata/include/otbNoDataHelper.h @@ -26,6 +26,10 @@ #include #include "OTBMetadataExport.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace itk { class MetaDataDictionary; diff --git a/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx b/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx index 5ddfa10103..a29d25e238 100644 --- a/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx +++ b/Modules/Feature/Edge/include/otbLineSegmentDetector.hxx @@ -37,6 +37,10 @@ #include "itkMatrix.h" #include "itkSymmetricEigenAnalysis.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + extern "C" double dlngam_(double *x); extern "C" double dbetai_(double *x, double *a, double *b); diff --git a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerProfileImageFilter.hxx b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerProfileImageFilter.hxx index df648c5561..7590da8353 100644 --- a/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerProfileImageFilter.hxx +++ b/Modules/Filtering/ChangeDetection/include/otbKullbackLeiblerProfileImageFilter.hxx @@ -27,6 +27,10 @@ #include "otbKullbackLeiblerProfileImageFilter.h" #include "otbMath.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx index 7b03807cef..e6271cf38e 100644 --- a/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx +++ b/Modules/Filtering/DEM/include/otbDEMToImageGenerator.hxx @@ -25,6 +25,10 @@ #include "otbMacro.h" #include "itkProgressReporter.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValuePow2.hxx b/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValuePow2.hxx index 37cfd2dc5f..d101f5b7c5 100644 --- a/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValuePow2.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbEuclideanDistanceMetricWithMissingValuePow2.hxx @@ -26,6 +26,10 @@ #include "otbEuclideanDistanceMetricWithMissingValuePow2.h" #include "itkMeasurementVectorTraits.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { namespace Statistics { diff --git a/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx b/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx index 26c714c100..2719b6f562 100644 --- a/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx +++ b/Modules/Filtering/MathParser/test/otbBandMathImageFilter.cxx @@ -29,6 +29,9 @@ #include "otbBandMathImageFilter.h" #include "otbImageFileWriter.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif int otbBandMathImageFilter( int itkNotUsed(argc), char* itkNotUsed(argv) []) { diff --git a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx index 161c812d97..1be3767f89 100644 --- a/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx +++ b/Modules/Filtering/MathParserX/test/otbBandMathXImageFilter.cxx @@ -31,7 +31,9 @@ #include "itkImageRegionIteratorWithIndex.h" - +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif int otbBandMathXImageFilter( int itkNotUsed(argc), char* itkNotUsed(argv) []) { diff --git a/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.hxx b/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.hxx index 67704d57af..972e90fcf9 100644 --- a/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.hxx +++ b/Modules/Filtering/Projection/include/otbVectorDataTransformFilter.hxx @@ -26,6 +26,10 @@ #include #include "otbStopwatch.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx b/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx index a7f96117e0..3dc4058c84 100644 --- a/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx +++ b/Modules/Filtering/Projection/test/otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx @@ -26,6 +26,10 @@ #include "otbMacro.h" #include +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + int otbGCPsToRPCSensorModelImageFilterCheckRpcModel(int argc, char * argv[]) { // Look for tolerance value diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx index 8dcf397249..fad7a7dd58 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsImageFilter.hxx @@ -27,6 +27,10 @@ #include "itkProgressReporter.h" #include "otbMacro.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx index 56b1bc98d7..144ef641d6 100644 --- a/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx +++ b/Modules/Filtering/Statistics/include/otbStreamingStatisticsVectorImageFilter.hxx @@ -27,6 +27,10 @@ #include "itkProgressReporter.h" #include "otbMacro.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Filtering/VectorDataManipulation/include/otbPolygonCompacityFunctor.h b/Modules/Filtering/VectorDataManipulation/include/otbPolygonCompacityFunctor.h index 8bf3100e00..ad4355f049 100644 --- a/Modules/Filtering/VectorDataManipulation/include/otbPolygonCompacityFunctor.h +++ b/Modules/Filtering/VectorDataManipulation/include/otbPolygonCompacityFunctor.h @@ -23,6 +23,10 @@ #include "otbMath.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Learning/Markov/include/otbMRFEnergyEdgeFidelity.h b/Modules/Learning/Markov/include/otbMRFEnergyEdgeFidelity.h index 05d2e71ff5..3b87aab0a7 100644 --- a/Modules/Learning/Markov/include/otbMRFEnergyEdgeFidelity.h +++ b/Modules/Learning/Markov/include/otbMRFEnergyEdgeFidelity.h @@ -24,6 +24,10 @@ #include "otbMRFEnergy.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { /** diff --git a/Modules/Learning/Markov/include/otbMRFEnergyGaussian.h b/Modules/Learning/Markov/include/otbMRFEnergyGaussian.h index 6a780c2508..435c5917dd 100644 --- a/Modules/Learning/Markov/include/otbMRFEnergyGaussian.h +++ b/Modules/Learning/Markov/include/otbMRFEnergyGaussian.h @@ -26,6 +26,10 @@ #include "otbMath.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { /** diff --git a/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h b/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h index bb9451c4f8..e49f825f3f 100644 --- a/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h +++ b/Modules/Learning/Markov/include/otbMRFEnergyGaussianClassification.h @@ -24,6 +24,10 @@ #include "otbMRFEnergy.h" #include "otbMath.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { /** diff --git a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx index 8d052aa478..a140195f10 100644 --- a/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx +++ b/Modules/Registration/DisparityMap/include/otbNCCRegistrationFunction.hxx @@ -28,6 +28,10 @@ #include "otbMacro.h" #include "otbNCCRegistrationFunction.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { diff --git a/Modules/Visualization/Ice/src/otbGlImageActor.cxx b/Modules/Visualization/Ice/src/otbGlImageActor.cxx index 1a61ab0062..c4ec370d3e 100644 --- a/Modules/Visualization/Ice/src/otbGlImageActor.cxx +++ b/Modules/Visualization/Ice/src/otbGlImageActor.cxx @@ -31,6 +31,10 @@ #include "itkListSample.h" #include "otbListSampleToHistogramListGenerator.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + namespace otb { -- GitLab From b5fe04864c576773477ffa7ca02cfc740229c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:22:46 +0200 Subject: [PATCH 42/63] ENH: include math.h for fabs --- Modules/Radiometry/Simulation/test/otbSoilDBTest.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Radiometry/Simulation/test/otbSoilDBTest.cxx b/Modules/Radiometry/Simulation/test/otbSoilDBTest.cxx index 439eda0b92..67e355a4d2 100644 --- a/Modules/Radiometry/Simulation/test/otbSoilDBTest.cxx +++ b/Modules/Radiometry/Simulation/test/otbSoilDBTest.cxx @@ -23,6 +23,8 @@ #include "otbSoilDataBase.h" #include +#include /* fabs */ + int otbSoilDataBaseParseFile(int argc, char * argv[]) { if(argc < 5) -- GitLab From 2f5ddcd991cc0e1fa3d5eb0d11213e15c2f58857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:27:30 +0200 Subject: [PATCH 43/63] COMP: use std::mutex instead of itk's deprecated equivalent in itk5 --- .../otbImageRegionAdaptativeSplitter.h | 9 +++++++++ .../otbImageRegionAdaptativeSplitter.hxx | 16 +++++++++++++++ .../src/otbImageMetadataInterfaceFactory.cxx | 14 ++++++++++++- ...tbOpticalImageMetadataInterfaceFactory.cxx | 12 +++++++++++ .../otbSarImageMetadataInterfaceFactory.cxx | 12 +++++++++++ .../include/otbStreamingImageVirtualWriter.h | 9 +++++++++ .../otbStreamingImageVirtualWriter.hxx | 16 +++++++++++++++ .../IO/ImageIO/include/otbImageFileWriter.h | 8 ++++++++ .../IO/ImageIO/include/otbImageFileWriter.hxx | 16 +++++++++++++++ Modules/IO/ImageIO/src/otbImageIOFactory.cxx | 20 ++++++++++++++----- .../src/otbVectorDataIOFactory.cxx | 13 ++++++++++++ ...otbDimensionalityReductionModelFactory.hxx | 14 ++++++++++++- .../otbMachineLearningModelFactoryBase.h | 11 ++++++++++ .../otbMachineLearningModelFactoryBase.cxx | 4 ++++ .../otbMachineLearningModelFactory.hxx | 13 +++++++++++- 15 files changed, 179 insertions(+), 8 deletions(-) diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h index 047f6fe092..5416df92e8 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h @@ -26,7 +26,12 @@ #include "itkImageRegionSplitter.h" #include "itkIndex.h" #include "itkSize.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#else +#include +#endif namespace otb { @@ -176,7 +181,11 @@ private: mutable bool m_IsUpToDate; // Lock to ensure thread-safety + #if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; + #else + std::mutex m_Lock; + #endif }; } // end namespace otb diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx index c29956a9d1..b461878624 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx @@ -41,13 +41,21 @@ ImageRegionAdaptativeSplitter this->SetRequestedNumberOfSplits(requestedNumber); // Check if we need to compute split map agagin + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif if(!m_IsUpToDate) { // Do so if we need to this->EstimateSplitMap(); } + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif // Return the size of the split map return m_StreamVector.size(); @@ -62,13 +70,21 @@ ImageRegionAdaptativeSplitter this->SetImageRegion(region); // Check if we need to compute split map agagin + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif if(!m_IsUpToDate) { // Do so if we need to this->EstimateSplitMap(); } + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif // Return the requested split return m_StreamVector.at(i); diff --git a/Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx b/Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx index 6d4f47301a..7d4a9a0687 100644 --- a/Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx +++ b/Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx @@ -39,8 +39,12 @@ #include "otbCosmoImageMetadataInterfaceFactory.h" #include "otbRadarsat2ImageMetadataInterfaceFactory.h" +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" #include "itkMutexLockHolder.h" +#else +#include +#endif #include #include @@ -100,12 +104,20 @@ ImageMetadataInterfaceFactory ::RegisterBuiltInFactories() { static bool firstTime = true; - + + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif { // This helper class makes sure the Mutex is unlocked // in the event an exception is thrown. + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(mutex); + #else + std::lock_guard mutexHolder(mutex); + #endif if (firstTime) { itk::ObjectFactoryBase::RegisterFactory(IkonosImageMetadataInterfaceFactory::New()); diff --git a/Modules/Core/Metadata/src/otbOpticalImageMetadataInterfaceFactory.cxx b/Modules/Core/Metadata/src/otbOpticalImageMetadataInterfaceFactory.cxx index abda05f537..2a0a48c72c 100644 --- a/Modules/Core/Metadata/src/otbOpticalImageMetadataInterfaceFactory.cxx +++ b/Modules/Core/Metadata/src/otbOpticalImageMetadataInterfaceFactory.cxx @@ -32,8 +32,12 @@ #include "otbPleiadesImageMetadataInterfaceFactory.h" #include "otbSpot6ImageMetadataInterfaceFactory.h" +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" #include "itkMutexLockHolder.h" +#else +#include +#endif namespace otb { @@ -80,11 +84,19 @@ OpticalImageMetadataInterfaceFactory { static bool firstTime = true; + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif { // This helper class makes sure the Mutex is unlocked // in the event an exception is thrown. + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(mutex); + #else + std::lock_guard mutexHolder(mutex); + #endif if (firstTime) { itk::ObjectFactoryBase::RegisterFactory(IkonosImageMetadataInterfaceFactory::New()); diff --git a/Modules/Core/Metadata/src/otbSarImageMetadataInterfaceFactory.cxx b/Modules/Core/Metadata/src/otbSarImageMetadataInterfaceFactory.cxx index 8ddf2b79c7..65540719c4 100644 --- a/Modules/Core/Metadata/src/otbSarImageMetadataInterfaceFactory.cxx +++ b/Modules/Core/Metadata/src/otbSarImageMetadataInterfaceFactory.cxx @@ -29,8 +29,12 @@ #include "otbCosmoImageMetadataInterfaceFactory.h" #include "otbRadarsat2ImageMetadataInterfaceFactory.h" +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" #include "itkMutexLockHolder.h" +#else +#include +#endif namespace otb { @@ -77,11 +81,19 @@ SarImageMetadataInterfaceFactory { static bool firstTime = true; + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif { // This helper class makes sure the Mutex is unlocked // in the event an exception is thrown. + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(mutex); + #else + std::lock_guard mutexHolder(mutex); + #endif if (firstTime) { itk::ObjectFactoryBase::RegisterFactory(TerraSarImageMetadataInterfaceFactory::New()); diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h index c26c960447..fd275c5c36 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h @@ -24,7 +24,12 @@ #include "itkMacro.h" #include "itkImageToImageFilter.h" #include "otbStreamingManager.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#else +#include +#endif namespace otb { @@ -194,7 +199,11 @@ private: unsigned long m_ObserverID; /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ + #if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; + #else + mutable std::mutex m_Lock; + #endif }; } // end namespace otb diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx index cdcee4f18e..0971e1fd2f 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx @@ -300,9 +300,17 @@ const bool & StreamingImageVirtualWriter ::GetAbortGenerateData() const { + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif bool ret = Superclass::GetAbortGenerateData(); + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -312,9 +320,17 @@ void StreamingImageVirtualWriter ::SetAbortGenerateData(bool val) { + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif Superclass::SetAbortGenerateData(val); + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif } } // end namespace otb diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.h b/Modules/IO/ImageIO/include/otbImageFileWriter.h index 78edc3e678..595651cf26 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.h +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.h @@ -25,7 +25,11 @@ #include "itkProcessObject.h" #include "otbStreamingManager.h" #include "otbExtendedFilenameToWriterOptions.h" +#if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#else +#include +#endif #include #include "OTBImageIOExport.h" @@ -282,7 +286,11 @@ private: unsigned int m_IOComponents; /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ + #if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; + #else + mutable std::mutex m_Lock; + #endif }; } // end namespace otb diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx index f046197d3b..c2464a1eda 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx @@ -850,10 +850,18 @@ const bool & ImageFileWriter ::GetAbortGenerateData() const { + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif // protected read here bool ret = Superclass::GetAbortGenerateData(); + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -863,9 +871,17 @@ void ImageFileWriter ::SetAbortGenerateData(bool val) { + #if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); + #else + m_Lock.lock(); + #endif Superclass::SetAbortGenerateData(val); + #if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); + #else + m_Lock.unlock(); + #endif } } // end namespace otb diff --git a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx index 042d600b56..6b359ccc6f 100644 --- a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx +++ b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx @@ -18,11 +18,6 @@ * limitations under the License. */ - - -#include "itkMutexLock.h" -#include "itkMutexLockHolder.h" - #include "otbImageIOFactory.h" #include "otbConfigure.h" @@ -33,6 +28,13 @@ #include "otbBSQImageIOFactory.h" #include "otbRADImageIOFactory.h" +#if ITK_VERSION_MAJOR < 5 +#include "itkMutexLock.h" +#include "itkMutexLockHolder.h" +#else +#include +#endif + namespace otb { @@ -83,11 +85,19 @@ ImageIOFactory::RegisterBuiltInFactories() { static bool firstTime = true; + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif { // This helper class makes sure the Mutex is unlocked // in the event an exception is thrown. + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(mutex); + #else + std::lock_guard mutexHolder(mutex); + #endif if (firstTime) { itk::ObjectFactoryBase::RegisterFactory(RADImageIOFactory::New()); diff --git a/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx b/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx index b0da05abe8..d11e594fab 100644 --- a/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx +++ b/Modules/IO/VectorDataIO/src/otbVectorDataIOFactory.cxx @@ -26,8 +26,13 @@ #endif #include "itkObjectFactoryBase.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" #include "itkMutexLockHolder.h" +#else +#include +#endif namespace otb { @@ -86,11 +91,19 @@ VectorDataIOFactory { static bool firstTime = true; + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif { // This helper class makes sure the Mutex is unlocked // in the event an exception is thrown. + #if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder mutexHolder(mutex); + #else + std::lock_guard mutexHolder(mutex); + #endif if (firstTime) { itk::ObjectFactoryBase::RegisterFactory(OGRVectorDataIOFactory::New()); diff --git a/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.hxx b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.hxx index 6fad411f58..1440f08dfa 100644 --- a/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.hxx +++ b/Modules/Learning/DimensionalityReductionLearning/include/otbDimensionalityReductionModelFactory.hxx @@ -30,7 +30,11 @@ #include "otbPCAModelFactory.h" #endif +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLockHolder.h" +#else +#include +#endif namespace otb { @@ -106,8 +110,12 @@ template void DimensionalityReductionModelFactory ::RegisterBuiltInFactories() -{ +{ +#if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder lockHolder(mutex); +#else + std::lock_guard lockHolder(mutex); +#endif RegisterFactory(SOM2DModelFactory::New()); RegisterFactory(SOM3DModelFactory::New()); @@ -137,7 +145,11 @@ void DimensionalityReductionModelFactory ::CleanFactories() { +#if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder lockHolder(mutex); +#else + std::lock_guard lockHolder(mutex); +#endif std::list factories = itk::ObjectFactoryBase::GetRegisteredFactories(); std::list::iterator itFac; diff --git a/Modules/Learning/LearningBase/include/otbMachineLearningModelFactoryBase.h b/Modules/Learning/LearningBase/include/otbMachineLearningModelFactoryBase.h index 31b4029dfa..fd135fa7fa 100644 --- a/Modules/Learning/LearningBase/include/otbMachineLearningModelFactoryBase.h +++ b/Modules/Learning/LearningBase/include/otbMachineLearningModelFactoryBase.h @@ -21,7 +21,14 @@ #ifndef otbMachineLearningModelFactoryBase_h #define otbMachineLearningModelFactoryBase_h +#include "itkObject.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLock.h" +#else +#include +#endif + #include "OTBLearningBaseExport.h" namespace otb @@ -50,7 +57,11 @@ protected: MachineLearningModelFactoryBase(); ~MachineLearningModelFactoryBase() override; + #if ITK_VERSION_MAJOR < 5 static itk::SimpleMutexLock mutex; + #else + static std::mutex mutex; + #endif private: MachineLearningModelFactoryBase(const Self &) = delete; diff --git a/Modules/Learning/LearningBase/src/otbMachineLearningModelFactoryBase.cxx b/Modules/Learning/LearningBase/src/otbMachineLearningModelFactoryBase.cxx index 954899e159..6c45d5a212 100644 --- a/Modules/Learning/LearningBase/src/otbMachineLearningModelFactoryBase.cxx +++ b/Modules/Learning/LearningBase/src/otbMachineLearningModelFactoryBase.cxx @@ -23,6 +23,10 @@ namespace otb { +#if ITK_VERSION_MAJOR < 5 itk::SimpleMutexLock MachineLearningModelFactoryBase::mutex; +#else +std::mutex MachineLearningModelFactoryBase::mutex; +#endif } // end namespace otb diff --git a/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.hxx b/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.hxx index 802027f27b..432b8d0bce 100644 --- a/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.hxx +++ b/Modules/Learning/Supervised/include/otbMachineLearningModelFactory.hxx @@ -43,8 +43,11 @@ #include "otbSharkKMeansMachineLearningModelFactory.h" #endif +#if ITK_VERSION_MAJOR < 5 #include "itkMutexLockHolder.h" - +#else +#include +#endif namespace otb { @@ -100,7 +103,11 @@ void MachineLearningModelFactory ::RegisterBuiltInFactories() { +#if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder lockHolder(mutex); +#else + std::lock_guard lockHolder(mutex); +#endif #ifdef OTB_USE_LIBSVM RegisterFactory(LibSVMMachineLearningModelFactory::New()); @@ -139,7 +146,11 @@ void MachineLearningModelFactory ::CleanFactories() { +#if ITK_VERSION_MAJOR < 5 itk::MutexLockHolder lockHolder(mutex); +#else + std::lock_guard lockHolder(mutex); +#endif std::list factories = itk::ObjectFactoryBase::GetRegisteredFactories(); std::list::iterator itFac; -- GitLab From 258092528ec2afe02d30213f3fbfd9630f5b3f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:32:54 +0200 Subject: [PATCH 44/63] COMP: Threader classes compatiiblity for itk5 --- .../Common/src/otbConfigurationManager.cxx | 11 ++++++++- Modules/Core/Common/src/otbLogger.cxx | 14 ++++++++++- .../include/otbObjectListToObjectListFilter.h | 11 ++++++++- .../otbObjectListToObjectListFilter.hxx | 14 +++++++++++ .../include/otbImageToPointSetFilter.h | 4 ++++ .../include/otbImageToPointSetFilter.hxx | 21 +++++++++++++++- .../Wavelet/test/otbWaveletTransform.cxx | 8 +++++-- .../IO/Carto/include/otbCoordinateToName.h | 14 +++++++---- Modules/IO/Carto/src/otbCoordinateToName.cxx | 10 +++++++- Modules/IO/TestKernel/include/otbTestMain.h | 13 ++++++++++ .../include/otbMachineLearningModel.hxx | 8 +++++++ .../include/otbPersistentSamplingFilterBase.h | 4 ++++ .../otbPersistentSamplingFilterBase.hxx | 24 ++++++++++++++++--- ...SharkRandomForestsMachineLearningModel.hxx | 12 ++++++++-- 14 files changed, 151 insertions(+), 17 deletions(-) diff --git a/Modules/Core/Common/src/otbConfigurationManager.cxx b/Modules/Core/Common/src/otbConfigurationManager.cxx index 63d94a1540..96e9c1c149 100644 --- a/Modules/Core/Common/src/otbConfigurationManager.cxx +++ b/Modules/Core/Common/src/otbConfigurationManager.cxx @@ -23,7 +23,12 @@ #include "otbMacro.h" #include "otbLogger.h" +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif + #include "itksys/SystemTools.hxx" #ifdef _OPENMP @@ -110,9 +115,13 @@ int ConfigurationManager::InitOpenMPThreads() { int ret = 1; #ifdef _OPENMP +#if ITK_VERSION_MAJOR < 5 ret = itk::MultiThreader::GetGlobalDefaultNumberOfThreads(); +#else + ret = itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads(); +#endif //ITK_VERSION_MAJOR omp_set_num_threads(ret); -#endif +#endif //_OPENMP return ret; } diff --git a/Modules/Core/Common/src/otbLogger.cxx b/Modules/Core/Common/src/otbLogger.cxx index 20685d1651..915d5d94ca 100644 --- a/Modules/Core/Common/src/otbLogger.cxx +++ b/Modules/Core/Common/src/otbLogger.cxx @@ -24,7 +24,12 @@ #include "itkStdStreamLogOutput.h" #include #include "gdal.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif #include #include @@ -93,10 +98,17 @@ void Logger::LogSetupInformation() this->Info(oss.str()); oss.str(""); oss.clear(); - + +#if ITK_VERSION_MAJOR < 5 oss<<"OTB will use at most "<< itk::MultiThreader::GetGlobalDefaultNumberOfThreads()<< " threads"<Info(oss.str()); oss.str(""); oss.clear(); diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h index bcdb08b450..7ad69e0d8f 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.h @@ -21,10 +21,15 @@ #ifndef otbObjectListToObjectListFilter_h #define otbObjectListToObjectListFilter_h -#include "itkMultiThreader.h" #include "otbObjectListSource.h" #include "otbMacro.h" //for ITK_THREAD_RETURN_TYPE in ITK5 +#if ITK_VERSION_MAJOR < 5 +#include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif + namespace otb { @@ -103,7 +108,11 @@ protected: /** Static function used as a "callback" by the MultiThreader. The threading * library will call this routine for each thread, which will delegate the * control to ThreadedGenerateData(). */ +#if ITK_VERSION_MAJOR >= 5 + static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg); +#else static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg); +#endif /** Internal structure used for passing image data into the threading library */ struct ThreadStruct diff --git a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx index a61230303c..19d29155a9 100644 --- a/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx +++ b/Modules/Core/ObjectList/include/otbObjectListToObjectListFilter.hxx @@ -146,7 +146,11 @@ ObjectListToObjectListFilter } template +#if ITK_VERSION_MAJOR >= 5 +itk::ITK_THREAD_RETURN_TYPE +#else ITK_THREAD_RETURN_TYPE +#endif ObjectListToObjectListFilter ::ThreaderCallback(void *arg) { @@ -155,9 +159,15 @@ ObjectListToObjectListFilter unsigned int total, start, stop; unsigned int requestedElements; +#if ITK_VERSION_MAJOR < 5 threadId = ((itk::MultiThreader::ThreadInfoStruct *) (arg))->ThreadID; threadCount = ((itk::MultiThreader::ThreadInfoStruct *) (arg))->NumberOfThreads; str = (ThreadStruct *) (((itk::MultiThreader::ThreadInfoStruct *) (arg))->UserData); +#else + threadId = ((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->ThreadID; + threadCount = ((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->NumberOfThreads; + str = (ThreadStruct *) (((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->UserData); +#endif requestedElements = str->Filter->GetInput()->Size(); total = str->Filter->SplitRequestedRegion(threadId, threadCount, requestedElements, start, stop); @@ -179,7 +189,11 @@ ObjectListToObjectListFilter // few threads idle. // } +#if ITK_VERSION_MAJOR >= 5 + return itk::ITK_THREAD_RETURN_DEFAULT_VALUE; +#else return ITK_THREAD_RETURN_VALUE; +#endif } /** diff --git a/Modules/Core/PointSet/include/otbImageToPointSetFilter.h b/Modules/Core/PointSet/include/otbImageToPointSetFilter.h index 9e00f51e76..deb213af80 100644 --- a/Modules/Core/PointSet/include/otbImageToPointSetFilter.h +++ b/Modules/Core/PointSet/include/otbImageToPointSetFilter.h @@ -104,7 +104,11 @@ protected: /** Static function used as a "callback" by the MultiThreader. The threading * library will call this routine for each thread, which will delegate the * control to ThreadedGenerateData(). */ + #if ITK_VERSION_MAJOR >= 5 + static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg); + #else static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg); + #endif /** Internal structure used for passing image data into the threading library */ struct ThreadStruct diff --git a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx index abc1f124a3..3704afe0c0 100644 --- a/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx +++ b/Modules/Core/PointSet/include/otbImageToPointSetFilter.hxx @@ -22,8 +22,13 @@ #define otbImageToPointSetFilter_hxx #include "otbImageToPointSetFilter.h" -#include "itkMultiThreader.h" //itk5 - itk4 compat +//#include "itkMultiThreader.h" //itk5 - itk4 compat +#if ITK_VERSION_MAJOR < 5 +#include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif namespace otb { @@ -272,7 +277,11 @@ ImageToPointSetFilter } template +#if ITK_VERSION_MAJOR >= 5 +itk::ITK_THREAD_RETURN_TYPE +#else ITK_THREAD_RETURN_TYPE +#endif ImageToPointSetFilter ::ThreaderCallback(void *arg) { @@ -280,9 +289,15 @@ ImageToPointSetFilter unsigned int total, threadCount; itk::ThreadIdType threadId; +#if ITK_VERSION_MAJOR < 5 threadId = ((itk::MultiThreader::ThreadInfoStruct *) (arg))->ThreadID; threadCount = ((itk::MultiThreader::ThreadInfoStruct *) (arg))->NumberOfThreads; str = (ThreadStruct *) (((itk::MultiThreader::ThreadInfoStruct *) (arg))->UserData); +#else + threadId = ((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->ThreadID; + threadCount = ((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->NumberOfThreads; + str = (ThreadStruct *) (((itk::MultiThreaderBase::ThreadInfoStruct *) (arg))->UserData); +#endif // execute the actual method with appropriate output region // first find out how many pieces extent can be split into. @@ -301,7 +316,11 @@ ImageToPointSetFilter // few threads idle. // } +#if ITK_VERSION_MAJOR >= 5 + return itk::ITK_THREAD_RETURN_DEFAULT_VALUE; +#else return ITK_THREAD_RETURN_VALUE; +#endif } template diff --git a/Modules/Filtering/Wavelet/test/otbWaveletTransform.cxx b/Modules/Filtering/Wavelet/test/otbWaveletTransform.cxx index 2c7c3a071d..41a4e691f6 100644 --- a/Modules/Filtering/Wavelet/test/otbWaveletTransform.cxx +++ b/Modules/Filtering/Wavelet/test/otbWaveletTransform.cxx @@ -42,8 +42,12 @@ int otbWaveletTransform_generic(int argc, char * argv[]) if (argc == 7) { - unsigned int NbOfThreads = atoi(argv[6]); - itk::MultiThreader::SetGlobalDefaultNumberOfThreads(NbOfThreads); + unsigned int NbOfThreads = atoi(argv[6]); +#if ITK_VERSION_MAJOR < 5 + itk::MultiThreader::SetGlobalDefaultNumberOfThreads(NbOfThreads); +#else + itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(NbOfThreads); +#endif } diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index 0b5e30606d..50600f8aa3 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -23,7 +23,13 @@ #define otbCoordinateToName_h #include "itkPoint.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkPlatformMultiThreader.h" +#endif + #include "itkConfigure.h" #include "otbCurlHelperInterface.h" #include "OTBCartoExport.h" @@ -65,11 +71,9 @@ public: itkSetMacro(Lon, double); itkSetMacro(Lat, double); - #if ITK_VERSION_MAJOR > 4 + using PlatformMultiThreader = itk::PlatformMultiThreader; - #else - using PlatformMultiThreader = itk::MultiThreader; - #endif + /** * Set the lon/lat only if they are far enough from the current point to * avoid triggering too many updates @@ -132,7 +136,7 @@ protected: virtual void DoEvaluate(); - static ITK_THREAD_RETURN_TYPE ThreadFunction(void*); + static itk::ITK_THREAD_RETURN_TYPE ThreadFunction(void*); private: CoordinateToName(const Self &) = delete; diff --git a/Modules/IO/Carto/src/otbCoordinateToName.cxx b/Modules/IO/Carto/src/otbCoordinateToName.cxx index 3dc7647573..77fa2900de 100644 --- a/Modules/IO/Carto/src/otbCoordinateToName.cxx +++ b/Modules/IO/Carto/src/otbCoordinateToName.cxx @@ -91,13 +91,21 @@ bool CoordinateToName::Evaluate() return true; } -ITK_THREAD_RETURN_TYPE +itk::ITK_THREAD_RETURN_TYPE CoordinateToName::ThreadFunction(void *arg) { +#if ITK_VERSION_MAJOR < 5 struct itk::MultiThreader::ThreadInfoStruct * pInfo = (itk::MultiThreader::ThreadInfoStruct *) (arg); +#else + struct itk::MultiThreaderBase::ThreadInfoStruct * pInfo = (itk::MultiThreaderBase::ThreadInfoStruct *) (arg); +#endif CoordinateToName::Pointer lThis = (CoordinateToName*) (pInfo->UserData); lThis->DoEvaluate(); +#if ITK_VERSION_MAJOR >= 5 + return itk::ITK_THREAD_RETURN_DEFAULT_VALUE; +#else return ITK_THREAD_RETURN_VALUE; +#endif } void CoordinateToName::DoEvaluate() diff --git a/Modules/IO/TestKernel/include/otbTestMain.h b/Modules/IO/TestKernel/include/otbTestMain.h index d0d988393a..765de1c4f4 100644 --- a/Modules/IO/TestKernel/include/otbTestMain.h +++ b/Modules/IO/TestKernel/include/otbTestMain.h @@ -27,7 +27,12 @@ #include #include +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif + #include "otbMacro.h" #include "otbOGRDriversInit.h" @@ -154,13 +159,21 @@ int main(int ac, char* av[]) if (CheckOption(av[1],"--with-threads", ac, 2)) { int numThreads = atoi(av[2]); + #if ITK_VERSION_MAJOR < 5 itk::MultiThreader::SetGlobalDefaultNumberOfThreads(numThreads); + #else + itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(numThreads); + #endif av += 2; ac -= 2; } else if (CheckOption(av[1], "--without-threads",ac, 1)) { + #if ITK_VERSION_MAJOR < 5 itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1); + #else + itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(1); + #endif av += 1; ac -= 1; } diff --git a/Modules/Learning/LearningBase/include/otbMachineLearningModel.hxx b/Modules/Learning/LearningBase/include/otbMachineLearningModel.hxx index 392857b02b..857ede0b86 100644 --- a/Modules/Learning/LearningBase/include/otbMachineLearningModel.hxx +++ b/Modules/Learning/LearningBase/include/otbMachineLearningModel.hxx @@ -27,7 +27,11 @@ #include "otbMachineLearningModel.h" +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif namespace otb { @@ -111,7 +115,11 @@ MachineLearningModel #pragma omp parallel shared(nb_threads,nb_batches) private(threadId) { // Get number of threads configured with ITK +#if ITK_VERSION_MAJOR < 5 omp_set_num_threads(itk::MultiThreader::GetGlobalDefaultNumberOfThreads()); +#else + omp_set_num_threads(itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads()); +#endif nb_threads = omp_get_num_threads(); threadId = omp_get_thread_num(); nb_batches = std::min(nb_threads,(unsigned int)input->Size()); diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h index c430cff148..511f8f737d 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.h @@ -193,7 +193,11 @@ protected: const std::vector& GetAdditionalFields(); /** Callback function to launch VectorThreadedGenerateData in each thread */ +#if ITK_VERSION_MAJOR < 5 static ITK_THREAD_RETURN_TYPE VectorThreaderCallback(void *arg); +#else + static itk::ITK_THREAD_RETURN_TYPE VectorThreaderCallback(void *arg); +#endif /** basically the same struct as itk::ImageSource::ThreadStruct */ struct VectorThreadStruct diff --git a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx index 0f5ae8395d..919bea6691 100644 --- a/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx +++ b/Modules/Learning/Sampling/include/otbPersistentSamplingFilterBase.hxx @@ -28,7 +28,12 @@ #include "otbMacro.h" #include "otbStopwatch.h" #include "itkProgressReporter.h" -#include "itkMultiThreader.h" //itk5 - itk4 compat + +#if ITK_VERSION_MAJOR < 5 +#include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif namespace otb { @@ -879,14 +884,23 @@ PersistentSamplingFilterBase } template +#if ITK_VERSION_MAJOR < 5 ITK_THREAD_RETURN_TYPE +#else +itk::ITK_THREAD_RETURN_TYPE +#endif PersistentSamplingFilterBase ::VectorThreaderCallback(void *arg) { +#if ITK_VERSION_MAJOR < 5 VectorThreadStruct *str = (VectorThreadStruct*)(((itk::MultiThreader::ThreadInfoStruct *)(arg))->UserData); - int threadId = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->ThreadID; int threadCount = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->NumberOfThreads; +#else + VectorThreadStruct *str = (VectorThreadStruct*)(((itk::MultiThreaderBase::ThreadInfoStruct *)(arg))->UserData); + int threadId = ((itk::MultiThreaderBase::ThreadInfoStruct *)(arg))->ThreadID; + int threadCount = ((itk::MultiThreaderBase::ThreadInfoStruct *)(arg))->NumberOfThreads; +#endif ogr::Layer layer = str->Filter->GetInMemoryInput(threadId); @@ -894,8 +908,12 @@ PersistentSamplingFilterBase { str->Filter->ThreadedGenerateVectorData(layer,threadId); } - + +#if ITK_VERSION_MAJOR >= 5 + return itk::ITK_THREAD_RETURN_DEFAULT_VALUE; +#else return ITK_THREAD_RETURN_VALUE; +#endif } template diff --git a/Modules/Learning/Supervised/include/otbSharkRandomForestsMachineLearningModel.hxx b/Modules/Learning/Supervised/include/otbSharkRandomForestsMachineLearningModel.hxx index b59e079182..a0553abade 100644 --- a/Modules/Learning/Supervised/include/otbSharkRandomForestsMachineLearningModel.hxx +++ b/Modules/Learning/Supervised/include/otbSharkRandomForestsMachineLearningModel.hxx @@ -70,8 +70,12 @@ SharkRandomForestsMachineLearningModel ::Train() { #ifdef _OPENMP +#if ITK_VERSION_MAJOR < 5 omp_set_num_threads(itk::MultiThreader::GetGlobalDefaultNumberOfThreads()); -#endif +#else + omp_set_num_threads(itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads()); +#endif // ITK_VERSION_MAJOR +#endif // _OPENMP std::vector features; std::vector class_labels; @@ -185,9 +189,13 @@ SharkRandomForestsMachineLearningModel shark::Data inputSamples = shark::createDataFromRange(features); #ifdef _OPENMP +#if ITK_VERSION_MAJOR < 5 omp_set_num_threads(itk::MultiThreader::GetGlobalDefaultNumberOfThreads()); +#else + omp_set_num_threads(itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads()); +#endif // ITK_VERSION_MAJOR +#endif // _OPENMP - #endif if( proba !=nullptr || quality != nullptr) { shark::Data probas = m_RFModel.decisionFunction()(inputSamples); -- GitLab From 2b78663601da13d7602bf4ca1fc3bdecb213f42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:34:49 +0200 Subject: [PATCH 45/63] COMP: new class otbCastImageFilter to replace deprecated VectorCastImageFilter --- .../app/otbGridBasedImageResampling.cxx | 13 +- .../AppStereo/app/otbStereoFramework.cxx | 16 +- .../otbStereoRectificationGridGenerator.cxx | 14 +- .../Core/Common/include/otbCastImageFilter.h | 114 +++++++++++ .../Common/include/otbCastImageFilter.hxx | 178 ++++++++++++++++++ 5 files changed, 330 insertions(+), 5 deletions(-) create mode 100644 Modules/Core/Common/include/otbCastImageFilter.h create mode 100644 Modules/Core/Common/include/otbCastImageFilter.hxx diff --git a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx index 3e2d3c361c..9c994f830a 100644 --- a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx +++ b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx @@ -29,8 +29,12 @@ #include "otbConcatenateVectorImageFilter.h" #include "otbMultiToMonoChannelExtractROI.h" #include "otbImageToVectorImageCastFilter.h" -#include "itkVectorCastImageFilter.h" +#if ITK_VERSION_MAJOR < 5 +#include "itkVectorCastImageFilter.h" +#else +#include "otbCastImageFilter.h" +#endif namespace otb { @@ -56,10 +60,15 @@ public: typedef itk::Vector DisplacementType; typedef otb::Image DisplacementFieldType; +#if ITK_VERSION_MAJOR < 5 typedef itk::VectorCastImageFilter DisplacementFieldCastFilterType; - +#else + typedef otb::CastImageFilter + DisplacementFieldCastFilterType; +#endif typedef otb::StreamingWarpImageFilter DisplacementType; typedef otb::Image DisplacementFieldType; +#if ITK_VERSION_MAJOR < 5 typedef itk::VectorCastImageFilter - DisplacementFieldCastFilterType; + DisplacementFieldCastFilterType; +#else + typedef otb::CastImageFilter + DisplacementFieldCastFilterType; +#endif typedef itk::InverseDisplacementFieldImageFilter InverseDisplacementFieldFilterType; diff --git a/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx b/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx index 5e6eee5bc6..98b718327c 100644 --- a/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoRectificationGridGenerator.cxx @@ -25,7 +25,13 @@ // Elevation handler #include "otbWrapperElevationParametersHandler.h" #include "itkInverseDisplacementFieldImageFilter.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkVectorCastImageFilter.h" +#else +#include "otbCastImageFilter.h" +#endif + #include "itkVectorIndexSelectionCastImageFilter.h" #include "otbImageList.h" #include "otbImageListToVectorImageFilter.h" @@ -52,9 +58,15 @@ public: typedef itk::Vector DisplacementType; typedef otb::Image DisplacementFieldType; +#if ITK_VERSION_MAJOR < 5 typedef itk::VectorCastImageFilter DisplacementFieldCastFilterType; + DisplacementFieldType> DisplacementFieldCastFilterType; +#else + typedef otb::CastImageFilter + DisplacementFieldCastFilterType; +#endif typedef itk::InverseDisplacementFieldImageFilter InverseDisplacementFieldFilterType; diff --git a/Modules/Core/Common/include/otbCastImageFilter.h b/Modules/Core/Common/include/otbCastImageFilter.h new file mode 100644 index 0000000000..f436278574 --- /dev/null +++ b/Modules/Core/Common/include/otbCastImageFilter.h @@ -0,0 +1,114 @@ +/*========================================================================= + * + * Copyright Insight Software Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ +#ifndef otbCastImageFilter_h +#define otbCastImageFilter_h + +#if ITK_VERSION_MAJOR >= 5 +#include "itkUnaryFunctorImageFilter.h" +#include "itkProgressReporter.h" + +#include + +namespace otb +{ + +/** \class CastImageFilter + * + * \brief Casts input pixels to output pixel type. + * + * This filter is templated over the input image type + * and the output image type. + * + * A typical use is to cast a + \code + itk::Image + \endcode + * to a + \code + itk::Image + \endcode + * + * This filter can also be used to cast a + \code + itk::VectorImage + \endcode + * to a + \code + itk::VectorImage + \endcode + * + * This class is copied from the itkCastImageFilter, but it doesn't have + * a static assertion requiring the input and output pixel dimension to match, + * thus this filter can be used to convert to and from variableLengthVector. + * + * If you need to perform a dimensionaly reduction, you may want + * to use the ExtractImageFilter instead of the CastImageFilter. + * + */ +template< typename TInputImage, typename TOutputImage > +class ITK_TEMPLATE_EXPORT CastImageFilter: + public itk::InPlaceImageFilter< TInputImage, TOutputImage > +{ +public: + ITK_DISALLOW_COPY_AND_ASSIGN(CastImageFilter); + + /** Standard class type aliases. */ + using Self = CastImageFilter; + + using Superclass = itk::InPlaceImageFilter< TInputImage, TOutputImage >; + + using Pointer = itk::SmartPointer< Self >; + using ConstPointer = itk::SmartPointer< const Self >; + + + using OutputImageRegionType = typename Superclass::OutputImageRegionType; + + using InputPixelType = typename TInputImage::PixelType; + using OutputPixelType = typename TOutputImage::PixelType; + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Run-time type information (and related methods). */ + itkTypeMacro(CastImageFilter, InPlaceImageFilter); + +protected: + CastImageFilter(); + virtual ~CastImageFilter() = default; + + void GenerateOutputInformation() override; + + void GenerateData() override; + + void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override; + + template + void DynamicThreadedGenerateDataDispatched(const OutputImageRegionType & outputRegionForThread, std::true_type isConvertible); + + template + void DynamicThreadedGenerateDataDispatched(const OutputImageRegionType & outputRegionForThread, std::false_type isConvertible); +}; +} // end namespace otb + +#endif + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbCastImageFilter.hxx" +#endif + +#endif // ITK_VERSION_MAJOR diff --git a/Modules/Core/Common/include/otbCastImageFilter.hxx b/Modules/Core/Common/include/otbCastImageFilter.hxx new file mode 100644 index 0000000000..8881f0046b --- /dev/null +++ b/Modules/Core/Common/include/otbCastImageFilter.hxx @@ -0,0 +1,178 @@ +/*========================================================================= + * + * Copyright Insight Software Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ +#ifndef itkCastImageFilter_hxx +#define itkCastImageFilter_hxx + +#if ITK_VERSION_MAJOR >= 5 + +#include "otbCastImageFilter.h" +#include "itkProgressReporter.h" +#include "itkImageAlgorithm.h" + +namespace otb +{ + + +template< typename TInputImage, typename TOutputImage > +CastImageFilter< TInputImage, TOutputImage > +::CastImageFilter() +{ + this->SetNumberOfRequiredInputs(1); + this->InPlaceOff(); + this->DynamicMultiThreadingOn(); +} + +template< typename TInputImage, typename TOutputImage > +void +CastImageFilter< TInputImage, TOutputImage > +::GenerateData() +{ + if ( this->GetInPlace() && this->CanRunInPlace() ) + { + // nothing to do, so avoid iterating over all the pixels + // for nothing! Allocate the output, generate a fake progress and exit + this->AllocateOutputs(); + itk::ProgressReporter progress(this, 0, 1); + return; + } + //else do normal Before+Threaded+After + Superclass::GenerateData(); +} + + +template< typename TInputImage, typename TOutputImage > +void +CastImageFilter< TInputImage, TOutputImage > +::GenerateOutputInformation() + { + // do not call the superclass' implementation of this method since + // this filter allows the input the output to be of different dimensions + + // get pointers to the input and output + TOutputImage *outputPtr = this->GetOutput(); + const TInputImage *inputPtr = this->GetInput(); + + if ( !outputPtr || !inputPtr ) + { + return; + } + + // Set the output image largest possible region. Use a RegionCopier + // so that the input and output images can be different dimensions. + OutputImageRegionType outputLargestPossibleRegion; + this->CallCopyInputRegionToOutputRegion( outputLargestPossibleRegion, + inputPtr->GetLargestPossibleRegion() ); + outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion); + + itk::ImageToImageFilterDetail::ImageInformationCopier + informationCopier; + informationCopier(outputPtr, inputPtr); + + } + + +template< typename TInputImage, typename TOutputImage > +void +CastImageFilter< TInputImage, TOutputImage > +::DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) +{ + DynamicThreadedGenerateDataDispatched(outputRegionForThread, + std::is_convertible()); +} + +template< typename TInputImage, typename TOutputImage > +template +void +CastImageFilter< TInputImage, TOutputImage > +::DynamicThreadedGenerateDataDispatched(const OutputImageRegionType & outputRegionForThread, std::true_type) +{ + const TInputImage *inputPtr = this->GetInput(); + TOutputImage *outputPtr = this->GetOutput(0); + + // Define the portion of the input to walk for this thread, using + // the CallCopyOutputRegionToInputRegion method allows for the input + // and output images to be different dimensions + typename TInputImage::RegionType inputRegionForThread; + + this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread); + + itk::ImageAlgorithm::Copy( inputPtr, outputPtr, inputRegionForThread, outputRegionForThread ); +} + + +template< typename TInputImage, typename TOutputImage > +template +void +CastImageFilter< TInputImage, TOutputImage > +::DynamicThreadedGenerateDataDispatched(const OutputImageRegionType & outputRegionForThread, std::false_type) +{ + // Implementation for non-implicit convertible pixels which are + // itk-array-like. + + //static_assert( OutputPixelType::Dimension == InputPixelType::Dimension, "Vector dimensions are required to match!" ); + static_assert( std::is_convertible::value, "Component types are required to be convertible." ); + + const typename OutputImageRegionType::SizeType ®ionSize = outputRegionForThread.GetSize(); + + if( regionSize[0] == 0 ) + { + return; + } + const TInputImage *inputPtr = this->GetInput(); + TOutputImage *outputPtr = this->GetOutput(0); + + // Define the portion of the input to walk for this thread, using + // the CallCopyOutputRegionToInputRegion method allows for the input + // and output images to be different dimensions + typename TInputImage::RegionType inputRegionForThread; + + this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread); + + // Define the iterators + itk::ImageScanlineConstIterator< TInputImage > inputIt(inputPtr, inputRegionForThread); + itk::ImageScanlineIterator< TOutputImage > outputIt(outputPtr, outputRegionForThread); + + inputIt.GoToBegin(); + outputIt.GoToBegin(); + while ( !inputIt.IsAtEnd() ) + { + while ( !inputIt.IsAtEndOfLine() ) + { + const InputPixelType &inputPixel = inputIt.Get(); + OutputPixelType value; + for ( unsigned int k = 0; k < OutputPixelType::Dimension; k++ ) + { + value[k] = static_cast< typename OutputPixelType::ValueType >( inputPixel[k] ); + } + outputIt.Set( value ); + + ++inputIt; + ++outputIt; + } + inputIt.NextLine(); + outputIt.NextLine(); + } + +} + +} // end namespace otb + +#endif + +#endif // ITK_VERSION_MAJOR -- GitLab From 0a043e5dae2955888c5375c8d21137a737898bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:35:31 +0200 Subject: [PATCH 46/63] COMP: remove unused header (and deprecated in itk 5 --- .../Conversion/include/otbVectorDataToLabelMapFilter.h | 2 +- .../include/otbVectorDataToLabelMapWithAttributesFilter.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.h index 90cba65b59..57cb18599e 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapFilter.h @@ -24,7 +24,7 @@ #include "itkLabelObject.h" #include "itkProgressReporter.h" -#include "itkBarrier.h" +//#include "itkBarrier.h" #include "itkConceptChecking.h" #include "itkContinuousIndex.h" //#include "itkDataObject.h" diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.h index 60586c59d8..bd13db6df3 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelMapWithAttributesFilter.h @@ -24,7 +24,7 @@ #include "itkLabelObject.h" #include "itkProgressReporter.h" -#include "itkBarrier.h" +//#include "itkBarrier.h" #include "itkConceptChecking.h" #include "itkContinuousIndex.h" //#include "itkDataObject.h" -- GitLab From b9886891b813c7209fd4ebb41e69c6d9af25a714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:35:53 +0200 Subject: [PATCH 47/63] ENH: remove unused header --- Modules/Filtering/Wavelet/include/otbWaveletTransform.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Modules/Filtering/Wavelet/include/otbWaveletTransform.h b/Modules/Filtering/Wavelet/include/otbWaveletTransform.h index a5d1375b5f..88b89a6dc9 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletTransform.h +++ b/Modules/Filtering/Wavelet/include/otbWaveletTransform.h @@ -29,8 +29,6 @@ #include "otbWaveletGenerator.h" #include "otbWaveletOperatorBase.h" -#include "itkMultiThreader.h" - namespace otb { /** \class WaveletTransform -- GitLab From e466e75f48cf869df292b127f3085cb0333f7cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 21 Jun 2019 17:37:06 +0200 Subject: [PATCH 48/63] COMP: spatial object compatibility for ITK5 (wip) --- Data/Input/ADS40RoiSmall.png.aux.xml | 10 +++++ .../otbDrawLineSpatialObjectListFilter.h | 5 +++ .../otbDrawLineSpatialObjectListFilter.hxx | 10 +++++ .../otbSpatialObjectToImageDrawingFilter.hxx | 34 ++++++++++++++ .../Core/SpatialObjects/test/CMakeLists.txt | 12 ----- .../test/otbDrawLineSpatialObject.cxx | 13 +++++- .../test/otbDrawLineSpatialObjectList.cxx | 28 +++++++++++- .../test/otbLineSpatialObjectList.cxx | 6 ++- .../test/otbSpatialObjectsTestDriver.cxx | 1 - ...alObjectListToRightAnglePointSetFilter.hxx | 45 ++++++++++++++++++- ...alObjectListToRightAnglePointSetFilter.cxx | 27 +++++++++++ ...tAnglePointSetFilterByStepsOutputAscii.cxx | 27 +++++++++++ .../Feature/Edge/include/otbFillGapsFilter.h | 7 ++- .../otbHoughTransform2DLinesImageFilter.hxx | 18 ++++++++ .../Edge/include/otbLocalHoughFilter.h | 6 ++- .../Edge/include/otbLocalHoughFilter.hxx | 16 ++++++- .../otbPersistentVectorizationImageFilter.hxx | 8 ++++ .../Feature/Edge/src/otbFillGapsFilter.cxx | 39 ++++++++++++++++ .../Feature/Edge/test/otbFillGapsFilter.cxx | 30 ++++++++++++- Modules/Feature/Edge/test/otbLocalHough.cxx | 8 +++- 20 files changed, 326 insertions(+), 24 deletions(-) create mode 100644 Data/Input/ADS40RoiSmall.png.aux.xml diff --git a/Data/Input/ADS40RoiSmall.png.aux.xml b/Data/Input/ADS40RoiSmall.png.aux.xml new file mode 100644 index 0000000000..2ed2381863 --- /dev/null +++ b/Data/Input/ADS40RoiSmall.png.aux.xml @@ -0,0 +1,10 @@ + + + + 255 + 120.1091003418 + 23 + 48.85195761071 + + + diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h index b13f26655d..e56bf11d6a 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.h @@ -65,7 +65,12 @@ public: typedef LineSpatialObjectList LinesListType; typedef LinesListType::LineType LineType; + +#if ITK_VERSION_MAJOR < 5 typedef LineType::PointListType PointListType; +#else + typedef LineType::LinePointListType PointListType; +#endif typedef typename LinesListType::const_iterator LineListIterator; typedef itk::ProcessObject ProcessObjectType; diff --git a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx index d8c28afbc4..d58802ead4 100644 --- a/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbDrawLineSpatialObjectListFilter.hxx @@ -101,13 +101,23 @@ DrawLineSpatialObjectListFilter PointListType& pointsList = (*itList)->GetPoints(); typename PointListType::const_iterator itPoints = pointsList.begin(); +#if ITK_VERSION_MAJOR < 5 indexBeginLine[0] = static_cast((*itPoints).GetPosition()[0]); indexBeginLine[1] = static_cast((*itPoints).GetPosition()[1]); +#else + indexBeginLine[0] = static_cast((*itPoints).GetPositionInObjectSpace()[0]); + indexBeginLine[1] = static_cast((*itPoints).GetPositionInObjectSpace()[1]); +#endif ++itPoints; //Get the second extremity of the segment +#if ITK_VERSION_MAJOR < 5 indexEndLine[0] = static_cast((*itPoints).GetPosition()[0]); indexEndLine[1] = static_cast((*itPoints).GetPosition()[1]); +#else + indexBeginLine[0] = static_cast((*itPoints).GetPositionInObjectSpace()[0]); + indexBeginLine[1] = static_cast((*itPoints).GetPositionInObjectSpace()[1]); +#endif /** Crop the segment if it is outside the region in the left*/ diff --git a/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.hxx b/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.hxx index 873cd8123a..e392f3af54 100644 --- a/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.hxx +++ b/Modules/Core/SpatialObjects/include/otbSpatialObjectToImageDrawingFilter.hxx @@ -263,7 +263,11 @@ void SpatialObjectToImageDrawingFilter ::GenerateOutputInformation() { +#if ITK_VERSION_MAJOR < 5 const InputSpatialObjectType * InputObject = this->GetInput(); +#else + auto InputObject = const_cast(this->GetInput()); +#endif OutputImagePointer OutputImage = this->GetOutput(); unsigned int i; @@ -283,7 +287,11 @@ SpatialObjectToImageDrawingFilter (*iter)->ComputeBoundingBox(); for (i = 0; i < ObjectDimension; ++i) { +#if ITK_VERSION_MAJOR < 5 minimum[i] = (*iter)->GetBoundingBox()->GetMinimum()[i]; +#else + minimum[i] = (*iter)->GetMyBoundingBoxInObjectSpace()->GetMinimum()[i]; +#endif } while (iter != end) @@ -291,32 +299,54 @@ SpatialObjectToImageDrawingFilter (*iter)->ComputeBoundingBox(); for (i = 0; i < ObjectDimension; ++i) { +#if ITK_VERSION_MAJOR < 5 if ((*iter)->GetBoundingBox()->GetMinimum()[i] < minimum[i]) { minimum[i] = (*iter)->GetBoundingBox()->GetMinimum()[i]; } +#else + if ((*iter)->GetMyBoundingBoxInObjectSpace()->GetMinimum()[i] < minimum[i]) + { + minimum[i] = (*iter)->GetMyBoundingBoxInObjectSpace()->GetMinimum()[i]; + } +#endif } ++iter; } for (i = 0; i < ObjectDimension; ++i) { +#if ITK_VERSION_MAJOR < 5 size[i] = (long unsigned int) (InputObject->GetBoundingBox()->GetMaximum()[i] - minimum[i]) + 1; +#else + size[i] = (long unsigned int) (InputObject->GetMyBoundingBoxInObjectSpace()->GetMaximum()[i] - minimum[i]) + 1; +#endif origine[i] = (long int) minimum[i]; originspecified = true; } +#if ITK_VERSION_MAJOR < 5 itkDebugMacro( << "minx= " << minimum[0] << ", miny= " << minimum[0] << ", maxx= " << InputObject->GetBoundingBox()->GetMaximum()[0] << ", maxy= " << InputObject->GetBoundingBox()->GetMaximum()[1]); +#else + itkDebugMacro( + << "minx= " << minimum[0] << ", miny= " << minimum[0] << ", maxx= " << + InputObject->GetMyBoundingBoxInObjectSpace()->GetMaximum()[0] << ", maxy= " << InputObject->GetMyBoundingBoxInObjectSpace()->GetMaximum()[1]); +#endif } else { for (i = 0; i < ObjectDimension; ++i) { +#if ITK_VERSION_MAJOR < 5 size[i] = (long int) (InputObject->GetBoundingBox()->GetMaximum()[i] - InputObject->GetBoundingBox()->GetMinimum()[i]); +#else + size[i] = (long int) (InputObject->GetMyBoundingBoxInObjectSpace()->GetMaximum()[i] + - InputObject->GetMyBoundingBoxInObjectSpace()->GetMinimum()[i]); +#endif } } @@ -366,9 +396,13 @@ SpatialObjectToImageDrawingFilter } else { +#if ITK_VERSION_MAJOR < 5 OutputImage->SetSignedSpacing(InputObject->GetIndexToObjectTransform()->GetScaleComponent()); // set spacing m_Spacing[0] = InputObject->GetIndexToObjectTransform()->GetScaleComponent()[0]; m_Spacing[1] = InputObject->GetIndexToObjectTransform()->GetScaleComponent()[1]; +#else //SpatialObjects exist purely in physical space coordinates + OutputImage->SetSignedSpacing(this->m_Spacing); // set spacing +#endif } if (originspecified) diff --git a/Modules/Core/SpatialObjects/test/CMakeLists.txt b/Modules/Core/SpatialObjects/test/CMakeLists.txt index ceddc82d09..2eef930337 100644 --- a/Modules/Core/SpatialObjects/test/CMakeLists.txt +++ b/Modules/Core/SpatialObjects/test/CMakeLists.txt @@ -22,7 +22,6 @@ otb_module_test() set(OTBSpatialObjectsTests otbSpatialObjectsTestDriver.cxx -otbSpatialObjectToImageDrawingFilter.cxx otbDrawLineSpatialObject.cxx otbLineSpatialObjectList.cxx otbDrawLineSpatialObjectList.cxx @@ -32,17 +31,6 @@ add_executable(otbSpatialObjectsTestDriver ${OTBSpatialObjectsTests}) target_link_libraries(otbSpatialObjectsTestDriver ${OTBSpatialObjects-Test_LIBRARIES}) otb_module_target_label(otbSpatialObjectsTestDriver) -# Tests Declaration -otb_add_test(NAME bfTvSpatialObjectToImageDrawingFilterWithoutInputImage COMMAND otbSpatialObjectsTestDriver - --compare-image ${NOTOL} - ${BASELINE}/bfTvSpatialObjectDrawingNoInput.png - ${TEMP}/bfTvSpatialObjectDrawingNoInput.png - otbSpatialObjectToImageDrawingFilter - ${TEMP}/bfTvSpatialObjectDrawingNoInput.png - 100 - 50 - ) - otb_add_test(NAME coTuDrawLineSpatialObject COMMAND otbSpatialObjectsTestDriver otbDrawLineSpatialObject diff --git a/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx b/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx index cd0b8010ba..a0653376c6 100644 --- a/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx +++ b/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObject.cxx @@ -65,13 +65,24 @@ int otbDrawLineSpatialObject(int itkNotUsed(argc), char * argv[]) // Definition of the line typedef itk::LineSpatialObject<2> LineType; - LineType::PointListType list; LineType::LinePointType point; +#if ITK_VERSION_MAJOR < 5 + LineType::PointListType list; +#else + LineType::LinePointListType list; +#endif +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); list.push_back(point); point.SetPosition(Vx, Vy); list.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + list.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + list.push_back(point); +#endif LineType::Pointer line = LineType::New(); line->SetId(0); diff --git a/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx b/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx index c43c46d12b..09ff8d6d34 100644 --- a/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx +++ b/Modules/Core/SpatialObjects/test/otbDrawLineSpatialObjectList.cxx @@ -60,8 +60,13 @@ int otbDrawLineSpatialObjectList(int itkNotUsed(argc), char * argv[]) typedef otb::LineSpatialObjectList LinesListType; typedef LinesListType::LineType LineType; LinesListType::Pointer list = LinesListType::New(); - + +#if ITK_VERSION_MAJOR < 5 LineType::PointListType pointList; +#else + LineType::LinePointListType pointList; +#endif + LineType::LinePointType point; // Definition of the first line @@ -71,10 +76,17 @@ int otbDrawLineSpatialObjectList(int itkNotUsed(argc), char * argv[]) Vx = 35.; Vy = 29.; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line = LineType::New(); line->SetId(0); @@ -91,10 +103,17 @@ int otbDrawLineSpatialObjectList(int itkNotUsed(argc), char * argv[]) Vx = 8.; Vy = 46.; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line2 = LineType::New(); line2->SetId(0); @@ -111,10 +130,17 @@ int otbDrawLineSpatialObjectList(int itkNotUsed(argc), char * argv[]) Vx = 22.; Vy = 38.; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line3 = LineType::New(); line3->SetId(0); diff --git a/Modules/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx b/Modules/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx index d04d0c0c75..2514bb06c8 100644 --- a/Modules/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx +++ b/Modules/Core/SpatialObjects/test/otbLineSpatialObjectList.cxx @@ -28,7 +28,11 @@ int otbLineSpatialObjectList(int itkNotUsed(argc), char * itkNotUsed(argv) []) { typedef otb::LineSpatialObjectList LineSpatialObjectListType; typedef LineSpatialObjectListType::LineType LineSpatialObjecType; - typedef LineSpatialObjectListType::LineType::PointListType PointListType; +#if ITK_VERSION_MAJOR < 5 + typedef LineSpatialObjectListType::LineType::PointListType PointListType; +#else + typedef LineSpatialObjectListType::LineType::LinePointListType PointListType; +#endif typedef LineSpatialObjectListType::const_iterator LineSpatialObjectListConstIterator; LineSpatialObjectListType::Pointer listLines = LineSpatialObjectListType::New(); diff --git a/Modules/Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx b/Modules/Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx index 9f015fb3f5..6e652d54c4 100644 --- a/Modules/Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx +++ b/Modules/Core/SpatialObjects/test/otbSpatialObjectsTestDriver.cxx @@ -22,7 +22,6 @@ void RegisterTests() { - REGISTER_TEST(otbSpatialObjectToImageDrawingFilter); REGISTER_TEST(otbDrawLineSpatialObject); REGISTER_TEST(otbLineSpatialObjectList); REGISTER_TEST(otbDrawLineSpatialObjectList); diff --git a/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx b/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx index dedbbc966f..f171640be3 100644 --- a/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx +++ b/Modules/Feature/Corner/include/otbLineSpatialObjectListToRightAnglePointSetFilter.hxx @@ -150,6 +150,7 @@ double LineSpatialObjectListToRightAnglePointSetFilter ::ComputeDistanceFromPointToSegment(PointType rAngle, LineType * line) { +#if ITK_VERSION_MAJOR < 5 /** Extract Indexes from the Dst line to instantiate the line iterator*/ typename LineType::PointListType& pointsListDst = line->GetPoints(); typename LineType::PointListType::const_iterator itPointsDst = pointsListDst.begin(); @@ -158,7 +159,16 @@ LineSpatialObjectListToRightAnglePointSetFilter ++itPointsDst; double X2 = (*itPointsDst).GetPosition()[0]; //xq2 double Y2 = (*itPointsDst).GetPosition()[1]; //yq2 - +#else + /** Extract Indexes from the Dst line to instantiate the line iterator*/ + typename LineType::LinePointListType& pointsListDst = line->GetPoints(); + typename LineType::LinePointListType::const_iterator itPointsDst = pointsListDst.begin(); + double X1 = (*itPointsDst).GetPositionInObjectSpace()[0]; //xq1 + double Y1 = (*itPointsDst).GetPositionInObjectSpace()[1]; //yq1 + ++itPointsDst; + double X2 = (*itPointsDst).GetPositionInObjectSpace()[0]; //xq2 + double Y2 = (*itPointsDst).GetPositionInObjectSpace()[1]; //yq2 +#endif double dist1 = std::sqrt((X1 - rAngle[0]) * (X1 - rAngle[0]) + (Y1 - rAngle[1]) * (Y1 - rAngle[1])); double dist2 = std::sqrt((X2 - rAngle[0]) * (X2 - rAngle[0]) + (Y2 - rAngle[1]) * (Y2 - rAngle[1])); @@ -188,6 +198,7 @@ double LineSpatialObjectListToRightAnglePointSetFilter ::ComputeOrientation(LineType * line) { +#if ITK_VERSION_MAJOR < 5 typename LineType::PointListType& pointsList = line->GetPoints(); typename LineType::PointListType::const_iterator itPoints = pointsList.begin(); double Xp1 = (*itPoints).GetPosition()[0]; @@ -196,7 +207,16 @@ LineSpatialObjectListToRightAnglePointSetFilter ++itPoints; double Xp2 = (*itPoints).GetPosition()[0]; double Yp2 = (*itPoints).GetPosition()[1]; +#else + typename LineType::LinePointListType& pointsList = line->GetPoints(); + typename LineType::LinePointListType::const_iterator itPoints = pointsList.begin(); + double Xp1 = (*itPoints).GetPositionInObjectSpace()[0]; + double Yp1 = (*itPoints).GetPositionInObjectSpace()[1]; + ++itPoints; + double Xp2 = (*itPoints).GetPositionInObjectSpace()[0]; + double Yp2 = (*itPoints).GetPositionInObjectSpace()[1]; +#endif //Compute the orientation double dx = Xp1 - Xp2; double dy = Yp1 - Yp2; @@ -217,6 +237,8 @@ LineSpatialObjectListToRightAnglePointSetFilter { PointType P; + +#if ITK_VERSION_MAJOR < 5 /** ----- */ typename LineType::PointListType& pointsList = lineSrc->GetPoints(); typename LineType::PointListType::const_iterator itPoints = pointsList.begin(); @@ -236,6 +258,27 @@ LineSpatialObjectListToRightAnglePointSetFilter ++itPointsDst; double Xq2 = (*itPointsDst).GetPosition()[0]; //xq2 double Yq2 = (*itPointsDst).GetPosition()[1]; //yq2 +#else + /** ----- */ + typename LineType::LinePointListType& pointsList = lineSrc->GetPoints(); + typename LineType::LinePointListType::const_iterator itPoints = pointsList.begin(); + + double Xp1 = (*itPoints).GetPositionInObjectSpace()[0]; + double Yp1 = (*itPoints).GetPositionInObjectSpace()[1]; + ++itPoints; + double Xp2 = (*itPoints).GetPositionInObjectSpace()[0]; + double Yp2 = (*itPoints).GetPositionInObjectSpace()[1]; + + /** Extract Indexes from the Dst line to instantiate the line iterator*/ + typename LineType::LinePointListType& pointsListDst = lineDst->GetPoints(); + typename LineType::LinePointListType::const_iterator itPointsDst = pointsListDst.begin(); + + double Xq1 = (*itPointsDst).GetPositionInObjectSpace()[0]; //xq1 + double Yq1 = (*itPointsDst).GetPositionInObjectSpace()[1]; //yq1 + ++itPointsDst; + double Xq2 = (*itPointsDst).GetPositionInObjectSpace()[0]; //xq2 + double Yq2 = (*itPointsDst).GetPositionInObjectSpace()[1]; //yq2 +#endif /** Compute the equation of the lines A and B which are support of the segments Src & Dst*/ // - Line 1 : slope and origin diff --git a/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx b/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx index a2387f9032..a16e96be94 100644 --- a/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx +++ b/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx @@ -53,7 +53,12 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int itkNotUsed(argc), cha /** Creation of lines */ LinesListType::Pointer list = LinesListType::New(); + +#if ITK_VERSION_MAJOR < 5 LineType::PointListType pointList; +#else + LineType::LinePointListType pointList; +#endif LineType::LinePointType point; // Definition of the first line @@ -63,10 +68,18 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int itkNotUsed(argc), cha Vx = 31.7; Vy = 25.1; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif + LineType::Pointer line = LineType::New(); line->SetId(0); @@ -83,10 +96,17 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int itkNotUsed(argc), cha Vx = 30.1; Vy = 10.6; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line2 = LineType::New(); line2->SetId(0); @@ -103,10 +123,17 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int itkNotUsed(argc), cha Vx = 40.5; Vy = 17.1; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line3 = LineType::New(); line3->SetId(0); diff --git a/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx b/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx index c019d966ef..0d47dfa5e5 100644 --- a/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx +++ b/Modules/Feature/Corner/test/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx @@ -53,7 +53,13 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int itk /** Creation of lines */ LinesListType::Pointer list = LinesListType::New(); + +#if ITK_VERSION_MAJOR < 5 LineType::PointListType pointList; +#else + LineType::LinePointListType pointList; +#endif + LineType::LinePointType point; // Definition of the first line @@ -63,10 +69,17 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int itk Vx = 31.7; Vy = 25.1; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line = LineType::New(); line->SetId(0); @@ -83,10 +96,17 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int itk Vx = 30.1; Vy = 10.6; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line2 = LineType::New(); line2->SetId(0); @@ -103,10 +123,17 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int itk Vx = 40.5; Vy = 17.1; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line3 = LineType::New(); line3->SetId(0); diff --git a/Modules/Feature/Edge/include/otbFillGapsFilter.h b/Modules/Feature/Edge/include/otbFillGapsFilter.h index d93ae1f2e7..15ec76ca6c 100644 --- a/Modules/Feature/Edge/include/otbFillGapsFilter.h +++ b/Modules/Feature/Edge/include/otbFillGapsFilter.h @@ -53,8 +53,13 @@ public: typedef LineSpatialObjectList LineSpatialObjectListType; typedef LineSpatialObjectListType::Pointer LineSpatialObjectListPointer; typedef LineSpatialObjectListType::LineType LineSpatialObjectType; - typedef LineSpatialObjectType::PointListType PointListType; typedef LineSpatialObjectType::LinePointType PointType; +#if ITK_VERSION_MAJOR < 5 + typedef LineSpatialObjectType::PointListType PointListType; +#else + typedef LineSpatialObjectType::LinePointListType PointListType; +#endif + typedef itk::ProcessObject ProcessObjectType; diff --git a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx index 0f7af0bfc1..f5e94dcdd7 100644 --- a/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbHoughTransform2DLinesImageFilter.hxx @@ -317,7 +317,11 @@ HoughTransform2DLinesImageFilter if (it_input.Get() == max) { // Create the line +#if ITK_VERSION_MAJOR < 5 LineType::PointListType list; // insert two points per line +#else + LineType::LinePointListType list; // insert two points per line +#endif double radius = this->GetDistanceValue(it_input.GetIndex()[0]); double teta = this->GetAngleValue(it_input.GetIndex()[1]); @@ -336,18 +340,32 @@ HoughTransform2DLinesImageFilter } LinePointType p; +#if ITK_VERSION_MAJOR < 5 p.SetPosition(Vx, Vy); list.push_back(p); p.SetPosition(Vx - VyNorm * 5, Vy + VxNorm * 5); list.push_back(p); +#else + p.SetPositionInObjectSpace(Vx, Vy); + list.push_back(p); + p.SetPositionInObjectSpace(Vx - VyNorm * 5, Vy + VxNorm * 5); + list.push_back(p); +#endif } else // if teta>0 { LinePointType p; +#if ITK_VERSION_MAJOR < 5 p.SetPosition(Vx, Vy); list.push_back(p); p.SetPosition(Vx - VyNorm * 5, Vy + VxNorm * 5); list.push_back(p); +#else + p.SetPositionInObjectSpace(Vx, Vy); + list.push_back(p); + p.SetPositionInObjectSpace(Vx - VyNorm * 5, Vy + VxNorm * 5); + list.push_back(p); +#endif } // end if(teta>0) // Create a Line Spatial Object diff --git a/Modules/Feature/Edge/include/otbLocalHoughFilter.h b/Modules/Feature/Edge/include/otbLocalHoughFilter.h index 42a2327ad7..ac3dcc89e9 100644 --- a/Modules/Feature/Edge/include/otbLocalHoughFilter.h +++ b/Modules/Feature/Edge/include/otbLocalHoughFilter.h @@ -69,8 +69,12 @@ public: typedef typename LinesListType::LineType LineType; typedef typename LineType::Pointer LinePointer; - typedef typename LineType::PointListType PointListType; typedef typename LineType::LinePointType LinePointType; +#if ITK_VERSION_MAJOR < 5 + typedef typename LineType::PointListType PointListType; +#else + typedef typename LineType::LinePointListType PointListType; +#endif /** Extract dimensions as well of the images of entry of exit. */ itkStaticConstMacro(InputImageDimension, diff --git a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx index 95a1c90a1c..46b795dfcd 100644 --- a/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx +++ b/Modules/Feature/Edge/include/otbLocalHoughFilter.hxx @@ -52,6 +52,7 @@ LinePointResearch(LineIterator itLines, InputImageType *image, IndexType origin) PointListType& pointsList = (*itLines)->GetPoints(); typename PointListType::const_iterator itPoints = pointsList.begin(); +#if ITK_VERSION_MAJOR < 5 double u[2]; u[0] = (*itPoints).GetPosition()[0]; u[1] = (*itPoints).GetPosition()[1]; @@ -59,7 +60,16 @@ LinePointResearch(LineIterator itLines, InputImageType *image, IndexType origin) double v[2]; v[0] = u[0] - (*itPoints).GetPosition()[0]; v[1] = u[1] - (*itPoints).GetPosition()[1]; - +#else + double u[2]; + u[0] = (*itPoints).GetPositionInObjectSpace()[0]; + u[1] = (*itPoints).GetPositionInObjectSpace()[1]; + ++itPoints; + double v[2]; + v[0] = u[0] - (*itPoints).GetPositionInObjectSpace()[0]; + v[1] = u[1] - (*itPoints).GetPositionInObjectSpace()[1]; +#endif + double norm = std::sqrt(v[0] * v[0] + v[1] * v[1]); v[0] /= norm; v[1] /= norm; @@ -99,7 +109,11 @@ LinePointResearch(LineIterator itLines, InputImageType *image, IndexType origin) ((region.IsInside(localIndex)) && (!region.IsInside(nextIndex)))) { +#if ITK_VERSION_MAJOR < 5 point.SetPosition(localIndex[0] + origin[0], localIndex[1] + origin[1]); +#else + point.SetPositionInObjectSpace(localIndex[0] + origin[0], localIndex[1] + origin[1]); +#endif ptList.push_back(point); } diff --git a/Modules/Feature/Edge/include/otbPersistentVectorizationImageFilter.hxx b/Modules/Feature/Edge/include/otbPersistentVectorizationImageFilter.hxx index a91f9a4b0f..725010a535 100644 --- a/Modules/Feature/Edge/include/otbPersistentVectorizationImageFilter.hxx +++ b/Modules/Feature/Edge/include/otbPersistentVectorizationImageFilter.hxx @@ -58,14 +58,22 @@ PersistentVectorizationImageFilter { // Compute the min max and handle mini-pipeline m_MinMaxFilter->SetInput(this->GetInput()); +#if ITK_VERSION_MAJOR < 5 m_MinMaxFilter->GraftOutput(this->GetOutput()); m_MinMaxFilter->Update(); this->GraftOutput(m_MinMaxFilter->GetOutput()); +#else // MinMaxFilter does not produce an output in ITK5 + m_MinMaxFilter->Update(); +#endif for (PixelType label = m_MinMaxFilter->GetMinimum() + 1; label <= m_MinMaxFilter->GetMaximum(); ++label) { ImageToEdgePathFilterPointerType edgeFilter = ImageToEdgePathFilterType::New(); +#if ITK_VERSION_MAJOR < 5 edgeFilter->SetInput(m_MinMaxFilter->GetOutput()); +#else // MinMaxFilter does not produce an output in ITK5 + edgeFilter->SetInput(this->GetInput()); +#endif edgeFilter->SetForegroundValue(label); edgeFilter->Update(); m_PathList->PushBack(edgeFilter->GetOutput()); diff --git a/Modules/Feature/Edge/src/otbFillGapsFilter.cxx b/Modules/Feature/Edge/src/otbFillGapsFilter.cxx index 63bbb863b5..ebf62e525d 100644 --- a/Modules/Feature/Edge/src/otbFillGapsFilter.cxx +++ b/Modules/Feature/Edge/src/otbFillGapsFilter.cxx @@ -104,20 +104,37 @@ FillGapsFilter PointListType& pointsList = (*itLineListA)->GetPoints(); itPoints = pointsList.begin(); +#if ITK_VERSION_MAJOR < 5 x1 = (*itPoints).GetPosition()[0]; y1 = (*itPoints).GetPosition()[1]; +#else + x1 = (*itPoints).GetPositionInObjectSpace()[0]; + y1 = (*itPoints).GetPositionInObjectSpace()[1]; +#endif ++itPoints; +#if ITK_VERSION_MAJOR < 5 x2 = (*itPoints).GetPosition()[0]; y2 = (*itPoints).GetPosition()[1]; +#else + x2 = (*itPoints).GetPositionInObjectSpace()[0]; + y2 = (*itPoints).GetPositionInObjectSpace()[1]; +#endif PointType point; PointListType pointList; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(x1, y1); pointList.push_back(point); point.SetPosition(x2, y2); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(x1, y1); + pointList.push_back(point); + point.SetPositionInObjectSpace(x2, y2); + pointList.push_back(point); +#endif LineSpatialObjectType::Pointer line = LineSpatialObjectType::New(); line->SetId(0); @@ -131,13 +148,21 @@ FillGapsFilter pointsList = (*itLineListB)->GetPoints(); itPoints = pointsList.begin(); +#if ITK_VERSION_MAJOR < 5 x3 = (*itPoints).GetPosition()[0]; y3 = (*itPoints).GetPosition()[1]; ++itPoints; x4 = (*itPoints).GetPosition()[0]; y4 = (*itPoints).GetPosition()[1]; +#else + x3 = (*itPoints).GetPositionInObjectSpace()[0]; + y3 = (*itPoints).GetPositionInObjectSpace()[1]; + ++itPoints; + x4 = (*itPoints).GetPositionInObjectSpace()[0]; + y4 = (*itPoints).GetPositionInObjectSpace()[1]; +#endif // Calculate the radius for each point of each line R13 = std::sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3)); @@ -215,10 +240,17 @@ FillGapsFilter PointType ppoint; PointListType ppointList; +#if ITK_VERSION_MAJOR < 5 ppoint.SetPosition(x2, y2); ppointList.push_back(ppoint); ppoint.SetPosition(x3, y3); ppointList.push_back(ppoint); +#else + ppoint.SetPositionInObjectSpace(x2, y2); + ppointList.push_back(ppoint); + ppoint.SetPositionInObjectSpace(x3, y3); + ppointList.push_back(ppoint); +#endif LineSpatialObjectType::Pointer lline = LineSpatialObjectType::New(); lline->SetId(0); @@ -241,10 +273,17 @@ FillGapsFilter PointType point; PointListType pointList; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(x3, y3); pointList.push_back(point); point.SetPosition(x4, y4); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(x3, y3); + pointList.push_back(point); + point.SetPositionInObjectSpace(x4, y4); + pointList.push_back(point); +#endif LineSpatialObjectType::Pointer line = LineSpatialObjectType::New(); line->SetId(0); diff --git a/Modules/Feature/Edge/test/otbFillGapsFilter.cxx b/Modules/Feature/Edge/test/otbFillGapsFilter.cxx index 17c7a02158..7e6db50527 100644 --- a/Modules/Feature/Edge/test/otbFillGapsFilter.cxx +++ b/Modules/Feature/Edge/test/otbFillGapsFilter.cxx @@ -62,7 +62,12 @@ int otbFillGapsFilter(int itkNotUsed(argc), char * argv[]) LinesListType::Pointer linesListBeforeFillGaps = LinesListType::New(); const LinesListType * linesListAfterFillGaps; +#if ITK_VERSION_MAJOR < 5 LineType::PointListType pointList; +#else + LineType::LinePointListType pointList; +#endif + LineType::LinePointType point; // Definition of the first line @@ -71,11 +76,18 @@ int otbFillGapsFilter(int itkNotUsed(argc), char * argv[]) Uy = 10.; Vx = 10.; Vy = 20.; - + +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line = LineType::New(); line->SetId(0); @@ -92,11 +104,18 @@ int otbFillGapsFilter(int itkNotUsed(argc), char * argv[]) Uy = 30.; Vx = 10.; Vy = 50.; - + +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line2 = LineType::New(); line2->SetId(0); @@ -114,10 +133,17 @@ int otbFillGapsFilter(int itkNotUsed(argc), char * argv[]) Vx = 50.; Vy = 50.; +#if ITK_VERSION_MAJOR < 5 point.SetPosition(Ux, Uy); pointList.push_back(point); point.SetPosition(Vx, Vy); pointList.push_back(point); +#else + point.SetPositionInObjectSpace(Ux, Uy); + pointList.push_back(point); + point.SetPositionInObjectSpace(Vx, Vy); + pointList.push_back(point); +#endif LineType::Pointer line3 = LineType::New(); line3->SetId(0); diff --git a/Modules/Feature/Edge/test/otbLocalHough.cxx b/Modules/Feature/Edge/test/otbLocalHough.cxx index 5704ab1f3d..d1067f697c 100644 --- a/Modules/Feature/Edge/test/otbLocalHough.cxx +++ b/Modules/Feature/Edge/test/otbLocalHough.cxx @@ -75,11 +75,15 @@ int otbLocalHough(int itkNotUsed(argc), char* argv[]) std::ofstream outfile(outfname); outfile << "size of the Line list " << list->size() << std::endl; - +#if ITK_VERSION_MAJOR < 5 for (itList = list->begin(); itList != list->end(); itList++) outfile << (*itList)->GetPoints()[0].GetPosition() << " \t" << (*itList)->GetPoints()[1].GetPosition() << std::endl; - +#else + for (itList = list->begin(); itList != list->end(); itList++) + outfile << (*itList)->GetPoints()[0].GetPositionInObjectSpace() << " \t" << (*itList)->GetPoints()[1].GetPositionInObjectSpace() << + std::endl; +#endif outfile.close(); return EXIT_SUCCESS; -- GitLab From 2653d727de50bb31aee2841d2437c7cd2361261b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Mon, 24 Jun 2019 14:14:11 +0200 Subject: [PATCH 49/63] COMP: itk v5 compatibility for MPI modules --- Modules/MPI/MPIConfig/test/otbMPIConfigTest.cxx | 2 +- .../include/otbSimpleParallelTiffWriter.h | 11 +++++++++++ .../include/otbSimpleParallelTiffWriter.hxx | 16 ++++++++++++++++ .../MPIVrtWriter/test/otbMPIReadWriteTest.cxx | 13 ++++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Modules/MPI/MPIConfig/test/otbMPIConfigTest.cxx b/Modules/MPI/MPIConfig/test/otbMPIConfigTest.cxx index 4b62b69d02..30d94458d3 100644 --- a/Modules/MPI/MPIConfig/test/otbMPIConfigTest.cxx +++ b/Modules/MPI/MPIConfig/test/otbMPIConfigTest.cxx @@ -21,7 +21,7 @@ #include "otbMPIConfig.h" #include -#include "itkMultiThreader.h" +//#include "itkMultiThreader.h" int otbMPIConfigTest(int argc, char* argv[]) { diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h index 0fe5cb7ede..cff8735dfe 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h @@ -31,7 +31,13 @@ #include "itkImageFileWriter.h" #include "itkObjectFactoryBase.h" + + +#if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#else +#include +#endif #include "itkImageRegionMultidimensionalSplitter.h" #include "otbImageIOFactory.h" @@ -332,7 +338,12 @@ private: bool m_TiffTiledMode; /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ +#if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; +#else + mutable std::mutex m_Lock; +#endif + }; diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx index 0e132d6e90..b79ee77764 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx @@ -842,9 +842,17 @@ const bool & SimpleParallelTiffWriter ::GetAbortGenerateData() const { +#if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); +#else + m_Lock.lock(); +#endif bool ret = Superclass::GetAbortGenerateData(); +#if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); +#else + m_Lock.unlock(); +#endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -854,9 +862,17 @@ void SimpleParallelTiffWriter ::SetAbortGenerateData(bool val) { +#if ITK_VERSION_MAJOR < 5 m_Lock.Lock(); +#else + m_Lock.lock(); +#endif Superclass::SetAbortGenerateData(val); +#if ITK_VERSION_MAJOR < 5 m_Lock.Unlock(); +#else + m_Lock.unlock(); +#endif } } diff --git a/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx b/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx index aabdd0571c..f9ef5f376f 100644 --- a/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx +++ b/Modules/MPI/MPIVrtWriter/test/otbMPIReadWriteTest.cxx @@ -25,7 +25,13 @@ #include "otbImageFileReader.h" #include "otbMPIConfig.h" #include "otbMPIVrtWriter.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkMultiThreader.h" +#else +#include "itkMultiThreaderBase.h" +#endif + #include #include @@ -34,9 +40,14 @@ int otbMPIReadWriteTest(int argc, char * argv[]) { // Mono-thread execution +#if ITK_VERSION_MAJOR < 5 itk::MultiThreader::SetGlobalMaximumNumberOfThreads(1); itk::MultiThreader::SetGlobalDefaultNumberOfThreads(1); - +#else + itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads(1); + itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(1); +#endif + // MPI Initialization typedef otb::MPIConfig MPIConfigType; MPIConfigType::Pointer config = MPIConfigType::Instance(); -- GitLab From ab730d5e159e6fea353be667cfa5b9748274c6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Mon, 24 Jun 2019 17:16:07 +0200 Subject: [PATCH 50/63] ENH: update itk version in superbuild to 5.0.0 --- SuperBuild/CMake/External_itk.cmake | 4 ++-- SuperBuild/patches/ITK/itk-1-fftw-all.diff | 28 +++++++++------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/SuperBuild/CMake/External_itk.cmake b/SuperBuild/CMake/External_itk.cmake index c018ecc083..ecddc3e896 100644 --- a/SuperBuild/CMake/External_itk.cmake +++ b/SuperBuild/CMake/External_itk.cmake @@ -146,8 +146,8 @@ set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-${SB_ITK_VERSION_MAJOR}.${SB_ ExternalProject_Add(ITK PREFIX ITK - URL "https://github.com/InsightSoftwareConsortium/ITK/archive/v5.0b01.tar.gz" - URL_MD5 7b4f2259160e4708ec30b385973f9eca + URL "https://github.com/InsightSoftwareConsortium/ITK/archive/v5.0.0.tar.gz" + URL_MD5 5bc86a7daf30eb30d78f878f00a29920 SOURCE_DIR ${ITK_SB_SRC} BINARY_DIR ${ITK_SB_BUILD_DIR} INSTALL_DIR ${SB_INSTALL_PREFIX} diff --git a/SuperBuild/patches/ITK/itk-1-fftw-all.diff b/SuperBuild/patches/ITK/itk-1-fftw-all.diff index ad7ac7e8fe..343126d2c3 100644 --- a/SuperBuild/patches/ITK/itk-1-fftw-all.diff +++ b/SuperBuild/patches/ITK/itk-1-fftw-all.diff @@ -1,22 +1,16 @@ -diff -burN ITK-5.0b01.orig/CMake/FindFFTW.cmake ITK-5.0b01/CMake/FindFFTW.cmake ---- ITK-5.0b01.orig/CMake/FindFFTW.cmake Wed Oct 3 11:56:29 2018 -+++ ITK-5.0b01/CMake/FindFFTW.cmake Wed Oct 3 11:58:11 2018 -@@ -56,7 +56,7 @@ - ) +diff -burN ITK-5.0.0.orig/CMake/FindFFTW.cmake ITK-5.0.0/CMake/FindFFTW.cmake +--- ITK-5.0.0.orig/CMake/FindFFTW.cmake 2019-05-22 17:54:36.000000000 +0200 ++++ ITK-5.0.0/CMake/FindFFTW.cmake 2019-06-24 16:45:46.316235664 +0200 +@@ -59,7 +59,7 @@ + if(ITK_USE_CUFFTW) + find_path(CUFFTW_INCLUDE_PATH cufftw.h ${FFTW_INC_SEARCHPATH}) + else() +- find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) ++ find_path(FFTW_INCLUDE_PATH fftw3.h NO_DEFAULT_PATH) endif() -- find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) -+ find_path(FFTW_INCLUDE_PATH fftw3.h NO_DEFAULT_PATH) - if(FFTW_INCLUDE_PATH) - file(TO_CMAKE_PATH "${FFTW_INCLUDE_PATH}" FFTW_INCLUDE_PATH) -@@ -145,14 +145,11 @@ - get_filename_component(FFTW_INSTALL_BASE_PATH ${FFTW_INCLUDE_PATH} PATH) - set(FFTW_LIB_SEARCHPATH - ${FFTW_INSTALL_BASE_PATH}/lib -- ${FFTW_INSTALL_BASE_PATH}/lib64 -- /usr/lib/fftw -- /usr/local/lib/fftw +@@ -176,8 +176,8 @@ ) if(ITK_USE_FFTWD) mark_as_advanced(FFTWD_LIB) @@ -27,7 +21,7 @@ diff -burN ITK-5.0b01.orig/CMake/FindFFTW.cmake ITK-5.0b01/CMake/FindFFTW.cmake if(FFTWD_LIB) set(FFTWD_FOUND 1) -@@ -167,8 +164,8 @@ +@@ -192,8 +192,8 @@ if(ITK_USE_FFTWF) mark_as_advanced(FFTWF_LIB) -- GitLab From dc9ac245f7293e759fb22ecaa2959e1f86fab874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Tue, 25 Jun 2019 10:00:17 +0200 Subject: [PATCH 51/63] COMP: itk v5 compatibility for examples --- Examples/IO/DEMHandlerExample.cxx | 3 +++ Examples/Iterators/ImageSliceIteratorWithIndex.cxx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Examples/IO/DEMHandlerExample.cxx b/Examples/IO/DEMHandlerExample.cxx index a133e2eff4..4ce83de75a 100644 --- a/Examples/IO/DEMHandlerExample.cxx +++ b/Examples/IO/DEMHandlerExample.cxx @@ -34,6 +34,9 @@ // library. #include "otbDEMHandler.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif int main(int argc, char* argv[]) { diff --git a/Examples/Iterators/ImageSliceIteratorWithIndex.cxx b/Examples/Iterators/ImageSliceIteratorWithIndex.cxx index 66dbf8336a..6bc8eace46 100644 --- a/Examples/Iterators/ImageSliceIteratorWithIndex.cxx +++ b/Examples/Iterators/ImageSliceIteratorWithIndex.cxx @@ -102,6 +102,10 @@ #include "otbImageFileReader.h" #include "otbImageFileWriter.h" +#if ITK_VERSION_MAJOR >= 5 +#include "vcl_legacy_aliases.h" // ITK v5 compatibility +#endif + int main(int argc, char* argv[]) { // Verify the number of parameters on the command line. -- GitLab From 6005a9b01629a5f1385584d7c945e56b669c217c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Tue, 25 Jun 2019 11:37:37 +0200 Subject: [PATCH 52/63] ENH: replace mutex lock and unlock by lock guard (std) and MutexLockHolder (itk) --- .../otbImageRegionAdaptativeSplitter.h | 7 +++-- .../otbImageRegionAdaptativeSplitter.hxx | 30 +++++++------------ .../include/otbStreamingImageVirtualWriter.h | 9 +++--- .../otbStreamingImageVirtualWriter.hxx | 30 +++++++------------ .../IO/ImageIO/include/otbImageFileWriter.h | 7 +++-- .../IO/ImageIO/include/otbImageFileWriter.hxx | 30 +++++++------------ .../include/otbSimpleParallelTiffWriter.h | 1 + .../include/otbSimpleParallelTiffWriter.hxx | 18 +++-------- 8 files changed, 48 insertions(+), 84 deletions(-) diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h index 5416df92e8..2e8c18bdba 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.h @@ -29,6 +29,7 @@ #if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#include "itkMutexLockHolder.h" #else #include #endif @@ -181,11 +182,11 @@ private: mutable bool m_IsUpToDate; // Lock to ensure thread-safety - #if ITK_VERSION_MAJOR < 5 +#if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; - #else +#else std::mutex m_Lock; - #endif +#endif }; } // end namespace otb diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx index b461878624..f4f8bc0079 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx @@ -41,21 +41,16 @@ ImageRegionAdaptativeSplitter this->SetRequestedNumberOfSplits(requestedNumber); // Check if we need to compute split map agagin - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif if(!m_IsUpToDate) { // Do so if we need to this->EstimateSplitMap(); } - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif // Return the size of the split map return m_StreamVector.size(); @@ -70,21 +65,16 @@ ImageRegionAdaptativeSplitter this->SetImageRegion(region); // Check if we need to compute split map agagin - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif if(!m_IsUpToDate) { // Do so if we need to this->EstimateSplitMap(); } - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif // Return the requested split return m_StreamVector.at(i); diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h index fd275c5c36..82e4876e17 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h @@ -27,6 +27,7 @@ #if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#include "itkMutexLockHolder.h" #else #include #endif @@ -199,11 +200,11 @@ private: unsigned long m_ObserverID; /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ - #if ITK_VERSION_MAJOR < 5 +#if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; - #else - mutable std::mutex m_Lock; - #endif +#else + std::mutex m_Lock; +#endif }; } // end namespace otb diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx index 0971e1fd2f..b70a5ddba0 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx @@ -300,17 +300,12 @@ const bool & StreamingImageVirtualWriter ::GetAbortGenerateData() const { - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif bool ret = Superclass::GetAbortGenerateData(); - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -320,17 +315,12 @@ void StreamingImageVirtualWriter ::SetAbortGenerateData(bool val) { - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif Superclass::SetAbortGenerateData(val); - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif } } // end namespace otb diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.h b/Modules/IO/ImageIO/include/otbImageFileWriter.h index 595651cf26..960c551508 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.h +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.h @@ -27,6 +27,7 @@ #include "otbExtendedFilenameToWriterOptions.h" #if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#include "itkMutexLockHolder.h" #else #include #endif @@ -286,11 +287,11 @@ private: unsigned int m_IOComponents; /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ - #if ITK_VERSION_MAJOR < 5 +#if ITK_VERSION_MAJOR < 5 itk::SimpleFastMutexLock m_Lock; - #else +#else mutable std::mutex m_Lock; - #endif +#endif }; } // end namespace otb diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx index c2464a1eda..3d9cdffebf 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx @@ -850,18 +850,13 @@ const bool & ImageFileWriter ::GetAbortGenerateData() const { - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif // protected read here bool ret = Superclass::GetAbortGenerateData(); - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -871,17 +866,12 @@ void ImageFileWriter ::SetAbortGenerateData(bool val) { - #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); - #else - m_Lock.lock(); - #endif +#if ITK_VERSION_MAJOR < 5 + itk::MutexLockHolder mutexHolder(m_Lock); +#else + std::lock_guard mutexHolder(m_Lock); +#endif Superclass::SetAbortGenerateData(val); - #if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); - #else - m_Lock.unlock(); - #endif } } // end namespace otb diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h index cff8735dfe..89e95716ee 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h @@ -35,6 +35,7 @@ #if ITK_VERSION_MAJOR < 5 #include "itkFastMutexLock.h" +#include "itkMutexLockHolder.h" #else #include #endif diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx index b79ee77764..21e1de48e7 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx @@ -843,16 +843,11 @@ SimpleParallelTiffWriter ::GetAbortGenerateData() const { #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); + itk::MutexLockHolder mutexHolder(m_Lock); #else - m_Lock.lock(); + std::lock_guard mutexHolder(m_Lock); #endif bool ret = Superclass::GetAbortGenerateData(); -#if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); -#else - m_Lock.unlock(); -#endif if (ret) return otb::Utils::TrueConstant; return otb::Utils::FalseConstant; } @@ -863,16 +858,11 @@ SimpleParallelTiffWriter ::SetAbortGenerateData(bool val) { #if ITK_VERSION_MAJOR < 5 - m_Lock.Lock(); + itk::MutexLockHolder mutexHolder(m_Lock); #else - m_Lock.lock(); + std::lock_guard mutexHolder(m_Lock); #endif Superclass::SetAbortGenerateData(val); -#if ITK_VERSION_MAJOR < 5 - m_Lock.Unlock(); -#else - m_Lock.unlock(); -#endif } } -- GitLab From 1afd8560224a1433657818fd13011f752784aaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Tue, 25 Jun 2019 11:56:54 +0200 Subject: [PATCH 53/63] DOC: typo --- Modules/Core/Common/include/otbCastImageFilter.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Core/Common/include/otbCastImageFilter.hxx b/Modules/Core/Common/include/otbCastImageFilter.hxx index 8881f0046b..75c16faa69 100644 --- a/Modules/Core/Common/include/otbCastImageFilter.hxx +++ b/Modules/Core/Common/include/otbCastImageFilter.hxx @@ -73,7 +73,7 @@ CastImageFilter< TInputImage, TOutputImage > } // Set the output image largest possible region. Use a RegionCopier - // so that the input and output images can be different dimensions. + // so that the input and output images can have different dimensions. OutputImageRegionType outputLargestPossibleRegion; this->CallCopyInputRegionToOutputRegion( outputLargestPossibleRegion, inputPtr->GetLargestPossibleRegion() ); -- GitLab From 4ad78a4cabd13619948f596e6a077941d8207d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Tue, 25 Jun 2019 11:58:13 +0200 Subject: [PATCH 54/63] STY: remove extra indent --- Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx index a5b71573df..76c1cb7ab1 100644 --- a/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx +++ b/Modules/Filtering/Contrast/include/otbComputeGainLutFilter.hxx @@ -35,7 +35,7 @@ ComputeGainLutFilter < TInputImage , TOutputImage > ::ComputeGainLutFilter() { OTB_DISABLE_DYNAMIC_MT; - m_NbBin = 256; + m_NbBin = 256; m_NbPixel = 0; m_Min = std::numeric_limits< double >::quiet_NaN(); m_Max = std::numeric_limits< double >::quiet_NaN(); -- GitLab From e236d64e6dc185ad07281f79160969166031f6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Tue, 25 Jun 2019 15:23:15 +0200 Subject: [PATCH 55/63] BUG: template itk mutex lock holders on simpleFastMutexLock instead of simpleMutexLock --- .../Core/Common/include/otbImageRegionAdaptativeSplitter.hxx | 4 ++-- .../Core/Streaming/include/otbStreamingImageVirtualWriter.hxx | 4 ++-- Modules/IO/ImageIO/include/otbImageFileWriter.h | 2 +- Modules/IO/ImageIO/include/otbImageFileWriter.hxx | 4 ++-- .../MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h | 2 +- .../MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx index f4f8bc0079..da1876ecc0 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.hxx @@ -42,7 +42,7 @@ ImageRegionAdaptativeSplitter // Check if we need to compute split map agagin #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif @@ -66,7 +66,7 @@ ImageRegionAdaptativeSplitter // Check if we need to compute split map agagin #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx index b70a5ddba0..8850082892 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.hxx @@ -301,7 +301,7 @@ StreamingImageVirtualWriter ::GetAbortGenerateData() const { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif @@ -316,7 +316,7 @@ StreamingImageVirtualWriter ::SetAbortGenerateData(bool val) { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.h b/Modules/IO/ImageIO/include/otbImageFileWriter.h index 960c551508..a54b64e828 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.h +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.h @@ -288,7 +288,7 @@ private: /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ #if ITK_VERSION_MAJOR < 5 - itk::SimpleFastMutexLock m_Lock; + mutable itk::SimpleFastMutexLock m_Lock; #else mutable std::mutex m_Lock; #endif diff --git a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx index 3d9cdffebf..6d993dabe6 100644 --- a/Modules/IO/ImageIO/include/otbImageFileWriter.hxx +++ b/Modules/IO/ImageIO/include/otbImageFileWriter.hxx @@ -851,7 +851,7 @@ ImageFileWriter ::GetAbortGenerateData() const { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif @@ -867,7 +867,7 @@ ImageFileWriter ::SetAbortGenerateData(bool val) { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h index 89e95716ee..dd7293e876 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.h @@ -340,7 +340,7 @@ private: /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ #if ITK_VERSION_MAJOR < 5 - itk::SimpleFastMutexLock m_Lock; + mutable itk::SimpleFastMutexLock m_Lock; #else mutable std::mutex m_Lock; #endif diff --git a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx index 21e1de48e7..3a7f131f0c 100644 --- a/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx +++ b/Modules/MPI/MPITiffWriter/include/otbSimpleParallelTiffWriter.hxx @@ -843,7 +843,7 @@ SimpleParallelTiffWriter ::GetAbortGenerateData() const { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif @@ -858,7 +858,7 @@ SimpleParallelTiffWriter ::SetAbortGenerateData(bool val) { #if ITK_VERSION_MAJOR < 5 - itk::MutexLockHolder mutexHolder(m_Lock); + itk::MutexLockHolder mutexHolder(m_Lock); #else std::lock_guard mutexHolder(m_Lock); #endif -- GitLab From 5150d4c5b445e11ed3d42f12dc5f0a54306bad33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Wed, 26 Jun 2019 10:24:43 +0200 Subject: [PATCH 56/63] COMP: various fixes for itk4 compatibility --- .../Streaming/include/otbStreamingImageVirtualWriter.h | 4 ++-- .../include/otbJoinHistogramMIImageFilter.h | 7 +++++-- Modules/IO/Carto/include/otbCoordinateToName.h | 8 ++++++++ Modules/IO/Carto/src/otbCoordinateToName.cxx | 5 +++++ .../src/otbWrapperApplicationRegistry.cxx | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h index 82e4876e17..90f76e742a 100644 --- a/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h +++ b/Modules/Core/Streaming/include/otbStreamingImageVirtualWriter.h @@ -201,9 +201,9 @@ private: /** Lock to ensure thread-safety (added for the AbortGenerateData flag) */ #if ITK_VERSION_MAJOR < 5 - itk::SimpleFastMutexLock m_Lock; + mutable itk::SimpleFastMutexLock m_Lock; #else - std::mutex m_Lock; + mutable std::mutex m_Lock; #endif }; diff --git a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h index 87d022233e..aeb1f8f475 100644 --- a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h @@ -83,8 +83,11 @@ public: itkTypeMacro(JoinHistogramMIImageFilter, SuperClass); protected: - JoinHistogramMIImageFilter() { -OTB_DISABLE_DYNAMIC_MT; + JoinHistogramMIImageFilter() + { +#if ITK_VERSION_MAJOR < 5 + OTB_DISABLE_DYNAMIC_MT; +#endif } ~JoinHistogramMIImageFilter() override {} diff --git a/Modules/IO/Carto/include/otbCoordinateToName.h b/Modules/IO/Carto/include/otbCoordinateToName.h index 50600f8aa3..e3b982670b 100644 --- a/Modules/IO/Carto/include/otbCoordinateToName.h +++ b/Modules/IO/Carto/include/otbCoordinateToName.h @@ -72,7 +72,11 @@ public: itkSetMacro(Lon, double); itkSetMacro(Lat, double); + #if ITK_VERSION_MAJOR > 4 using PlatformMultiThreader = itk::PlatformMultiThreader; + #else + using PlatformMultiThreader = itk::MultiThreader; + #endif /** * Set the lon/lat only if they are far enough from the current point to @@ -136,7 +140,11 @@ protected: virtual void DoEvaluate(); +#if ITK_VERSION_MAJOR >= 5 static itk::ITK_THREAD_RETURN_TYPE ThreadFunction(void*); +#else + static ITK_THREAD_RETURN_TYPE ThreadFunction( void * ); +#endif private: CoordinateToName(const Self &) = delete; diff --git a/Modules/IO/Carto/src/otbCoordinateToName.cxx b/Modules/IO/Carto/src/otbCoordinateToName.cxx index 77fa2900de..4dde849334 100644 --- a/Modules/IO/Carto/src/otbCoordinateToName.cxx +++ b/Modules/IO/Carto/src/otbCoordinateToName.cxx @@ -91,7 +91,12 @@ bool CoordinateToName::Evaluate() return true; } + +#if ITK_VERSION_MAJOR >= 5 itk::ITK_THREAD_RETURN_TYPE +#else +ITK_THREAD_RETURN_TYPE +#endif CoordinateToName::ThreadFunction(void *arg) { #if ITK_VERSION_MAJOR < 5 diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx index 819377047b..3230105ede 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx @@ -130,7 +130,7 @@ private: AppHandleContainerType m_Container; #if ITK_VERSION_MAJOR < 5 - static itk::SimpleMutexLock m_Mutex; + itk::SimpleMutexLock m_Mutex; #else std::mutex m_Mutex; #endif -- GitLab From 98fe67c28da88326b489b993e283b6a0c11c4bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 28 Jun 2019 11:22:58 +0200 Subject: [PATCH 57/63] COMP: remove ENABLE_SHARED from otb edge after removal of spatial objects --- Modules/Feature/Edge/otb-module.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/Feature/Edge/otb-module.cmake b/Modules/Feature/Edge/otb-module.cmake index 6272dc4dbc..31ea006ba4 100644 --- a/Modules/Feature/Edge/otb-module.cmake +++ b/Modules/Feature/Edge/otb-module.cmake @@ -23,7 +23,6 @@ extraction. users can find classes that implement tools such as Sobel Detector, Line Ratio Detector (SAR images), Hough Transform, and so on.") otb_module(OTBEdge -ENABLE_SHARED DEPENDS OTBCommon OTBConversion -- GitLab From baa6b923c406b6f13c6cad7c891d748a673566be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 28 Jun 2019 11:24:25 +0200 Subject: [PATCH 58/63] COMP: use otb CastImageFilter in StereoReconstructionExample --- Examples/DisparityMap/StereoReconstructionExample.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Examples/DisparityMap/StereoReconstructionExample.cxx b/Examples/DisparityMap/StereoReconstructionExample.cxx index d553c5e107..4cd4963700 100644 --- a/Examples/DisparityMap/StereoReconstructionExample.cxx +++ b/Examples/DisparityMap/StereoReconstructionExample.cxx @@ -48,7 +48,13 @@ #include "otbImageFileWriter.h" #include "otbBCOInterpolateImageFunction.h" #include "itkUnaryFunctorImageFilter.h" + +#if ITK_VERSION_MAJOR < 5 #include "itkVectorCastImageFilter.h" +#else +#include "otbCastImageFilter.h" +#endif + #include "otbImageList.h" #include "otbImageListToVectorImageFilter.h" #include "itkRescaleIntensityImageFilter.h" @@ -93,7 +99,11 @@ int main(int argc, char* argv[]) using DisplacementType = itk::Vector; using DisplacementFieldType = otb::Image; +#if ITK_VERSION_MAJOR < 5 using DisplacementFieldCastFilterType = itk::VectorCastImageFilter; +#else + using DisplacementFieldCastFilterType = otb::CastImageFilter; +#endif using WarpFilterType = otb::StreamingWarpImageFilter; -- GitLab From 5b19407a0e11d15f2d360656f09ed4e4a6210c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 28 Jun 2019 14:54:31 +0200 Subject: [PATCH 59/63] TEST: add second baseline for watershed test (the itk filter produces different results in ITK5) --- .../OTB/Images/obTuWatershedSegmentationFilterLabelImage.1.tif | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Data/Baseline/OTB/Images/obTuWatershedSegmentationFilterLabelImage.1.tif diff --git a/Data/Baseline/OTB/Images/obTuWatershedSegmentationFilterLabelImage.1.tif b/Data/Baseline/OTB/Images/obTuWatershedSegmentationFilterLabelImage.1.tif new file mode 100644 index 0000000000..51d4c7edcf --- /dev/null +++ b/Data/Baseline/OTB/Images/obTuWatershedSegmentationFilterLabelImage.1.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49831ab756458243d99367e06884eab40737b9dd113ed09628bdc638a07705f2 +size 827613 -- GitLab From d67cbae020ca79eb6dd757a6c9338276792b8a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Fri, 28 Jun 2019 15:03:10 +0200 Subject: [PATCH 60/63] DOC: add CastImageFilter to OTBCommon group --- Modules/Core/Common/include/otbCastImageFilter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/Core/Common/include/otbCastImageFilter.h b/Modules/Core/Common/include/otbCastImageFilter.h index f436278574..4b3ad0d229 100644 --- a/Modules/Core/Common/include/otbCastImageFilter.h +++ b/Modules/Core/Common/include/otbCastImageFilter.h @@ -59,6 +59,7 @@ namespace otb * If you need to perform a dimensionaly reduction, you may want * to use the ExtractImageFilter instead of the CastImageFilter. * + * \ingroup OTBCommon */ template< typename TInputImage, typename TOutputImage > class ITK_TEMPLATE_EXPORT CastImageFilter: -- GitLab From 656c63fe6c4f55d15cf6fa59ed6d6771ba6b7621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Wed, 3 Jul 2019 16:40:28 +0200 Subject: [PATCH 61/63] COMP: add otbMacro header for OTB_DISABLE_DYNAMIC_MT --- .../ChangeDetection/include/otbJoinHistogramMIImageFilter.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h index aeb1f8f475..b507b8cb91 100644 --- a/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h +++ b/Modules/Filtering/ChangeDetection/include/otbJoinHistogramMIImageFilter.h @@ -23,6 +23,7 @@ #include "otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h" #include "otbJoinHistogramMI.h" +#include "otbMacro.h" //for OTB_DISABLE_DYNAMIC_MT; namespace otb { @@ -85,9 +86,7 @@ public: protected: JoinHistogramMIImageFilter() { -#if ITK_VERSION_MAJOR < 5 OTB_DISABLE_DYNAMIC_MT; -#endif } ~JoinHistogramMIImageFilter() override {} -- GitLab From aa0bbd11a8868f5ef2d2c8d510db968103cbb446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Wed, 10 Jul 2019 12:02:06 +0200 Subject: [PATCH 62/63] CI: remove windows ci builds temporarily --- .gitlab-ci.yml | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61478a057a..ab01963a6c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -168,52 +168,52 @@ macos-xdk-build: - git checkout -f -q %CI_COMMIT_SHA% # - Win10 -windows-10-prepare: - extends: .windows-prepare - tags: - - windows10 - script: - - call ./CI/dev_env.bat x64 xdk 10 - - clcache.exe -s - - ctest -C Release -V -S CI/prepare_superbuild.cmake - - clcache.exe -s +#~ windows-10-prepare: + #~ extends: .windows-prepare + #~ tags: + #~ - windows10 + #~ script: + #~ - call ./CI/dev_env.bat x64 xdk 10 + #~ - clcache.exe -s + #~ - ctest -C Release -V -S CI/prepare_superbuild.cmake + #~ - clcache.exe -s -windows-10-build: - extends: .windows-build - tags: - - windows10 - script: - - call ./CI/dev_env.bat x64 otb 10 - - clcache.exe -s - - ctest -V -S CI/main_superbuild.cmake - - clcache.exe -s - - ctest -V -S CI/main_packages.cmake - dependencies: - - windows-10-prepare +#~ windows-10-build: + #~ extends: .windows-build + #~ tags: + #~ - windows10 + #~ script: + #~ - call ./CI/dev_env.bat x64 otb 10 + #~ - clcache.exe -s + #~ - ctest -V -S CI/main_superbuild.cmake + #~ - clcache.exe -s + #~ - ctest -V -S CI/main_packages.cmake + #~ dependencies: + #~ - windows-10-prepare # - Win8.1 -windows-8-prepare: - extends: .windows-prepare - tags: - - windows8 - script: - - call ./CI/dev_env.bat x86 xdk 8.1 - - clcache.exe -s - - ctest -C Release -V -S CI/prepare_superbuild.cmake - - clcache.exe -s +#~ windows-8-prepare: + #~ extends: .windows-prepare + #~ tags: + #~ - windows8 + #~ script: + #~ - call ./CI/dev_env.bat x86 xdk 8.1 + #~ - clcache.exe -s + #~ - ctest -C Release -V -S CI/prepare_superbuild.cmake + #~ - clcache.exe -s -windows-8-build: - extends: .windows-build - tags: - - windows8 - script: - - call ./CI/dev_env.bat x86 otb 8.1 - - clcache.exe -s - - ctest -V -S CI/main_superbuild.cmake - - clcache.exe -s - - ctest -V -S CI/main_packages.cmake - dependencies: - - windows-8-prepare +#~ windows-8-build: + #~ extends: .windows-build + #~ tags: + #~ - windows8 + #~ script: + #~ - call ./CI/dev_env.bat x86 otb 8.1 + #~ - clcache.exe -s + #~ - ctest -V -S CI/main_superbuild.cmake + #~ - clcache.exe -s + #~ - ctest -V -S CI/main_packages.cmake + #~ dependencies: + #~ - windows-8-prepare #------------------------- QA related jobs ------------------------------------- ubuntu-xdk-qa-code-coverage: -- GitLab From 29fd60ce4be9858bf3e927baa68bceb74933ae5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= Date: Wed, 10 Jul 2019 13:12:05 +0200 Subject: [PATCH 63/63] CI: remove windows ci builds temporarily --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab01963a6c..034c32ab08 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -289,8 +289,8 @@ deploy: - ubuntu-xdk-build - centos-xdk-build - macos-xdk-build - - windows-8-build - - windows-10-build +# - windows-8-build +# - windows-10-build release-container: image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7 -- GitLab