From 38ace64065e791b5ffbaceab607bd988b7d7242a Mon Sep 17 00:00:00 2001 From: OTB Bot <otbbot@orfeo-toolbox.org> Date: Wed, 7 Jul 2010 14:49:06 +0800 Subject: [PATCH] STYLE --- .../otbBSplineDecompositionImageFilter.txx | 66 +- .../otbBSplineInterpolateImageFunction.h | 14 +- .../otbBSplineInterpolateImageFunction.txx | 340 +++---- .../otbBinaryImageDensityFunction.h | 4 +- Code/BasicFilters/otbChangeLabelImageFilter.h | 12 +- Code/BasicFilters/otbConvolutionImageFilter.h | 4 +- Code/BasicFilters/otbEdgeDensityImageFilter.h | 4 +- Code/BasicFilters/otbHillShadingFilter.h | 8 +- Code/BasicFilters/otbHillShadingFunctor.h | 4 +- .../otbImageAndVectorImageOperationFilter.h | 68 +- .../otbImageListToImageListApplyFilter.h | 4 +- .../otbImageListToVectorImageFilter.h | 2 +- .../BasicFilters/otbImageToPointSetFilter.txx | 2 +- .../otbImportVectorImageFilter.txx | 3 +- .../otbInnerProductPCAImageFilter.h | 2 +- .../otbInnerProductPCAImageFilter.txx | 3 +- ...tbLabelizeConfidenceConnectedImageFilter.h | 10 +- ...otbLabelizeConnectedThresholdImageFilter.h | 10 +- ...LabelizeNeighborhoodConnectedImageFilter.h | 10 +- .../otbListSampleToHistogramListGenerator.h | 6 +- .../otbListSampleToHistogramListGenerator.txx | 24 +- ...pleToVariableDimensionHistogramGenerator.h | 6 +- ...eToVariableDimensionHistogramGenerator.txx | 24 +- Code/BasicFilters/otbMeanShiftImageFilter.h | 4 +- Code/BasicFilters/otbMeanShiftImageFilter.txx | 4 +- .../otbMeanShiftVectorImageFilter.h | 2 +- .../otbOverlapSaveConvolutionImageFilter.h | 2 +- .../otbOverlapSaveConvolutionImageFilter.txx | 2 +- Code/BasicFilters/otbPointSetFunction.h | 2 +- .../otbPointSetToDensityImageFilter.h | 2 +- Code/BasicFilters/otbPrintableImageFilter.h | 4 +- .../otbProlateInterpolateImageFunction.h | 14 +- .../otbProlateInterpolateImageFunction.txx | 6 +- .../otbQuaternaryFunctorImageFilter.h | 4 +- .../otbQuaternaryFunctorImageFilter.txx | 14 +- ...StreamingInnerProductVectorImageFilter.txx | 20 +- ...eamingMatrixTransposeMatrixImageFilter.txx | 20 +- .../otbStreamingResampleImageFilter.h | 2 +- .../otbStreamingStatisticsImageFilter.txx | 38 +- ...tbStreamingStatisticsVectorImageFilter.txx | 36 +- .../otbVectorImageToAmplitudeImageFilter.h | 14 +- .../otbVectorImageToImageListFilter.h | 2 +- .../otbVectorRescaleIntensityImageFilter.h | 10 +- .../otbVectorRescaleIntensityImageFilter.txx | 4 +- ...owedSincInterpolateImageBlackmanFunction.h | 18 +- ...ndowedSincInterpolateImageCosineFunction.h | 18 +- ...WindowedSincInterpolateImageFunctionBase.h | 8 +- ...owedSincInterpolateImageGaussianFunction.h | 18 +- ...dowedSincInterpolateImageHammingFunction.h | 18 +- ...dowedSincInterpolateImageLanczosFunction.h | 18 +- ...indowedSincInterpolateImageWelchFunction.h | 18 +- ...ctorNeighborhoodJoinHistogramImageFilter.h | 4 +- ...orNeighborhoodJoinHistogramImageFilter.txx | 14 +- Code/ChangeDetection/otbCBAMI.h | 3 +- Code/ChangeDetection/otbCBAMIChangeDetector.h | 24 +- .../otbCorrelationChangeDetector.h | 26 +- Code/ChangeDetection/otbCrossCorrelation.h | 2 +- .../otbJoinHistogramMIImageFilter.h | 26 +- .../otbKullbackLeiblerDistanceImageFilter.h | 22 +- .../otbKullbackLeiblerProfileImageFilter.h | 22 +- ...backLeiblerSupervizedDistanceImageFilter.h | 34 +- ...ckLeiblerSupervizedDistanceImageFilter.txx | 4 +- Code/ChangeDetection/otbLHMIChangeDetector.h | 24 +- .../otbMeanDifferenceImageFilter.h | 24 +- .../ChangeDetection/otbMeanRatioImageFilter.h | 24 +- Code/Common/otbArcSpatialObject.txx | 24 +- .../otbAttributesMapOpeningLabelMapFilter.h | 6 +- .../otbBinaryFunctorNeighborhoodImageFilter.h | 2 +- ...tbBinaryFunctorNeighborhoodImageFilter.txx | 12 +- ...naryFunctorNeighborhoodVectorImageFilter.h | 2 +- ...ryFunctorNeighborhoodVectorImageFilter.txx | 8 +- Code/Common/otbCommandLineArgumentParser.cxx | 16 +- Code/Common/otbDataNode.h | 1 - Code/Common/otbDataNode.txx | 107 +- .../otbDrawLineSpatialObjectListFilter.txx | 24 +- Code/Common/otbExtractROIBase.h | 2 +- Code/Common/otbGISTable.h | 2 +- .../otbGenericInterpolateImageFunction.h | 2 +- Code/Common/otbImageRegionTileMapSplitter.txx | 7 +- Code/Common/otbImageToVectorImageCastFilter.h | 10 +- .../Common/otbLabelObjectToPolygonFunctor.txx | 438 ++++---- Code/Common/otbLineSpatialObject.txx | 12 +- Code/Common/otbObjectList.h | 24 +- Code/Common/otbPathFunction.h | 2 +- Code/Common/otbPathListToHistogramGenerator.h | 6 +- Code/Common/otbPointSetAndValuesFunction.h | 2 +- Code/Common/otbPolygon.txx | 2 +- Code/Common/otbPostGISTable.h | 24 +- .../otbRadiometricAttributesLabelMapFilter.h | 16 +- Code/Common/otbRectangle.txx | 6 +- Code/Common/otbRemoteSensingRegion.h | 10 +- .../Common/otbShapeAttributesLabelMapFilter.h | 8 +- Code/Common/otbShiftScaleImageAdaptor.h | 14 +- Code/Common/otbStandardFilterWatcher.cxx | 2 +- Code/Common/otbStandardFilterWatcher.h | 1 - .../otbStatisticsAttributesLabelMapFilter.h | 10 +- Code/Common/otbStreamingTraits.txx | 282 +++--- Code/Common/otbVectorDataExtractROI.txx | 164 +-- Code/Common/otbVectorDataProperties.txx | 134 +-- Code/Common/otbVectorDataToImageFilter.txx | 231 ++--- Code/Common/otbVectorDataToLabelMapFilter.txx | 206 ++-- Code/Common/otbVectorImageToASImageAdaptor.h | 8 +- Code/DisparityMap/otbNCCRegistrationFilter.h | 6 +- .../DisparityMap/otbNCCRegistrationFunction.h | 4 +- .../otbAngularSecondMomentumTextureFunctor.h | 2 +- .../otbAssociativeSymmetricalSumImageFilter.h | 18 +- ...symmetricFusionOfLineDetectorImageFilter.h | 12 +- .../otbCloudDetectionFilter.h | 2 +- .../otbCloudEstimatorFilter.h | 2 +- .../otbClusterProminenceTextureFunctor.h | 2 +- .../otbClusterShadeTextureFunctor.h | 2 +- .../otbCompacityPathFunction.h | 2 +- .../otbCompacityPathFunction.txx | 4 +- .../otbComplexMomentImageFunction.h | 6 +- .../otbComplexMomentPathFunction.h | 8 +- .../otbComplexMomentPathFunction.txx | 4 +- .../otbContrastTextureFunctor.h | 1 - .../otbEnergyTextureFunctor.h | 2 +- .../otbEntropyTextureFunctor.h | 1 - .../otbExtractSegmentsImageFilter.h | 2 +- .../otbFlusserImageFunction.h | 6 +- .../otbFlusserImageFunction.txx | 280 +++--- .../otbFlusserPathFunction.h | 4 +- .../otbFlusserPathFunction.txx | 280 +++--- ...ForwardFourierMellinTransformImageFilter.h | 6 +- .../otbGenericRoadExtractionFilter.h | 38 +- .../otbGeometricMomentImageFunction.h | 6 +- .../otbGeometricMomentPathFunction.h | 4 +- ...rixAdvancedTextureCoefficientsCalculator.h | 91 +- ...xAdvancedTextureCoefficientsCalculator.txx | 175 ++-- Code/FeatureExtraction/otbHarrisImageFilter.h | 8 +- .../otbHarrisImageToPointSetFilter.h | 4 +- .../otbHessianToScalarImageFilter.h | 18 +- Code/FeatureExtraction/otbHuImageFunction.h | 6 +- Code/FeatureExtraction/otbHuImageFunction.txx | 194 ++-- Code/FeatureExtraction/otbHuPathFunction.h | 4 +- Code/FeatureExtraction/otbHuPathFunction.txx | 194 ++-- .../otbImageToHessianDeterminantImageFilter.h | 2 +- ...otbImageToModulusAndDirectionImageFilter.h | 4 +- ...bImageToModulusAndDirectionImageFilter.txx | 6 +- .../otbImageToSIFTKeyPointSetFilter.h | 8 +- .../otbImageToSIFTKeyPointSetFilter.txx | 16 +- ...otbInverseDifferenceMomentTextureFunctor.h | 4 +- .../otbKeyPointSetsMatchingFilter.h | 6 +- .../otbLineCorrelationDetectorImageFilter.h | 10 +- .../otbLineDetectorImageFilterBase.h | 8 +- .../otbLineRatioDetectorImageFilter.h | 10 +- .../otbLineSegmentDetector.h | 8 +- ...mageToGreyLevelCoocurenceMatrixGenerator.h | 100 +- ...otbModulusAndDirectionImageToImageFilter.h | 4 +- ...bModulusAndDirectionImageToImageFilter.txx | 2 +- .../otbMultiplyByScalarImageFilter.h | 18 +- .../otbNeighborhoodScalarProductFilter.txx | 48 +- .../otbNonMaxRemovalByDirectionFilter.h | 56 +- .../otbOrientationPathFunction.h | 2 +- .../otbOrientationPathFunction.txx | 4 +- .../otbPanTexTextureImageFilter.h | 22 +- .../otbPanTexTextureImageFunctionFilter.h | 24 +- .../otbRealMomentImageFunction.h | 6 +- .../otbRealMomentPathFunction.h | 4 +- ...RegionImageToRectangularPathListFilter.txx | 12 +- .../otbRemoveIsolatedByDirectionFilter.h | 8 +- .../otbRemoveTortuousPathListFilter.h | 6 +- .../otbRemoveWrongDirectionFilter.h | 6 +- .../otbRoadExtractionFilter.h | 4 +- .../FeatureExtraction/otbSFSTexturesFunctor.h | 6 +- .../otbScalarImageToAdvancedTexturesFilter.h | 68 +- ...otbScalarImageToAdvancedTexturesFilter.txx | 188 ++-- .../otbScalarImageToPanTexTextureFilter.h | 70 +- .../otbScalarImageToPanTexTextureFilter.txx | 77 +- .../otbScalarImageToTexturesFilter.h | 66 +- .../otbScalarImageToTexturesFilter.txx | 174 ++-- .../otbSimplifyPathListFilter.h | 6 +- .../FeatureExtraction/otbTextureFunctorBase.h | 12 +- .../otbTextureImageFunction.h | 4 +- .../otbThresholdImageToPointSetFilter.h | 2 +- .../otbTouziEdgeDetectorImageFilter.h | 2 +- .../otbTouziEdgeDetectorImageFilter.txx | 2 +- .../otbUrbanAreaDetectionImageFilter.h | 24 +- .../otbVectorizationPathListFilter.txx | 654 ++++++------ Code/Fusion/otbBayesianFusionFilter.h | 48 +- Code/Fusion/otbBayesianFusionFilter.txx | 60 +- Code/Fusion/otbFusionImageBase.h | 14 +- ...bSimpleRcsPanSharpeningFusionImageFilter.h | 2 +- Code/GeospatialAnalysis/otbGISTableFunction.h | 12 +- .../otbTransactorGISTableFunction.h | 8 +- Code/IO/otbCoordinateToName.cxx | 2 +- Code/IO/otbCurlHelper.cxx | 69 +- Code/IO/otbCurlHelper.h | 9 +- Code/IO/otbDefaultImageMetadataInterface.h | 18 +- Code/IO/otbGDALImageIO.cxx | 6 +- Code/IO/otbIkonosImageMetadataInterface.cxx | 12 +- Code/IO/otbIkonosImageMetadataInterface.h | 2 +- Code/IO/otbImageFileReader.txx | 12 +- Code/IO/otbImageFileWriter.txx | 6 +- Code/IO/otbImageMetadataInterfaceBase.cxx | 92 +- Code/IO/otbImageMetadataInterfaceBase.h | 3 +- Code/IO/otbImageSeriesFileReaderBase.txx | 29 +- Code/IO/otbKMLVectorDataIO.txx | 508 +++++----- Code/IO/otbMSTARImageIO.cxx | 260 ++--- Code/IO/otbOGRIOHelper.txx | 941 +++++++++--------- .../IO/otbQuickBirdImageMetadataInterface.cxx | 17 +- Code/IO/otbQuickBirdImageMetadataInterface.h | 2 +- Code/IO/otbSpotImageMetadataInterface.cxx | 12 +- Code/IO/otbSpotImageMetadataInterface.h | 2 +- Code/IO/otbThreads.h | 2 +- Code/IO/otbTileMapImageIO.cxx | 81 +- Code/IO/otbTileMapImageIO.h | 2 +- Code/IO/otbVectorDataIOBase.txx | 14 +- Code/IO/otbVectorDataKeywordlist.cxx | 270 ++--- Code/IO/otbVectorImage.h | 2 +- .../otbWorldView2ImageMetadataInterface.cxx | 55 +- Code/IO/otbWorldView2ImageMetadataInterface.h | 9 +- ...bWorldView2ImageMetadataInterfaceFactory.h | 9 +- Code/Learning/otbConfusionMatrixCalculator.h | 60 +- .../Learning/otbConfusionMatrixCalculator.txx | 77 +- Code/Learning/otbListSampleGenerator.h | 92 +- Code/Learning/otbListSampleGenerator.txx | 128 +-- Code/Learning/otbPeriodicSOM.h | 8 +- Code/Learning/otbPeriodicSOM.txx | 4 +- Code/Learning/otbSEMClassifier.h | 4 +- Code/Learning/otbSEMClassifier.txx | 17 +- Code/Learning/otbSOM.h | 4 +- Code/Learning/otbSOM.txx | 32 +- Code/Learning/otbSOMMap.h | 4 +- Code/Learning/otbSOMWithMissingValue.h | 8 +- Code/Learning/otbSOMWithMissingValue.txx | 4 +- Code/Learning/otbSOMbasedImageFilter.h | 22 +- .../otbSVMCrossValidationCostFunction.txx | 86 +- .../otbSVMImageClassificationWithRuleFilter.h | 2 +- Code/Learning/otbSVMImageModelEstimator.h | 2 +- Code/Learning/otbSVMImageModelEstimator.txx | 9 +- Code/Learning/otbSVMKernels.h | 27 +- Code/Learning/otbSVMModelEstimator.h | 3 +- Code/Learning/otbSVMModelEstimator.txx | 126 +-- Code/Learning/otbSVMPointSetModelEstimator.h | 2 +- .../Learning/otbSVMPointSetModelEstimator.txx | 13 +- .../Learning/otbSVMSampleListModelEstimator.h | 6 +- .../otbSVMSampleListModelEstimator.txx | 13 +- Code/Markov/otbMRFEnergy.h | 2 +- .../otbConvexOrConcaveClassificationFilter.h | 10 +- ...odesicMorphologyDecompositionImageFilter.h | 12 +- ...phologyIterativeDecompositionImageFilter.h | 4 +- .../otbGeodesicMorphologyLevelingFilter.h | 16 +- .../otbMorphologicalClosingProfileFilter.h | 12 +- .../otbMorphologicalOpeningProfileFilter.h | 12 +- ...ScaleConvexOrConcaveClassificationFilter.h | 10 +- Code/MultiScale/otbSubsampleImageFilter.h | 2 +- Code/MultiScale/otbSubsampleImageFilter.txx | 82 +- Code/MultiScale/otbWaveletFilterBank.h | 4 +- Code/MultiScale/otbWaveletHighPassOperator.h | 28 +- Code/MultiScale/otbWaveletLowPassOperator.h | 28 +- Code/MultiScale/otbWaveletOperator.h | 14 +- Code/MultiScale/otbWaveletOperatorBase.h | 4 +- Code/MultiScale/otbWaveletOperatorBase.txx | 14 +- Code/MultiScale/otbWaveletPacketTransform.h | 6 +- Code/MultiScale/otbWaveletPacketTransform.txx | 12 +- Code/MultiScale/otbWaveletTransform.h | 2 +- Code/Projections/otbCompositeTransform.h | 16 +- Code/Projections/otbCompositeTransform.txx | 56 +- Code/Projections/otbForwardSensorModel.h | 12 +- .../otbGCPsToRPCSensorModelImageFilter.txx | 2 +- Code/Projections/otbGenericMapProjection.h | 14 +- Code/Projections/otbGenericMapProjection.txx | 86 +- Code/Projections/otbGenericRSTransform.h | 12 +- Code/Projections/otbGenericRSTransform.txx | 4 +- Code/Projections/otbGeocentricTransform.h | 14 +- Code/Projections/otbGeocentricTransform.txx | 36 +- .../otbGroundSpacingImageFunction.h | 22 +- .../otbGroundSpacingImageFunction.txx | 37 +- Code/Projections/otbInverseSensorModel.h | 12 +- .../otbLambertConformalConicMapProjection.h | 2 +- .../otbLeastSquareAffineTransformEstimator.h | 10 +- Code/Projections/otbMapProjection.h | 16 +- Code/Projections/otbMapProjection.txx | 130 +-- Code/Projections/otbMapToMapProjection.h | 16 +- Code/Projections/otbMapToMapProjection.txx | 56 +- .../Projections/otbOrthoRectificationFilter.h | 4 +- Code/Projections/otbSensorModelBase.h | 12 +- Code/Projections/otbSensorModelBase.txx | 36 +- Code/Projections/otbTileMapTransform.h | 12 +- Code/Projections/otbTileMapTransform.txx | 68 +- .../otbVectorDataProjectionFilter.h | 8 +- .../otbVectorDataProjectionFilter.txx | 162 +-- .../otbAtmosphericCorrectionParameters.cxx | 4 +- .../otbAtmosphericCorrectionParameters.h | 2 +- ...arametersTo6SAtmosphericRadiativeTerms.cxx | 2 +- .../otbAtmosphericRadiativeTerms.cxx | 20 +- .../otbDEMCaracteristicsExtractor.h | 4 +- Code/Radiometry/otbGAndRIndexImageFilter.h | 8 +- Code/Radiometry/otbGAndRIndexImageFilter.txx | 6 +- .../otbImageToLuminanceImageFilter.h | 19 +- .../otbImageToReflectanceImageFilter.h | 16 +- .../otbLuminanceToReflectanceImageFilter.h | 16 +- .../otbMultiChannelGAndRIndexImageFilter.h | 7 +- ...bMultiChannelRAndBAndNIRIndexImageFilter.h | 8 +- ...nelRAndBAndNIRVegetationIndexImageFilter.h | 10 +- ...bMultiChannelRAndGAndNIRIndexImageFilter.h | 9 +- ...nelRAndGAndNIRVegetationIndexImageFilter.h | 8 +- .../otbMultiChannelRAndNIRIndexImageFilter.h | 6 +- ...ChannelRAndNIRVegetationIndexImageFilter.h | 10 +- .../otbMultiChannelRadiometricImageFilter.h | 4 +- .../otbRAndBAndNIRIndexImageFilter.h | 14 +- .../otbRAndBAndNIRIndexImageFilter.txx | 8 +- ...otbRAndBAndNIRVegetationIndexImageFilter.h | 12 +- .../otbRAndGAndNIRIndexImageFilter.h | 14 +- .../otbRAndGAndNIRIndexImageFilter.txx | 8 +- ...otbRAndGAndNIRVegetationIndexImageFilter.h | 16 +- Code/Radiometry/otbRAndNIRIndexImageFilter.h | 8 +- .../Radiometry/otbRAndNIRIndexImageFilter.txx | 6 +- .../otbRAndNIRVegetationIndexImageFilter.h | 8 +- ...flectanceToSurfaceReflectanceImageFilter.h | 12 +- ...ectanceToSurfaceReflectanceImageFilter.txx | 17 +- Code/Radiometry/otbSoilIndicesFunctor.h | 2 +- ...eAdjacencyEffect6SCorrectionSchemeFilter.h | 18 +- ...djacencyEffect6SCorrectionSchemeFilter.txx | 4 +- .../otbTerraSarBrightnessImageFilter.h | 12 +- .../otbTerraSarCalibrationFunctor.txx | 7 +- .../otbTerraSarCalibrationImageFilter.h | 2 +- Code/Radiometry/otbVegetationIndicesFunctor.h | 14 +- Code/Radiometry/otbWaterIndicesFunctor.h | 5 - .../otbWaterSqrtSpectralAngleImageFilter.h | 8 +- ...MultiChannelsPolarimetricSynthesisFilter.h | 12 +- ...ltiChannelsPolarimetricSynthesisFilter.txx | 138 +-- Code/SARPolarimetry/otbPolarimetricData.cxx | 46 +- .../otbPolarimetricSynthesisFilter.h | 20 +- .../otbPolarimetricSynthesisFilter.txx | 369 +++---- .../otbImageToImageRCC8Calculator.txx | 8 +- Code/SpatialReasoning/otbRCC8Graph.h | 2 +- Code/Testing/otbTestHelper.cxx | 228 +++-- Code/Testing/otbTestMain.h | 10 +- Code/Visu/otbImageAlternateViewer.txx | 298 +++--- .../otbImageToGrayscaleAnaglyphImageFilter.h | 20 +- Code/Visu/otbImageViewerBase.h | 12 +- Code/Visu/otbImageViewerBase.txx | 260 ++--- Code/Visu/otbImageViewerFullWidget.h | 514 +++++----- ...ViewerHistogramAndTransferFunctionWidget.h | 160 +-- Code/Visu/otbImageViewerScrollWidget.h | 96 +- Code/Visu/otbImageViewerZoomWidget.h | 140 +-- Code/Visu/otbImageWidgetBase.txx | 82 +- ...torImageToColorAnaglyphVectorImageFilter.h | 20 +- Code/Visualization/otbAlphaBlendingFunction.h | 4 +- .../otbArrowKeyMoveActionHandler.h | 234 ++--- Code/Visualization/otbBlendingImageFilter.h | 22 +- .../Visualization/otbHistogramActionHandler.h | 100 +- Code/Visualization/otbImageLayer.h | 16 +- Code/Visualization/otbImageLayer.txx | 38 +- .../otbImageLayerRenderingModel.h | 2 +- .../otbMultiplyBlendingFunction.h | 4 +- .../otbPixelDescriptionActionHandler.h | 74 +- Code/Visualization/otbRenderingFunction.h | 8 +- Code/Visualization/otbRenderingImageFilter.h | 25 +- .../otbSelectAreaActionHandler.h | 54 +- .../otbStandardRenderingFunction.h | 23 +- .../otbUniformAlphaBlendingFunction.h | 4 +- .../otbVectorDataActionHandler.h | 65 +- .../otbVectorDataGlComponent.txx | 40 +- Code/Visualization/otbVectorDataModel.cxx | 14 +- Code/Visualization/otbVectorDataModel.h | 10 +- Examples/BasicFilters/DEMToRainbowExample.cxx | 9 +- Examples/BasicFilters/HillShadingExample.cxx | 12 +- Examples/BasicFilters/IndexedToRGBExample.cxx | 8 +- .../MeanShiftVectorImageFilterExample.cxx | 6 +- .../BasicFilters/ScalingFilterExample.cxx | 2 +- .../ChangeDetectionFrameworkExample.cxx | 28 +- Examples/ChangeDetection/CorrelChDet.cxx | 8 +- Examples/ChangeDetection/DiffChDet.cxx | 10 +- Examples/ChangeDetection/JHMIChDet.cxx | 8 +- .../KullbackLeiblerDistanceChDet.cxx | 6 +- .../KullbackLeiblerProfileChDet.cxx | 10 +- ...KullbackLeiblerSupervizedDistanceChDet.cxx | 5 +- Examples/ChangeDetection/LHMIChDet.cxx | 8 +- Examples/ChangeDetection/RatioChDet.cxx | 8 +- .../BayesianPluginClassifier.cxx | 6 +- ...ationMaximizationMixtureModelEstimator.cxx | 6 +- .../KdTreeBasedKMeansClustering.cxx | 8 +- .../SOMImageClassificationExample.cxx | 4 +- .../SVMImageClassifierExample.cxx | 2 +- .../ScalarImageKmeansModelEstimator.cxx | 2 +- .../ScalarImageMarkovRandomField1.cxx | 10 +- .../Image/ImageAdaptor2.cxx | 6 +- .../Image/ImageAdaptor3.cxx | 4 +- .../Image/ImageAdaptor4.cxx | 4 +- .../EstimateAffineTransformationExample.cxx | 4 +- .../NCCRegistrationFilterExample.cxx | 16 +- .../SIFTDisparityMapEstimation.cxx | 10 +- .../SimpleDisparityMapEstimationExample.cxx | 20 +- .../FeatureExtraction/AlignmentsExample.cxx | 2 +- ...AssymmetricFusionOfLineDetectorExample.cxx | 4 +- .../CloudDetectionExample.cxx | 14 +- .../ComplexMomentImageExample.cxx | 2 +- .../CorrelationLineDetectorExample.cxx | 4 +- .../FeatureExtraction/EdgeDensityExample.cxx | 2 +- .../ExtractRoadByStepsExample.cxx | 56 +- .../FeatureExtraction/ExtractRoadExample.cxx | 14 +- .../ExtractSegmentsByStepsExample.cxx | 10 +- .../ExtractSegmentsExample.cxx | 6 +- .../FlusserMomentImageExample.cxx | 2 +- Examples/FeatureExtraction/HarrisExample.cxx | 2 +- .../HuMomentImageExample.cxx | 2 +- .../InnerProductPCAExample.cxx | 6 +- .../LineSegmentDetectorExample.cxx | 4 +- .../FeatureExtraction/LocalHoughExample.cxx | 4 +- Examples/FeatureExtraction/PanTexExample.cxx | 14 +- .../RatioLineDetectorExample.cxx | 2 +- .../RightAngleDetectionExample.cxx | 12 +- Examples/FeatureExtraction/SFSExample.cxx | 6 +- Examples/FeatureExtraction/SIFTExample.cxx | 12 +- .../FeatureExtraction/SIFTFastExample.cxx | 12 +- Examples/FeatureExtraction/SURFExample.cxx | 12 +- .../ScaleInvariantFeatureImageFilter.cxx | 10 +- .../FeatureExtraction/SeamCarvingExample.cxx | 6 +- .../SeamCarvingOtherExample.cxx | 6 +- Examples/FeatureExtraction/TextureExample.cxx | 160 +-- .../TouziEdgeDetectorExample.cxx | 4 +- .../Filtering/BinaryThresholdImageFilter.cxx | 2 +- .../CannyEdgeDetectionImageFilter.cxx | 4 +- Examples/Filtering/CompositeFilterExample.cxx | 4 +- .../DanielssonDistanceMapImageFilter.cxx | 4 +- Examples/Filtering/DerivativeImageFilter.cxx | 6 +- .../Filtering/DiscreteGaussianImageFilter.cxx | 4 +- ...radientAnisotropicDiffusionImageFilter.cxx | 4 +- .../GradientMagnitudeImageFilter.cxx | 4 +- ...tMagnitudeRecursiveGaussianImageFilter.cxx | 4 +- ...LaplacianRecursiveGaussianImageFilter1.cxx | 8 +- ...LaplacianRecursiveGaussianImageFilter2.cxx | 2 +- .../MathematicalMorphologyBinaryFilters.cxx | 18 +- ...MathematicalMorphologyGrayscaleFilters.cxx | 16 +- Examples/Filtering/MeanImageFilter.cxx | 2 +- Examples/Filtering/MedianImageFilter.cxx | 2 +- ...DerivativeRecursiveGaussianImageFilter.cxx | 4 +- Examples/Fusion/BayesianFusionImageFilter.cxx | 22 +- Examples/Fusion/PanSharpeningExample.cxx | 16 +- Examples/IO/DEMToImageGenerator.cxx | 10 +- Examples/IO/DEMToOrthoImageGenerator.cxx | 12 +- Examples/IO/DXFReaderExample.cxx | 2 +- Examples/IO/ExtractROI.cxx | 4 +- Examples/IO/ImageReadCastWrite.cxx | 4 +- .../IO/ImageReadRegionOfInterestWrite.cxx | 2 +- Examples/IO/LidarToImageExample.cxx | 2 +- .../ImageLinearIteratorWithIndex2.cxx | 2 +- Examples/Iterators/NeighborhoodIterators1.cxx | 2 +- Examples/Iterators/NeighborhoodIterators2.cxx | 2 +- Examples/Iterators/NeighborhoodIterators3.cxx | 2 +- Examples/Iterators/NeighborhoodIterators4.cxx | 2 +- Examples/Iterators/NeighborhoodIterators5.cxx | 2 +- Examples/Iterators/NeighborhoodIterators6.cxx | 4 +- .../ShapedNeighborhoodIterators1.cxx | 6 +- .../ShapedNeighborhoodIterators2.cxx | 2 +- .../Learning/SEMModelEstimatorExample.cxx | 2 +- Examples/Learning/SOMExample.cxx | 18 +- ...enericKernelImageClassificationExample.cxx | 4 +- ...enericKernelImageModelEstimatorExample.cxx | 2 +- .../SVMImageClassificationExample.cxx | 4 +- ...ageEstimatorClassificationMultiExample.cxx | 8 +- .../SVMImageModelEstimatorExample.cxx | 2 +- .../SVMPointSetClassificationExample.cxx | 2 +- Examples/Learning/SVMPointSetExample.cxx | 4 +- .../SVMPointSetModelEstimatorExample.cxx | 2 +- .../Markov/MarkovClassification2Example.cxx | 2 +- .../Markov/MarkovRegularizationExample.cxx | 2 +- ...phologicalPyramidAnalysisFilterExample.cxx | 10 +- ...orphologicalPyramidSegmentationExample.cxx | 10 +- .../MorphologicalPyramidSegmenterExample.cxx | 6 +- ...hologicalPyramidSynthesisFilterExample.cxx | 10 +- Examples/OBIA/ImageToLabelToImage.cxx | 8 +- Examples/OBIA/KeepNObjects.cxx | 8 +- Examples/OBIA/LabelMapToVectorData.cxx | 18 +- ...ometricAttributesLabelMapFilterExample.cxx | 14 +- .../FuzzyConnectednessImageFilter.cxx | 12 +- .../HybridSegmentationFuzzyVoronoi.cxx | 12 +- .../EstimateRPCSensorModelExample.cxx | 2 +- .../Projections/OrthoRectificationExample.cxx | 6 +- .../VectorDataProjectionExample.cxx | 2 +- ...lRAndBAndNIRVegetationIndexImageFilter.cxx | 20 +- ...lRAndGAndNIRVegetationIndexImageFilter.cxx | 12 +- .../AtmosphericCorrectionSequencement.cxx | 6 +- .../NDVIRAndNIRVegetationIndexImageFilter.cxx | 24 +- Examples/Registration/ImageRegistration1.cxx | 34 +- Examples/Registration/ImageRegistration2.cxx | 34 +- Examples/Registration/ImageRegistration5.cxx | 24 +- Examples/Registration/ImageRegistration9.cxx | 44 +- ...ver4ExamplePolarimetricSynthesisFilter.cxx | 4 +- Examples/Segmentation/ConfidenceConnected.cxx | 2 +- .../ConnectedThresholdImageFilter.cxx | 2 +- .../Segmentation/FastMarchingImageFilter.cxx | 20 +- .../IsolatedConnectedImageFilter.cxx | 2 +- ...belizeNeighborhoodConnectedImageFilter.cxx | 6 +- .../NeighborhoodConnectedImageFilter.cxx | 2 +- .../OtsuMultipleThresholdImageFilter.cxx | 2 +- .../Segmentation/OtsuThresholdImageFilter.cxx | 2 +- .../Segmentation/WatershedSegmentation.cxx | 8 +- .../otbBasicApplicationController.h | 4 +- .../Model/otbBasicApplicationModel.h | 8 +- .../BasicApplication/otbBasicApplication.cxx | 3 +- Examples/Tutorials/OrthoFusion.cxx | 10 +- .../Tutorials/SmarterFilteringPipeline.cxx | 9 +- .../otbClosingOpeningMorphologicalFilter.cxx | 2 +- ...tbClosingOpeningMorphologicalFilterNew.cxx | 2 +- .../otbMatrixTransposeMatrixImageFilter.cxx | 2 +- ...otbMatrixTransposeMatrixImageFilterNew.cxx | 2 +- .../otbOpeningClosingMorphologicalFilter.cxx | 2 +- ...tbOpeningClosingMorphologicalFilterNew.cxx | 2 +- .../BasicFilters/otbPathLengthFunctor.cxx | 4 +- ...PointSetDensityEpanechnikovFunctionNew.cxx | 2 +- ...ointSetDensityEpanechnikovFunctionTest.cxx | 2 +- .../otbPointSetExtractROITest.cxx | 3 +- .../otbPolygonCompacityFunctor.cxx | 4 +- .../otbScalarImageTextureFunctor.cxx | 2 +- .../otbScalarImageTextureFunctorNew.cxx | 2 +- .../otbScalarToRainbowRGBPixelFunctor.cxx | 2 +- .../otbScalarToRainbowRGBPixelFunctorNew.cxx | 2 +- .../otbScalarVectorImageTextureFunctor.cxx | 4 +- .../otbScalarVectorImageTextureFunctorNew.cxx | 2 +- .../otbStreamingResampleImageFilter.cxx | 2 +- ...amingResampleImageFilterCompareWithITK.cxx | 4 +- .../otbStreamingResampleImageFilterNew.cxx | 2 +- .../otbTransformPointSetFilterTest.cxx | 6 +- .../otbUnaryFunctorImageFilterNew.cxx | 6 +- ...UnaryImageFunctorWithVectorImageFilter.cxx | 4 +- ...ryImageFunctorWithVectorImageFilterNew.cxx | 4 +- .../otbCBAMIChangeDetectionTest.cxx | 8 +- .../otbCorrelChangeDetectionTest.cxx | 8 +- .../otbJHMIChangeDetectionTest.cxx | 8 +- ...ckLeiblerSupervizedDistanceImageFilter.cxx | 2 +- ...eiblerSupervizedDistanceImageFilterNew.cxx | 6 +- .../otbLHMIChangeDetectionTest.cxx | 8 +- .../otbMeanDiffChangeDetectionTest.cxx | 8 +- .../otbMeanRatioChangeDetectionTest.cxx | 8 +- Testing/Code/Common/otbExtractROI.cxx | 2 +- Testing/Code/Common/otbExtractROI2.cxx | 2 +- Testing/Code/Common/otbExtractROI_RGB.cxx | 2 +- .../Common/otbGISTableToGISTableFilterNew.cxx | 4 +- .../otbGenericInterpolateImageFunctionNew.cxx | 2 +- ...neSpatialObjectListToPointSetFilterNew.cxx | 2 +- .../Code/Common/otbMultiChannelExtractROI.cxx | 56 +- .../Common/otbMultiChannelExtractROINew.cxx | 2 +- .../otbMultiToMonoChannelExtractROI.cxx | 199 ++-- .../otbMultiToMonoChannelExtractROINew.cxx | 2 +- Testing/Code/Common/otbRectangle.cxx | 3 +- .../Code/Common/otbRemoteSensingRegion.cxx | 3 +- ...otbUnaryFunctorNeighborhoodImageFilter.cxx | 2 +- ...UnaryFunctorNeighborhoodImageFilterNew.cxx | 2 +- ...nctorNeighborhoodWithOffsetImageFilter.cxx | 2 +- ...orNeighborhoodWithOffsetImageFilterNew.cxx | 8 +- .../otbUnaryFunctorWithIndexImageFilter.cxx | 2 +- ...otbUnaryFunctorWithIndexImageFilterNew.cxx | 2 +- ...enteredRigidDeformationFieldEstimation.cxx | 28 +- .../otbEuler2DDeformationFieldEstimation.cxx | 28 +- .../DisparityMap/otbNCCRegistrationFilter.cxx | 10 +- .../otbNCCRegistrationFilterNew.cxx | 6 +- ...bTranslationDeformationFieldEstimation.cxx | 28 +- .../otbAddCarvingPathFilterNew.cxx | 2 +- .../otbAssymmetricFusionOfLineDetector.cxx | 2 +- .../otbAssymmetricFusionOfLineDetectorNew.cxx | 2 +- .../otbFourierMellinImageFilter.cxx | 4 +- .../otbFourierMellinImageFilterNew.cxx | 2 +- ...xAdvancedTextureCoefficientsCalculator.cxx | 315 +++--- ...vancedTextureCoefficientsCalculatorNew.cxx | 7 +- .../otbHoughTransform2DLinesImageTest.cxx | 4 +- ...mageToSIFTKeyPointSetFilterDistanceMap.cxx | 5 +- .../otbLineCorrelationDetectorLinear.cxx | 4 +- .../otbLineRatioDetectorLinear.cxx | 4 +- ...alObjectListToRightAnglePointSetFilter.cxx | 2 +- ...tAnglePointSetFilterByStepsOutputAscii.cxx | 2 +- ...bjectListToRightAnglePointSetFilterNew.cxx | 2 +- .../otbModulusAndDirectionImageFiltersNew.cxx | 6 +- .../otbMultiplyByScalarImageTest.cxx | 4 +- .../otbRemoveCarvingPathFilterNew.cxx | 2 +- ...otbScalarImageToAdvancedTexturesFilter.cxx | 50 +- ...ScalarImageToAdvancedTexturesFilterNew.cxx | 6 +- .../otbScalarImageToPanTexTextureFilter.cxx | 26 +- ...otbScalarImageToPanTexTextureFilterNew.cxx | 6 +- .../otbScalarImageToTexturesFilter.cxx | 40 +- .../otbScalarImageToTexturesFilterNew.cxx | 6 +- .../otbTextureFunctorBase.cxx | 2 +- .../otbUrbanAreaDetectionImageFilter.cxx | 2 +- .../otbUrbanAreaDetectionImageFilterNew.cxx | 2 +- .../Code/Fusion/otbBayesianFusionFilter.cxx | 14 +- .../Fusion/otbBayesianFusionFilterNew.cxx | 12 +- Testing/Code/Fusion/otbFusionImageBaseNew.cxx | 16 +- Testing/Code/IO/otbImageFileReaderERS.cxx | 2 +- Testing/Code/IO/otbImageFileReaderMSTAR.cxx | 2 +- Testing/Code/IO/otbImageFileReaderONERA.cxx | 2 +- .../IO/otbImageFileReaderONERAComplex.cxx | 6 +- ...bImageFileReaderRADComplexFloatExtract.cxx | 2 +- ...otbImageFileReaderTestSensorPixelValue.cxx | 41 +- .../IO/otbImageFileWriterONERAComplex.cxx | 2 +- .../Code/IO/otbImageMetadataInterfaceTest.cxx | 13 +- Testing/Code/IO/otbTileMapWriter.cxx | 2 +- .../otbVectorDataFileWriterMultiPolygons.cxx | 12 +- .../otbConfusionMatrixCalculatorTest.cxx | 137 ++- .../Code/Learning/otbListSampleGenerator.cxx | 33 +- .../Learning/otbSOMWithMissingValueNew.cxx | 2 +- .../Code/Learning/otbSVMClassifierImage.cxx | 2 +- ...otbSVMImageModelEstimatorModelAccessor.cxx | 2 +- .../Learning/otbSVMImageModelEstimatorNew.cxx | 2 +- .../otbSVMImageModelEstimatorTrain.cxx | 2 +- ...otbSVMImageModelEstimatorTrainOneClass.cxx | 2 +- ...leKernelFunctorImageClassificationTest.cxx | 12 +- ...leKernelFunctorImageModelEstimatorTest.cxx | 10 +- Testing/Code/Learning/otbSVMModelAccessor.cxx | 1 - .../otbSVMPointSetModelEstimatorNew.cxx | 2 +- .../otbSVMSampleListModelEstimatorNew.cxx | 4 +- ...esicMorphologyDecompositionImageFilter.cxx | 4 +- ...cMorphologyDecompositionImageFilterNew.cxx | 4 +- ...ologyIterativeDecompositionImageFilter.cxx | 6 +- ...gyIterativeDecompositionImageFilterNew.cxx | 4 +- ...aleConvexOrConcaveClassificationFilter.cxx | 2 +- ...ConvexOrConcaveClassificationFilterNew.cxx | 2 +- .../Code/Projections/otbProjectionBaseNew.cxx | 2 +- ...lRAndGAndNIRVegetationIndexImageFilter.cxx | 6 +- ...IRAndGAndNIRVegetationIndexImageFilter.cxx | 14 +- .../otbAtmosphericCorrectionSequencement.cxx | 7 +- ...lRAndBAndNIRVegetationIndexImageFilter.cxx | 14 +- ...IRAndBAndNIRVegetationIndexImageFilter.cxx | 10 +- .../Radiometry/otbGAndRIndexImageFilter.cxx | 18 +- .../otbIBGAndRAndNIRIndexImageFilter.cxx | 14 +- ...ultiChannelGAndRAndNIRIndexImageFilter.cxx | 6 +- ...ISUMultiChannelRAndNIRIndexImageFilter.cxx | 4 +- .../otbISURAndNIRIndexImageFilter.cxx | 10 +- ...bLuminanceToReflectanceImageFilterAuto.cxx | 2 +- .../otbMultiChannelGAndRIndexImageFilter.cxx | 18 +- ...lRAndBAndNIRVegetationIndexImageFilter.cxx | 14 +- ...ndBAndNIRVegetationIndexImageFilterNew.cxx | 2 +- ...iChannelRAndGAndNIRIndexImageFilterNew.cxx | 2 +- ...annelRAndNIRVegetationIndexImageFilter.cxx | 58 +- ...elRAndNIRVegetationIndexImageFilterNew.cxx | 2 +- ...IMultiChannelTM4AndTM5IndexImageFilter.cxx | 4 +- .../otbNDBITM4AndTM5IndexImageFilter.cxx | 10 +- ...bNDWIMultiChannelWaterIndexImageFilter.cxx | 4 +- .../otbNDWIWaterIndexImageFilter.cxx | 10 +- ...bRAndBAndNIRVegetationIndexImageFilter.cxx | 10 +- ...ndBAndNIRVegetationIndexImageFilterNew.cxx | 2 +- ...ndGAndNIRVegetationIndexImageFilterNew.cxx | 2 +- .../otbRAndNIRVegetationIndexImageFilter.cxx | 54 +- ...ectanceToSurfaceReflectanceImageFilter.cxx | 2 +- ...anceToSurfaceReflectanceImageFilterNew.cxx | 2 +- ...ToRomaniaSurfaceReflectanceImageFilter.cxx | 4 +- ...annelRAndNIRVegetationIndexImageFilter.cxx | 6 +- ...ASetBRAndNIRVegetationIndexImageFilter.cxx | 6 +- .../otbSpectralSensitivityReaderNew.cxx | 2 +- .../otbSpectralSensitivityReaderTest.cxx | 12 +- ...djacencyEffect6SCorrectionSchemeFilter.cxx | 4 +- ...cencyEffect6SCorrectionSchemeFilterNew.cxx | 2 +- ...lRAndBAndNIRVegetationIndexImageFilter.cxx | 6 +- ...IRAndBAndNIRVegetationIndexImageFilter.cxx | 14 +- ...annelRAndNIRVegetationIndexImageFilter.cxx | 4 +- ...bWDVIRAndNIRVegetationIndexImageFilter.cxx | 10 +- .../otbHHnHVPolarimetricSynthesisFilter.cxx | 2 +- ...otbHHnHVnVVPolarimetricSynthesisFilter.cxx | 2 +- .../otbPolarimetricSynthesisFilter.cxx | 2 +- .../otbPolarimetricSynthesisFilterNew.cxx | 2 +- .../otbVHnVVPolarimetricSynthesisFilter.cxx | 2 +- .../otbRCC8GraphFileReader.cxx | 102 +- ...rImageToColorAnaglyphVectorImageFilter.cxx | 8 +- ...ageToColorAnaglyphVectorImageFilterNew.cxx | 4 +- .../Visualization/otbHistogramCurveNew.cxx | 2 +- .../otbImageViewerEndToEndWithVectorData.cxx | 2 +- .../otbRenderingImageFilterAmplitude.cxx | 2 +- .../otbRenderingImageFilterPhase.cxx | 2 +- .../otbRenderingImageFilterVector.cxx | 2 +- ...ageFilterVectorWithExpNegativeTransfer.cxx | 8 +- .../Visualization/otbVectorDataModelTest.cxx | 22 +- Testing/Fa/0000169-fftcomplextocomplex.cxx | 4 +- 665 files changed, 8720 insertions(+), 8660 deletions(-) mode change 100755 => 100644 Code/IO/otbCurlHelper.cxx diff --git a/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx b/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx index adb5161004..f2dc28687f 100644 --- a/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx +++ b/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx @@ -132,39 +132,39 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage> // 2000, pg. 416. switch (m_SplineOrder) { - case 3: - m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; - break; - case 0: - m_NumberOfPoles = 0; - break; - case 1: - m_NumberOfPoles = 0; - break; - case 2: - m_NumberOfPoles = 1; - m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; - break; - case 4: - m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; - m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; - break; - case 5: - m_NumberOfPoles = 2; - m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) - - 13.0 / 2.0; - m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) - - 13.0 / 2.0; - break; - default: - // SplineOrder not implemented yet. - itk::ExceptionObject err(__FILE__, __LINE__); - err.SetLocation(ITK_LOCATION); - err.SetDescription("SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet."); - throw err; - break; + case 3: + m_NumberOfPoles = 1; + m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0; + break; + case 0: + m_NumberOfPoles = 0; + break; + case 1: + m_NumberOfPoles = 0; + break; + case 2: + m_NumberOfPoles = 1; + m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0; + break; + case 4: + m_NumberOfPoles = 2; + m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0; + m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0; + break; + case 5: + m_NumberOfPoles = 2; + m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0) + - 13.0 / 2.0; + m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0) + - 13.0 / 2.0; + break; + default: + // SplineOrder not implemented yet. + itk::ExceptionObject err(__FILE__, __LINE__); + err.SetLocation(ITK_LOCATION); + err.SetDescription("SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet."); + throw err; + break; } } diff --git a/Code/BasicFilters/otbBSplineInterpolateImageFunction.h b/Code/BasicFilters/otbBSplineInterpolateImageFunction.h index 9bec9c2a82..346e0a5ce6 100644 --- a/Code/BasicFilters/otbBSplineInterpolateImageFunction.h +++ b/Code/BasicFilters/otbBSplineInterpolateImageFunction.h @@ -41,9 +41,9 @@ namespace otb * \ingroup ImageFunctions */ template < - class TImageType, - class TCoordRep = double, - class TCoefficientType = double> + class TImageType, + class TCoordRep = double, + class TCoefficientType = double> class ITK_EXPORT BSplineInterpolateImageFunction : public itk::InterpolateImageFunction<TImageType, TCoordRep> { @@ -87,8 +87,8 @@ public: /** Internal Coefficient typedef support */ typedef TCoefficientType CoefficientDataType; typedef itk::Image<CoefficientDataType, - itkGetStaticConstMacro(ImageDimension) - > CoefficientImageType; + itkGetStaticConstMacro(ImageDimension) + > CoefficientImageType; /** Define filter for calculating the BSpline coefficients */ typedef otb::BSplineDecompositionImageFilter<TImageType, CoefficientImageType> @@ -108,8 +108,8 @@ public: /** Derivative typedef support */ typedef itk::CovariantVector<OutputType, - itkGetStaticConstMacro(ImageDimension) - > CovariantVectorType; + itkGetStaticConstMacro(ImageDimension) + > CovariantVectorType; CovariantVectorType EvaluateDerivative(const PointType& point) const { diff --git a/Code/BasicFilters/otbBSplineInterpolateImageFunction.txx b/Code/BasicFilters/otbBSplineInterpolateImageFunction.txx index c8ac86b4af..3aa1274b92 100644 --- a/Code/BasicFilters/otbBSplineInterpolateImageFunction.txx +++ b/Code/BasicFilters/otbBSplineInterpolateImageFunction.txx @@ -262,87 +262,87 @@ BSplineInterpolateImageFunction<TImageType, TCoordRep, TCoefficientType> switch (splineOrder) { - case 3: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] - (double) EvaluateIndex[n][1]; - weights[n][3] = (1.0 / 6.0) * w * w * w; - weights[n][0] = (1.0 / 6.0) + 0.5 * w * (w - 1.0) - weights[n][3]; - weights[n][2] = w + weights[n][0] - 2.0 * weights[n][3]; - weights[n][1] = 1.0 - weights[n][0] - weights[n][2] - weights[n][3]; - } - break; - case 0: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - weights[n][0] = 1; // implements nearest neighbor - } - break; - case 1: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] - (double) EvaluateIndex[n][0]; - weights[n][1] = w; - weights[n][0] = 1.0 - w; - } - break; - case 2: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - /* x */ - w = x[n] - (double) EvaluateIndex[n][1]; - weights[n][1] = 0.75 - w * w; - weights[n][2] = 0.5 * (w - weights[n][1] + 1.0); - weights[n][0] = 1.0 - weights[n][1] - weights[n][2]; - } - break; - case 4: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - /* x */ - w = x[n] - (double) EvaluateIndex[n][2]; - w2 = w * w; - t = (1.0 / 6.0) * w2; - weights[n][0] = 0.5 - w; - weights[n][0] *= weights[n][0]; - weights[n][0] *= (1.0 / 24.0) * weights[n][0]; - t0 = w * (t - 11.0 / 24.0); - t1 = 19.0 / 96.0 + w2 * (0.25 - t); - weights[n][1] = t1 + t0; - weights[n][3] = t1 - t0; - weights[n][4] = weights[n][0] + t0 + 0.5 * w; - weights[n][2] = 1.0 - weights[n][0] - weights[n][1] - weights[n][3] - weights[n][4]; - } - break; - case 5: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - /* x */ - w = x[n] - (double) EvaluateIndex[n][2]; - w2 = w * w; - weights[n][5] = (1.0 / 120.0) * w * w2 * w2; - w2 -= w; - w4 = w2 * w2; - w -= 0.5; - t = w2 * (w2 - 3.0); - weights[n][0] = (1.0 / 24.0) * (1.0 / 5.0 + w2 + w4) - weights[n][5]; - t0 = (1.0 / 24.0) * (w2 * (w2 - 5.0) + 46.0 / 5.0); - t1 = (-1.0 / 12.0) * w * (t + 4.0); - weights[n][2] = t0 + t1; - weights[n][3] = t0 - t1; - t0 = (1.0 / 16.0) * (9.0 / 5.0 - t); - t1 = (1.0 / 24.0) * w * (w4 - w2 - 5.0); - weights[n][1] = t0 + t1; - weights[n][4] = t0 - t1; - } - break; - default: - // SplineOrder not implemented yet. - itk::ExceptionObject err(__FILE__, __LINE__); - err.SetLocation(ITK_LOCATION); - err.SetDescription("SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet."); - throw err; - break; + case 3: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] - (double) EvaluateIndex[n][1]; + weights[n][3] = (1.0 / 6.0) * w * w * w; + weights[n][0] = (1.0 / 6.0) + 0.5 * w * (w - 1.0) - weights[n][3]; + weights[n][2] = w + weights[n][0] - 2.0 * weights[n][3]; + weights[n][1] = 1.0 - weights[n][0] - weights[n][2] - weights[n][3]; + } + break; + case 0: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + weights[n][0] = 1; // implements nearest neighbor + } + break; + case 1: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] - (double) EvaluateIndex[n][0]; + weights[n][1] = w; + weights[n][0] = 1.0 - w; + } + break; + case 2: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + /* x */ + w = x[n] - (double) EvaluateIndex[n][1]; + weights[n][1] = 0.75 - w * w; + weights[n][2] = 0.5 * (w - weights[n][1] + 1.0); + weights[n][0] = 1.0 - weights[n][1] - weights[n][2]; + } + break; + case 4: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + /* x */ + w = x[n] - (double) EvaluateIndex[n][2]; + w2 = w * w; + t = (1.0 / 6.0) * w2; + weights[n][0] = 0.5 - w; + weights[n][0] *= weights[n][0]; + weights[n][0] *= (1.0 / 24.0) * weights[n][0]; + t0 = w * (t - 11.0 / 24.0); + t1 = 19.0 / 96.0 + w2 * (0.25 - t); + weights[n][1] = t1 + t0; + weights[n][3] = t1 - t0; + weights[n][4] = weights[n][0] + t0 + 0.5 * w; + weights[n][2] = 1.0 - weights[n][0] - weights[n][1] - weights[n][3] - weights[n][4]; + } + break; + case 5: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + /* x */ + w = x[n] - (double) EvaluateIndex[n][2]; + w2 = w * w; + weights[n][5] = (1.0 / 120.0) * w * w2 * w2; + w2 -= w; + w4 = w2 * w2; + w -= 0.5; + t = w2 * (w2 - 3.0); + weights[n][0] = (1.0 / 24.0) * (1.0 / 5.0 + w2 + w4) - weights[n][5]; + t0 = (1.0 / 24.0) * (w2 * (w2 - 5.0) + 46.0 / 5.0); + t1 = (-1.0 / 12.0) * w * (t + 4.0); + weights[n][2] = t0 + t1; + weights[n][3] = t0 - t1; + t0 = (1.0 / 16.0) * (9.0 / 5.0 - t); + t1 = (1.0 / 24.0) * w * (w4 - w2 - 5.0); + weights[n][1] = t0 + t1; + weights[n][4] = t0 - t1; + } + break; + default: + // SplineOrder not implemented yet. + itk::ExceptionObject err(__FILE__, __LINE__); + err.SetLocation(ITK_LOCATION); + err.SetDescription("SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet."); + throw err; + break; } } @@ -364,98 +364,98 @@ BSplineInterpolateImageFunction<TImageType, TCoordRep, TCoefficientType> switch (derivativeSplineOrder) { - // Calculates B(splineOrder) ( (x + 1/2) - xi) - B(splineOrder -1) ( (x - 1/2) - xi) - case -1: - // Why would we want to do this? - for (unsigned int n = 0; n < ImageDimension; ++n) - { - weights[n][0] = 0.0; - } - break; - case 0: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - weights[n][0] = -1.0; - weights[n][1] = 1.0; - } - break; - case 1: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] + 0.5 - (double) EvaluateIndex[n][1]; - // w2 = w; - w1 = 1.0 - w; + // Calculates B(splineOrder) ( (x + 1/2) - xi) - B(splineOrder -1) ( (x - 1/2) - xi) + case -1: + // Why would we want to do this? + for (unsigned int n = 0; n < ImageDimension; ++n) + { + weights[n][0] = 0.0; + } + break; + case 0: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + weights[n][0] = -1.0; + weights[n][1] = 1.0; + } + break; + case 1: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] + 0.5 - (double) EvaluateIndex[n][1]; + // w2 = w; + w1 = 1.0 - w; - weights[n][0] = 0.0 - w1; - weights[n][1] = w1 - w; - weights[n][2] = w; - } - break; - case 2: + weights[n][0] = 0.0 - w1; + weights[n][1] = w1 - w; + weights[n][2] = w; + } + break; + case 2: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] + .5 - (double) EvaluateIndex[n][2]; - w2 = 0.75 - w * w; - w3 = 0.5 * (w - w2 + 1.0); - w1 = 1.0 - w2 - w3; - - weights[n][0] = 0.0 - w1; - weights[n][1] = w1 - w2; - weights[n][2] = w2 - w3; - weights[n][3] = w3; - } - break; - case 3: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] + .5 - (double) EvaluateIndex[n][2]; + w2 = 0.75 - w * w; + w3 = 0.5 * (w - w2 + 1.0); + w1 = 1.0 - w2 - w3; + + weights[n][0] = 0.0 - w1; + weights[n][1] = w1 - w2; + weights[n][2] = w2 - w3; + weights[n][3] = w3; + } + break; + case 3: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] + 0.5 - (double) EvaluateIndex[n][2]; - w4 = (1.0 / 6.0) * w * w * w; - w1 = (1.0 / 6.0) + 0.5 * w * (w - 1.0) - w4; - w3 = w + w1 - 2.0 * w4; - w2 = 1.0 - w1 - w3 - w4; - - weights[n][0] = 0.0 - w1; - weights[n][1] = w1 - w2; - weights[n][2] = w2 - w3; - weights[n][3] = w3 - w4; - weights[n][4] = w4; - } - break; - case 4: - for (unsigned int n = 0; n < ImageDimension; ++n) - { - w = x[n] + .5 - (double) EvaluateIndex[n][3]; - t2 = w * w; - t = (1.0 / 6.0) * t2; - w1 = 0.5 - w; - w1 *= w1; - w1 *= (1.0 / 24.0) * w1; - t0 = w * (t - 11.0 / 24.0); - t1 = 19.0 / 96.0 + t2 * (0.25 - t); - w2 = t1 + t0; - w4 = t1 - t0; - w5 = w1 + t0 + 0.5 * w; - w3 = 1.0 - w1 - w2 - w4 - w5; - - weights[n][0] = 0.0 - w1; - weights[n][1] = w1 - w2; - weights[n][2] = w2 - w3; - weights[n][3] = w3 - w4; - weights[n][4] = w4 - w5; - weights[n][5] = w5; - } - break; - - default: - // SplineOrder not implemented yet. - itk::ExceptionObject err(__FILE__, __LINE__); - err.SetLocation(ITK_LOCATION); - err.SetDescription( - "SplineOrder (for derivatives) must be between 1 and 5. Requested spline order has not been implemented yet."); - throw err; - break; + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] + 0.5 - (double) EvaluateIndex[n][2]; + w4 = (1.0 / 6.0) * w * w * w; + w1 = (1.0 / 6.0) + 0.5 * w * (w - 1.0) - w4; + w3 = w + w1 - 2.0 * w4; + w2 = 1.0 - w1 - w3 - w4; + + weights[n][0] = 0.0 - w1; + weights[n][1] = w1 - w2; + weights[n][2] = w2 - w3; + weights[n][3] = w3 - w4; + weights[n][4] = w4; + } + break; + case 4: + for (unsigned int n = 0; n < ImageDimension; ++n) + { + w = x[n] + .5 - (double) EvaluateIndex[n][3]; + t2 = w * w; + t = (1.0 / 6.0) * t2; + w1 = 0.5 - w; + w1 *= w1; + w1 *= (1.0 / 24.0) * w1; + t0 = w * (t - 11.0 / 24.0); + t1 = 19.0 / 96.0 + t2 * (0.25 - t); + w2 = t1 + t0; + w4 = t1 - t0; + w5 = w1 + t0 + 0.5 * w; + w3 = 1.0 - w1 - w2 - w4 - w5; + + weights[n][0] = 0.0 - w1; + weights[n][1] = w1 - w2; + weights[n][2] = w2 - w3; + weights[n][3] = w3 - w4; + weights[n][4] = w4 - w5; + weights[n][5] = w5; + } + break; + + default: + // SplineOrder not implemented yet. + itk::ExceptionObject err(__FILE__, __LINE__); + err.SetLocation(ITK_LOCATION); + err.SetDescription( + "SplineOrder (for derivatives) must be between 1 and 5. Requested spline order has not been implemented yet."); + throw err; + break; } } diff --git a/Code/BasicFilters/otbBinaryImageDensityFunction.h b/Code/BasicFilters/otbBinaryImageDensityFunction.h index a2a7c57e0a..1c92c19bfc 100644 --- a/Code/BasicFilters/otbBinaryImageDensityFunction.h +++ b/Code/BasicFilters/otbBinaryImageDensityFunction.h @@ -44,13 +44,13 @@ namespace otb template <class TInputImage, class TCoordRep = float> class ITK_EXPORT BinaryImageDensityFunction : public itk::ImageFunction<TInputImage, typename itk::NumericTraits<typename TInputImage::PixelType>::RealType, - TCoordRep> + TCoordRep> { public: /** Standard class typedefs. */ typedef BinaryImageDensityFunction Self; typedef itk::ImageFunction<TInputImage, typename itk::NumericTraits<typename TInputImage::PixelType>::RealType, - TCoordRep> Superclass; + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbChangeLabelImageFilter.h b/Code/BasicFilters/otbChangeLabelImageFilter.h index e3bb0b7b99..8908433080 100644 --- a/Code/BasicFilters/otbChangeLabelImageFilter.h +++ b/Code/BasicFilters/otbChangeLabelImageFilter.h @@ -113,17 +113,17 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT ChangeLabelImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::VectorChangeLabel<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::VectorChangeLabel<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ChangeLabelImageFilter Self; typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::VectorChangeLabel< - typename TInputImage::PixelType, - typename TOutputImage::PixelType> - > Superclass; + Functor::VectorChangeLabel< + typename TInputImage::PixelType, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbConvolutionImageFilter.h b/Code/BasicFilters/otbConvolutionImageFilter.h index 8fb1048698..013e97a838 100644 --- a/Code/BasicFilters/otbConvolutionImageFilter.h +++ b/Code/BasicFilters/otbConvolutionImageFilter.h @@ -59,8 +59,8 @@ namespace otb * \ingroup MultiThreaded */ template <class TInputImage, class TOutputImage, class TBoundaryCondition = - itk::ZeroFluxNeumannBoundaryCondition<TInputImage>, - class TFilterPrecision = typename itk::NumericTraits<typename TInputImage::InternalPixelType>::RealType > + itk::ZeroFluxNeumannBoundaryCondition<TInputImage>, + class TFilterPrecision = typename itk::NumericTraits<typename TInputImage::InternalPixelType>::RealType> class ITK_EXPORT ConvolutionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/BasicFilters/otbEdgeDensityImageFilter.h b/Code/BasicFilters/otbEdgeDensityImageFilter.h index e2a0753235..261935df87 100644 --- a/Code/BasicFilters/otbEdgeDensityImageFilter.h +++ b/Code/BasicFilters/otbEdgeDensityImageFilter.h @@ -72,8 +72,8 @@ public: /** PointSetToDensityImageFilter support*/ typedef otb::BinaryImageToDensityImageFilter<InputImageType, - OutputImageType, - DensityCountFunctionType> DensityImageType; + OutputImageType, + DensityCountFunctionType> DensityImageType; typedef typename DensityImageType::Pointer DensityImagePointerType; diff --git a/Code/BasicFilters/otbHillShadingFilter.h b/Code/BasicFilters/otbHillShadingFilter.h index b9005a98d7..8b5f5661c3 100644 --- a/Code/BasicFilters/otbHillShadingFilter.h +++ b/Code/BasicFilters/otbHillShadingFilter.h @@ -39,16 +39,16 @@ class ITK_EXPORT HillShadingFilter : public UnaryFunctorNeighborhoodImageFilter<TInputImage, TOutputImage, Functor::HillShadingFunctor<itk::ConstNeighborhoodIterator<TInputImage>, TInputImage, typename TOutputImage::PixelType> - > + > { public: /** Standard class typedefs. */ - typedef HillShadingFilter Self; + typedef HillShadingFilter Self; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); diff --git a/Code/BasicFilters/otbHillShadingFunctor.h b/Code/BasicFilters/otbHillShadingFunctor.h index 6b51fc6a07..94f95a30dd 100644 --- a/Code/BasicFilters/otbHillShadingFunctor.h +++ b/Code/BasicFilters/otbHillShadingFunctor.h @@ -148,8 +148,8 @@ public: float xSlope = ((makeValid(it.GetPixel(LEFTUP)) + 2 * makeValid(it.GetPixel(LEFT)) + makeValid(it.GetPixel(RIGHTDOWN))) - - (makeValid(it.GetPixel(RIGHTUP)) + 2 * makeValid(it.GetPixel(RIGHT)) + - makeValid(it.GetPixel(RIGHTDOWN)))) + - (makeValid(it.GetPixel(RIGHTUP)) + 2 * makeValid(it.GetPixel(RIGHT)) + + makeValid(it.GetPixel(RIGHTDOWN)))) / (m_XRes * m_Scale); // - as the azimuth is given compared to y axis pointing up float ySlope = -((makeValid(it.GetPixel(LEFTUP)) + 2 * makeValid(it.GetPixel(UP)) + makeValid(it.GetPixel(RIGHTUP))) diff --git a/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h b/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h index 3b9f68796a..db2684eef2 100644 --- a/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h +++ b/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h @@ -60,33 +60,33 @@ public: switch (m_Operator) { - case MULTIPLICATION: - { - vInTmp *= static_cast<InternalInputPixelType>(inPix); - break; - } - case ADDITION: - { - vInTmp += static_cast<InternalInputPixelType>(inPix); - break; - } - case DIVISON: - { - if (inPix != 0) vInTmp /= static_cast<InternalInputPixelType>(inPix); - else + case MULTIPLICATION: + { + vInTmp *= static_cast<InternalInputPixelType>(inPix); + break; + } + case ADDITION: + { + vInTmp += static_cast<InternalInputPixelType>(inPix); + break; + } + case DIVISON: + { + if (inPix != 0) vInTmp /= static_cast<InternalInputPixelType>(inPix); + else + { + vInTmp.Fill(0); + } + break; + } + case SUBSTRACTION: + { + vInTmp -= static_cast<InternalInputPixelType>(inPix); + break; + } + default: { - vInTmp.Fill(0); } - break; - } - case SUBSTRACTION: - { - vInTmp -= static_cast<InternalInputPixelType>(inPix); - break; - } - default: - { - } } for (unsigned int i = 0; i < vInTmp.Size(); i++) @@ -118,13 +118,13 @@ protected: template <class TInputImage, class TVectorInputImage, class TOutputImage> class ITK_EXPORT ImageAndVectorImageOperationFilter : public itk::BinaryFunctorImageFilter<TInputImage, - TVectorInputImage, - TOutputImage, - Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TVectorInputImage:: - PixelType, - ITK_TYPENAME TOutputImage:: - PixelType> > + TVectorInputImage, + TOutputImage, + Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME TVectorInputImage:: + PixelType, + ITK_TYPENAME TOutputImage:: + PixelType> > //ImageToImageFilter< TVectorInputImage, TOutputImage > { public: @@ -133,8 +133,8 @@ public: typedef ImageAndVectorImageOperationFilter Self; //typedef itk::ImageToImageFilter<TVectorInputImage, TOutputImage> Superclass; typedef Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TVectorInputImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> FunctorType; + ITK_TYPENAME TVectorInputImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> FunctorType; typedef itk::BinaryFunctorImageFilter<TInputImage, TVectorInputImage, TOutputImage, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbImageListToImageListApplyFilter.h b/Code/BasicFilters/otbImageListToImageListApplyFilter.h index ff783ab57f..1ae63bd910 100644 --- a/Code/BasicFilters/otbImageListToImageListApplyFilter.h +++ b/Code/BasicFilters/otbImageListToImageListApplyFilter.h @@ -41,13 +41,13 @@ namespace otb template <class TInputImageList, class TOutputImageList, class TFilter> class ITK_EXPORT ImageListToImageListApplyFilter : public ImageListToImageListFilter<typename TInputImageList::ImageType, - typename TOutputImageList::ImageType> + typename TOutputImageList::ImageType> { public: /** Standard typedefs */ typedef ImageListToImageListApplyFilter Self; typedef ImageListToImageListFilter<typename TInputImageList::ImageType, - typename TOutputImageList::ImageType> Superclass; + typename TOutputImageList::ImageType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbImageListToVectorImageFilter.h b/Code/BasicFilters/otbImageListToVectorImageFilter.h index 29447fb1a0..d6e8ff6544 100644 --- a/Code/BasicFilters/otbImageListToVectorImageFilter.h +++ b/Code/BasicFilters/otbImageListToVectorImageFilter.h @@ -41,7 +41,7 @@ public: /** Standard typedefs */ typedef ImageListToVectorImageFilter Self; typedef ImageListToImageFilter<typename TImageList::ImageType, - TVectorImage> Superclass; + TVectorImage> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbImageToPointSetFilter.txx b/Code/BasicFilters/otbImageToPointSetFilter.txx index 2eb13a9627..16d8baf457 100644 --- a/Code/BasicFilters/otbImageToPointSetFilter.txx +++ b/Code/BasicFilters/otbImageToPointSetFilter.txx @@ -159,7 +159,7 @@ ImageToPointSetFilter<TInputImage, TOutputPointSet> { streamRegion = m_RegionSplitter->GetSplit(piece, numDivisions, inputRegion); typedef itk::ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension), - itkGetStaticConstMacro(InputImageDimension)> + itkGetStaticConstMacro(InputImageDimension)> OutputToInputRegionCopierType; OutputToInputRegionCopierType regionCopier; InputImageRegionType inputRegion; diff --git a/Code/BasicFilters/otbImportVectorImageFilter.txx b/Code/BasicFilters/otbImportVectorImageFilter.txx index e5c99db6bc..de232f24e0 100644 --- a/Code/BasicFilters/otbImportVectorImageFilter.txx +++ b/Code/BasicFilters/otbImportVectorImageFilter.txx @@ -178,7 +178,8 @@ ImportVectorImageFilter<TOutputImage> int numberOfBands = m_Size / (size[0] * size[1]); - if (numberOfBands != static_cast<int>(numberOfBands)) itkExceptionMacro( + if (numberOfBands != static_cast<int>(numberOfBands)) + itkExceptionMacro( << "Buffer size and image size are not compatible !"); outputPtr->SetNumberOfComponentsPerPixel(numberOfBands); diff --git a/Code/BasicFilters/otbInnerProductPCAImageFilter.h b/Code/BasicFilters/otbInnerProductPCAImageFilter.h index c462a86a7c..5a165e3afb 100644 --- a/Code/BasicFilters/otbInnerProductPCAImageFilter.h +++ b/Code/BasicFilters/otbInnerProductPCAImageFilter.h @@ -87,7 +87,7 @@ public: /** Template parameters typedefs for mean component generation */ typedef Image<typename InputImageType::InternalPixelType, - ::itk::GetImageDimension<InputImageType>::ImageDimension> InternalImageType; + ::itk::GetImageDimension<InputImageType>::ImageDimension> InternalImageType; typedef Functor::MeanFunctor<typename InputImageType::PixelType, typename InternalImageType::PixelType> MeanFunctorType; typedef itk::UnaryFunctorImageFilter<InputImageType, InternalImageType, MeanFunctorType> MeanFilterType; diff --git a/Code/BasicFilters/otbInnerProductPCAImageFilter.txx b/Code/BasicFilters/otbInnerProductPCAImageFilter.txx index aff2bdc62f..0bde804a59 100644 --- a/Code/BasicFilters/otbInnerProductPCAImageFilter.txx +++ b/Code/BasicFilters/otbInnerProductPCAImageFilter.txx @@ -48,7 +48,8 @@ InnerProductPCAImageFilter<TInputImage, TOutputImage> ::GenerateOutputInformation(void) { Superclass::GenerateOutputInformation(); - if (m_GenerateMeanComponent == false) this->GetOutput()->SetNumberOfComponentsPerPixel( + if (m_GenerateMeanComponent == false) + this->GetOutput()->SetNumberOfComponentsPerPixel( m_NumberOfPrincipalComponentsRequired); else this->GetOutput()->SetNumberOfComponentsPerPixel(m_NumberOfPrincipalComponentsRequired + 1); } diff --git a/Code/BasicFilters/otbLabelizeConfidenceConnectedImageFilter.h b/Code/BasicFilters/otbLabelizeConfidenceConnectedImageFilter.h index 88003b8c91..8f332d1b66 100644 --- a/Code/BasicFilters/otbLabelizeConfidenceConnectedImageFilter.h +++ b/Code/BasicFilters/otbLabelizeConfidenceConnectedImageFilter.h @@ -33,18 +33,18 @@ namespace otb template <class TInputImage, class TOutputImage> class ITK_EXPORT LabelizeConfidenceConnectedImageFilter : public otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::ConfidenceConnectedImageFilter<TInputImage, TOutputImage> > + itk::ConfidenceConnectedImageFilter<TInputImage, TOutputImage> > { public: /** typedef for standard classes. */ typedef LabelizeConfidenceConnectedImageFilter - Self; + Self; typedef otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::ConfidenceConnectedImageFilter<TInputImage, TOutputImage> > Superclass; + itk::ConfidenceConnectedImageFilter<TInputImage, TOutputImage> > Superclass; typedef itk::SmartPointer<Self> - Pointer; + Pointer; typedef itk::SmartPointer<const Self> - ConstPointer; + ConstPointer; /** typedef to simplify variables definition and declaration. */ typedef TInputImage InputImageType; diff --git a/Code/BasicFilters/otbLabelizeConnectedThresholdImageFilter.h b/Code/BasicFilters/otbLabelizeConnectedThresholdImageFilter.h index 494656170a..e9e4d7eb94 100644 --- a/Code/BasicFilters/otbLabelizeConnectedThresholdImageFilter.h +++ b/Code/BasicFilters/otbLabelizeConnectedThresholdImageFilter.h @@ -31,18 +31,18 @@ namespace otb template <class TInputImage, class TOutputImage> class ITK_EXPORT LabelizeConnectedThresholdImageFilter : public otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::ConnectedThresholdImageFilter<TInputImage, TOutputImage> > + itk::ConnectedThresholdImageFilter<TInputImage, TOutputImage> > { public: /** typedef for standard classes. */ typedef LabelizeConnectedThresholdImageFilter - Self; + Self; typedef otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::ConnectedThresholdImageFilter<TInputImage, TOutputImage> > Superclass; + itk::ConnectedThresholdImageFilter<TInputImage, TOutputImage> > Superclass; typedef itk::SmartPointer<Self> - Pointer; + Pointer; typedef itk::SmartPointer<const Self> - ConstPointer; + ConstPointer; typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; diff --git a/Code/BasicFilters/otbLabelizeNeighborhoodConnectedImageFilter.h b/Code/BasicFilters/otbLabelizeNeighborhoodConnectedImageFilter.h index ad977d3cb5..75076fd937 100644 --- a/Code/BasicFilters/otbLabelizeNeighborhoodConnectedImageFilter.h +++ b/Code/BasicFilters/otbLabelizeNeighborhoodConnectedImageFilter.h @@ -37,18 +37,18 @@ namespace otb template <class TInputImage, class TOutputImage> class ITK_EXPORT LabelizeNeighborhoodConnectedImageFilter : public otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::NeighborhoodConnectedImageFilter<TInputImage, TOutputImage> > + itk::NeighborhoodConnectedImageFilter<TInputImage, TOutputImage> > { public: /** typedef for standard classes. */ typedef LabelizeNeighborhoodConnectedImageFilter - Self; + Self; typedef otb::LabelizeImageFilterBase<TInputImage, TOutputImage, - itk::NeighborhoodConnectedImageFilter<TInputImage, TOutputImage> > Superclass; + itk::NeighborhoodConnectedImageFilter<TInputImage, TOutputImage> > Superclass; typedef itk::SmartPointer<Self> - Pointer; + Pointer; typedef itk::SmartPointer<const Self> - ConstPointer; + ConstPointer; /** typedef to simplify variables definition and declaration. */ typedef TInputImage InputImageType; diff --git a/Code/BasicFilters/otbListSampleToHistogramListGenerator.h b/Code/BasicFilters/otbListSampleToHistogramListGenerator.h index 9ac3a4badb..66888df416 100644 --- a/Code/BasicFilters/otbListSampleToHistogramListGenerator.h +++ b/Code/BasicFilters/otbListSampleToHistogramListGenerator.h @@ -41,8 +41,8 @@ namespace otb { * \sa ListSampleToVariableDimensionHistogram */ template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer = itk::Statistics::DenseFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer = itk::Statistics::DenseFrequencyContainer> class ITK_EXPORT ListSampleToHistogramListGenerator : public itk::Object { @@ -63,7 +63,7 @@ public: typedef typename itk::NumericTraits <THistogramMeasurement>::RealType HistogramMeasurementRealType; typedef itk::Statistics::Histogram<HistogramMeasurementRealType, 1, - TFrequencyContainer> HistogramType; + TFrequencyContainer> HistogramType; typedef typename HistogramType::SizeType HistogramSizeType; typedef typename TListSample::MeasurementVectorType MeasurementVectorType; typedef ObjectList<HistogramType> HistogramListType; diff --git a/Code/BasicFilters/otbListSampleToHistogramListGenerator.txx b/Code/BasicFilters/otbListSampleToHistogramListGenerator.txx index 62e063078c..171f0bd27b 100644 --- a/Code/BasicFilters/otbListSampleToHistogramListGenerator.txx +++ b/Code/BasicFilters/otbListSampleToHistogramListGenerator.txx @@ -29,11 +29,11 @@ namespace otb { template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> ListSampleToHistogramListGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::ListSampleToHistogramListGenerator() : m_List(), m_Size(), m_MarginalScale(100), m_HistogramMin(), m_HistogramMax(), m_AutoMinMax(true), m_HistogramList() { @@ -42,12 +42,12 @@ ListSampleToHistogramListGenerator<TListSample, } template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> void ListSampleToHistogramListGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::GenerateData() { otbMsgDebugMacro(<< "ListSampleToHistogramListGenerator::GenerateData(): Entering"); @@ -172,12 +172,12 @@ ListSampleToHistogramListGenerator<TListSample, } template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> void ListSampleToHistogramListGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); diff --git a/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.h b/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.h index 5170fcb811..021d394327 100644 --- a/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.h +++ b/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.h @@ -46,8 +46,8 @@ namespace otb { * \sa VariableDimensionHistogram, ListSample, ListSampleToHistogramGenerator */ template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer = itk::Statistics::DenseFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer = itk::Statistics::DenseFrequencyContainer> class ITK_EXPORT ListSampleToVariableDimensionHistogramGenerator : public itk::Object { @@ -69,7 +69,7 @@ public: HistogramMeasurementRealType; typedef itk::Statistics::VariableDimensionHistogram<HistogramMeasurementRealType, - TFrequencyContainer> HistogramType; + TFrequencyContainer> HistogramType; typedef typename HistogramType::SizeType HistogramSizeType; typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; diff --git a/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.txx b/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.txx index b16a354e10..773b3d965d 100644 --- a/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.txx +++ b/Code/BasicFilters/otbListSampleToVariableDimensionHistogramGenerator.txx @@ -28,11 +28,11 @@ namespace otb { template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> ListSampleToVariableDimensionHistogramGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::ListSampleToVariableDimensionHistogramGenerator() { m_Histogram = HistogramType::New(); @@ -41,12 +41,12 @@ ListSampleToVariableDimensionHistogramGenerator<TListSample, } template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> void ListSampleToVariableDimensionHistogramGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::GenerateData() { otbMsgDebugMacro(<< "ListSampleToVariableDimensionHistogramGenerator::GenerateData(): Entering"); @@ -169,12 +169,12 @@ ListSampleToVariableDimensionHistogramGenerator<TListSample, } template<class TListSample, - class THistogramMeasurement, - class TFrequencyContainer> + class THistogramMeasurement, + class TFrequencyContainer> void ListSampleToVariableDimensionHistogramGenerator<TListSample, - THistogramMeasurement, - TFrequencyContainer> + THistogramMeasurement, + TFrequencyContainer> ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os, indent); diff --git a/Code/BasicFilters/otbMeanShiftImageFilter.h b/Code/BasicFilters/otbMeanShiftImageFilter.h index ee89c7018f..f68655dd48 100644 --- a/Code/BasicFilters/otbMeanShiftImageFilter.h +++ b/Code/BasicFilters/otbMeanShiftImageFilter.h @@ -106,8 +106,8 @@ public: */ template <class TInputImage, class TOutputImage, - class TLabeledOutput = otb::Image<unsigned short, 2>, - class TBufferConverter = MeanShift::ScalarBufferConverter> + class TLabeledOutput = otb::Image<unsigned short, 2>, + class TBufferConverter = MeanShift::ScalarBufferConverter> class ITK_EXPORT MeanShiftImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/BasicFilters/otbMeanShiftImageFilter.txx b/Code/BasicFilters/otbMeanShiftImageFilter.txx index b3b8e5e22d..9d8614950e 100644 --- a/Code/BasicFilters/otbMeanShiftImageFilter.txx +++ b/Code/BasicFilters/otbMeanShiftImageFilter.txx @@ -394,11 +394,11 @@ MeanShiftImageFilter<TInputImage, TOutputImage, TLabeledOutput, TBufferConverter { boundIndex[0] = (regionIndeces[i] % - clusterBoudariesOutputPtr->GetRequestedRegion().GetSize()[0]) + + clusterBoudariesOutputPtr->GetRequestedRegion().GetSize()[0]) + clusterBoudariesOutputPtr->GetRequestedRegion().GetIndex()[0]; boundIndex[1] = (regionIndeces[i] / - clusterBoudariesOutputPtr->GetRequestedRegion().GetSize()[0]) + + clusterBoudariesOutputPtr->GetRequestedRegion().GetSize()[0]) + clusterBoudariesOutputPtr->GetRequestedRegion().GetIndex()[1]; if (clusterBoudariesOutputPtr->GetBufferedRegion().IsInside(boundIndex)) { diff --git a/Code/BasicFilters/otbMeanShiftVectorImageFilter.h b/Code/BasicFilters/otbMeanShiftVectorImageFilter.h index 02c5e2f2d4..031038046b 100644 --- a/Code/BasicFilters/otbMeanShiftVectorImageFilter.h +++ b/Code/BasicFilters/otbMeanShiftVectorImageFilter.h @@ -82,7 +82,7 @@ public: /** Standard class typedef */ typedef MeanShiftVectorImageFilter Self; typedef MeanShiftImageFilter<TInputImage, TOutputImage, TLabeledOutput, - MeanShift::VectorBufferConverter> Superclass; + MeanShift::VectorBufferConverter> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.h b/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.h index d77075f112..e9090c4810 100644 --- a/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.h +++ b/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.h @@ -55,7 +55,7 @@ namespace otb * \ingroup IntensityImageFilters */ template <class TInputImage, class TOutputImage, - class TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition<TInputImage> > + class TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition<TInputImage> > class ITK_EXPORT OverlapSaveConvolutionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.txx b/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.txx index 9c5798f2f2..759d23bb81 100644 --- a/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.txx +++ b/Code/BasicFilters/otbOverlapSaveConvolutionImageFilter.txx @@ -269,7 +269,7 @@ OverlapSaveConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> typename InputImageType::IndexType index = outputIt.GetIndex(); unsigned int linearIndex = (index[1] + sizeOfFilter[1] - 1 - - outputRegionForThread.GetIndex()[1]) * pieceSize[0] - 1 + index[0] + sizeOfFilter[0] - + outputRegionForThread.GetIndex()[1]) * pieceSize[0] - 1 + index[0] + sizeOfFilter[0] - outputRegionForThread.GetIndex()[0]; outputIt.Set(static_cast<OutputPixelType>((inverseFFTpiece[linearIndex] / pieceNbOfPixel) * static_cast<double>(norm))); diff --git a/Code/BasicFilters/otbPointSetFunction.h b/Code/BasicFilters/otbPointSetFunction.h index 4206833267..2e8e0d1cba 100644 --- a/Code/BasicFilters/otbPointSetFunction.h +++ b/Code/BasicFilters/otbPointSetFunction.h @@ -34,7 +34,7 @@ namespace otb template <class TPointSet, class TOutput> class ITK_EXPORT PointSetFunction : public itk::SpatialFunction<TOutput, 2 /* TODO : change 2 by PointType::PointDimension*/, - typename TPointSet::PointType> + typename TPointSet::PointType> { public: /** Standard class typedefs. */ diff --git a/Code/BasicFilters/otbPointSetToDensityImageFilter.h b/Code/BasicFilters/otbPointSetToDensityImageFilter.h index ba4b7a9d90..8e802b338f 100644 --- a/Code/BasicFilters/otbPointSetToDensityImageFilter.h +++ b/Code/BasicFilters/otbPointSetToDensityImageFilter.h @@ -34,7 +34,7 @@ namespace otb */ template <class TInputPointSet, class TOutputImage, - class TDensityFunction = PointSetDensityFunction<TInputPointSet, typename TOutputImage::PixelType> > + class TDensityFunction = PointSetDensityFunction<TInputPointSet, typename TOutputImage::PixelType> > class ITK_EXPORT PointSetToDensityImageFilter : public itk::PointSetToImageFilter<TInputPointSet, TOutputImage> { diff --git a/Code/BasicFilters/otbPrintableImageFilter.h b/Code/BasicFilters/otbPrintableImageFilter.h index b06390ad55..e1217b5ac8 100644 --- a/Code/BasicFilters/otbPrintableImageFilter.h +++ b/Code/BasicFilters/otbPrintableImageFilter.h @@ -137,7 +137,7 @@ public: typedef typename MaskImageType::PixelType MaskPixelType; typedef otb::MultiChannelExtractROI<InputInternalPixelType, - InputInternalPixelType> ChannelExtractorType; + InputInternalPixelType> ChannelExtractorType; typedef typename ChannelExtractorType::ChannelsType ChannelsType; typedef VectorRescaleIntensityImageFilter @@ -145,7 +145,7 @@ public: typedef Functor::MaskFunctor<InputPixelType, MaskPixelType, OutputPixelType> FunctorType; typedef itk::BinaryFunctorImageFilter<OutputImageType, MaskImageType, - OutputImageType, FunctorType> FunctorFilterType; + OutputImageType, FunctorType> FunctorFilterType; typedef typename FunctorFilterType::Pointer FunctorFilterPointerType; /** Method for creation through object factory */ diff --git a/Code/BasicFilters/otbProlateInterpolateImageFunction.h b/Code/BasicFilters/otbProlateInterpolateImageFunction.h index e258ee449f..b153d18fa4 100644 --- a/Code/BasicFilters/otbProlateInterpolateImageFunction.h +++ b/Code/BasicFilters/otbProlateInterpolateImageFunction.h @@ -125,20 +125,20 @@ private: * \ingroup ImageFunctions ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT ProlateInterpolateImageFunction : public GenericInterpolateImageFunction<TInputImage, - ITK_TYPENAME Function::ProlateFunction<TInputInterpolator, TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::ProlateFunction<TInputInterpolator, TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef ProlateInterpolateImageFunction Self; typedef GenericInterpolateImageFunction<TInputImage, - Function::ProlateFunction<TInputInterpolator, TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> Superclass; + Function::ProlateFunction<TInputInterpolator, TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbProlateInterpolateImageFunction.txx b/Code/BasicFilters/otbProlateInterpolateImageFunction.txx index c600c16241..7207e53e58 100644 --- a/Code/BasicFilters/otbProlateInterpolateImageFunction.txx +++ b/Code/BasicFilters/otbProlateInterpolateImageFunction.txx @@ -205,7 +205,7 @@ ProlateFunction<TInput, TOutput> /** Constructor */ template<class TInputImage, class TBoundaryCondition, class TCoordRep, class TInputInterpolator, - class TOutputInterpolator> + class TOutputInterpolator> ProlateInterpolateImageFunction<TInputImage, TBoundaryCondition, TCoordRep, TInputInterpolator, TOutputInterpolator> ::ProlateInterpolateImageFunction() { @@ -215,14 +215,14 @@ ProlateInterpolateImageFunction<TInputImage, TBoundaryCondition, TCoordRep, TInp /** Destructor */ template<class TInputImage, class TBoundaryCondition, class TCoordRep, class TInputInterpolator, - class TOutputInterpolator> + class TOutputInterpolator> ProlateInterpolateImageFunction<TInputImage, TBoundaryCondition, TCoordRep, TInputInterpolator, TOutputInterpolator> ::~ProlateInterpolateImageFunction() { } template<class TInputImage, class TBoundaryCondition, class TCoordRep, class TInputInterpolator, - class TOutputInterpolator> + class TOutputInterpolator> void ProlateInterpolateImageFunction<TInputImage, TBoundaryCondition, TCoordRep, TInputInterpolator, TOutputInterpolator> ::PrintSelf(std::ostream& os, itk::Indent indent) const diff --git a/Code/BasicFilters/otbQuaternaryFunctorImageFilter.h b/Code/BasicFilters/otbQuaternaryFunctorImageFilter.h index cfe52467cd..11c7f27ffe 100644 --- a/Code/BasicFilters/otbQuaternaryFunctorImageFilter.h +++ b/Code/BasicFilters/otbQuaternaryFunctorImageFilter.h @@ -39,8 +39,8 @@ namespace otb * \ingroup IntensityImageFilters Multithreaded */ template <class TInputImage1, class TInputImage2, - class TInputImage3, class TInputImage4, - class TOutputImage, class TFunction> + class TInputImage3, class TInputImage4, + class TOutputImage, class TFunction> class ITK_EXPORT QuaternaryFunctorImageFilter : public itk::InPlaceImageFilter<TInputImage1, TOutputImage> { diff --git a/Code/BasicFilters/otbQuaternaryFunctorImageFilter.txx b/Code/BasicFilters/otbQuaternaryFunctorImageFilter.txx index 0458ddfe7b..b1890fa008 100644 --- a/Code/BasicFilters/otbQuaternaryFunctorImageFilter.txx +++ b/Code/BasicFilters/otbQuaternaryFunctorImageFilter.txx @@ -33,7 +33,7 @@ namespace otb * Constructor */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::QuaternaryFunctorImageFilter() { @@ -44,7 +44,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * Connect one of the operands for pixel-wise addition */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::SetInput1(const TInputImage1 *image1) @@ -57,7 +57,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * Connect one of the operands for pixel-wise addition */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::SetInput2(const TInputImage2 *image2) @@ -70,7 +70,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * Connect one of the operands for pixel-wise addition */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::SetInput3(const TInputImage3 *image3) @@ -83,7 +83,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * Connect one of the operands for pixel-wise addition */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::SetInput4(const TInputImage4 *image4) @@ -96,7 +96,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * BeforeThreadedGenerateData function. Validate inputs */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::BeforeThreadedGenerateData() @@ -124,7 +124,7 @@ QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputIma * ThreadedGenerateData function. Performs the pixel-wise addition */ template <class TInputImage1, class TInputImage2, class TInputImage3, - class TInputImage4, class TOutputImage, class TFunction> + class TInputImage4, class TOutputImage, class TFunction> void QuaternaryFunctorImageFilter<TInputImage1, TInputImage2, TInputImage3, TInputImage4, TOutputImage, TFunction> ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, diff --git a/Code/BasicFilters/otbStreamingInnerProductVectorImageFilter.txx b/Code/BasicFilters/otbStreamingInnerProductVectorImageFilter.txx index 512f9615fc..309cd6e2a2 100644 --- a/Code/BasicFilters/otbStreamingInnerProductVectorImageFilter.txx +++ b/Code/BasicFilters/otbStreamingInnerProductVectorImageFilter.txx @@ -58,16 +58,16 @@ PersistentInnerProductVectorImageFilter<TInputImage> { switch (output) { - case 0: - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; - case 1: - return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); - break; - default: - // might as well make an image - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; + case 0: + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; + case 1: + return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); + break; + default: + // might as well make an image + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; } } diff --git a/Code/BasicFilters/otbStreamingMatrixTransposeMatrixImageFilter.txx b/Code/BasicFilters/otbStreamingMatrixTransposeMatrixImageFilter.txx index f53d53076b..95e5e4ead0 100644 --- a/Code/BasicFilters/otbStreamingMatrixTransposeMatrixImageFilter.txx +++ b/Code/BasicFilters/otbStreamingMatrixTransposeMatrixImageFilter.txx @@ -64,16 +64,16 @@ PersistentMatrixTransposeMatrixImageFilter<TInputImage, TInputImage2> { switch (output) { - case 0: - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; - case 1: - return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); - break; - default: - // might as well make an image - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; + case 0: + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; + case 1: + return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); + break; + default: + // might as well make an image + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; } } diff --git a/Code/BasicFilters/otbStreamingResampleImageFilter.h b/Code/BasicFilters/otbStreamingResampleImageFilter.h index 87a43fb56a..633ba87bb5 100644 --- a/Code/BasicFilters/otbStreamingResampleImageFilter.h +++ b/Code/BasicFilters/otbStreamingResampleImageFilter.h @@ -33,7 +33,7 @@ namespace otb template <class TInputImage, class TOutputImage, class TInterpolatorPrecisionType = double> class ITK_EXPORT StreamingResampleImageFilter : public itk::ResampleImageFilter<TInputImage, TOutputImage, - TInterpolatorPrecisionType> + TInterpolatorPrecisionType> { public: diff --git a/Code/BasicFilters/otbStreamingStatisticsImageFilter.txx b/Code/BasicFilters/otbStreamingStatisticsImageFilter.txx index cdc051bba1..e3243b5e71 100644 --- a/Code/BasicFilters/otbStreamingStatisticsImageFilter.txx +++ b/Code/BasicFilters/otbStreamingStatisticsImageFilter.txx @@ -72,25 +72,25 @@ PersistentStatisticsImageFilter<TInputImage> { switch (output) { - case 0: - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; - case 1: - return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); - break; - case 2: - return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); - break; - case 3: - case 4: - case 5: - case 6: - return static_cast<itk::DataObject*>(RealObjectType::New().GetPointer()); - break; - default: - // might as well make an image - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; + case 0: + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; + case 1: + return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); + break; + case 2: + return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); + break; + case 3: + case 4: + case 5: + case 6: + return static_cast<itk::DataObject*>(RealObjectType::New().GetPointer()); + break; + default: + // might as well make an image + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; } } diff --git a/Code/BasicFilters/otbStreamingStatisticsVectorImageFilter.txx b/Code/BasicFilters/otbStreamingStatisticsVectorImageFilter.txx index 3886e0d648..736132af47 100644 --- a/Code/BasicFilters/otbStreamingStatisticsVectorImageFilter.txx +++ b/Code/BasicFilters/otbStreamingStatisticsVectorImageFilter.txx @@ -69,24 +69,24 @@ PersistentStatisticsVectorImageFilter<TInputImage> { switch (output) { - case 0: - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; - case 1: - case 2: - return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); - break; - case 3: - case 4: - return static_cast<itk::DataObject*>(RealPixelObjectType::New().GetPointer()); - break; - case 5: - return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); - break; - default: - // might as well make an image - return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); - break; + case 0: + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; + case 1: + case 2: + return static_cast<itk::DataObject*>(PixelObjectType::New().GetPointer()); + break; + case 3: + case 4: + return static_cast<itk::DataObject*>(RealPixelObjectType::New().GetPointer()); + break; + case 5: + return static_cast<itk::DataObject*>(MatrixObjectType::New().GetPointer()); + break; + default: + // might as well make an image + return static_cast<itk::DataObject*>(TInputImage::New().GetPointer()); + break; } } diff --git a/Code/BasicFilters/otbVectorImageToAmplitudeImageFilter.h b/Code/BasicFilters/otbVectorImageToAmplitudeImageFilter.h index 4dbbc14d32..e9b20e8feb 100644 --- a/Code/BasicFilters/otbVectorImageToAmplitudeImageFilter.h +++ b/Code/BasicFilters/otbVectorImageToAmplitudeImageFilter.h @@ -54,18 +54,18 @@ public: template <class TInputImage, class TOutputImage> class ITK_EXPORT VectorImageToAmplitudeImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::VectorToAmplitudeFunctor< - typename TInputImage::PixelType, typename TOutputImage::PixelType> > + Functor::VectorToAmplitudeFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef VectorImageToAmplitudeImageFilter Self; typedef itk::UnaryFunctorImageFilter< - TInputImage, - TOutputImage, - Functor::VectorToAmplitudeFunctor< - typename TInputImage::PixelType, - typename TOutputImage::PixelType> > Superclass; + TInputImage, + TOutputImage, + Functor::VectorToAmplitudeFunctor< + typename TInputImage::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbVectorImageToImageListFilter.h b/Code/BasicFilters/otbVectorImageToImageListFilter.h index 4cd1fe90d3..bffef469cd 100644 --- a/Code/BasicFilters/otbVectorImageToImageListFilter.h +++ b/Code/BasicFilters/otbVectorImageToImageListFilter.h @@ -40,7 +40,7 @@ public: /** Standard typedefs */ typedef VectorImageToImageListFilter Self; typedef ImageToImageListFilter<TVectorImageType, - typename TImageList::ImageType> Superclass; + typename TImageList::ImageType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.h b/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.h index 4741dc0b5c..320a057298 100644 --- a/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.h +++ b/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.h @@ -196,16 +196,16 @@ private: template <class TInputImage, class TOutputImage = TInputImage> class ITK_EXPORT VectorRescaleIntensityImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::VectorAffineTransform< - typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::VectorAffineTransform< + typename TInputImage::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef VectorRescaleIntensityImageFilter Self; typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::VectorAffineTransform<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > Superclass; + Functor::VectorAffineTransform<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.txx b/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.txx index c572b9ab31..354a7fe917 100644 --- a/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.txx +++ b/Code/BasicFilters/otbVectorRescaleIntensityImageFilter.txx @@ -95,8 +95,8 @@ VectorRescaleIntensityImageFilter<TInputImage, TOutputImage> typedef itk::Statistics::ListSample<MeasurementVectorType> ListSampleType; typedef float HistogramMeasurementType; typedef itk::Statistics::ListSampleToHistogramGenerator<ListSampleType, HistogramMeasurementType, - itk::Statistics::DenseFrequencyContainer, - 1> HistogramGeneratorType; + itk::Statistics::DenseFrequencyContainer, + 1> HistogramGeneratorType; typedef ObjectList<ListSampleType> ListSampleListType; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageBlackmanFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageBlackmanFunction.h index 1ee14d88bd..7191a9f567 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageBlackmanFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageBlackmanFunction.h @@ -87,22 +87,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageBlackmanFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::BlackmanWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::BlackmanWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageBlackmanFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::BlackmanWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::BlackmanWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageCosineFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageCosineFunction.h index 848aad7c9e..38128a7f20 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageCosineFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageCosineFunction.h @@ -80,22 +80,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageCosineFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::CosineWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::CosineWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageCosineFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::CosineWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::CosineWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageFunctionBase.h b/Code/BasicFilters/otbWindowedSincInterpolateImageFunctionBase.h index 7834e4fd08..da2f190531 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageFunctionBase.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageFunctionBase.h @@ -132,12 +132,12 @@ namespace otb * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TWindowFunction, class TBoundaryCondition = - itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = double> + itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = double> class ITK_EXPORT WindowedSincInterpolateImageFunctionBase : public GenericInterpolateImageFunction<TInputImage, - TWindowFunction, - TBoundaryCondition, - TCoordRep> + TWindowFunction, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageGaussianFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageGaussianFunction.h index f78181a935..67a2c626f2 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageGaussianFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageGaussianFunction.h @@ -80,22 +80,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageGaussianFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::GaussianWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::GaussianWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageGaussianFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::GaussianWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::GaussianWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageHammingFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageHammingFunction.h index 6e91c342ef..c4eafe8dd4 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageHammingFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageHammingFunction.h @@ -81,22 +81,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageHammingFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::HammingWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::HammingWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageHammingFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::HammingWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::HammingWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageLanczosFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageLanczosFunction.h index c19061a4c1..e4a5ea739d 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageLanczosFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageLanczosFunction.h @@ -91,22 +91,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageLanczosFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::LanczosWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::LanczosWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageLanczosFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::LanczosWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::LanczosWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/BasicFilters/otbWindowedSincInterpolateImageWelchFunction.h b/Code/BasicFilters/otbWindowedSincInterpolateImageWelchFunction.h index 01ac15a1c8..a33d6ea3ec 100644 --- a/Code/BasicFilters/otbWindowedSincInterpolateImageWelchFunction.h +++ b/Code/BasicFilters/otbWindowedSincInterpolateImageWelchFunction.h @@ -80,22 +80,22 @@ private: * \ingroup ImageFunctionBases ImageInterpolators */ template<class TInputImage, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, class TCoordRep = - double, class TInputInterpolator = double, class TOutputInterpolator = double> + double, class TInputInterpolator = double, class TOutputInterpolator = double> class ITK_EXPORT WindowedSincInterpolateImageWelchFunction : public WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::WelchWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::WelchWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> { public: /** Standard class typedefs. */ typedef WindowedSincInterpolateImageWelchFunction Self; typedef WindowedSincInterpolateImageFunctionBase<TInputImage, - ITK_TYPENAME Function::WelchWindowFunction<TInputInterpolator, - TOutputInterpolator>, - TBoundaryCondition, - TCoordRep> + ITK_TYPENAME Function::WelchWindowFunction<TInputInterpolator, + TOutputInterpolator>, + TBoundaryCondition, + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h index eea0214968..995fb6aa6f 100644 --- a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h +++ b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h @@ -36,9 +36,9 @@ namespace otb * \ingroup IntensityImageFilters Multithreaded */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> class ITK_EXPORT BinaryFunctorNeighborhoodJoinHistogramImageFilter : public itk::ImageToImageFilter<TInputImage1, - TOutputImage> + TOutputImage> { public: /** Standard class typedefs. */ diff --git a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx index e8efdc5dad..fe653dcef6 100644 --- a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx +++ b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx @@ -31,7 +31,7 @@ namespace otb * Constructor */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::BinaryFunctorNeighborhoodJoinHistogramImageFilter() { @@ -46,7 +46,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput1(const TInputImage1 * image1) @@ -59,7 +59,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput2(const TInputImage2 * image2) @@ -69,7 +69,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> const TInputImage1 * BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GetInput1() @@ -82,7 +82,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> const TInputImage2 * BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GetInput2() @@ -95,7 +95,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GenerateInputRequestedRegion() @@ -175,7 +175,7 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO * Initialize the histogram */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::HistogramType::Pointer BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> diff --git a/Code/ChangeDetection/otbCBAMI.h b/Code/ChangeDetection/otbCBAMI.h index 6529791b49..5f106aee99 100644 --- a/Code/ChangeDetection/otbCBAMI.h +++ b/Code/ChangeDetection/otbCBAMI.h @@ -253,7 +253,8 @@ protected: { if ((iti != itj) || (iti != itk) || (iti != - itl)) termeQ += + itl)) + termeQ += static_cast<TOutput>(vcl_pow(static_cast<double>(Qxijkl((*iti), (*itj), (*itk), (*itl))), 2)); } } diff --git a/Code/ChangeDetection/otbCBAMIChangeDetector.h b/Code/ChangeDetection/otbCBAMIChangeDetector.h index 986254f7ad..8879943d1d 100644 --- a/Code/ChangeDetection/otbCBAMIChangeDetector.h +++ b/Code/ChangeDetection/otbCBAMIChangeDetector.h @@ -52,22 +52,22 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT CBAMIChangeDetector : public BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::CBAMI< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::CBAMI< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef CBAMIChangeDetector Self; typedef BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::CBAMI< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::CBAMI< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -75,7 +75,7 @@ public: itkNewMacro(Self); /** Macro defining the type*/ - itkTypeMacro(CBAMIChangeDetector,SuperClass); + itkTypeMacro(CBAMIChangeDetector, SuperClass); protected: CBAMIChangeDetector() {} diff --git a/Code/ChangeDetection/otbCorrelationChangeDetector.h b/Code/ChangeDetection/otbCorrelationChangeDetector.h index e5153b47c9..64c5866266 100644 --- a/Code/ChangeDetection/otbCorrelationChangeDetector.h +++ b/Code/ChangeDetection/otbCorrelationChangeDetector.h @@ -51,30 +51,30 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT CorrelationChangeDetector : public BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::CrossCorrelation< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::CrossCorrelation< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef CorrelationChangeDetector Self; typedef BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::CrossCorrelation< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::CrossCorrelation< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); - + /** Macro defining the type*/ - itkTypeMacro(CorrelationChangeDetector,SuperClass); + itkTypeMacro(CorrelationChangeDetector, SuperClass); protected: CorrelationChangeDetector() {} diff --git a/Code/ChangeDetection/otbCrossCorrelation.h b/Code/ChangeDetection/otbCrossCorrelation.h index 9406801588..e3401cf1b1 100644 --- a/Code/ChangeDetection/otbCrossCorrelation.h +++ b/Code/ChangeDetection/otbCrossCorrelation.h @@ -85,7 +85,7 @@ public: { crossCorrel += (static_cast<TOutput>(itA.GetPixel(pos)) - - meanA) * + meanA) * (static_cast<TOutput>(itB.GetPixel(pos)) - meanB) / (itA.Size() * vcl_sqrt(static_cast<double>(varA * varB))); } } diff --git a/Code/ChangeDetection/otbJoinHistogramMIImageFilter.h b/Code/ChangeDetection/otbJoinHistogramMIImageFilter.h index 835757244c..d1259bef64 100644 --- a/Code/ChangeDetection/otbJoinHistogramMIImageFilter.h +++ b/Code/ChangeDetection/otbJoinHistogramMIImageFilter.h @@ -53,30 +53,30 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT JoinHistogramMIImageFilter : public BinaryFunctorNeighborhoodJoinHistogramImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::JoinHistogramMI< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::JoinHistogramMI< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef JoinHistogramMIImageFilter Self; typedef BinaryFunctorNeighborhoodJoinHistogramImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::JoinHistogramMI< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::JoinHistogramMI< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); - + /** Macro defining the type*/ - itkTypeMacro(JoinHistogramMIImageFilter,SuperClass); + itkTypeMacro(JoinHistogramMIImageFilter, SuperClass); protected: JoinHistogramMIImageFilter() {} diff --git a/Code/ChangeDetection/otbKullbackLeiblerDistanceImageFilter.h b/Code/ChangeDetection/otbKullbackLeiblerDistanceImageFilter.h index 1aa5b78817..5f869fa795 100644 --- a/Code/ChangeDetection/otbKullbackLeiblerDistanceImageFilter.h +++ b/Code/ChangeDetection/otbKullbackLeiblerDistanceImageFilter.h @@ -138,22 +138,22 @@ public: template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT KullbackLeiblerDistanceImageFilter : public otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerDistance< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerDistance< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef KullbackLeiblerDistanceImageFilter Self; typedef otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerDistance< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerDistance< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/ChangeDetection/otbKullbackLeiblerProfileImageFilter.h b/Code/ChangeDetection/otbKullbackLeiblerProfileImageFilter.h index 044a652c5b..416c005596 100644 --- a/Code/ChangeDetection/otbKullbackLeiblerProfileImageFilter.h +++ b/Code/ChangeDetection/otbKullbackLeiblerProfileImageFilter.h @@ -156,22 +156,22 @@ protected: template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT KullbackLeiblerProfileImageFilter : public BinaryFunctorNeighborhoodVectorImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerProfile< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerProfile< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef KullbackLeiblerProfileImageFilter Self; typedef /*typename*/ BinaryFunctorNeighborhoodVectorImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerProfile< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerProfile< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.h b/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.h index 3e31532174..83f3aa9173 100644 --- a/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.h +++ b/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.h @@ -83,16 +83,16 @@ public: protected: typedef ROIdataConversion< - typename TInput1::ImageType, TInputROIImage> ROIConversionType1; + typename TInput1::ImageType, TInputROIImage> ROIConversionType1; typedef itk::ConstNeighborhoodIterator< - typename ROIConversionType1::OutputImageType> ROIInputType1; + typename ROIConversionType1::OutputImageType> ROIInputType1; typedef ROIdataConversion< - typename TInput2::ImageType, TInputROIImage> ROIConversionType2; + typename TInput2::ImageType, TInputROIImage> ROIConversionType2; typedef itk::ConstNeighborhoodIterator< - typename ROIConversionType2::OutputImageType> ROIInputType2; + typename ROIConversionType2::OutputImageType> ROIInputType2; CumulantsForEdgeworth<ROIInputType1> * m_CumROI1; CumulantsForEdgeworth<ROIInputType2> * m_CumROI2; @@ -105,24 +105,24 @@ private: template <class TInputImage1, class TInputImage2, class TInputROIImage, class TOutputImage> class ITK_EXPORT KullbackLeiblerSupervizedDistanceImageFilter : public otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerSupervizedDistance< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - TInputROIImage, - typename TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerSupervizedDistance< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + TInputROIImage, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef KullbackLeiblerSupervizedDistanceImageFilter Self; typedef typename otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::KullbackLeiblerSupervizedDistance< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - TInputROIImage, - typename TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::KullbackLeiblerSupervizedDistance< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + TInputROIImage, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.txx b/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.txx index 16773ec981..f0454a6b80 100644 --- a/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.txx +++ b/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.txx @@ -59,7 +59,7 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> ROIConversionType1; typedef itk::ConstNeighborhoodIterator< - typename ROIConversionType1::OutputImageType> ROIInputType1; + typename ROIConversionType1::OutputImageType> ROIInputType1; typename ROIConversionType1::Pointer convertion1 = ROIConversionType1::New(); convertion1->SetInputImage(img1); @@ -82,7 +82,7 @@ KullbackLeiblerSupervizedDistance<TInput1, TInput2, TInputROIImage, TOutput> ROIConversionType2; typedef itk::ConstNeighborhoodIterator< - typename ROIConversionType2::OutputImageType> ROIInputType2; + typename ROIConversionType2::OutputImageType> ROIInputType2; typename ROIConversionType2::Pointer convertion2 = ROIConversionType2::New(); convertion2->SetInputImage(img2); diff --git a/Code/ChangeDetection/otbLHMIChangeDetector.h b/Code/ChangeDetection/otbLHMIChangeDetector.h index 35fdfc6f44..21b7eee1b9 100644 --- a/Code/ChangeDetection/otbLHMIChangeDetector.h +++ b/Code/ChangeDetection/otbLHMIChangeDetector.h @@ -52,22 +52,22 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT LHMIChangeDetector : public BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::LHMI< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::LHMI< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef LHMIChangeDetector Self; typedef BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::LHMI< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::LHMI< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -75,7 +75,7 @@ public: itkNewMacro(Self); /** Macro defining the type*/ - itkTypeMacro(LHMIChangeDetector,SuperClass); + itkTypeMacro(LHMIChangeDetector, SuperClass); protected: LHMIChangeDetector() {} diff --git a/Code/ChangeDetection/otbMeanDifferenceImageFilter.h b/Code/ChangeDetection/otbMeanDifferenceImageFilter.h index 94eca3e616..6aba5ba043 100644 --- a/Code/ChangeDetection/otbMeanDifferenceImageFilter.h +++ b/Code/ChangeDetection/otbMeanDifferenceImageFilter.h @@ -50,22 +50,22 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT MeanDifferenceImageFilter : public BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::MeanDifference< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::MeanDifference< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MeanDifferenceImageFilter Self; typedef BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::MeanDifference< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::MeanDifference< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -73,7 +73,7 @@ public: itkNewMacro(Self); /** Macro defining the type*/ - itkTypeMacro(MeanDifferenceImageFilter,SuperClass); + itkTypeMacro(MeanDifferenceImageFilter, SuperClass); protected: MeanDifferenceImageFilter() {} diff --git a/Code/ChangeDetection/otbMeanRatioImageFilter.h b/Code/ChangeDetection/otbMeanRatioImageFilter.h index 01f08889ac..3aa53e8df2 100644 --- a/Code/ChangeDetection/otbMeanRatioImageFilter.h +++ b/Code/ChangeDetection/otbMeanRatioImageFilter.h @@ -49,22 +49,22 @@ namespace otb template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT MeanRatioImageFilter : public BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::MeanRatio< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + Functor::MeanRatio< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MeanRatioImageFilter Self; typedef BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - Functor::MeanRatio< - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, - ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, - ITK_TYPENAME TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + Functor::MeanRatio< + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage1>, + ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage2>, + ITK_TYPENAME TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -72,7 +72,7 @@ public: itkNewMacro(Self); /** Macro defining the type*/ - itkTypeMacro(MeanRatioImageFilter,SuperClass); + itkTypeMacro(MeanRatioImageFilter, SuperClass); protected: MeanRatioImageFilter() {} diff --git a/Code/Common/otbArcSpatialObject.txx b/Code/Common/otbArcSpatialObject.txx index 074dff19e4..6717a0ab97 100644 --- a/Code/Common/otbArcSpatialObject.txx +++ b/Code/Common/otbArcSpatialObject.txx @@ -174,32 +174,32 @@ ArcSpatialObject<VDimension> largeur = m_Radius * (1 - vcl_cos((alpha / 2) * PI / 180)); pntA[0] = (m_Radius / - 2) * + 2) * (vcl_cos(m_Angle1 * PI / 180) + - vcl_cos(m_Angle2 * PI / - 180)) - (m_Radius * m_Radius / longueur) * (vcl_cos(m_Angle1 * PI / 180) - vcl_cos(m_Angle2 * PI / 180)); + vcl_cos(m_Angle2 * PI / + 180)) - (m_Radius * m_Radius / longueur) * (vcl_cos(m_Angle1 * PI / 180) - vcl_cos(m_Angle2 * PI / 180)); pntA[1] = (m_Radius / - 2) * + 2) * (vcl_sin(m_Angle1 * PI / 180) + - vcl_sin(m_Angle2 * PI / - 180)) - (m_Radius * m_Radius / longueur) * (vcl_sin(m_Angle1 * PI / 180) - vcl_sin(m_Angle2 * PI / 180)); + vcl_sin(m_Angle2 * PI / + 180)) - (m_Radius * m_Radius / longueur) * (vcl_sin(m_Angle1 * PI / 180) - vcl_sin(m_Angle2 * PI / 180)); pntB[0] = (m_Radius / - 2) * + 2) * (vcl_cos(m_Angle1 * PI / 180) + - vcl_cos(m_Angle2 * PI / - 180)) + (m_Radius * m_Radius / longueur) * (vcl_cos(m_Angle1 * PI / 180) - vcl_cos(m_Angle2 * PI / 180)); + vcl_cos(m_Angle2 * PI / + 180)) + (m_Radius * m_Radius / longueur) * (vcl_cos(m_Angle1 * PI / 180) - vcl_cos(m_Angle2 * PI / 180)); pntB[1] = (m_Radius / - 2) * + 2) * (vcl_sin(m_Angle1 * PI / 180) + - vcl_sin(m_Angle2 * PI / - 180)) + (m_Radius * m_Radius / longueur) * (vcl_sin(m_Angle1 * PI / 180) - vcl_sin(m_Angle2 * PI / 180)); + vcl_sin(m_Angle2 * PI / + 180)) + (m_Radius * m_Radius / longueur) * (vcl_sin(m_Angle1 * PI / 180) - vcl_sin(m_Angle2 * PI / 180)); pntC[0] = pntB[0] - (largeur / (2 * m_Radius)) * (pntB[1] - pntA[1]); pntC[1] = pntB[1] + (largeur / (2 * m_Radius)) * (pntB[0] - pntA[0]); pntD[0] = pntA[0] - (largeur / (2 * m_Radius)) * (pntB[1] - pntA[1]); diff --git a/Code/Common/otbAttributesMapOpeningLabelMapFilter.h b/Code/Common/otbAttributesMapOpeningLabelMapFilter.h index 746c58e357..2063a5738f 100644 --- a/Code/Common/otbAttributesMapOpeningLabelMapFilter.h +++ b/Code/Common/otbAttributesMapOpeningLabelMapFilter.h @@ -38,14 +38,14 @@ namespace otb template<class TImage> class ITK_EXPORT AttributesMapOpeningLabelMapFilter : public itk::AttributeOpeningLabelMapFilter<TImage, - Functor::AttributesMapLabelObjectAccessor<typename TImage:: - LabelObjectType> > + Functor::AttributesMapLabelObjectAccessor<typename TImage:: + LabelObjectType> > { public: /** Standard class typedefs. */ typedef AttributesMapOpeningLabelMapFilter Self; typedef itk::AttributeOpeningLabelMapFilter <TImage, - Functor::AttributesMapLabelObjectAccessor<TImage> > Superclass; + Functor::AttributesMapLabelObjectAccessor<TImage> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.h b/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.h index 1ae41fe584..93dcd808c5 100644 --- a/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.h +++ b/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.h @@ -39,7 +39,7 @@ namespace otb * */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> class ITK_EXPORT BinaryFunctorNeighborhoodImageFilter : public itk::ImageToImageFilter<TInputImage1, TOutputImage> { public: diff --git a/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.txx b/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.txx index f2684feb56..82a4d2b13d 100644 --- a/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.txx +++ b/Code/Common/otbBinaryFunctorNeighborhoodImageFilter.txx @@ -31,7 +31,7 @@ namespace otb * Constructor */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::BinaryFunctorNeighborhoodImageFilter() { @@ -43,7 +43,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput1(const TInputImage1 * image1) @@ -56,7 +56,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput2(const TInputImage2 * image2) @@ -66,7 +66,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> const TInputImage1 * BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GetInput1() @@ -79,7 +79,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> const TInputImage2 * BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GetInput2() @@ -92,7 +92,7 @@ BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, T } template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::GenerateInputRequestedRegion() diff --git a/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.h b/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.h index ede2658f5f..24f007f83b 100644 --- a/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.h +++ b/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.h @@ -34,7 +34,7 @@ namespace otb * \ingroup IntensityImageFilters Multithreaded */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> class ITK_EXPORT BinaryFunctorNeighborhoodVectorImageFilter : public itk::InPlaceImageFilter<TInputImage1, TOutputImage> { diff --git a/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.txx b/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.txx index a7766e0520..06219812e5 100644 --- a/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.txx +++ b/Code/Common/otbBinaryFunctorNeighborhoodVectorImageFilter.txx @@ -31,7 +31,7 @@ namespace otb * Constructor */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::BinaryFunctorNeighborhoodVectorImageFilter() { @@ -44,7 +44,7 @@ BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputIm * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput1(const TInputImage1 * image1) @@ -57,7 +57,7 @@ BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputIm * Connect one of the operands for neighborhood-wise operation */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetInput2(const TInputImage2 * image2) @@ -70,7 +70,7 @@ BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputIm * Connect the interval of radius */ template <class TInputImage1, class TInputImage2, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void BinaryFunctorNeighborhoodVectorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> ::SetRadius(const unsigned char& min, const unsigned char& max) diff --git a/Code/Common/otbCommandLineArgumentParser.cxx b/Code/Common/otbCommandLineArgumentParser.cxx index 26212de666..46a3075784 100644 --- a/Code/Common/otbCommandLineArgumentParser.cxx +++ b/Code/Common/otbCommandLineArgumentParser.cxx @@ -405,14 +405,14 @@ void CommandLineArgumentParser::PrintUsage(std::ostream& os) const { switch (m_OptionList[i].NumberOfParameters) { - case 0: - break; - case 1: - os << " (" << m_OptionList[i].NumberOfParameters << " parameter)"; - break; - default: - os << " (" << m_OptionList[i].NumberOfParameters << " parameters)"; - break; + case 0: + break; + case 1: + os << " (" << m_OptionList[i].NumberOfParameters << " parameter)"; + break; + default: + os << " (" << m_OptionList[i].NumberOfParameters << " parameters)"; + break; } } else diff --git a/Code/Common/otbDataNode.h b/Code/Common/otbDataNode.h index b356c7680e..189282dc3e 100644 --- a/Code/Common/otbDataNode.h +++ b/Code/Common/otbDataNode.h @@ -234,7 +234,6 @@ public: */ bool HasField(std::string key) const; - /** * \return the nth field of the node as a std::pair of (key,value). * \param index the index of the field to return. diff --git a/Code/Common/otbDataNode.txx b/Code/Common/otbDataNode.txx index e7c28384ef..94502e58a5 100644 --- a/Code/Common/otbDataNode.txx +++ b/Code/Common/otbDataNode.txx @@ -171,57 +171,58 @@ DataNode<TPrecision, VDimension, TValuePrecision> itk::OStringStream oss; switch (m_NodeType) { - case ROOT: - { - oss << "Root (" << m_NodeId << ")"; - break; - } - case DOCUMENT: - { - oss << "Document (" << m_NodeId << ")"; - break; - } - case FOLDER: - { - oss << "Folder (" << m_NodeId << ")"; - break; - } - case FEATURE_POINT: - { - oss << "Point (" << m_NodeId << ") " << m_Data.point; - break; - } - case FEATURE_LINE: - { - oss << "Line (" << m_NodeId << ") " << m_Data.line->GetVertexList()->Size() << " points"; - break; - } - case FEATURE_POLYGON: - { - oss << "Polygon (" << m_NodeId << ") " << this->GetPolygonExteriorRing()->GetVertexList()->Size() << " points, " << - this->GetPolygonInteriorRings()->Size() << " interior rings"; - break; - } - case FEATURE_MULTIPOINT: - { - oss << "MultiPoint (" << m_NodeId << ")"; - break; - } - case FEATURE_MULTILINE: - { - oss << "MultiLine (" << m_NodeId << ")"; - break; - } - case FEATURE_MULTIPOLYGON: - { - oss << "MultiPolygon (" << m_NodeId << ")"; - break; - } - case FEATURE_COLLECTION: - { - oss << "Collection (" << m_NodeId << ")"; - break; - } + case ROOT: + { + oss << "Root (" << m_NodeId << ")"; + break; + } + case DOCUMENT: + { + oss << "Document (" << m_NodeId << ")"; + break; + } + case FOLDER: + { + oss << "Folder (" << m_NodeId << ")"; + break; + } + case FEATURE_POINT: + { + oss << "Point (" << m_NodeId << ") " << m_Data.point; + break; + } + case FEATURE_LINE: + { + oss << "Line (" << m_NodeId << ") " << m_Data.line->GetVertexList()->Size() << " points"; + break; + } + case FEATURE_POLYGON: + { + oss << "Polygon (" << m_NodeId << ") " << this->GetPolygonExteriorRing()->GetVertexList()->Size() << + " points, " << + this->GetPolygonInteriorRings()->Size() << " interior rings"; + break; + } + case FEATURE_MULTIPOINT: + { + oss << "MultiPoint (" << m_NodeId << ")"; + break; + } + case FEATURE_MULTILINE: + { + oss << "MultiLine (" << m_NodeId << ")"; + break; + } + case FEATURE_MULTIPOLYGON: + { + oss << "MultiPolygon (" << m_NodeId << ")"; + break; + } + case FEATURE_COLLECTION: + { + oss << "Collection (" << m_NodeId << ")"; + break; + } } if (GetMetaDataDictionary().HasKey(MetaDataKey::VectorDataKeywordlistKey)) { @@ -354,8 +355,6 @@ DataNode<TPrecision, VDimension, TValuePrecision> return false; } - - /* template <class TPrecision, unsigned int VDimension, class TValuePrecision> typename DataNode<TPrecision,VDimension,TValuePrecision> @@ -409,8 +408,6 @@ DataNode<TPrecision,VDimension,TValuePrecision> m_FieldMap.clear(); }*/ - - template <class TPrecision, unsigned int VDimension, class TValuePrecision> bool DataNode<TPrecision, VDimension, TValuePrecision> diff --git a/Code/Common/otbDrawLineSpatialObjectListFilter.txx b/Code/Common/otbDrawLineSpatialObjectListFilter.txx index c9bfb4e5e7..5d63870591 100644 --- a/Code/Common/otbDrawLineSpatialObjectListFilter.txx +++ b/Code/Common/otbDrawLineSpatialObjectListFilter.txx @@ -114,11 +114,13 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutputImage> &outputRegionForThread) && this->IsColumnOutsideOfTheRegion(&indexEndLine, &indexBeginLine, &outputRegionForThread))) { - if (indexEndLine[0] >= static_cast<OutputIndexValueType>(size[0])) this->CropRightSegment(&indexEndLine, - &indexBeginLine, - &outputRegionForThread); + if (indexEndLine[0] >= static_cast<OutputIndexValueType>(size[0])) + this->CropRightSegment(&indexEndLine, + &indexBeginLine, + &outputRegionForThread); - if (indexBeginLine[0] >= static_cast<OutputIndexValueType>(size[0])) this->CropRightSegment( + if (indexBeginLine[0] >= static_cast<OutputIndexValueType>(size[0])) + this->CropRightSegment( &indexBeginLine, &indexEndLine, & @@ -130,14 +132,16 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutputImage> * Technically, the X component of the index is inside the image */ if (this->IsDownsideTheImage(&indexBeginLine) && - input->GetLargestPossibleRegion().IsInside(indexEndLine)) this->CropSegment(&indexBeginLine, - &indexEndLine, - &outputRegionForThread); + input->GetLargestPossibleRegion().IsInside(indexEndLine)) + this->CropSegment(&indexBeginLine, + &indexEndLine, + &outputRegionForThread); if (this->IsDownsideTheImage(&indexEndLine) && - input->GetLargestPossibleRegion().IsInside(indexBeginLine)) this->CropSegment(&indexEndLine, - &indexBeginLine, - &outputRegionForThread); + input->GetLargestPossibleRegion().IsInside(indexBeginLine)) + this->CropSegment(&indexEndLine, + &indexBeginLine, + &outputRegionForThread); /** If the segments are not in the region (upside or downside the region)*/ if (!(this->IsUpsideTheRegion(&indexBeginLine, diff --git a/Code/Common/otbExtractROIBase.h b/Code/Common/otbExtractROIBase.h index efb3bf9439..521600f859 100644 --- a/Code/Common/otbExtractROIBase.h +++ b/Code/Common/otbExtractROIBase.h @@ -82,7 +82,7 @@ public: typedef itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier<itkGetStaticConstMacro(InputImageDimension), - itkGetStaticConstMacro(OutputImageDimension)> + itkGetStaticConstMacro(OutputImageDimension)> ExtractROIBaseRegionCopierType; itkGetMacro(ExtractionRegion, InputImageRegionType); diff --git a/Code/Common/otbGISTable.h b/Code/Common/otbGISTable.h index a227fdc34e..9789169c97 100644 --- a/Code/Common/otbGISTable.h +++ b/Code/Common/otbGISTable.h @@ -61,7 +61,7 @@ public: typedef itk::Point<TPrecision, TSpatialDimension> PointType; typedef PolyLineParametricPathWithValue <TPrecision, TSpatialDimension> LineType; - typedef typename LineType::Pointer LinePointerType; + typedef typename LineType::Pointer LinePointerType; typedef Polygon <TPrecision> PolygonType; typedef typename PolygonType::Pointer PolygonPointerType; diff --git a/Code/Common/otbGenericInterpolateImageFunction.h b/Code/Common/otbGenericInterpolateImageFunction.h index dae21529aa..fa3751a010 100644 --- a/Code/Common/otbGenericInterpolateImageFunction.h +++ b/Code/Common/otbGenericInterpolateImageFunction.h @@ -36,7 +36,7 @@ namespace otb * \ingroup ImageFunctions ImageInterpolators */ template <class TInputImage, class TFunction, class TBoundaryCondition = itk::ConstantBoundaryCondition<TInputImage>, - class TCoordRep = double> + class TCoordRep = double> class ITK_EXPORT GenericInterpolateImageFunction : public itk::InterpolateImageFunction<TInputImage, TCoordRep> { diff --git a/Code/Common/otbImageRegionTileMapSplitter.txx b/Code/Common/otbImageRegionTileMapSplitter.txx index 6b6ca577b2..77c81c95fe 100644 --- a/Code/Common/otbImageRegionTileMapSplitter.txx +++ b/Code/Common/otbImageRegionTileMapSplitter.txx @@ -43,9 +43,10 @@ ImageRegionTileMapSplitter<VImageDimension> for (unsigned int j = VImageDimension; j > 0; --j) { // otbMsgDevMacro(<< "*** Dimension: " << j-1); - unsigned long int remainingToDo = static_cast<unsigned long int>(vcl_ceil(static_cast<double>(requestedNumber) / numPieces)); - unsigned int maxPieces = (regionIndex[j - 1] + regionSize[j - 1] - 1) / m_AlignStep - regionIndex[j - 1] - / m_AlignStep + 1; + unsigned long int remainingToDo = + static_cast<unsigned long int>(vcl_ceil(static_cast<double>(requestedNumber) / numPieces)); + unsigned int maxPieces = (regionIndex[j - 1] + regionSize[j - 1] - 1) / m_AlignStep - regionIndex[j - 1] + / m_AlignStep + 1; unsigned int stepPerPiece = 1; if (remainingToDo < maxPieces) { diff --git a/Code/Common/otbImageToVectorImageCastFilter.h b/Code/Common/otbImageToVectorImageCastFilter.h index 6a1bb4620b..80caff2797 100644 --- a/Code/Common/otbImageToVectorImageCastFilter.h +++ b/Code/Common/otbImageToVectorImageCastFilter.h @@ -66,16 +66,16 @@ public: template <class TInputImage, class TOutputVectorImage> class ITK_EXPORT ImageToVectorImageCastFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputVectorImage, - Functor::VectorCast<typename TInputImage::PixelType, - typename TOutputVectorImage::PixelType> > + Functor::VectorCast<typename TInputImage::PixelType, + typename TOutputVectorImage::PixelType> > { public: /// Standard class typedefs typedef ImageToVectorImageCastFilter Self; typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputVectorImage, - Functor::VectorCast<typename TInputImage::PixelType, - typename TOutputVectorImage - ::PixelType> > Superclass; + Functor::VectorCast<typename TInputImage::PixelType, + typename TOutputVectorImage + ::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Common/otbLabelObjectToPolygonFunctor.txx b/Code/Common/otbLabelObjectToPolygonFunctor.txx index b9f692a4b5..8e8ae47262 100644 --- a/Code/Common/otbLabelObjectToPolygonFunctor.txx +++ b/Code/Common/otbLabelObjectToPolygonFunctor.txx @@ -102,215 +102,217 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> { switch (m_CurrentState) { - case UP_RIGHT: - { - // First candidate run - IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine - 1); - if (IsRunIndexValid(firstCandidateRun)) - { - // Second candidate run - IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine, RightEnd(m_CurrentRun), firstCandidateRun); - if (IsRunIndexValid(secondCandidateRun)) - { - // Down-Right case - m_CurrentRun = secondCandidateRun; - m_CurrentState = DOWN_RIGHT; - m_PositionFlag = LEFT_END; - WalkRight(m_CurrentLine - 1, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - - } - else - { - // Up-Right case - m_CurrentLine--; - m_CurrentRun = firstCandidateRun; - m_CurrentState = UP_RIGHT; - m_PositionFlag = RIGHT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); - - } - } - else - { - IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine - 1, RightEnd(m_CurrentRun), m_CurrentRun); - - if (IsRunIndexValid(secondCandidateRun)) - { - // Up-Left Case - m_CurrentState = UP_LEFT; - m_PositionFlag = RIGHT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, RightEnd(secondCandidateRun), m_Polygon, m_CurrentState); - m_CurrentLine--; - m_CurrentRun = secondCandidateRun; - } - else - { - // Down-Left case - m_CurrentState = DOWN_LEFT; - m_PositionFlag = LEFT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - } - } - break; - } - case DOWN_LEFT: - { - // First candidate run - IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine + 1); - - if (IsRunIndexValid(firstCandidateRun)) - { - // Second candidate run - IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine, LeftEnd(m_CurrentRun), firstCandidateRun); - - if (IsRunIndexValid(secondCandidateRun)) - { - // Up-Left case - m_CurrentRun = secondCandidateRun; - m_CurrentState = UP_LEFT; - m_PositionFlag = RIGHT_END; - WalkLeft(m_CurrentLine + 1, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); - } - else - { - // Down-Left case - m_CurrentLine++; - m_CurrentRun = firstCandidateRun; - m_CurrentState = DOWN_LEFT; - m_PositionFlag = LEFT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - - } - } - else - { - IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine + 1, LeftEnd(m_CurrentRun), m_CurrentRun); - - if (IsRunIndexValid(secondCandidateRun)) - { - // Down-Right case - m_CurrentRun = secondCandidateRun; - m_CurrentLine++; - m_CurrentState = DOWN_RIGHT; - m_PositionFlag = LEFT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - - } - else - { - // Up-Right case - m_CurrentState = UP_RIGHT; - m_PositionFlag = RIGHT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); - - } - } - break; - } - case DOWN_RIGHT: - { - IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine + 1); - - if (IsRunIndexValid(firstCandidateRun)) + case UP_RIGHT: { - IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine, RightEnd(m_CurrentRun), firstCandidateRun); - - if (IsRunIndexValid(secondCandidateRun)) + // First candidate run + IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine - 1); + if (IsRunIndexValid(firstCandidateRun)) { - // Up-Left case - m_CurrentState = UP_LEFT; - m_PositionFlag = RIGHT_END; - m_CurrentRun = secondCandidateRun; - WalkLeft(m_CurrentLine + 1, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); - + // Second candidate run + IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine, RightEnd( + m_CurrentRun), firstCandidateRun); + if (IsRunIndexValid(secondCandidateRun)) + { + // Down-Right case + m_CurrentRun = secondCandidateRun; + m_CurrentState = DOWN_RIGHT; + m_PositionFlag = LEFT_END; + WalkRight(m_CurrentLine - 1, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } + else + { + // Up-Right case + m_CurrentLine--; + m_CurrentRun = firstCandidateRun; + m_CurrentState = UP_RIGHT; + m_PositionFlag = RIGHT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } else { - // Down-Left case - m_CurrentLine++; - m_CurrentRun = firstCandidateRun; - m_CurrentState = DOWN_LEFT; - m_PositionFlag = LEFT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - + IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine - 1, RightEnd(m_CurrentRun), m_CurrentRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Up-Left Case + m_CurrentState = UP_LEFT; + m_PositionFlag = RIGHT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, RightEnd(secondCandidateRun), m_Polygon, m_CurrentState); + m_CurrentLine--; + m_CurrentRun = secondCandidateRun; + } + else + { + // Down-Left case + m_CurrentState = DOWN_LEFT; + m_PositionFlag = LEFT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + } } + break; } - else + case DOWN_LEFT: { - IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine + 1, LeftEnd(m_CurrentRun), m_CurrentRun); + // First candidate run + IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine + 1); - if (IsRunIndexValid(secondCandidateRun)) + if (IsRunIndexValid(firstCandidateRun)) { - // Down-Right case - m_CurrentLine++; - m_CurrentRun = secondCandidateRun; - m_CurrentState = DOWN_RIGHT; - m_PositionFlag = LEFT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + // Second candidate run + IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine, LeftEnd(m_CurrentRun), firstCandidateRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Up-Left case + m_CurrentRun = secondCandidateRun; + m_CurrentState = UP_LEFT; + m_PositionFlag = RIGHT_END; + WalkLeft(m_CurrentLine + 1, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + } + else + { + // Down-Left case + m_CurrentLine++; + m_CurrentRun = firstCandidateRun; + m_CurrentState = DOWN_LEFT; + m_PositionFlag = LEFT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } else { - // Up-Right case - m_CurrentState = UP_RIGHT; - m_PositionFlag = RIGHT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); - + IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine + 1, LeftEnd(m_CurrentRun), m_CurrentRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Down-Right case + m_CurrentRun = secondCandidateRun; + m_CurrentLine++; + m_CurrentState = DOWN_RIGHT; + m_PositionFlag = LEFT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } + else + { + // Up-Right case + m_CurrentState = UP_RIGHT; + m_PositionFlag = RIGHT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } + break; } - break; - } - case UP_LEFT: - { - IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine - 1); - - if (IsRunIndexValid(firstCandidateRun)) + case DOWN_RIGHT: { - IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine, LeftEnd(m_CurrentRun), firstCandidateRun); + IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine + 1); - if (IsRunIndexValid(secondCandidateRun)) + if (IsRunIndexValid(firstCandidateRun)) { - // Down-Right case - m_CurrentRun = secondCandidateRun; - m_CurrentState = DOWN_RIGHT; - m_PositionFlag = LEFT_END; - WalkRight(m_CurrentLine - 1, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - + IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine, RightEnd( + m_CurrentRun), firstCandidateRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Up-Left case + m_CurrentState = UP_LEFT; + m_PositionFlag = RIGHT_END; + m_CurrentRun = secondCandidateRun; + WalkLeft(m_CurrentLine + 1, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } + else + { + // Down-Left case + m_CurrentLine++; + m_CurrentRun = firstCandidateRun; + m_CurrentState = DOWN_LEFT; + m_PositionFlag = LEFT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } else { - // Up-Right case - m_CurrentLine--; - m_CurrentRun = firstCandidateRun; - m_CurrentState = UP_RIGHT; - m_PositionFlag = RIGHT_END; - WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine + 1, LeftEnd(m_CurrentRun), m_CurrentRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Down-Right case + m_CurrentLine++; + m_CurrentRun = secondCandidateRun; + m_CurrentState = DOWN_RIGHT; + m_PositionFlag = LEFT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + } + else + { + // Up-Right case + m_CurrentState = UP_RIGHT; + m_PositionFlag = RIGHT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } + break; } - else + case UP_LEFT: { - IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine - 1, RightEnd(m_CurrentRun), m_CurrentRun); + IndexType firstCandidateRun = Within(m_CurrentPoint, m_CurrentLine - 1); - if (IsRunIndexValid(secondCandidateRun)) + if (IsRunIndexValid(firstCandidateRun)) { - // Up-Left case - m_CurrentState = UP_LEFT; - m_PositionFlag = RIGHT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, RightEnd(secondCandidateRun), m_Polygon, m_CurrentState); - m_CurrentLine--; - m_CurrentRun = secondCandidateRun; - + IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine, LeftEnd(m_CurrentRun), firstCandidateRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Down-Right case + m_CurrentRun = secondCandidateRun; + m_CurrentState = DOWN_RIGHT; + m_PositionFlag = LEFT_END; + WalkRight(m_CurrentLine - 1, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } + else + { + // Up-Right case + m_CurrentLine--; + m_CurrentRun = firstCandidateRun; + m_CurrentState = UP_RIGHT; + m_PositionFlag = RIGHT_END; + WalkRight(m_CurrentLine, m_CurrentPoint, RightEnd(m_CurrentRun), m_Polygon, m_CurrentState); + } } else { - // Down-Left case - m_CurrentState = DOWN_LEFT; - m_PositionFlag = LEFT_END; - WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); - + IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine - 1, RightEnd(m_CurrentRun), m_CurrentRun); + + if (IsRunIndexValid(secondCandidateRun)) + { + // Up-Left case + m_CurrentState = UP_LEFT; + m_PositionFlag = RIGHT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, RightEnd(secondCandidateRun), m_Polygon, m_CurrentState); + m_CurrentLine--; + m_CurrentRun = secondCandidateRun; + + } + else + { + // Down-Left case + m_CurrentState = DOWN_LEFT; + m_PositionFlag = LEFT_END; + WalkLeft(m_CurrentLine, m_CurrentPoint, LeftEnd(m_CurrentRun), m_Polygon, m_CurrentState); + + } } + break; } - break; - } } goesOn = m_CurrentPoint != m_StartingPoint; } @@ -347,13 +349,13 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> switch (m_PositionFlag) { - case LEFT_END: - rightoffset = 1; - break; + case LEFT_END: + rightoffset = 1; + break; - case RIGHT_END: - leftoffset = -1; - break; + case RIGHT_END: + leftoffset = -1; + break; } typename RunsPerLineType::iterator it = m_InternalDataSet.at(line).begin(); @@ -483,28 +485,28 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> switch (state) { - case UP_RIGHT: - offset[1] = 1; - break; - case UP_LEFT: - offset[1] = 1; - break; - case DOWN_RIGHT: - offset[1] = 0; - break; - case DOWN_LEFT: - offset[1] = 0; - break; + case UP_RIGHT: + offset[1] = 1; + break; + case UP_LEFT: + offset[1] = 1; + break; + case DOWN_RIGHT: + offset[1] = 0; + break; + case DOWN_LEFT: + offset[1] = 0; + break; } switch (m_PositionFlag) { - case LEFT_END: - offset[0] = 0; - break; - case RIGHT_END: - offset[0] = 1; - break; + case LEFT_END: + offset[0] = 0; + break; + case RIGHT_END: + offset[0] = 1; + break; } typename PolygonType::VertexType newPoint; @@ -554,22 +556,22 @@ LabelObjectToPolygonFunctor<TLabelObject, TPolygon> switch (state) { - case UP_RIGHT: - offset[0] = 1; - offset[1] = 1; - break; - case UP_LEFT: - offset[0] = 0; - offset[1] = 1; - break; - case DOWN_RIGHT: - offset[0] = 1; - offset[1] = 0; - break; - case DOWN_LEFT: - offset[0] = 0; - offset[1] = 0; - break; + case UP_RIGHT: + offset[0] = 1; + offset[1] = 1; + break; + case UP_LEFT: + offset[0] = 0; + offset[1] = 1; + break; + case DOWN_RIGHT: + offset[0] = 1; + offset[1] = 0; + break; + case DOWN_LEFT: + offset[0] = 0; + offset[1] = 0; + break; } typename PolygonType::VertexType newPoint; diff --git a/Code/Common/otbLineSpatialObject.txx b/Code/Common/otbLineSpatialObject.txx index 8d9fe4f107..8f740df7a1 100644 --- a/Code/Common/otbLineSpatialObject.txx +++ b/Code/Common/otbLineSpatialObject.txx @@ -163,7 +163,8 @@ LineSpatialObject<VDimension> (int) ((*it1).GetPosition()[1] + (((*it2).GetPosition()[1] - (*it1).GetPosition()[1]) / - ((*it2).GetPosition()[0] - (*it1).GetPosition()[0])) * (transformedPoint[0] - (*it1).GetPosition()[0])) && + ((*it2).GetPosition()[0] - + (*it1).GetPosition()[0])) * (transformedPoint[0] - (*it1).GetPosition()[0])) && transformedPoint[0] >= (*it1).GetPosition()[0] && transformedPoint[0] <= (*it2).GetPosition()[0]) { return true; @@ -175,7 +176,8 @@ LineSpatialObject<VDimension> (int) ((((*it2).GetPosition()[1] - (*it1).GetPosition()[1]) / ((*it1).GetPosition()[0] - - (*it2).GetPosition()[0])) * ((*it1).GetPosition()[0] - transformedPoint[0]) + (*it1).GetPosition()[1]) && + (*it2).GetPosition()[0])) * + ((*it1).GetPosition()[0] - transformedPoint[0]) + (*it1).GetPosition()[1]) && transformedPoint[0] >= (*it2).GetPosition()[0] && transformedPoint[0] <= (*it1).GetPosition()[0]) { return true; @@ -187,7 +189,8 @@ LineSpatialObject<VDimension> (int) ((((*it2).GetPosition()[0] - (*it1).GetPosition()[0]) / ((*it2).GetPosition()[1] - - (*it1).GetPosition()[1])) * (transformedPoint[1] - (*it1).GetPosition()[1]) + (*it1).GetPosition()[0]) && + (*it1).GetPosition()[1])) * + (transformedPoint[1] - (*it1).GetPosition()[1]) + (*it1).GetPosition()[0]) && transformedPoint[1] >= (*it1).GetPosition()[1] && transformedPoint[1] <= (*it2).GetPosition()[1]) { return true; @@ -199,7 +202,8 @@ LineSpatialObject<VDimension> (int) ((((*it2).GetPosition()[0] - (*it1).GetPosition()[0]) / ((*it1).GetPosition()[1] - - (*it2).GetPosition()[1])) * ((*it1).GetPosition()[1] - transformedPoint[1]) + (*it1).GetPosition()[0]) && + (*it2).GetPosition()[1])) * + ((*it1).GetPosition()[1] - transformedPoint[1]) + (*it1).GetPosition()[0]) && transformedPoint[1] >= (*it2).GetPosition()[1] && transformedPoint[1] <= (*it1).GetPosition()[1]) { return true; diff --git a/Code/Common/otbObjectList.h b/Code/Common/otbObjectList.h index 8d91617664..2c0b6cfbe7 100644 --- a/Code/Common/otbObjectList.h +++ b/Code/Common/otbObjectList.h @@ -183,7 +183,7 @@ public: /** * Decrement. */ - Iterator& operator --() + Iterator & operator --() { --m_Iter; return *this; @@ -222,7 +222,7 @@ public: /** * Instantiation operator. */ - Iterator& operator =(const Iterator& it) + Iterator & operator =(const Iterator& it) { m_Iter = it.m_Iter; return *this; @@ -274,7 +274,7 @@ public: /** * Increment. */ - ConstIterator& operator ++() + ConstIterator & operator ++() { ++m_Iter; return *this; @@ -282,7 +282,7 @@ public: /** * Decrement. */ - ConstIterator& operator --() + ConstIterator & operator --() { --m_Iter; return *this; @@ -304,7 +304,7 @@ public: /** * Instantiation operator. */ - ConstIterator& operator =(const ConstIterator& it) + ConstIterator & operator =(const ConstIterator& it) { m_Iter = it.m_Iter; return *this; @@ -312,7 +312,7 @@ public: /** * Instantiation operator. */ - ConstIterator& operator =(const Iterator& it) + ConstIterator & operator =(const Iterator& it) { m_Iter = it.m_Iter; return *this; @@ -381,7 +381,7 @@ public: /** * Decrement. */ - ReverseIterator& operator --() + ReverseIterator & operator --() { --m_Iter; return *this; @@ -403,7 +403,7 @@ public: /** * Instantiation operator. */ - ReverseIterator& operator =(const ReverseIterator& it) + ReverseIterator & operator =(const ReverseIterator& it) { m_Iter = it.m_Iter; return *this; @@ -458,7 +458,7 @@ public: /** * Increment. */ - ReverseConstIterator& operator ++() + ReverseConstIterator & operator ++() { ++m_Iter; return *this; @@ -466,7 +466,7 @@ public: /** * Decrement. */ - ReverseConstIterator& operator --() + ReverseConstIterator & operator --() { --m_Iter; return *this; @@ -488,7 +488,7 @@ public: /** * Instantiation operator. */ - ReverseConstIterator& operator =(const ReverseConstIterator& it) + ReverseConstIterator & operator =(const ReverseConstIterator& it) { m_Iter = it.m_Iter; return *this; @@ -496,7 +496,7 @@ public: /** * Instantiation operator. */ - ReverseConstIterator& operator =(const ReverseIterator& it) + ReverseConstIterator & operator =(const ReverseIterator& it) { m_Iter = it.m_Iter; return *this; diff --git a/Code/Common/otbPathFunction.h b/Code/Common/otbPathFunction.h index 129e359475..0bb14e0eeb 100644 --- a/Code/Common/otbPathFunction.h +++ b/Code/Common/otbPathFunction.h @@ -40,7 +40,7 @@ namespace otb * \ingroup PathFunction */ template <class TInputPath, - class TOutput> + class TOutput> class ITK_EXPORT PathFunction : public itk::FunctionBase<TInputPath, TOutput> { diff --git a/Code/Common/otbPathListToHistogramGenerator.h b/Code/Common/otbPathListToHistogramGenerator.h index fbd2c0d1be..76b8110b28 100644 --- a/Code/Common/otbPathListToHistogramGenerator.h +++ b/Code/Common/otbPathListToHistogramGenerator.h @@ -74,9 +74,9 @@ public: typedef itk::Statistics::DenseFrequencyContainer FrequencyContainerType; typedef itk::Statistics::ListSampleToHistogramGenerator< - ListSampleType, - MeasurementType, - FrequencyContainerType, 1> GeneratorType; + ListSampleType, + MeasurementType, + FrequencyContainerType, 1> GeneratorType; typedef typename GeneratorType::Pointer GeneratorPointer; diff --git a/Code/Common/otbPointSetAndValuesFunction.h b/Code/Common/otbPointSetAndValuesFunction.h index 95c7dc5e05..d26feeec75 100644 --- a/Code/Common/otbPointSetAndValuesFunction.h +++ b/Code/Common/otbPointSetAndValuesFunction.h @@ -38,7 +38,7 @@ public: /** Standard typedefs */ typedef PointSetAndValuesFunction Self; typedef itk::FunctionBase<itk::Point<TCoordRep, - ::itk::GetPointSetDimension<TPointSet>::PointDimension>, TValue> Superclass; + ::itk::GetPointSetDimension<TPointSet>::PointDimension>, TValue> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> diff --git a/Code/Common/otbPolygon.txx b/Code/Common/otbPolygon.txx index 19d757bdf9..f9bc3cfcf8 100644 --- a/Code/Common/otbPolygon.txx +++ b/Code/Common/otbPolygon.txx @@ -319,7 +319,7 @@ Polygon<TValue> { double xcross = (oo2 - oo1) / (cd1 - cd2); resp = (xamin <xcross && xbmin <xcross - && xamax> xcross && xbmax> xcross); + && xamax> xcross && xbmax> xcross); } } return resp; diff --git a/Code/Common/otbPostGISTable.h b/Code/Common/otbPostGISTable.h index 90f58109b3..2654de0b92 100644 --- a/Code/Common/otbPostGISTable.h +++ b/Code/Common/otbPostGISTable.h @@ -37,10 +37,10 @@ class ITK_EXPORT PostGISTable { public: /** Standard class typedefs */ - typedef PostGISTable Self; + typedef PostGISTable Self; typedef GISTable <TConnectionImplementation, TPrecision, TSpatialDimension> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Standard macros */ itkNewMacro(Self); @@ -48,17 +48,17 @@ public: itkStaticConstMacro(Dimension, unsigned int, TSpatialDimension); /** Some convenient typedefs */ - typedef TConnectionImplementation ConnectionType; - typedef typename ConnectionType::Pointer ConnectionPointerType; + typedef TConnectionImplementation ConnectionType; + typedef typename ConnectionType::Pointer ConnectionPointerType; typedef itk::Point<TPrecision, TSpatialDimension> PointType; typedef PolyLineParametricPathWithValue <TPrecision, TSpatialDimension> LineType; - typedef typename LineType::Pointer LinePointerType; - typedef Polygon <TPrecision> PolygonType; - typedef typename PolygonType::Pointer PolygonPointerType; - typedef typename PolygonType::ConstPointer PolygonConstPointerType; - typedef ObjectList<PolygonType> PolygonListType; - typedef typename PolygonListType::Pointer PolygonListPointerType; - typedef typename PolygonListType::ConstPointer PolygonListConstPointerType; + typedef typename LineType::Pointer LinePointerType; + typedef Polygon <TPrecision> PolygonType; + typedef typename PolygonType::Pointer PolygonPointerType; + typedef typename PolygonType::ConstPointer PolygonConstPointerType; + typedef ObjectList<PolygonType> PolygonListType; + typedef typename PolygonListType::Pointer PolygonListPointerType; + typedef typename PolygonListType::ConstPointer PolygonListConstPointerType; /** typedefs for correct polygon */ typedef otb::CorrectPolygonFunctor<PolygonType> CorrectFunctorType; diff --git a/Code/Common/otbRadiometricAttributesLabelMapFilter.h b/Code/Common/otbRadiometricAttributesLabelMapFilter.h index 872489e7db..eee0b31cdb 100644 --- a/Code/Common/otbRadiometricAttributesLabelMapFilter.h +++ b/Code/Common/otbRadiometricAttributesLabelMapFilter.h @@ -148,8 +148,8 @@ template<class TImage, class TFeatureImage> class ITK_EXPORT RadiometricAttributesLabelMapFilter : public LabelMapFeaturesFunctorImageFilter <TImage, - typename Functor::MultiStatsAttributesLabelObjectFunctor - <typename TImage::LabelObjectType, otb::Image<double, 2> > > + typename Functor::MultiStatsAttributesLabelObjectFunctor + <typename TImage::LabelObjectType, otb::Image<double, 2> > > { public: /** Some convenient typedefs. */ @@ -184,42 +184,42 @@ public: // GEMI typedef Functor::GEMI <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> GEMIFunctorType; + FeatureInternalPixelType, InternalPrecisionType> GEMIFunctorType; typedef MultiChannelRAndNIRIndexImageFilter <FeatureImageType, InternalImageType, GEMIFunctorType> GEMIFilterType; typedef typename GEMIFilterType::Pointer GEMIFilterPointerType; // NDVI typedef Functor::NDVI <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> NDVIFunctorType; + FeatureInternalPixelType, InternalPrecisionType> NDVIFunctorType; typedef MultiChannelRAndNIRIndexImageFilter <FeatureImageType, InternalImageType, NDVIFunctorType> NDVIFilterType; typedef typename NDVIFilterType::Pointer NDVIFilterPointerType; // IR typedef Functor::IR <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> IRFunctorType; + FeatureInternalPixelType, InternalPrecisionType> IRFunctorType; typedef MultiChannelGAndRIndexImageFilter <FeatureImageType, InternalImageType, IRFunctorType> IRFilterType; typedef typename IRFilterType::Pointer IRFilterPointerType; // IC typedef Functor::IC <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> ICFunctorType; + FeatureInternalPixelType, InternalPrecisionType> ICFunctorType; typedef MultiChannelGAndRIndexImageFilter <FeatureImageType, InternalImageType, ICFunctorType> ICFilterType; typedef typename ICFilterType::Pointer ICFilterPointerType; // IB typedef Functor::IB <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> IBFunctorType; + FeatureInternalPixelType, InternalPrecisionType> IBFunctorType; typedef MultiChannelGAndRIndexImageFilter <FeatureImageType, InternalImageType, IBFunctorType> IBFilterType; typedef typename IBFilterType::Pointer IBFilterPointerType; // NDWI2 typedef Functor::NDWI2 <FeatureInternalPixelType, - FeatureInternalPixelType, InternalPrecisionType> NDWI2FunctorType; + FeatureInternalPixelType, InternalPrecisionType> NDWI2FunctorType; typedef itk::UnaryFunctorImageFilter <FeatureImageType, InternalImageType, NDWI2FunctorType> NDWI2FilterType; typedef typename NDWI2FilterType::Pointer NDWI2FilterPointerType; diff --git a/Code/Common/otbRectangle.txx b/Code/Common/otbRectangle.txx index 0282207ce3..dd500a2bee 100644 --- a/Code/Common/otbRectangle.txx +++ b/Code/Common/otbRectangle.txx @@ -35,7 +35,8 @@ Rectangle<TValue> ::IsInside(VertexType point) const { /*Iterate through the inputVertexList*/ - if (m_VertexList->Size() < 2) itkGenericExceptionMacro( + if (m_VertexList->Size() < 2) + itkGenericExceptionMacro( << "Rectangle needs TWO vertex, up-to-date the start and the end of the segments with AdDVertex Method "); VertexListConstIteratorType it = m_VertexList->Begin(); @@ -192,7 +193,8 @@ void Rectangle<TValue> ::AddVertex(const ContinuousIndexType& vertex) { - if (m_VertexList->Size() > 1) itkGenericExceptionMacro( + if (m_VertexList->Size() > 1) + itkGenericExceptionMacro( << "Rectangle needs only TWO vertex, a width and an orientation "); m_VertexList->InsertElement(m_VertexList->Size(), vertex); diff --git a/Code/Common/otbRemoteSensingRegion.h b/Code/Common/otbRemoteSensingRegion.h index ce37d0d191..befd72d3d9 100644 --- a/Code/Common/otbRemoteSensingRegion.h +++ b/Code/Common/otbRemoteSensingRegion.h @@ -228,7 +228,7 @@ public: /** Compare two regions. */ bool - operator == (const Self& region) const + operator ==(const Self& region) const { bool same = 1; same = (m_Index == region.m_Index); @@ -238,7 +238,7 @@ public: /** Compare two regions. */ bool - operator != (const Self& region) const + operator !=(const Self& region) const { bool same = 1; same = (m_Index == region.m_Index); @@ -368,8 +368,8 @@ std::ostream & operator <<(std::ostream& os, const RemoteSensingRegion<TType>& r return os; } -template<class ImageType, class RemoteSensingRegionType > -typename ImageType::RegionType +template<class ImageType, class RemoteSensingRegionType> +typename ImageType::RegionType TransformPhysicalRegionToIndexRegion(const RemoteSensingRegionType& region, const ImageType* image) { typename ImageType::RegionType outputRegion; @@ -381,7 +381,6 @@ TransformPhysicalRegionToIndexRegion(const RemoteSensingRegionType& region, cons point[1] = region.GetIndex()[1]; image->TransformPhysicalPointToIndex(point, index); - point[0] = region.GetIndex()[0] + region.GetSize()[0]; point[1] = region.GetIndex()[1] + region.GetSize()[1]; image->TransformPhysicalPointToIndex(point, index2); @@ -398,7 +397,6 @@ TransformPhysicalRegionToIndexRegion(const RemoteSensingRegionType& region, cons return outputRegion; } - } // end namespace otb #endif diff --git a/Code/Common/otbShapeAttributesLabelMapFilter.h b/Code/Common/otbShapeAttributesLabelMapFilter.h index 33269b5437..2e08a1efac 100644 --- a/Code/Common/otbShapeAttributesLabelMapFilter.h +++ b/Code/Common/otbShapeAttributesLabelMapFilter.h @@ -165,13 +165,13 @@ private: * \ingroup ImageEnhancement MathematicalMorphologyImageFilters */ template<class TImage, - class TLabelImage = Image<typename TImage::PixelType, - TImage::ImageDimension> > + class TLabelImage = Image<typename TImage::PixelType, + TImage::ImageDimension> > class ITK_EXPORT ShapeAttributesLabelMapFilter : public otb::LabelMapFeaturesFunctorImageFilter <TImage, - typename Functor::ShapeAttributesLabelObjectFunctor - <typename TImage::LabelObjectType, TLabelImage> > + typename Functor::ShapeAttributesLabelObjectFunctor + <typename TImage::LabelObjectType, TLabelImage> > { public: /** Template parameters typedefs */ diff --git a/Code/Common/otbShiftScaleImageAdaptor.h b/Code/Common/otbShiftScaleImageAdaptor.h index f4fe97a4b4..bc4ba9c0f9 100644 --- a/Code/Common/otbShiftScaleImageAdaptor.h +++ b/Code/Common/otbShiftScaleImageAdaptor.h @@ -100,23 +100,23 @@ private: template <class TImage, class TOutputPixelType> class ITK_EXPORT ShiftScaleImageAdaptor : public itk::ImageAdaptor<TImage, Accessor::ShiftScalePixelAccessor< - typename TImage::PixelType, - TOutputPixelType> > + typename TImage::PixelType, + TOutputPixelType> > { public: /** Standard class typedefs. */ typedef ShiftScaleImageAdaptor Self; typedef itk::ImageAdaptor< - TImage, - Accessor::ShiftScalePixelAccessor<typename TImage::PixelType, TOutputPixelType> - > Superclass; + TImage, + Accessor::ShiftScalePixelAccessor<typename TImage::PixelType, TOutputPixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; typedef typename TImage::PixelType InternalType; typedef typename Superclass::IndexType IndexType; typedef typename Accessor::ShiftScalePixelAccessor< - typename TImage::PixelType, - TOutputPixelType> AccessorType; + typename TImage::PixelType, + TOutputPixelType> AccessorType; typedef typename AccessorType::ExternalType PixelType; /** Method for creation through the object factory. */ diff --git a/Code/Common/otbStandardFilterWatcher.cxx b/Code/Common/otbStandardFilterWatcher.cxx index 15ceca9b9c..0bb0806591 100644 --- a/Code/Common/otbStandardFilterWatcher.cxx +++ b/Code/Common/otbStandardFilterWatcher.cxx @@ -34,7 +34,7 @@ StandardFilterWatcher StandardFilterWatcher ::StandardFilterWatcher(itk::ProcessObject* process, const std::string& comment) - : FilterWatcherBase(process, comment.c_str()) + : FilterWatcherBase(process, comment.c_str()) { m_StarsCount = 50; } diff --git a/Code/Common/otbStandardFilterWatcher.h b/Code/Common/otbStandardFilterWatcher.h index 8497c7401a..f833a7de33 100644 --- a/Code/Common/otbStandardFilterWatcher.h +++ b/Code/Common/otbStandardFilterWatcher.h @@ -58,7 +58,6 @@ public: StandardFilterWatcher(itk::ProcessObject* process, const std::string& comment = ""); - /** Copy constructor */ StandardFilterWatcher(const StandardFilterWatcher&); diff --git a/Code/Common/otbStatisticsAttributesLabelMapFilter.h b/Code/Common/otbStatisticsAttributesLabelMapFilter.h index f8ebb6e9b7..f7f7f765c6 100644 --- a/Code/Common/otbStatisticsAttributesLabelMapFilter.h +++ b/Code/Common/otbStatisticsAttributesLabelMapFilter.h @@ -43,11 +43,11 @@ public: // Matrix typedef typedef typename itk::Matrix<double, - TFeatureImage::ImageDimension, - TFeatureImage::ImageDimension> MatrixType; + TFeatureImage::ImageDimension, + TFeatureImage::ImageDimension> MatrixType; // Vector typedef typedef typename itk::Vector<double, - TFeatureImage::ImageDimension> VectorType; + TFeatureImage::ImageDimension> VectorType; /// Typedef of the feature image type typedef typename TFeatureImage::PixelType FeatureType; @@ -121,8 +121,8 @@ template<class TImage, class TFeatureImage> class ITK_EXPORT StatisticsAttributesLabelMapFilter : public LabelMapFeaturesFunctorImageFilter <TImage, - typename Functor::StatisticsAttributesLabelObjectFunctor - <typename TImage::LabelObjectType, TFeatureImage> > + typename Functor::StatisticsAttributesLabelObjectFunctor + <typename TImage::LabelObjectType, TFeatureImage> > { public: /** Some convenient typedefs. */ diff --git a/Code/Common/otbStreamingTraits.txx b/Code/Common/otbStreamingTraits.txx index f488b84c22..cd913b2a40 100644 --- a/Code/Common/otbStreamingTraits.txx +++ b/Code/Common/otbStreamingTraits.txx @@ -45,140 +45,140 @@ unsigned long StreamingTraits<TImage> switch (mode) { - case SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS: // Just like SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS - case SET_NUMBER_OF_STREAM_DIVISIONS: - { - numDivisions = numberOfStreamDivision; - } - break; - case SET_BUFFER_MEMORY_SIZE: - { - const unsigned long bufferMemorySizeOctet = bufferMemorySize / 8; - unsigned long numberColumnsOfRegion = region.GetSize()[0]; // X dimension - const unsigned long sizeLine = numberColumnsOfRegion * \ - image->GetNumberOfComponentsPerPixel() * \ - sizeof(PixelType); - unsigned long regionSize = region.GetSize()[1] * sizeLine; - otbMsgDevMacro(<< "image->GetNumberOfComponentsPerPixel() = " << image->GetNumberOfComponentsPerPixel()); - otbMsgDevMacro(<< "sizeof(PixelType) = " << sizeof(PixelType)); - otbMsgDevMacro(<< "numberColumnsOfRegion = " << numberColumnsOfRegion); - otbMsgDevMacro(<< "sizeLine = " << sizeLine); - otbMsgDevMacro(<< "regionSize = " << regionSize); - otbMsgDevMacro(<< "BufferMemorySize = " << bufferMemorySize); - otbMsgDevMacro(<< "bufferMemorySizeOctet = " << bufferMemorySizeOctet); - - //Active streaming - if (regionSize > bufferMemorySizeOctet) + case SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS: // Just like SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS + case SET_NUMBER_OF_STREAM_DIVISIONS: { - //The regionSize must be at list equal to the sizeLine - if (regionSize < sizeLine) - { - otbMsgDevMacro(<< "Force buffer size."); - regionSize = sizeLine; - } - //Calculate NumberOfStreamDivisions - numDivisions = static_cast<unsigned long>( - vcl_ceil(static_cast<double>(regionSize) / static_cast<double>(bufferMemorySizeOctet)) - ); + numDivisions = numberOfStreamDivision; } - else + break; + case SET_BUFFER_MEMORY_SIZE: { - //Non streaming - numDivisions = 1; - } + const unsigned long bufferMemorySizeOctet = bufferMemorySize / 8; + unsigned long numberColumnsOfRegion = region.GetSize()[0]; // X dimension + const unsigned long sizeLine = numberColumnsOfRegion * \ + image->GetNumberOfComponentsPerPixel() * \ + sizeof(PixelType); + unsigned long regionSize = region.GetSize()[1] * sizeLine; + otbMsgDevMacro(<< "image->GetNumberOfComponentsPerPixel() = " << image->GetNumberOfComponentsPerPixel()); + otbMsgDevMacro(<< "sizeof(PixelType) = " << sizeof(PixelType)); + otbMsgDevMacro(<< "numberColumnsOfRegion = " << numberColumnsOfRegion); + otbMsgDevMacro(<< "sizeLine = " << sizeLine); + otbMsgDevMacro(<< "regionSize = " << regionSize); + otbMsgDevMacro(<< "BufferMemorySize = " << bufferMemorySize); + otbMsgDevMacro(<< "bufferMemorySizeOctet = " << bufferMemorySizeOctet); + + //Active streaming + if (regionSize > bufferMemorySizeOctet) + { + //The regionSize must be at list equal to the sizeLine + if (regionSize < sizeLine) + { + otbMsgDevMacro(<< "Force buffer size."); + regionSize = sizeLine; + } + //Calculate NumberOfStreamDivisions + numDivisions = static_cast<unsigned long>( + vcl_ceil(static_cast<double>(regionSize) / static_cast<double>(bufferMemorySizeOctet)) + ); + } + else + { + //Non streaming + numDivisions = 1; + } - } - break; - case SET_BUFFER_NUMBER_OF_LINES: - { - if (bufferNumberOfLinesDivisions < 1) - { - itkGenericExceptionMacro(<< "Buffer number of lines division must be greater than 0 !"); - } - /* Calculate number of split */ - unsigned long numberLinesOfRegion = region.GetSize()[1]; // Y dimension - if (numberLinesOfRegion > bufferNumberOfLinesDivisions) - { - numDivisions = - static_cast<unsigned long>(vcl_ceil(static_cast<double>(numberLinesOfRegion) / - static_cast<double>(bufferNumberOfLinesDivisions))); - } - else - { - //Non streaming - numDivisions = 1; } - } - break; - case SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: // Just like SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS - case SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: - { - typedef otb::ConfigurationFile ConfigurationType; - ConfigurationType::Pointer conf = ConfigurationType::GetInstance(); - std::streamoff streamMaxSizeBufferForStreamingBytes; - std::streamoff streamImageSizeToActivateStreamingBytes; - try + break; + case SET_BUFFER_NUMBER_OF_LINES: { - streamMaxSizeBufferForStreamingBytes = conf->GetParameter<std::streamoff>( - "OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING"); - streamImageSizeToActivateStreamingBytes = conf->GetParameter<std::streamoff>( - "OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING"); + if (bufferNumberOfLinesDivisions < 1) + { + itkGenericExceptionMacro(<< "Buffer number of lines division must be greater than 0 !"); + } + /* Calculate number of split */ + unsigned long numberLinesOfRegion = region.GetSize()[1]; // Y dimension + if (numberLinesOfRegion > bufferNumberOfLinesDivisions) + { + numDivisions = + static_cast<unsigned long>(vcl_ceil(static_cast<double>(numberLinesOfRegion) / + static_cast<double>(bufferNumberOfLinesDivisions))); + } + else + { + //Non streaming + numDivisions = 1; + } } - catch(...) + break; + case SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: // Just like SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS + case SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: { - // We should never have to go here if the configuration file is - // correct and found. In case it is not fallback on the cmake - // defined constants. - streamMaxSizeBufferForStreamingBytes = OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING; - streamImageSizeToActivateStreamingBytes = OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING; - } + typedef otb::ConfigurationFile ConfigurationType; + ConfigurationType::Pointer conf = ConfigurationType::GetInstance(); + std::streamoff streamMaxSizeBufferForStreamingBytes; + std::streamoff streamImageSizeToActivateStreamingBytes; + try + { + streamMaxSizeBufferForStreamingBytes = conf->GetParameter<std::streamoff>( + "OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING"); + streamImageSizeToActivateStreamingBytes = conf->GetParameter<std::streamoff>( + "OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING"); + } + catch(...) + { + // We should never have to go here if the configuration file is + // correct and found. In case it is not fallback on the cmake + // defined constants. + streamMaxSizeBufferForStreamingBytes = OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING; + streamImageSizeToActivateStreamingBytes = OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING; + } - //Convert in octet unit - std::streamoff streamMaxSizeBufferForStreaming = streamMaxSizeBufferForStreamingBytes / 8; - const std::streamoff streamImageSizeToActivateStreaming = streamImageSizeToActivateStreamingBytes / 8; + //Convert in octet unit + std::streamoff streamMaxSizeBufferForStreaming = streamMaxSizeBufferForStreamingBytes / 8; + const std::streamoff streamImageSizeToActivateStreaming = streamImageSizeToActivateStreamingBytes / 8; - std::streamoff numberColumnsOfRegion = region.GetSize()[0]; // X dimension - const std::streamoff sizeLine = static_cast<std::streamoff>(numberColumnsOfRegion) * \ - static_cast<std::streamoff>(image->GetNumberOfComponentsPerPixel()) * \ - static_cast<std::streamoff>(sizeof(PixelType)); - const std::streamoff regionSize = region.GetSize()[1] * sizeLine; - otbMsgDevMacro(<< "streamImageSizeToActivateStreaming in Bytes = " << streamImageSizeToActivateStreamingBytes); - otbMsgDevMacro(<< "streamMaxSizeBufferForStreaming in Bytes = " << streamMaxSizeBufferForStreamingBytes); - otbMsgDevMacro(<< "streamImageSizeToActivateStreaming = " << streamImageSizeToActivateStreaming); - otbMsgDevMacro(<< "streamMaxSizeBufferForStreaming = " << streamMaxSizeBufferForStreaming); - otbMsgDevMacro(<< "image->GetNumberOfComponentsPerPixel() = " << image->GetNumberOfComponentsPerPixel()); - otbMsgDevMacro(<< "sizeof(PixelType) = " << sizeof(PixelType)); - otbMsgDevMacro(<< "numberColumnsOfRegion = " << numberColumnsOfRegion); - otbMsgDevMacro(<< "sizeLine = " << sizeLine); - otbMsgDevMacro(<< "regionSize = " << regionSize); + std::streamoff numberColumnsOfRegion = region.GetSize()[0]; // X dimension + const std::streamoff sizeLine = static_cast<std::streamoff>(numberColumnsOfRegion) * \ + static_cast<std::streamoff>(image->GetNumberOfComponentsPerPixel()) * \ + static_cast<std::streamoff>(sizeof(PixelType)); + const std::streamoff regionSize = region.GetSize()[1] * sizeLine; + otbMsgDevMacro(<< "streamImageSizeToActivateStreaming in Bytes = " << streamImageSizeToActivateStreamingBytes); + otbMsgDevMacro(<< "streamMaxSizeBufferForStreaming in Bytes = " << streamMaxSizeBufferForStreamingBytes); + otbMsgDevMacro(<< "streamImageSizeToActivateStreaming = " << streamImageSizeToActivateStreaming); + otbMsgDevMacro(<< "streamMaxSizeBufferForStreaming = " << streamMaxSizeBufferForStreaming); + otbMsgDevMacro(<< "image->GetNumberOfComponentsPerPixel() = " << image->GetNumberOfComponentsPerPixel()); + otbMsgDevMacro(<< "sizeof(PixelType) = " << sizeof(PixelType)); + otbMsgDevMacro(<< "numberColumnsOfRegion = " << numberColumnsOfRegion); + otbMsgDevMacro(<< "sizeLine = " << sizeLine); + otbMsgDevMacro(<< "regionSize = " << regionSize); - //Active streaming - if (regionSize > streamImageSizeToActivateStreaming) - { - //On s'assure que la taille du bandeau fait au moins une ligne de l'image si pas TILING - if ((mode != SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS) - && (streamMaxSizeBufferForStreaming < sizeLine)) + //Active streaming + if (regionSize > streamImageSizeToActivateStreaming) { - otbMsgDevMacro(<< "Force buffer size."); - streamMaxSizeBufferForStreaming = sizeLine; + //On s'assure que la taille du bandeau fait au moins une ligne de l'image si pas TILING + if ((mode != SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS) + && (streamMaxSizeBufferForStreaming < sizeLine)) + { + otbMsgDevMacro(<< "Force buffer size."); + streamMaxSizeBufferForStreaming = sizeLine; + } + otbMsgDevMacro(<< "Buffer size : " << streamMaxSizeBufferForStreaming); + //Calculate NumberOfStreamDivisions + numDivisions = + static_cast<unsigned long>(vcl_ceil(static_cast<double>(regionSize) / + static_cast<double>(streamMaxSizeBufferForStreaming))); + } + else + { + //Non streaming + numDivisions = 1; } - otbMsgDevMacro(<< "Buffer size : " << streamMaxSizeBufferForStreaming); - //Calculate NumberOfStreamDivisions - numDivisions = - static_cast<unsigned long>(vcl_ceil(static_cast<double>(regionSize) / - static_cast<double>(streamMaxSizeBufferForStreaming))); - } - else - { - //Non streaming - numDivisions = 1; - } - } - break; - default: - itkGenericExceptionMacro(<< "Method use to calculate number of stream divisions is not set !"); - break; + } + break; + default: + itkGenericExceptionMacro(<< "Method use to calculate number of stream divisions is not set !"); + break; } if (numDivisions == 0) numDivisions = 1; otbMsgDevMacro(<< " -> Resume : method : " << mode << "\n -> Number of divisions = " << numDivisions); @@ -278,27 +278,27 @@ std::string StreamingTraits<TImage> { switch (mode) { - case SET_NUMBER_OF_STREAM_DIVISIONS: - return "CalculationDivisionEnumType::SET_NUMBER_OF_STREAM_DIVISIONS"; - break; - case SET_BUFFER_MEMORY_SIZE: - return "CalculationDivisionEnumType::SET_BUFFER_MEMORY_SIZE"; - break; - case SET_BUFFER_NUMBER_OF_LINES: - return "CalculationDivisionEnumType::SET_BUFFER_NUMBER_OF_LINES"; - break; - case SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: - return "CalculationDivisionEnumType::SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS"; - break; - case SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS: - return "CalculationDivisionEnumType::SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS"; - break; - case SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: - return "CalculationDivisionEnumType::SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS"; - break; - default: - return "unknown"; - break; + case SET_NUMBER_OF_STREAM_DIVISIONS: + return "CalculationDivisionEnumType::SET_NUMBER_OF_STREAM_DIVISIONS"; + break; + case SET_BUFFER_MEMORY_SIZE: + return "CalculationDivisionEnumType::SET_BUFFER_MEMORY_SIZE"; + break; + case SET_BUFFER_NUMBER_OF_LINES: + return "CalculationDivisionEnumType::SET_BUFFER_NUMBER_OF_LINES"; + break; + case SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: + return "CalculationDivisionEnumType::SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS"; + break; + case SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS: + return "CalculationDivisionEnumType::SET_TILING_WITH_SET_NUMBER_OF_STREAM_DIVISIONS"; + break; + case SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS: + return "CalculationDivisionEnumType::SET_TILING_WITH_SET_AUTOMATIC_NUMBER_OF_STREAM_DIVISIONS"; + break; + default: + return "unknown"; + break; } } diff --git a/Code/Common/otbVectorDataExtractROI.txx b/Code/Common/otbVectorDataExtractROI.txx index 282fac9f72..4b46df2ca4 100644 --- a/Code/Common/otbVectorDataExtractROI.txx +++ b/Code/Common/otbVectorDataExtractROI.txx @@ -137,106 +137,106 @@ VectorDataExtractROI<TVectorData> switch (dataNode->GetNodeType()) { - case ROOT: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - ++m_Kept; - break; - } - case DOCUMENT: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } - case FOLDER: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } - case FEATURE_POINT: - { - if (m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint()))) + case ROOT: { - newDataNode->SetPoint(dataNode->GetPoint()); newContainer = InternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); + ProcessNode((*it), newContainer); ++m_Kept; + break; } - break; - } - case FEATURE_LINE: - { - if (this->IsLineIntersectionNotNull(dataNode->GetLine())) + case DOCUMENT: { - newDataNode->SetLine(dataNode->GetLine()); newContainer = InternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); ++m_Kept; + ProcessNode((*it), newContainer); + break; } - break; - } - case FEATURE_POLYGON: - { - if (this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing())) + case FOLDER: { - newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing()); - newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings()); newContainer = InternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); ++m_Kept; + ProcessNode((*it), newContainer); + break; + } + case FEATURE_POINT: + { + if (m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint()))) + { + newDataNode->SetPoint(dataNode->GetPoint()); + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + } + break; + } + case FEATURE_LINE: + { + if (this->IsLineIntersectionNotNull(dataNode->GetLine())) + { + newDataNode->SetLine(dataNode->GetLine()); + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + } + break; + } + case FEATURE_POLYGON: + { + if (this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing())) + { + newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing()); + newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings()); + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + } + break; + } + case FEATURE_MULTIPOINT: + { + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + ProcessNode((*it), newContainer); + break; + } + case FEATURE_MULTILINE: + { + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + ProcessNode((*it), newContainer); + break; + } + case FEATURE_MULTIPOLYGON: + { + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + ProcessNode((*it), newContainer); + break; + } + case FEATURE_COLLECTION: + { + newContainer = InternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ++m_Kept; + ProcessNode((*it), newContainer); + break; } - break; - } - case FEATURE_MULTIPOINT: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } - case FEATURE_MULTILINE: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } - case FEATURE_MULTIPOLYGON: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } - case FEATURE_COLLECTION: - { - newContainer = InternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ++m_Kept; - ProcessNode((*it), newContainer); - break; - } } } } diff --git a/Code/Common/otbVectorDataProperties.txx b/Code/Common/otbVectorDataProperties.txx index 10f28d3f88..a1bf6dc940 100644 --- a/Code/Common/otbVectorDataProperties.txx +++ b/Code/Common/otbVectorDataProperties.txx @@ -110,75 +110,77 @@ VectorDataProperties<TVectorData> switch (dataNode->GetNodeType()) { - case otb::ROOT: - { - ProcessNode((*it)); - break; - } - case otb::DOCUMENT: - { - ProcessNode((*it)); - break; - } - case otb::FOLDER: - { - ProcessNode((*it)); - break; - } - case FEATURE_POINT: - { -// otbGenericMsgDebugMacro(<<"Insert Point from vectorData"); - IndexType start; - for (unsigned int i = 0; i < VectorDataDimension; ++i) + case otb::ROOT: { - start[i] = dataNode->GetPoint()[i]; + ProcessNode((*it)); + break; } - - SizeType size; - size.Fill(itk::NumericTraits<Type>::ZeroValue()); - RegionType region; - region.SetSize(size); - region.SetIndex(start); - this->AddRegion(region); - break; - } - case otb::FEATURE_LINE: - { + case otb::DOCUMENT: + { + ProcessNode((*it)); + break; + } + case otb::FOLDER: + { + ProcessNode((*it)); + break; + } + case FEATURE_POINT: + { +// otbGenericMsgDebugMacro(<<"Insert Point from vectorData"); + IndexType start; + for (unsigned int i = 0; i < VectorDataDimension; ++i) + { + start[i] = dataNode->GetPoint()[i]; + } + + SizeType size; + size.Fill(itk::NumericTraits<Type>::ZeroValue()); + RegionType region; + region.SetSize(size); + region.SetIndex(start); + this->AddRegion(region); + break; + } + case otb::FEATURE_LINE: + { // this->GetOutput()->InsertLineString( static_cast<typename TGISTable::LinePointerType> (dataNode->GetLine()), dataNode->GetNodeId() ); - this->AddRegion(dataNode->GetLine()->GetBoundingRegion()); - break; - } - case FEATURE_POLYGON: - { - //otbGenericMsgDebugMacro(<<"Insert polygons from vectorData"); - this->AddRegion(dataNode->GetPolygonExteriorRing()->GetBoundingRegion()); - break; - } - case FEATURE_MULTIPOINT: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); - break; - } - case FEATURE_MULTILINE: - { - itkExceptionMacro( - << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); - break; - } - case FEATURE_MULTIPOLYGON: - { - itkExceptionMacro( - << - "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); - break; - } - case FEATURE_COLLECTION: - { - itkExceptionMacro( - << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); - break; - } + this->AddRegion(dataNode->GetLine()->GetBoundingRegion()); + break; + } + case FEATURE_POLYGON: + { + //otbGenericMsgDebugMacro(<<"Insert polygons from vectorData"); + this->AddRegion(dataNode->GetPolygonExteriorRing()->GetBoundingRegion()); + break; + } + case FEATURE_MULTIPOINT: + { + itkExceptionMacro( + << + "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); + break; + } + case FEATURE_MULTILINE: + { + itkExceptionMacro( + << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); + break; + } + case FEATURE_MULTIPOLYGON: + { + itkExceptionMacro( + << + "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); + break; + } + case FEATURE_COLLECTION: + { + itkExceptionMacro( + << + "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToGISTableFilter(), please request for it"); + break; + } } } } diff --git a/Code/Common/otbVectorDataToImageFilter.txx b/Code/Common/otbVectorDataToImageFilter.txx index 2b609bb21e..3e91b3e09f 100644 --- a/Code/Common/otbVectorDataToImageFilter.txx +++ b/Code/Common/otbVectorDataToImageFilter.txx @@ -386,87 +386,90 @@ VectorDataToImageFilter<TVectorData, TImage> switch (dataNode->GetNodeType()) { - case otb::ROOT: - { - ProcessNode((*it), mDatasource); - break; - } - case otb::DOCUMENT: - { - ProcessNode((*it), mDatasource); - break; - } - case otb::FOLDER: - { - ProcessNode((*it), mDatasource); - break; - } - case FEATURE_POINT: - { + case otb::ROOT: + { + ProcessNode((*it), mDatasource); + break; + } + case otb::DOCUMENT: + { + ProcessNode((*it), mDatasource); + break; + } + case otb::FOLDER: + { + ProcessNode((*it), mDatasource); + break; + } + case FEATURE_POINT: + { // itkExceptionMacro(<<"This type (FEATURE_POINT) is not handle (yet) by VectorDataToImageFilter(), please request for it"); // std::cout << std::setprecision(15); // std::cout << " ** Inserting new point **" << std::endl; - typedef mapnik::vertex<double, 2> vertex2d; - typedef mapnik::point<vertex2d> point2d; - typedef boost::shared_ptr<point2d> point_ptr; - mapnik::geometry2d * point = new point2d; + typedef mapnik::vertex<double, 2> vertex2d; + typedef mapnik::point<vertex2d> point2d; + typedef boost::shared_ptr<point2d> point_ptr; + mapnik::geometry2d * point = new point2d; - point->move_to(dataNode->GetPoint()[0], dataNode->GetPoint()[1]); + point->move_to(dataNode->GetPoint()[0], dataNode->GetPoint()[1]); // std::cout << dataNode->GetPoint()[0] << ", " << dataNode->GetPoint()[1] << std::endl; - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; + typedef boost::shared_ptr<mapnik::raster> raster_ptr; + typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; + typedef boost::shared_ptr<Feature> feature_ptr; - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(point); + feature_ptr mfeature = feature_ptr(new Feature(1)); + mfeature->add_geometry(point); - mapnik::transcoder tr("ISO-8859-15"); + mapnik::transcoder tr("ISO-8859-15"); - if (dataNode->HasField("place_name")) boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("place_name")).c_str())); + if (dataNode->HasField("place_name")) + boost::put(*mfeature, "name", + tr.transcode((dataNode->GetFieldAsString("place_name")).c_str())); - boost::put(*mfeature, "place", tr.transcode("city")); - boost::put(*mfeature, "capital", tr.transcode("yes")); //FIXME more a question of style + boost::put(*mfeature, "place", tr.transcode("city")); + boost::put(*mfeature, "capital", tr.transcode("yes")); //FIXME more a question of style - mDatasource->push(mfeature); + mDatasource->push(mfeature); - break; - } - case otb::FEATURE_LINE: - { + break; + } + case otb::FEATURE_LINE: + { // std::cout << std::setprecision(15); // std::cout << " ** Inserting new line **" << std::endl; - typedef mapnik::vertex<double, 2> vertex2d; - typedef mapnik::line_string<vertex2d, mapnik::vertex_vector2> line2d; - typedef boost::shared_ptr<line2d> line_ptr; - mapnik::geometry2d * line = new line2d; - - typedef DataNodeType::LineType::VertexListConstIteratorType VertexIterator; - VertexIterator itVertex = dataNode->GetLine()->GetVertexList()->Begin(); - while (itVertex != dataNode->GetLine()->GetVertexList()->End()) - { + typedef mapnik::vertex<double, 2> vertex2d; + typedef mapnik::line_string<vertex2d, mapnik::vertex_vector2> line2d; + typedef boost::shared_ptr<line2d> line_ptr; + mapnik::geometry2d * line = new line2d; + + typedef DataNodeType::LineType::VertexListConstIteratorType VertexIterator; + VertexIterator itVertex = dataNode->GetLine()->GetVertexList()->Begin(); + while (itVertex != dataNode->GetLine()->GetVertexList()->End()) + { // std::cout << itVertex.Value()[0] << ", " << itVertex.Value()[1] << std::endl; - line->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); - ++itVertex; - } + line->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); + ++itVertex; + } // std::cout << "Num points: " << line->num_points() << std::endl; - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; + typedef boost::shared_ptr<mapnik::raster> raster_ptr; + typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; + typedef boost::shared_ptr<Feature> feature_ptr; - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(line); + feature_ptr mfeature = feature_ptr(new Feature(1)); + mfeature->add_geometry(line); - mapnik::transcoder tr("ISO-8859-15"); + mapnik::transcoder tr("ISO-8859-15"); - if (dataNode->HasField("name")) boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("name")).c_str())); - if (dataNode->HasField("NAME")) boost::put(*mfeature, "name", - tr.transcode((dataNode->GetFieldAsString("NAME")).c_str())); + if (dataNode->HasField("name")) + boost::put(*mfeature, "name", + tr.transcode((dataNode->GetFieldAsString("name")).c_str())); + if (dataNode->HasField("NAME")) + boost::put(*mfeature, "name", + tr.transcode((dataNode->GetFieldAsString("NAME")).c_str())); // std::cout << mfeature->props().size() << std::endl; // std::cout << " -> " << (*mfeature)["name"] << std::endl; @@ -475,65 +478,67 @@ VectorDataToImageFilter<TVectorData, TImage> // std::cout << "Type: " << dataNode->GetFieldAsString("TYPE") << std::endl; // std::cout << "OSM ID: " << dataNode->GetFieldAsString("osm_id") << std::endl; - if (dataNode->HasField("type")) boost::put(*mfeature, "highway", - tr.transcode((dataNode->GetFieldAsString("type")).c_str())); - if (dataNode->HasField("TYPE")) boost::put(*mfeature, "highway", - tr.transcode((dataNode->GetFieldAsString("TYPE")).c_str())); + if (dataNode->HasField("type")) + boost::put(*mfeature, "highway", + tr.transcode((dataNode->GetFieldAsString("type")).c_str())); + if (dataNode->HasField("TYPE")) + boost::put(*mfeature, "highway", + tr.transcode((dataNode->GetFieldAsString("TYPE")).c_str())); - mDatasource->push(mfeature); + mDatasource->push(mfeature); - break; - } - case FEATURE_POLYGON: - { + break; + } + case FEATURE_POLYGON: + { // itkExceptionMacro(<<"This type (FEATURE_POLYGON) is not handle (yet) by VectorDataToImageFilter(), please request for it"); - typedef mapnik::vertex<double, 2> vertex2d; - typedef mapnik::polygon<vertex2d, mapnik::vertex_vector2> polygon2d; - typedef boost::shared_ptr<polygon2d> polygon_ptr; - mapnik::geometry2d * polygon = new polygon2d; - - typedef DataNodeType::PolygonType::VertexListConstIteratorType VertexIterator; - VertexIterator itVertex = dataNode->GetPolygonExteriorRing()->GetVertexList()->Begin(); - while (itVertex != dataNode->GetPolygonExteriorRing()->GetVertexList()->End()) + typedef mapnik::vertex<double, 2> vertex2d; + typedef mapnik::polygon<vertex2d, mapnik::vertex_vector2> polygon2d; + typedef boost::shared_ptr<polygon2d> polygon_ptr; + mapnik::geometry2d * polygon = new polygon2d; + + typedef DataNodeType::PolygonType::VertexListConstIteratorType VertexIterator; + VertexIterator itVertex = dataNode->GetPolygonExteriorRing()->GetVertexList()->Begin(); + while (itVertex != dataNode->GetPolygonExteriorRing()->GetVertexList()->End()) + { + polygon->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); + ++itVertex; + } + + typedef boost::shared_ptr<mapnik::raster> raster_ptr; + typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; + typedef boost::shared_ptr<Feature> feature_ptr; + + feature_ptr mfeature = feature_ptr(new Feature(1)); + mfeature->add_geometry(polygon); + mDatasource->push(mfeature); + + break; + } + case FEATURE_MULTIPOINT: { - polygon->line_to(itVertex.Value()[0], m_SensorModelFlip * itVertex.Value()[1]); - ++itVertex; + itkExceptionMacro( + << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToImageFilter(), please request for it"); + break; + } + case FEATURE_MULTILINE: + { + itkExceptionMacro( + << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToImageFilter(), please request for it"); + break; + } + case FEATURE_MULTIPOLYGON: + { + itkExceptionMacro( + << "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToImageFilter(), please request for it"); + break; + } + case FEATURE_COLLECTION: + { + itkExceptionMacro( + << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToImageFilter(), please request for it"); + break; } - - typedef boost::shared_ptr<mapnik::raster> raster_ptr; - typedef mapnik::feature<mapnik::geometry2d, raster_ptr> Feature; - typedef boost::shared_ptr<Feature> feature_ptr; - - feature_ptr mfeature = feature_ptr(new Feature(1)); - mfeature->add_geometry(polygon); - mDatasource->push(mfeature); - - break; - } - case FEATURE_MULTIPOINT: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToImageFilter(), please request for it"); - break; - } - case FEATURE_MULTILINE: - { - itkExceptionMacro( - << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToImageFilter(), please request for it"); - break; - } - case FEATURE_MULTIPOLYGON: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToImageFilter(), please request for it"); - break; - } - case FEATURE_COLLECTION: - { - itkExceptionMacro( - << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToImageFilter(), please request for it"); - break; - } } } } diff --git a/Code/Common/otbVectorDataToLabelMapFilter.txx b/Code/Common/otbVectorDataToLabelMapFilter.txx index e5bfa9bce9..5bd8100694 100644 --- a/Code/Common/otbVectorDataToLabelMapFilter.txx +++ b/Code/Common/otbVectorDataToLabelMapFilter.txx @@ -252,121 +252,123 @@ VectorDataToLabelMapFilter<TVectorData, TLabelMap> otbGenericMsgDebugMacro(<< "Type of node " << dataNode->GetNodeType() << " id" << dataNode->GetNodeId()); switch (dataNode->GetNodeType()) { - case otb::ROOT: - { - ProcessNode((*it)); - break; - } - case otb::DOCUMENT: - { - ProcessNode((*it)); - break; - } - case otb::FOLDER: - { - ProcessNode((*it)); - break; - } - case FEATURE_POINT: - { - otbGenericMsgDebugMacro(<< "Insert Point from vectorData"); - IndexType index; - this->GetOutput()->TransformPhysicalPointToIndex(dataNode->GetPoint(), index); - - this->GetOutput()->SetPixel(index, m_lab); - m_lab += 10; - break; - } - case otb::FEATURE_LINE: - { - //TODO Bresenham - itkExceptionMacro( - << "This type (FEATURE_LINE) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); - break; - } - case FEATURE_POLYGON: - { + case otb::ROOT: + { + ProcessNode((*it)); + break; + } + case otb::DOCUMENT: + { + ProcessNode((*it)); + break; + } + case otb::FOLDER: + { + ProcessNode((*it)); + break; + } + case FEATURE_POINT: + { + otbGenericMsgDebugMacro(<< "Insert Point from vectorData"); + IndexType index; + this->GetOutput()->TransformPhysicalPointToIndex(dataNode->GetPoint(), index); - /** correct polygon exterior ring (simplify and close the pokygon)*/ - CorrectFunctorType correct; - PolygonPointerType correctPolygonExtRing = correct(dataNode->GetPolygonExteriorRing()); - - typedef typename DataNodeType::PolygonType PolygonType; - typedef typename PolygonType::RegionType RegionType; - typedef typename PolygonType::VertexType VertexType; - typedef typename IndexType::IndexValueType IndexValueType; - typedef typename VertexType::ValueType VertexValueType; - RegionType polygonExtRingBoundReg = correctPolygonExtRing->GetBoundingRegion(); - - VertexType vertex; - std::cout << "Polygon bounding region " << polygonExtRingBoundReg << std::endl; - std::cout << "output origin " << this->GetOutput()->GetOrigin() << std::endl; - std::cout << "spacing " << this->GetOutput()->GetSpacing() << std::endl; - // For each position in the bounding region of the polygon - - for (double i = polygonExtRingBoundReg.GetOrigin(0); - i < polygonExtRingBoundReg.GetOrigin(0) + polygonExtRingBoundReg.GetSize(0); - i += this->GetOutput()->GetSpacing()[0]) + this->GetOutput()->SetPixel(index, m_lab); + m_lab += 10; + break; + } + case otb::FEATURE_LINE: + { + //TODO Bresenham + itkExceptionMacro( + << "This type (FEATURE_LINE) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); + break; + } + case FEATURE_POLYGON: { - vertex[0] = static_cast<VertexValueType>(i); - for (double j = polygonExtRingBoundReg.GetOrigin(1); - j < polygonExtRingBoundReg.GetOrigin(1) + polygonExtRingBoundReg.GetSize(1); - j += this->GetOutput()->GetSpacing()[1]) - { - vertex[1] = static_cast<VertexValueType>(j); - if (correctPolygonExtRing->IsInside(vertex) || correctPolygonExtRing->IsOnEdge (vertex)) + /** correct polygon exterior ring (simplify and close the pokygon)*/ + CorrectFunctorType correct; + PolygonPointerType correctPolygonExtRing = correct(dataNode->GetPolygonExteriorRing()); + + typedef typename DataNodeType::PolygonType PolygonType; + typedef typename PolygonType::RegionType RegionType; + typedef typename PolygonType::VertexType VertexType; + typedef typename IndexType::IndexValueType IndexValueType; + typedef typename VertexType::ValueType VertexValueType; + RegionType polygonExtRingBoundReg = correctPolygonExtRing->GetBoundingRegion(); + + VertexType vertex; + std::cout << "Polygon bounding region " << polygonExtRingBoundReg << std::endl; + std::cout << "output origin " << this->GetOutput()->GetOrigin() << std::endl; + std::cout << "spacing " << this->GetOutput()->GetSpacing() << std::endl; + // For each position in the bounding region of the polygon + + for (double i = polygonExtRingBoundReg.GetOrigin(0); + i < polygonExtRingBoundReg.GetOrigin(0) + polygonExtRingBoundReg.GetSize(0); + i += this->GetOutput()->GetSpacing()[0]) + { + vertex[0] = static_cast<VertexValueType>(i); + for (double j = polygonExtRingBoundReg.GetOrigin(1); + j < polygonExtRingBoundReg.GetOrigin(1) + polygonExtRingBoundReg.GetSize(1); + j += this->GetOutput()->GetSpacing()[1]) { - IndexType index; - index[0] = static_cast<IndexValueType>(vertex[0] - polygonExtRingBoundReg.GetOrigin(0)); - index[1] = static_cast<IndexValueType>(vertex[1] - polygonExtRingBoundReg.GetOrigin(1)); + vertex[1] = static_cast<VertexValueType>(j); + + if (correctPolygonExtRing->IsInside(vertex) || correctPolygonExtRing->IsOnEdge (vertex)) + { + IndexType index; + index[0] = static_cast<IndexValueType>(vertex[0] - polygonExtRingBoundReg.GetOrigin(0)); + index[1] = static_cast<IndexValueType>(vertex[1] - polygonExtRingBoundReg.GetOrigin(1)); // index[0] += this->GetOutput()->GetOrigin()[0]; // index[1] += this->GetOutput()->GetOrigin()[1]; // std::cout << "index " << index << std::endl; - if (this->GetOutput()->HasLabel(m_lab)) - { - if (!this->GetOutput()->GetLabelObject(m_lab)->HasIndex(index)) - { //Add a pixel to the current labelObject + if (this->GetOutput()->HasLabel(m_lab)) + { + if (!this->GetOutput()->GetLabelObject(m_lab)->HasIndex(index)) + { //Add a pixel to the current labelObject + this->GetOutput()->SetPixel(index, m_lab); + } + } + else + { + //Add a pixel to the current labelObject this->GetOutput()->SetPixel(index, m_lab); } } - else - { - //Add a pixel to the current labelObject - this->GetOutput()->SetPixel(index, m_lab); - } } } + //Modify the label for the next layer + m_lab += 10; + break; + } + case FEATURE_MULTIPOINT: + { + itkExceptionMacro( + << + "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); + break; + } + case FEATURE_MULTILINE: + { + itkExceptionMacro( + << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); + break; + } + case FEATURE_MULTIPOLYGON: + { + itkExceptionMacro( + << + "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); + break; + } + case FEATURE_COLLECTION: + { + itkExceptionMacro( + << + "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); + break; } - //Modify the label for the next layer - m_lab += 10; - break; - } - case FEATURE_MULTIPOINT: - { - itkExceptionMacro( - << "This type (FEATURE_MULTIPOINT) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); - break; - } - case FEATURE_MULTILINE: - { - itkExceptionMacro( - << "This type (FEATURE_MULTILINE) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); - break; - } - case FEATURE_MULTIPOLYGON: - { - itkExceptionMacro( - << - "This type (FEATURE_MULTIPOLYGON) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); - break; - } - case FEATURE_COLLECTION: - { - itkExceptionMacro( - << "This type (FEATURE_COLLECTION) is not handle (yet) by VectorDataToLabelMapFilter(), please request for it"); - break; - } } } } diff --git a/Code/Common/otbVectorImageToASImageAdaptor.h b/Code/Common/otbVectorImageToASImageAdaptor.h index bd9cba4338..55f821a2d1 100644 --- a/Code/Common/otbVectorImageToASImageAdaptor.h +++ b/Code/Common/otbVectorImageToASImageAdaptor.h @@ -35,15 +35,15 @@ namespace otb template <class TImage> class ITK_EXPORT VectorImageToASImageAdaptor : public itk::ImageAdaptor<TImage, otb::Accessor::VectorImageToASPixelAccessor< - typename TImage::PixelType::ValueType> > + typename TImage::PixelType::ValueType> > { public: /** Standard class typedefs. */ typedef VectorImageToASImageAdaptor Self; typedef itk::ImageAdaptor<TImage, - otb::Accessor::VectorImageToASPixelAccessor< - typename TImage::PixelType::ValueType - > > Superclass; + otb::Accessor::VectorImageToASPixelAccessor< + typename TImage::PixelType::ValueType + > > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/DisparityMap/otbNCCRegistrationFilter.h b/Code/DisparityMap/otbNCCRegistrationFilter.h index a4d6ef4026..ed31924dd7 100644 --- a/Code/DisparityMap/otbNCCRegistrationFilter.h +++ b/Code/DisparityMap/otbNCCRegistrationFilter.h @@ -66,13 +66,13 @@ namespace otb template<class TFixedImage, class TMovingImage, class TDeformationField> class ITK_EXPORT NCCRegistrationFilter : public itk::PDEDeformableRegistrationFilter<TFixedImage, TMovingImage, - TDeformationField> + TDeformationField> { public: /** Standard class typedefs. */ typedef NCCRegistrationFilter Self; typedef itk::PDEDeformableRegistrationFilter< - TFixedImage, TMovingImage, TDeformationField> Superclass; + TFixedImage, TMovingImage, TDeformationField> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -106,7 +106,7 @@ public: /** NCCRegistrationFilterFunction type. */ typedef NCCRegistrationFunction<FixedImageType, MovingImageType, - DeformationFieldType> NCCRegistrationFunctionType; + DeformationFieldType> NCCRegistrationFunctionType; typedef typename NCCRegistrationFunctionType::RadiusType RadiusType; diff --git a/Code/DisparityMap/otbNCCRegistrationFunction.h b/Code/DisparityMap/otbNCCRegistrationFunction.h index 84fa2a297a..145a66c62a 100644 --- a/Code/DisparityMap/otbNCCRegistrationFunction.h +++ b/Code/DisparityMap/otbNCCRegistrationFunction.h @@ -47,13 +47,13 @@ namespace otb template<class TFixedImage, class TMovingImage, class TDeformationField> class ITK_EXPORT NCCRegistrationFunction : public itk::PDEDeformableRegistrationFunction<TFixedImage, - TMovingImage, TDeformationField> + TMovingImage, TDeformationField> { public: /** Standard class typedefs. */ typedef NCCRegistrationFunction Self; typedef itk::PDEDeformableRegistrationFunction<TFixedImage, - TMovingImage, TDeformationField> Superclass; + TMovingImage, TDeformationField> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbAngularSecondMomentumTextureFunctor.h b/Code/FeatureExtraction/otbAngularSecondMomentumTextureFunctor.h index b588ed48c0..5a71709fd5 100644 --- a/Code/FeatureExtraction/otbAngularSecondMomentumTextureFunctor.h +++ b/Code/FeatureExtraction/otbAngularSecondMomentumTextureFunctor.h @@ -65,7 +65,7 @@ public: for (unsigned s = 0; s < this->GetHisto()[r].size(); ++s) { double p = static_cast<double>(this->GetHisto()[r][s]) * areaInv; - out += p*p; + out += p * p; } } return out; diff --git a/Code/FeatureExtraction/otbAssociativeSymmetricalSumImageFilter.h b/Code/FeatureExtraction/otbAssociativeSymmetricalSumImageFilter.h index b82e509616..89ff410799 100644 --- a/Code/FeatureExtraction/otbAssociativeSymmetricalSumImageFilter.h +++ b/Code/FeatureExtraction/otbAssociativeSymmetricalSumImageFilter.h @@ -65,20 +65,20 @@ template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT AssociativeSymmetricalSumImageFilter : public itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, - Functor::AssociativeSymmetricalSum< - typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType> > + Functor::AssociativeSymmetricalSum< + typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef AssociativeSymmetricalSumImageFilter Self; typedef itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, - Functor::AssociativeSymmetricalSum< - typename TInputImage1::PixelType, - typename TInputImage1::PixelType, - typename TOutputImage::PixelType> - > Superclass; + Functor::AssociativeSymmetricalSum< + typename TInputImage1::PixelType, + typename TInputImage1::PixelType, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorImageFilter.h b/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorImageFilter.h index 61003b27fe..bc47f812b3 100644 --- a/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorImageFilter.h +++ b/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorImageFilter.h @@ -38,9 +38,9 @@ namespace otb */ template <class TInputImage, - class TOutputImage, - class TOutputImageDirection = TOutputImage, - class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > + class TOutputImage, + class TOutputImageDirection = TOutputImage, + class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > class ITK_EXPORT AssymmetricFusionOfLineDetectorImageFilter : public LineDetectorImageFilterBase<TInputImage, TOutputImage, TOutputImageDirection, TInterpolator> { @@ -80,11 +80,11 @@ protected: virtual ~AssymmetricFusionOfLineDetectorImageFilter() {} typedef otb::LineRatioDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> LineRatioType; + InterpolatorType> LineRatioType; typedef otb::LineCorrelationDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> LineCorrelationType; + InterpolatorType> LineCorrelationType; typedef otb::AssociativeSymmetricalSumImageFilter<InputImageType1, InputImageType2, - OutputImageType> AssSymSumType; + OutputImageType> AssSymSumType; virtual void GenerateData(); diff --git a/Code/FeatureExtraction/otbCloudDetectionFilter.h b/Code/FeatureExtraction/otbCloudDetectionFilter.h index e1748e8a21..30a1689bd2 100644 --- a/Code/FeatureExtraction/otbCloudDetectionFilter.h +++ b/Code/FeatureExtraction/otbCloudDetectionFilter.h @@ -27,7 +27,7 @@ namespace otb * \brief Applies cloud detection functor to an image. */ template <class TInputImage, class TOutputImage, class TFunction = Functor::CloudDetectionFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > class ITK_EXPORT CloudDetectionFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { public: diff --git a/Code/FeatureExtraction/otbCloudEstimatorFilter.h b/Code/FeatureExtraction/otbCloudEstimatorFilter.h index df9472489f..3ce58c8afc 100644 --- a/Code/FeatureExtraction/otbCloudEstimatorFilter.h +++ b/Code/FeatureExtraction/otbCloudEstimatorFilter.h @@ -33,7 +33,7 @@ namespace otb * \example FeatureExtraction/CloudDetectionExample.cxx */ template <class TInputImage, class TOutputImage, class TFunction = Functor::SpectralAngleFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > class ITK_EXPORT CloudEstimatorFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { public: diff --git a/Code/FeatureExtraction/otbClusterProminenceTextureFunctor.h b/Code/FeatureExtraction/otbClusterProminenceTextureFunctor.h index fa6dcfdb51..31c8ba7b51 100644 --- a/Code/FeatureExtraction/otbClusterProminenceTextureFunctor.h +++ b/Code/FeatureExtraction/otbClusterProminenceTextureFunctor.h @@ -67,7 +67,7 @@ public: double p = this->GetHisto()[r][s] * areaInv; double sumPixel = (static_cast<double>(s) + - 0.5) * this->GetNeighBinLength() + (static_cast<double>(r) + 0.5) * this->GetOffsetBinLength(); + 0.5) * this->GetNeighBinLength() + (static_cast<double>(r) + 0.5) * this->GetOffsetBinLength(); out += vcl_pow(sumPixel - 2 * mean, 4) * p; } } diff --git a/Code/FeatureExtraction/otbClusterShadeTextureFunctor.h b/Code/FeatureExtraction/otbClusterShadeTextureFunctor.h index bfa3f9c9e0..a16261ab82 100644 --- a/Code/FeatureExtraction/otbClusterShadeTextureFunctor.h +++ b/Code/FeatureExtraction/otbClusterShadeTextureFunctor.h @@ -66,7 +66,7 @@ public: double p = this->GetHisto()[r][s] * areaInv; double sumPixel = (static_cast<double>(s) + - 0.5) * this->GetNeighBinLength() + (static_cast<double>(r) + 0.5) * this->GetOffsetBinLength(); + 0.5) * this->GetNeighBinLength() + (static_cast<double>(r) + 0.5) * this->GetOffsetBinLength(); out += vcl_pow(sumPixel - 2 * mean, 3) * p; } } diff --git a/Code/FeatureExtraction/otbCompacityPathFunction.h b/Code/FeatureExtraction/otbCompacityPathFunction.h index 09ebfb1351..e7a46244a7 100644 --- a/Code/FeatureExtraction/otbCompacityPathFunction.h +++ b/Code/FeatureExtraction/otbCompacityPathFunction.h @@ -37,7 +37,7 @@ namespace otb */ template <class TInputPath, - class TOutput = double> + class TOutput = double> class ITK_EXPORT CompacityPathFunction : public PathFunction<TInputPath, TOutput> { diff --git a/Code/FeatureExtraction/otbCompacityPathFunction.txx b/Code/FeatureExtraction/otbCompacityPathFunction.txx index 75361bf53b..bffc74afc2 100644 --- a/Code/FeatureExtraction/otbCompacityPathFunction.txx +++ b/Code/FeatureExtraction/otbCompacityPathFunction.txx @@ -36,7 +36,7 @@ CompacityPathFunction<TInputPath, TOutput> template <class TInputPath, class TOutput> typename CompacityPathFunction<TInputPath, - TOutput>::OutputType + TOutput>::OutputType CompacityPathFunction<TInputPath, TOutput> ::Evaluate(const PathType& path) const { @@ -100,7 +100,7 @@ CompacityPathFunction<TInputPath, TOutput> template <class TInputPath, class TOutput> typename CompacityPathFunction<TInputPath, - TOutput>::OutputType + TOutput>::OutputType CompacityPathFunction<TInputPath, TOutput> ::Evaluate() const { diff --git a/Code/FeatureExtraction/otbComplexMomentImageFunction.h b/Code/FeatureExtraction/otbComplexMomentImageFunction.h index 76d3a848a7..1b086db60a 100644 --- a/Code/FeatureExtraction/otbComplexMomentImageFunction.h +++ b/Code/FeatureExtraction/otbComplexMomentImageFunction.h @@ -46,9 +46,9 @@ namespace otb * \ingroup ImageFunctions */ template <class TInput, - class TOutput = std::complex<double>, - class TPrecision = double, - class TCoordRep = float> + class TOutput = std::complex<double>, + class TPrecision = double, + class TCoordRep = float> class ITK_EXPORT ComplexMomentImageFunction : public GeometricMomentImageFunction<TInput, TOutput, TPrecision, TCoordRep> { diff --git a/Code/FeatureExtraction/otbComplexMomentPathFunction.h b/Code/FeatureExtraction/otbComplexMomentPathFunction.h index b55e43669e..c197ac438f 100644 --- a/Code/FeatureExtraction/otbComplexMomentPathFunction.h +++ b/Code/FeatureExtraction/otbComplexMomentPathFunction.h @@ -46,12 +46,12 @@ namespace otb * \ingroup ImageFunctions */ template <class TInputPath, - class TOutput = std::complex<double>, - class TPrecision = double> + class TOutput = std::complex<double>, + class TPrecision = double> class ITK_EXPORT ComplexMomentPathFunction : public GeometricMomentPathFunction<TInputPath, - TOutput, - TPrecision> + TOutput, + TPrecision> { public: /** Standard class typedefs. */ diff --git a/Code/FeatureExtraction/otbComplexMomentPathFunction.txx b/Code/FeatureExtraction/otbComplexMomentPathFunction.txx index 2e0b6a5b0a..c1f879ceec 100644 --- a/Code/FeatureExtraction/otbComplexMomentPathFunction.txx +++ b/Code/FeatureExtraction/otbComplexMomentPathFunction.txx @@ -83,7 +83,7 @@ ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> template <class TInputPath, class TOutput, class TPrecision> typename ComplexMomentPathFunction<TInputPath, - TOutput, TPrecision>::OutputType + TOutput, TPrecision>::OutputType ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> ::Evaluate(const PathType& path) const { @@ -166,7 +166,7 @@ ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> template <class TInputPath, class TOutput, class TPrecision> typename ComplexMomentPathFunction<TInputPath, - TOutput, TPrecision>::OutputType + TOutput, TPrecision>::OutputType ComplexMomentPathFunction<TInputPath, TOutput, TPrecision> ::Evaluate() const { diff --git a/Code/FeatureExtraction/otbContrastTextureFunctor.h b/Code/FeatureExtraction/otbContrastTextureFunctor.h index d1653201a5..847c1161cb 100644 --- a/Code/FeatureExtraction/otbContrastTextureFunctor.h +++ b/Code/FeatureExtraction/otbContrastTextureFunctor.h @@ -32,7 +32,6 @@ namespace Functor * otbScalarImageToTexturesFilter instead. */ - template <class TScalarInputPixelType, class TScalarOutputPixelType> class ITK_EXPORT ContrastTextureFunctor : public TextureFunctorBase<TScalarInputPixelType, TScalarOutputPixelType> diff --git a/Code/FeatureExtraction/otbEnergyTextureFunctor.h b/Code/FeatureExtraction/otbEnergyTextureFunctor.h index d6a203b38b..b7af1e7f3c 100644 --- a/Code/FeatureExtraction/otbEnergyTextureFunctor.h +++ b/Code/FeatureExtraction/otbEnergyTextureFunctor.h @@ -46,7 +46,7 @@ public: EnergyTextureFunctor() { }; - + virtual ~EnergyTextureFunctor(){} typedef TScalarInputPixelType InputScalarType; diff --git a/Code/FeatureExtraction/otbEntropyTextureFunctor.h b/Code/FeatureExtraction/otbEntropyTextureFunctor.h index 5f798780a3..49ab4c81c1 100644 --- a/Code/FeatureExtraction/otbEntropyTextureFunctor.h +++ b/Code/FeatureExtraction/otbEntropyTextureFunctor.h @@ -32,7 +32,6 @@ namespace Functor * otbScalarImageToTexturesFilter instead. */ - template <class TScalarInputPixelType, class TScalarOutputPixelType> class ITK_EXPORT EntropyTextureFunctor : public TextureFunctorBase<TScalarInputPixelType, TScalarOutputPixelType> diff --git a/Code/FeatureExtraction/otbExtractSegmentsImageFilter.h b/Code/FeatureExtraction/otbExtractSegmentsImageFilter.h index 23a7e2e6f6..9680402722 100644 --- a/Code/FeatureExtraction/otbExtractSegmentsImageFilter.h +++ b/Code/FeatureExtraction/otbExtractSegmentsImageFilter.h @@ -43,7 +43,7 @@ namespace otb */ template <class TInputImage, - class TOutputImage> + class TOutputImage> class ITK_EXPORT ExtractSegmentsImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/FeatureExtraction/otbFlusserImageFunction.h b/Code/FeatureExtraction/otbFlusserImageFunction.h index c4018af0a1..d5eac225cd 100644 --- a/Code/FeatureExtraction/otbFlusserImageFunction.h +++ b/Code/FeatureExtraction/otbFlusserImageFunction.h @@ -59,9 +59,9 @@ namespace otb */ template <class TInput, - class TOutput = double, - class TPrecision = double, - class TCoordRep = float> + class TOutput = double, + class TPrecision = double, + class TCoordRep = float> class ITK_EXPORT FlusserImageFunction : public RealMomentImageFunction<TInput, TOutput, TPrecision, TCoordRep> { diff --git a/Code/FeatureExtraction/otbFlusserImageFunction.txx b/Code/FeatureExtraction/otbFlusserImageFunction.txx index cde80e8601..e8274de0b8 100644 --- a/Code/FeatureExtraction/otbFlusserImageFunction.txx +++ b/Code/FeatureExtraction/otbFlusserImageFunction.txx @@ -79,146 +79,146 @@ FlusserImageFunction<TInput, TOutput, TPrecision, TCoordRep> switch (m_MomentNumber) { - case 1: - { - ComplexType C11; - function->SetP(1); - function->SetQ(1); - C11 = function->EvaluateAtIndex(index); - FlusserValue = C11.real(); - } - break; - case 2: - { - ComplexType C21, C12; - function->SetP(2); - function->SetQ(1); - C21 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - FlusserValue = vcl_abs(C21 * C12); - } - break; - case 3: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C20 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 4: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C20 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 5: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - FlusserValueComplex = C30 * vcl_pow(C12, 3); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 6: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - FlusserValueComplex = C30 * vcl_pow(C12, 3); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 7: - { - ComplexType C22; - function->SetP(2); - function->SetQ(2); - C22 = function->EvaluateAtIndex(index); - FlusserValue = C22.real(); - } - break; - case 8: - { - ComplexType C31, C12; - function->SetP(3); - function->SetQ(1); - C31 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C31 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 9: - { - ComplexType C31, C12; - function->SetP(3); - function->SetQ(1); - C31 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C31 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 10: - { - ComplexType C40, C12; - function->SetP(4); - function->SetQ(0); - C40 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C40 * vcl_pow(C12, 4); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 11: - { - ComplexType C40, C12; - function->SetP(4); - function->SetQ(0); - C40 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - FlusserValueComplex = C40 * vcl_pow(C12, 4); - FlusserValue = FlusserValueComplex.imag(); - } - break; - - default: - itkWarningMacro("Hu's invariant parameters are between 1 and 7"); + case 1: + { + ComplexType C11; + function->SetP(1); + function->SetQ(1); + C11 = function->EvaluateAtIndex(index); + FlusserValue = C11.real(); + } + break; + case 2: + { + ComplexType C21, C12; + function->SetP(2); + function->SetQ(1); + C21 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + FlusserValue = vcl_abs(C21 * C12); + } + break; + case 3: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 4: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 5: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 6: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 7: + { + ComplexType C22; + function->SetP(2); + function->SetQ(2); + C22 = function->EvaluateAtIndex(index); + FlusserValue = C22.real(); + } + break; + case 8: + { + ComplexType C31, C12; + function->SetP(3); + function->SetQ(1); + C31 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 9: + { + ComplexType C31, C12; + function->SetP(3); + function->SetQ(1); + C31 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 10: + { + ComplexType C40, C12; + function->SetP(4); + function->SetQ(0); + C40 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 11: + { + ComplexType C40, C12; + function->SetP(4); + function->SetQ(0); + C40 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValue = FlusserValueComplex.imag(); + } + break; + + default: + itkWarningMacro("Hu's invariant parameters are between 1 and 7"); } return (static_cast<RealType>(FlusserValue)); diff --git a/Code/FeatureExtraction/otbFlusserPathFunction.h b/Code/FeatureExtraction/otbFlusserPathFunction.h index 31f1c29b1f..2ff7e767a3 100644 --- a/Code/FeatureExtraction/otbFlusserPathFunction.h +++ b/Code/FeatureExtraction/otbFlusserPathFunction.h @@ -57,8 +57,8 @@ namespace otb */ template <class TInputPath, - class TOutput = double, - class TPrecision = double> + class TOutput = double, + class TPrecision = double> class ITK_EXPORT FlusserPathFunction : public RealMomentPathFunction<TInputPath, TOutput, TPrecision> { diff --git a/Code/FeatureExtraction/otbFlusserPathFunction.txx b/Code/FeatureExtraction/otbFlusserPathFunction.txx index 9bab392bd9..2c55546afd 100644 --- a/Code/FeatureExtraction/otbFlusserPathFunction.txx +++ b/Code/FeatureExtraction/otbFlusserPathFunction.txx @@ -65,146 +65,146 @@ FlusserPathFunction<TInputPath, TOutput, TPrecision> switch (m_MomentNumber) { - case 1: - { - ComplexType C11; - function->SetP(1); - function->SetQ(1); - C11 = function->Evaluate(); - FlusserValue = C11.real(); - } - break; - case 2: - { - ComplexType C21, C12; - function->SetP(2); - function->SetQ(1); - C21 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - FlusserValue = vcl_abs(C21 * C12); - } - break; - case 3: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C20 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 4: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C20 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 5: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - FlusserValueComplex = C30 * vcl_pow(C12, 3); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 6: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - FlusserValueComplex = C30 * vcl_pow(C12, 3); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 7: - { - ComplexType C22; - function->SetP(2); - function->SetQ(2); - C22 = function->Evaluate(); - FlusserValue = C22.real(); - } - break; - case 8: - { - ComplexType C31, C12; - function->SetP(3); - function->SetQ(1); - C31 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C31 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 9: - { - ComplexType C31, C12; - function->SetP(3); - function->SetQ(1); - C31 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C31 * vcl_pow(C12, 2); - FlusserValue = FlusserValueComplex.imag(); - } - break; - case 10: - { - ComplexType C40, C12; - function->SetP(4); - function->SetQ(0); - C40 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C40 * vcl_pow(C12, 4); - FlusserValue = FlusserValueComplex.real(); - } - break; - case 11: - { - ComplexType C40, C12; - function->SetP(4); - function->SetQ(0); - C40 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - FlusserValueComplex = C40 * vcl_pow(C12, 4); - FlusserValue = FlusserValueComplex.imag(); - } - break; - - default: - itkWarningMacro("Flusser's invariant parameters are between 1 and 11"); + case 1: + { + ComplexType C11; + function->SetP(1); + function->SetQ(1); + C11 = function->Evaluate(); + FlusserValue = C11.real(); + } + break; + case 2: + { + ComplexType C21, C12; + function->SetP(2); + function->SetQ(1); + C21 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + FlusserValue = vcl_abs(C21 * C12); + } + break; + case 3: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 4: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C20 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 5: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 6: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + FlusserValueComplex = C30 * vcl_pow(C12, 3); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 7: + { + ComplexType C22; + function->SetP(2); + function->SetQ(2); + C22 = function->Evaluate(); + FlusserValue = C22.real(); + } + break; + case 8: + { + ComplexType C31, C12; + function->SetP(3); + function->SetQ(1); + C31 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 9: + { + ComplexType C31, C12; + function->SetP(3); + function->SetQ(1); + C31 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C31 * vcl_pow(C12, 2); + FlusserValue = FlusserValueComplex.imag(); + } + break; + case 10: + { + ComplexType C40, C12; + function->SetP(4); + function->SetQ(0); + C40 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValue = FlusserValueComplex.real(); + } + break; + case 11: + { + ComplexType C40, C12; + function->SetP(4); + function->SetQ(0); + C40 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + FlusserValueComplex = C40 * vcl_pow(C12, 4); + FlusserValue = FlusserValueComplex.imag(); + } + break; + + default: + itkWarningMacro("Flusser's invariant parameters are between 1 and 11"); } return (static_cast<RealType>(FlusserValue)); diff --git a/Code/FeatureExtraction/otbForwardFourierMellinTransformImageFilter.h b/Code/FeatureExtraction/otbForwardFourierMellinTransformImageFilter.h index ea96f1bf42..e93ff2b76d 100644 --- a/Code/FeatureExtraction/otbForwardFourierMellinTransformImageFilter.h +++ b/Code/FeatureExtraction/otbForwardFourierMellinTransformImageFilter.h @@ -46,12 +46,12 @@ namespace otb */ template <class TPixel, - class TInterpol, - unsigned int Dimension = 2> + class TInterpol, + unsigned int Dimension = 2> class ITK_EXPORT ForwardFourierMellinTransformImageFilter : public itk::ImageToImageFilter<Image<TPixel, Dimension>, - itk::Image<std::complex<TPixel>, Dimension> > + itk::Image<std::complex<TPixel>, Dimension> > { public: diff --git a/Code/FeatureExtraction/otbGenericRoadExtractionFilter.h b/Code/FeatureExtraction/otbGenericRoadExtractionFilter.h index d4b4d17760..a7335f2d02 100644 --- a/Code/FeatureExtraction/otbGenericRoadExtractionFilter.h +++ b/Code/FeatureExtraction/otbGenericRoadExtractionFilter.h @@ -100,37 +100,37 @@ public: typedef otb::Image<VectorPixelType, InputImageType::ImageDimension> CovariantVectorImageType; typedef itk::SqrtImageFilter< - InputImageType, - InputImageType> SquareRootImageFilterType; + InputImageType, + InputImageType> SquareRootImageFilterType; typedef itk::GradientRecursiveGaussianImageFilter< - InputImageType, - CovariantVectorImageType> GradientFilterType; + InputImageType, + CovariantVectorImageType> GradientFilterType; typedef NeighborhoodScalarProductFilter< - CovariantVectorImageType, - ModulusType, - DirectionType> NeighborhoodScalarProductFilterType; + CovariantVectorImageType, + ModulusType, + DirectionType> NeighborhoodScalarProductFilterType; typedef RemoveIsolatedByDirectionFilter< - ModulusType, - DirectionType, - ModulusType> RemoveIsolatedByDirectionFilterType; + ModulusType, + DirectionType, + ModulusType> RemoveIsolatedByDirectionFilterType; typedef RemoveWrongDirectionFilter< - ModulusType, - DirectionType, - ModulusType> RemoveWrongDirectionFilterType; + ModulusType, + DirectionType, + ModulusType> RemoveWrongDirectionFilterType; typedef NonMaxRemovalByDirectionFilter< - ModulusType, - DirectionType, - ModulusType> NonMaxRemovalByDirectionFilterType; + ModulusType, + DirectionType, + ModulusType> NonMaxRemovalByDirectionFilterType; typedef VectorizationPathListFilter< - ModulusType, - DirectionType, - OutputPathType> VectorizationPathListFilterType; + ModulusType, + DirectionType, + OutputPathType> VectorizationPathListFilterType; typedef SimplifyPathListFilter<OutputPathType> SimplifyPathListFilterType; typedef BreakAngularPathListFilter<OutputPathType> BreakAngularPathListFilterType; diff --git a/Code/FeatureExtraction/otbGeometricMomentImageFunction.h b/Code/FeatureExtraction/otbGeometricMomentImageFunction.h index 6228b6451d..f721ddb8cb 100644 --- a/Code/FeatureExtraction/otbGeometricMomentImageFunction.h +++ b/Code/FeatureExtraction/otbGeometricMomentImageFunction.h @@ -31,9 +31,9 @@ namespace otb */ template <class TInput, - class TOutput = float, - class TPrecision = double, - class TCoordRep = float> + class TOutput = float, + class TPrecision = double, + class TCoordRep = float> class ITK_EXPORT GeometricMomentImageFunction : public itk::ImageFunction<TInput, TOutput, TCoordRep> { diff --git a/Code/FeatureExtraction/otbGeometricMomentPathFunction.h b/Code/FeatureExtraction/otbGeometricMomentPathFunction.h index ca399944d8..a5900915fa 100644 --- a/Code/FeatureExtraction/otbGeometricMomentPathFunction.h +++ b/Code/FeatureExtraction/otbGeometricMomentPathFunction.h @@ -31,8 +31,8 @@ namespace otb */ template <class TInputPath, - class TOutput, - class TPrecision = double> + class TOutput, + class TPrecision = double> class ITK_EXPORT GeometricMomentPathFunction : public PathFunction<TInputPath, TOutput> { diff --git a/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.h b/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.h index b40d274d40..984db6033f 100644 --- a/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.h +++ b/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.h @@ -22,14 +22,14 @@ #include "itkMacro.h" namespace otb { - -/** \class GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator + +/** \class GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator * \brief This class computes texture feature coefficients from a grey level * co-occurrence matrix. * * This class computes features that summarize image texture, given a grey level * co-occurrence matrix (generated by a ScalarImageToGreyLevelCooccurrenceMatrixGenerator - * or related class). + * or related class). * * The features calculated are as follows (where \f$ g(i, j) \f$ is the element in * cell i, j of a a normalized GLCM): @@ -38,7 +38,7 @@ namespace otb { * * "Sum of squares: Variance" \f$ = f_4 = \sum_{i,j}(i -mu)^2 g(i,j) \f$ * - * "Sum average" \f$ = f_6 = -\sum_{i}i g_{x+y}(i) + * "Sum average" \f$ = f_6 = -\sum_{i}i g_{x+y}(i) * * "Sum Variance" \f$ = f_7 = \sum_{i}(i - f_8)^2 g_{x+y}(i) \f$ * @@ -52,7 +52,7 @@ namespace otb { * * "Information Measures of Correlation IC2" \f$ = f_13 = \sqrt{1 - \exp{-2}|HXY2 - f_9|} \f$ * - * Above, \f$ \mu = \f$ (weighted pixel average) \f$ = \sum_{i,j}i \cdot g(i, j) = + * Above, \f$ \mu = \f$ (weighted pixel average) \f$ = \sum_{i,j}i \cdot g(i, j) = * \sum_{i,j}j \cdot g(i, j) \f$ (due to matrix summetry), and * * \f$ \g_{x+y}(k) = \sum_{i}\sum_{j}g(i)\f$ where \f$ i+j=k \f$ and \f$ k = 2,3,..,2N_[g} \f$ and @@ -62,7 +62,7 @@ namespace otb { * NOTA BENE: The input histogram will be forcably normalized! * This algorithm takes three passes through the input * histogram if the histogram was already normalized, and four if not. - * + * * Web references: * * http://www.cssip.uq.edu.au/meastex/www/algs/algs/algs.html @@ -70,18 +70,18 @@ namespace otb { * * Print references: * - * Haralick, R.M., K. Shanmugam and I. Dinstein. 1973. Textural Features for - * Image Classification. IEEE Transactions on Systems, Man and Cybernetics. + * Haralick, R.M., K. Shanmugam and I. Dinstein. 1973. Textural Features for + * Image Classification. IEEE Transactions on Systems, Man and Cybernetics. * SMC-3(6):610-620. * - * Haralick, R.M. 1979. Statistical and Structural Approaches to Texture. + * Haralick, R.M. 1979. Statistical and Structural Approaches to Texture. * Proceedings of the IEEE, 67:786-804. * - * R.W. Conners and C.A. Harlow. A Theoretical Comaprison of Texture Algorithms. + * R.W. Conners and C.A. Harlow. A Theoretical Comaprison of Texture Algorithms. * IEEE Transactions on Pattern Analysis and Machine Intelligence, 2:204-222, 1980. * * R.W. Conners, M.M. Trivedi, and C.A. Harlow. Segmentation of a High-Resolution - * Urban Scene using Texture Operators. Computer Vision, Graphics and Image + * Urban Scene using Texture Operators. Computer Vision, Graphics and Image * Processing, 25:273-310, 1984. * * \sa ScalarImageToGreyLevelCooccurrenceMatrixGenerator @@ -89,36 +89,36 @@ namespace otb { * \sa ScalarImageTextureCalculator * */ - -template < typename THistogram > -class ITK_EXPORT GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator : + +template <typename THistogram> +class ITK_EXPORT GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator : public itk::Object { public: /** Standard typedefs */ - typedef GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator Self; - typedef itk::Object Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - + typedef GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator Self; + typedef itk::Object Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + /** Run-time type information (and related methods). */ itkTypeMacro(GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator, itk::Object); - + /** standard New() method support */ itkNewMacro(Self); - - typedef THistogram HistogramType; - typedef typename HistogramType::Pointer HistogramPointer; - typedef typename HistogramType::ConstPointer HistogramConstPointer; - typedef typename HistogramType::MeasurementType MeasurementType; - typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; - typedef typename HistogramType::IndexType IndexType; - typedef typename HistogramType::FrequencyType FrequencyType; - + + typedef THistogram HistogramType; + typedef typename HistogramType::Pointer HistogramPointer; + typedef typename HistogramType::ConstPointer HistogramConstPointer; + typedef typename HistogramType::MeasurementType MeasurementType; + typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; + typedef typename HistogramType::IndexType IndexType; + typedef typename HistogramType::FrequencyType FrequencyType; + /** Connects the GLCM histogram over which the features are going to be computed */ - itkSetObjectMacro( Histogram, HistogramType ); - itkGetObjectMacro( Histogram, HistogramType ); - + itkSetObjectMacro(Histogram, HistogramType); + itkGetObjectMacro(Histogram, HistogramType); + itkGetMacro(Mean, double); itkGetMacro(Variance, double); itkGetMacro(SumAverage, double); @@ -128,31 +128,30 @@ public: itkGetMacro(DifferenceVariance, double); itkGetMacro(IC1, double); itkGetMacro(IC2, double); - + /** Triggers the Computation of the histogram */ - void Compute( void ); - + void Compute(void); + protected: GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator() {}; - virtual ~GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator() {}; + virtual ~GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator() {} void PrintSelf(std::ostream& os, itk::Indent indent) const; - private: - GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - + GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + HistogramPointer m_Histogram; - + void NormalizeHistogram(void); void ComputeMean(); - double m_Mean, m_Variance, m_SumAverage, m_SumVariance,m_SumEntropy, m_DifferenceEntropy, - m_DifferenceVariance, m_IC1, m_IC2; + double m_Mean, m_Variance, m_SumAverage, m_SumVariance, m_SumEntropy, m_DifferenceEntropy, + m_DifferenceVariance, m_IC1, m_IC2; - double ComputePS ( long unsigned int k ); - double ComputePD ( long unsigned int k ); + double ComputePS(long unsigned int k); + double ComputePD(long unsigned int k); }; -} // end of namespace otb +} // end of namespace otb #ifndef OTB_MANUAL_INSTANTIATION #include "otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.txx" diff --git a/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.txx b/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.txx index c75af60b05..9d787ec802 100644 --- a/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.txx +++ b/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.txx @@ -22,199 +22,194 @@ #include "vnl/vnl_math.h" namespace otb { - -template< class THistogram > + +template<class THistogram> void -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: -NormalizeHistogram( void ) +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: +NormalizeHistogram(void) { - typename HistogramType::Iterator hit; - typename HistogramType::FrequencyType totalFrequency = + typename HistogramType::Iterator hit; + typename HistogramType::FrequencyType totalFrequency = m_Histogram->GetTotalFrequency(); - + for (hit = m_Histogram->Begin(); hit != m_Histogram->End(); ++hit) { hit.SetFrequency(hit.GetFrequency() / totalFrequency); } } - -template< class THistogram > + +template<class THistogram> void -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: -ComputeMean( ) +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: +ComputeMean() { // This function takes two passes through the histogram and two passes through // an array of the same length as a histogram axis. This could probably be // cleverly compressed to one pass, but it's not clear that that's necessary. typedef typename HistogramType::Iterator HistogramIterator; - + // Initialize everything m_Mean = 0; - + // Ok, now do the first pass through the histogram to get the marginal sums // and compute the pixel mean HistogramIterator hit; for (hit = m_Histogram->Begin(); hit != m_Histogram->End(); ++hit) { MeasurementType frequency = hit.GetFrequency(); - IndexType index = m_Histogram->GetIndex(hit.GetInstanceIdentifier()); + IndexType index = m_Histogram->GetIndex(hit.GetInstanceIdentifier()); m_Mean += index[0] * frequency; } -} +} - -template< class THistogram > +template<class THistogram> void -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: -Compute () +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: +Compute() { typedef typename HistogramType::Iterator HistogramIterator; - + // First, normalize the histogram if it doesn't look normalized. // This is one pass through the histogram. FrequencyType totalFrequency = m_Histogram->GetTotalFrequency(); - if ( (totalFrequency - itk::NumericTraits<MeasurementType>::One) > 0.0001 ) + if ((totalFrequency - itk::NumericTraits<MeasurementType>::One) > 0.0001) { // Doesn't look normalized: this->NormalizeHistogram(); } - + // Now get the pixel mean. this->ComputeMean(); - + m_SumAverage = 0; m_SumEntropy = 0; m_SumVariance = 0; double PSSquareCumul = 0; double log2 = vcl_log(2.); - + // First pass to compute SumAverage, SumVariance - for (long unsigned int i = 0 ; i < m_Histogram->GetSize()[0] + m_Histogram->GetSize()[1]; ++i) + for (long unsigned int i = 0; i < m_Histogram->GetSize()[0] + m_Histogram->GetSize()[1]; ++i) { double psTmp = ComputePS (i); - - m_SumAverage += i *psTmp; + + m_SumAverage += i * psTmp; m_SumEntropy -= (psTmp > 0.0001) ? psTmp * vcl_log(psTmp) / log2 : 0; PSSquareCumul += i * i * psTmp; - } + } m_SumVariance = PSSquareCumul - m_SumAverage * m_SumAverage; - - double minSizeHist = std::min (m_Histogram->GetSize()[0] , m_Histogram->GetSize()[1]); - + + double minSizeHist = std::min (m_Histogram->GetSize()[0], m_Histogram->GetSize()[1]); + m_DifferenceEntropy = 0; m_DifferenceVariance = 0; double PDSquareCumul = 0; double PDCumul = 0; - + // Second pass to compute DifferenceVariance and DifferenceEntropy - for (long unsigned int i = 0 ; i < minSizeHist ; ++i) + for (long unsigned int i = 0; i < minSizeHist; ++i) { double pdTmp = ComputePD (i); - - PDCumul += i *pdTmp; + + PDCumul += i * pdTmp; m_DifferenceEntropy -= (pdTmp > 0.0001) ? pdTmp * vcl_log(pdTmp) / log2 : 0; PDSquareCumul += i * i * pdTmp; } m_DifferenceVariance = PDSquareCumul - PDCumul * PDCumul; - + typedef typename HistogramType::Iterator HistogramIterator; - + double hx = 0; double hy = 0; - + // Compute hx and hy need to compute f12 and f13 texture coefficients - for (long unsigned int i = 0 ; i < m_Histogram->GetSize()[0] ; ++i) + for (long unsigned int i = 0; i < m_Histogram->GetSize()[0]; ++i) { - double marginalfreq = m_Histogram->GetFrequency ( i , 0 ); - hx += (marginalfreq > 0.0001) ? vcl_log ( marginalfreq ) * marginalfreq : 0; + double marginalfreq = m_Histogram->GetFrequency (i, 0); + hx += (marginalfreq > 0.0001) ? vcl_log (marginalfreq) * marginalfreq : 0; } - - for (long unsigned int j = 0 ; j < m_Histogram->GetSize()[1] ; ++j) + + for (long unsigned int j = 0; j < m_Histogram->GetSize()[1]; ++j) { - double marginalfreq = m_Histogram->GetFrequency ( j , 1 ); - hy += (marginalfreq > 0.0001) ? vcl_log ( marginalfreq ) * marginalfreq : 0; + double marginalfreq = m_Histogram->GetFrequency (j, 1); + hy += (marginalfreq > 0.0001) ? vcl_log (marginalfreq) * marginalfreq : 0; } - + double hxy1 = 0; double hxy2 = 0; - + m_Variance = 0; double Entropy = 0; - + // Third pass over the histogram to compute Sum of squares (variance), entropy (needed for f12) for (HistogramIterator hit = m_Histogram->Begin(); hit != m_Histogram->End(); ++hit) { MeasurementType frequency = hit.GetFrequency(); - + IndexType index = m_Histogram->GetIndex(hit.GetInstanceIdentifier()); - - m_Variance += ( (index[0] - m_Mean) * (index[0] - m_Mean) ) * frequency; + + m_Variance += ((index[0] - m_Mean) * (index[0] - m_Mean)) * frequency; Entropy -= (frequency > 0.0001) ? frequency * vcl_log(frequency) / log2 : 0; - - double pipj = m_Histogram->GetFrequency (index[0] , 0) * m_Histogram->GetFrequency (index[1] , 1); - - hxy1 -= (pipj > 0.0001) ? frequency * vcl_log ( pipj ) : 0; - hxy2 -= (pipj > 0.0001) ? pipj * vcl_log ( pipj ) : 0; + + double pipj = m_Histogram->GetFrequency (index[0], 0) * m_Histogram->GetFrequency (index[1], 1); + + hxy1 -= (pipj > 0.0001) ? frequency * vcl_log(pipj) : 0; + hxy2 -= (pipj > 0.0001) ? pipj * vcl_log(pipj) : 0; } - - //Finally get f12 and f13 - m_IC1 = (vcl_abs( std::max ( hx, hy ) ) > 0.0001) ? ( Entropy - hxy1 ) / (std::max ( hx, hy ) ) : 0; - - m_IC2 = 1 - vcl_exp ( -2. * vcl_abs ( hxy2 - Entropy ) ); - m_IC2 = (m_IC2 >= 0) ? vcl_sqrt ( m_IC2 ) : 0; -} + //Finally get f12 and f13 + m_IC1 = (vcl_abs(std::max (hx, hy)) > 0.0001) ? (Entropy - hxy1) / (std::max (hx, hy)) : 0; + m_IC2 = 1 - vcl_exp (-2. * vcl_abs (hxy2 - Entropy)); + m_IC2 = (m_IC2 >= 0) ? vcl_sqrt (m_IC2) : 0; +} //TODO check this!! -template< class THistogram > +template<class THistogram> double -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: -ComputePS ( long unsigned int k ) -{ - double result = 0; - IndexType index; +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: +ComputePS(long unsigned int k) +{ + double result = 0; + IndexType index; long unsigned int start = std::max (static_cast <long unsigned int> (0), k - m_Histogram->GetSize()[1]); long unsigned int end = std::min (k, m_Histogram->GetSize()[0]); - for (long unsigned int i = start; i < end ; ++i) + for (long unsigned int i = start; i < end; ++i) { - index[0] = i; - index[1] = k - i; - result += m_Histogram->GetFrequency ( index ); - } + index[0] = i; + index[1] = k - i; + result += m_Histogram->GetFrequency (index); + } return result; } //TODO check this!! -template< class THistogram > +template<class THistogram> double -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: -ComputePD ( long unsigned int k ) -{ - double result = 0; - IndexType index; +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: +ComputePD(long unsigned int k) +{ + double result = 0; + IndexType index; long unsigned int end = std::min (m_Histogram->GetSize()[0] - k, m_Histogram->GetSize()[1]); - for (long unsigned int j = 0; j < end ; ++j) + for (long unsigned int j = 0; j < end; ++j) { - index[0] = j + k; - index[1] = j; - result += m_Histogram->GetFrequency ( index ); - } + index[0] = j + k; + index[1] = j; + result += m_Histogram->GetFrequency (index); + } return result; } - -template< class THistogram > +template<class THistogram> void -GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< THistogram >:: +GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator<THistogram>:: PrintSelf(std::ostream& os, itk::Indent indent) const { - Superclass::PrintSelf(os,indent); + Superclass::PrintSelf(os, indent); } } // end of namespace otb - #endif diff --git a/Code/FeatureExtraction/otbHarrisImageFilter.h b/Code/FeatureExtraction/otbHarrisImageFilter.h index d8cc8ce8f9..a4ac718961 100644 --- a/Code/FeatureExtraction/otbHarrisImageFilter.h +++ b/Code/FeatureExtraction/otbHarrisImageFilter.h @@ -80,14 +80,14 @@ public: // typedef typename InputImageType::SizeType SizeType; typedef itk::Image<itk::SymmetricSecondRankTensor< - typename itk::NumericTraits<InputPixelType>::RealType, - ::itk::GetImageDimension<InputImageType>::ImageDimension>, - ::itk::GetImageDimension<InputImageType>::ImageDimension> TensorType; + typename itk::NumericTraits<InputPixelType>::RealType, + ::itk::GetImageDimension<InputImageType>::ImageDimension>, + ::itk::GetImageDimension<InputImageType>::ImageDimension> TensorType; typedef itk::HessianRecursiveGaussianImageFilter<InputImageType, TensorType> HessianFilterType; typedef itk::RecursiveGaussianImageFilter<TensorType, - TensorType> GaussianFilterType; + TensorType> GaussianFilterType; typedef otb::HessianToScalarImageFilter<TensorType, OutputImageType> HessianToScalarFilterType; typedef otb::MultiplyByScalarImageFilter<OutputImageType, OutputImageType> MultiplyScalarFilterType; diff --git a/Code/FeatureExtraction/otbHarrisImageToPointSetFilter.h b/Code/FeatureExtraction/otbHarrisImageToPointSetFilter.h index dd7c479f36..3ca9f92054 100644 --- a/Code/FeatureExtraction/otbHarrisImageToPointSetFilter.h +++ b/Code/FeatureExtraction/otbHarrisImageToPointSetFilter.h @@ -30,7 +30,7 @@ namespace otb */ template <class TInputImage, - class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType, 2> > + class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType, 2> > class ITK_EXPORT HarrisImageToPointSetFilter : public ImageToPointSetFilter<TInputImage, TOutputPointSet> { @@ -57,7 +57,7 @@ public: typedef typename otb::HarrisImageFilter<InputImageType, InputImageType> HarrisImageFilterType; typedef typename otb::ThresholdImageToPointSetFilter<InputImageType, - OutputPointSetType> ThresholdImageToPointSetType; + OutputPointSetType> ThresholdImageToPointSetType; typedef typename OutputPointSetType::PixelType OutputPixelType; diff --git a/Code/FeatureExtraction/otbHessianToScalarImageFilter.h b/Code/FeatureExtraction/otbHessianToScalarImageFilter.h index c8379004b3..2a463e866d 100644 --- a/Code/FeatureExtraction/otbHessianToScalarImageFilter.h +++ b/Code/FeatureExtraction/otbHessianToScalarImageFilter.h @@ -71,20 +71,20 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT HessianToScalarImageFilter : public itk::UnaryFunctorImageFilter< - TInputImage, TOutputImage, - Functor::HessianToScalar< - ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage, TOutputImage, + Functor::HessianToScalar< + ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef HessianToScalarImageFilter Self; typedef typename itk::UnaryFunctorImageFilter< - TInputImage, - TOutputImage, - Functor::HessianToScalar< - ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> > Superclass; + TInputImage, + TOutputImage, + Functor::HessianToScalar< + ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbHuImageFunction.h b/Code/FeatureExtraction/otbHuImageFunction.h index 28896db70c..656c892993 100644 --- a/Code/FeatureExtraction/otbHuImageFunction.h +++ b/Code/FeatureExtraction/otbHuImageFunction.h @@ -54,9 +54,9 @@ namespace otb // public itk::ImageFunction< TInput, TOutput,TCoordRep > template <class TInput, - class TOutput = double, - class TPrecision = double, - class TCoordRep = float> + class TOutput = double, + class TPrecision = double, + class TCoordRep = float> class ITK_EXPORT HuImageFunction : public RealMomentImageFunction<TInput, TOutput, TPrecision, TCoordRep> { diff --git a/Code/FeatureExtraction/otbHuImageFunction.txx b/Code/FeatureExtraction/otbHuImageFunction.txx index 8bb695c485..9010631c8f 100644 --- a/Code/FeatureExtraction/otbHuImageFunction.txx +++ b/Code/FeatureExtraction/otbHuImageFunction.txx @@ -80,103 +80,103 @@ HuImageFunction<TInput, TOutput, TPrecision, TCoordRep> switch (m_MomentNumber) { - case 1: - { - ComplexType C11; - function->SetP(1); - function->SetQ(1); - C11 = function->EvaluateAtIndex(index); - HuValue = C11.real(); - } - break; - case 2: - { - ComplexType C20, C02; - function->SetP(2); - function->SetQ(0); - C20 = function->EvaluateAtIndex(index); - function->SetP(0); - function->SetQ(2); - C02 = function->EvaluateAtIndex(index); - - HuValue = vcl_abs(C20 * C02); - - } - break; - case 3: - { - ComplexType C30, C03; - function->SetP(3); - function->SetQ(0); - C30 = function->EvaluateAtIndex(index); - function->SetP(0); - function->SetQ(3); - C03 = function->EvaluateAtIndex(index); - - HuValue = vcl_abs(C30 * C03); - } - break; - case 4: - { - ComplexType C21, C12; - function->SetP(2); - function->SetQ(1); - C21 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - HuValue = vcl_abs(C21 * C12); - } - break; - - case 5: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - HuValueComplex = C30 * vcl_pow(C12, 3); - HuValue = HuValueComplex.real(); - } - break; - - case 6: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - HuValueComplex = C20 * vcl_pow(C12, 2); - HuValue = HuValueComplex.real(); - } - break; - - case 7: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->EvaluateAtIndex(index); - function->SetP(1); - function->SetQ(2); - C12 = function->EvaluateAtIndex(index); - - HuValueComplex = C30 * vcl_pow(C12, 3); - HuValue = HuValueComplex.imag(); - } - break; - - default: - itkWarningMacro("Hu's invariant parameters are between 1 and 7"); + case 1: + { + ComplexType C11; + function->SetP(1); + function->SetQ(1); + C11 = function->EvaluateAtIndex(index); + HuValue = C11.real(); + } + break; + case 2: + { + ComplexType C20, C02; + function->SetP(2); + function->SetQ(0); + C20 = function->EvaluateAtIndex(index); + function->SetP(0); + function->SetQ(2); + C02 = function->EvaluateAtIndex(index); + + HuValue = vcl_abs(C20 * C02); + + } + break; + case 3: + { + ComplexType C30, C03; + function->SetP(3); + function->SetQ(0); + C30 = function->EvaluateAtIndex(index); + function->SetP(0); + function->SetQ(3); + C03 = function->EvaluateAtIndex(index); + + HuValue = vcl_abs(C30 * C03); + } + break; + case 4: + { + ComplexType C21, C12; + function->SetP(2); + function->SetQ(1); + C21 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + HuValue = vcl_abs(C21 * C12); + } + break; + + case 5: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + HuValueComplex = C30 * vcl_pow(C12, 3); + HuValue = HuValueComplex.real(); + } + break; + + case 6: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + HuValueComplex = C20 * vcl_pow(C12, 2); + HuValue = HuValueComplex.real(); + } + break; + + case 7: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->EvaluateAtIndex(index); + function->SetP(1); + function->SetQ(2); + C12 = function->EvaluateAtIndex(index); + + HuValueComplex = C30 * vcl_pow(C12, 3); + HuValue = HuValueComplex.imag(); + } + break; + + default: + itkWarningMacro("Hu's invariant parameters are between 1 and 7"); } return (static_cast<RealType>(HuValue)); diff --git a/Code/FeatureExtraction/otbHuPathFunction.h b/Code/FeatureExtraction/otbHuPathFunction.h index 980a058fc5..a363944c54 100644 --- a/Code/FeatureExtraction/otbHuPathFunction.h +++ b/Code/FeatureExtraction/otbHuPathFunction.h @@ -53,8 +53,8 @@ namespace otb */ template <class TInputPath, - class TOutput = double, - class TPrecision = double> + class TOutput = double, + class TPrecision = double> class ITK_EXPORT HuPathFunction : public RealMomentPathFunction<TInputPath, TOutput, TPrecision> { diff --git a/Code/FeatureExtraction/otbHuPathFunction.txx b/Code/FeatureExtraction/otbHuPathFunction.txx index 05ba8174cb..08d04b45a6 100644 --- a/Code/FeatureExtraction/otbHuPathFunction.txx +++ b/Code/FeatureExtraction/otbHuPathFunction.txx @@ -66,103 +66,103 @@ HuPathFunction<TInputPath, TOutput, TPrecision> switch (m_MomentNumber) { - case 1: - { - ComplexType C11; - function->SetP(1); - function->SetQ(1); - C11 = function->Evaluate(); - HuValue = C11.real(); - } - break; - case 2: - { - ComplexType C20, C02; - function->SetP(2); - function->SetQ(0); - C20 = function->Evaluate(); - function->SetP(0); - function->SetQ(2); - C02 = function->Evaluate(); - - HuValue = vcl_abs(C20 * C02); - - } - break; - case 3: - { - ComplexType C30, C03; - function->SetP(3); - function->SetQ(0); - C30 = function->Evaluate(); - function->SetP(0); - function->SetQ(3); - C03 = function->Evaluate(); - - HuValue = vcl_abs(C30 * C03); - } - break; - case 4: - { - ComplexType C21, C12; - function->SetP(2); - function->SetQ(1); - C21 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - HuValue = vcl_abs(C21 * C12); - } - break; - - case 5: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - HuValueComplex = C30 * vcl_pow(C12, 3); - HuValue = HuValueComplex.real(); - } - break; - - case 6: - { - ComplexType C20, C12; - function->SetP(2); - function->SetQ(0); - C20 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - HuValueComplex = C20 * vcl_pow(C12, 2); - HuValue = HuValueComplex.real(); - } - break; - - case 7: - { - ComplexType C30, C12; - function->SetP(3); - function->SetQ(0); - C30 = function->Evaluate(); - function->SetP(1); - function->SetQ(2); - C12 = function->Evaluate(); - - HuValueComplex = C30 * vcl_pow(C12, 3); - HuValue = HuValueComplex.imag(); - } - break; - - default: - itkWarningMacro("Hu's invariant parameters are between 1 and 7"); + case 1: + { + ComplexType C11; + function->SetP(1); + function->SetQ(1); + C11 = function->Evaluate(); + HuValue = C11.real(); + } + break; + case 2: + { + ComplexType C20, C02; + function->SetP(2); + function->SetQ(0); + C20 = function->Evaluate(); + function->SetP(0); + function->SetQ(2); + C02 = function->Evaluate(); + + HuValue = vcl_abs(C20 * C02); + + } + break; + case 3: + { + ComplexType C30, C03; + function->SetP(3); + function->SetQ(0); + C30 = function->Evaluate(); + function->SetP(0); + function->SetQ(3); + C03 = function->Evaluate(); + + HuValue = vcl_abs(C30 * C03); + } + break; + case 4: + { + ComplexType C21, C12; + function->SetP(2); + function->SetQ(1); + C21 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + HuValue = vcl_abs(C21 * C12); + } + break; + + case 5: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + HuValueComplex = C30 * vcl_pow(C12, 3); + HuValue = HuValueComplex.real(); + } + break; + + case 6: + { + ComplexType C20, C12; + function->SetP(2); + function->SetQ(0); + C20 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + HuValueComplex = C20 * vcl_pow(C12, 2); + HuValue = HuValueComplex.real(); + } + break; + + case 7: + { + ComplexType C30, C12; + function->SetP(3); + function->SetQ(0); + C30 = function->Evaluate(); + function->SetP(1); + function->SetQ(2); + C12 = function->Evaluate(); + + HuValueComplex = C30 * vcl_pow(C12, 3); + HuValue = HuValueComplex.imag(); + } + break; + + default: + itkWarningMacro("Hu's invariant parameters are between 1 and 7"); } return (static_cast<RealType>(HuValue)); diff --git a/Code/FeatureExtraction/otbImageToHessianDeterminantImageFilter.h b/Code/FeatureExtraction/otbImageToHessianDeterminantImageFilter.h index 3caa9b903e..dffce7d209 100644 --- a/Code/FeatureExtraction/otbImageToHessianDeterminantImageFilter.h +++ b/Code/FeatureExtraction/otbImageToHessianDeterminantImageFilter.h @@ -114,7 +114,7 @@ public: typedef itk::HessianRecursiveGaussianImageFilter <InputImageType, VectorImageType> ImageToHessianImageFilterType; typedef typename ImageToHessianImageFilterType::Pointer - ImageToHessianImageFilterPointerType; + ImageToHessianImageFilterPointerType; typedef Functor::HessianDeterminant<VectorType, OutputPixelType> DeterminantFunctorType; typedef itk::UnaryFunctorImageFilter<VectorImageType, OutputImageType, DeterminantFunctorType> DeterminantFilterType; typedef typename DeterminantFilterType::Pointer diff --git a/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.h b/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.h index ccd306e380..91afd98113 100644 --- a/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.h +++ b/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.h @@ -34,8 +34,8 @@ namespace otb * */ template <class TInputImage, - class TOutputImage, - class TOutputImageDirection = TOutputImage> + class TOutputImage, + class TOutputImageDirection = TOutputImage> class ITK_EXPORT ImageToModulusAndDirectionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { public: diff --git a/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.txx b/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.txx index d60babf17d..3e21d24ebd 100644 --- a/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.txx +++ b/Code/FeatureExtraction/otbImageToModulusAndDirectionImageFilter.txx @@ -43,7 +43,7 @@ ImageToModulusAndDirectionImageFilter() /** Return the const output image modulus */ template <class TInputImage, class TOutputImage, class TOutputImageDirection> const typename ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, - TOutputImageDirection>::OutputImageType * + TOutputImageDirection>::OutputImageType * ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, TOutputImageDirection>:: GetOutput() const { @@ -71,7 +71,7 @@ GetOutput() /** Return the const output image direction */ template <class TInputImage, class TOutputImage, class TOutputImageDirection> const typename ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, - TOutputImageDirection>::OutputImageDirectionType * + TOutputImageDirection>::OutputImageDirectionType * ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, TOutputImageDirection>:: GetOutputDirection() const { @@ -86,7 +86,7 @@ GetOutputDirection() const /** Return the output image direction */ template <class TInputImage, class TOutputImage, class TOutputImageDirection> typename ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, - TOutputImageDirection>::OutputImageDirectionType * + TOutputImageDirection>::OutputImageDirectionType * ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, TOutputImageDirection>:: GetOutputDirection() { diff --git a/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.h b/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.h index af4795cfaf..98fc3cd3ee 100644 --- a/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.h +++ b/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.h @@ -205,14 +205,14 @@ public: typedef typename GradientFilterType::OutputImageType GradientOutputImageType; typedef itk::UnaryFunctorImageFilter<GradientOutputImageType, InputImageType, - Functor::MagnitudeFunctor<typename GradientOutputImageType::PixelType, - typename InputImageType::PixelType> > + Functor::MagnitudeFunctor<typename GradientOutputImageType::PixelType, + typename InputImageType::PixelType> > MagnitudeFilterType; typedef typename MagnitudeFilterType::Pointer MagnitudeFilterPointerType; typedef itk::UnaryFunctorImageFilter<GradientOutputImageType, InputImageType, - Functor::OrientationFunctor<typename GradientOutputImageType::PixelType, - typename InputImageType::PixelType> > + Functor::OrientationFunctor<typename GradientOutputImageType::PixelType, + typename InputImageType::PixelType> > OrientationFilterType; typedef typename OrientationFilterType::Pointer OrientationFilterPointerType; diff --git a/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.txx b/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.txx index 137f428c2f..c8d25f74ab 100644 --- a/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.txx +++ b/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.txx @@ -59,14 +59,14 @@ template <class TInputImage, class TOutputPointSet> const typename ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet>::OffsetType ImageToSIFTKeyPointSetFilter<TInputImage, TOutputPointSet>::m_Offsets[8] = { - {{-1, -1}}, //0 - {{-1, 0}}, //1 - {{-1, 1}}, //2 - {{ 0, -1}}, //3 - {{ 0, 1}}, //4 - {{ 1, -1}}, //5 - {{ 1, 0}}, //6 - {{ 1, 1}}, //7 + {{-1, -1}}, //0 + {{-1, 0}}, //1 + {{-1, 1}}, //2 + {{ 0, -1}}, //3 + {{ 0, 1}}, //4 + {{ 1, -1}}, //5 + {{ 1, 0}}, //6 + {{ 1, 1}}, //7 }; /** diff --git a/Code/FeatureExtraction/otbInverseDifferenceMomentTextureFunctor.h b/Code/FeatureExtraction/otbInverseDifferenceMomentTextureFunctor.h index 942e94bc77..2208e387ea 100644 --- a/Code/FeatureExtraction/otbInverseDifferenceMomentTextureFunctor.h +++ b/Code/FeatureExtraction/otbInverseDifferenceMomentTextureFunctor.h @@ -44,8 +44,8 @@ public: } InverseDifferenceMomentTextureFunctor() - { - }; + { + }; virtual ~InverseDifferenceMomentTextureFunctor(){} diff --git a/Code/FeatureExtraction/otbKeyPointSetsMatchingFilter.h b/Code/FeatureExtraction/otbKeyPointSetsMatchingFilter.h index 5dc11f928b..0231a8c78f 100644 --- a/Code/FeatureExtraction/otbKeyPointSetsMatchingFilter.h +++ b/Code/FeatureExtraction/otbKeyPointSetsMatchingFilter.h @@ -51,8 +51,8 @@ public: /// standard class typedefs typedef KeyPointSetsMatchingFilter Self; typedef ObjectListSource<ObjectList< - Landmark<typename TPointSet::PointType, - typename TPointSet::PixelType, double> > > Superclass; + Landmark<typename TPointSet::PointType, + typename TPointSet::PixelType, double> > > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -68,7 +68,7 @@ public: typedef TDistance DistanceType; typedef typename DistanceType::Pointer DistancePointerType; typedef Landmark<typename TPointSet::PointType, - typename TPointSet::PixelType, double> LandmarkType; + typename TPointSet::PixelType, double> LandmarkType; typedef typename LandmarkType::Pointer LandmarkPointerType; typedef ObjectList<LandmarkType> LandmarkListType; typedef typename LandmarkListType::Pointer LandmarkListPointerType; diff --git a/Code/FeatureExtraction/otbLineCorrelationDetectorImageFilter.h b/Code/FeatureExtraction/otbLineCorrelationDetectorImageFilter.h index 18472c515f..98bf32539b 100644 --- a/Code/FeatureExtraction/otbLineCorrelationDetectorImageFilter.h +++ b/Code/FeatureExtraction/otbLineCorrelationDetectorImageFilter.h @@ -31,12 +31,12 @@ namespace otb */ template <class TInputImage, - class TOutputImage, - class TOutputImageDirection = TOutputImage, - class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > + class TOutputImage, + class TOutputImageDirection = TOutputImage, + class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > class ITK_EXPORT LineCorrelationDetectorImageFilter : public LineDetectorImageFilterBase<TInputImage, TOutputImage, - TOutputImageDirection, - TInterpolator> + TOutputImageDirection, + TInterpolator> { public: /** Extract dimensions as well of the images of entry of exit. */ diff --git a/Code/FeatureExtraction/otbLineDetectorImageFilterBase.h b/Code/FeatureExtraction/otbLineDetectorImageFilterBase.h index 4a82c7d409..423441a58a 100644 --- a/Code/FeatureExtraction/otbLineDetectorImageFilterBase.h +++ b/Code/FeatureExtraction/otbLineDetectorImageFilterBase.h @@ -53,11 +53,11 @@ namespace otb */ template <class TInputImage, - class TOutputImage, - class TOutputImageDirection = TOutputImage, - class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > + class TOutputImage, + class TOutputImageDirection = TOutputImage, + class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > class ITK_EXPORT LineDetectorImageFilterBase : public ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, - TOutputImageDirection> + TOutputImageDirection> { public: /** Extract dimensions as well of the images of entry of exit. */ diff --git a/Code/FeatureExtraction/otbLineRatioDetectorImageFilter.h b/Code/FeatureExtraction/otbLineRatioDetectorImageFilter.h index d720d50d26..fa3c763e0d 100644 --- a/Code/FeatureExtraction/otbLineRatioDetectorImageFilter.h +++ b/Code/FeatureExtraction/otbLineRatioDetectorImageFilter.h @@ -60,12 +60,12 @@ namespace otb * */ template <class TInputImage, - class TOutputImage, - class TOutputImageDirection = TOutputImage, - class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > + class TOutputImage, + class TOutputImageDirection = TOutputImage, + class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage> > class ITK_EXPORT LineRatioDetectorImageFilter : public LineDetectorImageFilterBase<TInputImage, TOutputImage, - TOutputImageDirection, - TInterpolator> + TOutputImageDirection, + TInterpolator> { public: /** Extract dimensions as well of the images of entry of exit. */ diff --git a/Code/FeatureExtraction/otbLineSegmentDetector.h b/Code/FeatureExtraction/otbLineSegmentDetector.h index 922d2471fc..6157985846 100644 --- a/Code/FeatureExtraction/otbLineSegmentDetector.h +++ b/Code/FeatureExtraction/otbLineSegmentDetector.h @@ -135,16 +135,16 @@ public: typedef typename GradientFilterType::OutputImageType GradientOutputImageType; typedef itk::UnaryFunctorImageFilter<GradientOutputImageType, OutputImageType, - Functor::MagnitudeFunctor<typename GradientOutputImageType::PixelType, - TPrecision> > MagnitudeFilterType; + Functor::MagnitudeFunctor<typename GradientOutputImageType::PixelType, + TPrecision> > MagnitudeFilterType; typedef typename MagnitudeFilterType::Pointer MagnitudeFilterPointerType; typedef typename MagnitudeFilterType::OutputImageType::PixelType MagnitudePixelType; typedef typename MagnitudeFilterType::OutputImageType MagnitudeImageType; typedef typename MagnitudeImageType::Pointer MagnitudeImagePointerType; typedef itk::UnaryFunctorImageFilter<GradientOutputImageType, OutputImageType, - Functor::OrientationFunctor<typename GradientOutputImageType::PixelType, - TPrecision> > OrientationFilterType; + Functor::OrientationFunctor<typename GradientOutputImageType::PixelType, + TPrecision> > OrientationFilterType; typedef typename OrientationFilterType::Pointer OrientationFilterPointerType; typedef typename OrientationFilterType::OutputImageType OutputImageDirType; typedef typename OutputImageDirType::RegionType OutputImageDirRegionType; diff --git a/Code/FeatureExtraction/otbMaskedScalarImageToGreyLevelCoocurenceMatrixGenerator.h b/Code/FeatureExtraction/otbMaskedScalarImageToGreyLevelCoocurenceMatrixGenerator.h index 4c787065f2..d2a954c343 100644 --- a/Code/FeatureExtraction/otbMaskedScalarImageToGreyLevelCoocurenceMatrixGenerator.h +++ b/Code/FeatureExtraction/otbMaskedScalarImageToGreyLevelCoocurenceMatrixGenerator.h @@ -23,68 +23,68 @@ namespace otb { - /** \class MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - * \brief This class extends the ITK version by providing matrix estimation on a sub-region. - * - * This class compute the co-occurence matrix over a given region of the image. The region can be set - * using the SetRegion()/GetRegion() methods. - * - * \sa itk::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - */ -template <class TImage, class THistogramFrequencyContainer = itk::Statistics::DenseFrequencyContainer > +/** \class MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator + * \brief This class extends the ITK version by providing matrix estimation on a sub-region. + * + * This class compute the co-occurence matrix over a given region of the image. The region can be set + * using the SetRegion()/GetRegion() methods. + * + * \sa itk::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator + */ +template <class TImage, class THistogramFrequencyContainer = itk::Statistics::DenseFrequencyContainer> class MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - : public itk::Statistics::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator<TImage,THistogramFrequencyContainer> + : public itk::Statistics::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator<TImage, + THistogramFrequencyContainer> { public: - /** Standard class typedef */ - typedef MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator Self; - typedef itk::Statistics::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - <TImage,THistogramFrequencyContainer> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + /** Standard class typedef */ + typedef MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator Self; + typedef itk::Statistics::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator + <TImage, THistogramFrequencyContainer> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; - /** Creation through object factory */ - itkNewMacro(Self); + /** Creation through object factory */ + itkNewMacro(Self); - /** RTTI */ - itkTypeMacro(MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator, - itk::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator); + /** RTTI */ + itkTypeMacro(MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator, + itk::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator); - /** Superclass typedefs */ - typedef TImage ImageType; - typedef typename ImageType::RegionType RegionType; - typedef typename Superclass::RadiusType RadiusType; + /** Superclass typedefs */ + typedef TImage ImageType; + typedef typename ImageType::RegionType RegionType; + typedef typename Superclass::RadiusType RadiusType; - /** Set/Get the region on which the co-occurence matrix is computed */ - itkSetMacro(Region,RegionType); - itkGetMacro(Region,RegionType); + /** Set/Get the region on which the co-occurence matrix is computed */ + itkSetMacro(Region, RegionType); + itkGetMacro(Region, RegionType); protected: - /** Constructor */ - MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator() : m_Region() {} - /** Destructor */ - ~MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator(){} - - /** Overload this method to restrict co-occurence to the given region */ - virtual void FillHistogram(RadiusType radius, RegionType region) - { - // Check that region is inside the requested region - RegionType subregion = m_Region; - - if(subregion.Crop(region)) - { - // If so, call superclass FillHistogram implementation - this->Superclass::FillHistogram(radius,subregion); - } - } + /** Constructor */ + MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator() : m_Region() {} + /** Destructor */ + ~MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator(){} + + /** Overload this method to restrict co-occurence to the given region */ + virtual void FillHistogram(RadiusType radius, RegionType region) + { + // Check that region is inside the requested region + RegionType subregion = m_Region; + + if (subregion.Crop(region)) + { + // If so, call superclass FillHistogram implementation + this->Superclass::FillHistogram(radius, subregion); + } + } private: - MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - - /** Region on which to compute co-occurence */ - RegionType m_Region; + MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator(const Self&); //purposely not implemented + void operator =(const Self&); //purposely not implemented + /** Region on which to compute co-occurence */ + RegionType m_Region; }; } // End namespace otb diff --git a/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.h b/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.h index f9283032c1..7cda01913f 100644 --- a/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.h +++ b/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.h @@ -34,8 +34,8 @@ namespace otb * */ template <class TInputImage, - class TInputImageDirection, - class TOutputImage> + class TInputImageDirection, + class TOutputImage> class ITK_EXPORT ModulusAndDirectionImageToImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { public: diff --git a/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.txx b/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.txx index 55a06c5e65..fca9ad52d4 100644 --- a/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.txx +++ b/Code/FeatureExtraction/otbModulusAndDirectionImageToImageFilter.txx @@ -77,7 +77,7 @@ GetInput(void) /** Return the intput image direction */ template <class TInputImage, class TInputImageDirection, class TOutputImage> const typename ModulusAndDirectionImageToImageFilter<TInputImage, TInputImageDirection, - TOutputImage>::InputImageDirectionType * + TOutputImage>::InputImageDirectionType * ModulusAndDirectionImageToImageFilter<TInputImage, TInputImageDirection, TOutputImage>:: GetInputDirection(void) { diff --git a/Code/FeatureExtraction/otbMultiplyByScalarImageFilter.h b/Code/FeatureExtraction/otbMultiplyByScalarImageFilter.h index 6ad2fce665..74c07f6c82 100644 --- a/Code/FeatureExtraction/otbMultiplyByScalarImageFilter.h +++ b/Code/FeatureExtraction/otbMultiplyByScalarImageFilter.h @@ -65,20 +65,20 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT MultiplyByScalarImageFilter : public itk::UnaryFunctorImageFilter< - TInputImage, TOutputImage, - Functor::MultiplyByScalar< - ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> > + TInputImage, TOutputImage, + Functor::MultiplyByScalar< + ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MultiplyByScalarImageFilter Self; typedef typename itk::UnaryFunctorImageFilter< - TInputImage, - TOutputImage, - Functor::MultiplyByScalar< - ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> > Superclass; + TInputImage, + TOutputImage, + Functor::MultiplyByScalar< + ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbNeighborhoodScalarProductFilter.txx b/Code/FeatureExtraction/otbNeighborhoodScalarProductFilter.txx index d919c49d02..abed186141 100644 --- a/Code/FeatureExtraction/otbNeighborhoodScalarProductFilter.txx +++ b/Code/FeatureExtraction/otbNeighborhoodScalarProductFilter.txx @@ -97,30 +97,30 @@ NeighborhoodScalarProductFilter<TInputImage, TOutputModulus, TOutputDirection> OffsetType offset2; switch (neighborhoodNumber) { - case 0: - offset1[0] = 1; - offset1[1] = -1; - offset2[0] = -1; - offset2[1] = 1; - break; - case 1: - offset1[0] = 1; - offset1[1] = 0; - offset2[0] = -1; - offset2[1] = 0; - break; - case 2: - offset1[0] = 1; - offset1[1] = 1; - offset2[0] = -1; - offset2[1] = -1; - break; - case 3: - offset1[0] = 0; - offset1[1] = 1; - offset2[0] = 0; - offset2[1] = -1; - break; + case 0: + offset1[0] = 1; + offset1[1] = -1; + offset2[0] = -1; + offset2[1] = 1; + break; + case 1: + offset1[0] = 1; + offset1[1] = 0; + offset2[0] = -1; + offset2[1] = 0; + break; + case 2: + offset1[0] = 1; + offset1[1] = 1; + offset2[0] = -1; + offset2[1] = -1; + break; + case 3: + offset1[0] = 0; + offset1[1] = 1; + offset2[0] = 0; + offset2[1] = -1; + break; } // Get the gradient values InputPixelType pixel1 = neighInputIt.GetPixel(offset1); diff --git a/Code/FeatureExtraction/otbNonMaxRemovalByDirectionFilter.h b/Code/FeatureExtraction/otbNonMaxRemovalByDirectionFilter.h index 6228b8dede..88211f6bf7 100644 --- a/Code/FeatureExtraction/otbNonMaxRemovalByDirectionFilter.h +++ b/Code/FeatureExtraction/otbNonMaxRemovalByDirectionFilter.h @@ -55,30 +55,30 @@ public: } switch (neighborhoodNumber) { - case 0: - offset1[0] = 1; - offset1[1] = -1; - offset2[0] = -1; - offset2[1] = 1; - break; - case 1: - offset1[0] = 1; - offset1[1] = 0; - offset2[0] = -1; - offset2[1] = 0; - break; - case 2: - offset1[0] = 1; - offset1[1] = 1; - offset2[0] = -1; - offset2[1] = -1; - break; - case 3: - offset1[0] = 0; - offset1[1] = 1; - offset2[0] = 0; - offset2[1] = -1; - break; + case 0: + offset1[0] = 1; + offset1[1] = -1; + offset2[0] = -1; + offset2[1] = 1; + break; + case 1: + offset1[0] = 1; + offset1[1] = 0; + offset2[0] = -1; + offset2[1] = 0; + break; + case 2: + offset1[0] = 1; + offset1[1] = 1; + offset2[0] = -1; + offset2[1] = -1; + break; + case 3: + offset1[0] = 0; + offset1[1] = 1; + offset2[0] = 0; + offset2[1] = -1; + break; } if ((itA.GetCenterPixel() > itA.GetPixel(offset1)) && (itA.GetCenterPixel() > itA.GetPixel(offset2))) @@ -117,11 +117,11 @@ public: /** typedef of the computing filter (this allows us to derive from ModulusAndDirectionToImageFilter as well as using the BinaryFunctorNeighBorhoodImageFilter, which is appropriate here */ typedef Functor::NonMaxRemovalByDirectionFunctor< - typename itk::ConstNeighborhoodIterator<TInputModulus>, - typename itk::ConstNeighborhoodIterator<TInputDirection>, - typename TOutputImage::PixelType> FunctorType; + typename itk::ConstNeighborhoodIterator<TInputModulus>, + typename itk::ConstNeighborhoodIterator<TInputDirection>, + typename TOutputImage::PixelType> FunctorType; typedef otb::BinaryFunctorNeighborhoodImageFilter<TInputModulus, TInputDirection, TOutputImage, - FunctorType> ComputingFilterType; + FunctorType> ComputingFilterType; protected: /** Constructor */ diff --git a/Code/FeatureExtraction/otbOrientationPathFunction.h b/Code/FeatureExtraction/otbOrientationPathFunction.h index c82e93a25f..234aed4913 100644 --- a/Code/FeatureExtraction/otbOrientationPathFunction.h +++ b/Code/FeatureExtraction/otbOrientationPathFunction.h @@ -33,7 +33,7 @@ namespace otb */ template <class TInputPath, - class TOutput = double> + class TOutput = double> class ITK_EXPORT OrientationPathFunction : public PathFunction<TInputPath, TOutput> { diff --git a/Code/FeatureExtraction/otbOrientationPathFunction.txx b/Code/FeatureExtraction/otbOrientationPathFunction.txx index ec6dd801e3..ab09be6b0c 100644 --- a/Code/FeatureExtraction/otbOrientationPathFunction.txx +++ b/Code/FeatureExtraction/otbOrientationPathFunction.txx @@ -36,7 +36,7 @@ OrientationPathFunction<TInputPath, TOutput> template <class TInputPath, class TOutput> typename OrientationPathFunction<TInputPath, - TOutput>::OutputType + TOutput>::OutputType OrientationPathFunction<TInputPath, TOutput> ::Evaluate(const PathType& path) const { @@ -72,7 +72,7 @@ OrientationPathFunction<TInputPath, TOutput> template <class TInputPath, class TOutput> typename OrientationPathFunction<TInputPath, - TOutput>::OutputType + TOutput>::OutputType OrientationPathFunction<TInputPath, TOutput> ::Evaluate() const { diff --git a/Code/FeatureExtraction/otbPanTexTextureImageFilter.h b/Code/FeatureExtraction/otbPanTexTextureImageFilter.h index 7a38054125..23b3da4dce 100644 --- a/Code/FeatureExtraction/otbPanTexTextureImageFilter.h +++ b/Code/FeatureExtraction/otbPanTexTextureImageFilter.h @@ -36,22 +36,22 @@ namespace otb template <class TInputImage, class TOutputImage> class ITK_EXPORT PanTexTextureImageFilter : public UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, TOutputImage, - ITK_TYPENAME Functor::PanTexTextureFunctor<ITK_TYPENAME - TInputImage:: - InternalPixelType, - ITK_TYPENAME - TOutputImage:: - InternalPixelType> > + ITK_TYPENAME Functor::PanTexTextureFunctor<ITK_TYPENAME + TInputImage:: + InternalPixelType, + ITK_TYPENAME + TOutputImage:: + InternalPixelType> > { public: /** Standard class typedefs. */ typedef PanTexTextureImageFilter Self; typedef UnaryFunctorNeighborhoodWithOffsetImageFilter<TInputImage, - TOutputImage, - typename Functor::PanTexTextureFunctor<typename TInputImage:: - InternalPixelType, - typename TOutputImage:: - InternalPixelType> > + TOutputImage, + typename Functor::PanTexTextureFunctor<typename TInputImage:: + InternalPixelType, + typename TOutputImage:: + InternalPixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbPanTexTextureImageFunctionFilter.h b/Code/FeatureExtraction/otbPanTexTextureImageFunctionFilter.h index 208512683b..cfe758d3bd 100644 --- a/Code/FeatureExtraction/otbPanTexTextureImageFunctionFilter.h +++ b/Code/FeatureExtraction/otbPanTexTextureImageFunctionFilter.h @@ -40,24 +40,24 @@ namespace otb template <class TInputImage, class TOutputImage, class TCoordRep = float> class ITK_EXPORT PanTexTextureImageFunctionFilter : public FunctionWithNeighborhoodToImageFilter<TInputImage, TOutputImage, - TextureImageFunction<TInputImage, - ITK_TYPENAME Functor::PanTexTextureFunctor< - ITK_TYPENAME TInputImage::PixelType, - ITK_TYPENAME - TOutputImage::PixelType>, TCoordRep> > + TextureImageFunction<TInputImage, + ITK_TYPENAME Functor::PanTexTextureFunctor< + ITK_TYPENAME TInputImage::PixelType, + ITK_TYPENAME + TOutputImage::PixelType>, TCoordRep> > { public: /** Standard class typedefs. */ typedef PanTexTextureImageFunctionFilter Self; typedef FunctionWithNeighborhoodToImageFilter<TInputImage, TOutputImage, - TextureImageFunction<TInputImage, - typename Functor::PanTexTextureFunctor<typename - TInputImage - ::PixelType, - typename - TOutputImage - ::PixelType>, TCoordRep> > Superclass; + TextureImageFunction<TInputImage, + typename Functor::PanTexTextureFunctor<typename + TInputImage + ::PixelType, + typename + TOutputImage + ::PixelType>, TCoordRep> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbRealMomentImageFunction.h b/Code/FeatureExtraction/otbRealMomentImageFunction.h index 416bfb3889..46a08cf225 100644 --- a/Code/FeatureExtraction/otbRealMomentImageFunction.h +++ b/Code/FeatureExtraction/otbRealMomentImageFunction.h @@ -31,9 +31,9 @@ namespace otb */ template <class TInput, - class TOutput = float, - class TPrecision = double, - class TCoordRep = float> + class TOutput = float, + class TPrecision = double, + class TCoordRep = float> class ITK_EXPORT RealMomentImageFunction : public GeometricMomentImageFunction<TInput, TOutput, TPrecision, TCoordRep> { diff --git a/Code/FeatureExtraction/otbRealMomentPathFunction.h b/Code/FeatureExtraction/otbRealMomentPathFunction.h index 9fde16deb0..ec8b76ad48 100644 --- a/Code/FeatureExtraction/otbRealMomentPathFunction.h +++ b/Code/FeatureExtraction/otbRealMomentPathFunction.h @@ -32,8 +32,8 @@ namespace otb */ template <class TInputPath, - class TOutput = double, - class TPrecision = double> + class TOutput = double, + class TPrecision = double> class ITK_EXPORT RealMomentPathFunction : public GeometricMomentPathFunction<TInputPath, TOutput, TPrecision> { diff --git a/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx b/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx index 305edd5496..c65bf412c3 100644 --- a/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx +++ b/Code/FeatureExtraction/otbRegionImageToRectangularPathListFilter.txx @@ -370,22 +370,26 @@ RegionImageToRectangularPathListFilter<TInputImage, TOutputPath> point[0] = (avgX + x1 * halfLength + x2 * halfWidth) * spacing[0] + origin[0]; point[1] = (avgY + y1 * halfLength + y2 * halfWidth) * spacing[1] + origin[1]; path->AddVertex(point); - if (regionCount <= regionDebugNumber) std::cout << "corner 1 : [" << point[0] << ", " << point[1] << "]" << + if (regionCount <= regionDebugNumber) + std::cout << "corner 1 : [" << point[0] << ", " << point[1] << "]" << std::endl; point[0] = (avgX - x1 * halfLength + x2 * halfWidth) * spacing[0] + origin[0]; point[1] = (avgY - y1 * halfLength + y2 * halfWidth) * spacing[1] + origin[1]; path->AddVertex(point); - if (regionCount <= regionDebugNumber) std::cout << "corner 2 : [" << point[0] << ", " << point[1] << "]" << + if (regionCount <= regionDebugNumber) + std::cout << "corner 2 : [" << point[0] << ", " << point[1] << "]" << std::endl; point[0] = (avgX - x1 * halfLength - x2 * halfWidth) * spacing[0] + origin[0]; point[1] = (avgY - y1 * halfLength - y2 * halfWidth) * spacing[1] + origin[1]; path->AddVertex(point); - if (regionCount <= regionDebugNumber) std::cout << "corner 3 : [" << point[0] << ", " << point[1] << "]" << + if (regionCount <= regionDebugNumber) + std::cout << "corner 3 : [" << point[0] << ", " << point[1] << "]" << std::endl; point[0] = (avgX + x1 * halfLength - x2 * halfWidth) * spacing[0] + origin[0]; point[1] = (avgY + y1 * halfLength - y2 * halfWidth) * spacing[1] + origin[1]; path->AddVertex(point); - if (regionCount <= regionDebugNumber) std::cout << "corner 4 : [" << point[0] << ", " << point[1] << "]" << + if (regionCount <= regionDebugNumber) + std::cout << "corner 4 : [" << point[0] << ", " << point[1] << "]" << std::endl; point[0] = (avgX + x1 * halfLength + x2 * halfWidth) * spacing[0] + origin[0]; point[1] = (avgY + y1 * halfLength + y2 * halfWidth) * spacing[1] + origin[1]; diff --git a/Code/FeatureExtraction/otbRemoveIsolatedByDirectionFilter.h b/Code/FeatureExtraction/otbRemoveIsolatedByDirectionFilter.h index 49a9f70b6e..498cabbff3 100644 --- a/Code/FeatureExtraction/otbRemoveIsolatedByDirectionFilter.h +++ b/Code/FeatureExtraction/otbRemoveIsolatedByDirectionFilter.h @@ -92,11 +92,11 @@ public: /** typedef of the computing filter (this allows us to derive from ModulusAndDirectionToImageFilter as well as using the BinaryFunctorNeighBorhoodImageFilter, which is appropriate here */ typedef Functor::RemoveIsolatedByDirectionFunctor< - typename itk::ConstNeighborhoodIterator<TInputModulus>, - typename itk::ConstNeighborhoodIterator<TInputDirection>, - typename TOutputImage::PixelType> FunctorType; + typename itk::ConstNeighborhoodIterator<TInputModulus>, + typename itk::ConstNeighborhoodIterator<TInputDirection>, + typename TOutputImage::PixelType> FunctorType; typedef otb::BinaryFunctorNeighborhoodImageFilter<TInputModulus, TInputDirection, TOutputImage, - FunctorType> ComputingFilterType; + FunctorType> ComputingFilterType; protected: /** Constructor */ diff --git a/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.h b/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.h index 6b0106ae33..8a7e1bc47c 100644 --- a/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.h +++ b/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.h @@ -52,9 +52,9 @@ namespace otb template <class TPath> class ITK_EXPORT RemoveTortuousPathListFilter : public UnaryFunctorObjectListBooleanFilter< - ObjectList<TPath>, - ObjectList<TPath>, - PathMeanDistanceFunctor<typename TPath::Pointer> > + ObjectList<TPath>, + ObjectList<TPath>, + PathMeanDistanceFunctor<typename TPath::Pointer> > {}; } // End namespace otb diff --git a/Code/FeatureExtraction/otbRemoveWrongDirectionFilter.h b/Code/FeatureExtraction/otbRemoveWrongDirectionFilter.h index 15628be399..4e3095847b 100644 --- a/Code/FeatureExtraction/otbRemoveWrongDirectionFilter.h +++ b/Code/FeatureExtraction/otbRemoveWrongDirectionFilter.h @@ -88,9 +88,9 @@ public: /** typedef of the computing filter (this allows us to derive from ModulusAndDirectionToImageFilter as well as using the BinaryFunctorImageFilter, which is appropriate here */ typedef Functor::RemoveWrongDirectionFunctor< - typename TInputModulus::PixelType, - typename TInputDirection::PixelType, - typename TOutputImage::PixelType> FunctorType; + typename TInputModulus::PixelType, + typename TInputDirection::PixelType, + typename TOutputImage::PixelType> FunctorType; typedef itk::BinaryFunctorImageFilter<TInputModulus, TInputDirection, TOutputImage, FunctorType> ComputingFilterType; protected: diff --git a/Code/FeatureExtraction/otbRoadExtractionFilter.h b/Code/FeatureExtraction/otbRoadExtractionFilter.h index 7857896904..224225f302 100644 --- a/Code/FeatureExtraction/otbRoadExtractionFilter.h +++ b/Code/FeatureExtraction/otbRoadExtractionFilter.h @@ -90,8 +90,8 @@ public: /* Template parameters typedefs for composites filters */ typedef SpectralAngleDistanceImageFilter< - InputImageType, - SpectralAngleType> SpectralAngleDistanceImageFilterType; + InputImageType, + SpectralAngleType> SpectralAngleDistanceImageFilterType; typedef GenericRoadExtractionFilter<SpectralAngleType, OutputPathType> GenericRoadExtractionFilterType; diff --git a/Code/FeatureExtraction/otbSFSTexturesFunctor.h b/Code/FeatureExtraction/otbSFSTexturesFunctor.h index 2966a04fa0..fff3684563 100644 --- a/Code/FeatureExtraction/otbSFSTexturesFunctor.h +++ b/Code/FeatureExtraction/otbSFSTexturesFunctor.h @@ -134,12 +134,10 @@ public: dist = vcl_sqrt(vcl_pow(static_cast<double>(offEnd[0]), 2) + vcl_pow(static_cast<double>(offEnd[1]), 2)); // for length computation - if (m_SelectedTextures[0] == true) - if (dist > length) length = dist; + if (m_SelectedTextures[0] == true) if (dist > length) length = dist; // for width computation - if (m_SelectedTextures[1] == true) - if (dist < width) width = dist; + if (m_SelectedTextures[1] == true) if (dist < width) width = dist; // for PSI computation if (m_SelectedTextures[2] == true || m_SelectedTextures[5] == true) sum += dist; diff --git a/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.h b/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.h index 861b4008cc..a34e54e4af 100644 --- a/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.h +++ b/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.h @@ -31,69 +31,69 @@ class ScalarImageToAdvancedTexturesFilter : public itk::ImageToImageFilter { public: /** Standard class typedefs */ - typedef ScalarImageToAdvancedTexturesFilter Self; - typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef ScalarImageToAdvancedTexturesFilter Self; + typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Creation through the object factory */ itkNewMacro(Self); /** RTTI */ - itkTypeMacro(ScalarImageToAdvancedTexturesFilter,ImageToImageFilter); + itkTypeMacro(ScalarImageToAdvancedTexturesFilter, ImageToImageFilter); /** Template class typedefs */ - typedef TInpuImage InputImageType; - typedef typename InputImageType::Pointer InputImagePointerType; - typedef typename InputImageType::PixelType InputPixelType; - typedef typename InputImageType::RegionType InputRegionType; - typedef typename InputRegionType::SizeType SizeType; - typedef TOutputImage OutputImageType; - typedef typename OutputImageType::Pointer OutputImagePointerType; - typedef typename OutputImageType::RegionType OutputRegionType; + typedef TInpuImage InputImageType; + typedef typename InputImageType::Pointer InputImagePointerType; + typedef typename InputImageType::PixelType InputPixelType; + typedef typename InputImageType::RegionType InputRegionType; + typedef typename InputRegionType::SizeType SizeType; + typedef TOutputImage OutputImageType; + typedef typename OutputImageType::Pointer OutputImagePointerType; + typedef typename OutputImageType::RegionType OutputRegionType; /** Co-occurence matrix and textures calculator */ typedef otb::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - <InputImageType> CoocurrenceMatrixGeneratorType; + <InputImageType> CoocurrenceMatrixGeneratorType; typedef typename CoocurrenceMatrixGeneratorType::Pointer CoocurrenceMatrixGeneratorPointerType; typedef typename CoocurrenceMatrixGeneratorType::OffsetType OffsetType; typedef typename CoocurrenceMatrixGeneratorType::HistogramType HistogramType; typedef GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator <HistogramType> TextureCoefficientsCalculatorType; - typedef typename TextureCoefficientsCalculatorType::Pointer TextureCoefficientsCalculatorPointerType; + typedef typename TextureCoefficientsCalculatorType::Pointer TextureCoefficientsCalculatorPointerType; /** Set the radius of the window on which textures will be computed */ - itkSetMacro(Radius,SizeType); + itkSetMacro(Radius, SizeType); /** Get the radius of the window on which textures will be computed */ - itkGetMacro(Radius,SizeType); + itkGetMacro(Radius, SizeType); /** Set the offset for co-occurence computation */ - itkSetMacro(Offset,OffsetType); + itkSetMacro(Offset, OffsetType); /** Get the offset for co-occurence computation */ - itkGetMacro(Offset,OffsetType); + itkGetMacro(Offset, OffsetType); /** Set the number of bin per axis for histogram generation */ - itkSetMacro(NumberOfBinsPerAxis,unsigned int); + itkSetMacro(NumberOfBinsPerAxis, unsigned int); /** Get the number of bin per axis for histogram generation */ - itkGetMacro(NumberOfBinsPerAxis,unsigned int); + itkGetMacro(NumberOfBinsPerAxis, unsigned int); /** Set the input image minimum */ - itkSetMacro(InputImageMinimum,InputPixelType); + itkSetMacro(InputImageMinimum, InputPixelType); /** Get the input image minimum */ - itkGetMacro(InputImageMinimum,InputPixelType); + itkGetMacro(InputImageMinimum, InputPixelType); /** Set the input image maximum */ - itkSetMacro(InputImageMaximum,InputPixelType); + itkSetMacro(InputImageMaximum, InputPixelType); /** Get the input image maximum */ - itkGetMacro(InputImageMaximum,InputPixelType); + itkGetMacro(InputImageMaximum, InputPixelType); /** Get the mean output image */ OutputImageType * GetMeanOutput(); - + /** Get the variance output image */ OutputImageType * GetVarianceOutput(); @@ -126,29 +126,29 @@ protected: /** Generate the input requested region */ virtual void GenerateInputRequestedRegion(); /** Parallel textures extraction */ - virtual void ThreadedGenerateData(const OutputRegionType & outputRegion, int threadId); + virtual void ThreadedGenerateData(const OutputRegionType& outputRegion, int threadId); private: ScalarImageToAdvancedTexturesFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented + void operator =(const Self&); //purposely not implemented /** Convenient method to compute union of 2 regions */ - static OutputRegionType RegionUnion(const OutputRegionType & region1, const OutputRegionType & region2); + static OutputRegionType RegionUnion(const OutputRegionType& region1, const OutputRegionType& region2); /** Radius of the window on which to compute textures */ - SizeType m_Radius; + SizeType m_Radius; /** Offset for co-occurence */ - OffsetType m_Offset; + OffsetType m_Offset; /** Number of bins per axis for histogram generation */ - unsigned int m_NumberOfBinsPerAxis; + unsigned int m_NumberOfBinsPerAxis; /** Input image minimum */ - InputPixelType m_InputImageMinimum; + InputPixelType m_InputImageMinimum; /** Input image maximum */ - InputPixelType m_InputImageMaximum; + InputPixelType m_InputImageMaximum; }; } // End namespace otb diff --git a/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.txx b/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.txx index 15238eb176..26d811cbc3 100644 --- a/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.txx +++ b/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.txx @@ -25,164 +25,164 @@ namespace otb { -template <class TInputImage,class TOutputImage> -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::ScalarImageToAdvancedTexturesFilter() : m_Radius(), - m_Offset(), - m_NumberOfBinsPerAxis(8), - m_InputImageMinimum(0), - m_InputImageMaximum(256) + m_Offset(), + m_NumberOfBinsPerAxis(8), + m_InputImageMinimum(0), + m_InputImageMaximum(256) { // There are 9 outputs corresponding to the 8 textures indices this->SetNumberOfOutputs(9); // Create the 9 outputs - this->SetNthOutput(0,OutputImageType::New()); - this->SetNthOutput(1,OutputImageType::New()); - this->SetNthOutput(2,OutputImageType::New()); - this->SetNthOutput(3,OutputImageType::New()); - this->SetNthOutput(4,OutputImageType::New()); - this->SetNthOutput(5,OutputImageType::New()); - this->SetNthOutput(6,OutputImageType::New()); - this->SetNthOutput(7,OutputImageType::New()); - this->SetNthOutput(8,OutputImageType::New()); + this->SetNthOutput(0, OutputImageType::New()); + this->SetNthOutput(1, OutputImageType::New()); + this->SetNthOutput(2, OutputImageType::New()); + this->SetNthOutput(3, OutputImageType::New()); + this->SetNthOutput(4, OutputImageType::New()); + this->SetNthOutput(5, OutputImageType::New()); + this->SetNthOutput(6, OutputImageType::New()); + this->SetNthOutput(7, OutputImageType::New()); + this->SetNthOutput(8, OutputImageType::New()); } -template <class TInputImage,class TOutputImage> -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::~ScalarImageToAdvancedTexturesFilter() {} -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetVarianceOutput() { - if(this->GetNumberOfOutputs()<1) + if (this->GetNumberOfOutputs() < 1) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(0)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetSumAverageOutput() { - if(this->GetNumberOfOutputs()<2) + if (this->GetNumberOfOutputs() < 2) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(1)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetSumVarianceOutput() { - if(this->GetNumberOfOutputs()<3) + if (this->GetNumberOfOutputs() < 3) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(2)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetSumEntropyOutput() { - if(this->GetNumberOfOutputs()<4) + if (this->GetNumberOfOutputs() < 4) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(3)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetDifferenceEntropyOutput() { - if(this->GetNumberOfOutputs()<5) + if (this->GetNumberOfOutputs() < 5) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(4)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetDifferenceVarianceOutput() { - if(this->GetNumberOfOutputs()<6) + if (this->GetNumberOfOutputs() < 6) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(5)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetIC1Output() { - if(this->GetNumberOfOutputs()<7) + if (this->GetNumberOfOutputs() < 7) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(6)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetIC2Output() { - if(this->GetNumberOfOutputs()<8) + if (this->GetNumberOfOutputs() < 8) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(7)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GetMeanOutput() { - if(this->GetNumberOfOutputs()<1) + if (this->GetNumberOfOutputs() < 1) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(8)); } -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> ::GenerateInputRequestedRegion() { // First, call superclass implementation Superclass::GenerateInputRequestedRegion(); // Retrieve the input and output pointers - InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); + InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); OutputImagePointerType outputPtr = this->GetOutput(); - if(!inputPtr || !outputPtr) + if (!inputPtr || !outputPtr) { return; } @@ -193,15 +193,17 @@ ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> OutputRegionType outputRequestedRegion = outputPtr->GetRequestedRegion(); typename OutputRegionType::IndexType outputIndex = outputRequestedRegion.GetIndex(); - typename OutputRegionType::SizeType outputSize = outputRequestedRegion.GetSize(); - typename InputRegionType::IndexType inputIndex; - typename InputRegionType::SizeType inputSize; + typename OutputRegionType::SizeType outputSize = outputRequestedRegion.GetSize(); + typename InputRegionType::IndexType inputIndex; + typename InputRegionType::SizeType inputSize; // First, apply offset - for(unsigned int dim = 0; dim<InputImageType::ImageDimension;++dim) + for (unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { - inputIndex[dim]=std::min(outputIndex[dim],outputIndex[dim]+m_Offset[dim]); - inputSize[dim] =std::max(outputIndex[dim]+outputSize[dim],outputIndex[dim]+outputSize[dim]+m_Offset[dim])-inputIndex[dim]; + inputIndex[dim] = std::min(outputIndex[dim], outputIndex[dim] + m_Offset[dim]); + inputSize[dim] = + std::max(outputIndex[dim] + outputSize[dim], outputIndex[dim] + outputSize[dim] + + m_Offset[dim]) - inputIndex[dim]; } // Build the input requested region @@ -213,14 +215,14 @@ ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> inputRequestedRegion.PadByRadius(m_Radius); // Try to apply the requested region to the input image - if(inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) + if (inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) { inputPtr->SetRequestedRegion(inputRequestedRegion); } else { // Build an exception - itk::InvalidRequestedRegionError e(__FILE__,__LINE__); + itk::InvalidRequestedRegionError e(__FILE__, __LINE__); e.SetLocation(ITK_LOCATION); e.SetDescription("Requested region is (at least partially) outside the largest possible region."); e.SetDataObject(inputPtr); @@ -228,10 +230,10 @@ ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> } } -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> -::ThreadedGenerateData(const OutputRegionType & outputRegionForThread, int threadId) +ScalarImageToAdvancedTexturesFilter<TInputImage, TOutputImage> +::ThreadedGenerateData(const OutputRegionType& outputRegionForThread, int threadId) { // Retrieve the input and output pointers InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); @@ -241,20 +243,20 @@ ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> OutputImagePointerType sumVariancePtr = this->GetSumVarianceOutput(); OutputImagePointerType sumEntropytPtr = this->GetSumEntropyOutput(); OutputImagePointerType differenceEntropyPtr = this->GetDifferenceEntropyOutput(); - OutputImagePointerType differenceVariancePtr= this->GetDifferenceVarianceOutput(); + OutputImagePointerType differenceVariancePtr = this->GetDifferenceVarianceOutput(); OutputImagePointerType ic1Ptr = this->GetIC1Output(); OutputImagePointerType ic2Ptr = this->GetIC2Output(); // Build output iterators - itk::ImageRegionIteratorWithIndex<OutputImageType> varianceIt(variancePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> meanIt(meanPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> sumAverageIt(sumAveragePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> sumVarianceIt(sumVariancePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> sumEntropytIt(sumEntropytPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> differenceEntropyIt(differenceEntropyPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> differenceVarianceIt(differenceVariancePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> ic1It(ic1Ptr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> ic2It(ic2Ptr,outputRegionForThread); + itk::ImageRegionIteratorWithIndex<OutputImageType> varianceIt(variancePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> meanIt(meanPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> sumAverageIt(sumAveragePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> sumVarianceIt(sumVariancePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> sumEntropytIt(sumEntropytPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> differenceEntropyIt(differenceEntropyPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> differenceVarianceIt(differenceVariancePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> ic1It(ic1Ptr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> ic2It(ic2Ptr, outputRegionForThread); // Go to begin varianceIt.GoToBegin(); @@ -272,34 +274,34 @@ ScalarImageToAdvancedTexturesFilter<TInputImage,TOutputImage> coOccurenceMatrixGenerator->SetInput(inputPtr); coOccurenceMatrixGenerator->SetOffset(m_Offset); coOccurenceMatrixGenerator->SetNumberOfBinsPerAxis(m_NumberOfBinsPerAxis); - coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum,m_InputImageMaximum); + coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum, m_InputImageMaximum); // Build the texture calculator TextureCoefficientsCalculatorPointerType texturesCalculator = TextureCoefficientsCalculatorType::New(); // Set-up progress reporting - itk::ProgressReporter progress(this,threadId,outputRegionForThread.GetNumberOfPixels()); + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); // Iterate on outputs to compute textures - while(!varianceIt.IsAtEnd() - &&!meanIt.IsAtEnd() - &&!sumAverageIt.IsAtEnd() - &&!sumVarianceIt.IsAtEnd() - &&!sumEntropytIt.IsAtEnd() - &&!differenceEntropyIt.IsAtEnd() - &&!differenceVarianceIt.IsAtEnd() - &&!ic1It.IsAtEnd() - &&!ic2It.IsAtEnd()) + while (!varianceIt.IsAtEnd() + && !meanIt.IsAtEnd() + && !sumAverageIt.IsAtEnd() + && !sumVarianceIt.IsAtEnd() + && !sumEntropytIt.IsAtEnd() + && !differenceEntropyIt.IsAtEnd() + && !differenceVarianceIt.IsAtEnd() + && !ic1It.IsAtEnd() + && !ic2It.IsAtEnd()) { // Find the input region on which texture will be computed - InputRegionType currentRegion; - typename InputRegionType::IndexType currentIndex = varianceIt.GetIndex()-m_Radius; + InputRegionType currentRegion; + typename InputRegionType::IndexType currentIndex = varianceIt.GetIndex() - m_Radius; typename InputRegionType::SizeType currentSize; - for(unsigned int dim = 0; dim<InputImageType::ImageDimension;++dim) + for (unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { // Compute current size before applying offset - currentSize[dim] = 2*m_Radius[dim]+1; + currentSize[dim] = 2 * m_Radius[dim] + 1; } // Fill current region diff --git a/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.h b/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.h index c1617ad8f1..19b1775b0a 100644 --- a/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.h +++ b/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.h @@ -24,7 +24,7 @@ namespace otb { -/** \class ScalarImageToPanTexTextureFilter +/** \class ScalarImageToPanTexTextureFilter * \brief This class computes a texture derived built-up precense index (PanTex) * * This class computes a texture-derived built-up presence index (PanTex) from textural @@ -33,8 +33,8 @@ namespace otb * Print references: * * Pesari, M., A. Gerhardinger, F. Kayitakire. 2008. A robust built-up area precense - * index by anisotropic rotation-invariant textural measure. - * IEEE Journal of selected topics in applied earth observations and remote sensing. + * index by anisotropic rotation-invariant textural measure. + * IEEE Journal of selected topics in applied earth observations and remote sensing. * Vol1,NO3. * * @@ -50,60 +50,60 @@ class ScalarImageToPanTexTextureFilter : public itk::ImageToImageFilter { public: /** Standard class typedefs */ - typedef ScalarImageToPanTexTextureFilter Self; - typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef ScalarImageToPanTexTextureFilter Self; + typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Creation through the object factory */ itkNewMacro(Self); /** RTTI */ - itkTypeMacro(ScalarImageToPanTexTextureFilter,ImageToImageFilter); + itkTypeMacro(ScalarImageToPanTexTextureFilter, ImageToImageFilter); /** Template class typedefs */ - typedef TInpuImage InputImageType; - typedef typename InputImageType::Pointer InputImagePointerType; - typedef typename InputImageType::PixelType InputPixelType; - typedef typename InputImageType::RegionType InputRegionType; - typedef typename InputRegionType::SizeType SizeType; - typedef TOutputImage OutputImageType; - typedef typename OutputImageType::Pointer OutputImagePointerType; - typedef typename OutputImageType::RegionType OutputRegionType; + typedef TInpuImage InputImageType; + typedef typename InputImageType::Pointer InputImagePointerType; + typedef typename InputImageType::PixelType InputPixelType; + typedef typename InputImageType::RegionType InputRegionType; + typedef typename InputRegionType::SizeType SizeType; + typedef TOutputImage OutputImageType; + typedef typename OutputImageType::Pointer OutputImagePointerType; + typedef typename OutputImageType::RegionType OutputRegionType; /** Co-occurence matrix and textures calculator */ typedef otb::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - <InputImageType> CoocurrenceMatrixGeneratorType; + <InputImageType> CoocurrenceMatrixGeneratorType; typedef typename CoocurrenceMatrixGeneratorType::Pointer CoocurrenceMatrixGeneratorPointerType; typedef typename CoocurrenceMatrixGeneratorType::OffsetType OffsetType; typedef typename std::vector<OffsetType> OffsetListType; typedef typename CoocurrenceMatrixGeneratorType::HistogramType HistogramType; typedef typename HistogramType::FrequencyType FrequencyType; typedef typename HistogramType::MeasurementType MeasurementType; - typedef typename HistogramType::Iterator HistogramIterator; - + typedef typename HistogramType::Iterator HistogramIterator; + /** Set the radius of the window on which textures will be computed */ - itkSetMacro(Radius,SizeType); + itkSetMacro(Radius, SizeType); /** Get the radius of the window on which textures will be computed */ - itkGetMacro(Radius,SizeType); + itkGetMacro(Radius, SizeType); /** Set the number of bin per axis for histogram generation */ - itkSetMacro(NumberOfBinsPerAxis,unsigned int); + itkSetMacro(NumberOfBinsPerAxis, unsigned int); /** Get the number of bin per axis for histogram generation */ - itkGetMacro(NumberOfBinsPerAxis,unsigned int); + itkGetMacro(NumberOfBinsPerAxis, unsigned int); /** Set the input image minimum */ - itkSetMacro(InputImageMinimum,InputPixelType); + itkSetMacro(InputImageMinimum, InputPixelType); /** Get the input image minimum */ - itkGetMacro(InputImageMinimum,InputPixelType); + itkGetMacro(InputImageMinimum, InputPixelType); /** Set the input image maximum */ - itkSetMacro(InputImageMaximum,InputPixelType); + itkSetMacro(InputImageMaximum, InputPixelType); /** Get the input image maximum */ - itkGetMacro(InputImageMaximum,InputPixelType); + itkGetMacro(InputImageMaximum, InputPixelType); protected: /** Constructor */ @@ -113,29 +113,29 @@ protected: /** Generate the input requested region */ virtual void GenerateInputRequestedRegion(); /** Parallel textures extraction */ - virtual void ThreadedGenerateData(const OutputRegionType & outputRegion, int threadId); + virtual void ThreadedGenerateData(const OutputRegionType& outputRegion, int threadId); private: ScalarImageToPanTexTextureFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented + void operator =(const Self&); //purposely not implemented /** Convenient method to compute union of 2 regions */ - static OutputRegionType RegionUnion(const OutputRegionType & region1, const OutputRegionType & region2); + static OutputRegionType RegionUnion(const OutputRegionType& region1, const OutputRegionType& region2); /** Radius of the window on which to compute textures */ - SizeType m_Radius; + SizeType m_Radius; /** List of Offsets for co-occurence */ - OffsetListType m_OffsetList; + OffsetListType m_OffsetList; /** Number of bins per axis for histogram generation */ - unsigned int m_NumberOfBinsPerAxis; + unsigned int m_NumberOfBinsPerAxis; /** Input image minimum */ - InputPixelType m_InputImageMinimum; + InputPixelType m_InputImageMinimum; /** Input image maximum */ - InputPixelType m_InputImageMaximum; + InputPixelType m_InputImageMaximum; }; } // End namespace otb diff --git a/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.txx b/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.txx index 7c1a5e411a..ae844a897d 100644 --- a/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.txx +++ b/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.txx @@ -25,16 +25,16 @@ namespace otb { -template <class TInputImage,class TOutputImage> -ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToPanTexTextureFilter<TInputImage, TOutputImage> ::ScalarImageToPanTexTextureFilter() : m_Radius(), - m_NumberOfBinsPerAxis(8), - m_InputImageMinimum(0), - m_InputImageMaximum(256) + m_NumberOfBinsPerAxis(8), + m_InputImageMinimum(0), + m_InputImageMaximum(256) { // There are 1 output corresponding to the Pan Tex texture indice this->SetNumberOfOutputs(1); - + //Fill the offset list for contrast computation OffsetType off; off[0] = 0; @@ -62,25 +62,24 @@ ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> m_OffsetList.push_back(off); //(2,1) } -template <class TInputImage,class TOutputImage> -ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToPanTexTextureFilter<TInputImage, TOutputImage> ::~ScalarImageToPanTexTextureFilter() {} - -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> +ScalarImageToPanTexTextureFilter<TInputImage, TOutputImage> ::GenerateInputRequestedRegion() { // First, call superclass implementation Superclass::GenerateInputRequestedRegion(); // Retrieve the input and output pointers - InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); + InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); OutputImagePointerType outputPtr = this->GetOutput(); - if(!inputPtr || !outputPtr) + if (!inputPtr || !outputPtr) { return; } @@ -92,22 +91,22 @@ ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> // Build the input requested region InputRegionType inputRequestedRegion = outputRequestedRegion; - + // Apply the radius - SizeType maxOffsetSize; + SizeType maxOffsetSize; maxOffsetSize[0] = 2; maxOffsetSize[1] = 2; inputRequestedRegion.PadByRadius(m_Radius + maxOffsetSize); // Try to apply the requested region to the input image - if(inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) + if (inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) { inputPtr->SetRequestedRegion(inputRequestedRegion); } else { // Build an exception - itk::InvalidRequestedRegionError e(__FILE__,__LINE__); + itk::InvalidRequestedRegionError e(__FILE__, __LINE__); e.SetLocation(ITK_LOCATION); e.SetDescription("Requested region is (at least partially) outside the largest possible region."); e.SetDataObject(inputPtr); @@ -115,35 +114,35 @@ ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> } } -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> -::ThreadedGenerateData(const OutputRegionType & outputRegionForThread, int threadId) +ScalarImageToPanTexTextureFilter<TInputImage, TOutputImage> +::ThreadedGenerateData(const OutputRegionType& outputRegionForThread, int threadId) { // Retrieve the input and output pointers InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); OutputImagePointerType outputPtr = this->GetOutput(); - - itk::ImageRegionIteratorWithIndex<OutputImageType> outputIt(outputPtr,outputRegionForThread); - + + itk::ImageRegionIteratorWithIndex<OutputImageType> outputIt(outputPtr, outputRegionForThread); + // Go to begin outputIt.GoToBegin(); // Set-up progress reporting - itk::ProgressReporter progress(this,threadId,outputRegionForThread.GetNumberOfPixels()); + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); // Iterate on outputs to compute textures - while(!outputIt.IsAtEnd()) + while (!outputIt.IsAtEnd()) { // Find the input region on which texture will be computed - InputRegionType currentRegion; - typename InputRegionType::IndexType currentIndex = outputIt.GetIndex()-m_Radius; + InputRegionType currentRegion; + typename InputRegionType::IndexType currentIndex = outputIt.GetIndex() - m_Radius; typename InputRegionType::SizeType currentSize; - for(unsigned int dim = 0; dim<InputImageType::ImageDimension;++dim) + for (unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { // Compute current size before applying offset - currentSize[dim] = 2*m_Radius[dim]+1; + currentSize[dim] = 2 * m_Radius[dim] + 1; } // Fill current region @@ -162,17 +161,17 @@ ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> coOccurenceMatrixGenerator->SetInput(inputPtr); coOccurenceMatrixGenerator->SetOffset((*offIt)); coOccurenceMatrixGenerator->SetNumberOfBinsPerAxis(m_NumberOfBinsPerAxis); - coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum,m_InputImageMaximum); - + coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum, m_InputImageMaximum); + // Compute the co-occurence matrix coOccurenceMatrixGenerator->SetRegion(currentRegion); coOccurenceMatrixGenerator->SetNormalize(true); coOccurenceMatrixGenerator->Compute(); - + typename HistogramType::Pointer histo = coOccurenceMatrixGenerator->GetOutput(); - + double inertia = 0; - for (HistogramIterator hit = histo->Begin();hit != histo->End(); ++hit) + for (HistogramIterator hit = histo->Begin(); hit != histo->End(); ++hit) { MeasurementType frequency = hit.GetFrequency(); if (frequency == 0) @@ -182,13 +181,13 @@ ScalarImageToPanTexTextureFilter<TInputImage,TOutputImage> typename InputRegionType::IndexType index = histo->GetIndex(hit.GetInstanceIdentifier()); inertia += (index[0] - index[1]) * (index[0] - index[1]) * frequency; } - + if (inertia < out) out = inertia; } - - outputIt.Set(out); - ++outputIt; - progress.CompletedPixel(); + + outputIt.Set(out); + ++outputIt; + progress.CompletedPixel(); } } diff --git a/Code/FeatureExtraction/otbScalarImageToTexturesFilter.h b/Code/FeatureExtraction/otbScalarImageToTexturesFilter.h index 34b692c4fd..88ad15ef5d 100644 --- a/Code/FeatureExtraction/otbScalarImageToTexturesFilter.h +++ b/Code/FeatureExtraction/otbScalarImageToTexturesFilter.h @@ -73,65 +73,65 @@ class ScalarImageToTexturesFilter : public itk::ImageToImageFilter { public: /** Standard class typedefs */ - typedef ScalarImageToTexturesFilter Self; - typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef ScalarImageToTexturesFilter Self; + typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Creation through the object factory */ itkNewMacro(Self); /** RTTI */ - itkTypeMacro(ScalarImageToTexturesFilter,ImageToImageFilter); + itkTypeMacro(ScalarImageToTexturesFilter, ImageToImageFilter); /** Template class typedefs */ - typedef TInpuImage InputImageType; - typedef typename InputImageType::Pointer InputImagePointerType; - typedef typename InputImageType::PixelType InputPixelType; - typedef typename InputImageType::RegionType InputRegionType; - typedef typename InputRegionType::SizeType SizeType; - typedef TOutputImage OutputImageType; - typedef typename OutputImageType::Pointer OutputImagePointerType; - typedef typename OutputImageType::RegionType OutputRegionType; + typedef TInpuImage InputImageType; + typedef typename InputImageType::Pointer InputImagePointerType; + typedef typename InputImageType::PixelType InputPixelType; + typedef typename InputImageType::RegionType InputRegionType; + typedef typename InputRegionType::SizeType SizeType; + typedef TOutputImage OutputImageType; + typedef typename OutputImageType::Pointer OutputImagePointerType; + typedef typename OutputImageType::RegionType OutputRegionType; /** Co-occurence matrix and textures calculator */ typedef otb::MaskedScalarImageToGreyLevelCooccurrenceMatrixGenerator - <InputImageType> CoocurrenceMatrixGeneratorType; + <InputImageType> CoocurrenceMatrixGeneratorType; typedef typename CoocurrenceMatrixGeneratorType::Pointer CoocurrenceMatrixGeneratorPointerType; typedef typename CoocurrenceMatrixGeneratorType::OffsetType OffsetType; typedef typename CoocurrenceMatrixGeneratorType::HistogramType HistogramType; typedef itk::Statistics::GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator <HistogramType> TextureCoefficientsCalculatorType; - typedef typename TextureCoefficientsCalculatorType::Pointer TextureCoefficientsCalculatorPointerType; + typedef typename TextureCoefficientsCalculatorType::Pointer TextureCoefficientsCalculatorPointerType; /** Set the radius of the window on which textures will be computed */ - itkSetMacro(Radius,SizeType); + itkSetMacro(Radius, SizeType); /** Get the radius of the window on which textures will be computed */ - itkGetMacro(Radius,SizeType); + itkGetMacro(Radius, SizeType); /** Set the offset for co-occurence computation */ - itkSetMacro(Offset,OffsetType); + itkSetMacro(Offset, OffsetType); /** Get the offset for co-occurence computation */ - itkGetMacro(Offset,OffsetType); + itkGetMacro(Offset, OffsetType); /** Set the number of bin per axis for histogram generation */ - itkSetMacro(NumberOfBinsPerAxis,unsigned int); + itkSetMacro(NumberOfBinsPerAxis, unsigned int); /** Get the number of bin per axis for histogram generation */ - itkGetMacro(NumberOfBinsPerAxis,unsigned int); + itkGetMacro(NumberOfBinsPerAxis, unsigned int); /** Set the input image minimum */ - itkSetMacro(InputImageMinimum,InputPixelType); + itkSetMacro(InputImageMinimum, InputPixelType); /** Get the input image minimum */ - itkGetMacro(InputImageMinimum,InputPixelType); + itkGetMacro(InputImageMinimum, InputPixelType); /** Set the input image maximum */ - itkSetMacro(InputImageMaximum,InputPixelType); + itkSetMacro(InputImageMaximum, InputPixelType); /** Get the input image maximum */ - itkGetMacro(InputImageMaximum,InputPixelType); + itkGetMacro(InputImageMaximum, InputPixelType); /** Get the energy output image */ OutputImageType * GetEnergyOutput(); @@ -165,29 +165,29 @@ protected: /** Generate the input requested region */ virtual void GenerateInputRequestedRegion(); /** Parallel textures extraction */ - virtual void ThreadedGenerateData(const OutputRegionType & outputRegion, int threadId); + virtual void ThreadedGenerateData(const OutputRegionType& outputRegion, int threadId); private: ScalarImageToTexturesFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented + void operator =(const Self&); //purposely not implemented /** Convenient method to compute union of 2 regions */ - static OutputRegionType RegionUnion(const OutputRegionType & region1, const OutputRegionType & region2); + static OutputRegionType RegionUnion(const OutputRegionType& region1, const OutputRegionType& region2); /** Radius of the window on which to compute textures */ - SizeType m_Radius; + SizeType m_Radius; /** Offset for co-occurence */ - OffsetType m_Offset; + OffsetType m_Offset; /** Number of bins per axis for histogram generation */ - unsigned int m_NumberOfBinsPerAxis; + unsigned int m_NumberOfBinsPerAxis; /** Input image minimum */ - InputPixelType m_InputImageMinimum; + InputPixelType m_InputImageMinimum; /** Input image maximum */ - InputPixelType m_InputImageMaximum; + InputPixelType m_InputImageMaximum; }; } // End namespace otb diff --git a/Code/FeatureExtraction/otbScalarImageToTexturesFilter.txx b/Code/FeatureExtraction/otbScalarImageToTexturesFilter.txx index 7172d68901..f07af29769 100644 --- a/Code/FeatureExtraction/otbScalarImageToTexturesFilter.txx +++ b/Code/FeatureExtraction/otbScalarImageToTexturesFilter.txx @@ -25,150 +25,150 @@ namespace otb { -template <class TInputImage,class TOutputImage> -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::ScalarImageToTexturesFilter() : m_Radius(), - m_Offset(), - m_NumberOfBinsPerAxis(8), - m_InputImageMinimum(0), - m_InputImageMaximum(256) + m_Offset(), + m_NumberOfBinsPerAxis(8), + m_InputImageMinimum(0), + m_InputImageMaximum(256) { // There are 8 outputs corresponding to the 8 textures indices this->SetNumberOfOutputs(8); // Create the 8 outputs - this->SetNthOutput(0,OutputImageType::New()); - this->SetNthOutput(1,OutputImageType::New()); - this->SetNthOutput(2,OutputImageType::New()); - this->SetNthOutput(3,OutputImageType::New()); - this->SetNthOutput(4,OutputImageType::New()); - this->SetNthOutput(5,OutputImageType::New()); - this->SetNthOutput(6,OutputImageType::New()); - this->SetNthOutput(7,OutputImageType::New()); + this->SetNthOutput(0, OutputImageType::New()); + this->SetNthOutput(1, OutputImageType::New()); + this->SetNthOutput(2, OutputImageType::New()); + this->SetNthOutput(3, OutputImageType::New()); + this->SetNthOutput(4, OutputImageType::New()); + this->SetNthOutput(5, OutputImageType::New()); + this->SetNthOutput(6, OutputImageType::New()); + this->SetNthOutput(7, OutputImageType::New()); } -template <class TInputImage,class TOutputImage> -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::~ScalarImageToTexturesFilter() {} -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetEnergyOutput() { - if(this->GetNumberOfOutputs()<1) + if (this->GetNumberOfOutputs() < 1) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(0)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetEntropyOutput() { - if(this->GetNumberOfOutputs()<2) + if (this->GetNumberOfOutputs() < 2) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(1)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetCorrelationOutput() { - if(this->GetNumberOfOutputs()<3) + if (this->GetNumberOfOutputs() < 3) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(2)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetInverseDifferenceMomentOutput() { - if(this->GetNumberOfOutputs()<4) + if (this->GetNumberOfOutputs() < 4) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(3)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetInertiaOutput() { - if(this->GetNumberOfOutputs()<5) + if (this->GetNumberOfOutputs() < 5) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(4)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetClusterShadeOutput() { - if(this->GetNumberOfOutputs()<6) + if (this->GetNumberOfOutputs() < 6) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(5)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetClusterProminenceOutput() { - if(this->GetNumberOfOutputs()<7) + if (this->GetNumberOfOutputs() < 7) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(6)); } -template <class TInputImage,class TOutputImage> -typename ScalarImageToTexturesFilter<TInputImage,TOutputImage> +template <class TInputImage, class TOutputImage> +typename ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::OutputImageType * -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GetHaralickCorrelationOutput() { - if(this->GetNumberOfOutputs()<8) + if (this->GetNumberOfOutputs() < 8) { return 0; } return static_cast<OutputImageType *>(this->GetOutput(7)); } -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToTexturesFilter<TInputImage,TOutputImage> +ScalarImageToTexturesFilter<TInputImage, TOutputImage> ::GenerateInputRequestedRegion() { // First, call superclass implementation Superclass::GenerateInputRequestedRegion(); // Retrieve the input and output pointers - InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); + InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); OutputImagePointerType outputPtr = this->GetOutput(); - if(!inputPtr || !outputPtr) + if (!inputPtr || !outputPtr) { return; } @@ -179,15 +179,17 @@ ScalarImageToTexturesFilter<TInputImage,TOutputImage> OutputRegionType outputRequestedRegion = outputPtr->GetRequestedRegion(); typename OutputRegionType::IndexType outputIndex = outputRequestedRegion.GetIndex(); - typename OutputRegionType::SizeType outputSize = outputRequestedRegion.GetSize(); - typename InputRegionType::IndexType inputIndex; - typename InputRegionType::SizeType inputSize; + typename OutputRegionType::SizeType outputSize = outputRequestedRegion.GetSize(); + typename InputRegionType::IndexType inputIndex; + typename InputRegionType::SizeType inputSize; // First, apply offset - for(unsigned int dim = 0; dim<InputImageType::ImageDimension;++dim) + for (unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { - inputIndex[dim]=std::min(outputIndex[dim],outputIndex[dim]+m_Offset[dim]); - inputSize[dim] =std::max(outputIndex[dim]+outputSize[dim],outputIndex[dim]+outputSize[dim]+m_Offset[dim])-inputIndex[dim]; + inputIndex[dim] = std::min(outputIndex[dim], outputIndex[dim] + m_Offset[dim]); + inputSize[dim] = + std::max(outputIndex[dim] + outputSize[dim], outputIndex[dim] + outputSize[dim] + + m_Offset[dim]) - inputIndex[dim]; } // Build the input requested region @@ -199,14 +201,14 @@ ScalarImageToTexturesFilter<TInputImage,TOutputImage> inputRequestedRegion.PadByRadius(m_Radius); // Try to apply the requested region to the input image - if(inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) + if (inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) { inputPtr->SetRequestedRegion(inputRequestedRegion); } else { // Build an exception - itk::InvalidRequestedRegionError e(__FILE__,__LINE__); + itk::InvalidRequestedRegionError e(__FILE__, __LINE__); e.SetLocation(ITK_LOCATION); e.SetDescription("Requested region is (at least partially) outside the largest possible region."); e.SetDataObject(inputPtr); @@ -214,10 +216,10 @@ ScalarImageToTexturesFilter<TInputImage,TOutputImage> } } -template <class TInputImage,class TOutputImage> +template <class TInputImage, class TOutputImage> void -ScalarImageToTexturesFilter<TInputImage,TOutputImage> -::ThreadedGenerateData(const OutputRegionType & outputRegionForThread, int threadId) +ScalarImageToTexturesFilter<TInputImage, TOutputImage> +::ThreadedGenerateData(const OutputRegionType& outputRegionForThread, int threadId) { // Retrieve the input and output pointers InputImagePointerType inputPtr = const_cast<InputImageType *>(this->GetInput()); @@ -231,14 +233,14 @@ ScalarImageToTexturesFilter<TInputImage,TOutputImage> OutputImagePointerType haralickCorPtr = this->GetHaralickCorrelationOutput(); // Build output iterators - itk::ImageRegionIteratorWithIndex<OutputImageType> energyIt(energyPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> entropyIt(entropyPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> correlationIt(correlationPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> invDiffMomentIt(invDiffMomentPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> inertiaIt(inertiaPtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> clusterShadeIt(clusterShadePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> clusterProminenceIt(clusterProminencePtr,outputRegionForThread); - itk::ImageRegionIterator<OutputImageType> haralickCorIt(haralickCorPtr,outputRegionForThread); + itk::ImageRegionIteratorWithIndex<OutputImageType> energyIt(energyPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> entropyIt(entropyPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> correlationIt(correlationPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> invDiffMomentIt(invDiffMomentPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> inertiaIt(inertiaPtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> clusterShadeIt(clusterShadePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> clusterProminenceIt(clusterProminencePtr, outputRegionForThread); + itk::ImageRegionIterator<OutputImageType> haralickCorIt(haralickCorPtr, outputRegionForThread); // Go to begin energyIt.GoToBegin(); @@ -250,39 +252,37 @@ ScalarImageToTexturesFilter<TInputImage,TOutputImage> clusterProminenceIt.GoToBegin(); haralickCorIt.GoToBegin(); - - // Build the co-occurence matrix generator CoocurrenceMatrixGeneratorPointerType coOccurenceMatrixGenerator = CoocurrenceMatrixGeneratorType::New(); coOccurenceMatrixGenerator->SetInput(inputPtr); coOccurenceMatrixGenerator->SetOffset(m_Offset); coOccurenceMatrixGenerator->SetNumberOfBinsPerAxis(m_NumberOfBinsPerAxis); - coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum,m_InputImageMaximum); + coOccurenceMatrixGenerator->SetPixelValueMinMax(m_InputImageMinimum, m_InputImageMaximum); // Build the texture calculator TextureCoefficientsCalculatorPointerType texturesCalculator = TextureCoefficientsCalculatorType::New(); // Set-up progress reporting - itk::ProgressReporter progress(this,threadId,outputRegionForThread.GetNumberOfPixels()); + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); // Iterate on outputs to compute textures - while(!energyIt.IsAtEnd() - &&!entropyIt.IsAtEnd() - &&!correlationIt.IsAtEnd() - &&!invDiffMomentIt.IsAtEnd() - &&!inertiaIt.IsAtEnd() - &&!clusterShadeIt.IsAtEnd() - &&!clusterProminenceIt.IsAtEnd() - &&!haralickCorIt.IsAtEnd()) + while (!energyIt.IsAtEnd() + && !entropyIt.IsAtEnd() + && !correlationIt.IsAtEnd() + && !invDiffMomentIt.IsAtEnd() + && !inertiaIt.IsAtEnd() + && !clusterShadeIt.IsAtEnd() + && !clusterProminenceIt.IsAtEnd() + && !haralickCorIt.IsAtEnd()) { // Compute the region on which co-occurence will be estimated - typename InputRegionType::IndexType inputIndex = energyIt.GetIndex()-m_Radius; - typename InputRegionType::SizeType inputSize; + typename InputRegionType::IndexType inputIndex = energyIt.GetIndex() - m_Radius; + typename InputRegionType::SizeType inputSize; // First, apply offset - for(unsigned int dim = 0; dim<InputImageType::ImageDimension;++dim) + for (unsigned int dim = 0; dim < InputImageType::ImageDimension; ++dim) { - inputSize[dim] =2*m_Radius[dim]+1; + inputSize[dim] = 2 * m_Radius[dim] + 1; } // Build the input region diff --git a/Code/FeatureExtraction/otbSimplifyPathListFilter.h b/Code/FeatureExtraction/otbSimplifyPathListFilter.h index 58597aa578..279791de7d 100644 --- a/Code/FeatureExtraction/otbSimplifyPathListFilter.h +++ b/Code/FeatureExtraction/otbSimplifyPathListFilter.h @@ -62,9 +62,9 @@ namespace otb template <class TPath> class ITK_EXPORT SimplifyPathListFilter : public UnaryFunctorObjectListFilter< - ObjectList<TPath>, - ObjectList<TPath>, - SimplifyPathFunctor<TPath, TPath> > + ObjectList<TPath>, + ObjectList<TPath>, + SimplifyPathFunctor<TPath, TPath> > {}; } // End namespace otb diff --git a/Code/FeatureExtraction/otbTextureFunctorBase.h b/Code/FeatureExtraction/otbTextureFunctorBase.h index b0e5d31b43..3bdb78ad0c 100644 --- a/Code/FeatureExtraction/otbTextureFunctorBase.h +++ b/Code/FeatureExtraction/otbTextureFunctorBase.h @@ -280,13 +280,15 @@ public: int histoIdY = 0; IntVectorType histoTemp; - if (m_NeighBinLength != 0) histoTemp = + if (m_NeighBinLength != 0) + histoTemp = IntVectorType(static_cast<unsigned int>(vcl_floor(static_cast<double>(this->GetMaxi() - this->GetMini()) / m_NeighBinLength) + 1.), 0); else histoTemp = IntVectorType(1, 0); - if (m_OffsetBinLength != 0) m_Histo = + if (m_OffsetBinLength != 0) + m_Histo = IntVectorVectorType(static_cast<unsigned int>(vcl_floor(static_cast<double>(this->GetMaxiOff() - this->GetMiniOff()) / m_OffsetBinLength) + 1.), histoTemp); @@ -304,10 +306,12 @@ public: offset[1] = k; histoIdX = 0; histoIdY = 0; - if (m_OffsetBinLength != 0) histoIdX = + if (m_OffsetBinLength != 0) + histoIdX = static_cast<int>(vcl_floor((static_cast<double>(neighOff[offsetOff]) - this->GetMiniOff()) / static_cast<double>(m_OffsetBinLength))); - if (m_NeighBinLength != 0) histoIdY = + if (m_NeighBinLength != 0) + histoIdY = static_cast<int>(vcl_floor((static_cast<double>(neigh[offset]) - this->GetMini()) / static_cast<double>(m_NeighBinLength))); diff --git a/Code/FeatureExtraction/otbTextureImageFunction.h b/Code/FeatureExtraction/otbTextureImageFunction.h index 5b135dda67..8eee1733dc 100644 --- a/Code/FeatureExtraction/otbTextureImageFunction.h +++ b/Code/FeatureExtraction/otbTextureImageFunction.h @@ -39,13 +39,13 @@ namespace otb template <class TInputImage, class TFunctor, class TCoordRep = float> class ITK_EXPORT TextureImageFunction : public itk::ImageFunction<TInputImage, ITK_TYPENAME itk::NumericTraits<typename TInputImage::PixelType>::RealType, - TCoordRep> + TCoordRep> { public: /** Standard class typedefs. */ typedef TextureImageFunction Self; typedef itk::ImageFunction<TInputImage, ITK_TYPENAME itk::NumericTraits<typename TInputImage::PixelType>::RealType, - TCoordRep> Superclass; + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/FeatureExtraction/otbThresholdImageToPointSetFilter.h b/Code/FeatureExtraction/otbThresholdImageToPointSetFilter.h index 076b61be8e..acd3063b90 100644 --- a/Code/FeatureExtraction/otbThresholdImageToPointSetFilter.h +++ b/Code/FeatureExtraction/otbThresholdImageToPointSetFilter.h @@ -30,7 +30,7 @@ namespace otb */ template <class TInputImage, - class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType, 2> > + class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType, 2> > class ITK_EXPORT ThresholdImageToPointSetFilter : public ImageToPointSetFilter<TInputImage, TOutputPointSet> { diff --git a/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.h b/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.h index 2d1398b3e3..dd8f1184a0 100644 --- a/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.h +++ b/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.h @@ -57,7 +57,7 @@ namespace otb template <class TInputImage, class TOutputImage, class TOutputImageDirection = TOutputImage> class ITK_EXPORT TouziEdgeDetectorImageFilter : public ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, - TOutputImageDirection> + TOutputImageDirection> { public: /** Extract input and output images sizes. */ diff --git a/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.txx b/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.txx index baba885600..cef91cafbf 100644 --- a/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.txx +++ b/Code/FeatureExtraction/otbTouziEdgeDetectorImageFilter.txx @@ -45,7 +45,7 @@ TouziEdgeDetectorImageFilter<TInputImage, TOutputImage, TOutputImageDirection>:: template <class TInputImage, class TOutputImage, class TOutputImageDirection> void TouziEdgeDetectorImageFilter<TInputImage, TOutputImage, - TOutputImageDirection>::GenerateInputRequestedRegion() throw ( + TOutputImageDirection>::GenerateInputRequestedRegion() throw ( itk::InvalidRequestedRegionError) { // call the superclass' implementation of this method diff --git a/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.h b/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.h index c7706a0512..f0599f82db 100644 --- a/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.h +++ b/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.h @@ -152,9 +152,9 @@ protected: * \brief where the white areas represents the urban areas. */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::RadiometricNonWaterNonVegetationIndexFunctor< - typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::RadiometricNonWaterNonVegetationIndexFunctor< + typename TInputImage::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT UrbanAreaDetectionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { @@ -183,18 +183,18 @@ public: /** Filters typedefs */ // NonVegetationNonWaterIndexFilter typedef Functor::RadiometricNonWaterNonVegetationDetectionFunctor<VectorImagePixelType, - OutputImagePixelType> FunctorType; + OutputImagePixelType> FunctorType; typedef MultiChannelRAndGAndNIRIndexImageFilter <VectorImageType, OutputImageType, - FunctorType> UrbanAreaExtractionFilterType; + FunctorType> UrbanAreaExtractionFilterType; typedef typename UrbanAreaExtractionFilterType::Pointer - UrbanAreaExtrationFilterPointerType; + UrbanAreaExtrationFilterPointerType; // Erode/Dilate Filters typedef typename itk::BinaryBallStructuringElement<OutputImagePixelType, - 2> StructuringElementType; + 2> StructuringElementType; typedef typename itk::BinaryErodeImageFilter<OutputImageType, OutputImageType, - StructuringElementType> ErodeFilterType; + StructuringElementType> ErodeFilterType; typedef typename itk::BinaryDilateImageFilter<OutputImageType, OutputImageType, - StructuringElementType> DilateFilterType; + StructuringElementType> DilateFilterType; // MaskImageFilter typedef typename itk::MaskImageFilter<VectorImageType, OutputImageType> MaskImageFilterType; typedef typename MaskImageFilterType::Pointer MaskImageFilterPointerType; @@ -203,12 +203,12 @@ public: typedef typename IntensityFilterType::Pointer IntensityFilterPointerType; // EdgeDensityFilter typedef BinaryImageDensityFunction<SingleImageType> - CountFunctionType; + CountFunctionType; typedef itk::SobelEdgeDetectionImageFilter<SingleImageType, SingleImageType> SobelType; typedef EdgeDetectorImageFilter<SingleImageType, SingleImageType, - SobelType> SobelDetectorType; + SobelType> SobelDetectorType; typedef EdgeDensityImageFilter<SingleImageType, SingleImageType, SobelDetectorType, - CountFunctionType> EdgeDensityFilterType; + CountFunctionType> EdgeDensityFilterType; typedef typename EdgeDensityFilterType::Pointer EdgeDensityFilterPointerType; // Threshold diff --git a/Code/FeatureExtraction/otbVectorizationPathListFilter.txx b/Code/FeatureExtraction/otbVectorizationPathListFilter.txx index 50221ed286..5114ddee50 100644 --- a/Code/FeatureExtraction/otbVectorizationPathListFilter.txx +++ b/Code/FeatureExtraction/otbVectorizationPathListFilter.txx @@ -289,230 +289,230 @@ VectorizationPathListFilter<TInputModulus, TInputDirection, TOutputPath> OffsetType tmpOffset; switch (neighborhoodNumber) { - case 0: - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - tmpOffset[0] = 2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - - break; - - case 1: - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - tmpOffset[0] = 2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - break; - - case 2: - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - - tmpOffset[0] = 0; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - break; - - case 3: - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - tmpOffset[0] = -2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - break; - - case 4: - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - tmpOffset[0] = -2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = -2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - break; - - case 5: - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - tmpOffset[0] = -2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - break; - - case 6: - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - - tmpOffset[0] = 0; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - break; - - case 7: - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - tmpOffset[0] = 2; - tmpOffset[1] = -2; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 2; - tmpOffset[1] = 2; - offset.push_back(tmpOffset); - break; + case 0: + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + tmpOffset[0] = 2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + + break; + + case 1: + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + tmpOffset[0] = 2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + break; + + case 2: + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + + tmpOffset[0] = 0; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + break; + + case 3: + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + tmpOffset[0] = -2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + break; + + case 4: + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + tmpOffset[0] = -2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = -2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + break; + + case 5: + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + tmpOffset[0] = -2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + break; + + case 6: + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + + tmpOffset[0] = 0; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + break; + + case 7: + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + tmpOffset[0] = 2; + tmpOffset[1] = -2; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 2; + tmpOffset[1] = 2; + offset.push_back(tmpOffset); + break; } return offset; } @@ -552,109 +552,109 @@ VectorizationPathListFilter<TInputModulus, TInputDirection, TOutputPath> // otbMsgDevMacro(<<"Direction: " << neighborhoodNumber) switch (neighborhoodNumber) { - case 0: - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - break; - - case 1: - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - break; - - case 2: - tmpOffset[0] = 0; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - - break; - - case 3: - tmpOffset[0] = -1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - break; - - case 4: - tmpOffset[0] = -1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - break; - - case 5: - tmpOffset[0] = -1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - - break; - - case 6: - tmpOffset[0] = 0; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - - break; - - case 7: - tmpOffset[0] = 1; - tmpOffset[1] = -1; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 0; - offset.push_back(tmpOffset); - tmpOffset[0] = 1; - tmpOffset[1] = 1; - offset.push_back(tmpOffset); - - break; + case 0: + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + break; + + case 1: + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + break; + + case 2: + tmpOffset[0] = 0; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + + break; + + case 3: + tmpOffset[0] = -1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + break; + + case 4: + tmpOffset[0] = -1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + break; + + case 5: + tmpOffset[0] = -1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + + break; + + case 6: + tmpOffset[0] = 0; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + + break; + + case 7: + tmpOffset[0] = 1; + tmpOffset[1] = -1; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 0; + offset.push_back(tmpOffset); + tmpOffset[0] = 1; + tmpOffset[1] = 1; + offset.push_back(tmpOffset); + + break; } return offset; } diff --git a/Code/Fusion/otbBayesianFusionFilter.h b/Code/Fusion/otbBayesianFusionFilter.h index d23b623b7e..bbc57acc6b 100644 --- a/Code/Fusion/otbBayesianFusionFilter.h +++ b/Code/Fusion/otbBayesianFusionFilter.h @@ -42,9 +42,9 @@ namespace Functor * */ template <class TInputMultiSpectral, - class TInputMultiSpectralInterp, - class TInputPanchro, - class TOutput> + class TInputMultiSpectralInterp, + class TInputPanchro, + class TOutput> class BayesianFunctor { public: @@ -189,18 +189,18 @@ private: */ template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> class ITK_EXPORT BayesianFusionFilter : public FusionImageBase<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage, - Functor::BayesianFunctor<ITK_TYPENAME TInputMultiSpectralImage::PixelType, - ITK_TYPENAME TInputMultiSpectralInterpImage::PixelType, - ITK_TYPENAME TInputPanchroImage::PixelType, - ITK_TYPENAME TOutputImage::PixelType> > + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage, + Functor::BayesianFunctor<ITK_TYPENAME TInputMultiSpectralImage::PixelType, + ITK_TYPENAME TInputMultiSpectralInterpImage::PixelType, + ITK_TYPENAME TInputPanchroImage::PixelType, + ITK_TYPENAME TOutputImage::PixelType> > { public: /** Extract input and output images dimensions.*/ @@ -216,13 +216,13 @@ public: /** "typedef" for standard classes. */ typedef BayesianFusionFilter Self; typedef FusionImageBase<InputMultiSpectralImageType, - InputMultiSpectralInterpImageType, - InputPanchroImageType, - OutputImageType, - Functor::BayesianFunctor<ITK_TYPENAME InputMultiSpectralImageType::PixelType, - ITK_TYPENAME InputMultiSpectralInterpImageType::PixelType, - ITK_TYPENAME InputPanchroImageType::PixelType, - ITK_TYPENAME OutputImageType::PixelType> > Superclass; + InputMultiSpectralInterpImageType, + InputPanchroImageType, + OutputImageType, + Functor::BayesianFunctor<ITK_TYPENAME InputMultiSpectralImageType::PixelType, + ITK_TYPENAME InputMultiSpectralInterpImageType::PixelType, + ITK_TYPENAME InputPanchroImageType::PixelType, + ITK_TYPENAME OutputImageType::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -258,13 +258,13 @@ public: /** Typedef for statistic computing. */ typedef StreamingStatisticsVectorImageFilter<InputMultiSpectralInterpImageType> - StreamingStatisticsVectorImageFilterType; + StreamingStatisticsVectorImageFilterType; typedef typename StreamingStatisticsVectorImageFilterType::MatrixType - MatrixType; + MatrixType; typedef StreamingMatrixTransposeMatrixImageFilter<InputMultiSpectralImageType, - InputMultiSpectralImageType> MSTransposeMSType; + InputMultiSpectralImageType> MSTransposeMSType; typedef ImageToVectorImageCastFilter<InputPanchroImageType, - InputMultiSpectralImageType> CasterType; + InputMultiSpectralImageType> CasterType; /** Set the ponderation value. */ itkSetMacro(Lambda, float); diff --git a/Code/Fusion/otbBayesianFusionFilter.txx b/Code/Fusion/otbBayesianFusionFilter.txx index 85d5d63757..994bdecda2 100644 --- a/Code/Fusion/otbBayesianFusionFilter.txx +++ b/Code/Fusion/otbBayesianFusionFilter.txx @@ -27,13 +27,13 @@ namespace otb { template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> BayesianFusionFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage> + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage> ::BayesianFusionFilter() { m_Lambda = 0.9999; @@ -42,26 +42,26 @@ BayesianFusionFilter<TInputMultiSpectralImage, } template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> BayesianFusionFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage> + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage> ::~BayesianFusionFilter() { } template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> void BayesianFusionFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage> + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage> ::Modified() { Superclass::Modified(); @@ -69,14 +69,14 @@ BayesianFusionFilter<TInputMultiSpectralImage, } template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> void BayesianFusionFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage> + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage> ::BeforeThreadedGenerateData() { if (!m_StatisticsHaveBeenGenerated) @@ -87,14 +87,14 @@ BayesianFusionFilter<TInputMultiSpectralImage, } template <class TInputMultiSpectralImage, - class TInputMultiSpectralInterpImage, - class TInputPanchroImage, - class TOutputImage> + class TInputMultiSpectralInterpImage, + class TInputPanchroImage, + class TOutputImage> void BayesianFusionFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, - TOutputImage> + TInputMultiSpectralInterpImage, + TInputPanchroImage, + TOutputImage> ::ComputeInternalStatistics() { OutputImageRegionType msiRequestedRegion = this->GetMultiSpectInterp()->GetRequestedRegion(); diff --git a/Code/Fusion/otbFusionImageBase.h b/Code/Fusion/otbFusionImageBase.h index 404c9346af..5c63808a27 100644 --- a/Code/Fusion/otbFusionImageBase.h +++ b/Code/Fusion/otbFusionImageBase.h @@ -28,10 +28,10 @@ namespace otb * \sa TernaryFunctorImageFilter */ template <class TInputMultiSpectralImage, class TInputMultiSpectralInterpImage, class TInputPanchroImage, - class TOutputImage, class TFunctor> + class TOutputImage, class TFunctor> class ITK_EXPORT FusionImageBase : public itk::TernaryFunctorImageFilter<TInputMultiSpectralImage, - TInputMultiSpectralInterpImage, - TInputPanchroImage, TOutputImage, TFunctor> + TInputMultiSpectralInterpImage, + TInputPanchroImage, TOutputImage, TFunctor> { public: /** Extract input and output images dimensions.*/ @@ -48,10 +48,10 @@ public: /** "typedef" for standard classes. */ typedef FusionImageBase Self; typedef itk::TernaryFunctorImageFilter<InputMultiSpectralImageType, - InputMultiSpectralInterpImageType, - InputPanchroImageType, - OutputImageType, - FunctorType> Superclass; + InputMultiSpectralInterpImageType, + InputPanchroImageType, + OutputImageType, + FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Fusion/otbSimpleRcsPanSharpeningFusionImageFilter.h b/Code/Fusion/otbSimpleRcsPanSharpeningFusionImageFilter.h index 0e96c03bfa..653638bc25 100644 --- a/Code/Fusion/otbSimpleRcsPanSharpeningFusionImageFilter.h +++ b/Code/Fusion/otbSimpleRcsPanSharpeningFusionImageFilter.h @@ -101,7 +101,7 @@ protected: <TPanImageType, InternalImageType> ConvolutionFilterType; typedef itk::DivideImageFilter <TXsImageType, InternalImageType, - InternalVectorImageType> DivideFilterType; + InternalVectorImageType> DivideFilterType; typedef itk::MultiplyImageFilter <InternalVectorImageType, TPanImageType, TOutputImageType> MultiplyFilterType; diff --git a/Code/GeospatialAnalysis/otbGISTableFunction.h b/Code/GeospatialAnalysis/otbGISTableFunction.h index 1f70c0aff1..f8094ce8b2 100644 --- a/Code/GeospatialAnalysis/otbGISTableFunction.h +++ b/Code/GeospatialAnalysis/otbGISTableFunction.h @@ -39,12 +39,12 @@ namespace otb * \ingroup GISTableFunctions */ template < - class TInputTable, - class TOutput - > + class TInputTable, + class TOutput + > class ITK_EXPORT GISTableFunction : public FunctionBase<TInputTable, - TOutput> + TOutput> { public: /** Dimension underlying input table. */ @@ -54,8 +54,8 @@ public: /** Standard class typedefs. */ typedef GISTableFunction Self; typedef FunctionBase< - TInputTable, - TOutput> Superclass; + TInputTable, + TOutput> Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; diff --git a/Code/GeospatialAnalysis/otbTransactorGISTableFunction.h b/Code/GeospatialAnalysis/otbTransactorGISTableFunction.h index 237d35a797..7a4bbd4dd6 100644 --- a/Code/GeospatialAnalysis/otbTransactorGISTableFunction.h +++ b/Code/GeospatialAnalysis/otbTransactorGISTableFunction.h @@ -35,12 +35,12 @@ namespace otb * \ingroup TransactorGISTableFunctions */ template < - class TInputTable, - class TOutput, class TTransactor - > + class TInputTable, + class TOutput, class TTransactor + > class ITK_EXPORT TransactorGISTableFunction : public GISTableFunction<TInputTable, - TOutput> + TOutput> { public: /** Dimension underlying input table. */ diff --git a/Code/IO/otbCoordinateToName.cxx b/Code/IO/otbCoordinateToName.cxx index c6f740c601..cee9af9197 100644 --- a/Code/IO/otbCoordinateToName.cxx +++ b/Code/IO/otbCoordinateToName.cxx @@ -128,7 +128,7 @@ void CoordinateToName::ParseXMLGeonames(std::string& placeName, std::string& cou placeName = childName->GetText(); } TiXmlElement* childCountryName = docHandle.FirstChild("geonames").FirstChild("geoname"). - FirstChild("countryName").Element(); + FirstChild("countryName").Element(); if (childCountryName) { countryName = childCountryName->GetText(); diff --git a/Code/IO/otbCurlHelper.cxx b/Code/IO/otbCurlHelper.cxx old mode 100755 new mode 100644 index ef7d1ecd19..4647499ed9 --- a/Code/IO/otbCurlHelper.cxx +++ b/Code/IO/otbCurlHelper.cxx @@ -68,9 +68,9 @@ int CurlHelper::RetrieveFile(const std::string& urlString, std::string filename) CURLcode res = CURL_LAST; FILE* output_file = fopen(filename.c_str(), "wb"); - + curl = curl_easy_init(); - + char url[256]; strcpy(url, urlString.c_str()); @@ -80,19 +80,19 @@ int CurlHelper::RetrieveFile(const std::string& urlString, std::string filename) // Set 5s timeout curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); - - // Use our writing static function to avoid file descriptor + + // Use our writing static function to avoid file descriptor // pointer crash on windows curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &Self::write_data); // Say the file where to write the received data - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)output_file); - + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) output_file); + res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); - + fclose(output_file); } otbMsgDevMacro(<< " -> " << res); @@ -103,8 +103,7 @@ int CurlHelper::RetrieveFile(const std::string& urlString, std::string filename) #endif } - -int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, +int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, const std::vector<std::string>& listFilename, int maxConnect) const { @@ -115,16 +114,16 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, CURLM * multiHandle; std::vector<CURL *> listCurlHandles; std::vector<FILE *> listFiles; - + std::vector<std::string>::const_iterator filename; filename = listFilename.begin(); - while (filename != listFilename.end() ) + while (filename != listFilename.end()) { FILE* lOutputFile = fopen((*filename).c_str(), "wb"); if (lOutputFile == NULL) - { - itkExceptionMacro(<< "otbCurlHelper: bad file name: " << (*filename).c_str()); - } + { + itkExceptionMacro(<< "otbCurlHelper: bad file name: " << (*filename).c_str()); + } // Add file to vector listFiles.push_back(lOutputFile); @@ -144,10 +143,10 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, // Initialize curl handle std::vector<std::string>::const_iterator url; - std::vector<FILE *>::const_iterator file; + std::vector<FILE *>::const_iterator file; url = listURLs.begin(); file = listFiles.begin(); - while ( (url != listURLs.end()) && (file != listFiles.end() )) + while ((url != listURLs.end()) && (file != listFiles.end())) { otbMsgDevMacro(<< "Retrieving: " << (*url).data()); CURL * lEasyHandle; @@ -162,7 +161,7 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, curl_easy_setopt(lEasyHandle, CURLOPT_USERAGENT, m_Browser.data()); curl_easy_setopt(lEasyHandle, CURLOPT_URL, (*url).data()); curl_easy_setopt(lEasyHandle, CURLOPT_WRITEFUNCTION, &Self::write_data); - curl_easy_setopt(lEasyHandle, CURLOPT_WRITEDATA, (void*)(*file)); + curl_easy_setopt(lEasyHandle, CURLOPT_WRITEDATA, (void*) (*file)); // Add easy handle to multi handle curl_multi_add_handle(multiHandle, lEasyHandle); @@ -181,7 +180,8 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, // Perform int lStillRunning; - while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multiHandle, &lStillRunning)); + while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multiHandle, &lStillRunning)) + ; // Now get that URL while (lStillRunning) @@ -209,18 +209,18 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, switch (rc) { - case -1: - /* select error */ - break; - case 0: - /* timeout */ - default: - /* timeout or readable/writable sockets */ - while ( - CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multiHandle, &lStillRunning) - ) - ; - break; + case -1: + /* select error */ + break; + case 0: + /* timeout */ + default: + /* timeout or readable/writable sockets */ + while ( + CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multiHandle, &lStillRunning) + ) + ; + break; } } @@ -241,7 +241,6 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, itkExceptionMacro(<< "otbCurlHelper: Error occurs while perform Multi handle"); } - // Cleanup // Close files @@ -269,10 +268,10 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs, file = listFilename.begin(); int res = 0; int resTmp = -1; - while ( (url != listURLs.end()) && (file != listFilename.end() )) + while ((url != listURLs.end()) && (file != listFilename.end())) { resTmp = RetrieveFile(*url, *file); - if (res == 0) res = resTmp; + if (res == 0) res = resTmp; ++url; ++file; } @@ -288,9 +287,9 @@ size_t CurlHelper::write_data(void* ptr, size_t size, size_t nmemb, void* data) { size_t written; - FILE * fDescriptor = (FILE *)(data); + FILE * fDescriptor = (FILE *) (data); - written = fwrite(ptr,size,nmemb,fDescriptor); + written = fwrite(ptr, size, nmemb, fDescriptor); return written; } diff --git a/Code/IO/otbCurlHelper.h b/Code/IO/otbCurlHelper.h index b4b600195e..ff5b3a9bb3 100644 --- a/Code/IO/otbCurlHelper.h +++ b/Code/IO/otbCurlHelper.h @@ -49,16 +49,15 @@ public: int RetrieveFile(const std::ostringstream& urlStream, std::string filename) const; int RetrieveFile(const std::string& urlString, std::string filename) const; - int RetrieveFileMulti(const std::vector<std::string>& listURLs, + int RetrieveFileMulti(const std::vector<std::string>& listURLs, const std::vector<std::string>& listFiles, int maxConnect) const; protected: CurlHelper() : m_Browser("Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) " - "Gecko/20071127 Firefox/2.0.0.11") {} + "Gecko/20071127 Firefox/2.0.0.11") {} ~CurlHelper() {} - private: CurlHelper(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented @@ -67,14 +66,14 @@ private: { return nmemb; } - + // Need to use our writing function to handle windows segfaults // Need to be static cause the CURL_OPT is expecting a pure C // function or a static c++ method. static size_t write_data(void* ptr, size_t size, size_t nmemb, void* data); // Browser Agent used - std::string m_Browser; + std::string m_Browser; }; } #endif diff --git a/Code/IO/otbDefaultImageMetadataInterface.h b/Code/IO/otbDefaultImageMetadataInterface.h index 4eaf7b80b6..3c9c8b5fa9 100644 --- a/Code/IO/otbDefaultImageMetadataInterface.h +++ b/Code/IO/otbDefaultImageMetadataInterface.h @@ -151,29 +151,29 @@ public: } unsigned int GetDefaultRBand() const - { + { return 0; } - + unsigned int GetDefaultGBand() const - { + { return 1; } - + unsigned int GetDefaultBBand() const - { + { return 2; } - + protected: DefaultImageMetadataInterface(){}; virtual ~DefaultImageMetadataInterface() {} - + private: - + DefaultImageMetadataInterface(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented - + }; } // end namespace otb diff --git a/Code/IO/otbGDALImageIO.cxx b/Code/IO/otbGDALImageIO.cxx index 4148340fbd..0cb544d97e 100644 --- a/Code/IO/otbGDALImageIO.cxx +++ b/Code/IO/otbGDALImageIO.cxx @@ -306,7 +306,7 @@ void GDALImageIO::InternalReadImageInformation() // else // { - // Get image dimensions +// Get image dimensions m_width = m_poDataset->GetRasterXSize(); m_height = m_poDataset->GetRasterYSize(); @@ -512,7 +512,7 @@ void GDALImageIO::InternalReadImageInformation() /* Get the projection coordinate system of the image : ProjectionRef */ /* -------------------------------------------------------------------- */ - if (m_poDataset->GetProjectionRef() != NULL && !std::string(m_poDataset->GetProjectionRef()).empty() ) + if (m_poDataset->GetProjectionRef() != NULL && !std::string(m_poDataset->GetProjectionRef()).empty()) { OGRSpatialReference* pSR; const char * pszProjection = NULL; @@ -611,7 +611,7 @@ void GDALImageIO::InternalReadImageInformation() if (projRef.empty()) { projRef = - "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"; + "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"; itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projRef); } diff --git a/Code/IO/otbIkonosImageMetadataInterface.cxx b/Code/IO/otbIkonosImageMetadataInterface.cxx index 8ed8c1aa13..3651434880 100644 --- a/Code/IO/otbIkonosImageMetadataInterface.cxx +++ b/Code/IO/otbIkonosImageMetadataInterface.cxx @@ -589,24 +589,24 @@ IkonosImageMetadataInterface return wavel; } -unsigned int +unsigned int IkonosImageMetadataInterface ::GetDefaultRBand() const -{ +{ return 2; } -unsigned int +unsigned int IkonosImageMetadataInterface ::GetDefaultGBand() const -{ +{ return 1; } -unsigned int +unsigned int IkonosImageMetadataInterface ::GetDefaultBBand() const -{ +{ return 0; } diff --git a/Code/IO/otbIkonosImageMetadataInterface.h b/Code/IO/otbIkonosImageMetadataInterface.h index fba391f8f4..37d6caffac 100644 --- a/Code/IO/otbIkonosImageMetadataInterface.h +++ b/Code/IO/otbIkonosImageMetadataInterface.h @@ -100,7 +100,7 @@ public: bool CanRead(const MetaDataDictionaryType& dict) const; /** Those methodes are to retrieve the spectral band corresponding - * to the R, G, B or A chanel */ + * to the R, G, B or A chanel */ unsigned int GetDefaultRBand() const; unsigned int GetDefaultGBand() const; diff --git a/Code/IO/otbImageFileReader.txx b/Code/IO/otbImageFileReader.txx index 1746b40b24..7cbb14d5bc 100644 --- a/Code/IO/otbImageFileReader.txx +++ b/Code/IO/otbImageFileReader.txx @@ -244,7 +244,7 @@ ImageFileReader<TOutputImage> m_ExceptionMessage = ""; this->TestFileExistanceAndReadability(); } - catch (itk::ExceptionObject &err) + catch (itk::ExceptionObject & err) { m_ExceptionMessage = err.GetDescription(); } @@ -391,10 +391,10 @@ ImageFileReader<TOutputImage> //we need to pass the depth information which in on the IO to the projection //to be handle throught the kwl typename TileMapImageIO::Pointer imageIO = dynamic_cast<TileMapImageIO*>(this->GetImageIO()); - if(imageIO.IsNotNull()) - { - dynamic_cast<ossimTileMapModel*>(projection)->setDepth(imageIO->GetDepth()); - } + if (imageIO.IsNotNull()) + { + dynamic_cast<ossimTileMapModel*>(projection)->setDepth(imageIO->GetDepth()); + } } hasMetaData = projection->saveState(geom_kwl); // delete projection; //FIXME find out where this should occur @@ -464,7 +464,7 @@ ImageFileReader<TOutputImage> && this->m_FileName[3] == 'p') { CurlHelper::Pointer curlHelper = CurlHelper::New(); - int res = curlHelper->TestUrlAvailability(this->m_FileName); + int res = curlHelper->TestUrlAvailability(this->m_FileName); if (res != 0 && res != 63) // 63 stands for filesize exceed { itk::ImageFileReaderException e(__FILE__, __LINE__); diff --git a/Code/IO/otbImageFileWriter.txx b/Code/IO/otbImageFileWriter.txx index 12be319146..bbe5b3e708 100644 --- a/Code/IO/otbImageFileWriter.txx +++ b/Code/IO/otbImageFileWriter.txx @@ -42,7 +42,7 @@ namespace otb template <class TInputImage> ImageFileWriter<TInputImage> ::ImageFileWriter() : itk::ImageFileWriter<TInputImage>() -, m_WriteGeomFile(false) + , m_WriteGeomFile(false) { m_BufferMemorySize = 0; m_BufferNumberOfLinesDivisions = 0; @@ -95,9 +95,9 @@ ImageFileWriter<TInputImage> itk::ExposeMetaData<ImageKeywordlist>(dict, MetaDataKey::OSSIMKeywordlistKey, otb_kwl); otb_kwl.convertToOSSIMKeywordlist(geom_kwl); - if(geom_kwl.getSize()>0) + if (geom_kwl.getSize() > 0) { - otbMsgDevMacro(<<"Exporting keywordlist ..."); + otbMsgDevMacro(<< "Exporting keywordlist ..."); ossimFilename geomFileName(this->GetFileName()); geomFileName.setExtension(".geom"); geom_kwl.write(geomFileName.chars()); diff --git a/Code/IO/otbImageMetadataInterfaceBase.cxx b/Code/IO/otbImageMetadataInterfaceBase.cxx index 1377335cf4..1ce892719e 100644 --- a/Code/IO/otbImageMetadataInterfaceBase.cxx +++ b/Code/IO/otbImageMetadataInterfaceBase.cxx @@ -469,52 +469,52 @@ ImageMetadataInterfaceBase::PrintSelf(std::ostream& os, itk::Indent indent, cons switch (key.GetKeyType(keys[itkey])) { - case MetaDataKey::TSTRING: - itk::ExposeMetaData<std::string>(dict2, keys[itkey], svalue); - os << indent << "---> " << keys[itkey] << " = " << svalue << std::endl; - break; - - case MetaDataKey::TENTIER: - itk::ExposeMetaData<unsigned int>(dict2, keys[itkey], ivalue); - os << indent << "---> " << keys[itkey] << " = " << ivalue << std::endl; - break; - - case MetaDataKey::TVECTOR: - itk::ExposeMetaData<VectorType>(dict2, keys[itkey], vvalue); - - for (i = 0; i < vvalue.size(); ++i) - { - os << indent << "---> " << keys[itkey] << "[" << i << "] = " << vvalue[i] << std::endl; - } - vvalue.clear(); - - break; - - case MetaDataKey::TDOUBLE: - itk::ExposeMetaData<double>(dict2, keys[itkey], dvalue); - os << indent << "---> " << keys[itkey] << " = " << dvalue << std::endl; - break; - - case MetaDataKey::TOTB_GCP: - itk::ExposeMetaData<OTB_GCP>(dict2, keys[itkey], gcpvalue); - - os << indent << "---> " << keys[itkey] << std::endl; - gcpvalue.Print(os); - break; - case MetaDataKey::TOSSIMKEYWORDLIST: - itk::ExposeMetaData<ImageKeywordlist>(dict2, keys[itkey], ossimvalue); - - os << indent << "---> " << keys[itkey] << std::endl; - ossimvalue.Print(os); - break; - case MetaDataKey::TVECTORDATAKEYWORDLIST: - itk::ExposeMetaData<VectorDataKeywordlist>(dict2, keys[itkey], vectorDataKeywordlistValue); - - os << indent << "---> " << keys[itkey] << std::endl; - vectorDataKeywordlistValue.Print(os); - break; - default: - break; + case MetaDataKey::TSTRING: + itk::ExposeMetaData<std::string>(dict2, keys[itkey], svalue); + os << indent << "---> " << keys[itkey] << " = " << svalue << std::endl; + break; + + case MetaDataKey::TENTIER: + itk::ExposeMetaData<unsigned int>(dict2, keys[itkey], ivalue); + os << indent << "---> " << keys[itkey] << " = " << ivalue << std::endl; + break; + + case MetaDataKey::TVECTOR: + itk::ExposeMetaData<VectorType>(dict2, keys[itkey], vvalue); + + for (i = 0; i < vvalue.size(); ++i) + { + os << indent << "---> " << keys[itkey] << "[" << i << "] = " << vvalue[i] << std::endl; + } + vvalue.clear(); + + break; + + case MetaDataKey::TDOUBLE: + itk::ExposeMetaData<double>(dict2, keys[itkey], dvalue); + os << indent << "---> " << keys[itkey] << " = " << dvalue << std::endl; + break; + + case MetaDataKey::TOTB_GCP: + itk::ExposeMetaData<OTB_GCP>(dict2, keys[itkey], gcpvalue); + + os << indent << "---> " << keys[itkey] << std::endl; + gcpvalue.Print(os); + break; + case MetaDataKey::TOSSIMKEYWORDLIST: + itk::ExposeMetaData<ImageKeywordlist>(dict2, keys[itkey], ossimvalue); + + os << indent << "---> " << keys[itkey] << std::endl; + ossimvalue.Print(os); + break; + case MetaDataKey::TVECTORDATAKEYWORDLIST: + itk::ExposeMetaData<VectorDataKeywordlist>(dict2, keys[itkey], vectorDataKeywordlistValue); + + os << indent << "---> " << keys[itkey] << std::endl; + vectorDataKeywordlistValue.Print(os); + break; + default: + break; } } diff --git a/Code/IO/otbImageMetadataInterfaceBase.h b/Code/IO/otbImageMetadataInterfaceBase.h index 6a42bbf301..372c5e7553 100644 --- a/Code/IO/otbImageMetadataInterfaceBase.h +++ b/Code/IO/otbImageMetadataInterfaceBase.h @@ -214,14 +214,13 @@ public: virtual unsigned int BandIndexToWavelengthPosition(unsigned int i) const; /** Those methodes are to retrieve the spectral band corresponding - * to the R, G, B or A chanel */ + * to the R, G, B or A chanel */ virtual unsigned int GetDefaultRBand() const = 0; virtual unsigned int GetDefaultGBand() const = 0; virtual unsigned int GetDefaultBBand() const = 0; - virtual bool CanRead(const MetaDataDictionaryType& dict) const = 0; virtual void PrintSelf(std::ostream& os, itk::Indent indent, const MetaDataDictionaryType& dict) const; diff --git a/Code/IO/otbImageSeriesFileReaderBase.txx b/Code/IO/otbImageSeriesFileReaderBase.txx index 127969375b..2d33ff714e 100644 --- a/Code/IO/otbImageSeriesFileReaderBase.txx +++ b/Code/IO/otbImageSeriesFileReaderBase.txx @@ -67,10 +67,11 @@ typename ImageSeriesFileReaderBase<TImage, TInternalImage>::OutputImageListType ImageSeriesFileReaderBase<TImage, TInternalImage> ::GetOutput() { - if (this->GetNumberOfOutputs() < 1) throw ImageSeriesFileReaderException(__FILE__, - __LINE__, - "No data to output", - ITK_LOCATION); + if (this->GetNumberOfOutputs() < 1) + throw ImageSeriesFileReaderException(__FILE__, + __LINE__, + "No data to output", + ITK_LOCATION); return static_cast<OutputImageListType*>(this->m_OutputList); } @@ -80,15 +81,17 @@ typename ImageSeriesFileReaderBase<TImage, TInternalImage>::OutputImageType * ImageSeriesFileReaderBase<TImage, TInternalImage> ::GetOutput(unsigned int idx) { - if (this->GetNumberOfOutputs() < 1) throw ImageSeriesFileReaderException(__FILE__, - __LINE__, - "No data to output", - ITK_LOCATION); - - if (idx >= m_OutputList->Size()) throw ImageSeriesFileReaderException(__FILE__, - __LINE__, - "Index out of bounds", - ITK_LOCATION); + if (this->GetNumberOfOutputs() < 1) + throw ImageSeriesFileReaderException(__FILE__, + __LINE__, + "No data to output", + ITK_LOCATION); + + if (idx >= m_OutputList->Size()) + throw ImageSeriesFileReaderException(__FILE__, + __LINE__, + "Index out of bounds", + ITK_LOCATION); return static_cast<OutputImageType*>(this->m_OutputList->GetNthElement(idx)); } diff --git a/Code/IO/otbKMLVectorDataIO.txx b/Code/IO/otbKMLVectorDataIO.txx index a8da150163..73a9974813 100644 --- a/Code/IO/otbKMLVectorDataIO.txx +++ b/Code/IO/otbKMLVectorDataIO.txx @@ -137,60 +137,60 @@ KMLVectorDataIO<TData>::WalkContainer(const kmldom::ContainerPtr& container, Dat kmldom::FeaturePtr feature = container->get_feature_array_at(i); switch (feature->Type()) { - case kmldom::Type_Document: - { - DataNodePointerType document = DataNodeType::New(); - document->SetNodeType(DOCUMENT); - document->SetNodeId(feature->get_id()); - if (feature->has_name()) + case kmldom::Type_Document: { - document->SetFieldAsString("name", feature->get_name()); + DataNodePointerType document = DataNodeType::New(); + document->SetNodeType(DOCUMENT); + document->SetNodeId(feature->get_id()); + if (feature->has_name()) + { + document->SetFieldAsString("name", feature->get_name()); + } + m_Tree->Add(document, father); + WalkFeature(feature, document); + break; } - m_Tree->Add(document, father); - WalkFeature(feature, document); - break; - } - case kmldom::Type_Folder: - { - DataNodePointerType folder = DataNodeType::New(); - folder->SetNodeType(FOLDER); - folder->SetNodeId(feature->get_id()); - if (feature->has_name()) + case kmldom::Type_Folder: { - folder->SetFieldAsString("name", feature->get_name()); + DataNodePointerType folder = DataNodeType::New(); + folder->SetNodeType(FOLDER); + folder->SetNodeId(feature->get_id()); + if (feature->has_name()) + { + folder->SetFieldAsString("name", feature->get_name()); + } + m_Tree->Add(folder, father); + WalkFeature(feature, folder); + break; } - m_Tree->Add(folder, father); - WalkFeature(feature, folder); - break; - } - case kmldom::Type_GroundOverlay: - { - WalkFeature(feature, father); - break; - } - case kmldom::Type_NetworkLink: - { - WalkFeature(feature, father); - break; - } - case kmldom::Type_PhotoOverlay: - { - WalkFeature(feature, father); - break; - } - case kmldom::Type_Placemark: - { - // We just ignore placemarks - WalkFeature(feature, father); - break; - } - case kmldom::Type_ScreenOverlay: - { - WalkFeature(feature, father); - break; - } - default: - break; + case kmldom::Type_GroundOverlay: + { + WalkFeature(feature, father); + break; + } + case kmldom::Type_NetworkLink: + { + WalkFeature(feature, father); + break; + } + case kmldom::Type_PhotoOverlay: + { + WalkFeature(feature, father); + break; + } + case kmldom::Type_Placemark: + { + // We just ignore placemarks + WalkFeature(feature, father); + break; + } + case kmldom::Type_ScreenOverlay: + { + WalkFeature(feature, father); + break; + } + default: + break; } } @@ -213,41 +213,41 @@ KMLVectorDataIO<TData>::WalkGeometry(const kmldom::GeometryPtr& geometry, DataNo // Create a Node with the Geometry type. switch (geometry->Type()) { - case kmldom::Type_Point: - { - node = ConvertGeometryToPointNode(geometry); - m_Tree->Add(node, father); - break; - } - case kmldom::Type_LineString: - { - node = ConvertGeometryToLineStringNode(geometry); - m_Tree->Add(node, father); - break; - } - case kmldom::Type_LinearRing: - { - node = ConvertGeometryToLinearRingNode(geometry); - m_Tree->Add(node, father); - break; - } - case kmldom::Type_Polygon: - { - node = ConvertGeometryToPolygonNode(geometry); - m_Tree->Add(node, father); - break; - } - case kmldom::Type_MultiGeometry: - { - // this case is treated downer - break; - } - case kmldom::Type_Model: - { - break; - } - default: // KML has 6 types of Geometry. - break; + case kmldom::Type_Point: + { + node = ConvertGeometryToPointNode(geometry); + m_Tree->Add(node, father); + break; + } + case kmldom::Type_LineString: + { + node = ConvertGeometryToLineStringNode(geometry); + m_Tree->Add(node, father); + break; + } + case kmldom::Type_LinearRing: + { + node = ConvertGeometryToLinearRingNode(geometry); + m_Tree->Add(node, father); + break; + } + case kmldom::Type_Polygon: + { + node = ConvertGeometryToPolygonNode(geometry); + m_Tree->Add(node, father); + break; + } + case kmldom::Type_MultiGeometry: + { + // this case is treated downer + break; + } + case kmldom::Type_Model: + { + break; + } + default: // KML has 6 types of Geometry. + break; } // Recurse into <MultiGeometry>. @@ -623,142 +623,158 @@ void KMLVectorDataIO<TData>::ProcessNodeWrite(InternalTreeNodeType * source, ++m_Kept; switch (dataNode->GetNodeType()) { - case ROOT: - { - break; - } - case DOCUMENT: - { - kmldom::DocumentPtr document = factory->CreateDocument(); - if (dataNode->HasField("name")) - { - std::string fieldname = dataNode->GetFieldAsString("name"); - document->set_name(fieldname); - } - kml->set_feature(document); - currentDocument = document; - ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); - break; - } - case FOLDER: - { - kmldom::FolderPtr folder = factory->CreateFolder(); - std::string fieldname = dataNode->GetFieldAsString("name"); - folder->set_name(fieldname); - currentDocument->add_feature(folder); - currentFolder = folder; - ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); - break; - } - case FEATURE_POINT: - { - // Create <coordinates> - kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); - PointType pointCoord = dataNode->GetPoint(); - if (DataNodeType::Dimension > 2) + case ROOT: { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2]); + break; } - else + case DOCUMENT: { - coordinates->add_latlng(pointCoord[1], pointCoord[0]); + kmldom::DocumentPtr document = factory->CreateDocument(); + if (dataNode->HasField("name")) + { + std::string fieldname = dataNode->GetFieldAsString("name"); + document->set_name(fieldname); + } + kml->set_feature(document); + currentDocument = document; + ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); + break; } - - // Create <Point> and give it <coordinates>. - kmldom::PointPtr point = factory->CreatePoint(); - point->set_coordinates(coordinates); - - if (currentMultiGeometry != NULL) + case FOLDER: { - currentMultiGeometry->add_geometry(point); + kmldom::FolderPtr folder = factory->CreateFolder(); + std::string fieldname = dataNode->GetFieldAsString("name"); + folder->set_name(fieldname); + currentDocument->add_feature(folder); + currentFolder = folder; + ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); + break; } - else + case FEATURE_POINT: { - - kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); - placemark->set_geometry(point); - if (currentFolder != NULL) + // Create <coordinates> + kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); + PointType pointCoord = dataNode->GetPoint(); + if (DataNodeType::Dimension > 2) { - currentFolder->add_feature(placemark); + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2]); } else { - currentDocument->add_feature(placemark); + coordinates->add_latlng(pointCoord[1], pointCoord[0]); } - } - break; - } - case FEATURE_LINE: - { - - VertexListConstPointerType vertexList = dataNode->GetLine()->GetVertexList(); - - // Create <coordinates> - kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); - kmldom::LineStringPtr line = factory->CreateLineString(); - - typename VertexListType::ConstIterator vIt = vertexList->Begin(); + // Create <Point> and give it <coordinates>. + kmldom::PointPtr point = factory->CreatePoint(); + point->set_coordinates(coordinates); - while (vIt != vertexList->End()) - { - VertexType pointCoord = vIt.Value(); - if (DataNodeType::Dimension > 2) + if (currentMultiGeometry != NULL) { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2]); + currentMultiGeometry->add_geometry(point); } else { - coordinates->add_latlng(pointCoord[1], pointCoord[0]); - } - line->set_coordinates(coordinates); - ++vIt; - } - if (currentMultiGeometry != NULL) - { - currentMultiGeometry->add_geometry(line); + kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); + placemark->set_geometry(point); + if (currentFolder != NULL) + { + currentFolder->add_feature(placemark); + } + else + { + currentDocument->add_feature(placemark); + } + + } + break; } - else + case FEATURE_LINE: { - kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); - placemark->set_geometry(line); - if (currentFolder != NULL) + + VertexListConstPointerType vertexList = dataNode->GetLine()->GetVertexList(); + + // Create <coordinates> + kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); + kmldom::LineStringPtr line = factory->CreateLineString(); + + typename VertexListType::ConstIterator vIt = vertexList->Begin(); + + while (vIt != vertexList->End()) { - currentFolder->add_feature(placemark); + VertexType pointCoord = vIt.Value(); + if (DataNodeType::Dimension > 2) + { + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2]); + } + else + { + coordinates->add_latlng(pointCoord[1], pointCoord[0]); + } + line->set_coordinates(coordinates); + ++vIt; + } + + if (currentMultiGeometry != NULL) + { + currentMultiGeometry->add_geometry(line); } else { - currentDocument->add_feature(placemark); + kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); + placemark->set_geometry(line); + if (currentFolder != NULL) + { + currentFolder->add_feature(placemark); + } + else + { + currentDocument->add_feature(placemark); + } } + break; } - break; - } - case FEATURE_POLYGON: - { //TODO refine the solution of drawing the polygon 1m above the ground - // In a polygon we just can find any LinearRings + case FEATURE_POLYGON: + { //TODO refine the solution of drawing the polygon 1m above the ground + // In a polygon we just can find any LinearRings - kmldom::LinearRingPtr line = factory->CreateLinearRing(); - kmldom::PolygonPtr polygon = factory->CreatePolygon(); + kmldom::LinearRingPtr line = factory->CreateLinearRing(); + kmldom::PolygonPtr polygon = factory->CreatePolygon(); - polygon->set_extrude(true); - polygon->set_altitudemode(1); //ALTITUDEMODE_RELATIVETOGROUND + polygon->set_extrude(true); + polygon->set_altitudemode(1); //ALTITUDEMODE_RELATIVETOGROUND - kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); - kmldom::OuterBoundaryIsPtr outerboundaryis = factory->CreateOuterBoundaryIs(); - kmldom::InnerBoundaryIsPtr innerboundaryis = factory->CreateInnerBoundaryIs(); + kmldom::CoordinatesPtr coordinates = factory->CreateCoordinates(); + kmldom::OuterBoundaryIsPtr outerboundaryis = factory->CreateOuterBoundaryIs(); + kmldom::InnerBoundaryIsPtr innerboundaryis = factory->CreateInnerBoundaryIs(); - VertexListConstPointerType vertexList = dataNode->GetPolygonExteriorRing()->GetVertexList(); + VertexListConstPointerType vertexList = dataNode->GetPolygonExteriorRing()->GetVertexList(); - typename VertexListType::ConstIterator vIt = vertexList->Begin(); + typename VertexListType::ConstIterator vIt = vertexList->Begin(); - if (vIt == vertexList->End()) - { - itkExceptionMacro(<< "Polygon is empty"); - } + if (vIt == vertexList->End()) + { + itkExceptionMacro(<< "Polygon is empty"); + } - while (vIt != vertexList->End()) - { + while (vIt != vertexList->End()) + { + VertexType pointCoord = vIt.Value(); + if (DataNodeType::Dimension > 2) + { + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2] + 1); //Drawing polygon 1m above ground to avoid z-buffer issues + } + else + { + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], 1); //Drawing polygon 1m above ground to avoid z-buffer issues + } + + line->set_coordinates(coordinates); + ++vIt; + } + + //Adding the first point again to close the polygon + vIt = vertexList->Begin(); VertexType pointCoord = vIt.Value(); if (DataNodeType::Dimension > 2) { @@ -768,37 +784,37 @@ void KMLVectorDataIO<TData>::ProcessNodeWrite(InternalTreeNodeType * source, { coordinates->add_latlngalt(pointCoord[1], pointCoord[0], 1); //Drawing polygon 1m above ground to avoid z-buffer issues } - line->set_coordinates(coordinates); - ++vIt; - } - //Adding the first point again to close the polygon - vIt = vertexList->Begin(); - VertexType pointCoord = vIt.Value(); - if (DataNodeType::Dimension > 2) - { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2] + 1); //Drawing polygon 1m above ground to avoid z-buffer issues - } - else - { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], 1); //Drawing polygon 1m above ground to avoid z-buffer issues - } - line->set_coordinates(coordinates); + outerboundaryis->set_linearring(line); + polygon->set_outerboundaryis(outerboundaryis); - outerboundaryis->set_linearring(line); - polygon->set_outerboundaryis(outerboundaryis); + // Retrieving internal rings as well + for (typename PolygonListType::Iterator pIt = dataNode->GetPolygonInteriorRings()->Begin(); + pIt != dataNode->GetPolygonInteriorRings()->End(); ++pIt) + { - // Retrieving internal rings as well - for (typename PolygonListType::Iterator pIt = dataNode->GetPolygonInteriorRings()->Begin(); - pIt != dataNode->GetPolygonInteriorRings()->End(); ++pIt) - { + vertexList = pIt.Get()->GetVertexList(); + vIt = vertexList->Begin(); - vertexList = pIt.Get()->GetVertexList(); - vIt = vertexList->Begin(); + while (vIt != vertexList->End()) + { + vIt = vertexList->Begin(); + VertexType pointCoord = vIt.Value(); + if (DataNodeType::Dimension > 2) + { + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2] + 1); //Drawing polygon 1m above ground to avoid z-buffer issues + } + else + { + coordinates->add_latlngalt(pointCoord[1], pointCoord[0], 1); //Drawing polygon 1m above ground to avoid z-buffer issues + } + + line->set_coordinates(coordinates); + ++vIt; + } - while (vIt != vertexList->End()) - { + //Adding the first point again to close the polygon vIt = vertexList->Begin(); VertexType pointCoord = vIt.Value(); if (DataNodeType::Dimension > 2) @@ -812,36 +828,38 @@ void KMLVectorDataIO<TData>::ProcessNodeWrite(InternalTreeNodeType * source, line->set_coordinates(coordinates); ++vIt; + + innerboundaryis->set_linearring(line); + polygon->add_innerboundaryis(innerboundaryis); + innerboundaryis->clear_linearring(); } - //Adding the first point again to close the polygon - vIt = vertexList->Begin(); - VertexType pointCoord = vIt.Value(); - if (DataNodeType::Dimension > 2) + if (currentMultiGeometry != NULL) { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], pointCoord[2] + 1); //Drawing polygon 1m above ground to avoid z-buffer issues + currentMultiGeometry->add_geometry(polygon); } else { - coordinates->add_latlngalt(pointCoord[1], pointCoord[0], 1); //Drawing polygon 1m above ground to avoid z-buffer issues + kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); + placemark->set_geometry(polygon); + if (currentFolder != NULL) + { + currentFolder->add_feature(placemark); + } + else + { + currentDocument->add_feature(placemark); + } } - - line->set_coordinates(coordinates); - ++vIt; - - innerboundaryis->set_linearring(line); - polygon->add_innerboundaryis(innerboundaryis); - innerboundaryis->clear_linearring(); + break; } - - if (currentMultiGeometry != NULL) - { - currentMultiGeometry->add_geometry(polygon); - } - else + // MultiGeometry + case FEATURE_COLLECTION: { + kmldom::MultiGeometryPtr multi = factory->CreateMultiGeometry(); + currentMultiGeometry = multi; kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); - placemark->set_geometry(polygon); + placemark->set_geometry(multi); if (currentFolder != NULL) { currentFolder->add_feature(placemark); @@ -850,29 +868,11 @@ void KMLVectorDataIO<TData>::ProcessNodeWrite(InternalTreeNodeType * source, { currentDocument->add_feature(placemark); } + ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); + break; } - break; - } - // MultiGeometry - case FEATURE_COLLECTION: - { - kmldom::MultiGeometryPtr multi = factory->CreateMultiGeometry(); - currentMultiGeometry = multi; - kmldom::PlacemarkPtr placemark = factory->CreatePlacemark(); - placemark->set_geometry(multi); - if (currentFolder != NULL) - { - currentFolder->add_feature(placemark); - } - else - { - currentDocument->add_feature(placemark); - } - ProcessNodeWrite(*it, factory, kml, currentDocument, currentFolder, currentMultiGeometry); - break; - } - default: - break; + default: + break; } // end switch } // end for diff --git a/Code/IO/otbMSTARImageIO.cxx b/Code/IO/otbMSTARImageIO.cxx index da43cf26b2..037e25e81a 100644 --- a/Code/IO/otbMSTARImageIO.cxx +++ b/Code/IO/otbMSTARImageIO.cxx @@ -335,16 +335,16 @@ void MSTARImageIO::Read(void* buffer) ******************************************************/ switch (mstartype) { - case CHIP_IMAGE: - magloc = phlen; - fseek(MSTARfp, magloc, 0); - nchunks = numrows * numcols; - break; - case FSCENE_IMAGE: - magloc = phlen + nhlen; /* nhlen = 512 */ - fseek(MSTARfp, magloc, 0); - nchunks = numrows * numcols; - break; + case CHIP_IMAGE: + magloc = phlen; + fseek(MSTARfp, magloc, 0); + nchunks = numrows * numcols; + break; + case FSCENE_IMAGE: + magloc = phlen + nhlen; /* nhlen = 512 */ + fseek(MSTARfp, magloc, 0); + nchunks = numrows * numcols; + break; } /****************************************************** @@ -357,12 +357,12 @@ void MSTARImageIO::Read(void* buffer) byteorder = (int) CheckByteOrder(); switch (byteorder) { - case LSB_FIRST: - printf("==> Little-Endian CPU detected: Will byteswap before scaling data!\n"); - break; - case MSB_FIRST: - printf("==> Big-Endian CPU detected: No byteswap needed!\n"); - break; + case LSB_FIRST: + printf("==> Little-Endian CPU detected: Will byteswap before scaling data!\n"); + break; + case MSB_FIRST: + printf("==> Big-Endian CPU detected: No byteswap needed!\n"); + break; } /****************************************************** @@ -386,148 +386,148 @@ void MSTARImageIO::Read(void* buffer) /* Open output file for writing... */ switch (mstartype) { - case CHIP_IMAGE: - otbMsgDevMacro(<< " Chip and all "); - totchunks = nchunks * 2; - bytesPerImage = totchunks * sizeof(float); - CHIPdata = (float *) malloc(bytesPerImage); - - if (CHIPdata == (float *) NULL) - { - fclose(MSTARfp); - itkExceptionMacro("Error: Unable to malloc CHIP memory!\n"); + case CHIP_IMAGE: + otbMsgDevMacro(<< " Chip and all "); + totchunks = nchunks * 2; + bytesPerImage = totchunks * sizeof(float); + CHIPdata = (float *) malloc(bytesPerImage); - } + if (CHIPdata == (float *) NULL) + { + fclose(MSTARfp); + itkExceptionMacro("Error: Unable to malloc CHIP memory!\n"); - switch (byteorder) - { - case LSB_FIRST: /* Little-endian..do byteswap */ + } - otbMsgDevMacro(<< "Performing auto-byteswap...\n"); - for (i = 0; i < totchunks; ++i) + switch (byteorder) { - fread(bigfloatbuf, sizeof(char), 4, MSTARfp); - littlefloatval = byteswap_SR_IR(bigfloatbuf); - CHIPdata[i] = littlefloatval; - } - break; + case LSB_FIRST: /* Little-endian..do byteswap */ - case MSB_FIRST: /* Big-endian..no swap */ + otbMsgDevMacro(<< "Performing auto-byteswap...\n"); + for (i = 0; i < totchunks; ++i) + { + fread(bigfloatbuf, sizeof(char), 4, MSTARfp); + littlefloatval = byteswap_SR_IR(bigfloatbuf); + CHIPdata[i] = littlefloatval; + } + break; - numgot = fread(CHIPdata, sizeof(float), totchunks, MSTARfp); - break; - } - - /* Writes ALL data or MAG only data based on totchunks */ - //n = fwrite(CHIPdata, sizeof(float), totchunks, RAWfp); - - // Recopie dans le buffer - - for (int ci = 0; ci < nchunks; ++ci) - { - p[ci * 2] = CHIPdata[ci]; //magnitude - p[ci * 2 + 1] = CHIPdata[nchunks + ci]; //phase - } - - /* Cleanup: Close file..free memory */ - free(CHIPdata); - break; /* End of CHIP_IMAGE case */ - - case FSCENE_IMAGE: - bytesPerImage = nchunks * sizeof(short); - FSCENEdata = (unsigned short *) malloc(bytesPerImage); - if (FSCENEdata == (unsigned short *) NULL) - { - fclose(MSTARfp); - itkExceptionMacro(<< "Error: Unable to malloc fullscene memory!\n"); - } - - otbMsgDevMacro(<< "Reading MSTAR fullscene magnitude data from [" << MSTARname << "]."); - - switch (byteorder) - { - case LSB_FIRST: /* Little-endian..do byteswap */ - otbMsgDevMacro(<< "Performing auto-byteswap..."); - for (i = 0; i < nchunks; ++i) - { - fread(bigushortbuf, sizeof(char), 2, MSTARfp); - littleushortval = byteswap_SUS_IUS(bigushortbuf); - FSCENEdata[i] = littleushortval; + case MSB_FIRST: /* Big-endian..no swap */ + + numgot = fread(CHIPdata, sizeof(float), totchunks, MSTARfp); + break; } - break; - case MSB_FIRST: /* Big-endian..no swap */ - numgot = fread(FSCENEdata, sizeof(short), nchunks, MSTARfp); - break; - } + /* Writes ALL data or MAG only data based on totchunks */ + //n = fwrite(CHIPdata, sizeof(float), totchunks, RAWfp); - otbMsgDevMacro(<< "Writing MSTAR fullscene magnitude data to [" << RAWname << "]."); - //n = fwrite(FSCENEdata, sizeof(short), nchunks, RAWfp); - for (int nbComponents = 0; nbComponents < 1; ++nbComponents) - { // Recopie dans le buffer - unsigned long cpt(0); - cpt = (unsigned long) (nbComponents) * (unsigned long) (m_NbOctetPixel); - for (unsigned long i = 0; i < lTailleBuffer; i = i + m_NbOctetPixel) + for (int ci = 0; ci < nchunks; ++ci) { - memcpy((void*) (&(p[cpt])), (const void*) (&(FSCENEdata[i])), (size_t) (m_NbOctetPixel)); - cpt += step; + p[ci * 2] = CHIPdata[ci]; //magnitude + p[ci * 2 + 1] = CHIPdata[nchunks + ci]; //phase } - } + /* Cleanup: Close file..free memory */ + free(CHIPdata); + break; /* End of CHIP_IMAGE case */ - if (n != nchunks) - { - fclose(MSTARfp); - itkExceptionMacro(<< "Error: in writing MSTAR Fullscene data!"); - } + case FSCENE_IMAGE: + bytesPerImage = nchunks * sizeof(short); + FSCENEdata = (unsigned short *) malloc(bytesPerImage); + if (FSCENEdata == (unsigned short *) NULL) + { + fclose(MSTARfp); + itkExceptionMacro(<< "Error: Unable to malloc fullscene memory!\n"); + } - otbMsgDevMacro(<< "Reading MSTAR fullscene phase data from [" << MSTARname << "]."); + otbMsgDevMacro(<< "Reading MSTAR fullscene magnitude data from [" << MSTARname << "]."); - switch (byteorder) - { - case LSB_FIRST: /* Little-endian..do byteswap */ - otbMsgDevMacro(<< "Performing auto-byteswap..."); - for (i = 0; i < nchunks; ++i) + switch (byteorder) { - fread(bigushortbuf, sizeof(char), 2, MSTARfp); - littleushortval = byteswap_SUS_IUS(bigushortbuf); - FSCENEdata[i] = littleushortval; + case LSB_FIRST: /* Little-endian..do byteswap */ + otbMsgDevMacro(<< "Performing auto-byteswap..."); + for (i = 0; i < nchunks; ++i) + { + fread(bigushortbuf, sizeof(char), 2, MSTARfp); + littleushortval = byteswap_SUS_IUS(bigushortbuf); + FSCENEdata[i] = littleushortval; + } + break; + + case MSB_FIRST: /* Big-endian..no swap */ + numgot = fread(FSCENEdata, sizeof(short), nchunks, MSTARfp); + break; } - break; - case MSB_FIRST: /* Big-endian..no swap */ - numgot = fread(FSCENEdata, sizeof(short), nchunks, MSTARfp); - break; - } + otbMsgDevMacro(<< "Writing MSTAR fullscene magnitude data to [" << RAWname << "]."); + //n = fwrite(FSCENEdata, sizeof(short), nchunks, RAWfp); + for (int nbComponents = 0; nbComponents < 1; ++nbComponents) + { + // Recopie dans le buffer - otbMsgDevMacro(<< "Writing MSTAR fullscene phase data to [" << RAWname << "]."); -// n = fwrite(FSCENEdata, sizeof(short), nchunks, RAWfp); - for (unsigned int nbComponents = 1; nbComponents < this->GetNumberOfComponents(); ++nbComponents) - { - // Recopie dans le buffer + unsigned long cpt(0); + cpt = (unsigned long) (nbComponents) * (unsigned long) (m_NbOctetPixel); + for (unsigned long i = 0; i < lTailleBuffer; i = i + m_NbOctetPixel) + { + memcpy((void*) (&(p[cpt])), (const void*) (&(FSCENEdata[i])), (size_t) (m_NbOctetPixel)); + cpt += step; + } - unsigned long cpt(0); - cpt = (unsigned long) (nbComponents) * (unsigned long) (m_NbOctetPixel); - for (unsigned long i = 0; i < lTailleBuffer; i = i + m_NbOctetPixel) + } + + if (n != nchunks) { - memcpy((void*) (&(p[cpt])), (const void*) (&(CHIPdata[i])), (size_t) (m_NbOctetPixel)); - cpt += step; + fclose(MSTARfp); + itkExceptionMacro(<< "Error: in writing MSTAR Fullscene data!"); } - } + otbMsgDevMacro(<< "Reading MSTAR fullscene phase data from [" << MSTARname << "]."); + + switch (byteorder) + { + case LSB_FIRST: /* Little-endian..do byteswap */ + otbMsgDevMacro(<< "Performing auto-byteswap..."); + for (i = 0; i < nchunks; ++i) + { + fread(bigushortbuf, sizeof(char), 2, MSTARfp); + littleushortval = byteswap_SUS_IUS(bigushortbuf); + FSCENEdata[i] = littleushortval; + } + break; + + case MSB_FIRST: /* Big-endian..no swap */ + numgot = fread(FSCENEdata, sizeof(short), nchunks, MSTARfp); + break; + } - if (n != nchunks) - { - fclose(MSTARfp); - itkExceptionMacro(<< "Error: in writing MSTAR Fullscene Phase data!"); - } + otbMsgDevMacro(<< "Writing MSTAR fullscene phase data to [" << RAWname << "]."); +// n = fwrite(FSCENEdata, sizeof(short), nchunks, RAWfp); + for (unsigned int nbComponents = 1; nbComponents < this->GetNumberOfComponents(); ++nbComponents) + { + // Recopie dans le buffer + + unsigned long cpt(0); + cpt = (unsigned long) (nbComponents) * (unsigned long) (m_NbOctetPixel); + for (unsigned long i = 0; i < lTailleBuffer; i = i + m_NbOctetPixel) + { + memcpy((void*) (&(p[cpt])), (const void*) (&(CHIPdata[i])), (size_t) (m_NbOctetPixel)); + cpt += step; + } + + } + + if (n != nchunks) + { + fclose(MSTARfp); + itkExceptionMacro(<< "Error: in writing MSTAR Fullscene Phase data!"); + } - /* Cleanup: free memory */ - free(FSCENEdata); + /* Cleanup: free memory */ + free(FSCENEdata); - break; /* End of FSCENE_IMAGE case */ + break; /* End of FSCENE_IMAGE case */ } /* End of 'mstartype' switch */ diff --git a/Code/IO/otbOGRIOHelper.txx b/Code/IO/otbOGRIOHelper.txx index 78b9ef2979..d2a3b60747 100644 --- a/Code/IO/otbOGRIOHelper.txx +++ b/Code/IO/otbOGRIOHelper.txx @@ -72,7 +72,7 @@ OGRIOHelper<TVectorData> LinePointerType line = LineType::New(); - OGRPoint * ogrTmpPoint = (OGRPoint *)OGRGeometryFactory::createGeometry(wkbPoint); + OGRPoint * ogrTmpPoint = (OGRPoint *) OGRGeometryFactory::createGeometry(wkbPoint); for (int pIndex = 0; pIndex < ogrLine->getNumPoints(); ++pIndex) { @@ -116,7 +116,7 @@ OGRIOHelper<TVectorData> itkGenericExceptionMacro(<< "Failed to convert OGRGeometry to OGRPolygon"); } - OGRPoint * ogrTmpPoint = (OGRPoint *)OGRGeometryFactory::createGeometry(wkbPoint); + OGRPoint * ogrTmpPoint = (OGRPoint *) OGRGeometryFactory::createGeometry(wkbPoint); OGRLinearRing * ogrRing = ogrPolygon->getExteriorRing(); PolygonPointerType extRing = PolygonType::New(); @@ -215,233 +215,91 @@ inline void OGRIOHelper<TVectorData> switch (geometry->getGeometryType()) { - case wkbPoint: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - - newNode->Set(ConvertGeometryToPointNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbPoint25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPointNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbLineString: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbLineString25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbPolygon: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbPolygon25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(geometry)); - //Reach the DataNode inside the tree node - itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); - itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, - MetaDataKey::VectorDataKeywordlistKey, - kwl); - folderPtr->AddChild(newNode); - break; - } - case wkbMultiPoint: - { - - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTIPOINT); - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiPoint * ogrMulti = (OGRMultiPoint *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbPoint: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + + newNode->Set(ConvertGeometryToPointNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbMultiPoint25D: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTIPOINT); - - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiPoint * ogrMulti = (OGRMultiPoint *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbPoint25D: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + newNode->Set(ConvertGeometryToPointNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbMultiLineString: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTILINE); - - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiLineString * ogrMulti = (OGRMultiLineString *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbLineString: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + newNode->Set(ConvertGeometryToLineNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbMultiLineString25D: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTILINE); - - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiLineString * ogrMulti = (OGRMultiLineString *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbLineString25D: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + newNode->Set(ConvertGeometryToLineNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbMultiPolygon: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTIPOLYGON); - - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiPolygon * ogrMulti = (OGRMultiPolygon *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbPolygon: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + newNode->Set(ConvertGeometryToPolygonNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbMultiPolygon25D: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_MULTIPOLYGON); - - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); - - OGRMultiPolygon * ogrMulti = (OGRMultiPolygon *) geometry; - - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) + case wkbPolygon25D: { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + newNode->Set(ConvertGeometryToPolygonNode(geometry)); + //Reach the DataNode inside the tree node itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, MetaDataKey::VectorDataKeywordlistKey, kwl); - multiPtr->AddChild(newNode); + folderPtr->AddChild(newNode); + break; } - break; - } - case wkbGeometryCollection: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_COLLECTION); + case wkbMultiPoint: + { - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTIPOINT); + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); - OGRGeometryCollection * ogrMulti = (OGRGeometryCollection *) geometry; + OGRMultiPoint * ogrMulti = (OGRMultiPoint *) geometry; - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) - { - switch (ogrMulti->getGeometryRef(geoIndex)->getGeometryType()) - { - case wkbPoint: + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); @@ -450,9 +308,21 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; } - case wkbPoint25D: + break; + } + case wkbMultiPoint25D: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTIPOINT); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRMultiPoint * ogrMulti = (OGRMultiPoint *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); @@ -461,9 +331,21 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; } - case wkbLineString: + break; + } + case wkbMultiLineString: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTILINE); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRMultiLineString * ogrMulti = (OGRMultiLineString *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); @@ -472,9 +354,21 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; } - case wkbLineString25D: + break; + } + case wkbMultiLineString25D: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTILINE); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRMultiLineString * ogrMulti = (OGRMultiLineString *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); @@ -483,9 +377,21 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; } - case wkbPolygon: + break; + } + case wkbMultiPolygon: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTIPOLYGON); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRMultiPolygon * ogrMulti = (OGRMultiPolygon *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); @@ -494,9 +400,21 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; } - case wkbPolygon25D: + break; + } + case wkbMultiPolygon25D: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_MULTIPOLYGON); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRMultiPolygon * ogrMulti = (OGRMultiPolygon *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); @@ -505,90 +423,172 @@ inline void OGRIOHelper<TVectorData> MetaDataKey::VectorDataKeywordlistKey, kwl); multiPtr->AddChild(newNode); - break; - } - default: - { - std::cout << "Geometry type not found: " << ogrMulti->getGeometryRef(geoIndex)->getGeometryType() << - std::endl; - break; - } } + break; } - break; - } - case wkbGeometryCollection25D: - { - DataNodePointerType multi = DataNodeType::New(); - multi->SetNodeType(FEATURE_COLLECTION); + case wkbGeometryCollection: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_COLLECTION); - multiPtr = InternalTreeNodeType::New(); - multiPtr->Set(multi); - folderPtr->AddChild(multiPtr); + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); - OGRGeometryCollection * ogrMulti = (OGRGeometryCollection *) geometry; + OGRGeometryCollection * ogrMulti = (OGRGeometryCollection *) geometry; - for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) - { - switch (ogrMulti->getGeometryRef(geoIndex)->getGeometryType()) - { - case wkbPoint: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; - } - case wkbPoint25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; - } - case wkbLineString: + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; + switch (ogrMulti->getGeometryRef(geoIndex)->getGeometryType()) + { + case wkbPoint: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + case wkbPoint25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + case wkbLineString: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + case wkbLineString25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + case wkbPolygon: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + case wkbPolygon25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + itk::MetaDataDictionary& dict = newNode->Get()->GetMetaDataDictionary(); + itk::EncapsulateMetaData<VectorDataKeywordlist>(dict, + MetaDataKey::VectorDataKeywordlistKey, + kwl); + multiPtr->AddChild(newNode); + break; + } + default: + { + std::cout << "Geometry type not found: " << ogrMulti->getGeometryRef(geoIndex)->getGeometryType() << + std::endl; + break; + } + } } - case wkbLineString25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; - } - case wkbPolygon: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; - } - case wkbPolygon25D: - { - typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); - newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); - multiPtr->AddChild(newNode); - break; - } - default: + break; + } + case wkbGeometryCollection25D: + { + DataNodePointerType multi = DataNodeType::New(); + multi->SetNodeType(FEATURE_COLLECTION); + + multiPtr = InternalTreeNodeType::New(); + multiPtr->Set(multi); + folderPtr->AddChild(multiPtr); + + OGRGeometryCollection * ogrMulti = (OGRGeometryCollection *) geometry; + + for (int geoIndex = 0; geoIndex < ogrMulti->getNumGeometries(); ++geoIndex) { - std::cout << "Geometry type not found: " << ogrMulti->getGeometryRef(geoIndex)->getGeometryType() << - std::endl; - break; - } + switch (ogrMulti->getGeometryRef(geoIndex)->getGeometryType()) + { + case wkbPoint: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + case wkbPoint25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPointNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + case wkbLineString: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + case wkbLineString25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToLineNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + case wkbPolygon: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + case wkbPolygon25D: + { + typename InternalTreeNodeType::Pointer newNode = InternalTreeNodeType::New(); + newNode->Set(ConvertGeometryToPolygonNode(ogrMulti->getGeometryRef(geoIndex))); + multiPtr->AddChild(newNode); + break; + } + default: + { + std::cout << "Geometry type not found: " << ogrMulti->getGeometryRef(geoIndex)->getGeometryType() << + std::endl; + break; + } + } } + break; + } + default: + { + std::cout << "Geometry not handled: " << geometry->getGeometryName() << std::endl; + break; } - break; - } - default: - { - std::cout << "Geometry not handled: " << geometry->getGeometryName() << std::endl; - break; - } } } @@ -619,143 +619,117 @@ unsigned int OGRIOHelper<TVectorData> ++m_Kept; switch (dataNode->GetNodeType()) { - case ROOT: - { - break; - } - case DOCUMENT: - { - ogrCurrentLayer = m_DataSource->CreateLayer(dataNode->GetNodeId(), oSRS, wkbUnknown, NULL); - if (ogrCurrentLayer == NULL) + case ROOT: { - //itkExceptionMacro(<<"Failed to create layer "<<dataNode->GetNodeId()); - std::cout << "Failed to create layer " << dataNode->GetNodeId() << std::endl; + break; } - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } - case FOLDER: - { - - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } - case FEATURE_POINT: - { - //Build the ogrObject - OGRPoint ogrPoint; - ogrPoint.setX(dataNode->GetPoint()[0]); - ogrPoint.setY(dataNode->GetPoint()[1]); - - if (DataNodeType::Dimension > 2) + case DOCUMENT: { - ogrPoint.setZ(dataNode->GetPoint()[2]); + ogrCurrentLayer = m_DataSource->CreateLayer(dataNode->GetNodeId(), oSRS, wkbUnknown, NULL); + if (ogrCurrentLayer == NULL) + { + //itkExceptionMacro(<<"Failed to create layer "<<dataNode->GetNodeId()); + std::cout << "Failed to create layer " << dataNode->GetNodeId() << std::endl; + } + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; } - - //Save it in the structure - if (ogrCollection == NULL) + case FOLDER: { - OGRFeature *ogrFeature; - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->SetGeometry(&ogrPoint); + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; + } + case FEATURE_POINT: + { + //Build the ogrObject + OGRPoint ogrPoint; + ogrPoint.setX(dataNode->GetPoint()[0]); + ogrPoint.setY(dataNode->GetPoint()[1]); - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + if (DataNodeType::Dimension > 2) { - itkExceptionMacro(<< "Failed to create feature in shapefile."); -// std::cout << "Failed to create feature in shapefile." + ogrPoint.setZ(dataNode->GetPoint()[2]); } - OGRFeature::DestroyFeature(ogrFeature); - } - else - { - ogrCollection->addGeometry(&ogrPoint); - } + //Save it in the structure + if (ogrCollection == NULL) + { + OGRFeature *ogrFeature; - break; - } - case FEATURE_LINE: - { - //Build the ogrObject - OGRLineString ogrLine; - VertexListConstPointerType vertexList = dataNode->GetLine()->GetVertexList(); + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->SetGeometry(&ogrPoint); - typename VertexListType::ConstIterator vIt = vertexList->Begin(); + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); +// std::cout << "Failed to create feature in shapefile." + } - while (vIt != vertexList->End()) - { - OGRPoint ogrPoint; - ogrPoint.setX(vIt.Value()[0]); - ogrPoint.setY(vIt.Value()[1]); - if (DataNodeType::Dimension > 2) + OGRFeature::DestroyFeature(ogrFeature); + } + else { - ogrPoint.setZ(vIt.Value()[2]); + ogrCollection->addGeometry(&ogrPoint); } - ogrLine.addPoint(&ogrPoint); - ++vIt; - } - //Save it in the structure - if (ogrCollection == NULL) + break; + } + case FEATURE_LINE: { - OGRFeature *ogrFeature; + //Build the ogrObject + OGRLineString ogrLine; + VertexListConstPointerType vertexList = dataNode->GetLine()->GetVertexList(); - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->SetGeometry(&ogrLine); + typename VertexListType::ConstIterator vIt = vertexList->Begin(); - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + while (vIt != vertexList->End()) { - itkExceptionMacro(<< "Failed to create feature in shapefile."); + OGRPoint ogrPoint; + ogrPoint.setX(vIt.Value()[0]); + ogrPoint.setY(vIt.Value()[1]); + if (DataNodeType::Dimension > 2) + { + ogrPoint.setZ(vIt.Value()[2]); + } + ogrLine.addPoint(&ogrPoint); + ++vIt; } - OGRFeature::DestroyFeature(ogrFeature); + //Save it in the structure + if (ogrCollection == NULL) + { + OGRFeature *ogrFeature; - } - else - { - ogrCollection->addGeometry(&ogrLine); - } + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->SetGeometry(&ogrLine); - break; - } - case FEATURE_POLYGON: - { - - //Build the ogrObject - OGRPolygon * ogrPolygon = (OGRPolygon *)OGRGeometryFactory::createGeometry(wkbPolygon); - OGRLinearRing * ogrExternalRing = (OGRLinearRing *)OGRGeometryFactory::createGeometry(wkbLinearRing); - VertexListConstPointerType vertexList = dataNode->GetPolygonExteriorRing()->GetVertexList(); + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); + } - typename VertexListType::ConstIterator vIt = vertexList->Begin(); + OGRFeature::DestroyFeature(ogrFeature); - while (vIt != vertexList->End()) - { - OGRPoint ogrPoint; - ogrPoint.setX(vIt.Value()[0]); - ogrPoint.setY(vIt.Value()[1]); - if (DataNodeType::Dimension > 2) + } + else { - ogrPoint.setZ(vIt.Value()[2]); + ogrCollection->addGeometry(&ogrLine); } - ogrExternalRing->addPoint(&ogrPoint); - ++vIt; + break; } - ogrPolygon->addRing(ogrExternalRing); - // Close the polygon - ogrPolygon->closeRings(); - OGRGeometryFactory::destroyGeometry(ogrExternalRing); - - // Retrieving internal rings as well - for (typename PolygonListType::Iterator pIt = dataNode->GetPolygonInteriorRings()->Begin(); - pIt != dataNode->GetPolygonInteriorRings()->End(); ++pIt) + case FEATURE_POLYGON: { - OGRLinearRing * ogrInternalRing = (OGRLinearRing *)OGRGeometryFactory::createGeometry(wkbLinearRing); - vertexList = pIt.Get()->GetVertexList(); - vIt = vertexList->Begin(); + + //Build the ogrObject + OGRPolygon * ogrPolygon = (OGRPolygon *) OGRGeometryFactory::createGeometry(wkbPolygon); + OGRLinearRing * ogrExternalRing = (OGRLinearRing *) OGRGeometryFactory::createGeometry(wkbLinearRing); + VertexListConstPointerType vertexList = dataNode->GetPolygonExteriorRing()->GetVertexList(); + + typename VertexListType::ConstIterator vIt = vertexList->Begin(); while (vIt != vertexList->End()) { @@ -766,139 +740,166 @@ unsigned int OGRIOHelper<TVectorData> { ogrPoint.setZ(vIt.Value()[2]); } - ogrInternalRing->addPoint(&ogrPoint); + + ogrExternalRing->addPoint(&ogrPoint); ++vIt; } - ogrPolygon->addRing(ogrInternalRing); - OGRGeometryFactory::destroyGeometry(ogrInternalRing); - } + ogrPolygon->addRing(ogrExternalRing); + // Close the polygon + ogrPolygon->closeRings(); + OGRGeometryFactory::destroyGeometry(ogrExternalRing); + + // Retrieving internal rings as well + for (typename PolygonListType::Iterator pIt = dataNode->GetPolygonInteriorRings()->Begin(); + pIt != dataNode->GetPolygonInteriorRings()->End(); ++pIt) + { + OGRLinearRing * ogrInternalRing = (OGRLinearRing *) OGRGeometryFactory::createGeometry(wkbLinearRing); + vertexList = pIt.Get()->GetVertexList(); + vIt = vertexList->Begin(); + + while (vIt != vertexList->End()) + { + OGRPoint ogrPoint; + ogrPoint.setX(vIt.Value()[0]); + ogrPoint.setY(vIt.Value()[1]); + if (DataNodeType::Dimension > 2) + { + ogrPoint.setZ(vIt.Value()[2]); + } + ogrInternalRing->addPoint(&ogrPoint); + ++vIt; + } + ogrPolygon->addRing(ogrInternalRing); + OGRGeometryFactory::destroyGeometry(ogrInternalRing); + } + + //Save it in the structure + if (ogrCollection == NULL) + { + OGRFeature *ogrFeature; - //Save it in the structure - if (ogrCollection == NULL) + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->SetGeometry(ogrPolygon); + + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); + } + + OGRFeature::DestroyFeature(ogrFeature); + + } + else + { + ogrCollection->addGeometry(ogrPolygon); + } + + OGRGeometryFactory::destroyGeometry(ogrPolygon); + break; + } + case FEATURE_MULTIPOINT: { - OGRFeature *ogrFeature; + if (ogrCollection != NULL) + { + itkExceptionMacro(<< "Problem while creating multipoint."); + } + + OGRMultiPoint* ogrMultiPoint = (OGRMultiPoint*) OGRGeometryFactory::createGeometry(wkbMultiPoint); + OGRFeature * ogrFeature; ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->SetGeometry(ogrPolygon); + ogrFeature->GetDefnRef()->SetGeomType(wkbMultiPoint); + ogrFeature->SetGeometry(ogrMultiPoint); if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) { itkExceptionMacro(<< "Failed to create feature in shapefile."); } - OGRFeature::DestroyFeature(ogrFeature); - + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; } - else + case FEATURE_MULTILINE: { - ogrCollection->addGeometry(ogrPolygon); - } + if (ogrCollection != NULL) + { + itkExceptionMacro(<< "Problem while creating multiline."); + } - OGRGeometryFactory::destroyGeometry(ogrPolygon); - break; - } - case FEATURE_MULTIPOINT: - { - if (ogrCollection != NULL) - { - itkExceptionMacro(<< "Problem while creating multipoint."); - } - - OGRMultiPoint* ogrMultiPoint= (OGRMultiPoint* )OGRGeometryFactory::createGeometry(wkbMultiPoint); - OGRFeature *ogrFeature; + // Instanciate a new ogrMultiLineString feature + OGRMultiLineString* ogrMultiLineString = (OGRMultiLineString*) OGRGeometryFactory::createGeometry( + wkbMultiLineString); - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->GetDefnRef()->SetGeomType(wkbMultiPoint); - ogrFeature->SetGeometry(ogrMultiPoint); + OGRFeature *ogrFeature; - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) - { - itkExceptionMacro(<< "Failed to create feature in shapefile."); - } + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->GetDefnRef()->SetGeomType(wkbMultiLineString); + ogrFeature->SetGeometry(ogrMultiLineString); - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } - case FEATURE_MULTILINE: - { - if (ogrCollection != NULL) - { - itkExceptionMacro(<< "Problem while creating multiline."); + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); + } + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; } + case FEATURE_MULTIPOLYGON: + { + if (ogrCollection != NULL) + { + itkExceptionMacro(<< "Problem while creating multipolygon."); + } - // Instanciate a new ogrMultiLineString feature - OGRMultiLineString* ogrMultiLineString= (OGRMultiLineString* )OGRGeometryFactory::createGeometry(wkbMultiLineString); - - OGRFeature *ogrFeature; + // Instanciate a new multipolygon feature + OGRMultiPolygon* ogrMultiPolygon = (OGRMultiPolygon*) OGRGeometryFactory::createGeometry(wkbMultiPolygon); + OGRFeature * ogrFeature; - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->GetDefnRef()->SetGeomType(wkbMultiLineString); - ogrFeature->SetGeometry(ogrMultiLineString); + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->GetDefnRef()->SetGeomType(wkbMultiPolygon); + ogrFeature->SetGeometry(ogrMultiPolygon); - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) - { - itkExceptionMacro(<< "Failed to create feature in shapefile."); + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); + } + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; } - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } - case FEATURE_MULTIPOLYGON: - { - if (ogrCollection != NULL) + case FEATURE_COLLECTION: { - itkExceptionMacro(<< "Problem while creating multipolygon."); - } - - // Instanciate a new multipolygon feature - OGRMultiPolygon* ogrMultiPolygon= (OGRMultiPolygon* )OGRGeometryFactory::createGeometry(wkbMultiPolygon); - OGRFeature *ogrFeature; + if (ogrCollection != NULL) + { + itkExceptionMacro(<< "Problem while creating collection."); + } - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->GetDefnRef()->SetGeomType(wkbMultiPolygon); - ogrFeature->SetGeometry(ogrMultiPolygon); + OGRGeometryCollection* ogrCollectionGeometry = (OGRGeometryCollection*) OGRGeometryFactory::createGeometry( + wkbGeometryCollection); - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) - { - itkExceptionMacro(<< "Failed to create feature in shapefile."); - } - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } - case FEATURE_COLLECTION: - { - if (ogrCollection != NULL) - { - itkExceptionMacro(<< "Problem while creating collection."); - } + OGRFeature *ogrFeature; - OGRGeometryCollection* ogrCollectionGeometry = (OGRGeometryCollection* )OGRGeometryFactory::createGeometry(wkbGeometryCollection); - - OGRFeature *ogrFeature; + ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); + ogrFeature->SetField("Name", dataNode->GetNodeId()); + ogrFeature->GetDefnRef()->SetGeomType(wkbGeometryCollection); + ogrFeature->SetGeometry(ogrCollectionGeometry); - ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); - ogrFeature->SetField("Name", dataNode->GetNodeId()); - ogrFeature->GetDefnRef()->SetGeomType(wkbGeometryCollection); - ogrFeature->SetGeometry(ogrCollectionGeometry); + if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) + { + itkExceptionMacro(<< "Failed to create feature in shapefile."); + } - if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE) - { - itkExceptionMacro(<< "Failed to create feature in shapefile."); + ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); + break; } - - ProcessNodeWrite(*it, m_DataSource, ogrCollection, ogrCurrentLayer, oSRS); - break; - } } } return m_Kept; } - } // end namespace otb #endif diff --git a/Code/IO/otbQuickBirdImageMetadataInterface.cxx b/Code/IO/otbQuickBirdImageMetadataInterface.cxx index 4f7de4e810..97c69273d3 100644 --- a/Code/IO/otbQuickBirdImageMetadataInterface.cxx +++ b/Code/IO/otbQuickBirdImageMetadataInterface.cxx @@ -449,10 +449,11 @@ QuickBirdImageMetadataInterface { itkExceptionMacro(<< "Invalid bandID " << keywordStringBId); } - + ossimString keywordStringTDILevel = kwl.find("support_data.TDI_level"); int TDILevel = keywordStringTDILevel.toInt(); - if (keywordStringBId == ossimString("P") && TDILevel != 10 && TDILevel != 13 && TDILevel != 18 && TDILevel != 24 && TDILevel != 32) + if (keywordStringBId == ossimString("P") && TDILevel != 10 && TDILevel != 13 && TDILevel != 18 && TDILevel != 24 && + TDILevel != 32) { itkExceptionMacro(<< "Invalid TDILevel " << TDILevel); } @@ -685,24 +686,24 @@ QuickBirdImageMetadataInterface return wavel; } -unsigned int +unsigned int QuickBirdImageMetadataInterface ::GetDefaultRBand() const -{ +{ return 2; } -unsigned int +unsigned int QuickBirdImageMetadataInterface ::GetDefaultGBand() const -{ +{ return 1; } -unsigned int +unsigned int QuickBirdImageMetadataInterface ::GetDefaultBBand() const -{ +{ return 0; } diff --git a/Code/IO/otbQuickBirdImageMetadataInterface.h b/Code/IO/otbQuickBirdImageMetadataInterface.h index 4852df9dbc..a422dd7c1c 100644 --- a/Code/IO/otbQuickBirdImageMetadataInterface.h +++ b/Code/IO/otbQuickBirdImageMetadataInterface.h @@ -100,7 +100,7 @@ public: bool CanRead(const MetaDataDictionaryType& dict) const; /** Those methodes are to retrieve the spectral band corresponding - * to the R, G, B or A chanel */ + * to the R, G, B or A chanel */ unsigned int GetDefaultRBand() const; unsigned int GetDefaultGBand() const; diff --git a/Code/IO/otbSpotImageMetadataInterface.cxx b/Code/IO/otbSpotImageMetadataInterface.cxx index d1dbc5d52d..5358c1f52b 100644 --- a/Code/IO/otbSpotImageMetadataInterface.cxx +++ b/Code/IO/otbSpotImageMetadataInterface.cxx @@ -686,24 +686,24 @@ SpotImageMetadataInterface return i; } -unsigned int +unsigned int SpotImageMetadataInterface ::GetDefaultRBand() const -{ +{ return 0; } -unsigned int +unsigned int SpotImageMetadataInterface ::GetDefaultGBand() const -{ +{ return 1; } -unsigned int +unsigned int SpotImageMetadataInterface ::GetDefaultBBand() const -{ +{ return 2; } diff --git a/Code/IO/otbSpotImageMetadataInterface.h b/Code/IO/otbSpotImageMetadataInterface.h index 0a54f533fc..f944b7ebcc 100644 --- a/Code/IO/otbSpotImageMetadataInterface.h +++ b/Code/IO/otbSpotImageMetadataInterface.h @@ -110,7 +110,7 @@ public: virtual unsigned int BandIndexToWavelengthPosition(unsigned int i) const; /** Those methodes are to retrieve the spectral band corresponding - * to the R, G, B or A chanel */ + * to the R, G, B or A chanel */ unsigned int GetDefaultRBand() const; unsigned int GetDefaultGBand() const; diff --git a/Code/IO/otbThreads.h b/Code/IO/otbThreads.h index 6fac447a53..2263145c9b 100644 --- a/Code/IO/otbThreads.h +++ b/Code/IO/otbThreads.h @@ -24,7 +24,7 @@ namespace otb /** \class Threads * \brief Operation from open threads that are used in Monteverdi * - * Implement the sleep operation from openthreads to remove Monteverdi + * Implement the sleep operation from openthreads to remove Monteverdi * dependance to openthreads at compile time. * */ diff --git a/Code/IO/otbTileMapImageIO.cxx b/Code/IO/otbTileMapImageIO.cxx index 718d15ee9a..a7eb778898 100644 --- a/Code/IO/otbTileMapImageIO.cxx +++ b/Code/IO/otbTileMapImageIO.cxx @@ -40,7 +40,6 @@ #include "itkTimeProbe.h" #include "otbCurlHelper.h" - namespace otb { @@ -152,7 +151,6 @@ void TileMapImageIO::Read(void* buffer) int nTilesX = (int) ceil(totSamples / 256.) + 1; int nTilesY = (int) ceil(totLines / 256.) + 1; - // Clear vectors m_ListFilename.clear(); m_ListURLs.clear(); @@ -311,7 +309,6 @@ void TileMapImageIO::GenerateBuffer(unsigned char *p) for (unsigned int currentTile = 0; currentTile < m_ListTiles.size(); currentTile++) { - // Read tile from cache this->ReadTile(m_ListTiles[currentTile].filename, bufferTile); @@ -456,20 +453,20 @@ void TileMapImageIO::ReadImageInformation() std::getline(file, mode); switch (atoi(mode.c_str())) { - case 0: - m_AddressMode = TileMapAdressingStyle::GM; - return; - case 1: - m_AddressMode = TileMapAdressingStyle::OSM; - return; - case 2: - m_AddressMode = TileMapAdressingStyle::NEARMAP; - return; - case 3: - m_AddressMode = TileMapAdressingStyle::LOCAL; - return; - default: - itkExceptionMacro(<< "Addressing style unknown"); + case 0: + m_AddressMode = TileMapAdressingStyle::GM; + return; + case 1: + m_AddressMode = TileMapAdressingStyle::OSM; + return; + case 2: + m_AddressMode = TileMapAdressingStyle::NEARMAP; + return; + case 3: + m_AddressMode = TileMapAdressingStyle::LOCAL; + return; + default: + itkExceptionMacro(<< "Addressing style unknown"); } otbMsgDevMacro(<< "File parameters: " << m_ServerName << " " << m_FileSuffix << " " << m_AddressMode); @@ -722,18 +719,18 @@ int TileMapImageIO::XYToQuadTree(double x, double y, std::ostringstream& quad) c switch (quad_index) { - case 0: - quad << "q"; - break; - case 1: - quad << "r"; - break; - case 2: - quad << "t"; - break; - case 3: - quad << "s"; - break; + case 0: + quad << "q"; + break; + case 1: + quad << "r"; + break; + case 2: + quad << "t"; + break; + case 3: + quad << "s"; + break; } // level down x *= 2; @@ -756,18 +753,18 @@ int TileMapImageIO::XYToQuadTree2(double x, double y, std::ostringstream& quad) switch (quad_index) { - case 0: - quad << "0"; - break; - case 1: - quad << "1"; - break; - case 2: - quad << "2"; - break; - case 3: - quad << "3"; - break; + case 0: + quad << "0"; + break; + case 1: + quad << "1"; + break; + case 2: + quad << "2"; + break; + case 3: + quad << "3"; + break; } // level down x *= 2; @@ -776,7 +773,7 @@ int TileMapImageIO::XYToQuadTree2(double x, double y, std::ostringstream& quad) return 0; } - + unsigned int TileMapImageIO::GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits, const ImageIORegion& pasteRegion) const diff --git a/Code/IO/otbTileMapImageIO.h b/Code/IO/otbTileMapImageIO.h index 5dca3ed872..32b413e7c3 100644 --- a/Code/IO/otbTileMapImageIO.h +++ b/Code/IO/otbTileMapImageIO.h @@ -183,7 +183,7 @@ private: void FillCacheFaults(void* buffer) const; int XYToQuadTree(double x, double y, std::ostringstream& quad) const; int XYToQuadTree2(double x, double y, std::ostringstream& quad) const; - + /** CURL Multi */ void GenerateTileInfo(double x, double y, int numTileX, int numTileY); bool CanReadFromCache(std::string filename); diff --git a/Code/IO/otbVectorDataIOBase.txx b/Code/IO/otbVectorDataIOBase.txx index 2640057dab..e99470b03a 100644 --- a/Code/IO/otbVectorDataIOBase.txx +++ b/Code/IO/otbVectorDataIOBase.txx @@ -56,13 +56,13 @@ VectorDataIOBase<TData> std::string s; switch (t) { - case BigEndian: - return s = "BigEndian"; - case LittleEndian: - return s = "LittleEndian"; - case OrderNotApplicable: - default: - return s = "OrderNotApplicable"; + case BigEndian: + return s = "BigEndian"; + case LittleEndian: + return s = "LittleEndian"; + case OrderNotApplicable: + default: + return s = "OrderNotApplicable"; } return s = "OrderNotApplicable"; } diff --git a/Code/IO/otbVectorDataKeywordlist.cxx b/Code/IO/otbVectorDataKeywordlist.cxx index 8986b779e0..1de251bf49 100644 --- a/Code/IO/otbVectorDataKeywordlist.cxx +++ b/Code/IO/otbVectorDataKeywordlist.cxx @@ -97,7 +97,9 @@ VectorDataKeywordlist ss << std::setprecision(15) << m_FieldList[i].second.Real; return ss.str(); } - itkExceptionMacro(<< "This type (" << m_FieldList[i].first->GetType() << ") is not handled (yet) by GetFieldAsString(), please request for it"); + itkExceptionMacro( + << "This type (" << m_FieldList[i].first->GetType() << + ") is not handled (yet) by GetFieldAsString(), please request for it"); } } return ""; @@ -217,70 +219,70 @@ VectorDataKeywordlist output << field.first->GetFieldTypeName(field.first->GetType()) << "): "; switch (field.first->GetType()) { - case OFTInteger: - { - output << field.second.Integer; - break; - } - case OFTIntegerList: - { - output << "Type not handled for printing"; - break; - } - case OFTReal: - { - output << field.second.Real; - break; - } - case OFTRealList: - { - output << "Type not handled for printing"; - break; - } - case OFTString: - { - if (field.second.String != NULL) + case OFTInteger: { - output << field.second.String; + output << field.second.Integer; + break; + } + case OFTIntegerList: + { + output << "Type not handled for printing"; + break; + } + case OFTReal: + { + output << field.second.Real; + break; + } + case OFTRealList: + { + output << "Type not handled for printing"; + break; + } + case OFTString: + { + if (field.second.String != NULL) + { + output << field.second.String; + } + break; + } + case OFTStringList: + { + output << "Type not handled for printing"; + break; + } + case OFTWideString: + { + output << "Type not handled for printing"; + break; + } + case OFTWideStringList: + { + output << "Type not handled for printing"; + break; + } + case OFTBinary: + { + output << "Type not handled for printing"; + break; + } + case OFTDate: + { + output << field.second.Date.Year << field.second.Date.Month << field.second.Date.Day; + break; + } + case OFTTime: + { + output << field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second; + break; + } + case OFTDateTime: + { + output << field.second.Date.Year << field.second.Date.Month << field.second.Date.Day << "-" + << field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second; + break; } - break; - } - case OFTStringList: - { - output << "Type not handled for printing"; - break; - } - case OFTWideString: - { - output << "Type not handled for printing"; - break; - } - case OFTWideStringList: - { - output << "Type not handled for printing"; - break; - } - case OFTBinary: - { - output << "Type not handled for printing"; - break; - } - case OFTDate: - { - output << field.second.Date.Year << field.second.Date.Month << field.second.Date.Day; - break; - } - case OFTTime: - { - output << field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second; - break; - } - case OFTDateTime: - { - output << field.second.Date.Year << field.second.Date.Month << field.second.Date.Day << "-" - << field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second; - break; - } } output << std::endl; return output.str(); @@ -294,79 +296,79 @@ VectorDataKeywordlist outField.first = new OGRFieldDefn(field.first); switch (field.first->GetType()) { - case OFTInteger: - { - outField.second.Integer = field.second.Integer; - break; - } - case OFTIntegerList: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTReal: - { - outField.second.Real = field.second.Real; - break; - } - case OFTRealList: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTString: - { - if (field.second.String != NULL) + case OFTInteger: { - CPLFree(outField.second.String); - outField.second.String = CPLStrdup(field.second.String); + outField.second.Integer = field.second.Integer; + break; + } + case OFTIntegerList: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTReal: + { + outField.second.Real = field.second.Real; + break; + } + case OFTRealList: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTString: + { + if (field.second.String != NULL) + { + CPLFree(outField.second.String); + outField.second.String = CPLStrdup(field.second.String); + } + break; + } + case OFTStringList: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTWideString: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTWideStringList: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTBinary: + { + std::cerr << "OGR type not handled" << std::endl; + break; + } + case OFTDate: + { + outField.second.Date.Year = field.second.Date.Year; + outField.second.Date.Month = field.second.Date.Month; + outField.second.Date.Day = field.second.Date.Day; + break; + } + case OFTTime: + { + outField.second.Date.Hour = field.second.Date.Hour; + outField.second.Date.Minute = field.second.Date.Minute; + outField.second.Date.Second = field.second.Date.Second; + break; + } + case OFTDateTime: + { + outField.second.Date.Year = field.second.Date.Year; + outField.second.Date.Month = field.second.Date.Month; + outField.second.Date.Day = field.second.Date.Day; + outField.second.Date.Hour = field.second.Date.Hour; + outField.second.Date.Minute = field.second.Date.Minute; + outField.second.Date.Second = field.second.Date.Second; + break; } - break; - } - case OFTStringList: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTWideString: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTWideStringList: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTBinary: - { - std::cerr << "OGR type not handled" << std::endl; - break; - } - case OFTDate: - { - outField.second.Date.Year = field.second.Date.Year; - outField.second.Date.Month = field.second.Date.Month; - outField.second.Date.Day = field.second.Date.Day; - break; - } - case OFTTime: - { - outField.second.Date.Hour = field.second.Date.Hour; - outField.second.Date.Minute = field.second.Date.Minute; - outField.second.Date.Second = field.second.Date.Second; - break; - } - case OFTDateTime: - { - outField.second.Date.Year = field.second.Date.Year; - outField.second.Date.Month = field.second.Date.Month; - outField.second.Date.Day = field.second.Date.Day; - outField.second.Date.Hour = field.second.Date.Hour; - outField.second.Date.Minute = field.second.Date.Minute; - outField.second.Date.Second = field.second.Date.Second; - break; - } } return outField; } diff --git a/Code/IO/otbVectorImage.h b/Code/IO/otbVectorImage.h index 755e28555c..69a87b6908 100644 --- a/Code/IO/otbVectorImage.h +++ b/Code/IO/otbVectorImage.h @@ -79,7 +79,7 @@ public: /** Tyepdef for the functor used to access a neighborhood of pixel pointers.*/ typedef itk::VectorImageNeighborhoodAccessorFunctor< - Self> NeighborhoodAccessorFunctorType; + Self> NeighborhoodAccessorFunctorType; /** Dimension of the image. This constant is used by functions that are * templated over image type (as opposed to being templated over pixel type diff --git a/Code/IO/otbWorldView2ImageMetadataInterface.cxx b/Code/IO/otbWorldView2ImageMetadataInterface.cxx index 39622010b9..165e25171a 100644 --- a/Code/IO/otbWorldView2ImageMetadataInterface.cxx +++ b/Code/IO/otbWorldView2ImageMetadataInterface.cxx @@ -244,9 +244,9 @@ WorldView2ImageMetadataInterface::GetMinute(const MetaDataDictionaryType& dict) ossimString keywordString = kwl.find(key.c_str()); if (keywordString == ossimString("Unknown")) - { - itkExceptionMacro("Unknown date") - } + { + itkExceptionMacro("Unknown date") + } std::vector<ossimString> keywordStrings = keywordString.split(separatorList); @@ -413,7 +413,7 @@ WorldView2ImageMetadataInterface ossimString keywordStringBitsPerPixel = kwl.find("support_data.bits_per_pixel"); int bitsPerPixel = keywordStringBitsPerPixel.toInt(); - if (bitsPerPixel != 16 ) + if (bitsPerPixel != 16) { itkExceptionMacro(<< "Invalid bitsPerPixel " << bitsPerPixel); } @@ -424,10 +424,10 @@ WorldView2ImageMetadataInterface { itkExceptionMacro(<< "Invalid bandID " << keywordStringBId); } - + ossimString keywordStringTDILevel = kwl.find("support_data.TDI_level"); int TDILevel = keywordStringTDILevel.toInt(); - if (keywordStringBId == ossimString("P") && TDILevel != 24 ) + if (keywordStringBId == ossimString("P") && TDILevel != 24) { itkExceptionMacro(<< "Invalid TDILevel " << TDILevel); } @@ -438,23 +438,22 @@ WorldView2ImageMetadataInterface outputValuesVariableLengthVector.Fill(1.); if (keywordStringBId == ossimString("P")) - { - ossimString keywordStringAbsCalFactor = kwl.find("support_data.absCalFactor"); - outputValuesVariableLengthVector[0] = keywordStringAbsCalFactor.toDouble(); - } - else - { + { + ossimString keywordStringAbsCalFactor = kwl.find("support_data.absCalFactor"); + outputValuesVariableLengthVector[0] = keywordStringAbsCalFactor.toDouble(); + } + else + { // ossimString keywordStringAbsCalFactor = kwl.find("support_data.B_band_absCalFactor"); - ossimString keywordStringAbsCalFactor = kwl.find("band_C.abscalfactor"); - outputValuesVariableLengthVector[0] = keywordStringAbsCalFactor.toDouble(); - keywordStringAbsCalFactor = kwl.find("support_data.G_band_absCalFactor"); - outputValuesVariableLengthVector[1] = keywordStringAbsCalFactor.toDouble(); - keywordStringAbsCalFactor = kwl.find("support_data.N_band_absCalFactor"); - outputValuesVariableLengthVector[2] = keywordStringAbsCalFactor.toDouble(); - keywordStringAbsCalFactor = kwl.find("support_data.R_band_absCalFactor"); - outputValuesVariableLengthVector[3] = keywordStringAbsCalFactor.toDouble(); - } - + ossimString keywordStringAbsCalFactor = kwl.find("band_C.abscalfactor"); + outputValuesVariableLengthVector[0] = keywordStringAbsCalFactor.toDouble(); + keywordStringAbsCalFactor = kwl.find("support_data.G_band_absCalFactor"); + outputValuesVariableLengthVector[1] = keywordStringAbsCalFactor.toDouble(); + keywordStringAbsCalFactor = kwl.find("support_data.N_band_absCalFactor"); + outputValuesVariableLengthVector[2] = keywordStringAbsCalFactor.toDouble(); + keywordStringAbsCalFactor = kwl.find("support_data.R_band_absCalFactor"); + outputValuesVariableLengthVector[3] = keywordStringAbsCalFactor.toDouble(); + } /* PIO : To be confirmed !!! if (keywordStringBId == ossimString("P")) @@ -612,24 +611,24 @@ WorldView2ImageMetadataInterface return wavel; } -unsigned int +unsigned int WorldView2ImageMetadataInterface ::GetDefaultRBand() const -{ +{ return 2; } -unsigned int +unsigned int WorldView2ImageMetadataInterface ::GetDefaultGBand() const -{ +{ return 1; } -unsigned int +unsigned int WorldView2ImageMetadataInterface ::GetDefaultBBand() const -{ +{ return 0; } diff --git a/Code/IO/otbWorldView2ImageMetadataInterface.h b/Code/IO/otbWorldView2ImageMetadataInterface.h index 4bf0c7f67b..fd31dc3cc9 100644 --- a/Code/IO/otbWorldView2ImageMetadataInterface.h +++ b/Code/IO/otbWorldView2ImageMetadataInterface.h @@ -36,9 +36,9 @@ class ITK_EXPORT WorldView2ImageMetadataInterface : public ImageMetadataInterfac public: typedef WorldView2ImageMetadataInterface Self; - typedef ImageMetadataInterfaceBase Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef ImageMetadataInterfaceBase Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); @@ -97,11 +97,10 @@ public: /** Get the last wavelength for the spectral band definition */ VariableLengthVectorType GetLastWavelengths(const MetaDataDictionaryType& dict) const; - bool CanRead(const MetaDataDictionaryType& dict) const; /** Those methodes are to retrieve the spectral band corresponding - * to the R, G, B or A chanel */ + * to the R, G, B or A chanel */ unsigned int GetDefaultRBand() const; unsigned int GetDefaultGBand() const; diff --git a/Code/IO/otbWorldView2ImageMetadataInterfaceFactory.h b/Code/IO/otbWorldView2ImageMetadataInterfaceFactory.h index d31d000627..001a95b469 100644 --- a/Code/IO/otbWorldView2ImageMetadataInterfaceFactory.h +++ b/Code/IO/otbWorldView2ImageMetadataInterfaceFactory.h @@ -34,9 +34,9 @@ class ITK_EXPORT WorldView2ImageMetadataInterfaceFactory : public itk::ObjectFac public: /** Standard class typedefs. */ typedef WorldView2ImageMetadataInterfaceFactory Self; - typedef itk::ObjectFactoryBase Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef itk::ObjectFactoryBase Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Class methods used to interface with the registered factories. */ virtual const char* GetITKSourceVersion(void) const; @@ -51,7 +51,8 @@ public: /** Register one factory of this type */ static void RegisterOneFactory(void) { - WorldView2ImageMetadataInterfaceFactory::Pointer worldView2IMIFactory = WorldView2ImageMetadataInterfaceFactory::New(); + WorldView2ImageMetadataInterfaceFactory::Pointer worldView2IMIFactory = + WorldView2ImageMetadataInterfaceFactory::New(); itk::ObjectFactoryBase::RegisterFactory(worldView2IMIFactory); } diff --git a/Code/Learning/otbConfusionMatrixCalculator.h b/Code/Learning/otbConfusionMatrixCalculator.h index e881b0b07a..b0d8842919 100644 --- a/Code/Learning/otbConfusionMatrixCalculator.h +++ b/Code/Learning/otbConfusionMatrixCalculator.h @@ -32,7 +32,7 @@ namespace otb * \brief TODO * */ -template < class TRefListLabel, class TProdListLabel > +template <class TRefListLabel, class TProdListLabel> class ITK_EXPORT ConfusionMatrixCalculator : public itk::ProcessObject { @@ -40,29 +40,29 @@ public: /** Standard class typedefs */ typedef ConfusionMatrixCalculator Self; typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; - + /** Run-time type information (and related methods). */ itkTypeMacro(ConfusionMatrixCalculator, itk::ProcessObject); - + /** Method for creation through the object factory. */ itkNewMacro(Self); /** List to store the corresponding labels */ - typedef TRefListLabel RefListLabelType; - typedef typename RefListLabelType::Pointer RefListLabelPointerType; + typedef TRefListLabel RefListLabelType; + typedef typename RefListLabelType::Pointer RefListLabelPointerType; - typedef TProdListLabel ProdListLabelType; - typedef typename ProdListLabelType::Pointer ProdListLabelPointerType; + typedef TProdListLabel ProdListLabelType; + typedef typename ProdListLabelType::Pointer ProdListLabelPointerType; - typedef int ClassLabelType; + typedef int ClassLabelType; /** Type for the confusion matrix */ - typedef itk::VariableSizeMatrix<double> ConfusionMatrixType; - + typedef itk::VariableSizeMatrix<double> ConfusionMatrixType; + virtual void Update(); - + /** Accessors */ itkSetObjectMacro(ReferenceLabels, RefListLabelType); @@ -74,7 +74,7 @@ public: itkGetMacro(NumberOfClasses, unsigned short); itkGetMacro(NumberOfSamples, unsigned long); itkGetMacro(ConfusionMatrix, ConfusionMatrixType); - + std::map<ClassLabelType, int> GetMapOfClasses() const { return m_MapOfClasses; @@ -83,31 +83,31 @@ public: protected: ConfusionMatrixCalculator(); virtual ~ConfusionMatrixCalculator() {} - void PrintSelf(std::ostream& os, itk::Indent indent) const; - + void PrintSelf(std::ostream& os, itk::Indent indent) const; + /** Triggers the computation of the confusion matrix */ - void GenerateData( void ); - + void GenerateData(void); + private: - ConfusionMatrixCalculator(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - - double m_KappaIndex; - double m_OverallAccuracy; + ConfusionMatrixCalculator(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + + double m_KappaIndex; + double m_OverallAccuracy; std::map<ClassLabelType, int> m_MapOfClasses; - unsigned short m_NumberOfClasses; - unsigned long m_NumberOfSamples; + unsigned short m_NumberOfClasses; + unsigned long m_NumberOfSamples; - ConfusionMatrixType m_ConfusionMatrix; + ConfusionMatrixType m_ConfusionMatrix; + + RefListLabelPointerType m_ReferenceLabels; + ProdListLabelPointerType m_ProducedLabels; - RefListLabelPointerType m_ReferenceLabels; - ProdListLabelPointerType m_ProducedLabels; - }; -}// end of namespace otb - +} // end of namespace otb + #ifndef OTB_MANUAL_INSTANTIATION #include "otbConfusionMatrixCalculator.txx" #endif diff --git a/Code/Learning/otbConfusionMatrixCalculator.txx b/Code/Learning/otbConfusionMatrixCalculator.txx index 10859ef395..c46a533a87 100644 --- a/Code/Learning/otbConfusionMatrixCalculator.txx +++ b/Code/Learning/otbConfusionMatrixCalculator.txx @@ -24,55 +24,53 @@ namespace otb { template<class TRefListLabel, class TProdListLabel> -ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> +ConfusionMatrixCalculator<TRefListLabel, TProdListLabel> ::ConfusionMatrixCalculator() : m_KappaIndex(0.0), m_OverallAccuracy(0.0), m_NumberOfClasses(0) { this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredOutputs(1); - m_ConfusionMatrix = ConfusionMatrixType(m_NumberOfClasses,m_NumberOfClasses); + m_ConfusionMatrix = ConfusionMatrixType(m_NumberOfClasses, m_NumberOfClasses); m_ConfusionMatrix.Fill(0); m_ReferenceLabels = RefListLabelType::New(); m_ProducedLabels = ProdListLabelType::New(); } - -template < class TRefListLabel, class TProdListLabel > -void -ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> +template <class TRefListLabel, class TProdListLabel> +void +ConfusionMatrixCalculator<TRefListLabel, TProdListLabel> ::Update() { this->GenerateData(); } - -template < class TRefListLabel, class TProdListLabel > +template <class TRefListLabel, class TProdListLabel> void -ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> +ConfusionMatrixCalculator<TRefListLabel, TProdListLabel> ::GenerateData() { - + typename RefListLabelType::ConstIterator refIterator = m_ReferenceLabels->Begin(); - typename ProdListLabelType::ConstIterator prodIterator = m_ProducedLabels->Begin(); + typename ProdListLabelType::ConstIterator prodIterator = m_ProducedLabels->Begin(); //check that both lists have the same number of samples - if( m_ReferenceLabels->Size() != m_ProducedLabels->Size() ) + if (m_ReferenceLabels->Size() != m_ProducedLabels->Size()) { otbMsgDebugMacro(<< "refLabels size = " << m_ReferenceLabels->Size() << - " / proLabels size = " << m_ProducedLabels->Size()); - throw itk::ExceptionObject(__FILE__, __LINE__, "ListSample size missmatch", ITK_LOCATION); + " / proLabels size = " << m_ProducedLabels->Size()); + throw itk::ExceptionObject(__FILE__, __LINE__, "ListSample size missmatch", ITK_LOCATION); } m_NumberOfSamples = m_ReferenceLabels->Size(); - + // count the number of classes int countClasses = 0; - while( refIterator != m_ReferenceLabels->End() ) + while (refIterator != m_ReferenceLabels->End()) { int currentLabel = refIterator.GetMeasurementVector()[0]; - if(m_MapOfClasses.find(currentLabel) == m_MapOfClasses.end()) + if (m_MapOfClasses.find(currentLabel) == m_MapOfClasses.end()) { m_MapOfClasses[currentLabel] = countClasses; ++countClasses; @@ -83,9 +81,9 @@ ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> m_NumberOfClasses = countClasses; - std::vector< long int > samplesPerClass; + std::vector<long int> samplesPerClass; - for(unsigned int i=0; i<m_NumberOfClasses; i++) + for (unsigned int i = 0; i < m_NumberOfClasses; i++) samplesPerClass.push_back(0); m_ConfusionMatrix = ConfusionMatrixType(m_NumberOfClasses, m_NumberOfClasses); @@ -94,7 +92,7 @@ ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> refIterator = m_ReferenceLabels->Begin(); prodIterator = m_ProducedLabels->Begin(); - while( refIterator != m_ReferenceLabels->End() ) + while (refIterator != m_ReferenceLabels->End()) { int refLabel = refIterator.GetMeasurementVector()[0]; int prodLabel = prodIterator.GetMeasurementVector()[0]; @@ -103,46 +101,43 @@ ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> int prodPos = m_MapOfClasses[prodLabel]; ++samplesPerClass[refPos]; - m_ConfusionMatrix( refPos,prodPos )+=1; + m_ConfusionMatrix(refPos, prodPos) += 1; ++refIterator; ++prodIterator; } - this->m_OverallAccuracy = 0.; - for (unsigned int i = 0;i<m_NumberOfClasses;++i) - { - this->m_OverallAccuracy += m_ConfusionMatrix(i,i); - } + for (unsigned int i = 0; i < m_NumberOfClasses; ++i) + { + this->m_OverallAccuracy += m_ConfusionMatrix(i, i); + } - this->m_OverallAccuracy/=static_cast<double>(m_NumberOfSamples); + this->m_OverallAccuracy /= static_cast<double>(m_NumberOfSamples); double luckyRate = 0.; - for (unsigned int i = 0;i<m_NumberOfClasses;++i) - { + for (unsigned int i = 0; i < m_NumberOfClasses; ++i) + { double sum_ij = 0.; double sum_ji = 0.; - for (unsigned int j = 0;j<m_NumberOfClasses;++j) - { - sum_ij +=m_ConfusionMatrix(i,j); - sum_ji +=m_ConfusionMatrix(j,i); + for (unsigned int j = 0; j < m_NumberOfClasses; ++j) + { + sum_ij += m_ConfusionMatrix(i, j); + sum_ji += m_ConfusionMatrix(j, i); + } + luckyRate += sum_ij * sum_ji; } - luckyRate+=sum_ij*sum_ji; - } - - luckyRate/=vcl_pow(m_NumberOfSamples,2.0); + luckyRate /= vcl_pow(m_NumberOfSamples, 2.0); - m_KappaIndex = (m_OverallAccuracy-luckyRate)/(1-luckyRate); + m_KappaIndex = (m_OverallAccuracy - luckyRate) / (1 - luckyRate); } - -template < class TRefListLabel, class TProdListLabel > +template <class TRefListLabel, class TProdListLabel> void -ConfusionMatrixCalculator<TRefListLabel,TProdListLabel> +ConfusionMatrixCalculator<TRefListLabel, TProdListLabel> ::PrintSelf(std::ostream& os, itk::Indent indent) const { os << indent << "TODO"; diff --git a/Code/Learning/otbListSampleGenerator.h b/Code/Learning/otbListSampleGenerator.h index 474186622a..cbb5190a8a 100644 --- a/Code/Learning/otbListSampleGenerator.h +++ b/Code/Learning/otbListSampleGenerator.h @@ -28,22 +28,22 @@ namespace otb { /** \class ListSampleGenerator * \brief Produces a ListSample from a VectorImage and a VectorData - * + * * This filter produces two ListSample for learning and validation of * learning algorithms. The repartition between the learning and validation * ListSample can be adjusted using the SetValidationTrainingProportion() * method. - * + * * The size of the training and validation ListSample can be limited using the * SetMaxTrainingSize() and SetMaxValidationSize() methods. - * + * * Classes are specified by the VectorData with a metadata identified by * a specific key. This key can be provided by the SetClassKey() method * (using "Class" as a default key). * */ -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> class ITK_EXPORT ListSampleGenerator : public itk::ProcessObject { @@ -51,48 +51,48 @@ public: /** Standard class typedefs */ typedef ListSampleGenerator Self; typedef itk::ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; - + /** Run-time type information (and related methods). */ itkTypeMacro(ListSampleGenerator, itk::ProcessObject); - + /** Method for creation through the object factory. */ itkNewMacro(Self); - - typedef TImage ImageType; - typedef TVectorData VectorDataType; + + typedef TImage ImageType; + typedef TVectorData VectorDataType; typedef typename VectorDataType::Pointer VectorDataPointerType; - + typedef itk::PreOrderTreeIterator<typename VectorDataType::DataTreeType> TreeIteratorType; - + /** List to store the pixel values */ typedef typename ImageType::PixelType SampleType; typedef itk::Statistics::ListSample<SampleType> ListSampleType; typedef typename ListSampleType::Pointer ListSamplePointerType; - + /** List to store the corresponding labels */ - typedef int ClassLabelType; - typedef itk::FixedArray<ClassLabelType, 1> LabelType; //note could be templated by an std:::string - typedef itk::Statistics::ListSample<LabelType> ListLabelType; - typedef typename ListLabelType::Pointer ListLabelPointerType; - + typedef int ClassLabelType; + typedef itk::FixedArray<ClassLabelType, 1> LabelType; //note could be templated by an std:::string + typedef itk::Statistics::ListSample<LabelType> ListLabelType; + typedef typename ListLabelType::Pointer ListLabelPointerType; + /** Connects the input image for which the sample list is going to be extracted */ - void SetInput( const ImageType * ); + void SetInput(const ImageType *); const ImageType * GetInput() const; - + /** Connects the vector data for which the sample list is going to be extracted * if this is the only input vector data, both the training and validation samples * come from it */ - void SetInputVectorData( const VectorDataType * ); + void SetInputVectorData(const VectorDataType *); const VectorDataType * GetInputVectorData() const; - + // Switch to the classic interface once OTB use the new stat framework? // ListSample are a full DataObject // typedef itk::DataObject::Pointer DataObjectPointer; // virtual DataObjectPointer MakeOutput(unsigned int idx); virtual void Update(); - + /** Accessors */ itkGetConstMacro(MaxTrainingSize, long int); itkSetMacro(MaxTrainingSize, long int); @@ -113,66 +113,64 @@ public: { return m_ClassesSamplesNumberValidation; } - + itkGetStringMacro(ClassKey); itkSetStringMacro(ClassKey); - + itkGetConstMacro(ClassMinSize, double); itkGetObjectMacro(TrainingListSample, ListSampleType); itkGetObjectMacro(TrainingListLabel, ListLabelType); itkGetObjectMacro(ValidationListSample, ListSampleType); itkGetObjectMacro(ValidationListLabel, ListLabelType); - + std::map<ClassLabelType, double> GetClassesSize() const - { + { return m_ClassesSize; - } - + } void GenerateClassStatistics(); protected: ListSampleGenerator(); virtual ~ListSampleGenerator() {} - void PrintSelf(std::ostream& os, itk::Indent indent) const; - + void PrintSelf(std::ostream& os, itk::Indent indent) const; + /** Triggers the Computation of the sample list */ - void GenerateData( void ); - + void GenerateData(void); + private: - ListSampleGenerator(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - + ListSampleGenerator(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + void ComputeClassSelectionProbability(); - + long int m_MaxTrainingSize; // number of training samples (-1 = no limit) long int m_MaxValidationSize; // number of validation samples (-1 = no limit) - double m_ValidationTrainingProportion; // proportion of training vs validation - // (0.0 = all training, 1.0 = all validation) + double m_ValidationTrainingProportion; // proportion of training vs validation + // (0.0 = all training, 1.0 = all validation) - unsigned short m_NumberOfClasses; - std::string m_ClassKey; - double m_ClassMinSize; + unsigned short m_NumberOfClasses; + std::string m_ClassKey; + double m_ClassMinSize; ListSamplePointerType m_TrainingListSample; ListLabelPointerType m_TrainingListLabel; ListSamplePointerType m_ValidationListSample; ListLabelPointerType m_ValidationListLabel; - std::map<ClassLabelType, double> m_ClassesSize; std::map<ClassLabelType, double> m_ClassesProbTraining; std::map<ClassLabelType, double> m_ClassesProbValidation; - + std::map<ClassLabelType, int> m_ClassesSamplesNumberTraining; //Just a counter std::map<ClassLabelType, int> m_ClassesSamplesNumberValidation; //Just a counter - + typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType; RandomGeneratorType::Pointer m_RandomGenerator; }; -}// end of namespace otb - +} // end of namespace otb + #ifndef OTB_MANUAL_INSTANTIATION #include "otbListSampleGenerator.txx" #endif diff --git a/Code/Learning/otbListSampleGenerator.txx b/Code/Learning/otbListSampleGenerator.txx index d7848bc116..f534db151d 100644 --- a/Code/Learning/otbListSampleGenerator.txx +++ b/Code/Learning/otbListSampleGenerator.txx @@ -28,8 +28,8 @@ namespace otb template<class TImage, class TVectorData> ListSampleGenerator<TImage, TVectorData> ::ListSampleGenerator() : - m_MaxTrainingSize(-1), - m_MaxValidationSize(-1), + m_MaxTrainingSize(-1), + m_MaxValidationSize(-1), m_ValidationTrainingProportion(0.0), m_NumberOfClasses(0), m_ClassKey("Class"), @@ -43,56 +43,56 @@ ListSampleGenerator<TImage, TVectorData> m_TrainingListLabel = ListLabelType::New(); m_ValidationListSample = ListSampleType::New(); m_ValidationListLabel = ListLabelType::New(); - + m_RandomGenerator = RandomGeneratorType::GetInstance(); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> -::SetInput( const ImageType * image ) +ListSampleGenerator<TImage, TVectorData> +::SetInput(const ImageType * image) { - this->ProcessObject::SetNthInput(0, const_cast< ImageType * >( image ) ); + this->ProcessObject::SetNthInput(0, const_cast<ImageType *>(image)); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> const TImage * -ListSampleGenerator<TImage,TVectorData> -::GetInput( ) const +ListSampleGenerator<TImage, TVectorData> +::GetInput() const { if (this->GetNumberOfInputs() < 1) { return 0; } - return static_cast<const ImageType * >(this->ProcessObject::GetInput(0) ); + return static_cast<const ImageType *>(this->ProcessObject::GetInput(0)); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> -::SetInputVectorData( const VectorDataType * vectorData ) +ListSampleGenerator<TImage, TVectorData> +::SetInputVectorData(const VectorDataType * vectorData) { - this->ProcessObject::SetNthInput(1, const_cast< VectorDataType * >( vectorData ) ); + this->ProcessObject::SetNthInput(1, const_cast<VectorDataType *>(vectorData)); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> const TVectorData * -ListSampleGenerator<TImage,TVectorData> -::GetInputVectorData( ) const +ListSampleGenerator<TImage, TVectorData> +::GetInputVectorData() const { if (this->GetNumberOfInputs() < 2) { return 0; } - return static_cast<const VectorDataType * >(this->ProcessObject::GetInput(1) ); + return static_cast<const VectorDataType *>(this->ProcessObject::GetInput(1)); } /** * */ -//template < class TImage, class TVectorData > +//template < class TImage, class TVectorData > //typename ListSampleGenerator<TImage,TVectorData>::DataObjectPointer //ListSampleGenerator<TImage,TVectorData> //::MakeOutput(unsigned int itkNotUsed(idx)) @@ -104,36 +104,35 @@ ListSampleGenerator<TImage,TVectorData> /** * */ -template < class TImage, class TVectorData > -void -ListSampleGenerator<TImage,TVectorData> +template <class TImage, class TVectorData> +void +ListSampleGenerator<TImage, TVectorData> ::Update() { this->GenerateData(); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> +ListSampleGenerator<TImage, TVectorData> ::GenerateData() { typename VectorDataType::ConstPointer vectorData = this->GetInputVectorData(); - + typename ImageType::Pointer image = const_cast<ImageType*>(this->GetInput()); - + //Gather some information about the relative size of the classes //we would like to have the same number of samples per class this->GenerateClassStatistics(); - + this->ComputeClassSelectionProbability(); - // Clear the sample lists m_TrainingListSample->Clear(); m_TrainingListLabel->Clear(); m_ValidationListSample->Clear(); m_ValidationListLabel->Clear(); - + m_ClassesSamplesNumberTraining.clear(); m_ClassesSamplesNumberValidation.clear(); @@ -147,8 +146,8 @@ ListSampleGenerator<TImage,TVectorData> { typename ImageType::RegionType polygonRegion = - otb::TransformPhysicalRegionToIndexRegion(itVector.Get()->GetPolygonExteriorRing()->GetBoundingRegion(), - image.GetPointer()); + otb::TransformPhysicalRegionToIndexRegion(itVector.Get()->GetPolygonExteriorRing()->GetBoundingRegion(), + image.GetPointer()); image->SetRequestedRegion(polygonRegion); image->PropagateRequestedRegion(); @@ -172,14 +171,14 @@ ListSampleGenerator<TImage,TVectorData> m_ClassesSamplesNumberTraining[itVector.Get()->GetFieldAsInt(m_ClassKey)] += 1; } else if (randomValue < m_ClassesProbTraining[itVector.Get()->GetFieldAsInt(m_ClassKey)] - + m_ClassesProbValidation[itVector.Get()->GetFieldAsInt(m_ClassKey)]) + + m_ClassesProbValidation[itVector.Get()->GetFieldAsInt(m_ClassKey)]) { //Add the sample to the validation list m_ValidationListSample->PushBack(it.Get()); m_ValidationListLabel->PushBack(itVector.Get()->GetFieldAsInt(m_ClassKey)); m_ClassesSamplesNumberValidation[itVector.Get()->GetFieldAsInt(m_ClassKey)] += 1; } - //Note: some samples may not be used at all + //Note: some samples may not be used at all } ++it; } @@ -191,17 +190,17 @@ ListSampleGenerator<TImage,TVectorData> assert(m_ValidationListSample->Size() == m_ValidationListLabel->Size()); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> +ListSampleGenerator<TImage, TVectorData> ::GenerateClassStatistics() { m_ClassesSize.clear(); - + //Compute pixel area: typename ImageType::Pointer image = const_cast<ImageType*>(this->GetInput()); - double pixelArea = vcl_abs(image->GetSpacing()[0]*image->GetSpacing()[1]); - + double pixelArea = vcl_abs(image->GetSpacing()[0] * image->GetSpacing()[1]); + typename VectorDataType::ConstPointer vectorData = this->GetInputVectorData(); TreeIteratorType itVector(vectorData->GetDataTree()); itVector.GoToBegin(); @@ -210,15 +209,15 @@ ListSampleGenerator<TImage,TVectorData> if (itVector.Get()->IsPolygonFeature()) { m_ClassesSize[itVector.Get()->GetFieldAsInt(m_ClassKey)] += - itVector.Get()->GetPolygonExteriorRing()->GetArea()/pixelArea;// in pixel + itVector.Get()->GetPolygonExteriorRing()->GetArea() / pixelArea; // in pixel } ++itVector; } std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); - double minSize = itmap->second; + double minSize = itmap->second; ++itmap; - while(itmap != m_ClassesSize.end()) + while (itmap != m_ClassesSize.end()) { if (minSize > itmap->second) { @@ -231,17 +230,19 @@ ListSampleGenerator<TImage,TVectorData> m_NumberOfClasses = m_ClassesSize.size(); } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> +ListSampleGenerator<TImage, TVectorData> ::ComputeClassSelectionProbability() { m_ClassesProbTraining.clear(); m_ClassesProbValidation.clear(); - + //Go through the classes size to find the smallest one double minSizeTraining = -1; - for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); itmap != m_ClassesSize.end(); ++itmap) + for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); + itmap != m_ClassesSize.end(); + ++itmap) { if ((minSizeTraining < 0) || (minSizeTraining > itmap->second)) { @@ -250,12 +251,11 @@ ListSampleGenerator<TImage,TVectorData> } double minSizeValidation = minSizeTraining; - + //Apply the proportion between training and validation samples (all training by default) - minSizeTraining *= (1.0-m_ValidationTrainingProportion); + minSizeTraining *= (1.0 - m_ValidationTrainingProportion); minSizeValidation *= m_ValidationTrainingProportion; - //Apply the limit if specified by the user if ((m_MaxTrainingSize != -1) && (m_MaxTrainingSize < minSizeTraining)) { @@ -265,22 +265,26 @@ ListSampleGenerator<TImage,TVectorData> { minSizeValidation = m_MaxValidationSize; } - + //Compute the probability selection for each class - for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); itmap != m_ClassesSize.end(); ++itmap) + for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); + itmap != m_ClassesSize.end(); + ++itmap) { m_ClassesProbTraining[itmap->first] = minSizeTraining / itmap->second; } - for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); itmap != m_ClassesSize.end(); ++itmap) + for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesSize.begin(); + itmap != m_ClassesSize.end(); + ++itmap) { m_ClassesProbValidation[itmap->first] = minSizeValidation / itmap->second; } - + } -template < class TImage, class TVectorData > +template <class TImage, class TVectorData> void -ListSampleGenerator<TImage,TVectorData> +ListSampleGenerator<TImage, TVectorData> ::PrintSelf(std::ostream& os, itk::Indent indent) const { os << indent << "* MaxTrainingSize: " << m_MaxTrainingSize << "\n"; @@ -299,7 +303,7 @@ ListSampleGenerator<TImage,TVectorData> os << indent << itmap->first << ": " << itmap->second << "\n"; } } - + os << "\n" << indent << "* Training set:\n"; if (m_ClassesProbTraining.empty()) { @@ -309,19 +313,19 @@ ListSampleGenerator<TImage,TVectorData> { os << indent << "** Selection probability:\n"; for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesProbTraining.begin(); - itmap != m_ClassesProbTraining.end(); ++itmap) + itmap != m_ClassesProbTraining.end(); ++itmap) { os << indent << itmap->first << ": " << itmap->second << "\n"; } os << indent << "** Number of selected samples:\n"; for (std::map<ClassLabelType, int>::const_iterator itmap = m_ClassesSamplesNumberTraining.begin(); - itmap != m_ClassesSamplesNumberTraining.end(); ++itmap) + itmap != m_ClassesSamplesNumberTraining.end(); ++itmap) { os << indent << itmap->first << ": " << itmap->second << "\n"; } } - - os << "\n" << indent << "* Validation set:\n"; + + os << "\n" << indent << "* Validation set:\n"; if (m_ClassesProbValidation.empty()) { os << indent << "Not computed\n"; @@ -330,13 +334,13 @@ ListSampleGenerator<TImage,TVectorData> { os << indent << "** Selection probability:\n"; for (std::map<ClassLabelType, double>::const_iterator itmap = m_ClassesProbValidation.begin(); - itmap != m_ClassesProbValidation.end(); ++itmap) + itmap != m_ClassesProbValidation.end(); ++itmap) { os << indent << itmap->first << ": " << itmap->second << "\n"; } os << indent << "** Number of selected samples:\n"; for (std::map<ClassLabelType, int>::const_iterator itmap = m_ClassesSamplesNumberValidation.begin(); - itmap != m_ClassesSamplesNumberValidation.end(); ++itmap) + itmap != m_ClassesSamplesNumberValidation.end(); ++itmap) { os << indent << itmap->first << ": " << itmap->second << "\n"; } diff --git a/Code/Learning/otbPeriodicSOM.h b/Code/Learning/otbPeriodicSOM.h index 2d62ab9d3e..d149b69e31 100644 --- a/Code/Learning/otbPeriodicSOM.h +++ b/Code/Learning/otbPeriodicSOM.h @@ -53,8 +53,8 @@ namespace otb * \sa CzihoSOMNeighborhoodBehaviorFunctor */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> class ITK_EXPORT PeriodicSOM : public SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> { @@ -62,8 +62,8 @@ public: /** Standard typedefs */ typedef PeriodicSOM Self; typedef SOM<TListSample, TMap, - TSOMLearningBehaviorFunctor, - TSOMNeighborhoodBehaviorFunctor> Superclass; + TSOMLearningBehaviorFunctor, + TSOMNeighborhoodBehaviorFunctor> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Learning/otbPeriodicSOM.txx b/Code/Learning/otbPeriodicSOM.txx index d13af11a56..6d2d184723 100644 --- a/Code/Learning/otbPeriodicSOM.txx +++ b/Code/Learning/otbPeriodicSOM.txx @@ -36,8 +36,8 @@ namespace otb * \param radius The radius of the neighbourhood. */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void PeriodicSOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::UpdateMap(const NeuronType& sample, double beta, SizeType& radius) diff --git a/Code/Learning/otbSEMClassifier.h b/Code/Learning/otbSEMClassifier.h index bcf5ae4da5..d47b5ebe67 100644 --- a/Code/Learning/otbSEMClassifier.h +++ b/Code/Learning/otbSEMClassifier.h @@ -42,14 +42,14 @@ namespace otb template<class TInputImage, class TOutputImage> class ITK_EXPORT SEMClassifier : public itk::Statistics::SampleClassifier< - typename itk::Statistics::ListSample<typename TInputImage::PixelType> > + typename itk::Statistics::ListSample<typename TInputImage::PixelType> > { public: /** Standard class typedef*/ typedef SEMClassifier Self; //typedef itk::Object Superclass; typedef itk::Statistics::SampleClassifier< - typename itk::Statistics::ListSample<typename TInputImage::PixelType> > + typename itk::Statistics::ListSample<typename TInputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Learning/otbSEMClassifier.txx b/Code/Learning/otbSEMClassifier.txx index cd9be3878e..2d15f680d0 100644 --- a/Code/Learning/otbSEMClassifier.txx +++ b/Code/Learning/otbSEMClassifier.txx @@ -300,7 +300,8 @@ SEMClassifier<TInputImage, TOutputImage> m_NbClasses = theNumberOfClasses; m_ComponentVector.resize(theNumberOfClasses); - if (m_ComponentDeclared == 1) otbMsgDebugMacro( + if (m_ComponentDeclared == 1) + otbMsgDebugMacro( << "Previous component declarations will be lost since called before SetNumberOfClasses"); m_ComponentDeclared = 0; @@ -445,13 +446,13 @@ SEMClassifier<TInputImage, TOutputImage> switch (GetCurrentIteration()) { - case 0: - case 1: - otbMsgDebugMacro(<< "Doing iteration " << GetCurrentIteration()); - break; - default: - otbMsgDebugMacro(<< m_NbChange << " sample change at iteration " - << GetCurrentIteration()); + case 0: + case 1: + otbMsgDebugMacro(<< "Doing iteration " << GetCurrentIteration()); + break; + default: + otbMsgDebugMacro(<< m_NbChange << " sample change at iteration " + << GetCurrentIteration()); } } diff --git a/Code/Learning/otbSOM.h b/Code/Learning/otbSOM.h index 219d2fa8fa..177cfbe02d 100644 --- a/Code/Learning/otbSOM.h +++ b/Code/Learning/otbSOM.h @@ -52,8 +52,8 @@ namespace otb * \sa CzihoSOMNeighborhoodBehaviorFunctor */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> class ITK_EXPORT SOM : public itk::ImageSource<TMap> { diff --git a/Code/Learning/otbSOM.txx b/Code/Learning/otbSOM.txx index 2dee5e5ab0..c55dd3082a 100644 --- a/Code/Learning/otbSOM.txx +++ b/Code/Learning/otbSOM.txx @@ -35,8 +35,8 @@ namespace otb * Constructor */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::SOM() { @@ -57,8 +57,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * Destructor */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::~SOM() { @@ -70,8 +70,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * \param radius The radius of the nieghbourhood. */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::UpdateMap(const NeuronType& sample, double beta, SizeType& radius) @@ -127,8 +127,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * Step one iteration. */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::Step(unsigned int currentIteration) @@ -154,8 +154,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * Output information redefinition */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::GenerateOutputInformation() @@ -177,8 +177,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * Output redefinition */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::AllocateOutputs() @@ -194,8 +194,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc * Main computation method */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::GenerateData(void) @@ -247,8 +247,8 @@ SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunc *PrintSelf method */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::PrintSelf(std::ostream& os, itk::Indent indent) const diff --git a/Code/Learning/otbSOMMap.h b/Code/Learning/otbSOMMap.h index 203e4e6d65..211b6fb574 100644 --- a/Code/Learning/otbSOMMap.h +++ b/Code/Learning/otbSOMMap.h @@ -46,8 +46,8 @@ namespace otb * \sa SOMActivationBuilder */ template <class TNeuron = itk::VariableLengthVector<double>, - class TDistance = itk::Statistics::EuclideanDistance<TNeuron>, - unsigned int VMapDimension = 2> + class TDistance = itk::Statistics::EuclideanDistance<TNeuron>, + unsigned int VMapDimension = 2> class ITK_EXPORT SOMMap : public otb::VectorImage<typename TNeuron::ComponentType, VMapDimension> { diff --git a/Code/Learning/otbSOMWithMissingValue.h b/Code/Learning/otbSOMWithMissingValue.h index 356294f0de..f6866ba622 100644 --- a/Code/Learning/otbSOMWithMissingValue.h +++ b/Code/Learning/otbSOMWithMissingValue.h @@ -41,8 +41,8 @@ namespace otb * \sa EuclideanDistanceWithMissingValue */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor = Functor::CzihoSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor = Functor::CzihoSOMNeighborhoodBehaviorFunctor> class ITK_EXPORT SOMWithMissingValue : public PeriodicSOM<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> { @@ -50,8 +50,8 @@ public: /** Standard typedefs */ typedef SOMWithMissingValue Self; typedef PeriodicSOM<TListSample, TMap, - TSOMLearningBehaviorFunctor, - TSOMNeighborhoodBehaviorFunctor> Superclass; + TSOMLearningBehaviorFunctor, + TSOMNeighborhoodBehaviorFunctor> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Learning/otbSOMWithMissingValue.txx b/Code/Learning/otbSOMWithMissingValue.txx index 8c06849743..bd64f87056 100644 --- a/Code/Learning/otbSOMWithMissingValue.txx +++ b/Code/Learning/otbSOMWithMissingValue.txx @@ -40,8 +40,8 @@ namespace otb * \param radius The radius of the nieghbourhood. */ template <class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, - class TSOMNeighborhoodBehaviorFunctor> + class TSOMLearningBehaviorFunctor, + class TSOMNeighborhoodBehaviorFunctor> void SOMWithMissingValue<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor> ::UpdateMap(const NeuronType& sample, double beta, SizeType& radius) diff --git a/Code/Learning/otbSOMbasedImageFilter.h b/Code/Learning/otbSOMbasedImageFilter.h index 6fe2648d71..80c8ea7407 100644 --- a/Code/Learning/otbSOMbasedImageFilter.h +++ b/Code/Learning/otbSOMbasedImageFilter.h @@ -95,21 +95,21 @@ private: * \sa EuclideanDistanceWithMissingValue */ template <class TInputImage, class TOutputImage, - class TDistanceMetric, class TMap> + class TDistanceMetric, class TMap> class ITK_EXPORT SOMbasedImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::SOMbasedImageFilterFunctor<typename TInputImage::PixelType, - typename TOutputImage::PixelType, - TDistanceMetric, TMap> > + Functor::SOMbasedImageFilterFunctor<typename TInputImage::PixelType, + typename TOutputImage::PixelType, + TDistanceMetric, TMap> > { public: /** Standard class typedefs. */ typedef SOMbasedImageFilter Self; typedef typename itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::SOMbasedImageFilterFunctor< - typename TInputImage::PixelType, - typename TOutputImage::PixelType, - TDistanceMetric, TMap> > Superclass; + Functor::SOMbasedImageFilterFunctor< + typename TInputImage::PixelType, + typename TOutputImage::PixelType, + TDistanceMetric, TMap> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -127,9 +127,9 @@ public: typedef typename MapType::Pointer MapPointerType; typedef Functor::SOMbasedImageFilterFunctor< - typename TInputImage::PixelType, - typename TOutputImage::PixelType, - TDistanceMetric, TMap> FunctorType; + typename TInputImage::PixelType, + typename TOutputImage::PixelType, + TDistanceMetric, TMap> FunctorType; /** Vectors that hold the training area */ typedef typename TInputImage::PixelType MeasurementType; diff --git a/Code/Learning/otbSVMCrossValidationCostFunction.txx b/Code/Learning/otbSVMCrossValidationCostFunction.txx index 2f47213337..6b217c85c4 100644 --- a/Code/Learning/otbSVMCrossValidationCostFunction.txx +++ b/Code/Learning/otbSVMCrossValidationCostFunction.txx @@ -95,25 +95,25 @@ SVMCrossValidationCostFunction<TModel> switch (m_Model->GetKernelType()) { - case LINEAR: - // C - return 1; + case LINEAR: + // C + return 1; - case POLY: - // C, gamma and coef0 - return 3; + case POLY: + // C, gamma and coef0 + return 3; - case RBF: - // C and gamma - return 2; + case RBF: + // C and gamma + return 2; - case SIGMOID: - // C, gamma and coef0 - return 3; + case SIGMOID: + // C, gamma and coef0 + return 3; - default: - // C - return 1; + default: + // C + return 1; } } @@ -124,34 +124,34 @@ SVMCrossValidationCostFunction<TModel> { switch (m_Model->GetKernelType()) { - case LINEAR: - // C - svm_parameters.C = parameters[0]; - break; - - case POLY: - // C, gamma and coef0 - svm_parameters.C = parameters[0]; - svm_parameters.gamma = parameters[1]; - svm_parameters.coef0 = parameters[2]; - break; - - case RBF: - // C and gamma - svm_parameters.C = parameters[0]; - svm_parameters.gamma = parameters[1]; - break; - - case SIGMOID: - // C, gamma and coef0 - svm_parameters.C = parameters[0]; - svm_parameters.gamma = parameters[1]; - svm_parameters.coef0 = parameters[2]; - break; - - default: - svm_parameters.C = parameters[0]; - break; + case LINEAR: + // C + svm_parameters.C = parameters[0]; + break; + + case POLY: + // C, gamma and coef0 + svm_parameters.C = parameters[0]; + svm_parameters.gamma = parameters[1]; + svm_parameters.coef0 = parameters[2]; + break; + + case RBF: + // C and gamma + svm_parameters.C = parameters[0]; + svm_parameters.gamma = parameters[1]; + break; + + case SIGMOID: + // C, gamma and coef0 + svm_parameters.C = parameters[0]; + svm_parameters.gamma = parameters[1]; + svm_parameters.coef0 = parameters[2]; + break; + + default: + svm_parameters.C = parameters[0]; + break; } } diff --git a/Code/Learning/otbSVMImageClassificationWithRuleFilter.h b/Code/Learning/otbSVMImageClassificationWithRuleFilter.h index 08d937db1d..4b3c55fbe0 100644 --- a/Code/Learning/otbSVMImageClassificationWithRuleFilter.h +++ b/Code/Learning/otbSVMImageClassificationWithRuleFilter.h @@ -46,7 +46,7 @@ public: /** Standard typedefs */ typedef SVMImageClassificationWithRuleFilter Self; typedef SVMImageClassificationFilter<TInputImage, - TOutputImage, TMaskImage> Superclass; + TOutputImage, TMaskImage> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Learning/otbSVMImageModelEstimator.h b/Code/Learning/otbSVMImageModelEstimator.h index 480f4c1ba6..89e49b2f06 100644 --- a/Code/Learning/otbSVMImageModelEstimator.h +++ b/Code/Learning/otbSVMImageModelEstimator.h @@ -51,7 +51,7 @@ public: /** Standard class typedefs. */ typedef SVMImageModelEstimator Self; typedef SVMModelEstimator<ITK_TYPENAME TInputImage::PixelType::ComponentType, - ITK_TYPENAME TTrainingImage::PixelType> + ITK_TYPENAME TTrainingImage::PixelType> Superclass; typedef itk::SmartPointer<Self> Pointer; diff --git a/Code/Learning/otbSVMImageModelEstimator.txx b/Code/Learning/otbSVMImageModelEstimator.txx index ad2ed43b06..edb0f12c30 100644 --- a/Code/Learning/otbSVMImageModelEstimator.txx +++ b/Code/Learning/otbSVMImageModelEstimator.txx @@ -35,7 +35,7 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> } template<class TInputImage, - class TTrainingImage> + class TTrainingImage> SVMImageModelEstimator<TInputImage, TTrainingImage> ::~SVMImageModelEstimator(void) {} @@ -44,7 +44,7 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> * PrintSelf */ template<class TInputImage, - class TTrainingImage> + class TTrainingImage> void SVMImageModelEstimator<TInputImage, TTrainingImage> ::PrintSelf(std::ostream& os, itk::Indent indent) const @@ -96,7 +96,7 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> * Generate data (start the model building process) */ template<class TInputImage, - class TTrainingImage> + class TTrainingImage> void SVMImageModelEstimator<TInputImage, TTrainingImage> ::PrepareData() @@ -115,7 +115,8 @@ SVMImageModelEstimator<TInputImage, TTrainingImage> // Check if size of the two inputs are same for (unsigned int i = 0; i < TInputImage::ImageDimension; ++i) { - if (inputImageSize[i] != trainingImageSize[i]) throw itk::ExceptionObject( + if (inputImageSize[i] != trainingImageSize[i]) + throw itk::ExceptionObject( __FILE__, __LINE__, "Input image size is not the same as the training image size.", diff --git a/Code/Learning/otbSVMKernels.h b/Code/Learning/otbSVMKernels.h index 48bcafa789..686abdb2a7 100644 --- a/Code/Learning/otbSVMKernels.h +++ b/Code/Learning/otbSVMKernels.h @@ -287,19 +287,20 @@ public: } switch (degree) { - case 0: - return kernelValue; - break; - case 1: - return (-2 * gamma * (yval - xval) * kernelValue); - break; - default: - return (-2 * gamma * - ((degree - - 1) * - this->derivative(x, y, param, degree - 2, index, isAtEnd, - constValue) + (yval - xval) * derivative(x, y, param, degree - 1, index, isAtEnd, constValue))); - break; + case 0: + return kernelValue; + break; + case 1: + return (-2 * gamma * (yval - xval) * kernelValue); + break; + default: + return (-2 * gamma * + ((degree - + 1) * + this->derivative(x, y, param, degree - 2, index, isAtEnd, + constValue) + + (yval - xval) * derivative(x, y, param, degree - 1, index, isAtEnd, constValue))); + break; } } diff --git a/Code/Learning/otbSVMModelEstimator.h b/Code/Learning/otbSVMModelEstimator.h index ded05b26d9..f977ef79a4 100644 --- a/Code/Learning/otbSVMModelEstimator.h +++ b/Code/Learning/otbSVMModelEstimator.h @@ -70,7 +70,7 @@ public: itkNewMacro(Self); /** Macro defining the type*/ - itkTypeMacro(SVMModelEstimator,SuperClass); + itkTypeMacro(SVMModelEstimator, SuperClass); /** Get the output model */ ModelType * GetModel(); @@ -296,7 +296,6 @@ public: this->SaveModel(fname.c_str()); } - protected: /** Constructor */ SVMModelEstimator(); diff --git a/Code/Learning/otbSVMModelEstimator.txx b/Code/Learning/otbSVMModelEstimator.txx index 5a063e690d..64d19dd197 100644 --- a/Code/Learning/otbSVMModelEstimator.txx +++ b/Code/Learning/otbSVMModelEstimator.txx @@ -127,40 +127,40 @@ SVMModelEstimator<InputPixelType, LabelPixelType> switch (this->GetModel()->GetKernelType()) { - case LINEAR: - // C - initialParameters.SetSize(1); - initialParameters[0] = this->GetModel()->GetC(); - break; - - case POLY: - // C, gamma and coef0 - initialParameters.SetSize(3); - initialParameters[0] = this->GetModel()->GetC(); - initialParameters[1] = this->GetModel()->GetKernelGamma(); - initialParameters[2] = this->GetModel()->GetKernelCoef0(); - break; - - case RBF: - // C and gamma - initialParameters.SetSize(2); - initialParameters[0] = this->GetModel()->GetC(); - initialParameters[1] = this->GetModel()->GetKernelGamma(); - break; - - case SIGMOID: - // C, gamma and coef0 - initialParameters.SetSize(3); - initialParameters[0] = this->GetModel()->GetC(); - initialParameters[1] = this->GetModel()->GetKernelGamma(); - initialParameters[2] = this->GetModel()->GetKernelCoef0(); - break; - - default: - // Only C - initialParameters.SetSize(1); - initialParameters[0] = this->GetModel()->GetC(); - break; + case LINEAR: + // C + initialParameters.SetSize(1); + initialParameters[0] = this->GetModel()->GetC(); + break; + + case POLY: + // C, gamma and coef0 + initialParameters.SetSize(3); + initialParameters[0] = this->GetModel()->GetC(); + initialParameters[1] = this->GetModel()->GetKernelGamma(); + initialParameters[2] = this->GetModel()->GetKernelCoef0(); + break; + + case RBF: + // C and gamma + initialParameters.SetSize(2); + initialParameters[0] = this->GetModel()->GetC(); + initialParameters[1] = this->GetModel()->GetKernelGamma(); + break; + + case SIGMOID: + // C, gamma and coef0 + initialParameters.SetSize(3); + initialParameters[0] = this->GetModel()->GetC(); + initialParameters[1] = this->GetModel()->GetKernelGamma(); + initialParameters[2] = this->GetModel()->GetKernelCoef0(); + break; + + default: + // Only C + initialParameters.SetSize(1); + initialParameters[0] = this->GetModel()->GetC(); + break; } m_InitialCrossValidationAccuracy = crossValidationFunction->GetValue(initialParameters); @@ -215,35 +215,35 @@ SVMModelEstimator<InputPixelType, LabelPixelType> switch (this->GetModel()->GetKernelType()) { - case LINEAR: - // C - this->GetModel()->SetC(fineBestParameters[0]); - break; - - case POLY: - // C, gamma and coef0 - this->GetModel()->SetC(fineBestParameters[0]); - this->GetModel()->SetKernelGamma(fineBestParameters[1]); - this->GetModel()->SetKernelCoef0(fineBestParameters[2]); - break; - - case RBF: - // C and gamma - this->GetModel()->SetC(fineBestParameters[0]); - this->GetModel()->SetKernelGamma(fineBestParameters[1]); - break; - - case SIGMOID: - // C, gamma and coef0 - this->GetModel()->SetC(fineBestParameters[0]); - this->GetModel()->SetKernelGamma(fineBestParameters[1]); - this->GetModel()->SetKernelCoef0(fineBestParameters[2]); - break; - - default: - // Only C - this->GetModel()->SetC(fineBestParameters[0]); - break; + case LINEAR: + // C + this->GetModel()->SetC(fineBestParameters[0]); + break; + + case POLY: + // C, gamma and coef0 + this->GetModel()->SetC(fineBestParameters[0]); + this->GetModel()->SetKernelGamma(fineBestParameters[1]); + this->GetModel()->SetKernelCoef0(fineBestParameters[2]); + break; + + case RBF: + // C and gamma + this->GetModel()->SetC(fineBestParameters[0]); + this->GetModel()->SetKernelGamma(fineBestParameters[1]); + break; + + case SIGMOID: + // C, gamma and coef0 + this->GetModel()->SetC(fineBestParameters[0]); + this->GetModel()->SetKernelGamma(fineBestParameters[1]); + this->GetModel()->SetKernelCoef0(fineBestParameters[2]); + break; + + default: + // Only C + this->GetModel()->SetC(fineBestParameters[0]); + break; } } } diff --git a/Code/Learning/otbSVMPointSetModelEstimator.h b/Code/Learning/otbSVMPointSetModelEstimator.h index 782333b0f7..2a162cf49e 100644 --- a/Code/Learning/otbSVMPointSetModelEstimator.h +++ b/Code/Learning/otbSVMPointSetModelEstimator.h @@ -50,7 +50,7 @@ public: /** Standard class typedefs. */ typedef SVMPointSetModelEstimator Self; typedef SVMModelEstimator<typename TInputPointSet::PixelType::value_type, - typename TTrainingPointSet::PixelType> Superclass; + typename TTrainingPointSet::PixelType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> diff --git a/Code/Learning/otbSVMPointSetModelEstimator.txx b/Code/Learning/otbSVMPointSetModelEstimator.txx index b2e1dcda18..25a0d39445 100644 --- a/Code/Learning/otbSVMPointSetModelEstimator.txx +++ b/Code/Learning/otbSVMPointSetModelEstimator.txx @@ -25,16 +25,16 @@ namespace otb { template<class TInputPointSet, - class TTrainingPointSet> + class TTrainingPointSet> SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> ::SVMPointSetModelEstimator(void) : SVMModelEstimator<ITK_TYPENAME TInputPointSet::PixelType::value_type, - ITK_TYPENAME TTrainingPointSet::PixelType>() + ITK_TYPENAME TTrainingPointSet::PixelType>() { this->SetNumberOfRequiredInputs(2); } template<class TInputPointSet, - class TTrainingPointSet> + class TTrainingPointSet> SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> ::~SVMPointSetModelEstimator(void) {} @@ -43,7 +43,7 @@ SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> * PrintSelf */ template<class TInputPointSet, - class TTrainingPointSet> + class TTrainingPointSet> void SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> ::PrintSelf(std::ostream& os, itk::Indent indent) const @@ -95,7 +95,7 @@ SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> * Generate data (start the model building process) */ template<class TInputPointSet, - class TTrainingPointSet> + class TTrainingPointSet> void SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> ::PrepareData() @@ -110,7 +110,8 @@ SVMPointSetModelEstimator<TInputPointSet, TTrainingPointSet> int trainingPointSetSize = trainingPointSet->GetNumberOfPoints(); // Check if size of the two inputs are same - if (inputPointSetSize != trainingPointSetSize) throw itk::ExceptionObject( + if (inputPointSetSize != trainingPointSetSize) + throw itk::ExceptionObject( __FILE__, __LINE__, "Input pointset size is not the same as the training pointset size.", diff --git a/Code/Learning/otbSVMSampleListModelEstimator.h b/Code/Learning/otbSVMSampleListModelEstimator.h index 16a4efa467..f74ad67b90 100644 --- a/Code/Learning/otbSVMSampleListModelEstimator.h +++ b/Code/Learning/otbSVMSampleListModelEstimator.h @@ -99,8 +99,8 @@ public: * \ingroup ClassificationFilters */ template <class TInputSampleList, - class TTrainingSampleList, class TMeasurementFunctor = - Functor::VectorToMeasurementVectorFunctor<typename TInputSampleList::MeasurementVectorType> > + class TTrainingSampleList, class TMeasurementFunctor = + Functor::VectorToMeasurementVectorFunctor<typename TInputSampleList::MeasurementVectorType> > class ITK_EXPORT SVMSampleListModelEstimator : public SVMModelEstimator<typename TInputSampleList::MeasurementType, typename TTrainingSampleList::MeasurementType> { @@ -108,7 +108,7 @@ public: /** Standard class typedefs. */ typedef SVMSampleListModelEstimator Self; typedef SVMModelEstimator<typename TInputSampleList::MeasurementType, - typename TTrainingSampleList::MeasurementType> + typename TTrainingSampleList::MeasurementType> Superclass; typedef itk::SmartPointer<Self> Pointer; diff --git a/Code/Learning/otbSVMSampleListModelEstimator.txx b/Code/Learning/otbSVMSampleListModelEstimator.txx index e2ac4eb5bb..cac9fb7ec8 100644 --- a/Code/Learning/otbSVMSampleListModelEstimator.txx +++ b/Code/Learning/otbSVMSampleListModelEstimator.txx @@ -26,14 +26,14 @@ namespace otb { template<class TInputSampleList, - class TTrainingSampleList, class TMeasurementFunctor> + class TTrainingSampleList, class TMeasurementFunctor> SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementFunctor> ::SVMSampleListModelEstimator(void) : SVMModelEstimator<ITK_TYPENAME TInputSampleList::MeasurementType, - ITK_TYPENAME TTrainingSampleList::MeasurementType>() + ITK_TYPENAME TTrainingSampleList::MeasurementType>() {} template<class TInputSampleList, - class TTrainingSampleList, class TMeasurementFunctor> + class TTrainingSampleList, class TMeasurementFunctor> SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementFunctor> ::~SVMSampleListModelEstimator(void) {} @@ -42,7 +42,7 @@ SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementF * PrintSelf */ template<class TInputSampleList, - class TTrainingSampleList, class TMeasurementFunctor> + class TTrainingSampleList, class TMeasurementFunctor> void SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementFunctor> ::PrintSelf(std::ostream& os, itk::Indent indent) const @@ -54,7 +54,7 @@ SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementF * Generate data (start the model building process) */ template<class TInputSampleList, - class TTrainingSampleList, class TMeasurementFunctor> + class TTrainingSampleList, class TMeasurementFunctor> void SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementFunctor> ::PrepareData() @@ -68,7 +68,8 @@ SVMSampleListModelEstimator<TInputSampleList, TTrainingSampleList, TMeasurementF int trainingSampleListSize = trainingSampleList->Size(); // Check if size of the two inputs are same - if (inputSampleListSize != trainingSampleListSize) throw itk::ExceptionObject( + if (inputSampleListSize != trainingSampleListSize) + throw itk::ExceptionObject( __FILE__, __LINE__, "Input pointset size is not the same as the training pointset size.", diff --git a/Code/Markov/otbMRFEnergy.h b/Code/Markov/otbMRFEnergy.h index ac2ac67468..80ba90ef15 100644 --- a/Code/Markov/otbMRFEnergy.h +++ b/Code/Markov/otbMRFEnergy.h @@ -218,7 +218,7 @@ protected: MRFEnergy() : m_NumberOfParameters(1), m_Parameters(0) - {}; + {}; virtual ~MRFEnergy() {} unsigned int m_NumberOfParameters; ParametersType m_Parameters; diff --git a/Code/MultiScale/otbConvexOrConcaveClassificationFilter.h b/Code/MultiScale/otbConvexOrConcaveClassificationFilter.h index 116cdd4e7e..a532359e8a 100644 --- a/Code/MultiScale/otbConvexOrConcaveClassificationFilter.h +++ b/Code/MultiScale/otbConvexOrConcaveClassificationFilter.h @@ -177,15 +177,15 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT ConvexOrConcaveClassificationFilter : public itk::BinaryFunctorImageFilter<TInputImage, TInputImage, TOutputImage, - Functor::ConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::ConvexOrConcaveDecisionRule<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef ConvexOrConcaveClassificationFilter Self; typedef itk::BinaryFunctorImageFilter<TInputImage, TInputImage, TOutputImage, - Functor::ConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::ConvexOrConcaveDecisionRule<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -201,7 +201,7 @@ public: typedef TOutputImage OutputImageType; typedef typename OutputImageType::PixelType LabelType; typedef Functor::ConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> DecisionFunctorType; + typename TOutputImage::PixelType> DecisionFunctorType; /** * Set the input image * \param image the input image diff --git a/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.h b/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.h index d9f60e08fb..a92f66da2d 100644 --- a/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.h +++ b/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.h @@ -99,18 +99,18 @@ public: typedef TOutputImage OutputImageType; typedef TStructuringElement - StructuringElementType; + StructuringElementType; typedef typename StructuringElementType::RadiusType RadiusType; typedef itk::OpeningByReconstructionImageFilter<InputImageType, InputImageType, - StructuringElementType> OpeningFilterType; + StructuringElementType> OpeningFilterType; typedef itk::ClosingByReconstructionImageFilter<InputImageType, InputImageType, - StructuringElementType> ClosingFilterType; + StructuringElementType> ClosingFilterType; typedef itk::SubtractImageFilter<InputImageType, InputImageType, - OutputImageType> ConvexFilterType; + OutputImageType> ConvexFilterType; typedef itk::SubtractImageFilter<OutputImageType, InputImageType, - OutputImageType> ConcaveFilterType; + OutputImageType> ConcaveFilterType; typedef otb::GeodesicMorphologyLevelingFilter<InputImageType, OutputImageType, - OutputImageType> LevelingFilterType; + OutputImageType> LevelingFilterType; /** Pointers typedefs*/ typedef typename OpeningFilterType::Pointer OpeningFilterPointerType; diff --git a/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.h b/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.h index b9b22653c3..fdf862a5fd 100644 --- a/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.h +++ b/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.h @@ -95,9 +95,9 @@ public: /** Typedef of the decomposition filter */ typedef GeodesicMorphologyDecompositionImageFilter<InputImageType, InputImageType, - StructuringElementType> DecompositionFilterType; + StructuringElementType> DecompositionFilterType; typedef typename DecompositionFilterType::Pointer - DecompositionFilterPointerType; + DecompositionFilterPointerType; /** Accessors */ itkSetMacro(Step, unsigned int); diff --git a/Code/MultiScale/otbGeodesicMorphologyLevelingFilter.h b/Code/MultiScale/otbGeodesicMorphologyLevelingFilter.h index c31b6bfb8e..623ddd1ea4 100644 --- a/Code/MultiScale/otbGeodesicMorphologyLevelingFilter.h +++ b/Code/MultiScale/otbGeodesicMorphologyLevelingFilter.h @@ -70,19 +70,19 @@ public: template <class TInputImage, class TInputMaps, class TOutputImage> class ITK_EXPORT GeodesicMorphologyLevelingFilter : public itk::TernaryFunctorImageFilter<TInputImage, TInputImage, - TInputImage, TOutputImage, - Functor::LevelingFunctor<typename TInputImage::PixelType, - typename TInputMaps::PixelType, - typename TOutputImage::PixelType> > + TInputImage, TOutputImage, + Functor::LevelingFunctor<typename TInputImage::PixelType, + typename TInputMaps::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef GeodesicMorphologyLevelingFilter Self; typedef itk::TernaryFunctorImageFilter<TInputImage, TInputImage, - TInputImage, TOutputImage, - Functor::LevelingFunctor<typename TInputImage::PixelType, - typename TInputMaps::PixelType, - typename TOutputImage::PixelType> > Superclass; + TInputImage, TOutputImage, + Functor::LevelingFunctor<typename TInputImage::PixelType, + typename TInputMaps::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/MultiScale/otbMorphologicalClosingProfileFilter.h b/Code/MultiScale/otbMorphologicalClosingProfileFilter.h index 8603494380..c2f0ccc8c8 100644 --- a/Code/MultiScale/otbMorphologicalClosingProfileFilter.h +++ b/Code/MultiScale/otbMorphologicalClosingProfileFilter.h @@ -46,17 +46,17 @@ namespace otb template <class TInputImage, class TOutputImage, class TStructuringElement> class ITK_EXPORT MorphologicalClosingProfileFilter : public ImageToProfileFilter<TInputImage, TOutputImage, - itk::ClosingByReconstructionImageFilter - <TInputImage, TOutputImage, TStructuringElement>, - unsigned int> + itk::ClosingByReconstructionImageFilter + <TInputImage, TOutputImage, TStructuringElement>, + unsigned int> { public: /** Standard typedefs */ typedef MorphologicalClosingProfileFilter Self; typedef ImageToProfileFilter<TInputImage, TOutputImage, - itk::ClosingByReconstructionImageFilter - <TInputImage, TOutputImage, TStructuringElement>, - unsigned int> Superclass; + itk::ClosingByReconstructionImageFilter + <TInputImage, TOutputImage, TStructuringElement>, + unsigned int> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/MultiScale/otbMorphologicalOpeningProfileFilter.h b/Code/MultiScale/otbMorphologicalOpeningProfileFilter.h index 0b04b48c06..345d084c4a 100644 --- a/Code/MultiScale/otbMorphologicalOpeningProfileFilter.h +++ b/Code/MultiScale/otbMorphologicalOpeningProfileFilter.h @@ -46,17 +46,17 @@ namespace otb template <class TInputImage, class TOutputImage, class TStructuringElement> class ITK_EXPORT MorphologicalOpeningProfileFilter : public ImageToProfileFilter<TInputImage, TOutputImage, - itk::OpeningByReconstructionImageFilter - <TInputImage, TOutputImage, TStructuringElement>, - unsigned int> + itk::OpeningByReconstructionImageFilter + <TInputImage, TOutputImage, TStructuringElement>, + unsigned int> { public: /** Standard typedefs */ typedef MorphologicalOpeningProfileFilter Self; typedef ImageToProfileFilter<TInputImage, TOutputImage, - itk::OpeningByReconstructionImageFilter - <TInputImage, TOutputImage, TStructuringElement>, - unsigned int> Superclass; + itk::OpeningByReconstructionImageFilter + <TInputImage, TOutputImage, TStructuringElement>, + unsigned int> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.h b/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.h index 67570bab1e..959f732e7e 100644 --- a/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.h +++ b/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.h @@ -145,15 +145,15 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT MultiScaleConvexOrConcaveClassificationFilter : public QuaternaryFunctorImageFilter<TInputImage, TInputImage, TOutputImage, TOutputImage, TOutputImage, - Functor::MultiScaleConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::MultiScaleConvexOrConcaveDecisionRule<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef MultiScaleConvexOrConcaveClassificationFilter Self; typedef QuaternaryFunctorImageFilter<TInputImage, TInputImage, TOutputImage, TOutputImage, TOutputImage, - Functor::MultiScaleConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::MultiScaleConvexOrConcaveDecisionRule<typename TInputImage::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -169,7 +169,7 @@ public: typedef TOutputImage OutputImageType; typedef typename OutputImageType::PixelType LabelType; typedef Functor::MultiScaleConvexOrConcaveDecisionRule<typename TInputImage::PixelType, - typename TOutputImage::PixelType> DecisionFunctorType; + typename TOutputImage::PixelType> DecisionFunctorType; /** * Set the opening profile derivative maxima image * \param derivativeMaxima the opening profile derivative maxima image diff --git a/Code/MultiScale/otbSubsampleImageFilter.h b/Code/MultiScale/otbSubsampleImageFilter.h index 1448a2ca9d..beb66c8984 100644 --- a/Code/MultiScale/otbSubsampleImageFilter.h +++ b/Code/MultiScale/otbSubsampleImageFilter.h @@ -46,7 +46,7 @@ namespace otb { * \sa DecimateImageFilter */ template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> class ITK_EXPORT SubsampleImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/MultiScale/otbSubsampleImageFilter.txx b/Code/MultiScale/otbSubsampleImageFilter.txx index fa4343229c..ed442b8052 100644 --- a/Code/MultiScale/otbSubsampleImageFilter.txx +++ b/Code/MultiScale/otbSubsampleImageFilter.txx @@ -32,7 +32,7 @@ namespace otb { template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::PrintSelf(std::ostream& os, itk::Indent indent) const @@ -47,7 +47,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> bool SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::IsSubsampleFactorOne() const @@ -61,7 +61,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::GenerateOutputInformation() @@ -77,7 +77,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::CallCopyOutputRegionToInputRegion @@ -106,7 +106,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::CallCopyInputRegionToOutputRegion @@ -134,7 +134,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::BeforeThreadedGenerateData() @@ -144,7 +144,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> } template <class TInputImage, class TOutputImage, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> void SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, @@ -165,47 +165,47 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> switch (DirectionOfTransformation) { - case Wavelet::FORWARD: - { - inputIter.SetSubsampleFactor(GetSubsampleFactor()); - inputIter.GoToBegin(); - - while (!inputIter.IsAtEnd()) + case Wavelet::FORWARD: { - outputIter.SetOffset( - static_cast<typename SubsampledImageRegionIterator<OutputImageType>::OffsetType> - (inputIter.GetOffset())); - outputIter.Set(static_cast<OutputPixelType>(inputIter.Get())); - ++inputIter; - } + inputIter.SetSubsampleFactor(GetSubsampleFactor()); + inputIter.GoToBegin(); - break; - } - case Wavelet::INVERSE: - { - inputIter.SetSubsampleFactor(1); - inputIter.GoToBegin(); + while (!inputIter.IsAtEnd()) + { + outputIter.SetOffset( + static_cast<typename SubsampledImageRegionIterator<OutputImageType>::OffsetType> + (inputIter.GetOffset())); + outputIter.Set(static_cast<OutputPixelType>(inputIter.Get())); + ++inputIter; + } - while (!inputIter.IsAtEnd()) + break; + } + case Wavelet::INVERSE: { - InputImageIndexType inputIndex = inputIter.GetIndex(); - OutputImageIndexType outputIndex; - for (unsigned int i = 0; i < OutputImageDimension; i++) + inputIter.SetSubsampleFactor(1); + inputIter.GoToBegin(); + + while (!inputIter.IsAtEnd()) { - outputIndex[i] = inputIndex[i] * m_SubsampleFactor[i]; + InputImageIndexType inputIndex = inputIter.GetIndex(); + OutputImageIndexType outputIndex; + for (unsigned int i = 0; i < OutputImageDimension; i++) + { + outputIndex[i] = inputIndex[i] * m_SubsampleFactor[i]; + } + outputIter.SetIndex(outputIndex); + outputIter.Set(static_cast<OutputPixelType>(inputIter.Get())); + ++inputIter; } - outputIter.SetIndex(outputIndex); - outputIter.Set(static_cast<OutputPixelType>(inputIter.Get())); - ++inputIter; - } - break; - } - default: - { - itkExceptionMacro(<< "otb::SubsampleImageFilter have to be Wavelet::FORWARD or Wavelet::INVERSE only!!"); - break; - } + break; + } + default: + { + itkExceptionMacro(<< "otb::SubsampleImageFilter have to be Wavelet::FORWARD or Wavelet::INVERSE only!!"); + break; + } } } diff --git a/Code/MultiScale/otbWaveletFilterBank.h b/Code/MultiScale/otbWaveletFilterBank.h index 67dfa5bfd0..b360a7ddf0 100644 --- a/Code/MultiScale/otbWaveletFilterBank.h +++ b/Code/MultiScale/otbWaveletFilterBank.h @@ -77,8 +77,8 @@ namespace otb { * \ingroup Streamed */ template <class TInputImage, class TOutputImage, - class TWaveletOperator, - Wavelet::WaveletDirection TDirectionOfTransformation> + class TWaveletOperator, + Wavelet::WaveletDirection TDirectionOfTransformation> class ITK_EXPORT WaveletFilterBank : public itk::ImageToImageFilter<TInputImage, TOutputImage> { diff --git a/Code/MultiScale/otbWaveletHighPassOperator.h b/Code/MultiScale/otbWaveletHighPassOperator.h index 5af9076852..e285479dad 100644 --- a/Code/MultiScale/otbWaveletHighPassOperator.h +++ b/Code/MultiScale/otbWaveletHighPassOperator.h @@ -36,18 +36,18 @@ namespace otb { * \sa WaveletGenerator */ template <Wavelet::Wavelet TMotherWaveletOperator, - Wavelet::WaveletDirection TDirectionOfTransformation, - class TPixel, unsigned int VDimension, - class TAllocator = itk::NeighborhoodAllocator<TPixel> > + Wavelet::WaveletDirection TDirectionOfTransformation, + class TPixel, unsigned int VDimension, + class TAllocator = itk::NeighborhoodAllocator<TPixel> > class ITK_EXPORT WaveletHighPassOperator : public WaveletOperatorBase<TMotherWaveletOperator, - TPixel, VDimension, TAllocator> + TPixel, VDimension, TAllocator> { public: /** Standard typedefs */ typedef WaveletHighPassOperator Self; typedef WaveletOperatorBase<TMotherWaveletOperator, - TPixel, VDimension, TAllocator> Superclass; + TPixel, VDimension, TAllocator> Superclass; itkTypeMacro(WaveletHighPassOperator, WaveletOperatorBase); @@ -78,15 +78,15 @@ protected: CoefficientVector coeff; switch (DirectionOfTransformation) { - case Wavelet::FORWARD: - this->m_WaveletGenerator->GetHighPassCoefficientVector(coeff); - break; - case Wavelet::INVERSE: - this->m_WaveletGenerator->GetLowPassCoefficientVector(coeff); - Superclass::GenerateInverseHighPassFilterFromLowPassFilter(coeff); - break; - default: // Here to prevent from compilation warnings - break; + case Wavelet::FORWARD: + this->m_WaveletGenerator->GetHighPassCoefficientVector(coeff); + break; + case Wavelet::INVERSE: + this->m_WaveletGenerator->GetLowPassCoefficientVector(coeff); + Superclass::GenerateInverseHighPassFilterFromLowPassFilter(coeff); + break; + default: // Here to prevent from compilation warnings + break; } Superclass::UpSamplingCoefficients(coeff); diff --git a/Code/MultiScale/otbWaveletLowPassOperator.h b/Code/MultiScale/otbWaveletLowPassOperator.h index 59b151d4ee..2b72ee68ec 100644 --- a/Code/MultiScale/otbWaveletLowPassOperator.h +++ b/Code/MultiScale/otbWaveletLowPassOperator.h @@ -35,18 +35,18 @@ namespace otb { * \sa WaveletGenerator */ template <Wavelet::Wavelet TMotherWaveletOperator, - Wavelet::WaveletDirection TDirectionOfTransformation, - class TPixel, unsigned int VDimension, - class TAllocator = itk::NeighborhoodAllocator<TPixel> > + Wavelet::WaveletDirection TDirectionOfTransformation, + class TPixel, unsigned int VDimension, + class TAllocator = itk::NeighborhoodAllocator<TPixel> > class ITK_EXPORT WaveletLowPassOperator : public WaveletOperatorBase<TMotherWaveletOperator, - TPixel, VDimension, TAllocator> + TPixel, VDimension, TAllocator> { public: /** Standard typedefs */ typedef WaveletLowPassOperator Self; typedef WaveletOperatorBase<TMotherWaveletOperator, - TPixel, VDimension, TAllocator> Superclass; + TPixel, VDimension, TAllocator> Superclass; itkTypeMacro(WaveletLowPassOperator, WaveletOperatorBase); @@ -77,15 +77,15 @@ protected: CoefficientVector coeff; switch (DirectionOfTransformation) { - case Wavelet::FORWARD: - this->m_WaveletGenerator->GetLowPassCoefficientVector(coeff); - break; - case Wavelet::INVERSE: - this->m_WaveletGenerator->GetHighPassCoefficientVector(coeff); - Superclass::GenerateInverseLowPassFilterFromHighPassFilter(coeff); - break; - default: // Here to prevent from compilation warnings - break; + case Wavelet::FORWARD: + this->m_WaveletGenerator->GetLowPassCoefficientVector(coeff); + break; + case Wavelet::INVERSE: + this->m_WaveletGenerator->GetHighPassCoefficientVector(coeff); + Superclass::GenerateInverseLowPassFilterFromHighPassFilter(coeff); + break; + default: // Here to prevent from compilation warnings + break; } Superclass::UpSamplingCoefficients(coeff); diff --git a/Code/MultiScale/otbWaveletOperator.h b/Code/MultiScale/otbWaveletOperator.h index 669ca99c27..c33f55843c 100644 --- a/Code/MultiScale/otbWaveletOperator.h +++ b/Code/MultiScale/otbWaveletOperator.h @@ -47,9 +47,9 @@ namespace otb { * \sa WaveletHighPassOperator */ template <Wavelet::Wavelet TMotherWaveletOperator, - Wavelet::WaveletDirection TDirectionOfTransformation, - class TPixel, unsigned int VDimension, - class TAllocator = itk::NeighborhoodAllocator<TPixel> > + Wavelet::WaveletDirection TDirectionOfTransformation, + class TPixel, unsigned int VDimension, + class TAllocator = itk::NeighborhoodAllocator<TPixel> > class ITK_EXPORT WaveletOperator { public: @@ -58,12 +58,12 @@ public: /** Typedefs redirections */ typedef WaveletLowPassOperator< - TMotherWaveletOperator, TDirectionOfTransformation, - TPixel, VDimension, TAllocator> + TMotherWaveletOperator, TDirectionOfTransformation, + TPixel, VDimension, TAllocator> LowPassOperator; typedef WaveletHighPassOperator< - TMotherWaveletOperator, TDirectionOfTransformation, - TPixel, VDimension, TAllocator> + TMotherWaveletOperator, TDirectionOfTransformation, + TPixel, VDimension, TAllocator> HighPassOperator; private: diff --git a/Code/MultiScale/otbWaveletOperatorBase.h b/Code/MultiScale/otbWaveletOperatorBase.h index 04dd14bc3b..c52a876d2f 100644 --- a/Code/MultiScale/otbWaveletOperatorBase.h +++ b/Code/MultiScale/otbWaveletOperatorBase.h @@ -65,8 +65,8 @@ enum WaveletDirection {FORWARD, INVERSE}; * \ingroup Operators */ template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, - class TAllocator = itk::NeighborhoodAllocator<TPixel> > + class TPixel, unsigned int VDimension, + class TAllocator = itk::NeighborhoodAllocator<TPixel> > class ITK_EXPORT WaveletOperatorBase : public itk::NeighborhoodOperator<TPixel, VDimension, TAllocator> { diff --git a/Code/MultiScale/otbWaveletOperatorBase.txx b/Code/MultiScale/otbWaveletOperatorBase.txx index 5f5f01a681..37eea11a50 100644 --- a/Code/MultiScale/otbWaveletOperatorBase.txx +++ b/Code/MultiScale/otbWaveletOperatorBase.txx @@ -25,7 +25,7 @@ namespace otb { template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::PrintSelf(std::ostream& os, itk::Indent i) const @@ -44,7 +44,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::UpSamplingCoefficients(CoefficientVector& coeff) @@ -68,7 +68,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::RevertFilter(CoefficientVector& coeff) @@ -88,7 +88,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::GenerateForwardHighPassFilterFromLowPassFilter(CoefficientVector& coeff) @@ -119,7 +119,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::GenerateInverseHighPassFilterFromLowPassFilter(CoefficientVector& coeff) @@ -146,7 +146,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::GenerateInverseLowPassFilterFromHighPassFilter(CoefficientVector& coeff) @@ -173,7 +173,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> } template <Wavelet::Wavelet TMotherWaveletOperator, - class TPixel, unsigned int VDimension, class TAllocator> + class TPixel, unsigned int VDimension, class TAllocator> void WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> ::ReduceFilterLength(CoefficientVector& coeff) diff --git a/Code/MultiScale/otbWaveletPacketTransform.h b/Code/MultiScale/otbWaveletPacketTransform.h index 4c243724ff..b616326640 100644 --- a/Code/MultiScale/otbWaveletPacketTransform.h +++ b/Code/MultiScale/otbWaveletPacketTransform.h @@ -54,8 +54,8 @@ namespace otb { * \sa WaveletTransform */ template <class TInputImage, class TOutputImage, class TFilter, - Wavelet::WaveletDirection TDirectionOfTransformation, - class TCost = FullyDecomposedWaveletPacketCost<TInputImage> > + Wavelet::WaveletDirection TDirectionOfTransformation, + class TCost = FullyDecomposedWaveletPacketCost<TInputImage> > class ITK_EXPORT WaveletPacketTransform : public itk::ImageSource<TOutputImage> { @@ -238,7 +238,7 @@ private: */ template <class TInputImage, class TOutputImage, class TFilter> class ITK_EXPORT WaveletPacketTransform<TInputImage, TOutputImage, TFilter, - Wavelet::INVERSE, FullyDecomposedWaveletPacketCost<TInputImage> > + Wavelet::INVERSE, FullyDecomposedWaveletPacketCost<TInputImage> > : public ImageListToImageFilter<TInputImage, TOutputImage> { public: diff --git a/Code/MultiScale/otbWaveletPacketTransform.txx b/Code/MultiScale/otbWaveletPacketTransform.txx index ff0ea5b5e7..13ecf3d7ce 100644 --- a/Code/MultiScale/otbWaveletPacketTransform.txx +++ b/Code/MultiScale/otbWaveletPacketTransform.txx @@ -113,7 +113,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD, TCo template <class TInputImage, class TOutputImage, class TFilter> WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::WaveletPacketTransform () : m_SubsampleImageFactor(2), m_NumberOfFilters(0), m_DepthOfDecomposition(0) { @@ -128,7 +128,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, template <class TInputImage, class TOutputImage, class TFilter> void WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::GenerateOutputInformation() { if (m_NumberOfFilters == 0) InterpretRule(); @@ -159,7 +159,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, template <class TInputImage, class TOutputImage, class TFilter> void WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::GenerateData() { if (m_WaveletPacketRule[0] != true) @@ -212,7 +212,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, template <class TInputImage, class TOutputImage, class TFilter> unsigned int WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::SetInputFilters (unsigned int& ruleID, InputImageIterator& imgIt, unsigned int filterID) { @@ -241,7 +241,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, template <class TInputImage, class TOutputImage, class TFilter> void WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::InterpretRule() { if (m_FilterList && m_FilterList->Size() != 0) @@ -259,7 +259,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, template <class TInputImage, class TOutputImage, class TFilter> void WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, - FullyDecomposedWaveletPacketCost<TInputImage> > + FullyDecomposedWaveletPacketCost<TInputImage> > ::InterpretRule (unsigned int& ruleID, unsigned int curDepth) { diff --git a/Code/MultiScale/otbWaveletTransform.h b/Code/MultiScale/otbWaveletTransform.h index 264184b746..54f6c60fe6 100644 --- a/Code/MultiScale/otbWaveletTransform.h +++ b/Code/MultiScale/otbWaveletTransform.h @@ -48,7 +48,7 @@ namespace otb { * */ template <class TInputImage, class TOutputImage, class TFilter, - Wavelet::WaveletDirection TDirectionOfTransformation> + Wavelet::WaveletDirection TDirectionOfTransformation> class ITK_EXPORT WaveletTransform : public itk::ImageSource<TOutputImage> { diff --git a/Code/Projections/otbCompositeTransform.h b/Code/Projections/otbCompositeTransform.h index 1496526689..c85dfe482c 100644 --- a/Code/Projections/otbCompositeTransform.h +++ b/Code/Projections/otbCompositeTransform.h @@ -49,20 +49,20 @@ namespace otb //} ProjectionTypeEnum; template <class TFirstTransform, - class TSecondTransform, - class TScalarType = typename TFirstTransform::ScalarType, - unsigned int NInputDimensions = TFirstTransform::InputSpaceDimension, - unsigned int NOutputDimensions = TSecondTransform::OutputSpaceDimension> + class TSecondTransform, + class TScalarType = typename TFirstTransform::ScalarType, + unsigned int NInputDimensions = TFirstTransform::InputSpaceDimension, + unsigned int NOutputDimensions = TSecondTransform::OutputSpaceDimension> class ITK_EXPORT CompositeTransform : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef CompositeTransform Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbCompositeTransform.txx b/Code/Projections/otbCompositeTransform.txx index f794e8dea3..a42ef307b5 100644 --- a/Code/Projections/otbCompositeTransform.txx +++ b/Code/Projections/otbCompositeTransform.txx @@ -29,15 +29,15 @@ namespace otb { template<class TFirstTransform, - class TSecondTransform, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TSecondTransform, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> CompositeTransform<TFirstTransform, - TSecondTransform, - TScalarType, - NInputDimensions, - NOutputDimensions> + TSecondTransform, + TScalarType, + NInputDimensions, + NOutputDimensions> ::CompositeTransform() : Superclass(SpaceDimension, ParametersDimension) { m_FirstTransform = 0; @@ -45,34 +45,34 @@ CompositeTransform<TFirstTransform, } template<class TFirstTransform, - class TSecondTransform, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TSecondTransform, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> CompositeTransform<TFirstTransform, - TSecondTransform, - TScalarType, - NInputDimensions, - NOutputDimensions> + TSecondTransform, + TScalarType, + NInputDimensions, + NOutputDimensions> ::~CompositeTransform() { } template<class TFirstTransform, - class TSecondTransform, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TSecondTransform, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> typename CompositeTransform<TFirstTransform, - TSecondTransform, - TScalarType, - NInputDimensions, - NOutputDimensions>::SecondTransformOutputPointType + TSecondTransform, + TScalarType, + NInputDimensions, + NOutputDimensions>::SecondTransformOutputPointType CompositeTransform<TFirstTransform, - TSecondTransform, - TScalarType, - NInputDimensions, - NOutputDimensions> + TSecondTransform, + TScalarType, + NInputDimensions, + NOutputDimensions> ::TransformPoint(const FirstTransformInputPointType& point1) const { FirstTransformOutputPointType geoPoint; diff --git a/Code/Projections/otbForwardSensorModel.h b/Code/Projections/otbForwardSensorModel.h index 385b270a2d..8972b4de98 100644 --- a/Code/Projections/otbForwardSensorModel.h +++ b/Code/Projections/otbForwardSensorModel.h @@ -41,19 +41,19 @@ namespace otb */ template <class TScalarType, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT ForwardSensorModel : public SensorModelBase<TScalarType, - NInputDimensions, - NOutputDimensions> + NInputDimensions, + NOutputDimensions> { public: /** Standard class typedefs. */ typedef ForwardSensorModel Self; typedef SensorModelBase<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx b/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx index a7be421dae..07ef7c5da8 100644 --- a/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx +++ b/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx @@ -356,7 +356,7 @@ GCPsToRPCSensorModelImageFilter<TImage> rpcSolver->createRpcProjection()->getProjection()); ossimKeywordlist kwl; m_RpcProjection->saveState(kwl); - // Compute errors + // Compute errors this->ComputeErrors(); // Build an otb::ImageKeywordList diff --git a/Code/Projections/otbGenericMapProjection.h b/Code/Projections/otbGenericMapProjection.h index f570f454db..b8d1ef6d1f 100644 --- a/Code/Projections/otbGenericMapProjection.h +++ b/Code/Projections/otbGenericMapProjection.h @@ -52,18 +52,18 @@ namespace otb typedef enum {FORWARD = 0, INVERSE = 1} InverseOrForwardTransformationEnum; template <InverseOrForwardTransformationEnum TDirectionOfMapping, - class TScalarType = double, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + class TScalarType = double, + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT GenericMapProjection : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs. */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef GenericMapProjection Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbGenericMapProjection.txx b/Code/Projections/otbGenericMapProjection.txx index 35b91e029e..61a78a01a5 100644 --- a/Code/Projections/otbGenericMapProjection.txx +++ b/Code/Projections/otbGenericMapProjection.txx @@ -27,7 +27,7 @@ namespace otb { template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GenericMapProjection() : Superclass(SpaceDimension, ParametersDimension) { @@ -37,7 +37,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::~GenericMapProjection() { @@ -48,7 +48,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> typename GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions>::OssimMapProjectionType* GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetMapProjection() @@ -63,9 +63,9 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> const typename GenericMapProjection<Transform, TScalarType, NInputDimensions, - NOutputDimensions>::OssimMapProjectionType* + NOutputDimensions>::OssimMapProjectionType* GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetMapProjection() const { @@ -79,7 +79,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> std::string GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetWkt() @@ -93,7 +93,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> void GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetWkt(std::string projectionRefWkt) @@ -105,7 +105,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> bool GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::InstanciateProjection() @@ -141,7 +141,7 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> typename GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::TransformPoint(const InputPointType& point) const @@ -151,60 +151,60 @@ GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions // otbMsgDevMacro(<< "DirectionOfMapping: " << DirectionOfMapping); switch (DirectionOfMapping) { - case INVERSE: - { + case INVERSE: + { // otbMsgDevMacro(<< "Cartographic coordinates: (" << point[0] << "," << point[1] << ")"); - //from "itk::point" to "ossim::ossimDpt" - ossimDpt ossimDPoint(point[0], point[1]); + //from "itk::point" to "ossim::ossimDpt" + ossimDpt ossimDPoint(point[0], point[1]); - //map projection - ossimGpt ossimGPoint; - ossimGPoint = this->GetMapProjection()->inverse(ossimDPoint); - ossimGPoint.changeDatum(ossimDatumFactory::instance()->wgs84()); + //map projection + ossimGpt ossimGPoint; + ossimGPoint = this->GetMapProjection()->inverse(ossimDPoint); + ossimGPoint.changeDatum(ossimDatumFactory::instance()->wgs84()); // otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_MapProjection->print(std::cout)); - outputPoint[0] = ossimGPoint.lon; - outputPoint[1] = ossimGPoint.lat; + outputPoint[0] = ossimGPoint.lon; + outputPoint[1] = ossimGPoint.lat; // otbMsgDevMacro(<< "Geographic coordinates (lon, lat) : (" << outputPoint[0] << "," << outputPoint[1] << ")"); - if ((InputPointType::PointDimension == 3) && (OutputPointType::PointDimension == 3)) - { - outputPoint[2] = point[2]; + if ((InputPointType::PointDimension == 3) && (OutputPointType::PointDimension == 3)) + { + outputPoint[2] = point[2]; + } + break; } - break; - } - case FORWARD: - { + case FORWARD: + { // otbMsgDevMacro(<< "Geographic coordinates (lon, lat) : (" << point[1] << "," << point[0] << ")"); - //from "itk::point" to "ossim::ossimGpt" - ossimGpt ossimGPoint(point[1], point[0]); + //from "itk::point" to "ossim::ossimGpt" + ossimGpt ossimGPoint(point[1], point[0]); - //map projection - ossimDpt ossimDPoint; - ossimDPoint = this->GetMapProjection()->forward(ossimGPoint); + //map projection + ossimDpt ossimDPoint; + ossimDPoint = this->GetMapProjection()->forward(ossimGPoint); // otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_MapProjection->print(std::cout)); - outputPoint[0] = ossimDPoint.x; - outputPoint[1] = ossimDPoint.y; + outputPoint[0] = ossimDPoint.x; + outputPoint[1] = ossimDPoint.y; // otbMsgDevMacro(<< "Cartographic coordinates: (" << outputPoint[0] << "," << outputPoint[1] << ")"); - if ((InputPointType::PointDimension == 3) && (OutputPointType::PointDimension == 3)) + if ((InputPointType::PointDimension == 3) && (OutputPointType::PointDimension == 3)) + { + outputPoint[2] = point[2]; + } + break; + } + default: { - outputPoint[2] = point[2]; + itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); + break; } - break; - } - default: - { - itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); - break; - } } return outputPoint; } template<InverseOrForwardTransformationEnum Transform, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> void GenericMapProjection<Transform, TScalarType, NInputDimensions, NOutputDimensions> ::PrintMap() const diff --git a/Code/Projections/otbGenericRSTransform.h b/Code/Projections/otbGenericRSTransform.h index 6f4ba55c02..189b464ebc 100644 --- a/Code/Projections/otbGenericRSTransform.h +++ b/Code/Projections/otbGenericRSTransform.h @@ -45,17 +45,17 @@ enum TransformAccuracy {UNKNOWN, ESTIMATE, PRECISE}; **/ template <class TScalarType = double, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT GenericRSTransform : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs. */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef GenericRSTransform Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbGenericRSTransform.txx b/Code/Projections/otbGenericRSTransform.txx index 14755858c4..ed93d1bdb7 100644 --- a/Code/Projections/otbGenericRSTransform.txx +++ b/Code/Projections/otbGenericRSTransform.txx @@ -116,7 +116,7 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> if (!m_InputProjectionRef.empty()) //map projection { typedef otb::GenericMapProjection<otb::INVERSE, ScalarType, InputSpaceDimension, - InputSpaceDimension> InverseMapProjectionType; + InputSpaceDimension> InverseMapProjectionType; typename InverseMapProjectionType::Pointer mapTransform = InverseMapProjectionType::New(); mapTransform->SetWkt(m_InputProjectionRef); if (mapTransform->GetMapProjection() != NULL) @@ -191,7 +191,7 @@ GenericRSTransform<TScalarType, NInputDimensions, NOutputDimensions> if (!m_OutputProjectionRef.empty()) //map projection { typedef otb::GenericMapProjection<otb::FORWARD, ScalarType, InputSpaceDimension, - OutputSpaceDimension> ForwardMapProjectionType; + OutputSpaceDimension> ForwardMapProjectionType; typename ForwardMapProjectionType::Pointer mapTransform = ForwardMapProjectionType::New(); mapTransform->SetWkt(m_OutputProjectionRef); if (mapTransform->GetMapProjection() != NULL) diff --git a/Code/Projections/otbGeocentricTransform.h b/Code/Projections/otbGeocentricTransform.h index 57bb827a9b..4c9f1bce5c 100644 --- a/Code/Projections/otbGeocentricTransform.h +++ b/Code/Projections/otbGeocentricTransform.h @@ -31,18 +31,18 @@ namespace otb * */ template <InverseOrForwardTransformationEnum TDirectionOfMapping, - class TScalarType = double, - unsigned int NInputDimensions = 3, - unsigned int NOutputDimensions = 3> + class TScalarType = double, + unsigned int NInputDimensions = 3, + unsigned int NOutputDimensions = 3> class ITK_EXPORT GeocentricTransform : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs. */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef GeocentricTransform Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbGeocentricTransform.txx b/Code/Projections/otbGeocentricTransform.txx index 610059adae..5ed52dd089 100644 --- a/Code/Projections/otbGeocentricTransform.txx +++ b/Code/Projections/otbGeocentricTransform.txx @@ -24,7 +24,7 @@ namespace otb { template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::GeocentricTransform() : Superclass(SpaceDimension, ParametersDimension) { @@ -32,7 +32,7 @@ GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDi } template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::~GeocentricTransform() { @@ -43,7 +43,7 @@ GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDi } template<InverseOrForwardTransformationEnum TransformDirection, class TScalarType, unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NOutputDimensions> typename GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::TransformPoint(const InputPointType& point) const @@ -52,22 +52,22 @@ GeocentricTransform<TransformDirection, TScalarType, NInputDimensions, NOutputDi switch (DirectionOfMapping) { - case INVERSE: - { - m_Ellipsoid->XYZToLatLonHeight(point[0], point[1], point[2], outputPoint[1], outputPoint[0], outputPoint[2]); - break; - } - case FORWARD: - { - m_Ellipsoid->latLonHeightToXYZ(point[1], point[0], point[2], outputPoint[0], outputPoint[1], outputPoint[2]); + case INVERSE: + { + m_Ellipsoid->XYZToLatLonHeight(point[0], point[1], point[2], outputPoint[1], outputPoint[0], outputPoint[2]); + break; + } + case FORWARD: + { + m_Ellipsoid->latLonHeightToXYZ(point[1], point[0], point[2], outputPoint[0], outputPoint[1], outputPoint[2]); - break; - } - default: - { - itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); - break; - } + break; + } + default: + { + itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); + break; + } } //To be completed return outputPoint; diff --git a/Code/Projections/otbGroundSpacingImageFunction.h b/Code/Projections/otbGroundSpacingImageFunction.h index 9a6611e66b..dd09c515cd 100644 --- a/Code/Projections/otbGroundSpacingImageFunction.h +++ b/Code/Projections/otbGroundSpacingImageFunction.h @@ -32,8 +32,8 @@ namespace otb * \class GroundSpacingImageFunction * \brief Calculate the approximate ground spacing in X and Y directions * - * This uses the ‘Haversine’ formula to calculate great-circle distances between - * the two points – that is, the shortest distance over the earth’s surface – + * This uses the ‘Haversine’ formula to calculate great-circle distances between + * the two points – that is, the shortest distance over the earth’s surface – * giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills!). * * \ingroup ImageFunctions @@ -41,13 +41,13 @@ namespace otb template <class TInputImage, class TCoordRep = float> class ITK_EXPORT GroundSpacingImageFunction : public itk::ImageFunction<TInputImage, typename itk::NumericTraits<std::complex<float> >::FloatType, - TCoordRep> + TCoordRep> { public: /** Standard class typedefs. */ typedef GroundSpacingImageFunction Self; typedef itk::ImageFunction<TInputImage, typename itk::NumericTraits<std::complex<float> >::FloatType, - TCoordRep> Superclass; + TCoordRep> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -65,7 +65,7 @@ public: typedef typename Superclass::PointType PointType; typedef otb::GenericRSTransform<double> TransformType; - + itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension); /** Datatype used for the density */ @@ -73,8 +73,8 @@ public: FloatType; typedef typename itk::NumericTraits<std::complex<float> >::ValueType ValueType; - typedef typename IndexType::IndexValueType IndexValueType; - + typedef typename IndexType::IndexValueType IndexValueType; + /** Evalulate the function at specified index */ virtual FloatType EvaluateAtIndex(const IndexType& index) const; @@ -106,10 +106,10 @@ protected: private: GroundSpacingImageFunction(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented - - TransformType::Pointer m_Transform; - ValueType m_R; - ValueType m_deg2radCoef; + + TransformType::Pointer m_Transform; + ValueType m_R; + ValueType m_deg2radCoef; }; } // end namespace otb diff --git a/Code/Projections/otbGroundSpacingImageFunction.txx b/Code/Projections/otbGroundSpacingImageFunction.txx index 07c35d41c8..a2b0f88613 100644 --- a/Code/Projections/otbGroundSpacingImageFunction.txx +++ b/Code/Projections/otbGroundSpacingImageFunction.txx @@ -68,41 +68,46 @@ GroundSpacingImageFunction<TInputImage, TCoordRep> } PointType point = this->GetPixelLocation(index); - + IndexType indexSrcX, indexSrcY; indexSrcX[0] = - static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion().GetSize()[0] - - index[0]))); // x position + static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). + GetSize()[0] - + index[0]))); // x position indexSrcX[1] = index[1]; // y position indexSrcY[0] = index[0]; // x position indexSrcY[1] = - static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion().GetSize()[1] - - index[1]))); - + static_cast<IndexValueType>(vcl_fabs(static_cast<ValueType>(this->GetInputImage()->GetLargestPossibleRegion(). + GetSize()[1] - + index[1]))); + PointType pointSrcX = this->GetPixelLocation(indexSrcX); PointType pointSrcY = this->GetPixelLocation(indexSrcY); ValueType dLatX = (vcl_fabs(pointSrcX[1] - point[1])) * m_deg2radCoef; ValueType dLonX = (vcl_fabs(pointSrcX[0] - point[0])) * m_deg2radCoef; - + const ValueType One = itk::NumericTraits<ValueType>::One; const ValueType Two = One + One; - ValueType aX = vcl_sin(dLatX/Two) * vcl_sin(dLatX/Two) + vcl_cos( point[1] * m_deg2radCoef) * vcl_cos(pointSrcX[1] * m_deg2radCoef) * vcl_sin(dLonX/Two) * vcl_sin(dLonX/Two); - ValueType cX = Two * vcl_atan2(vcl_sqrt(aX), vcl_sqrt(One-aX)); + ValueType aX = vcl_sin(dLatX / Two) * vcl_sin(dLatX / Two) + vcl_cos(point[1] * m_deg2radCoef) * vcl_cos( + pointSrcX[1] * m_deg2radCoef) * vcl_sin(dLonX / Two) * vcl_sin(dLonX / Two); + ValueType cX = Two * vcl_atan2(vcl_sqrt(aX), vcl_sqrt(One - aX)); ValueType dX = m_R * cX; - ValueType dLatY = (vcl_fabs(pointSrcY[1] - point[1])) * m_deg2radCoef; ValueType dLonY = (vcl_fabs(pointSrcY[0] - point[0])) * m_deg2radCoef; - - ValueType aY = vcl_sin(dLatY/Two) * vcl_sin(dLatY/Two) + vcl_cos( point[1] * m_deg2radCoef) * vcl_cos(pointSrcY[1] * m_deg2radCoef) * vcl_sin(dLonY/Two) * vcl_sin(dLonY/Two); - ValueType cY = Two * vcl_atan2(vcl_sqrt(aY), vcl_sqrt(One-aY)); + + ValueType aY = vcl_sin(dLatY / Two) * vcl_sin(dLatY / Two) + vcl_cos(point[1] * m_deg2radCoef) * vcl_cos( + pointSrcY[1] * m_deg2radCoef) * vcl_sin(dLonY / Two) * vcl_sin(dLonY / Two); + ValueType cY = Two * vcl_atan2(vcl_sqrt(aY), vcl_sqrt(One - aY)); ValueType dY = m_R * cY; - - FloatType var (dX / (vcl_fabs(static_cast<ValueType>(indexSrcX[0] - index[0]))), dY / (vcl_fabs(static_cast<ValueType>(indexSrcY[1] - index[1])))); - + + FloatType var(dX / (vcl_fabs(static_cast<ValueType>(indexSrcX[0] - index[0]))), dY / (vcl_fabs(static_cast<ValueType>( + indexSrcY[1] - + index[1])))); + return var; } diff --git a/Code/Projections/otbInverseSensorModel.h b/Code/Projections/otbInverseSensorModel.h index 725bc68525..f5fa472ce5 100644 --- a/Code/Projections/otbInverseSensorModel.h +++ b/Code/Projections/otbInverseSensorModel.h @@ -41,19 +41,19 @@ namespace otb * \ingroup Projection */ template <class TScalarType, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT InverseSensorModel : public SensorModelBase<TScalarType, - NInputDimensions, - NOutputDimensions> + NInputDimensions, + NOutputDimensions> { public: /** Standard class typedefs. */ typedef InverseSensorModel Self; typedef SensorModelBase<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbLambertConformalConicMapProjection.h b/Code/Projections/otbLambertConformalConicMapProjection.h index 0074d4829a..18d2e7e210 100644 --- a/Code/Projections/otbLambertConformalConicMapProjection.h +++ b/Code/Projections/otbLambertConformalConicMapProjection.h @@ -31,7 +31,7 @@ namespace otb */ template <InverseOrForwardTransformationEnum transform> class ITK_EXPORT LambertConformalConicMapProjection : public MapProjection<ossimLambertConformalConicProjection, - transform> + transform> { public: /** Standard class typedefs. */ diff --git a/Code/Projections/otbLeastSquareAffineTransformEstimator.h b/Code/Projections/otbLeastSquareAffineTransformEstimator.h index 3a531805c5..25a1ad01e6 100644 --- a/Code/Projections/otbLeastSquareAffineTransformEstimator.h +++ b/Code/Projections/otbLeastSquareAffineTransformEstimator.h @@ -84,18 +84,18 @@ public: typedef TPoint PointType; typedef typename PointType::CoordRepType PrecisionType; typedef itk::CovariantVector<PrecisionType, - PointDimension> CovariantVectorType; + PointDimension> CovariantVectorType; typedef std::pair<PointType, PointType> TiePointsType; typedef std::vector<TiePointsType> TiePointsContainerType; /** Affine transform components typedefs */ typedef itk::Matrix<PrecisionType, - PointDimension, - PointDimension> MatrixType; + PointDimension, + PointDimension> MatrixType; typedef itk::Vector<PrecisionType, - PointDimension> VectorType; + PointDimension> VectorType; typedef itk::AffineTransform<PrecisionType, - PointDimension> AffineTransformType; + PointDimension> AffineTransformType; typedef typename AffineTransformType::Pointer AffineTransformPointerType; /** Get the affine transform matrix */ diff --git a/Code/Projections/otbMapProjection.h b/Code/Projections/otbMapProjection.h index 9a2132ad6b..2ee5308901 100644 --- a/Code/Projections/otbMapProjection.h +++ b/Code/Projections/otbMapProjection.h @@ -54,19 +54,19 @@ namespace otb **/ template <class TOssimMapProjection, - InverseOrForwardTransformationEnum TDirectionOfMapping, - class TScalarType = double, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + InverseOrForwardTransformationEnum TDirectionOfMapping, + class TScalarType = double, + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT MapProjection : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs. */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef MapProjection Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbMapProjection.txx b/Code/Projections/otbMapProjection.txx index 3371e5c316..b29888b980 100644 --- a/Code/Projections/otbMapProjection.txx +++ b/Code/Projections/otbMapProjection.txx @@ -25,7 +25,7 @@ namespace otb { template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::MapProjection() : Superclass(SpaceDimension, ParametersDimension) { @@ -35,7 +35,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::~MapProjection() { @@ -43,7 +43,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> const TOssimMapProjection* MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetMapProjection() const @@ -52,7 +52,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> TOssimMapProjection* MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetMapProjection() @@ -61,7 +61,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::InstanciateProjection() @@ -71,7 +71,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu /// Method to set the projection ellipsoid template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetEllipsoid() { @@ -81,7 +81,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions /// Method to set the projection ellipsoid by copy template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetEllipsoid(const ossimEllipsoid& ellipsoid) { @@ -90,7 +90,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///// Method to set the projection ellipsoid by knowing its code template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetEllipsoid(std::string code) { @@ -100,7 +100,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///// Method to set the projection ellipsoid by knowing its axis template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetEllipsoid(const double& major_axis, const double& minor_axis) { @@ -109,9 +109,9 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, - NOutputDimensions>::OutputPointType + NOutputDimensions>::OutputPointType MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::TransformPoint(const InputPointType& point) const { @@ -119,46 +119,46 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu switch (DirectionOfMapping) { - case INVERSE: - { + case INVERSE: + { // otbMsgDevMacro(<< "Cartographic coordinates: (" << point[0] << "," << point[1] << ")"); - //from "itk::point" to "ossim::ossimDpt" - ossimDpt ossimDPoint(point[0], point[1]); + //from "itk::point" to "ossim::ossimDpt" + ossimDpt ossimDPoint(point[0], point[1]); - //map projection - ossimGpt ossimGPoint; - ossimGPoint = m_MapProjection->inverse(ossimDPoint); - ossimGPoint.changeDatum(ossimDatumFactory::instance()->wgs84()); + //map projection + ossimGpt ossimGPoint; + ossimGPoint = m_MapProjection->inverse(ossimDPoint); + ossimGPoint.changeDatum(ossimDatumFactory::instance()->wgs84()); // otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_MapProjection->print(std::cout)); - outputPoint[0] = ossimGPoint.lon; - outputPoint[1] = ossimGPoint.lat; + outputPoint[0] = ossimGPoint.lon; + outputPoint[1] = ossimGPoint.lat; // otbMsgDevMacro(<< "Geographic coordinates (lon, lat) : (" << outputPoint[0] << "," << outputPoint[1] << ")"); - break; - } - case FORWARD: - { + break; + } + case FORWARD: + { // otbMsgDevMacro(<< "Geographic coordinates (lon, lat) : (" << point[1] << "," << point[0] << ")"); - //from "itk::point" to "ossim::ossimGpt" - ossimGpt ossimGPoint(point[1], point[0]); + //from "itk::point" to "ossim::ossimGpt" + ossimGpt ossimGPoint(point[1], point[0]); - //map projection - ossimDpt ossimDPoint; - ossimDPoint = m_MapProjection->forward(ossimGPoint); + //map projection + ossimDpt ossimDPoint; + ossimDPoint = m_MapProjection->forward(ossimGPoint); // otbGenericMsgDebugMacro(<< "Forward : ========================= " << std::endl << m_MapProjection->print(std::cout)); - outputPoint[0] = ossimDPoint.x; - outputPoint[1] = ossimDPoint.y; + outputPoint[0] = ossimDPoint.x; + outputPoint[1] = ossimDPoint.y; // otbMsgDevMacro(<< "Cartographic coordinates: (" << outputPoint[0] << "," << outputPoint[1] << ")"); - break; - } - default: - { - itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); - break; - } + break; + } + default: + { + itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); + break; + } } return outputPoint; @@ -166,9 +166,9 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The geographic point corresponding to (0,0) template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, - NOutputDimensions>::InputPointType + NOutputDimensions>::InputPointType MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::Origin() { @@ -182,7 +182,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The False Northing(avoid negative coordinates) template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetFalseNorthing() const @@ -194,7 +194,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The FalseEasting(avoid negative coordinates) template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetFalseEasting() const @@ -206,7 +206,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The StandardParallel1(depends on the projection type) template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetStandardParallel1() const @@ -218,7 +218,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The StandardParallel2(depends on the projection type) template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetStandardParallel2() const @@ -230,7 +230,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The projection name template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> std::string MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetProjectionName() const @@ -243,7 +243,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///Check if the projection is geographic template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> bool MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::IsGeographic() const @@ -253,7 +253,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return the major axis of the ellipsoid template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetA() const @@ -265,7 +265,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return the minor axis of the ellipsoid template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetB() const @@ -277,7 +277,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return the flatening of the ellipsoid template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> double MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetF() const @@ -289,9 +289,9 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The resolution in meters template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, - NOutputDimensions>::OutputPointType + NOutputDimensions>::OutputPointType MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetMetersPerPixel() const { @@ -306,9 +306,9 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return The resolution in degree template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, - NOutputDimensions>::OutputPointType + NOutputDimensions>::OutputPointType MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetDecimalDegreesPerPixel() const { @@ -323,7 +323,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///Set the ellipsoid axis template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetAB(double a, double b) { @@ -332,7 +332,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///Set the origin template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetOrigin(const InputPointType& origin) { @@ -342,7 +342,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///Set the origin in a given datum template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetOrigin(const InputPointType& origin, std::string datumCode) { @@ -352,7 +352,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///Set the map resolution in meters template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetMetersPerPixel(const OutputPointType& point) { @@ -362,7 +362,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///Set the map resolution in degree template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetDecimalDegreesPerPixel(const OutputPointType& point) { @@ -372,7 +372,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///\return an approximation of the resolution in degree template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::ComputeDegreesPerPixel(const InputPointType& ground, const OutputPointType& metersPerPixel, @@ -386,7 +386,7 @@ void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions ///\return an approximation of the resolution in meters template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::ComputeMetersPerPixel(const InputPointType& center, @@ -407,7 +407,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu ///\return an approximation of the resolution in meters template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::ComputeMetersPerPixel(double deltaDegreesPerPixelLat, double deltaDegreesPerPixelLon, OutputPointType& metersPerPixel) @@ -420,7 +420,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> std::string MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::GetWkt() const @@ -434,7 +434,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::SetWkt(std::string projectionRefWkt) @@ -444,7 +444,7 @@ MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOu } template<class TOssimMapProjection, InverseOrForwardTransformationEnum Transform, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void MapProjection<TOssimMapProjection, Transform, TScalarType, NInputDimensions, NOutputDimensions> ::PrintMap() const diff --git a/Code/Projections/otbMapToMapProjection.h b/Code/Projections/otbMapToMapProjection.h index d3eab396e8..854b1fac5a 100644 --- a/Code/Projections/otbMapToMapProjection.h +++ b/Code/Projections/otbMapToMapProjection.h @@ -42,19 +42,19 @@ namespace otb * \sa GenericMapProjection */ template <class TInputMapProjection, - class TOutputMapProjection, - class TScalarType = double, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + class TOutputMapProjection, + class TScalarType = double, + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT MapToMapProjection : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs */ typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef MapToMapProjection Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbMapToMapProjection.txx b/Code/Projections/otbMapToMapProjection.txx index e7f2cd92d9..336ac98639 100644 --- a/Code/Projections/otbMapToMapProjection.txx +++ b/Code/Projections/otbMapToMapProjection.txx @@ -24,30 +24,30 @@ namespace otb { template<class TInputMapProjection, - class TOutputMapProjection, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TOutputMapProjection, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> MapToMapProjection<TInputMapProjection, - TOutputMapProjection, - TScalarType, - NInputDimensions, - NOutputDimensions> + TOutputMapProjection, + TScalarType, + NInputDimensions, + NOutputDimensions> ::MapToMapProjection() : Superclass(SpaceDimension, ParametersDimension) { } template<class TInputMapProjection, - class TOutputMapProjection, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TOutputMapProjection, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> MapToMapProjection<TInputMapProjection, - TOutputMapProjection, - TScalarType, - NInputDimensions, - NOutputDimensions> + TOutputMapProjection, + TScalarType, + NInputDimensions, + NOutputDimensions> ::~MapToMapProjection() { } @@ -110,21 +110,21 @@ MapToMapProjection<TInputMapProjection, }*/ template<class TInputMapProjection, - class TOutputMapProjection, - class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + class TOutputMapProjection, + class TScalarType, + unsigned int NInputDimensions, + unsigned int NOutputDimensions> typename MapToMapProjection<TInputMapProjection, - TOutputMapProjection, - TScalarType, - NInputDimensions, - NOutputDimensions> + TOutputMapProjection, + TScalarType, + NInputDimensions, + NOutputDimensions> ::OutputPointType MapToMapProjection<TInputMapProjection, - TOutputMapProjection, - TScalarType, - NInputDimensions, - NOutputDimensions>:: + TOutputMapProjection, + TScalarType, + NInputDimensions, + NOutputDimensions>:: TransformPoint(const InputPointType& point) const { OutputPointOfInputMapProjectionType geopoint; diff --git a/Code/Projections/otbOrthoRectificationFilter.h b/Code/Projections/otbOrthoRectificationFilter.h index d62a0619d2..8417719a19 100644 --- a/Code/Projections/otbOrthoRectificationFilter.h +++ b/Code/Projections/otbOrthoRectificationFilter.h @@ -53,8 +53,8 @@ class ITK_EXPORT OrthoRectificationFilter : public: /** Standard class typedefs */ typedef StreamingResampleImageFilter<TInputImage, - TOutputImage, - TInterpolatorPrecision> Superclass; + TOutputImage, + TInterpolatorPrecision> Superclass; typedef OrthoRectificationFilter Self; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbSensorModelBase.h b/Code/Projections/otbSensorModelBase.h index 5828d6b92c..5589d71ea6 100644 --- a/Code/Projections/otbSensorModelBase.h +++ b/Code/Projections/otbSensorModelBase.h @@ -41,11 +41,11 @@ namespace otb * */ template <class TScalarType, - unsigned int NInputDimensions = 3, - unsigned int NOutputDimensions = 2> + unsigned int NInputDimensions = 3, + unsigned int NOutputDimensions = 2> class ITK_EXPORT SensorModelBase : public itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> + NInputDimensions, + NOutputDimensions> { public: @@ -53,8 +53,8 @@ public: /** Standard class typedefs. */ typedef SensorModelBase Self; typedef itk::Transform<TScalarType, - NInputDimensions, - NOutputDimensions> Superclass; + NInputDimensions, + NOutputDimensions> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbSensorModelBase.txx b/Code/Projections/otbSensorModelBase.txx index 719747774d..025b5b05c6 100644 --- a/Code/Projections/otbSensorModelBase.txx +++ b/Code/Projections/otbSensorModelBase.txx @@ -34,8 +34,8 @@ namespace otb { template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::SensorModelBase() : Superclass(OutputSpaceDimension, 0) { @@ -48,8 +48,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> } template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::~SensorModelBase() { @@ -62,8 +62,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /// Get the Geometry Keyword list template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> ImageKeywordlist SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::GetImageGeometryKeywordlist(void) const @@ -73,8 +73,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /// Get the Geometry Keyword list template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> ossimKeywordlist SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::GetOssimKeywordlist(void) @@ -87,8 +87,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /// Get the ossim model template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> ossimProjection* SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::GetOssimModel(void) @@ -99,8 +99,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /** Set the Imagekeywordlist and affect the ossim projection ( m_Model) */ template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> void SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::SetImageGeometry(const ImageKeywordlist& image_kwl) @@ -111,8 +111,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /** Set the Imagekeywordlist and affect the ossim projection ( m_Model) */ template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> void SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::SetImageGeometry(const ossimKeywordlist& geom_kwl) @@ -124,8 +124,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> /** Instatiate the sensor model from metadata. */ template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> void SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::CreateProjection(const ImageKeywordlist& image_kwl) @@ -151,8 +151,8 @@ SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> * PrintSelf method */ template <class TScalarType, - unsigned int NInputDimensions, - unsigned int NOutputDimensions> + unsigned int NInputDimensions, + unsigned int NOutputDimensions> void SensorModelBase<TScalarType, NInputDimensions, NOutputDimensions> ::PrintSelf(std::ostream& os, itk::Indent indent) const diff --git a/Code/Projections/otbTileMapTransform.h b/Code/Projections/otbTileMapTransform.h index d3cd3cd84e..1ffb4c93f6 100644 --- a/Code/Projections/otbTileMapTransform.h +++ b/Code/Projections/otbTileMapTransform.h @@ -44,18 +44,18 @@ namespace otb **/ template <InverseOrForwardTransformationEnum TTransformDirection, - class TScalarType = double, - unsigned int NInputDimensions = 2, - unsigned int NOutputDimensions = 2> + class TScalarType = double, + unsigned int NInputDimensions = 2, + unsigned int NOutputDimensions = 2> class ITK_EXPORT TileMapTransform : public itk::Transform<TScalarType, // Data type for scalars - NInputDimensions, // Number of dimensions in the input space - NOutputDimensions> // Number of dimensions in the output space + NInputDimensions, // Number of dimensions in the input space + NOutputDimensions> // Number of dimensions in the output space { public: /** Standard class typedefs. */ typedef TileMapTransform Self; typedef itk::Transform<TScalarType, - NInputDimensions, NOutputDimensions> Superclass; + NInputDimensions, NOutputDimensions> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Projections/otbTileMapTransform.txx b/Code/Projections/otbTileMapTransform.txx index 554a5a09e3..c05fa4fe2d 100644 --- a/Code/Projections/otbTileMapTransform.txx +++ b/Code/Projections/otbTileMapTransform.txx @@ -25,7 +25,7 @@ namespace otb { template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::TileMapTransform() : Superclass(SpaceDimension, ParametersDimension) { @@ -33,7 +33,7 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime } template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::~TileMapTransform() { @@ -41,7 +41,7 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime } template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions>::OutputPointType TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::TransformPoint(const InputPointType& point) const @@ -50,48 +50,48 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime switch (DirectionOfMapping) { - case INVERSE: - { + case INVERSE: + { // otbMsgDevMacro(<< "Cartographic coordinates: (" << point[0] << "," << point[1] << ")"); - //from "itk::point" to "ossim::ossimDpt" - ossimDpt ossimDPoint(point[0], point[1]); + //from "itk::point" to "ossim::ossimDpt" + ossimDpt ossimDPoint(point[0], point[1]); - //map projection - ossimGpt ossimGPoint; + //map projection + ossimGpt ossimGPoint; // ossimGPoint=m_TileMapTransform->inverse(ossimDPoint); - m_TileMapTransform->lineSampleToWorld(ossimDPoint, ossimGPoint); + m_TileMapTransform->lineSampleToWorld(ossimDPoint, ossimGPoint); // otbGenericMsgDebugMacro(<< "Inverse : " << std::endl << m_TileMapTransform->print(std::cout)); - outputPoint[0] = ossimGPoint.lon; - outputPoint[1] = ossimGPoint.lat; + outputPoint[0] = ossimGPoint.lon; + outputPoint[1] = ossimGPoint.lat; // otbMsgDevMacro(<< "Geographic coordinates (long/lat) : (" << outputPoint[0] << "," << outputPoint[1] << ")"); - break; - } - case FORWARD: - { + break; + } + case FORWARD: + { // otbMsgDevMacro(<< "Geographic coordinates (long/lat) : (" << point[1] << "," << point[0] << ")"); - //from "itk::point" to "ossim::ossimGpt" - ossimGpt ossimGPoint(point[1], point[0]); + //from "itk::point" to "ossim::ossimGpt" + ossimGpt ossimGPoint(point[1], point[0]); - //map projection - ossimDpt ossimDPoint; + //map projection + ossimDpt ossimDPoint; // ossimDPoint=m_TileMapTransform->forward(ossimGPoint); - m_TileMapTransform->worldToLineSample(ossimGPoint, ossimDPoint); + m_TileMapTransform->worldToLineSample(ossimGPoint, ossimDPoint); // otbGenericMsgDebugMacro(<< "Forward : ========================= \n" // << m_TileMapTransform->print(std::cout)); - outputPoint[0] = ossimDPoint.x; - outputPoint[1] = ossimDPoint.y; + outputPoint[0] = ossimDPoint.x; + outputPoint[1] = ossimDPoint.y; // otbMsgDevMacro(<< "Cartographic coordinates: (" << outputPoint[0] << "," << outputPoint[1] << ")"); - break; - } - default: - { - itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); - break; - } + break; + } + default: + { + itkExceptionMacro(<< "Model is INVERSE or FORWARD only !!"); + break; + } } return outputPoint; @@ -99,7 +99,7 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime ///\return The geographic point corresponding to (0,0) template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> typename TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions>::InputPointType TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::Origin() @@ -113,7 +113,7 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime } template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::PrintMap() const @@ -122,7 +122,7 @@ TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDime } template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> void TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::SetLevel(unsigned int level) { @@ -130,7 +130,7 @@ void TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutpu } template<InverseOrForwardTransformationEnum TTransformDirection, class TScalarType, - unsigned int NInputDimensions, unsigned int NOutputDimensions> + unsigned int NInputDimensions, unsigned int NOutputDimensions> unsigned int TileMapTransform<TTransformDirection, TScalarType, NInputDimensions, NOutputDimensions> ::GetLevel() const { diff --git a/Code/Projections/otbVectorDataProjectionFilter.h b/Code/Projections/otbVectorDataProjectionFilter.h index 3a1c98bbac..721c8b09e3 100644 --- a/Code/Projections/otbVectorDataProjectionFilter.h +++ b/Code/Projections/otbVectorDataProjectionFilter.h @@ -86,10 +86,10 @@ public: typedef itk::Vector<double, 2> SpacingType; typedef itk::Point<double, 2> OriginType; - typedef typename InputVectorDataType::DataNodePointerType InputDataNodePointerType; - typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType; - typedef typename OutputVectorDataType::DataNodePointerType OutputDataNodePointerType; - typedef typename OutputVectorDataType::DataTreePointerType OutputDataTreePointerType; + typedef typename InputVectorDataType::DataNodePointerType InputDataNodePointerType; + typedef typename OutputVectorDataType::DataNodeType OutputDataNodeType; + typedef typename OutputVectorDataType::DataNodePointerType OutputDataNodePointerType; + typedef typename OutputVectorDataType::DataTreePointerType OutputDataTreePointerType; typedef typename InputVectorDataType::DataTreeType::TreeNodeType InputInternalTreeNodeType; typedef typename OutputVectorDataType::DataTreeType::TreeNodeType OutputInternalTreeNodeType; diff --git a/Code/Projections/otbVectorDataProjectionFilter.txx b/Code/Projections/otbVectorDataProjectionFilter.txx index 14ef9b61ed..f2b3f2d178 100644 --- a/Code/Projections/otbVectorDataProjectionFilter.txx +++ b/Code/Projections/otbVectorDataProjectionFilter.txx @@ -389,87 +389,87 @@ VectorDataProjectionFilter<TInputVectorData, TOutputVectorData> switch (dataNode->GetNodeType()) { - case ROOT: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case DOCUMENT: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case FOLDER: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case FEATURE_POINT: - { - newDataNode->SetPoint(this->ReprojectPoint(dataNode->GetPoint())); - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - break; - } - case FEATURE_LINE: - { - newDataNode->SetLine(this->ReprojectLine(dataNode->GetLine())); - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - break; - } - case FEATURE_POLYGON: - { - newDataNode->SetPolygonExteriorRing(this->ReprojectPolygon(dataNode->GetPolygonExteriorRing())); - newDataNode->SetPolygonInteriorRings(this->ReprojectPolygonList(dataNode->GetPolygonInteriorRings())); - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - break; - } - case FEATURE_MULTIPOINT: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case FEATURE_MULTILINE: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case FEATURE_MULTIPOLYGON: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } - case FEATURE_COLLECTION: - { - newContainer = OutputInternalTreeNodeType::New(); - newContainer->Set(newDataNode); - destination->AddChild(newContainer); - ProcessNode((*it), newContainer); - break; - } + case ROOT: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case DOCUMENT: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case FOLDER: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case FEATURE_POINT: + { + newDataNode->SetPoint(this->ReprojectPoint(dataNode->GetPoint())); + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + break; + } + case FEATURE_LINE: + { + newDataNode->SetLine(this->ReprojectLine(dataNode->GetLine())); + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + break; + } + case FEATURE_POLYGON: + { + newDataNode->SetPolygonExteriorRing(this->ReprojectPolygon(dataNode->GetPolygonExteriorRing())); + newDataNode->SetPolygonInteriorRings(this->ReprojectPolygonList(dataNode->GetPolygonInteriorRings())); + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + break; + } + case FEATURE_MULTIPOINT: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case FEATURE_MULTILINE: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case FEATURE_MULTIPOLYGON: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } + case FEATURE_COLLECTION: + { + newContainer = OutputInternalTreeNodeType::New(); + newContainer->Set(newDataNode); + destination->AddChild(newContainer); + ProcessNode((*it), newContainer); + break; + } } ++it; } diff --git a/Code/Radiometry/otbAtmosphericCorrectionParameters.cxx b/Code/Radiometry/otbAtmosphericCorrectionParameters.cxx index 634aec7837..33e6cf5d74 100644 --- a/Code/Radiometry/otbAtmosphericCorrectionParameters.cxx +++ b/Code/Radiometry/otbAtmosphericCorrectionParameters.cxx @@ -50,11 +50,11 @@ FilterFunctionValues total += m_FilterFunctionValues6S[i]; } unsigned int centerIndex = 0; - double total2 = 0; + double total2 = 0; for (centerIndex = 0; centerIndex < m_FilterFunctionValues6S.size(); ++centerIndex) { total2 += m_FilterFunctionValues6S[centerIndex]; - if (total2 > total/2) break; + if (total2 > total / 2) break; } return m_MinSpectralValue + m_UserStep * centerIndex; } diff --git a/Code/Radiometry/otbAtmosphericCorrectionParameters.h b/Code/Radiometry/otbAtmosphericCorrectionParameters.h index 1321950bec..eef0a6aa13 100644 --- a/Code/Radiometry/otbAtmosphericCorrectionParameters.h +++ b/Code/Radiometry/otbAtmosphericCorrectionParameters.h @@ -147,7 +147,7 @@ public: typedef enum {NO_AEROSOL = 0, CONTINENTAL = 1, MARITIME = 2, URBAN = 3, DESERTIC = 5} AerosolModelType; - typedef ObjectList<FilterFunctionValues> InternalWavelengthSpectralBandVectorType; + typedef ObjectList<FilterFunctionValues> InternalWavelengthSpectralBandVectorType; typedef InternalWavelengthSpectralBandVectorType::Pointer WavelengthSpectralBandVectorType; /** diff --git a/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx b/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx index 91394eabe0..0cef1e2a1a 100644 --- a/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx +++ b/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx @@ -177,7 +177,7 @@ AtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms input->GetOzoneAmount(), /** The Ozone amount (Stratospheric ozone layer content) */ input->GetAerosolModel(), /** The Aerosol model */ input->GetAerosolOptical(), /** The Aerosol optical (radiative impact of aerosol for the reference wavelength 550-nm) */ - input->GetWavelengthSpectralBand()->GetNthElement(i),/** Wavelength for the spectral band definition */ + input->GetWavelengthSpectralBand()->GetNthElement(i), /** Wavelength for the spectral band definition */ /** Note : The Max wavelength spectral band value must be updated ! */ atmosphericReflectance, /** Atmospheric reflectance */ atmosphericSphericalAlbedo, /** atmospheric spherical albedo */ diff --git a/Code/Radiometry/otbAtmosphericRadiativeTerms.cxx b/Code/Radiometry/otbAtmosphericRadiativeTerms.cxx index 69fde5eba9..8d9998213b 100644 --- a/Code/Radiometry/otbAtmosphericRadiativeTerms.cxx +++ b/Code/Radiometry/otbAtmosphericRadiativeTerms.cxx @@ -563,25 +563,25 @@ AtmosphericRadiativeTerms os << "Channel " << i << " : " << std::endl; //ValueType::(os,indent); os << indent << "Intrinsic Atmospheric Reflectance : " - << m_Values[i]->GetIntrinsicAtmosphericReflectance() << std::endl; + << m_Values[i]->GetIntrinsicAtmosphericReflectance() << std::endl; os << indent << "Shperical Albedo of the Atmosphere : " - << m_Values[i]->GetSphericalAlbedo() << std::endl; + << m_Values[i]->GetSphericalAlbedo() << std::endl; os << indent << "Total Gaseous Transmission : " - << m_Values[i]->GetTotalGaseousTransmission() << std::endl; + << m_Values[i]->GetTotalGaseousTransmission() << std::endl; os << indent << "Atmosphere Downward Transmittance : " - << m_Values[i]->GetDownwardTransmittance() << std::endl; + << m_Values[i]->GetDownwardTransmittance() << std::endl; os << indent << "Atmosphere Upward Transmittance : " - << m_Values[i]->GetUpwardTransmittance() << std::endl; + << m_Values[i]->GetUpwardTransmittance() << std::endl; os << indent << "Upward Diffuse Transmittance : " - << m_Values[i]->GetUpwardDiffuseTransmittance() << std::endl; + << m_Values[i]->GetUpwardDiffuseTransmittance() << std::endl; os << indent << "Upward Direct Transmittance : " - << m_Values[i]->GetUpwardDirectTransmittance() << std::endl; + << m_Values[i]->GetUpwardDirectTransmittance() << std::endl; os << indent << "Rayleigh Upward Diffuse Transmittance : " - << m_Values[i]->GetUpwardDiffuseTransmittanceForRayleigh() << std::endl; + << m_Values[i]->GetUpwardDiffuseTransmittanceForRayleigh() << std::endl; os << indent << "Aerosols Upward Diffuse Transmittance : " - << m_Values[i]->GetUpwardDiffuseTransmittanceForAerosol() << std::endl; + << m_Values[i]->GetUpwardDiffuseTransmittanceForAerosol() << std::endl; os << indent << "Wavelength : " - << m_Values[i]->GetWavelengthSpectralBand() << std::endl; + << m_Values[i]->GetWavelengthSpectralBand() << std::endl; } } diff --git a/Code/Radiometry/otbDEMCaracteristicsExtractor.h b/Code/Radiometry/otbDEMCaracteristicsExtractor.h index 391f5d6347..53da381cbf 100644 --- a/Code/Radiometry/otbDEMCaracteristicsExtractor.h +++ b/Code/Radiometry/otbDEMCaracteristicsExtractor.h @@ -87,9 +87,9 @@ public: /** Filter definition */ typedef itk::GradientMagnitudeImageFilter<InputImageType, - OutputImageType> GradientMagnitudeFilterType; + OutputImageType> GradientMagnitudeFilterType; typedef itk::GradientImageFilter<InputImageType, InputInternalPixelType, - InputInternalPixelType> GradientRecursiveGaussianImageFilterType; + InputInternalPixelType> GradientRecursiveGaussianImageFilterType; typedef typename GradientRecursiveGaussianImageFilterType::OutputImageType tutuType; typedef itk::NthElementImageAdaptor<tutuType, InputInternalPixelType> AdaptorType; typedef itk::Atan2ImageFilter<AdaptorType, AdaptorType, OutputImageType> Atan2FilterType; diff --git a/Code/Radiometry/otbGAndRIndexImageFilter.h b/Code/Radiometry/otbGAndRIndexImageFilter.h index 7c6d6365d6..8d196912a6 100644 --- a/Code/Radiometry/otbGAndRIndexImageFilter.h +++ b/Code/Radiometry/otbGAndRIndexImageFilter.h @@ -32,11 +32,11 @@ namespace otb */ template <class TInputImageG, class TInputImageR, class TOutputImage, - class TFunction = Functor::IR<typename TInputImageG::PixelType, - typename TInputImageR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::IR<typename TInputImageG::PixelType, + typename TInputImageR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT GAndRIndexImageFilter : public itk::BinaryFunctorImageFilter<TInputImageG, TInputImageR, TOutputImage, - TFunction> + TFunction> { public: diff --git a/Code/Radiometry/otbGAndRIndexImageFilter.txx b/Code/Radiometry/otbGAndRIndexImageFilter.txx index 92ab31b5e4..3322996452 100644 --- a/Code/Radiometry/otbGAndRIndexImageFilter.txx +++ b/Code/Radiometry/otbGAndRIndexImageFilter.txx @@ -31,7 +31,7 @@ namespace otb * Constructor */ template <class TInputImageG, class TInputImageR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> GAndRIndexImageFilter<TInputImageG, TInputImageR, TOutputImage, TFunction> ::GAndRIndexImageFilter() { @@ -41,7 +41,7 @@ GAndRIndexImageFilter<TInputImageG, TInputImageR, TOutputImage, TFunction> * Connect one of the operands for pixel-wise addition */ template <class TInputImageG, class TInputImageR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void GAndRIndexImageFilter<TInputImageG, TInputImageR, TOutputImage, TFunction> ::SetInputG(const TInputImageG * image1) @@ -54,7 +54,7 @@ GAndRIndexImageFilter<TInputImageG, TInputImageR, TOutputImage, TFunction> * Connect one of the operands for pixel-wise addition */ template <class TInputImageG, class TInputImageR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void GAndRIndexImageFilter<TInputImageG, TInputImageR, TOutputImage, TFunction> ::SetInputR(const TInputImageR * image2) diff --git a/Code/Radiometry/otbImageToLuminanceImageFilter.h b/Code/Radiometry/otbImageToLuminanceImageFilter.h index 0d66eb96e4..d14088414b 100644 --- a/Code/Radiometry/otbImageToLuminanceImageFilter.h +++ b/Code/Radiometry/otbImageToLuminanceImageFilter.h @@ -107,13 +107,13 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT ImageToLuminanceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, - TOutputImage, - ITK_TYPENAME Functor::ImageToLuminanceImageFunctor<ITK_TYPENAME - TInputImage:: - InternalPixelType, - ITK_TYPENAME - TOutputImage:: - InternalPixelType> > + TOutputImage, + ITK_TYPENAME Functor::ImageToLuminanceImageFunctor<ITK_TYPENAME + TInputImage:: + InternalPixelType, + ITK_TYPENAME + TOutputImage:: + InternalPixelType> > { public: /** Extract input and output images dimensions.*/ @@ -124,7 +124,7 @@ public: typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename Functor::ImageToLuminanceImageFunctor<ITK_TYPENAME InputImageType::InternalPixelType, - ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; + ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ typedef ImageToLuminanceImageFilter Self; @@ -191,7 +191,8 @@ protected: otbMsgDevMacro(<< "Dimension: "); otbMsgDevMacro(<< "m_Alpha.GetSize(): " << m_Alpha.GetSize()); otbMsgDevMacro(<< "m_Beta.GetSize() : " << m_Beta.GetSize()); - otbMsgDevMacro(<< "this->GetInput()->GetNumberOfComponentsPerPixel() : " << this->GetInput()->GetNumberOfComponentsPerPixel()); + otbMsgDevMacro( + << "this->GetInput()->GetNumberOfComponentsPerPixel() : " << this->GetInput()->GetNumberOfComponentsPerPixel()); if ((m_Alpha.GetSize() != this->GetInput()->GetNumberOfComponentsPerPixel()) || (m_Beta.GetSize() != this->GetInput()->GetNumberOfComponentsPerPixel())) diff --git a/Code/Radiometry/otbImageToReflectanceImageFilter.h b/Code/Radiometry/otbImageToReflectanceImageFilter.h index e00ddaf1f5..58efd86bb1 100644 --- a/Code/Radiometry/otbImageToReflectanceImageFilter.h +++ b/Code/Radiometry/otbImageToReflectanceImageFilter.h @@ -125,13 +125,13 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT ImageToReflectanceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, - TOutputImage, - ITK_TYPENAME Functor::ImageToReflectanceImageFunctor<ITK_TYPENAME - TInputImage:: - InternalPixelType, - ITK_TYPENAME - TOutputImage:: - InternalPixelType> > + TOutputImage, + ITK_TYPENAME Functor::ImageToReflectanceImageFunctor<ITK_TYPENAME + TInputImage:: + InternalPixelType, + ITK_TYPENAME + TOutputImage:: + InternalPixelType> > { public: /** Extract input and output images dimensions.*/ @@ -142,7 +142,7 @@ public: typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename Functor::ImageToReflectanceImageFunctor<ITK_TYPENAME InputImageType::InternalPixelType, - ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; + ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ typedef ImageToReflectanceImageFilter Self; diff --git a/Code/Radiometry/otbLuminanceToReflectanceImageFilter.h b/Code/Radiometry/otbLuminanceToReflectanceImageFilter.h index 88977f21e5..9908b92f67 100644 --- a/Code/Radiometry/otbLuminanceToReflectanceImageFilter.h +++ b/Code/Radiometry/otbLuminanceToReflectanceImageFilter.h @@ -118,13 +118,13 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT LuminanceToReflectanceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, - TOutputImage, - ITK_TYPENAME Functor::LuminanceToReflectanceImageFunctor<ITK_TYPENAME - TInputImage:: - InternalPixelType, - ITK_TYPENAME - TOutputImage:: - InternalPixelType> > + TOutputImage, + ITK_TYPENAME Functor::LuminanceToReflectanceImageFunctor<ITK_TYPENAME + TInputImage:: + InternalPixelType, + ITK_TYPENAME + TOutputImage:: + InternalPixelType> > { public: /** Extract input and output images dimensions.*/ @@ -135,7 +135,7 @@ public: typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename Functor::LuminanceToReflectanceImageFunctor<ITK_TYPENAME InputImageType::InternalPixelType, - ITK_TYPENAME OutputImageType::InternalPixelType> + ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ diff --git a/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.h b/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.h index f1bef13738..b9d11c4918 100644 --- a/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.h @@ -36,9 +36,9 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::IR<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::IR<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelGAndRIndexImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { @@ -90,7 +90,6 @@ public: } } - protected: /// Constructor MultiChannelGAndRIndexImageFilter() : m_GreenIndex(1), m_RedIndex(2) {}; diff --git a/Code/Radiometry/otbMultiChannelRAndBAndNIRIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndBAndNIRIndexImageFilter.h index cf77a86664..0137666949 100644 --- a/Code/Radiometry/otbMultiChannelRAndBAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndBAndNIRIndexImageFilter.h @@ -36,10 +36,10 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::ARVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::ARVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndBAndNIRIndexImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { diff --git a/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.h index 6dd4a0409d..5b6d18e386 100644 --- a/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.h @@ -25,7 +25,7 @@ namespace otb /** \class MultiChannelRAndBAndNIRVegetationIndexImageFilter * \brief <b>DEPRECATED:</b> use otbMultiChannelRAndBAndNIRIndexImageFilter. - * + * * Implements multi channel R and B and NIR pixel-wise generic * vegetation index operation on one vector image. * @@ -38,10 +38,10 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::ARVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::ARVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndBAndNIRVegetationIndexImageFilter : public MultiChannelRAndBAndNIRIndexImageFilter<TInputImage, TOutputImage, TFunction> { diff --git a/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilter.h index d12bee65e3..0ef3a223c6 100644 --- a/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilter.h @@ -36,10 +36,10 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::AVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::AVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndGAndNIRIndexImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { @@ -102,7 +102,6 @@ public: } } - protected: /// Constructor MultiChannelRAndGAndNIRIndexImageFilter() : m_RedIndex(3), m_GreenIndex(2), m_NIRIndex(4) {}; diff --git a/Code/Radiometry/otbMultiChannelRAndGAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndGAndNIRVegetationIndexImageFilter.h index 5da011e00c..f99a0794f4 100644 --- a/Code/Radiometry/otbMultiChannelRAndGAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndGAndNIRVegetationIndexImageFilter.h @@ -38,10 +38,10 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::AVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::AVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndGAndNIRVegetationIndexImageFilter : public MultiChannelRAndGAndNIRIndexImageFilter<TInputImage, TOutputImage, TFunction> { diff --git a/Code/Radiometry/otbMultiChannelRAndNIRIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndNIRIndexImageFilter.h index a1b48a57fb..15a798b2e6 100644 --- a/Code/Radiometry/otbMultiChannelRAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndNIRIndexImageFilter.h @@ -36,9 +36,9 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::NDVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::NDVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndNIRIndexImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { diff --git a/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.h index e215ef7d8d..a21b3a4588 100644 --- a/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.h @@ -24,9 +24,9 @@ namespace otb { /** \class MultiChannelRAndNIRVegetationIndexImageFilter - * \brief <b>DEPRECATED:</b> use otbMultiChannelRAndNIRIndexImageFilter. + * \brief <b>DEPRECATED:</b> use otbMultiChannelRAndNIRIndexImageFilter. * - * Implements multi channel R and NIR pixel-wise generic + * Implements multi channel R and NIR pixel-wise generic * vegetation index operation on one vector image. * * This class is parameterized over the type of the input image and @@ -39,9 +39,9 @@ namespace otb * \ingroup Radiometry */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::NDVI<typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::NDVI<typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelRAndNIRVegetationIndexImageFilter : public MultiChannelRAndNIRIndexImageFilter<TInputImage, TOutputImage, TFunction> { diff --git a/Code/Radiometry/otbMultiChannelRadiometricImageFilter.h b/Code/Radiometry/otbMultiChannelRadiometricImageFilter.h index 886d3acd25..ee7169ca02 100644 --- a/Code/Radiometry/otbMultiChannelRadiometricImageFilter.h +++ b/Code/Radiometry/otbMultiChannelRadiometricImageFilter.h @@ -105,8 +105,8 @@ public: protected: /// Constructor - MultiChannelRadiometricImageFilter() : - m_BlueIndex(0), m_GreenIndex(0), m_RedIndex(0), m_NIRIndex(0), m_MIRIndex(0) {}; + MultiChannelRadiometricImageFilter() : + m_BlueIndex(0), m_GreenIndex(0), m_RedIndex(0), m_NIRIndex(0), m_MIRIndex(0) {}; /// Destructor virtual ~MultiChannelRadiometricImageFilter() {} /// Before generating data, set functor parameters diff --git a/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.h b/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.h index cc18fc0f6e..4797aa4086 100644 --- a/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.h @@ -32,20 +32,20 @@ namespace otb */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::ARVI<typename TInputImageR::PixelType, - typename TInputImageB::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::ARVI<typename TInputImageR::PixelType, + typename TInputImageB::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndBAndNIRIndexImageFilter : public itk::TernaryFunctorImageFilter<TInputImageR, TInputImageB, - TInputImageNIR, TOutputImage, - TFunction> + TInputImageNIR, TOutputImage, + TFunction> { public: /** Standard typedefs */ typedef RAndBAndNIRIndexImageFilter Self; typedef itk::TernaryFunctorImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputImage, - TFunction> Superclass; + TFunction> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.txx b/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.txx index 70fc3f09ed..e86813e2c8 100644 --- a/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.txx +++ b/Code/Radiometry/otbRAndBAndNIRIndexImageFilter.txx @@ -27,7 +27,7 @@ namespace otb * Constructor */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputImage, TFunction> ::RAndBAndNIRIndexImageFilter() { @@ -37,7 +37,7 @@ RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputImage, TFunction> ::SetInputR(const TInputImageR * image) @@ -50,7 +50,7 @@ RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputImage, TFunction> ::SetInputB(const TInputImageB * image) @@ -62,7 +62,7 @@ RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, TInputImageNIR, TOutputImage, TFunction> ::SetInputNIR(const TInputImageNIR * image) diff --git a/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.h index 98cb2b739e..28566f04bf 100644 --- a/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.h @@ -32,13 +32,13 @@ namespace otb */ template <class TInputImageR, class TInputImageB, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::ARVI<typename TInputImageR::PixelType, - typename TInputImageB::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::ARVI<typename TInputImageR::PixelType, + typename TInputImageB::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndBAndNIRVegetationIndexImageFilter : public RAndBAndNIRIndexImageFilter<TInputImageR, TInputImageB, - TInputImageNIR, - TOutputImage, TFunction> + TInputImageNIR, + TOutputImage, TFunction> { }; diff --git a/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.h b/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.h index 486ee44393..d20c37df04 100644 --- a/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.h @@ -32,20 +32,20 @@ namespace otb */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::AVI<typename TInputImageR::PixelType, - typename TInputImageG::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::AVI<typename TInputImageR::PixelType, + typename TInputImageG::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndGAndNIRIndexImageFilter : public itk::TernaryFunctorImageFilter<TInputImageR, TInputImageG, - TInputImageNIR, TOutputImage, - TFunction> + TInputImageNIR, TOutputImage, + TFunction> { public: /** Standard typedefs */ typedef RAndGAndNIRIndexImageFilter Self; typedef itk::TernaryFunctorImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, - TFunction> Superclass; + TFunction> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.txx b/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.txx index 65e6fbf33f..8ae674a331 100644 --- a/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.txx +++ b/Code/Radiometry/otbRAndGAndNIRIndexImageFilter.txx @@ -27,7 +27,7 @@ namespace otb * Constructor */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, TFunction> ::RAndGAndNIRIndexImageFilter() { @@ -37,7 +37,7 @@ RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, TFunction> ::SetInputR(const TInputImageR * image) @@ -50,7 +50,7 @@ RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, TFunction> ::SetInputG(const TInputImageG * image) @@ -62,7 +62,7 @@ RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndGAndNIRIndexImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, TFunction> ::SetInputNIR(const TInputImageNIR * image) diff --git a/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilter.h index 8450c8f102..c785722170 100644 --- a/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilter.h @@ -32,21 +32,21 @@ namespace otb */ template <class TInputImageR, class TInputImageG, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::AVI<typename TInputImageR::PixelType, - typename TInputImageG::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::AVI<typename TInputImageR::PixelType, + typename TInputImageG::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndGAndNIRVegetationIndexImageFilter : public itk::TernaryFunctorImageFilter<TInputImageR, - TInputImageG, - TInputImageNIR, - TOutputImage, TFunction> + TInputImageG, + TInputImageNIR, + TOutputImage, TFunction> { public: /** Standard typedefs */ typedef RAndGAndNIRVegetationIndexImageFilter Self; typedef itk::TernaryFunctorImageFilter<TInputImageR, TInputImageG, TInputImageNIR, TOutputImage, - TFunction> Superclass; + TFunction> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Radiometry/otbRAndNIRIndexImageFilter.h b/Code/Radiometry/otbRAndNIRIndexImageFilter.h index 638187a81c..7d6f513f9f 100644 --- a/Code/Radiometry/otbRAndNIRIndexImageFilter.h +++ b/Code/Radiometry/otbRAndNIRIndexImageFilter.h @@ -31,11 +31,11 @@ namespace otb */ template <class TInputImageR, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::NDVI<typename TInputImageR::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::NDVI<typename TInputImageR::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndNIRIndexImageFilter : public itk::BinaryFunctorImageFilter<TInputImageR, TInputImageNIR, - TOutputImage, TFunction> + TOutputImage, TFunction> { public: diff --git a/Code/Radiometry/otbRAndNIRIndexImageFilter.txx b/Code/Radiometry/otbRAndNIRIndexImageFilter.txx index 2c16ddb1c1..dd66420de1 100644 --- a/Code/Radiometry/otbRAndNIRIndexImageFilter.txx +++ b/Code/Radiometry/otbRAndNIRIndexImageFilter.txx @@ -31,7 +31,7 @@ namespace otb * Constructor */ template <class TInputImageR, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, TOutputImage, TFunction> ::RAndNIRIndexImageFilter() { @@ -41,7 +41,7 @@ RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, TOutputImage, TFunction> * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, TOutputImage, TFunction> ::SetInputR(const TInputImageR * image1) @@ -54,7 +54,7 @@ RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, TOutputImage, TFunction> * Connect one of the operands for pixel-wise addition */ template <class TInputImageR, class TInputImageNIR, - class TOutputImage, class TFunction> + class TOutputImage, class TFunction> void RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, TOutputImage, TFunction> ::SetInputNIR(const TInputImageNIR * image2) diff --git a/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.h b/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.h index 9adfca8b4f..2223053a4b 100644 --- a/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.h +++ b/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.h @@ -31,11 +31,11 @@ namespace otb */ template <class TInputImageR, class TInputImageNIR, class TOutputImage, - class TFunction = Functor::NDVI<typename TInputImageR::PixelType, - typename TInputImageNIR::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::NDVI<typename TInputImageR::PixelType, + typename TInputImageNIR::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT RAndNIRVegetationIndexImageFilter : public RAndNIRIndexImageFilter<TInputImageR, TInputImageNIR, - TOutputImage, TFunction> + TOutputImage, TFunction> { }; } // end namespace otb diff --git a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.h b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.h index bbd11a2684..632f4c6f96 100644 --- a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.h +++ b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.h @@ -124,11 +124,11 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT ReflectanceToSurfaceReflectanceImageFilter : public UnaryImageFunctorWithVectorImageFilter<TInputImage, - TOutputImage, - ITK_TYPENAME Functor::ReflectanceToSurfaceReflectanceImageFunctor< - ITK_TYPENAME TInputImage::InternalPixelType, - ITK_TYPENAME - TOutputImage::InternalPixelType> > + TOutputImage, + ITK_TYPENAME Functor::ReflectanceToSurfaceReflectanceImageFunctor< + ITK_TYPENAME TInputImage::InternalPixelType, + ITK_TYPENAME + TOutputImage::InternalPixelType> > { public: /** Extract input and output images dimensions.*/ @@ -139,7 +139,7 @@ public: typedef TInputImage InputImageType; typedef TOutputImage OutputImageType; typedef typename Functor::ReflectanceToSurfaceReflectanceImageFunctor<ITK_TYPENAME InputImageType::InternalPixelType, - ITK_TYPENAME OutputImageType::InternalPixelType> + ITK_TYPENAME OutputImageType::InternalPixelType> FunctorType; /** "typedef" for standard classes. */ typedef ReflectanceToSurfaceReflectanceImageFilter Self; diff --git a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx index 0918902134..dec21d411e 100644 --- a/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx +++ b/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.txx @@ -30,11 +30,11 @@ namespace otb */ template <class TInputImage, class TOutputImage> ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage> -::ReflectanceToSurfaceReflectanceImageFilter(): - m_IsSetAtmosphericRadiativeTerms(false), - m_AeronetFileName(""), - m_FilterFunctionValuesFileName(""), - m_UseGenerateParameters(true) +::ReflectanceToSurfaceReflectanceImageFilter() : + m_IsSetAtmosphericRadiativeTerms(false), + m_AeronetFileName(""), + m_FilterFunctionValuesFileName(""), + m_UseGenerateParameters(true) { m_AtmosphericRadiativeTerms = AtmosphericRadiativeTerms::New(); m_CorrectionParameters = AtmosphericCorrectionParameters::New(); @@ -101,7 +101,8 @@ ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage> { bool ffvfOK = true; if (m_FilterFunctionCoef.size() == 0) ffvfOK = false; - else if (m_FilterFunctionCoef.size() != this->GetInput()->GetNumberOfComponentsPerPixel()) itkExceptionMacro( + else if (m_FilterFunctionCoef.size() != this->GetInput()->GetNumberOfComponentsPerPixel()) + itkExceptionMacro( << "Function Values and Input image size mismatch"); for (unsigned int i = 0; i < this->GetInput()->GetNumberOfComponentsPerPixel(); i++) @@ -156,8 +157,8 @@ ReflectanceToSurfaceReflectanceImageFilter<TInputImage, TOutputImage> for (unsigned int i = 0; i < this->GetInput()->GetNumberOfComponentsPerPixel(); ++i) { - double coef; - double res; + double coef; + double res; unsigned int wavelengthPosition = imageMetadataInterface->BandIndexToWavelengthPosition(i); coef = static_cast<double>(m_AtmosphericRadiativeTerms->GetTotalGaseousTransmission(wavelengthPosition) * m_AtmosphericRadiativeTerms->GetDownwardTransmittance(wavelengthPosition) diff --git a/Code/Radiometry/otbSoilIndicesFunctor.h b/Code/Radiometry/otbSoilIndicesFunctor.h index cc2b0e13d2..be38f6a6e2 100644 --- a/Code/Radiometry/otbSoilIndicesFunctor.h +++ b/Code/Radiometry/otbSoilIndicesFunctor.h @@ -275,7 +275,7 @@ protected: return static_cast<TOutput>(0.); } - return static_cast<TOutput>( dRed*dRed/ (dGreen*dGreen*dGreen) ); + return static_cast<TOutput>(dRed * dRed / (dGreen * dGreen * dGreen)); } }; diff --git a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.h b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.h index 539bd4e3e4..08e5d3b79b 100644 --- a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.h +++ b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.h @@ -150,21 +150,21 @@ private: template <class TInputImage, class TOutputImage> class ITK_EXPORT SurfaceAdjacencyEffect6SCorrectionSchemeFilter : public UnaryFunctorNeighborhoodImageFilter<TInputImage, - TOutputImage, - ITK_TYPENAME Functor::ComputeNeighborhoodContributionFunctor<itk:: - ConstNeighborhoodIterator - <TInputImage>, - ITK_TYPENAME - TOutputImage - ::PixelType> > + TOutputImage, + ITK_TYPENAME Functor::ComputeNeighborhoodContributionFunctor<itk:: + ConstNeighborhoodIterator + <TInputImage>, + ITK_TYPENAME + TOutputImage + ::PixelType> > { public: /** "typedef" to simplify the variables definition and the declaration. */ typedef Functor::ComputeNeighborhoodContributionFunctor<itk::ConstNeighborhoodIterator<TInputImage>, - ITK_TYPENAME TOutputImage::PixelType> FunctorType; + ITK_TYPENAME TOutputImage::PixelType> FunctorType; /** "typedef" for standard classes. */ - typedef SurfaceAdjacencyEffect6SCorrectionSchemeFilter Self; + typedef SurfaceAdjacencyEffect6SCorrectionSchemeFilter Self; typedef UnaryFunctorNeighborhoodImageFilter<TInputImage, TOutputImage, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx index 85921c29ee..6632b7d34e 100644 --- a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx +++ b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx @@ -227,7 +227,9 @@ SurfaceAdjacencyEffect6SCorrectionSchemeFilter<TInputImage, TOutputImage> SIXSTraits::ComputeEnvironmentalContribution(rayleigh, aerosol, radiusMatrix(i, j), palt, - vcl_cos(m_ZenithalViewingAngle * CONST_PI_180), notUsed1, notUsed2, factor); //Call to 6S + vcl_cos( + m_ZenithalViewingAngle * CONST_PI_180), notUsed1, notUsed2, + factor); //Call to 6S currentWeightingMatrix(i, j) = factor; } } diff --git a/Code/Radiometry/otbTerraSarBrightnessImageFilter.h b/Code/Radiometry/otbTerraSarBrightnessImageFilter.h index 088b601cdb..bde1f9ad66 100644 --- a/Code/Radiometry/otbTerraSarBrightnessImageFilter.h +++ b/Code/Radiometry/otbTerraSarBrightnessImageFilter.h @@ -65,11 +65,11 @@ namespace otb template <class TInputImage, class TOutputImage> class ITK_EXPORT TerraSarBrightnessImageFilter : public itk::UnaryFunctorImageFilter< - TInputImage, - TOutputImage, - ITK_TYPENAME Functor::TerraSarBrightnessFunctor< - ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TInputImage::InternalPixelType>::ValueType, - ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TOutputImage::InternalPixelType>::ValueType> > + TInputImage, + TOutputImage, + ITK_TYPENAME Functor::TerraSarBrightnessFunctor< + ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TInputImage::InternalPixelType>::ValueType, + ITK_TYPENAME itk::NumericTraits<ITK_TYPENAME TOutputImage::InternalPixelType>::ValueType> > { public: /** Extract input and output images dimensions.*/ @@ -90,7 +90,7 @@ public: /** "typedef" for standard classes. */ typedef TerraSarBrightnessImageFilter Self; typedef itk::UnaryFunctorImageFilter<InputImageType, - OutputImageType, FunctorType> Superclass; + OutputImageType, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Radiometry/otbTerraSarCalibrationFunctor.txx b/Code/Radiometry/otbTerraSarCalibrationFunctor.txx index 0231d1eb0d..c4ef881952 100644 --- a/Code/Radiometry/otbTerraSarCalibrationFunctor.txx +++ b/Code/Radiometry/otbTerraSarCalibrationFunctor.txx @@ -64,11 +64,10 @@ TerraSarCalibrationFunctor<TInput, TOutput> // Get polynomial coefficients std::vector<double> coefficients = m_NoiseRecord.get_polynomialCoefficients(); - + // Evaluate double nebn = 0.; - if ( !vnl_math_isnan(deltaTau) && coefficients.size() > 0 ) - nebn = Horner (coefficients, deltaTau); + if (!vnl_math_isnan(deltaTau) && coefficients.size() > 0) nebn = Horner (coefficients, deltaTau); // Do not forget to multiply by the calibration factor nebn *= m_CalibrationFactor; @@ -82,7 +81,7 @@ double TerraSarCalibrationFunctor<TInput, TOutput> ::Horner(std::vector<double>& coefficients, const double nebn) const { std::vector<double>::reverse_iterator coefIt = coefficients.rbegin(); - double res = *(coefIt); + double res = *(coefIt); ++coefIt; while (coefIt < coefficients.rend()) diff --git a/Code/Radiometry/otbTerraSarCalibrationImageFilter.h b/Code/Radiometry/otbTerraSarCalibrationImageFilter.h index d1b15aa5b3..167ef8f8cc 100644 --- a/Code/Radiometry/otbTerraSarCalibrationImageFilter.h +++ b/Code/Radiometry/otbTerraSarCalibrationImageFilter.h @@ -119,7 +119,7 @@ public: /** Calibration functor typedef */ typedef typename Functor::TerraSarCalibrationFunctor<InputValueType, - OutputValueType> CalibrationFunctorType; + OutputValueType> CalibrationFunctorType; /** typedef to access metadata */ typedef itk::MetaDataDictionary MetaDataDictionaryType; diff --git a/Code/Radiometry/otbVegetationIndicesFunctor.h b/Code/Radiometry/otbVegetationIndicesFunctor.h index 37c756bad8..04951bd427 100644 --- a/Code/Radiometry/otbVegetationIndicesFunctor.h +++ b/Code/Radiometry/otbVegetationIndicesFunctor.h @@ -49,12 +49,12 @@ public: typedef itk::VariableLengthVector<TInput1> InputVectorType; //operators != - bool operator != (const RAndNIRIndexBase&) const + bool operator !=(const RAndNIRIndexBase&) const { return false; } //operator == - bool operator == (const RAndNIRIndexBase& other) const + bool operator ==(const RAndNIRIndexBase& other) const { return !(*this != other); } @@ -153,13 +153,13 @@ public: typedef itk::VariableLengthVector<TInput1> InputVectorType; //operators != - bool operator != (const RAndBAndNIRIndexBase&) const + bool operator !=(const RAndBAndNIRIndexBase&) const { return false; } //operator == - bool operator == (const RAndBAndNIRIndexBase& other) const + bool operator ==(const RAndBAndNIRIndexBase& other) const { return !(*this != other); } @@ -330,7 +330,6 @@ public: } } - /// Set Red Index void SetRedIndex(unsigned int channel) { @@ -378,7 +377,6 @@ private: unsigned int m_NIRIndex; }; - /** \class NDVI * \brief This functor computes the Normalized Difference Vegetation Index (NDVI) * @@ -473,7 +471,7 @@ public: return "PVI"; } - PVI(): m_A(0.90893), m_B(7.46216), m_Coeff(0.74) {} + PVI() : m_A(0.90893), m_B(7.46216), m_Coeff(0.74) {} virtual ~PVI() {} /** Set/Get A and B parameters */ void SetA(const double A) @@ -635,7 +633,6 @@ private: }; - /** \class WDVI * \brief This functor computes the Weighted Difference Vegetation Index (WDVI) * @@ -755,7 +752,6 @@ private: }; - /** \class MSAVI2 * \brief This functor computes the Modified Soil Adjusted Vegetation Index (MSAVI2) * diff --git a/Code/Radiometry/otbWaterIndicesFunctor.h b/Code/Radiometry/otbWaterIndicesFunctor.h index 6f572f4920..3fbe86a1ca 100644 --- a/Code/Radiometry/otbWaterIndicesFunctor.h +++ b/Code/Radiometry/otbWaterIndicesFunctor.h @@ -323,7 +323,6 @@ public: } } - protected: inline TOutput Evaluate(const TInput1& g, const TInput2& nir) const { @@ -407,7 +406,6 @@ public: } } - protected: inline TOutput Evaluate(const TInput1& g, const TInput2& mir) const { @@ -491,7 +489,6 @@ public: } } - protected: inline TOutput Evaluate(const TInput1& mir, const TInput2& g) const { @@ -577,7 +574,6 @@ public: } } - protected: inline TOutput Evaluate(const TInput1& r, const TInput2& g) const { @@ -713,7 +709,6 @@ public: } } - protected: inline TOutputPixel Evaluate(const TInputVectorPixel& inPix) const { diff --git a/Code/Radiometry/otbWaterSqrtSpectralAngleImageFilter.h b/Code/Radiometry/otbWaterSqrtSpectralAngleImageFilter.h index ae8286f2ac..896c54f143 100644 --- a/Code/Radiometry/otbWaterSqrtSpectralAngleImageFilter.h +++ b/Code/Radiometry/otbWaterSqrtSpectralAngleImageFilter.h @@ -30,7 +30,7 @@ namespace otb * * This filter calculates a pixel wise water indice by calculating * the spectral angle distance with a reference radiometry. - * This class is templated over the input multispectral image type, + * This class is templated over the input multispectral image type, * and the output image type. * By default, the filter use the channel 0 as blue, the channel 1 as * green, the channel 2 as red, and the channel 3 as near @@ -44,9 +44,9 @@ namespace otb */ template <class TInputVectorImage, class TOutputImage, - class TFunction = Functor::WaterSqrtSpectralAngleFunctor < - typename TInputVectorImage::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::WaterSqrtSpectralAngleFunctor < + typename TInputVectorImage::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT WaterSqrtSpectralAngleImageFilter : public itk::UnaryFunctorImageFilter<TInputVectorImage, TOutputImage, TFunction> { diff --git a/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.h b/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.h index 858a9f3a43..89c3223d5f 100644 --- a/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.h +++ b/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.h @@ -35,12 +35,12 @@ namespace otb */ template <class TInputImage, class TOutputImage, - class TFunction = Functor::PolarimetricSynthesisFunctor< - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TInputImage::InternalPixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::PolarimetricSynthesisFunctor< + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TInputImage::InternalPixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT MultiChannelsPolarimetricSynthesisFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage> { public: diff --git a/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.txx b/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.txx index e14d501baf..82d7acebf9 100644 --- a/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.txx +++ b/Code/SARPolarimetry/otbMultiChannelsPolarimetricSynthesisFilter.txx @@ -177,54 +177,54 @@ MultiChannelsPolarimetricSynthesisFilter<TInputImage, TOutputImage, TFunction> // Computation with 4 channels switch (val) { - case HH_HV_VH_VV: - while (!inputIt.IsAtEnd()) - { - outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], - inputIt.Get()[2], inputIt.Get()[3])); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here - } - break; + case HH_HV_VH_VV: + while (!inputIt.IsAtEnd()) + { + outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], + inputIt.Get()[2], inputIt.Get()[3])); + ++inputIt; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; - // With 3 channels : HH HV VV ou HH VH VV - case HH_HV_VV: - while (!inputIt.IsAtEnd()) - { - outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], - inputIt.Get()[1], inputIt.Get()[2])); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here - } - break; + // With 3 channels : HH HV VV ou HH VH VV + case HH_HV_VV: + while (!inputIt.IsAtEnd()) + { + outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], + inputIt.Get()[1], inputIt.Get()[2])); + ++inputIt; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; - // Only HH and HV are present - case HH_HV: - while (!inputIt.IsAtEnd()) - { - outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], 0, 0)); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here - } - break; + // Only HH and HV are present + case HH_HV: + while (!inputIt.IsAtEnd()) + { + outputIt.Set(m_Gain * GetFunctor() (inputIt.Get()[0], inputIt.Get()[1], 0, 0)); + ++inputIt; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; - // Only VH and VV are present - case VH_VV: - while (!inputIt.IsAtEnd()) - { - outputIt.Set(m_Gain * GetFunctor() (0, 0, inputIt.Get()[2], inputIt.Get()[3])); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here - } - break; + // Only VH and VV are present + case VH_VV: + while (!inputIt.IsAtEnd()) + { + outputIt.Set(m_Gain * GetFunctor() (0, 0, inputIt.Get()[2], inputIt.Get()[3])); + ++inputIt; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; - default: - itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); - return; + default: + itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); + return; } } @@ -283,31 +283,31 @@ MultiChannelsPolarimetricSynthesisFilter<TInputImage, TOutputImage, TFunction> switch (val) { - case HH_HV_VH_VV: - break; - case HH_HV_VV: - break; - case HH_VH_VV: - break; - // Only HH and HV are present - case HH_HV: - - // Forcing KhiI=0 PsiI=0 - this->SetKhiI(0); - this->SetPsiI(0); - break; - - // Only VH and VV are present - case VH_VV: - - // Forcing KhiI=0 PsiI=90 - this->SetKhiI(0); - this->SetPsiI(90); - break; - - default: - itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !!"); - return; + case HH_HV_VH_VV: + break; + case HH_HV_VV: + break; + case HH_VH_VV: + break; + // Only HH and HV are present + case HH_HV: + + // Forcing KhiI=0 PsiI=0 + this->SetKhiI(0); + this->SetPsiI(0); + break; + + // Only VH and VV are present + case VH_VV: + + // Forcing KhiI=0 PsiI=90 + this->SetKhiI(0); + this->SetPsiI(90); + break; + + default: + itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !!"); + return; } if (GetMode() == 1) ForceCoPolar(); diff --git a/Code/SARPolarimetry/otbPolarimetricData.cxx b/Code/SARPolarimetry/otbPolarimetricData.cxx index bbc5834714..8a9114a2f9 100644 --- a/Code/SARPolarimetry/otbPolarimetricData.cxx +++ b/Code/SARPolarimetry/otbPolarimetricData.cxx @@ -81,29 +81,29 @@ PolarimetricData switch (NumberOfImages) { - case 4: - SetArchitectureType(HH_HV_VH_VV); - break; - - case 3: - SetArchitectureType(HH_HV_VV); - break; - - case 2: - - if (EmissionH && !EmissionV) - { - SetArchitectureType(HH_HV); - } - else if (!EmissionH && EmissionV) - { - SetArchitectureType(VH_VV); - } - break; - - default: - itkExceptionMacro("Unknown architecture !"); - return; + case 4: + SetArchitectureType(HH_HV_VH_VV); + break; + + case 3: + SetArchitectureType(HH_HV_VV); + break; + + case 2: + + if (EmissionH && !EmissionV) + { + SetArchitectureType(HH_HV); + } + else if (!EmissionH && EmissionV) + { + SetArchitectureType(VH_VV); + } + break; + + default: + itkExceptionMacro("Unknown architecture !"); + return; } } diff --git a/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.h b/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.h index 8a9e25eadd..b6c6255632 100644 --- a/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.h +++ b/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.h @@ -57,23 +57,23 @@ namespace otb */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction = Functor::PolarimetricSynthesisFunctor< - typename TInputImageHH::PixelType, - typename TInputImageHV::PixelType, - typename TInputImageVH::PixelType, - typename TInputImageVV::PixelType, - typename TOutputImage::PixelType> > + class TFunction = Functor::PolarimetricSynthesisFunctor< + typename TInputImageHH::PixelType, + typename TInputImageHV::PixelType, + typename TInputImageVH::PixelType, + typename TInputImageVV::PixelType, + typename TOutputImage::PixelType> > class ITK_EXPORT PolarimetricSynthesisFilter : public otb::QuaternaryFunctorImageFilter<TInputImageHH, - TInputImageHV, TInputImageVH, - TInputImageVV, TOutputImage, - TFunction> + TInputImageHV, TInputImageVH, + TInputImageVV, TOutputImage, + TFunction> { public: /** Standard typedefs */ typedef PolarimetricSynthesisFilter Self; typedef otb::QuaternaryFunctorImageFilter<TInputImageHH, TInputImageHV, - TInputImageVH, TInputImageVV, TOutputImage, TFunction> Superclass; + TInputImageVH, TInputImageVV, TOutputImage, TFunction> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.txx b/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.txx index 45bf710bae..dc9b065f3a 100644 --- a/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.txx +++ b/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.txx @@ -28,7 +28,7 @@ namespace otb * Constructor */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::PolarimetricSynthesisFilter() { @@ -44,7 +44,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI } template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::GenerateOutputInformation() @@ -69,7 +69,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::SetInputHH(const TInputImageHH * image) @@ -83,7 +83,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::SetInputHV(const TInputImageHV * image) @@ -96,7 +96,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::SetInputVH(const TInputImageVH * image) @@ -109,7 +109,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Connect one of the operands for pixel-wise addition */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::SetInputVV(const TInputImageVV * image) @@ -122,7 +122,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Printself */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::PrintSelf(std::ostream& os, itk::Indent indent) const @@ -149,7 +149,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Force Copolar mode */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::ForceCoPolar() @@ -163,7 +163,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Force Crosspolar mode */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::ForceCrossPolar() @@ -177,7 +177,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Verify and force the inputs, if only 2 or 3 channels are present. Determine the kind of architecture. */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::VerifyAndForceInputs() @@ -185,28 +185,28 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI switch (m_ArchitectureType->GetArchitectureType()) { - case HH_HV: - // Forcing KhiI=0 PsiI=0 - this->SetKhiI(0); - this->SetPsiI(0); - break; + case HH_HV: + // Forcing KhiI=0 PsiI=0 + this->SetKhiI(0); + this->SetPsiI(0); + break; - case VH_VV: - // Forcing KhiI=0 PsiI=90 - this->SetKhiI(0); - this->SetPsiI(90); - break; + case VH_VV: + // Forcing KhiI=0 PsiI=90 + this->SetKhiI(0); + this->SetPsiI(90); + break; - case HH_VV: - itkExceptionMacro("Only the HH and VV channels are available : Polarimetric synthesis is not supported !"); - return; + case HH_VV: + itkExceptionMacro("Only the HH and VV channels are available : Polarimetric synthesis is not supported !"); + return; - case UNKNOWN: - itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); - return; + case UNKNOWN: + itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); + return; - default: - break; + default: + break; } @@ -219,7 +219,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * Computation of the electromagnetic fields Ei Er */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::ComputeElectromagneticFields() @@ -260,7 +260,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * BeforeThreadedGenerateData */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::BeforeThreadedGenerateData() @@ -281,7 +281,7 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI * ThreadedGenerateData function. Performs the pixel-wise addition */ template <class TInputImageHH, class TInputImageHV, class TInputImageVH, class TInputImageVV, class TOutputImage, - class TFunction> + class TFunction> void PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputImageVV, TOutputImage, TFunction> ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, @@ -294,169 +294,172 @@ PolarimetricSynthesisFilter<TInputImageHH, TInputImageHV, TInputImageVH, TInputI switch (m_ArchitectureType->GetArchitectureType()) { - // With 4 channels : - case HH_HV_VH_VV: - { - // We use dynamic_cast since inputs are stored as DataObjects. The - // ImageToImageFilter::GetInput(int) always returns a pointer to a - // TInputImage1 so it cannot be used for the second or third input. - HHInputImagePointer inputPtrHH - = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); - HVInputImagePointer inputPtrHV - = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); - VHInputImagePointer inputPtrVH - = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); - VVInputImagePointer inputPtrVV - = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); - - itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); - - itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); - - inputItHH.GoToBegin(); - inputItHV.GoToBegin(); - inputItVH.GoToBegin(); - inputItVV.GoToBegin(); - - while (!inputItHH.IsAtEnd()) + // With 4 channels : + case HH_HV_VH_VV: { - outputIt.Set(m_Gain * Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), inputItVH.Get(), inputItVV.Get())); - ++inputItHH; - ++inputItHV; - ++inputItVH; - ++inputItVV; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here + // We use dynamic_cast since inputs are stored as DataObjects. The + // ImageToImageFilter::GetInput(int) always returns a pointer to a + // TInputImage1 so it cannot be used for the second or third input. + HHInputImagePointer inputPtrHH + = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); + HVInputImagePointer inputPtrHV + = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); + VHInputImagePointer inputPtrVH + = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); + VVInputImagePointer inputPtrVV + = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); + + itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); + + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + inputItHH.GoToBegin(); + inputItHV.GoToBegin(); + inputItVH.GoToBegin(); + inputItVV.GoToBegin(); + + while (!inputItHH.IsAtEnd()) + { + outputIt.Set(m_Gain * + Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), inputItVH.Get(), inputItVV.Get())); + ++inputItHH; + ++inputItHV; + ++inputItVH; + ++inputItVV; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; } - break; - } - // With 3 channels : HH HV VV - case HH_HV_VV: - - { - HHInputImagePointer inputPtrHH - = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); - HVInputImagePointer inputPtrHV - = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); - VVInputImagePointer inputPtrVV - = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); + // With 3 channels : HH HV VV + case HH_HV_VV: - itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); - itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); - - itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); - - inputItHH.GoToBegin(); - inputItHV.GoToBegin(); - inputItVV.GoToBegin(); - - while (!inputItHH.IsAtEnd()) { - outputIt.Set(m_Gain * Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), inputItHV.Get(), inputItVV.Get())); - ++inputItHH; - ++inputItHV; - ++inputItVV; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here + HHInputImagePointer inputPtrHH + = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); + HVInputImagePointer inputPtrHV + = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); + VVInputImagePointer inputPtrVV + = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); + + itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); + itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); + + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + inputItHH.GoToBegin(); + inputItHV.GoToBegin(); + inputItVV.GoToBegin(); + + while (!inputItHH.IsAtEnd()) + { + outputIt.Set(m_Gain * + Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), inputItHV.Get(), inputItVV.Get())); + ++inputItHH; + ++inputItHV; + ++inputItVV; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; } - break; - } - // With 3 channels : HH VH VV - case HH_VH_VV: - { - - HHInputImagePointer inputPtrHH - = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); - VHInputImagePointer inputPtrVH - = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); - VVInputImagePointer inputPtrVV - = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); - OutputImagePointer outputPtr = this->GetOutput(0); - - itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); - - itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); - - inputItHH.GoToBegin(); - inputItVH.GoToBegin(); - inputItVV.GoToBegin(); - - while (!inputItHH.IsAtEnd()) + // With 3 channels : HH VH VV + case HH_VH_VV: { - outputIt.Set(m_Gain * Superclass::GetFunctor() (inputItHH.Get(), inputItVH.Get(), inputItVH.Get(), inputItVV.Get())); - ++inputItHH; - ++inputItVH; - ++inputItVV; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here - } - break; - } - // With 2 channels : HH HV - case HH_HV: - { - - HHInputImagePointer inputPtrHH - = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); - HVInputImagePointer inputPtrHV - = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); - - itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); - itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); - itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); - - inputItHH.GoToBegin(); - inputItHV.GoToBegin(); - - while (!inputItHH.IsAtEnd()) - { - outputIt.Set(m_Gain * Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), 0, 0)); - ++inputItHH; - ++inputItHV; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here + HHInputImagePointer inputPtrHH + = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); + VHInputImagePointer inputPtrVH + = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); + VVInputImagePointer inputPtrVV + = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); + OutputImagePointer outputPtr = this->GetOutput(0); + + itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); + + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + inputItHH.GoToBegin(); + inputItVH.GoToBegin(); + inputItVV.GoToBegin(); + + while (!inputItHH.IsAtEnd()) + { + outputIt.Set(m_Gain * + Superclass::GetFunctor() (inputItHH.Get(), inputItVH.Get(), inputItVH.Get(), inputItVV.Get())); + ++inputItHH; + ++inputItVH; + ++inputItVV; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; } - break; - } - // With 2 channels : VH VV - case VH_VV: - { - VHInputImagePointer inputPtrVH - = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); - VVInputImagePointer inputPtrVV - = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); - - itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); - itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); - itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); - - itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); - - inputItVH.GoToBegin(); - inputItVV.GoToBegin(); + // With 2 channels : HH HV + case HH_HV: + { - while (!inputItVH.IsAtEnd()) + HHInputImagePointer inputPtrHH + = dynamic_cast<const TInputImageHH*>((itk::ProcessObject::GetInput(0))); + HVInputImagePointer inputPtrHV + = dynamic_cast<const TInputImageHV*>((itk::ProcessObject::GetInput(1))); + + itk::ImageRegionConstIterator<TInputImageHH> inputItHH(inputPtrHH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageHV> inputItHV(inputPtrHV, outputRegionForThread); + itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); + + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + inputItHH.GoToBegin(); + inputItHV.GoToBegin(); + + while (!inputItHH.IsAtEnd()) + { + outputIt.Set(m_Gain * Superclass::GetFunctor() (inputItHH.Get(), inputItHV.Get(), 0, 0)); + ++inputItHH; + ++inputItHV; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; + } + // With 2 channels : VH VV + case VH_VV: { - outputIt.Set(m_Gain * Superclass::GetFunctor() (0, 0, inputItVH.Get(), inputItVV.Get())); - ++inputItVH; - ++inputItVV; - ++outputIt; - progress.CompletedPixel(); // potential exception thrown here + VHInputImagePointer inputPtrVH + = dynamic_cast<const TInputImageVH*>((itk::ProcessObject::GetInput(2))); + VVInputImagePointer inputPtrVV + = dynamic_cast<const TInputImageVV*>((itk::ProcessObject::GetInput(3))); + + itk::ImageRegionConstIterator<TInputImageVH> inputItVH(inputPtrVH, outputRegionForThread); + itk::ImageRegionConstIterator<TInputImageVV> inputItVV(inputPtrVV, outputRegionForThread); + itk::ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread); + + itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels()); + + inputItVH.GoToBegin(); + inputItVV.GoToBegin(); + + while (!inputItVH.IsAtEnd()) + { + outputIt.Set(m_Gain * Superclass::GetFunctor() (0, 0, inputItVH.Get(), inputItVV.Get())); + ++inputItVH; + ++inputItVV; + ++outputIt; + progress.CompletedPixel(); // potential exception thrown here + } + break; } - break; - } - default: - itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); - return; + default: + itkExceptionMacro("Unknown architecture : Polarimetric synthesis is impossible !"); + return; } } // end namespace otb diff --git a/Code/SpatialReasoning/otbImageToImageRCC8Calculator.txx b/Code/SpatialReasoning/otbImageToImageRCC8Calculator.txx index 8d831f811d..6f5c611c0d 100644 --- a/Code/SpatialReasoning/otbImageToImageRCC8Calculator.txx +++ b/Code/SpatialReasoning/otbImageToImageRCC8Calculator.txx @@ -214,11 +214,11 @@ ImageToImageRCC8Calculator<TInputImage> /// Definition of the Filters used to compute the boolean typedef itk::SubtractImageFilter<BoolImageType, BoolImageType, - BoolImageType> - SubtractFilterType; + BoolImageType> + SubtractFilterType; typedef itk::BinaryBallStructuringElement<bool, - BoolImageType::ImageDimension> - BinaryBallStructuringElementType; + BoolImageType::ImageDimension> + BinaryBallStructuringElementType; typedef itk::BinaryDilateImageFilter<BoolImageType, BoolImageType, BinaryBallStructuringElementType> DilateFilterType; typedef itk::AndImageFilter<BoolImageType, BoolImageType, BoolImageType> AndFilterType; /// Declaration and instantiation diff --git a/Code/SpatialReasoning/otbRCC8Graph.h b/Code/SpatialReasoning/otbRCC8Graph.h index d23fb4dfd9..b5c84311dd 100644 --- a/Code/SpatialReasoning/otbRCC8Graph.h +++ b/Code/SpatialReasoning/otbRCC8Graph.h @@ -71,7 +71,7 @@ public: /** Typedef for the boost graph representation */ typedef boost::adjacency_list <boost::vecS, boost::vecS, boost::bidirectionalS, - VertexPointerType, EdgePointerType> InternalGraphType; + VertexPointerType, EdgePointerType> InternalGraphType; /** Edges and vertices descriptors typedefs (boost objects)*/ typedef typename InternalGraphType::vertex_descriptor VertexDescriptorType; typedef typename InternalGraphType::edge_descriptor EdgeDescriptorType; diff --git a/Code/Testing/otbTestHelper.cxx b/Code/Testing/otbTestHelper.cxx index 7f7cb37137..0bd9820d42 100644 --- a/Code/Testing/otbTestHelper.cxx +++ b/Code/Testing/otbTestHelper.cxx @@ -812,9 +812,10 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b std::string strTestName(test_poDS->GetName()); if (strRefName != strTestName) { - if (!m_ReportErrors) otbPrintDiff("WARNING: INFO: Internal data source name poDS->GetName() were different", - strRefName, - strTestName); + if (!m_ReportErrors) + otbPrintDiff("WARNING: INFO: Internal data source name poDS->GetName() were different", + strRefName, + strTestName); } /* -------------------------------------------------------------------- */ @@ -829,13 +830,15 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b if (ref_poLayer == NULL) { - if (m_ReportErrors) std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << + if (m_ReportErrors) + std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << " for REF data source" << std::endl; return (1); } if (test_poLayer == NULL) { - if (m_ReportErrors) std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << + if (m_ReportErrors) + std::cout << "FAILURE: Couldn't fetch advertised layer " << iLayer << " for REF data source" << std::endl; return (1); } @@ -872,7 +875,7 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b { itkGenericExceptionMacro(<< "Impossible to create ASCII file <" << ref_filename << ">."); } - DumpOGRFeature(ref_f, ref_poFeature ); + DumpOGRFeature(ref_f, ref_poFeature); delete ref_poFeature; fclose(ref_f); @@ -882,7 +885,7 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b { itkGenericExceptionMacro(<< "Impossible to create ASCII file <" << test_filename << ">."); } - DumpOGRFeature(test_f, test_poFeature ); + DumpOGRFeature(test_f, test_poFeature); delete test_poFeature; fclose(test_f); @@ -925,143 +928,136 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b void TestHelper::DumpOGRFeature(FILE* fpOut, OGRFeature* feature, char** papszOptions) { -if( fpOut == NULL ) - fpOut = stdout; + if (fpOut == NULL) fpOut = stdout; -fprintf( fpOut, "OGRFeature(%s):%ld\n", feature->GetDefnRef()->GetName(), feature->GetFID() ); + fprintf(fpOut, "OGRFeature(%s):%ld\n", feature->GetDefnRef()->GetName(), feature->GetFID()); -const char* pszDisplayFields = - CSLFetchNameValue(papszOptions, "DISPLAY_FIELDS"); -if (pszDisplayFields == NULL || CSLTestBoolean(pszDisplayFields)) -{ - for( int iField = 0; iField < feature->GetFieldCount(); iField++ ) + const char* pszDisplayFields = + CSLFetchNameValue(papszOptions, "DISPLAY_FIELDS"); + if (pszDisplayFields == NULL || CSLTestBoolean(pszDisplayFields)) { - OGRFieldDefn *poFDefn = feature->GetDefnRef()->GetFieldDefn(iField); + for (int iField = 0; iField < feature->GetFieldCount(); iField++) + { + OGRFieldDefn *poFDefn = feature->GetDefnRef()->GetFieldDefn(iField); - fprintf( fpOut, " %s (%s) = ", - poFDefn->GetNameRef(), - OGRFieldDefn::GetFieldTypeName(poFDefn->GetType()) ); + fprintf(fpOut, " %s (%s) = ", + poFDefn->GetNameRef(), + OGRFieldDefn::GetFieldTypeName(poFDefn->GetType())); - if( feature->IsFieldSet( iField ) ) - fprintf( fpOut, "%s\n", feature->GetFieldAsString( iField ) ); - else - fprintf( fpOut, "(null)\n" ); + if (feature->IsFieldSet(iField)) fprintf(fpOut, "%s\n", feature->GetFieldAsString(iField)); + else fprintf(fpOut, "(null)\n"); + } } -} - -if( feature->GetStyleString() != NULL ) -{ + if (feature->GetStyleString() != NULL) + { const char* pszDisplayStyle = - CSLFetchNameValue(papszOptions, "DISPLAY_STYLE"); + CSLFetchNameValue(papszOptions, "DISPLAY_STYLE"); if (pszDisplayStyle == NULL || CSLTestBoolean(pszDisplayStyle)) - { - fprintf( fpOut, " Style = %s\n", feature->GetStyleString() ); + { + fprintf(fpOut, " Style = %s\n", feature->GetStyleString()); + } } -} -if( feature->GetGeometryRef() != NULL ) -{ + if (feature->GetGeometryRef() != NULL) + { const char* pszDisplayGeometry = - CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); - if ( ! (pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "NO") ) ) + CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); + if (!(pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "NO"))) { DumpOGRGeometry(fpOut, feature->GetGeometryRef(), " ", papszOptions); } -} + } -fprintf( fpOut, "\n" ); + fprintf(fpOut, "\n"); } void TestHelper::DumpOGRGeometry(FILE* fp, OGRGeometry* geometry, const char * pszPrefix, char** papszOptions) { - char *pszWkt = NULL; + char *pszWkt = NULL; - if( pszPrefix == NULL ) - pszPrefix = ""; + if (pszPrefix == NULL) pszPrefix = ""; - if( fp == NULL ) - fp = stdout; + if (fp == NULL) fp = stdout; - const char* pszDisplayGeometry = - CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); - if (pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "SUMMARY")) - { - OGRLineString *poLine; - OGRPolygon *poPoly; - OGRLinearRing *poRing; - OGRGeometryCollection *poColl; - fprintf( fp, "%s%s : ", pszPrefix, geometry->getGeometryName() ); - switch( geometry->getGeometryType() ) + const char* pszDisplayGeometry = + CSLFetchNameValue(papszOptions, "DISPLAY_GEOMETRY"); + if (pszDisplayGeometry != NULL && EQUAL(pszDisplayGeometry, "SUMMARY")) + { + OGRLineString * poLine; + OGRPolygon * poPoly; + OGRLinearRing * poRing; + OGRGeometryCollection *poColl; + fprintf(fp, "%s%s : ", pszPrefix, geometry->getGeometryName()); + switch (geometry->getGeometryType()) + { + case wkbUnknown: + case wkbNone: + break; + case wkbPoint: + case wkbPoint25D: + break; + case wkbLineString: + case wkbLineString25D: + poLine = (OGRLineString*) geometry; + fprintf(fp, "%d points\n", poLine->getNumPoints()); + break; + case wkbPolygon: + case wkbPolygon25D: { - case wkbUnknown: - case wkbNone: - break; - case wkbPoint: - case wkbPoint25D: - break; - case wkbLineString: - case wkbLineString25D: - poLine = (OGRLineString*)geometry; - fprintf( fp, "%d points\n", poLine->getNumPoints() ); - break; - case wkbPolygon: - case wkbPolygon25D: - { - int ir; - int nRings; - poPoly = (OGRPolygon*)geometry; - poRing = poPoly->getExteriorRing(); - nRings = poPoly->getNumInteriorRings(); - fprintf( fp, "%d points", poRing->getNumPoints() ); - if (nRings) - { - fprintf( fp, ", %d inner rings (", nRings); - for( ir = 0; ir < nRings; ir++) - { - if (ir) - fprintf( fp, ", "); - fprintf( fp, "%d points", - poPoly->getInteriorRing(ir)->getNumPoints() ); - } - fprintf( fp, ")"); - } - fprintf( fp, "\n"); - break; - } - case wkbMultiPoint: - case wkbMultiPoint25D: - case wkbMultiLineString: - case wkbMultiLineString25D: - case wkbMultiPolygon: - case wkbMultiPolygon25D: - case wkbGeometryCollection: - case wkbGeometryCollection25D: + int ir; + int nRings; + poPoly = (OGRPolygon*) geometry; + poRing = poPoly->getExteriorRing(); + nRings = poPoly->getNumInteriorRings(); + fprintf(fp, "%d points", poRing->getNumPoints()); + if (nRings) + { + fprintf(fp, ", %d inner rings (", nRings); + for (ir = 0; ir < nRings; ir++) { - int ig; - poColl = (OGRGeometryCollection*)geometry; - fprintf( fp, "%d geometries:\n", poColl->getNumGeometries() ); - for ( ig = 0; ig < poColl->getNumGeometries(); ig++) - { - OGRGeometry * poChild = (OGRGeometry*)poColl->getGeometryRef(ig); - fprintf( fp, "%s", pszPrefix); - DumpOGRGeometry(fp, poChild, pszPrefix, papszOptions); - } - break; + if (ir) fprintf(fp, ", "); + fprintf(fp, "%d points", + poPoly->getInteriorRing(ir)->getNumPoints()); } - case wkbLinearRing: - break; + fprintf(fp, ")"); + } + fprintf(fp, "\n"); + break; } - } - else if (pszDisplayGeometry == NULL || CSLTestBoolean(pszDisplayGeometry) || - EQUAL(pszDisplayGeometry, "WKT")) - { - if( geometry->exportToWkt( &pszWkt ) == OGRERR_NONE ) + case wkbMultiPoint: + case wkbMultiPoint25D: + case wkbMultiLineString: + case wkbMultiLineString25D: + case wkbMultiPolygon: + case wkbMultiPolygon25D: + case wkbGeometryCollection: + case wkbGeometryCollection25D: { - fprintf( fp, "%s%s\n", pszPrefix, pszWkt ); - CPLFree( pszWkt ); + int ig; + poColl = (OGRGeometryCollection*) geometry; + fprintf(fp, "%d geometries:\n", poColl->getNumGeometries()); + for (ig = 0; ig < poColl->getNumGeometries(); ig++) + { + OGRGeometry * poChild = (OGRGeometry*) poColl->getGeometryRef(ig); + fprintf(fp, "%s", pszPrefix); + DumpOGRGeometry(fp, poChild, pszPrefix, papszOptions); + } + break; } + case wkbLinearRing: + break; + } + } + else if (pszDisplayGeometry == NULL || CSLTestBoolean(pszDisplayGeometry) || + EQUAL(pszDisplayGeometry, "WKT")) + { + if (geometry->exportToWkt(&pszWkt) == OGRERR_NONE) + { + fprintf(fp, "%s%s\n", pszPrefix, pszWkt); + CPLFree(pszWkt); + } } } @@ -1350,8 +1346,8 @@ bool TestHelper::CompareLines(std::string strfileref, if (isNumeric(strRef)) { - if ((strRef != strTest) && (vcl_abs(atof(strRef.c_str())) > m_EpsilonBoundaryChecking) - && (vcl_abs(atof(strRef.c_str()) - atof(strTest.c_str())) > epsilon * vcl_abs(atof(strRef.c_str())))) //epsilon as relative error + if ((strRef != strTest) && (vcl_abs(atof(strRef.c_str())) > m_EpsilonBoundaryChecking) + && (vcl_abs(atof(strRef.c_str()) - atof(strTest.c_str())) > epsilon * vcl_abs(atof(strRef.c_str())))) //epsilon as relative error { if (m_ReportErrors) { diff --git a/Code/Testing/otbTestMain.h b/Code/Testing/otbTestMain.h index d00fd3346b..f226754dc5 100644 --- a/Code/Testing/otbTestMain.h +++ b/Code/Testing/otbTestMain.h @@ -347,7 +347,7 @@ int main(int ac, char* av[]) std::string testFilenameImage = (*itTestFilenames); std::map<std::string, - int> baselines = + int> baselines = testHelper.RegressionTestbaselines(const_cast<char*>(baselineFilenameImage.c_str())); std::map<std::string, int>::reverse_iterator baseline = baselines.rbegin(); multiResult = 1; @@ -393,7 +393,7 @@ int main(int ac, char* av[]) std::string testFilenameImage = (*itTestFilenames); std::map<std::string, - int> baselines = + int> baselines = testHelper.RegressionTestbaselines(const_cast<char*>(baselineFilenameImage.c_str())); std::map<std::string, int>::reverse_iterator baseline = baselines.rbegin(); multiResult = 1; @@ -451,7 +451,7 @@ int main(int ac, char* av[]) std::string testFilenameAscii = (*itTestFilenames); std::map<std::string, - int> baselines = + int> baselines = testHelper.RegressionTestbaselines(const_cast<char*>(baselineFilenameAscii.c_str())); std::map<std::string, int>::reverse_iterator baseline = baselines.rbegin(); multiResult = 1; @@ -500,7 +500,7 @@ int main(int ac, char* av[]) std::string testFilenameBinary = (*itTestFilenames); std::map<std::string, - int> baselines = + int> baselines = testHelper.RegressionTestbaselines(const_cast<char*>(baselineFilenameBinary.c_str())); std::map<std::string, int>::reverse_iterator baseline = baselines.rbegin(); multiResult = 1; @@ -541,7 +541,7 @@ int main(int ac, char* av[]) std::string testFilenameOgr = (*itTestFilenames); std::map<std::string, - int> baselines = + int> baselines = testHelper.RegressionTestbaselines(const_cast<char*>(baselineFilenameOgr.c_str())); std::map<std::string, int>::reverse_iterator baseline = baselines.rbegin(); multiResult = 1; diff --git a/Code/Visu/otbImageAlternateViewer.txx b/Code/Visu/otbImageAlternateViewer.txx index eaa1b677da..d170718504 100644 --- a/Code/Visu/otbImageAlternateViewer.txx +++ b/Code/Visu/otbImageAlternateViewer.txx @@ -552,59 +552,59 @@ ImageAlternateViewer<TPixel> switch (part) { - case 0: - index = deUL; - size[0] = max(bufUL[0] - deUL[0], 0L); - size[1] = max(bufUL[1] - deUL[1], 0L); - break; - - case 1: - index[0] = max(deUL[0], bufUL[0]); - index[1] = deUL[1]; - size[0] = min(bufLR[0] - max(bufUL[0], 0L), deLR[0] - index[0]); - size[1] = max(bufUL[1] - deUL[1], 0L); - break; - - case 2: - index[0] = min(bufLR[0], deLR[0]); - index[1] = deUL[1]; - size[0] = max(deLR[0] - bufLR[0], 0L); - size[1] = max(bufUL[1] - deUL[1], 0L); - break; - - case 3: - index[0] = deUL[0]; - index[1] = max(bufUL[1], 0L); - size[0] = max(bufUL[0] - deUL[0], 0L); - size[1] = min(bufLR[1] - max(bufUL[1], 0L), deLR[1] - index[1]); - break; - - case 4: - index[0] = min(bufLR[0], deLR[0]); - index[1] = max(bufUL[1], deUL[0]); - size[0] = max(deLR[0] - bufLR[0], 0L); - size[1] = min(bufLR[1] - max(bufUL[1], 0L), deLR[1] - index[1]); - break; - - case 5: - index[0] = deUL[0]; - index[1] = min(deLR[1], bufLR[1]); - size[0] = max(bufUL[0] - deUL[0], 0L); - size[1] = max(deLR[1] - bufLR[1], 0L); - break; - - case 6: - index[0] = max(deUL[0], bufUL[0]); - index[1] = min(deLR[1], bufLR[1]); - size[0] = min(bufLR[0] - max(bufUL[0], 0L), deLR[0] - index[0]); - size[1] = max(deLR[1] - bufLR[1], 0L); - break; - - case 7: - index[0] = min(bufLR[0], deLR[0]); - index[1] = min(deLR[1], bufLR[1]); - size[0] = max(deLR[0] - bufLR[0], 0L); - size[1] = max(deLR[1] - bufLR[1], 0L); + case 0: + index = deUL; + size[0] = max(bufUL[0] - deUL[0], 0L); + size[1] = max(bufUL[1] - deUL[1], 0L); + break; + + case 1: + index[0] = max(deUL[0], bufUL[0]); + index[1] = deUL[1]; + size[0] = min(bufLR[0] - max(bufUL[0], 0L), deLR[0] - index[0]); + size[1] = max(bufUL[1] - deUL[1], 0L); + break; + + case 2: + index[0] = min(bufLR[0], deLR[0]); + index[1] = deUL[1]; + size[0] = max(deLR[0] - bufLR[0], 0L); + size[1] = max(bufUL[1] - deUL[1], 0L); + break; + + case 3: + index[0] = deUL[0]; + index[1] = max(bufUL[1], 0L); + size[0] = max(bufUL[0] - deUL[0], 0L); + size[1] = min(bufLR[1] - max(bufUL[1], 0L), deLR[1] - index[1]); + break; + + case 4: + index[0] = min(bufLR[0], deLR[0]); + index[1] = max(bufUL[1], deUL[0]); + size[0] = max(deLR[0] - bufLR[0], 0L); + size[1] = min(bufLR[1] - max(bufUL[1], 0L), deLR[1] - index[1]); + break; + + case 5: + index[0] = deUL[0]; + index[1] = min(deLR[1], bufLR[1]); + size[0] = max(bufUL[0] - deUL[0], 0L); + size[1] = max(deLR[1] - bufLR[1], 0L); + break; + + case 6: + index[0] = max(deUL[0], bufUL[0]); + index[1] = min(deLR[1], bufLR[1]); + size[0] = min(bufLR[0] - max(bufUL[0], 0L), deLR[0] - index[0]); + size[1] = max(deLR[1] - bufLR[1], 0L); + break; + + case 7: + index[0] = min(bufLR[0], deLR[0]); + index[1] = min(deLR[1], bufLR[1]); + size[0] = max(deLR[0] - bufLR[0], 0L); + size[1] = max(deLR[1] - bufLR[1], 0L); } region.SetSize(size); region.SetIndex(index); @@ -812,119 +812,121 @@ ImageAlternateViewer<TPixel> if (m_Updating) return 0; switch (event) { - case FL_PUSH: - { - if (!m_Drag) + case FL_PUSH: + { + if (!m_Drag) + { + m_OldMousePos[0] = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[0] / 2) + + (static_cast<double>(Fl::event_x()) - + static_cast<double>( + m_DisplayExtent.GetSize()[0] / 2)) / m_OpenGlIsotropicZoom); + m_OldMousePos[1] = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[1] / 2) + + (static_cast<double>(Fl::event_y()) - + static_cast<double>( + m_DisplayExtent.GetSize()[1] / 2)) / m_OpenGlIsotropicZoom); + m_Drag = true; + m_DragEventCounter = 0; + + if (m_SubWindowRegion.IsInside(m_OldMousePos)) + { + m_SubWindowMove = true; + } + else + { + m_OldViewedRegionCenter = m_ViewedRegionCenter; + } + } + return 1; + } + + case FL_DRAG: { - m_OldMousePos[0] = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[0] / 2) - + (static_cast<double>(Fl::event_x()) - - static_cast<double>( - m_DisplayExtent.GetSize()[0] / 2)) / m_OpenGlIsotropicZoom); - m_OldMousePos[1] = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[1] / 2) - + (static_cast<double>(Fl::event_y()) - - static_cast<double>( - m_DisplayExtent.GetSize()[1] / 2)) / m_OpenGlIsotropicZoom); m_Drag = true; - m_DragEventCounter = 0; - if (m_SubWindowRegion.IsInside(m_OldMousePos)) + int x = static_cast<int>(static_cast<double>(m_DisplayExtent.GetSize()[0] / 2) + + (Fl::event_x() - static_cast<double>( + m_DisplayExtent.GetSize()[0] / 2)) / m_OpenGlIsotropicZoom); + int y = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[1] / 2) + + (Fl::event_y() - static_cast<double>( + m_DisplayExtent.GetSize()[1] / 2)) / m_OpenGlIsotropicZoom); + if (Fl::event_button() == FL_MIDDLE_MOUSE) + { + if (!m_SubWindowMode) m_SubWindowMode = true; + IndexType newIndex; + SizeType newSize; + + newIndex[0] = (x > m_OldMousePos[0] ? m_OldMousePos[0] : x); + newIndex[1] = (y > m_OldMousePos[1] ? m_OldMousePos[1] : y); + newSize[0] = vcl_abs(x - m_OldMousePos[0]); + newSize[1] = vcl_abs(y - m_OldMousePos[1]); + m_SubWindowRegion.SetIndex(newIndex); + m_SubWindowRegion.SetSize(newSize); + this->redraw(); + ++m_DragEventCounter; + } + else if (m_SubWindowMove) { - m_SubWindowMove = true; + IndexType index = m_SubWindowRegion.GetIndex(); + index[0] += (x - m_OldMousePos[0]); + index[1] += (y - m_OldMousePos[1]); + m_SubWindowRegion.SetIndex(index); + m_OldMousePos[0] = x; + m_OldMousePos[1] = y; + this->redraw(); + ++m_DragEventCounter; } + else { - m_OldViewedRegionCenter = m_ViewedRegionCenter; + SpacingType spacing = m_Image->GetSpacing() * m_SpacingZoomFactor; + PointType origin; + origin[0] = static_cast<double>(m_OldViewedRegionCenter[0]) - static_cast<double>( + this->m_DisplayExtent.GetSize()[0] / 2) * spacing[0]; + origin[1] = static_cast<double>(m_OldViewedRegionCenter[1]) - static_cast<double>( + this->m_DisplayExtent.GetSize()[1] / 2) * spacing[1]; + PointType newCenter; + newCenter[0] = origin[0] + + static_cast<double>(m_OldMousePos[0] - x + static_cast<long>( + this->m_DisplayExtent.GetSize()[0]) / + 2) * spacing[0]; + newCenter[1] = origin[1] + + static_cast<double>(m_OldMousePos[1] - y + static_cast<long>( + this->m_DisplayExtent.GetSize()[1]) / + 2) * spacing[1]; + m_Image->TransformPhysicalPointToIndex(newCenter, m_ViewedRegionCenter); + this->redraw(); + ++m_DragEventCounter; } + + DecorationRedraw(); + return 1; } - return 1; - } - case FL_DRAG: - { - m_Drag = true; - - int x = static_cast<int>(static_cast<double>(m_DisplayExtent.GetSize()[0] / 2) - + (Fl::event_x() - static_cast<double>( - m_DisplayExtent.GetSize()[0] / 2)) / m_OpenGlIsotropicZoom); - int y = static_cast<long int>(static_cast<double>(m_DisplayExtent.GetSize()[1] / 2) - + (Fl::event_y() - static_cast<double>( - m_DisplayExtent.GetSize()[1] / 2)) / m_OpenGlIsotropicZoom); - if (Fl::event_button() == FL_MIDDLE_MOUSE) + case FL_RELEASE: { - if (!m_SubWindowMode) m_SubWindowMode = true; - IndexType newIndex; - SizeType newSize; - - newIndex[0] = (x > m_OldMousePos[0] ? m_OldMousePos[0] : x); - newIndex[1] = (y > m_OldMousePos[1] ? m_OldMousePos[1] : y); - newSize[0] = vcl_abs(x - m_OldMousePos[0]); - newSize[1] = vcl_abs(y - m_OldMousePos[1]); - m_SubWindowRegion.SetIndex(newIndex); - m_SubWindowRegion.SetSize(newSize); - this->redraw(); - ++m_DragEventCounter; + m_OldViewedRegionCenter = m_ViewedRegionCenter; + m_Drag = false; + AdditionalRedraw(); + m_SubWindowMove = false; + return 1; } - else if (m_SubWindowMove) + case FL_FOCUS: { - IndexType index = m_SubWindowRegion.GetIndex(); - index[0] += (x - m_OldMousePos[0]); - index[1] += (y - m_OldMousePos[1]); - m_SubWindowRegion.SetIndex(index); - m_OldMousePos[0] = x; - m_OldMousePos[1] = y; - this->redraw(); - ++m_DragEventCounter; + return 1; } - - else + case FL_UNFOCUS: { - SpacingType spacing = m_Image->GetSpacing() * m_SpacingZoomFactor; - PointType origin; - origin[0] = static_cast<double>(m_OldViewedRegionCenter[0]) - static_cast<double>( - this->m_DisplayExtent.GetSize()[0] / 2) * spacing[0]; - origin[1] = static_cast<double>(m_OldViewedRegionCenter[1]) - static_cast<double>( - this->m_DisplayExtent.GetSize()[1] / 2) * spacing[1]; - PointType newCenter; - newCenter[0] = origin[0] + - static_cast<double>(m_OldMousePos[0] - x + static_cast<long>(this->m_DisplayExtent.GetSize()[0]) / - 2) * spacing[0]; - newCenter[1] = origin[1] + - static_cast<double>(m_OldMousePos[1] - y + static_cast<long>(this->m_DisplayExtent.GetSize()[1]) / - 2) * spacing[1]; - m_Image->TransformPhysicalPointToIndex(newCenter, m_ViewedRegionCenter); - this->redraw(); - ++m_DragEventCounter; + return 1; } - - DecorationRedraw(); - return 1; - } - - case FL_RELEASE: - { - m_OldViewedRegionCenter = m_ViewedRegionCenter; - m_Drag = false; - AdditionalRedraw(); - m_SubWindowMove = false; - return 1; - } - case FL_FOCUS: - { - return 1; - } - case FL_UNFOCUS: - { - return 1; - } - case FL_KEYDOWN: - { - if (Fl::event_key() == 116) // T key + case FL_KEYDOWN: { - m_SubWindowMode = !m_SubWindowMode; - this->redraw(); + if (Fl::event_key() == 116) // T key + { + m_SubWindowMode = !m_SubWindowMode; + this->redraw(); + } + return 1; } - return 1; - } } return 0; } diff --git a/Code/Visu/otbImageToGrayscaleAnaglyphImageFilter.h b/Code/Visu/otbImageToGrayscaleAnaglyphImageFilter.h index 4d34a3912b..f57d541b5e 100644 --- a/Code/Visu/otbImageToGrayscaleAnaglyphImageFilter.h +++ b/Code/Visu/otbImageToGrayscaleAnaglyphImageFilter.h @@ -65,11 +65,11 @@ template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT ImageToGrayscaleAnaglyphImageFilter : public itk::BinaryFunctorImageFilter <TInputImage1, TInputImage2, TOutputImage, - Functor::GrayscaleAnaglyphFunctor< - typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType - > > + Functor::GrayscaleAnaglyphFunctor< + typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType + > > { public: /** Standard typedefs */ @@ -77,11 +77,11 @@ public: typedef itk::BinaryFunctorImageFilter <TInputImage1, TInputImage2, TOutputImage, - Functor::GrayscaleAnaglyphFunctor< - typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType - > > Superclass; + Functor::GrayscaleAnaglyphFunctor< + typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType + > > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visu/otbImageViewerBase.h b/Code/Visu/otbImageViewerBase.h index 78c3e9c64a..296a7351aa 100644 --- a/Code/Visu/otbImageViewerBase.h +++ b/Code/Visu/otbImageViewerBase.h @@ -118,17 +118,17 @@ public: typedef itk::Statistics::ListSample<MeasurementVectorType> ListSampleType; typedef float HistogramMeasurementType; typedef itk::Statistics::ListSampleToHistogramGenerator<ListSampleType, HistogramMeasurementType, - itk::Statistics::DenseFrequencyContainer, - 1> HistogramGeneratorType; + itk::Statistics::DenseFrequencyContainer, + 1> HistogramGeneratorType; typedef otb::ObjectList<ListSampleType> - ListSampleListType; + ListSampleListType; typedef otb::ObjectList<HistogramGeneratorType> - HistogramGeneratorListType; + HistogramGeneratorListType; typedef typename HistogramGeneratorListType::Pointer - HistogramGeneratorListPointerType; + HistogramGeneratorListPointerType; typedef typename HistogramGeneratorType::HistogramType HistogramType; typedef otb::ImageViewerHistogramAndTransferFunctionWidget<HistogramType, InputPixelType, - LabelType> HistogramWidgetType; + LabelType> HistogramWidgetType; typedef typename HistogramWidgetType::Pointer HistogramWidgetPointerType; diff --git a/Code/Visu/otbImageViewerBase.txx b/Code/Visu/otbImageViewerBase.txx index 6b1f97fa2d..3f48fb6258 100644 --- a/Code/Visu/otbImageViewerBase.txx +++ b/Code/Visu/otbImageViewerBase.txx @@ -1052,146 +1052,146 @@ ImageViewerBase<TPixel, TLabel> switch (viewModel) { - case ScrollWidgetType::RGB: - { + case ScrollWidgetType::RGB: + { // if(m_InputImage->GetNumberOfComponentsPerPixel()>2) // { //NOTE: No reason to prevent a 2 bands image to be displayed in RGB // and the image is not necessarily loaded at that time. - if (m_UseScroll) - { - m_ScrollWidget->SetViewModel(viewModel); - m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); - m_ScrollWidget->SetBlueChannelIndex(m_BlueChannelIndex); - } - m_FullWidget->SetViewModel(viewModel); - m_ZoomWidget->SetViewModel(viewModel); - m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); - m_ZoomWidget->SetBlueChannelIndex(m_BlueChannelIndex); - m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); - m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); - m_FullWidget->SetBlueChannelIndex(m_BlueChannelIndex); - - ComputeNormalizationFactors(); - - typename HistogramWidgetType::ColorType blue, red, green; - - red[0] = 0.5; - red[1] = 0; - red[2] = 0; - - green[0] = 0; - green[1] = 0.5; - green[2] = 0; - - blue[0] = 0; - blue[1] = 0; - blue[2] = 0.5; - - m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_RedChannelIndex)->GetOutput()); - m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_RedChannelIndex)); - m_RedHistogramWidget->SetLabel("Red channel"); - m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); - m_RedHistogramWidget->SetHistogramColor(red); - m_RedHistogramWidget->SetTextColor(red); - - m_BlueHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_BlueChannelIndex)->GetOutput()); - m_BlueHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_BlueChannelIndex)); - m_BlueHistogramWidget->SetLabel("Blue channel"); - m_BlueHistogramWidget->SetTransferFunctionLabel("Affine"); - m_BlueHistogramWidget->SetHistogramColor(blue); - m_BlueHistogramWidget->SetTextColor(blue); - m_GreenHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_GreenChannelIndex)->GetOutput()); - m_GreenHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_GreenChannelIndex)); - m_GreenHistogramWidget->SetLabel("Green channel"); - m_GreenHistogramWidget->SetTransferFunctionLabel("Affine"); - m_GreenHistogramWidget->SetHistogramColor(green); - m_GreenHistogramWidget->SetTextColor(green); - break; + if (m_UseScroll) + { + m_ScrollWidget->SetViewModel(viewModel); + m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); + m_ScrollWidget->SetBlueChannelIndex(m_BlueChannelIndex); + } + m_FullWidget->SetViewModel(viewModel); + m_ZoomWidget->SetViewModel(viewModel); + m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); + m_ZoomWidget->SetBlueChannelIndex(m_BlueChannelIndex); + m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); + m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); + m_FullWidget->SetBlueChannelIndex(m_BlueChannelIndex); + + ComputeNormalizationFactors(); + + typename HistogramWidgetType::ColorType blue, red, green; + + red[0] = 0.5; + red[1] = 0; + red[2] = 0; + + green[0] = 0; + green[1] = 0.5; + green[2] = 0; + + blue[0] = 0; + blue[1] = 0; + blue[2] = 0.5; + + m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_RedChannelIndex)->GetOutput()); + m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_RedChannelIndex)); + m_RedHistogramWidget->SetLabel("Red channel"); + m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); + m_RedHistogramWidget->SetHistogramColor(red); + m_RedHistogramWidget->SetTextColor(red); + + m_BlueHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_BlueChannelIndex)->GetOutput()); + m_BlueHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_BlueChannelIndex)); + m_BlueHistogramWidget->SetLabel("Blue channel"); + m_BlueHistogramWidget->SetTransferFunctionLabel("Affine"); + m_BlueHistogramWidget->SetHistogramColor(blue); + m_BlueHistogramWidget->SetTextColor(blue); + m_GreenHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_GreenChannelIndex)->GetOutput()); + m_GreenHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_GreenChannelIndex)); + m_GreenHistogramWidget->SetLabel("Green channel"); + m_GreenHistogramWidget->SetTransferFunctionLabel("Affine"); + m_GreenHistogramWidget->SetHistogramColor(green); + m_GreenHistogramWidget->SetTextColor(green); + break; // } - } - case ScrollWidgetType::GRAYSCALE: - { - if (m_UseScroll) + } + case ScrollWidgetType::GRAYSCALE: { - m_ScrollWidget->SetViewModel(viewModel); - m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); + if (m_UseScroll) + { + m_ScrollWidget->SetViewModel(viewModel); + m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); + } + m_FullWidget->SetViewModel(viewModel); + m_ZoomWidget->SetViewModel(viewModel); + m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); + m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); + + ComputeNormalizationFactors(); + + typename HistogramWidgetType::ColorType gray; + gray.Fill(0.5); + + m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_RedChannelIndex)->GetOutput()); + m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_RedChannelIndex)); + m_RedHistogramWidget->SetLabel("Grayscale channel"); + m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); + m_RedHistogramWidget->SetHistogramColor(gray); + m_RedHistogramWidget->SetTextColor(gray); + break; } - m_FullWidget->SetViewModel(viewModel); - m_ZoomWidget->SetViewModel(viewModel); - m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); - m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); - - ComputeNormalizationFactors(); - - typename HistogramWidgetType::ColorType gray; - gray.Fill(0.5); - - m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(m_RedChannelIndex)->GetOutput()); - m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(m_RedChannelIndex)); - m_RedHistogramWidget->SetLabel("Grayscale channel"); - m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); - m_RedHistogramWidget->SetHistogramColor(gray); - m_RedHistogramWidget->SetTextColor(gray); - break; - } - case ScrollWidgetType::COMPLEX_MODULUS: - { - if (m_UseScroll) + case ScrollWidgetType::COMPLEX_MODULUS: { - m_ScrollWidget->SetViewModel(viewModel); - m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); + if (m_UseScroll) + { + m_ScrollWidget->SetViewModel(viewModel); + m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); + } + m_FullWidget->SetViewModel(viewModel); + m_ZoomWidget->SetViewModel(viewModel); + m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); + m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); + m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); + + ComputeNormalizationFactors(); + + typename HistogramWidgetType::ColorType gray; + gray.Fill(0.5); + + m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(0)->GetOutput()); + m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(0)); + m_RedHistogramWidget->SetLabel("Modulus"); + m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); + m_RedHistogramWidget->SetHistogramColor(gray); + m_RedHistogramWidget->SetTextColor(gray); + break; } - m_FullWidget->SetViewModel(viewModel); - m_ZoomWidget->SetViewModel(viewModel); - m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); - m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); - m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); - - ComputeNormalizationFactors(); - - typename HistogramWidgetType::ColorType gray; - gray.Fill(0.5); - - m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(0)->GetOutput()); - m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(0)); - m_RedHistogramWidget->SetLabel("Modulus"); - m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); - m_RedHistogramWidget->SetHistogramColor(gray); - m_RedHistogramWidget->SetTextColor(gray); - break; - } - case ScrollWidgetType::COMPLEX_PHASE: - { - if (m_UseScroll) + case ScrollWidgetType::COMPLEX_PHASE: { - m_ScrollWidget->SetViewModel(viewModel); - m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); + if (m_UseScroll) + { + m_ScrollWidget->SetViewModel(viewModel); + m_ScrollWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ScrollWidget->SetGreenChannelIndex(m_GreenChannelIndex); + } + m_FullWidget->SetViewModel(viewModel); + m_ZoomWidget->SetViewModel(viewModel); + m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); + m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); + m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); + m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); + + ComputeNormalizationFactors(); + + typename HistogramWidgetType::ColorType gray; + gray.Fill(0.5); + + m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(0)->GetOutput()); + m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(0)); + m_RedHistogramWidget->SetLabel("Phase"); + m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); + m_RedHistogramWidget->SetHistogramColor(gray); + m_RedHistogramWidget->SetTextColor(gray); + break; } - m_FullWidget->SetViewModel(viewModel); - m_ZoomWidget->SetViewModel(viewModel); - m_ZoomWidget->SetRedChannelIndex(m_RedChannelIndex); - m_FullWidget->SetRedChannelIndex(m_RedChannelIndex); - m_ZoomWidget->SetGreenChannelIndex(m_GreenChannelIndex); - m_FullWidget->SetGreenChannelIndex(m_GreenChannelIndex); - - ComputeNormalizationFactors(); - - typename HistogramWidgetType::ColorType gray; - gray.Fill(0.5); - - m_RedHistogramWidget->SetHistogram(m_HistogramGeneratorList->GetNthElement(0)->GetOutput()); - m_RedHistogramWidget->SetTransferFunction(m_TransferFunctionList->GetNthElement(0)); - m_RedHistogramWidget->SetLabel("Phase"); - m_RedHistogramWidget->SetTransferFunctionLabel("Affine"); - m_RedHistogramWidget->SetHistogramColor(gray); - m_RedHistogramWidget->SetTextColor(gray); - break; - } } } diff --git a/Code/Visu/otbImageViewerFullWidget.h b/Code/Visu/otbImageViewerFullWidget.h index 1bca9eed84..449fd3a826 100644 --- a/Code/Visu/otbImageViewerFullWidget.h +++ b/Code/Visu/otbImageViewerFullWidget.h @@ -103,75 +103,75 @@ public: { switch (event) { - case FL_PUSH: - { - // in case of mouse click, change the point of view - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType clickedIndex; - clickedIndex[0] = x; - clickedIndex[1] = y; - clickedIndex = this->WindowToImageCoordinates(clickedIndex); - - if (m_EventsInterface.IsNotNull()) - { - m_EventsInterface->PixelClicked(clickedIndex); - } - if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) - { - m_Parent->ChangeZoomViewedRegion(clickedIndex); - m_Parent->Update(); - } - return 1; - } - case FL_KEYDOWN: - { - IndexType newIndex = m_Parent->GetZoomWidget()->GetViewedRegion().GetIndex(); - SizeType newSize = m_Parent->GetZoomWidget()->GetViewedRegion().GetSize(); - bool moved = false; - switch (Fl::event_key()) - { - case FL_Down: + case FL_PUSH: { - newIndex[1] += static_cast<long int>(newSize[1] / 2) + newSize[1] / 2; - newIndex[0] += newSize[0] / 2; - moved = true; - break; - } - case FL_Up: - { - newIndex[1] += -static_cast<long int>(newSize[1] / 2) - + newSize[1] / 2; - newIndex[0] += newSize[0] / 2; - moved = true; - break; - } - case FL_Left: - { - newIndex[0] += -static_cast<long int>(newSize[0] / 2) - + newSize[0] / 2; - newIndex[1] += newSize[1] / 2; - moved = true; - break; + // in case of mouse click, change the point of view + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType clickedIndex; + clickedIndex[0] = x; + clickedIndex[1] = y; + clickedIndex = this->WindowToImageCoordinates(clickedIndex); + + if (m_EventsInterface.IsNotNull()) + { + m_EventsInterface->PixelClicked(clickedIndex); + } + if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) + { + m_Parent->ChangeZoomViewedRegion(clickedIndex); + m_Parent->Update(); + } + return 1; } - case FL_Right: + case FL_KEYDOWN: { - newIndex[0] += static_cast<long int>(newSize[0] / 2) - + newSize[0] / 2; - newIndex[1] += newSize[1] / 2; - moved = true; - break; - } - // if the view center was moved: - if (moved) + IndexType newIndex = m_Parent->GetZoomWidget()->GetViewedRegion().GetIndex(); + SizeType newSize = m_Parent->GetZoomWidget()->GetViewedRegion().GetSize(); + bool moved = false; + switch (Fl::event_key()) { - m_Parent->ChangeFullViewedRegion(newIndex); - m_Parent->ChangeZoomViewedRegion(newIndex); - m_Parent->Update(); + case FL_Down: + { + newIndex[1] += static_cast<long int>(newSize[1] / 2) + newSize[1] / 2; + newIndex[0] += newSize[0] / 2; + moved = true; + break; + } + case FL_Up: + { + newIndex[1] += -static_cast<long int>(newSize[1] / 2) + + newSize[1] / 2; + newIndex[0] += newSize[0] / 2; + moved = true; + break; + } + case FL_Left: + { + newIndex[0] += -static_cast<long int>(newSize[0] / 2) + + newSize[0] / 2; + newIndex[1] += newSize[1] / 2; + moved = true; + break; + } + case FL_Right: + { + newIndex[0] += static_cast<long int>(newSize[0] / 2) + + newSize[0] / 2; + newIndex[1] += newSize[1] / 2; + moved = true; + break; + } + // if the view center was moved: + if (moved) + { + m_Parent->ChangeFullViewedRegion(newIndex); + m_Parent->ChangeZoomViewedRegion(newIndex); + m_Parent->Update(); + } } + return 1; } - return 1; - } } return 0; } @@ -180,139 +180,139 @@ public: { switch (event) { - case FL_PUSH: - { - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType clickedIndex; - clickedIndex[0] = x; - clickedIndex[1] = y; - if (!m_Drag) + case FL_PUSH: { - m_LastIndex = this->WindowToImageCoordinates(clickedIndex); - } - return 1; - } - case FL_DRAG: - { - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType index; - index[0] = x; - index[1] = y; - IndexType clickedIndex = this->WindowToImageCoordinates(index); - typename BoxType::Pointer box = BoxType::New(); - box->SetColor(m_Parent->GetInterfaceBoxesColor()); - IndexType boxIndex; - SizeType boxSize; - // compute the size of the selection box - if (clickedIndex[0] > m_LastIndex[0]) - { - boxIndex[0] = m_LastIndex[0]; - boxSize[0] = clickedIndex[0] - m_LastIndex[0]; - } - else - { - boxIndex[0] = clickedIndex[0]; - boxSize[0] = m_LastIndex[0] - clickedIndex[0]; - } - if (clickedIndex[1] > m_LastIndex[1]) - { - boxIndex[1] = m_LastIndex[1]; - boxSize[1] = clickedIndex[1] - m_LastIndex[1]; - } - else - { - boxIndex[1] = clickedIndex[1]; - boxSize[1] = m_LastIndex[1] - clickedIndex[1]; + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType clickedIndex; + clickedIndex[0] = x; + clickedIndex[1] = y; + if (!m_Drag) + { + m_LastIndex = this->WindowToImageCoordinates(clickedIndex); + } + return 1; } - box->SetIndex(boxIndex); - box->SetSize(boxSize); - if (m_Drag) + case FL_DRAG: { - m_Parent->GetInterfaceBoxesList()->PopBack(); + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType index; + index[0] = x; + index[1] = y; + IndexType clickedIndex = this->WindowToImageCoordinates(index); + typename BoxType::Pointer box = BoxType::New(); + box->SetColor(m_Parent->GetInterfaceBoxesColor()); + IndexType boxIndex; + SizeType boxSize; + // compute the size of the selection box + if (clickedIndex[0] > m_LastIndex[0]) + { + boxIndex[0] = m_LastIndex[0]; + boxSize[0] = clickedIndex[0] - m_LastIndex[0]; + } + else + { + boxIndex[0] = clickedIndex[0]; + boxSize[0] = m_LastIndex[0] - clickedIndex[0]; + } + if (clickedIndex[1] > m_LastIndex[1]) + { + boxIndex[1] = m_LastIndex[1]; + boxSize[1] = clickedIndex[1] - m_LastIndex[1]; + } + else + { + boxIndex[1] = clickedIndex[1]; + boxSize[1] = m_LastIndex[1] - clickedIndex[1]; + } + box->SetIndex(boxIndex); + box->SetSize(boxSize); + if (m_Drag) + { + m_Parent->GetInterfaceBoxesList()->PopBack(); + } + m_Parent->GetInterfaceBoxesList()->PushBack(box); + m_Drag = true; + m_Parent->Update(); + return 1; } - m_Parent->GetInterfaceBoxesList()->PushBack(box); - m_Drag = true; - m_Parent->Update(); - return 1; - } - case FL_RELEASE: - { - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType clickedIndex; - clickedIndex[0] = x; - clickedIndex[1] = y; - clickedIndex = this->WindowToImageCoordinates(clickedIndex); - if (m_Drag) - { - m_Parent->GetInterfaceBoxesList()->PopBack(); - } - if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) + case FL_RELEASE: { - if (m_Parent->GetPolygonROIList()->Size() == 0) + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType clickedIndex; + clickedIndex[0] = x; + clickedIndex[1] = y; + clickedIndex = this->WindowToImageCoordinates(clickedIndex); + if (m_Drag) { - m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); - m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); + m_Parent->GetInterfaceBoxesList()->PopBack(); + } + if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) + { + if (m_Parent->GetPolygonROIList()->Size() == 0) + { + m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); + m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); + } + } + IndexType boxIndex; + SizeType boxSize; + if (clickedIndex[0] > m_LastIndex[0]) + { + boxIndex[0] = m_LastIndex[0]; + boxSize[0] = clickedIndex[0] - m_LastIndex[0]; + } + else + { + boxIndex[0] = clickedIndex[0]; + boxSize[0] = m_LastIndex[0] - clickedIndex[0]; + } + if (clickedIndex[1] > m_LastIndex[1]) + { + boxIndex[1] = m_LastIndex[1]; + boxSize[1] = clickedIndex[1] - m_LastIndex[1]; + } + else + { + boxIndex[1] = clickedIndex[1]; + boxSize[1] = m_LastIndex[1] - clickedIndex[1]; } - } - IndexType boxIndex; - SizeType boxSize; - if (clickedIndex[0] > m_LastIndex[0]) - { - boxIndex[0] = m_LastIndex[0]; - boxSize[0] = clickedIndex[0] - m_LastIndex[0]; - } - else - { - boxIndex[0] = clickedIndex[0]; - boxSize[0] = m_LastIndex[0] - clickedIndex[0]; - } - if (clickedIndex[1] > m_LastIndex[1]) - { - boxIndex[1] = m_LastIndex[1]; - boxSize[1] = clickedIndex[1] - m_LastIndex[1]; - } - else - { - boxIndex[1] = clickedIndex[1]; - boxSize[1] = m_LastIndex[1] - clickedIndex[1]; - } - if (m_EventsInterface.IsNotNull()) - { - RegionType selectedRegion; - selectedRegion.SetIndex(boxIndex); - selectedRegion.SetSize(boxSize); - m_EventsInterface->RegionSelected(selectedRegion); - } - if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) - { - ContinuousIndexType newVertex; - // Up Left corner - newVertex[0] = boxIndex[0]; - newVertex[1] = boxIndex[1]; - m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); - // Up Right corner - newVertex[0] += boxSize[0]; - m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); - // Down Right corner - newVertex[1] += boxSize[1]; - m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); - // Down Left corner - newVertex[0] = boxIndex[0]; - m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); - m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); - m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); + if (m_EventsInterface.IsNotNull()) + { + RegionType selectedRegion; + selectedRegion.SetIndex(boxIndex); + selectedRegion.SetSize(boxSize); + m_EventsInterface->RegionSelected(selectedRegion); + } + if (m_EventsInterface.IsNull() || m_EventsInterface->GetForwardEvents()) + { + ContinuousIndexType newVertex; + // Up Left corner + newVertex[0] = boxIndex[0]; + newVertex[1] = boxIndex[1]; + m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); + // Up Right corner + newVertex[0] += boxSize[0]; + m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); + // Down Right corner + newVertex[1] += boxSize[1]; + m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); + // Down Left corner + newVertex[0] = boxIndex[0]; + m_Parent->GetPolygonROIList()->Back()->AddVertex(newVertex); + m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); + m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); - m_Parent->Update(); + m_Parent->Update(); + } + m_Drag = false; + return 1; } - m_Drag = false; - return 1; - } } return 0; } @@ -321,54 +321,54 @@ public: { switch (event) { - case FL_PUSH: - { - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType clickedIndex; - clickedIndex[0] = x; - clickedIndex[1] = y; - clickedIndex = this->WindowToImageCoordinates(clickedIndex); - // If left mouse click - if (Fl::event_button() == FL_LEFT_MOUSE) + case FL_PUSH: { - // If not already editing a polygon, start a new one. - if (m_Parent->GetPolygonROIList()->Size() == 0) + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType clickedIndex; + clickedIndex[0] = x; + clickedIndex[1] = y; + clickedIndex = this->WindowToImageCoordinates(clickedIndex); + // If left mouse click + if (Fl::event_button() == FL_LEFT_MOUSE) + { + // If not already editing a polygon, start a new one. + if (m_Parent->GetPolygonROIList()->Size() == 0) + { + m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); + m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); + } + m_Parent->GetPolygonROIList()->Back()->AddVertex(clickedIndex); + m_Parent->Update(); + } + else if (Fl::event_button() == FL_RIGHT_MOUSE) { m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); - } - m_Parent->GetPolygonROIList()->Back()->AddVertex(clickedIndex); - m_Parent->Update(); - } - else if (Fl::event_button() == FL_RIGHT_MOUSE) - { - m_Parent->GetPolygonROIList()->PushBack(PolygonType::New()); - m_Parent->GetPolygonROIList()->Back()->SetValue(m_Parent->GetNextROILabel()); + } + return 1; } - return 1; - } - case FL_KEYDOWN: - { - // erase the last vertex of the current polygon - if (Fl::event_key() == FL_Page_Down) + case FL_KEYDOWN: { - if (m_Parent->GetPolygonROIList()->Size() > 0) + // erase the last vertex of the current polygon + if (Fl::event_key() == FL_Page_Down) { - unsigned int sizeOfThePolygon = m_Parent->GetPolygonROIList()->Back()->GetVertexList()->Size(); - if (sizeOfThePolygon > 0) + if (m_Parent->GetPolygonROIList()->Size() > 0) { - // itk::PolylineParametricPath does not provide a RemoveVertex() method, and the access to the vertex list is const, so we have no other choice to remove a vertex. - VertexListPointerType list = - const_cast<VertexListType *>(m_Parent->GetPolygonROIList()->Back()->GetVertexList()); - list->pop_back(); - m_Parent->Update(); + unsigned int sizeOfThePolygon = m_Parent->GetPolygonROIList()->Back()->GetVertexList()->Size(); + if (sizeOfThePolygon > 0) + { + // itk::PolylineParametricPath does not provide a RemoveVertex() method, and the access to the vertex list is const, so we have no other choice to remove a vertex. + VertexListPointerType list = + const_cast<VertexListType *>(m_Parent->GetPolygonROIList()->Back()->GetVertexList()); + list->pop_back(); + m_Parent->Update(); + } } } + return 1; } - return 1; - } } return 0; } @@ -417,45 +417,45 @@ public: // handle the pixel value reporting switch (event) { - case FL_ENTER: - { - m_MouseIn = true; - return 1; - } - case FL_LEAVE: - { - m_MouseIn = false; - m_Parent->ClearPixLocVal(); - return 1; - } - case FL_MOVE: - { - // If we move inside the point of view, then report the pixel location and value. - m_MouseIn = true; - if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + case FL_ENTER: { - m_MousePos[0] = Fl::event_x(); - m_MousePos[1] = Fl::event_y(); - IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); - m_Parent->ReportPixel(newIndex); - m_MouseMoveCount = 0; + m_MouseIn = true; + return 1; + } + case FL_LEAVE: + { + m_MouseIn = false; + m_Parent->ClearPixLocVal(); + return 1; + } + case FL_MOVE: + { + // If we move inside the point of view, then report the pixel location and value. + m_MouseIn = true; + if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + { + m_MousePos[0] = Fl::event_x(); + m_MousePos[1] = Fl::event_y(); + IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); + m_Parent->ReportPixel(newIndex); + m_MouseMoveCount = 0; + } + m_MouseMoveCount++; + return 1; + } + case FL_FOCUS: + { + return 1; + } + case FL_UNFOCUS: + { + return 1; + } + case FL_HIDE: + { + m_Parent->Hide(); + return 0; } - m_MouseMoveCount++; - return 1; - } - case FL_FOCUS: - { - return 1; - } - case FL_UNFOCUS: - { - return 1; - } - case FL_HIDE: - { - m_Parent->Hide(); - return 0; - } } // If the current mode is rectangle selection, call the right handle method if (m_Parent->GetRectangularROISelectionMode()) diff --git a/Code/Visu/otbImageViewerHistogramAndTransferFunctionWidget.h b/Code/Visu/otbImageViewerHistogramAndTransferFunctionWidget.h index b347887cfe..1e08fed512 100644 --- a/Code/Visu/otbImageViewerHistogramAndTransferFunctionWidget.h +++ b/Code/Visu/otbImageViewerHistogramAndTransferFunctionWidget.h @@ -89,96 +89,96 @@ protected: this->GetHistogram()->Quantile(0, 0.)) / factor; switch (event) { - case FL_PUSH: - { - double x = Fl::event_x(); - if ((vcl_abs(x - xlower) < 50) || (vcl_abs(x - xupper) < 50)) + case FL_PUSH: { - if (vcl_abs(x - xlower) < vcl_abs(x - xupper)) - { - m_ModifyLower = true; - } - else + double x = Fl::event_x(); + if ((vcl_abs(x - xlower) < 50) || (vcl_abs(x - xupper) < 50)) { - m_ModifyUpper = true; + if (vcl_abs(x - xlower) < vcl_abs(x - xupper)) + { + m_ModifyLower = true; + } + else + { + m_ModifyUpper = true; + } } + return 1; } - return 1; - } - case FL_RELEASE: - { - m_ModifyLower = false; - m_ModifyUpper = false; - m_Parent->ChangeTransferFunctions(); - m_Parent->Update(); - return 1; - } - case FL_DRAG: - { - double x = Fl::event_x(); - - if (m_ModifyLower && (x > this->GetMarginX()) && - (x < static_cast<double>(this->w()) - this->GetMarginX() - this->GetOutputHistogramMargin() * - static_cast<double>(this->w()))) - { - x = (x > xupper ? xupper : x); - this->GetTransferFunction()->SetLowerBound(static_cast<PixelType>(this->GetHistogram()->Quantile(0, - 0.) + - (x - this->GetMarginX()) * factor)); - this->redraw(); - } - else if (m_ModifyUpper && - (x < static_cast<double>(this->w()) - this->GetMarginX() - this->GetOutputHistogramMargin() * - static_cast<double>(this->w()))) - { - x = (x < xlower ? xlower : x); - this->GetTransferFunction()->SetUpperBound(static_cast<PixelType>(this->GetHistogram()->Quantile(0, - 0.) + - (x - this->GetMarginX()) * factor)); - this->redraw(); - } - return 1; - } - case FL_MOUSEWHEEL: - { - int dy = Fl::event_dy(); - if (dy > 0) + case FL_RELEASE: { - m_TransferFunctionCode++; + m_ModifyLower = false; + m_ModifyUpper = false; + m_Parent->ChangeTransferFunctions(); + m_Parent->Update(); + return 1; } - else + case FL_DRAG: { - m_TransferFunctionCode--; + double x = Fl::event_x(); + + if (m_ModifyLower && (x > this->GetMarginX()) && + (x < static_cast<double>(this->w()) - this->GetMarginX() - this->GetOutputHistogramMargin() * + static_cast<double>(this->w()))) + { + x = (x > xupper ? xupper : x); + this->GetTransferFunction()->SetLowerBound(static_cast<PixelType>(this->GetHistogram()->Quantile(0, + 0.) + + (x - this->GetMarginX()) * factor)); + this->redraw(); + } + else if (m_ModifyUpper && + (x < static_cast<double>(this->w()) - this->GetMarginX() - this->GetOutputHistogramMargin() * + static_cast<double>(this->w()))) + { + x = (x < xlower ? xlower : x); + this->GetTransferFunction()->SetUpperBound(static_cast<PixelType>(this->GetHistogram()->Quantile(0, + 0.) + + (x - this->GetMarginX()) * factor)); + this->redraw(); + } + return 1; } - m_TransferFunctionCode = vcl_abs(m_TransferFunctionCode % 4); - TransferFunctionPointerType newFunction; - switch (m_TransferFunctionCode) + case FL_MOUSEWHEEL: { - case 0: - newFunction = AffineTransferFunctionType::New(); - this->SetTransferFunctionLabel("Affine"); - break; - case 1: - newFunction = SquareRootTransferFunctionType::New(); - this->SetTransferFunctionLabel("Square Root"); - break; - case 2: - newFunction = LogTransferFunctionType::New(); - this->SetTransferFunctionLabel("Logarithmic"); - break; - case 3: - newFunction = SquareonentialTransferFunctionType::New(); - this->SetTransferFunctionLabel("Square"); - break; - } - newFunction->SetLowerBound(this->GetTransferFunction()->GetLowerBound()); - newFunction->SetUpperBound(this->GetTransferFunction()->GetUpperBound()); - this->SetTransferFunction(newFunction); - m_Parent->ChangeTransferFunctions(); - m_Parent->Update(); - return 1; + int dy = Fl::event_dy(); + if (dy > 0) + { + m_TransferFunctionCode++; + } + else + { + m_TransferFunctionCode--; + } + m_TransferFunctionCode = vcl_abs(m_TransferFunctionCode % 4); + TransferFunctionPointerType newFunction; + switch (m_TransferFunctionCode) + { + case 0: + newFunction = AffineTransferFunctionType::New(); + this->SetTransferFunctionLabel("Affine"); + break; + case 1: + newFunction = SquareRootTransferFunctionType::New(); + this->SetTransferFunctionLabel("Square Root"); + break; + case 2: + newFunction = LogTransferFunctionType::New(); + this->SetTransferFunctionLabel("Logarithmic"); + break; + case 3: + newFunction = SquareonentialTransferFunctionType::New(); + this->SetTransferFunctionLabel("Square"); + break; + } + newFunction->SetLowerBound(this->GetTransferFunction()->GetLowerBound()); + newFunction->SetUpperBound(this->GetTransferFunction()->GetUpperBound()); + this->SetTransferFunction(newFunction); + m_Parent->ChangeTransferFunctions(); + m_Parent->Update(); + return 1; - } + } } return 0; } diff --git a/Code/Visu/otbImageViewerScrollWidget.h b/Code/Visu/otbImageViewerScrollWidget.h index e5906cbfb8..852085428e 100644 --- a/Code/Visu/otbImageViewerScrollWidget.h +++ b/Code/Visu/otbImageViewerScrollWidget.h @@ -75,56 +75,56 @@ public: { switch (event) { - case FL_PUSH: - { - int x = Fl::event_x(); - int y = Fl::event_y(); - IndexType clickedIndex; - clickedIndex[0] = x; - clickedIndex[1] = y; - clickedIndex = this->WindowToImageCoordinates(clickedIndex); - clickedIndex[0] = clickedIndex[0] * m_Parent->GetShrinkFactor(); - clickedIndex[1] = clickedIndex[1] * m_Parent->GetShrinkFactor(); - //std::cout<<"Scroll widget: "<<m_Parent->GetLabel()<<" before parent update"<<std::endl; - m_Parent->ChangeFullViewedRegion(clickedIndex); - m_Parent->ChangeZoomViewedRegion(clickedIndex); - m_Parent->Update(); - //std::cout<<"Scroll widget: "<<m_Parent->GetLabel()<<" after parent update"<<std::endl; - return 1; - } - case FL_ENTER: - { - m_MouseIn = true; - return 1; - } - case FL_LEAVE: - { - m_MouseIn = false; - m_Parent->ClearPixLocVal(); - return 1; - } - case FL_MOVE: - { - m_MouseIn = true; - if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + case FL_PUSH: { - m_MousePos[0] = Fl::event_x(); - m_MousePos[1] = Fl::event_y(); - IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); - IndexType realIndex; - realIndex[0] = newIndex[0] * m_Parent->GetShrinkFactor(); - realIndex[1] = newIndex[1] * m_Parent->GetShrinkFactor(); - m_Parent->ReportPixel(realIndex); - m_MouseMoveCount = 0; + int x = Fl::event_x(); + int y = Fl::event_y(); + IndexType clickedIndex; + clickedIndex[0] = x; + clickedIndex[1] = y; + clickedIndex = this->WindowToImageCoordinates(clickedIndex); + clickedIndex[0] = clickedIndex[0] * m_Parent->GetShrinkFactor(); + clickedIndex[1] = clickedIndex[1] * m_Parent->GetShrinkFactor(); + //std::cout<<"Scroll widget: "<<m_Parent->GetLabel()<<" before parent update"<<std::endl; + m_Parent->ChangeFullViewedRegion(clickedIndex); + m_Parent->ChangeZoomViewedRegion(clickedIndex); + m_Parent->Update(); + //std::cout<<"Scroll widget: "<<m_Parent->GetLabel()<<" after parent update"<<std::endl; + return 1; + } + case FL_ENTER: + { + m_MouseIn = true; + return 1; + } + case FL_LEAVE: + { + m_MouseIn = false; + m_Parent->ClearPixLocVal(); + return 1; + } + case FL_MOVE: + { + m_MouseIn = true; + if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + { + m_MousePos[0] = Fl::event_x(); + m_MousePos[1] = Fl::event_y(); + IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); + IndexType realIndex; + realIndex[0] = newIndex[0] * m_Parent->GetShrinkFactor(); + realIndex[1] = newIndex[1] * m_Parent->GetShrinkFactor(); + m_Parent->ReportPixel(realIndex); + m_MouseMoveCount = 0; + } + m_MouseMoveCount++; + return 1; + } + case FL_HIDE: + { + m_Parent->Hide(); + return 0; } - m_MouseMoveCount++; - return 1; - } - case FL_HIDE: - { - m_Parent->Hide(); - return 0; - } } return 0; } diff --git a/Code/Visu/otbImageViewerZoomWidget.h b/Code/Visu/otbImageViewerZoomWidget.h index 3dccf57fa4..dd23f85ee7 100644 --- a/Code/Visu/otbImageViewerZoomWidget.h +++ b/Code/Visu/otbImageViewerZoomWidget.h @@ -72,93 +72,93 @@ public: { switch (event) { - case FL_ENTER: - { - m_MouseIn = true; - return 1; - } - case FL_LEAVE: - { - m_MouseIn = false; - m_Parent->UpdateZoomWidget(); - m_Parent->ClearPixLocVal(); - return 1; - } - case FL_MOVE: - { - m_MouseIn = true; - if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + case FL_ENTER: { - m_MousePos[0] = Fl::event_x(); - m_MousePos[1] = Fl::event_y(); - IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); - m_Parent->ReportPixel(newIndex); - m_MouseMoveCount = 0; + m_MouseIn = true; + return 1; } - m_MouseMoveCount++; - return 1; - } - case FL_MOUSEWHEEL: - { - int dy = Fl::event_dy(); - if (dy < 0) + case FL_LEAVE: + { + m_MouseIn = false; + m_Parent->UpdateZoomWidget(); + m_Parent->ClearPixLocVal(); + return 1; + } + case FL_MOVE: { - this->SetZoomFactor(this->GetOpenGlIsotropicZoom() + m_ZoomStep); + m_MouseIn = true; + if (m_MouseMoveCount % m_ValueUpdateFrequency == 0) + { + m_MousePos[0] = Fl::event_x(); + m_MousePos[1] = Fl::event_y(); + IndexType newIndex = this->WindowToImageCoordinates(m_MousePos); + m_Parent->ReportPixel(newIndex); + m_MouseMoveCount = 0; + } + m_MouseMoveCount++; + return 1; } - else + case FL_MOUSEWHEEL: { - if (this->GetOpenGlIsotropicZoom() - m_ZoomStep >= 1) + int dy = Fl::event_dy(); + if (dy < 0) { - this->SetZoomFactor(this->GetOpenGlIsotropicZoom() - m_ZoomStep); + this->SetZoomFactor(this->GetOpenGlIsotropicZoom() + m_ZoomStep); } else { - this->SetZoomFactor(1.0); + if (this->GetOpenGlIsotropicZoom() - m_ZoomStep >= 1) + { + this->SetZoomFactor(this->GetOpenGlIsotropicZoom() - m_ZoomStep); + } + else + { + this->SetZoomFactor(1.0); + } } + m_Parent->Update(); + return 1; } - m_Parent->Update(); - return 1; - } - case FL_FOCUS: - { - return 1; - } - case FL_UNFOCUS: - { - return 1; - } - case FL_KEYDOWN: - { - IndexType newIndex = this->GetViewedRegion().GetIndex(); - SizeType newSize = this->GetViewedRegion().GetSize(); - newIndex[0] = newIndex[0] + newSize[0] / 2; - newIndex[1] = newIndex[1] + newSize[1] / 2; - switch (Fl::event_key()) - { - case FL_Down: - { - newIndex[1] = newIndex[1] + newSize[1] / 8; - break; - } - case FL_Up: + case FL_FOCUS: { - newIndex[1] = newIndex[1] - newSize[1] / 8; - break; + return 1; } - case FL_Left: + case FL_UNFOCUS: { - newIndex[0] = newIndex[0] - newSize[0] / 8; - break; + return 1; } - case FL_Right: + case FL_KEYDOWN: { - newIndex[0] = newIndex[0] + newSize[0] / 8; - break; - } + IndexType newIndex = this->GetViewedRegion().GetIndex(); + SizeType newSize = this->GetViewedRegion().GetSize(); + newIndex[0] = newIndex[0] + newSize[0] / 2; + newIndex[1] = newIndex[1] + newSize[1] / 2; + switch (Fl::event_key()) + { + case FL_Down: + { + newIndex[1] = newIndex[1] + newSize[1] / 8; + break; + } + case FL_Up: + { + newIndex[1] = newIndex[1] - newSize[1] / 8; + break; + } + case FL_Left: + { + newIndex[0] = newIndex[0] - newSize[0] / 8; + break; + } + case FL_Right: + { + newIndex[0] = newIndex[0] + newSize[0] / 8; + break; + } + } + m_Parent->ChangeZoomViewedRegion(newIndex); + return 1; } - m_Parent->ChangeZoomViewedRegion(newIndex); - return 1; - } } return 0; } diff --git a/Code/Visu/otbImageWidgetBase.txx b/Code/Visu/otbImageWidgetBase.txx index 323f3d32fb..8b12f462cd 100644 --- a/Code/Visu/otbImageWidgetBase.txx +++ b/Code/Visu/otbImageWidgetBase.txx @@ -478,47 +478,47 @@ ImageWidgetBase<TPixel> #endif switch (m_ViewModel) { - case RGB: - { - m_OpenGlBuffer[index] = Normalize(it.Get()[m_RedChannelIndex], m_RedChannelIndex); - m_OpenGlBuffer[index + 1] = Normalize(it.Get()[m_GreenChannelIndex], m_GreenChannelIndex); - m_OpenGlBuffer[index + 2] = Normalize(it.Get()[m_BlueChannelIndex], m_BlueChannelIndex); - m_OpenGlBuffer[index + 3] = 255; - break; - } - case GRAYSCALE: - { - unsigned char gray = Normalize(it.Get()[m_RedChannelIndex], m_RedChannelIndex); - m_OpenGlBuffer[index] = gray; - m_OpenGlBuffer[index + 1] = gray; - m_OpenGlBuffer[index + 2] = gray; - m_OpenGlBuffer[index + 3] = 255; - break; - } - case COMPLEX_MODULUS: - { - double re = static_cast<double>(it.Get()[m_RedChannelIndex]); - double im = static_cast<double>(it.Get()[m_GreenChannelIndex]); - // std::cout << " *** " << m_RedChannelIndex << " " << m_GreenChannelIndex << std::endl; - unsigned char modulus = Normalize(static_cast<PixelType>(vcl_sqrt(static_cast<double>(im * im + re * re))), 0); - // std::cout << " ** " << im << " " << re << " -> " << static_cast<int>(modulus) << std::endl; - m_OpenGlBuffer[index] = modulus; - m_OpenGlBuffer[index + 1] = modulus; - m_OpenGlBuffer[index + 2] = modulus; - m_OpenGlBuffer[index + 3] = 255; - break; - } - case COMPLEX_PHASE: - { - unsigned char phase = - Normalize(static_cast<PixelType>(vcl_atan2(static_cast<double>(it.Get()[m_GreenChannelIndex]), - static_cast<double>(it.Get()[m_RedChannelIndex]))), 0); - m_OpenGlBuffer[index] = phase; - m_OpenGlBuffer[index + 1] = phase; - m_OpenGlBuffer[index + 2] = phase; - m_OpenGlBuffer[index + 3] = 255; - break; - } + case RGB: + { + m_OpenGlBuffer[index] = Normalize(it.Get()[m_RedChannelIndex], m_RedChannelIndex); + m_OpenGlBuffer[index + 1] = Normalize(it.Get()[m_GreenChannelIndex], m_GreenChannelIndex); + m_OpenGlBuffer[index + 2] = Normalize(it.Get()[m_BlueChannelIndex], m_BlueChannelIndex); + m_OpenGlBuffer[index + 3] = 255; + break; + } + case GRAYSCALE: + { + unsigned char gray = Normalize(it.Get()[m_RedChannelIndex], m_RedChannelIndex); + m_OpenGlBuffer[index] = gray; + m_OpenGlBuffer[index + 1] = gray; + m_OpenGlBuffer[index + 2] = gray; + m_OpenGlBuffer[index + 3] = 255; + break; + } + case COMPLEX_MODULUS: + { + double re = static_cast<double>(it.Get()[m_RedChannelIndex]); + double im = static_cast<double>(it.Get()[m_GreenChannelIndex]); + // std::cout << " *** " << m_RedChannelIndex << " " << m_GreenChannelIndex << std::endl; + unsigned char modulus = Normalize(static_cast<PixelType>(vcl_sqrt(static_cast<double>(im * im + re * re))), 0); + // std::cout << " ** " << im << " " << re << " -> " << static_cast<int>(modulus) << std::endl; + m_OpenGlBuffer[index] = modulus; + m_OpenGlBuffer[index + 1] = modulus; + m_OpenGlBuffer[index + 2] = modulus; + m_OpenGlBuffer[index + 3] = 255; + break; + } + case COMPLEX_PHASE: + { + unsigned char phase = + Normalize(static_cast<PixelType>(vcl_atan2(static_cast<double>(it.Get()[m_GreenChannelIndex]), + static_cast<double>(it.Get()[m_RedChannelIndex]))), 0); + m_OpenGlBuffer[index] = phase; + m_OpenGlBuffer[index + 1] = phase; + m_OpenGlBuffer[index + 2] = phase; + m_OpenGlBuffer[index + 3] = 255; + break; + } } } } diff --git a/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.h b/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.h index c68f4ca4c8..6818ab677f 100644 --- a/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.h +++ b/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.h @@ -109,11 +109,11 @@ template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT VectorImageToColorAnaglyphVectorImageFilter : public itk::BinaryFunctorImageFilter <TInputImage1, TInputImage2, TOutputImage, - Functor::ColorAnaglyphFunctor< - typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType - > > + Functor::ColorAnaglyphFunctor< + typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType + > > { public: /** Standard typedefs */ @@ -121,11 +121,11 @@ public: typedef itk::BinaryFunctorImageFilter <TInputImage1, TInputImage2, TOutputImage, - Functor::ColorAnaglyphFunctor< - typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType - > > Superclass; + Functor::ColorAnaglyphFunctor< + typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType + > > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visualization/otbAlphaBlendingFunction.h b/Code/Visualization/otbAlphaBlendingFunction.h index 38eb7cf9e4..f0ae9ae459 100644 --- a/Code/Visualization/otbAlphaBlendingFunction.h +++ b/Code/Visualization/otbAlphaBlendingFunction.h @@ -46,8 +46,8 @@ public: /** Standard class typedefs */ typedef AlphaBlendingFunction Self; typedef BlendingFunction<TInputRGBPixel1, - TInputRGBPixel2, - TOutputRGBPixel> Superclass; + TInputRGBPixel2, + TOutputRGBPixel> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visualization/otbArrowKeyMoveActionHandler.h b/Code/Visualization/otbArrowKeyMoveActionHandler.h index 4748f4321b..0454b115e7 100644 --- a/Code/Visualization/otbArrowKeyMoveActionHandler.h +++ b/Code/Visualization/otbArrowKeyMoveActionHandler.h @@ -86,123 +86,123 @@ public: { switch (Fl::event_key()) { - case FL_Up: - { - typename ViewType::SizeType size; - size = m_View->GetFullWidget()->GetExtent().GetSize(); - - // Get the current position - typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; - screenPoint[0] = size[0] / 2; - screenPoint[1] = size[1] / 2; - - // Transform to image point - imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); - - // Transform to index - typename ViewType::IndexType index; - index[0] = static_cast<int>(imagePoint[0]); - index[1] = static_cast<int>(imagePoint[1]); - - // Move - index[1] -= size[1]; - - // Change scaled extract region center - m_Model->SetExtractRegionCenter(index); - // Update model - m_Model->Update(); - return true; - break; - } - case FL_Down: - { - typename ViewType::SizeType size; - size = m_View->GetFullWidget()->GetExtent().GetSize(); - - // Get the current position - typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; - screenPoint[0] = size[0] / 2; - screenPoint[1] = size[1] / 2; - - // Transform to image point - imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); - - // Transform to index - typename ViewType::IndexType index; - index[0] = static_cast<int>(imagePoint[0]); - index[1] = static_cast<int>(imagePoint[1]); - - // Move - index[1] += size[1]; - - // Change scaled extract region center - m_Model->SetExtractRegionCenter(index); - // Update model - m_Model->Update(); - return true; - break; - } - case FL_Left: - { - typename ViewType::SizeType size; - size = m_View->GetFullWidget()->GetExtent().GetSize(); - - // Get the current position - typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; - screenPoint[0] = size[0] / 2; - screenPoint[1] = size[1] / 2; - - // Transform to image point - imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); - - // Transform to index - typename ViewType::IndexType index; - index[0] = static_cast<int>(imagePoint[0]); - index[1] = static_cast<int>(imagePoint[1]); - - // Move - index[0] -= size[0]; - - // Change scaled extract region center - m_Model->SetExtractRegionCenter(index); - // Update model - m_Model->Update(); - return true; - break; - } - case FL_Right: - { - typename ViewType::SizeType size; - size = m_View->GetFullWidget()->GetExtent().GetSize(); - - // Get the current position - typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; - screenPoint[0] = size[0] / 2; - screenPoint[1] = size[1] / 2; - - // Transform to image point - imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); - - // Transform to index - typename ViewType::IndexType index; - index[0] = static_cast<int>(imagePoint[0]); - index[1] = static_cast<int>(imagePoint[1]); - - // Move - index[0] += size[0]; - - // Change scaled extract region center - m_Model->SetExtractRegionCenter(index); - // Update model - m_Model->Update(); - return true; - break; - } - default: - { - return false; - break; - } + case FL_Up: + { + typename ViewType::SizeType size; + size = m_View->GetFullWidget()->GetExtent().GetSize(); + + // Get the current position + typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; + screenPoint[0] = size[0] / 2; + screenPoint[1] = size[1] / 2; + + // Transform to image point + imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); + + // Transform to index + typename ViewType::IndexType index; + index[0] = static_cast<int>(imagePoint[0]); + index[1] = static_cast<int>(imagePoint[1]); + + // Move + index[1] -= size[1]; + + // Change scaled extract region center + m_Model->SetExtractRegionCenter(index); + // Update model + m_Model->Update(); + return true; + break; + } + case FL_Down: + { + typename ViewType::SizeType size; + size = m_View->GetFullWidget()->GetExtent().GetSize(); + + // Get the current position + typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; + screenPoint[0] = size[0] / 2; + screenPoint[1] = size[1] / 2; + + // Transform to image point + imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); + + // Transform to index + typename ViewType::IndexType index; + index[0] = static_cast<int>(imagePoint[0]); + index[1] = static_cast<int>(imagePoint[1]); + + // Move + index[1] += size[1]; + + // Change scaled extract region center + m_Model->SetExtractRegionCenter(index); + // Update model + m_Model->Update(); + return true; + break; + } + case FL_Left: + { + typename ViewType::SizeType size; + size = m_View->GetFullWidget()->GetExtent().GetSize(); + + // Get the current position + typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; + screenPoint[0] = size[0] / 2; + screenPoint[1] = size[1] / 2; + + // Transform to image point + imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); + + // Transform to index + typename ViewType::IndexType index; + index[0] = static_cast<int>(imagePoint[0]); + index[1] = static_cast<int>(imagePoint[1]); + + // Move + index[0] -= size[0]; + + // Change scaled extract region center + m_Model->SetExtractRegionCenter(index); + // Update model + m_Model->Update(); + return true; + break; + } + case FL_Right: + { + typename ViewType::SizeType size; + size = m_View->GetFullWidget()->GetExtent().GetSize(); + + // Get the current position + typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; + screenPoint[0] = size[0] / 2; + screenPoint[1] = size[1] / 2; + + // Transform to image point + imagePoint = m_View->GetFullWidget()->GetScreenToImageTransform()->TransformPoint(screenPoint); + + // Transform to index + typename ViewType::IndexType index; + index[0] = static_cast<int>(imagePoint[0]); + index[1] = static_cast<int>(imagePoint[1]); + + // Move + index[0] += size[0]; + + // Change scaled extract region center + m_Model->SetExtractRegionCenter(index); + // Update model + m_Model->Update(); + return true; + break; + } + default: + { + return false; + break; + } } } } diff --git a/Code/Visualization/otbBlendingImageFilter.h b/Code/Visualization/otbBlendingImageFilter.h index 35b521619b..232c13f261 100644 --- a/Code/Visualization/otbBlendingImageFilter.h +++ b/Code/Visualization/otbBlendingImageFilter.h @@ -41,12 +41,12 @@ class BlendingFunctor public: /** Blending function typedef */ typedef otb::Function::BlendingFunction<TInputPixel1, - TInputPixel2, TOutputPixel> BlendingFunctionType; + TInputPixel2, TOutputPixel> BlendingFunctionType; /** Blending function pointer typedef */ typedef typename BlendingFunctionType::Pointer BlendingFunctionPointerType; /** Default rendering function typedef */ typedef otb::Function::UniformAlphaBlendingFunction<TInputPixel1, - TInputPixel2, TOutputPixel> DefaultBlendingFunctionType; + TInputPixel2, TOutputPixel> DefaultBlendingFunctionType; /** Scalar pixel operator */ inline TOutputPixel operator ()(const TInputPixel1& input1, const TInputPixel2& input2) @@ -98,19 +98,19 @@ private: template <class TInputImage1, class TInputImage2 = TInputImage1, class TOutputImage = TInputImage1> class BlendingImageFilter : public itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, - Functor::BlendingFunctor - <typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType> > + Functor::BlendingFunctor + <typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef BlendingImageFilter Self; typedef itk::BinaryFunctorImageFilter <TInputImage1, TInputImage2, TOutputImage, Functor::BlendingFunctor - <typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType> > Superclass; + <typename TInputImage1::PixelType, + typename TInputImage2::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -123,8 +123,8 @@ public: /** Blending function typedef */ typedef Functor::BlendingFunctor <typename TInputImage1::PixelType, - typename TInputImage2::PixelType, - typename TOutputImage::PixelType> BlendingFunctorType; + typename TInputImage2::PixelType, + typename TOutputImage::PixelType> BlendingFunctorType; typedef typename BlendingFunctorType::BlendingFunctionType BlendingFunctionType; /** diff --git a/Code/Visualization/otbHistogramActionHandler.h b/Code/Visualization/otbHistogramActionHandler.h index 777a605ba3..21af533d25 100644 --- a/Code/Visualization/otbHistogramActionHandler.h +++ b/Code/Visualization/otbHistogramActionHandler.h @@ -93,66 +93,66 @@ public: { switch (event) { - case FL_PUSH: - { - // Position Clicked - double x = Fl::event_x(); - - if ((vcl_abs(x - abcisseL) < 50) || (vcl_abs(x - abcisseR) < 50)) + case FL_PUSH: { - if (vcl_abs(x - abcisseL) < vcl_abs(x - abcisseR)) + // Position Clicked + double x = Fl::event_x(); + + if ((vcl_abs(x - abcisseL) < 50) || (vcl_abs(x - abcisseR) < 50)) { - m_ModifyLeft = true; + if (vcl_abs(x - abcisseL) < vcl_abs(x - abcisseR)) + { + m_ModifyLeft = true; + } + else + { + m_ModifyRight = true; + } } - else + return true; + } + case FL_RELEASE: + { + if (m_ModifyLeft || m_ModifyRight) { - m_ModifyRight = true; + m_Model->Update(); } + + m_ModifyLeft = false; + m_ModifyRight = false; + return true; } - return true; - } - case FL_RELEASE: - { - if (m_ModifyLeft || m_ModifyRight) + case FL_DRAG: { - m_Model->Update(); - } - - m_ModifyLeft = false; - m_ModifyRight = false; - return true; - } - case FL_DRAG: - { - double x = Fl::event_x(); + double x = Fl::event_x(); - if (m_ModifyLeft) - { - double tx = x - abcisseL; - m_LeftAsymptote->SetAbcisse(m_LeftAsymptote->GetAbcisse() + tx); - m_Curve->redraw(); - - // Update The Rendering Function min and max - ParametersType param = m_RenderingFunction->GetParameters(); - param.SetElement(2 * m_Channel, m_LeftAsymptote->GetAbcisse() + tx); - param.SetElement(2 * m_Channel + 1, m_RightAsymptote->GetAbcisse()); - m_RenderingFunction->SetParameters(param); - } + if (m_ModifyLeft) + { + double tx = x - abcisseL; + m_LeftAsymptote->SetAbcisse(m_LeftAsymptote->GetAbcisse() + tx); + m_Curve->redraw(); + + // Update The Rendering Function min and max + ParametersType param = m_RenderingFunction->GetParameters(); + param.SetElement(2 * m_Channel, m_LeftAsymptote->GetAbcisse() + tx); + param.SetElement(2 * m_Channel + 1, m_RightAsymptote->GetAbcisse()); + m_RenderingFunction->SetParameters(param); + } - if (m_ModifyRight) - { - double tx = x - abcisseR; - m_RightAsymptote->SetAbcisse(m_RightAsymptote->GetAbcisse() + tx); - m_Curve->redraw(); - - // Update The Rendering Function min and max - ParametersType param = m_RenderingFunction->GetParameters(); - param.SetElement(2 * m_Channel, m_LeftAsymptote->GetAbcisse()); - param.SetElement(2 * m_Channel + 1, m_RightAsymptote->GetAbcisse() + tx); - m_RenderingFunction->SetParameters(param); + if (m_ModifyRight) + { + double tx = x - abcisseR; + m_RightAsymptote->SetAbcisse(m_RightAsymptote->GetAbcisse() + tx); + m_Curve->redraw(); + + // Update The Rendering Function min and max + ParametersType param = m_RenderingFunction->GetParameters(); + param.SetElement(2 * m_Channel, m_LeftAsymptote->GetAbcisse()); + param.SetElement(2 * m_Channel + 1, m_RightAsymptote->GetAbcisse() + tx); + m_RenderingFunction->SetParameters(param); + } + return true; } - return true; - } } } return false; diff --git a/Code/Visualization/otbImageLayer.h b/Code/Visualization/otbImageLayer.h index a947c10ca1..1e8a6b9b66 100644 --- a/Code/Visualization/otbImageLayer.h +++ b/Code/Visualization/otbImageLayer.h @@ -73,10 +73,10 @@ public: typedef typename ImageType::IndexType IndexType; typedef typename IndexType::IndexValueType IndexValueType; - typedef itk::Point<double, 2> PointType; - typedef otb::GenericRSTransform<double> TransformType; - typedef otb::GroundSpacingImageFunction<ImageType> GroundSpacingImageType; - typedef typename GroundSpacingImageType::FloatType FloatType; + typedef itk::Point<double, 2> PointType; + typedef otb::GenericRSTransform<double> TransformType; + typedef otb::GroundSpacingImageFunction<ImageType> GroundSpacingImageType; + typedef typename GroundSpacingImageType::FloatType FloatType; /** Output image typedef */ typedef TOutputImage OutputImageType; typedef typename OutputImageType::PixelType OutputPixelType; @@ -89,8 +89,8 @@ public: typedef itk::Statistics::DenseFrequencyContainer DFContainerType; typedef itk::Statistics::Histogram< - typename itk::NumericTraits<ScalarType>::RealType, 1, - DFContainerType> HistogramType; + typename itk::NumericTraits<ScalarType>::RealType, 1, + DFContainerType> HistogramType; typedef typename HistogramType::Pointer HistogramPointerType; typedef ObjectList<HistogramType> HistogramListType; typedef typename HistogramListType::Pointer HistogramListPointerType; @@ -255,11 +255,11 @@ private: /** General info about the image*/ std::string m_PlaceName; //FIXME the call should be done by a more general method outside of the layer std::string m_CountryName; //which would also handle the dependance to curl - + /** Ground spacing calculator */ typename GroundSpacingImageType::Pointer m_GroundSpacing; //FIXME the call should be done by a more general method outside of the layer FloatType m_ApproxGroundSpacing; - + }; // end class } // end namespace otb diff --git a/Code/Visualization/otbImageLayer.txx b/Code/Visualization/otbImageLayer.txx index d20fc89e69..2f987e01cf 100644 --- a/Code/Visualization/otbImageLayer.txx +++ b/Code/Visualization/otbImageLayer.txx @@ -48,7 +48,7 @@ ImageLayer<TImage, TOutputImage> // Default rendering function typedef Function::StandardRenderingFunction<PixelType, - typename TOutputImage::PixelType> DefaultRenderingFunctionType; + typename TOutputImage::PixelType> DefaultRenderingFunctionType; m_RenderingFunction = DefaultRenderingFunctionType::New(); m_QuicklookRenderingFilter->SetRenderingFunction(m_RenderingFunction); m_ExtractRenderingFilter->SetRenderingFunction(m_RenderingFunction); @@ -67,9 +67,9 @@ ImageLayer<TImage, TOutputImage> m_PlaceName = ""; m_CountryName = ""; - + m_GroundSpacing = GroundSpacingImageType::New(); - m_ApproxGroundSpacing = itk::NumericTraits<FloatType >::min(); + m_ApproxGroundSpacing = itk::NumericTraits<FloatType>::min(); } template <class TImage, class TOutputImage> @@ -98,7 +98,7 @@ ImageLayer<TImage, TOutputImage> // Initialize the geotransform this->InitTransform(); - + //Get the ground spacing of the central pixel this->ComputeApproximativeGroundSpacing(); } @@ -284,8 +284,9 @@ ImageLayer<TImage, TOutputImage> { PointType point = this->GetPixelLocation (index); - oss << setiosflags(ios::fixed) << setprecision(2) << "Ground spacing(in m): " << m_ApproxGroundSpacing << std::endl; - + oss << setiosflags(ios::fixed) << setprecision(2) << "Ground spacing(in m): " << m_ApproxGroundSpacing << + std::endl; + oss << setiosflags(ios::fixed) << setprecision(6) << "Lon: " << point[0] << " Lat: " << point[1] << std::endl; if (m_Transform->GetTransformAccuracy() == Projection::PRECISE) oss << "(precise location)" << std::endl; @@ -337,12 +338,11 @@ ImageLayer<TImage, TOutputImage> m_Transform->SetInputSpacing(m_Image->GetSpacing()); // m_Transform->SetDEMDirectory(m_DEMDirectory); m_Transform->InstanciateTransform(); - + //Set parameters of the ground spacing image calculators m_GroundSpacing->SetInputImage(m_Image); m_GroundSpacing->SetTransform(m_Transform); - - + } template <class TImage, class TOutputImage> @@ -350,20 +350,20 @@ void ImageLayer<TImage, TOutputImage> ::ComputeApproximativeGroundSpacing() { - if (m_Transform->IsUpToDate()) + if (m_Transform->IsUpToDate()) { if (m_Transform->GetTransformAccuracy() != Projection::UNKNOWN) { - IndexType index; - vnl_random rand; - - index[0] = static_cast<IndexValueType>(rand.lrand32(0,m_Image->GetLargestPossibleRegion().GetSize()[0])); - index[1] = static_cast<IndexValueType>(rand.lrand32(0,m_Image->GetLargestPossibleRegion().GetSize()[1])); - - m_ApproxGroundSpacing = m_GroundSpacing->EvaluateAtIndex(index); + IndexType index; + vnl_random rand; + + index[0] = static_cast<IndexValueType>(rand.lrand32(0, m_Image->GetLargestPossibleRegion().GetSize()[0])); + index[1] = static_cast<IndexValueType>(rand.lrand32(0, m_Image->GetLargestPossibleRegion().GetSize()[1])); + + m_ApproxGroundSpacing = m_GroundSpacing->EvaluateAtIndex(index); } - } - + } + } } diff --git a/Code/Visualization/otbImageLayerRenderingModel.h b/Code/Visualization/otbImageLayerRenderingModel.h index 1639843529..3d988219ab 100644 --- a/Code/Visualization/otbImageLayerRenderingModel.h +++ b/Code/Visualization/otbImageLayerRenderingModel.h @@ -42,7 +42,7 @@ namespace otb */ template <class TOutputImage, - class TLayer = otb::ImageLayerBase<TOutputImage> > + class TLayer = otb::ImageLayerBase<TOutputImage> > class ImageLayerRenderingModel : public MVCModel<ListenerBase>, public LayerBasedModel<TLayer> { diff --git a/Code/Visualization/otbMultiplyBlendingFunction.h b/Code/Visualization/otbMultiplyBlendingFunction.h index 82b02f3fc2..da263ef534 100644 --- a/Code/Visualization/otbMultiplyBlendingFunction.h +++ b/Code/Visualization/otbMultiplyBlendingFunction.h @@ -40,8 +40,8 @@ public: /** Standard class typedefs */ typedef MultiplyBlendingFunction Self; typedef BlendingFunction<TInputRGBPixel1, - TInputRGBPixel2, - TOutputRGBPixel> Superclass; + TInputRGBPixel2, + TOutputRGBPixel> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visualization/otbPixelDescriptionActionHandler.h b/Code/Visualization/otbPixelDescriptionActionHandler.h index 5a8bf1eb34..ea253fb2b8 100644 --- a/Code/Visualization/otbPixelDescriptionActionHandler.h +++ b/Code/Visualization/otbPixelDescriptionActionHandler.h @@ -86,43 +86,43 @@ public: { switch (event) { - case FL_ENTER: - { - return true; - break; - } - case FL_LEAVE: - { - return true; - break; - } - case FL_MOVE: - { - // Get the clicked index - typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; - screenPoint = sourceWidget->GetMousePosition(); - - // Transform to image point - imagePoint = sourceWidget->GetScreenToImageTransform()->TransformPoint(screenPoint); - - // Transform to index - typename ViewType::IndexType index; - index[0] = static_cast<int>(imagePoint[0]); - index[1] = static_cast<int>(imagePoint[1]); - - //Add the offset - index += m_Offset; - - // Communicate new index to model - m_Model->UpdatePixelDescription(index); - - return true; - break; - } - default: - { - break; - } + case FL_ENTER: + { + return true; + break; + } + case FL_LEAVE: + { + return true; + break; + } + case FL_MOVE: + { + // Get the clicked index + typename ViewType::ImageWidgetType::PointType screenPoint, imagePoint; + screenPoint = sourceWidget->GetMousePosition(); + + // Transform to image point + imagePoint = sourceWidget->GetScreenToImageTransform()->TransformPoint(screenPoint); + + // Transform to index + typename ViewType::IndexType index; + index[0] = static_cast<int>(imagePoint[0]); + index[1] = static_cast<int>(imagePoint[1]); + + //Add the offset + index += m_Offset; + + // Communicate new index to model + m_Model->UpdatePixelDescription(index); + + return true; + break; + } + default: + { + break; + } } } } diff --git a/Code/Visualization/otbRenderingFunction.h b/Code/Visualization/otbRenderingFunction.h index 63b17dfd93..7cfd6fde26 100644 --- a/Code/Visualization/otbRenderingFunction.h +++ b/Code/Visualization/otbRenderingFunction.h @@ -79,7 +79,7 @@ public: typedef otb::ListSampleToHistogramListGenerator <ListSampleType, ScalarType, DFContainerType> HistogramFilterType; typedef itk::Statistics::Histogram< - RealScalarType, 1, DFContainerType> HistogramType; + RealScalarType, 1, DFContainerType> HistogramType; typedef typename HistogramType::Pointer HistogramPointerType; typedef ObjectList<HistogramType> HistogramListType; typedef typename HistogramListType::Pointer HistogramListPointerType; @@ -89,7 +89,7 @@ public: typedef itk::Array<double> ParametersType; - typedef typename itk::MetaDataDictionary MetaDataDictionaryType; + typedef typename itk::MetaDataDictionary MetaDataDictionaryType; /** Evaluate method: required interface */ virtual OutputPixelType Evaluate(const PixelType& spixel) const @@ -156,8 +156,8 @@ public: */ // REVIEW: I agree, we should not be calling intialize ourselve, it // would better be seamless - virtual void Initialize(const MetaDataDictionaryType &metadatadictionary){} //FIXME should disappear and be - //automatic (IsModified()) + virtual void Initialize(const MetaDataDictionaryType& metadatadictionary){} //FIXME should disappear and be + //automatic (IsModified()) protected: /** Constructor */ diff --git a/Code/Visualization/otbRenderingImageFilter.h b/Code/Visualization/otbRenderingImageFilter.h index 7af39ebb2f..18b0fcb476 100644 --- a/Code/Visualization/otbRenderingImageFilter.h +++ b/Code/Visualization/otbRenderingImageFilter.h @@ -62,7 +62,7 @@ public: typedef itk::RGBPixel<ScalarPixelType> RGBPixelType; typedef itk::RGBAPixel<ScalarPixelType> RGBAPixelType; - typedef typename itk::MetaDataDictionary MetaDataDictionaryType; + typedef typename itk::MetaDataDictionary MetaDataDictionaryType; /** Pixel operator */ inline TRGBPixel operator ()(const PixelType& pixel) const @@ -99,12 +99,11 @@ public: /** * Initialize the rendering function. */ - void InitializeFunction(const MetaDataDictionaryType &metadatadictionary) + void InitializeFunction(const MetaDataDictionaryType& metadatadictionary) { - m_Function->Initialize(metadatadictionary); + m_Function->Initialize(metadatadictionary); } - private: /** The rendering function */ RenderingFunctionPointerType m_Function; @@ -123,17 +122,17 @@ private: template <class TInputImage, class TOutputImage = Image<itk::RGBAPixel<unsigned char>, 2> > class RenderingImageFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, - Functor::RenderingFunctor - <typename TInputImage::PixelType, - typename TOutputImage::PixelType> > + Functor::RenderingFunctor + <typename TInputImage::PixelType, + typename TOutputImage::PixelType> > { public: /** Standard typedefs */ typedef RenderingImageFilter Self; typedef itk::UnaryFunctorImageFilter <TInputImage, TOutputImage, Functor::RenderingFunctor - <typename TInputImage::PixelType, - typename TOutputImage::PixelType> > Superclass; + <typename TInputImage::PixelType, + typename TOutputImage::PixelType> > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -146,7 +145,7 @@ public: /** Rendering function typedef */ typedef Functor::RenderingFunctor <typename TInputImage::PixelType, - typename TOutputImage::PixelType> RenderingFunctorType; + typename TOutputImage::PixelType> RenderingFunctorType; typedef typename RenderingFunctorType::RenderingFunctionType RenderingFunctionType; /** @@ -187,7 +186,7 @@ public: } // Initialize the rendering function - this->GetFunctor().InitializeFunction(this->GetInput()->GetMetaDataDictionary()); + this->GetFunctor().InitializeFunction(this->GetInput()->GetMetaDataDictionary()); otbMsgDevMacro(<< "RenderingImageFilter::BeforeThreadedGenerateData():"); otbMsgDevMacro(<< " - Output functor size " @@ -218,8 +217,8 @@ protected: virtual ~RenderingImageFilter() {} typedef Function::StandardRenderingFunction< - typename TInputImage::PixelType, - typename TOutputImage::PixelType> DefaultRenderingFunctionType; + typename TInputImage::PixelType, + typename TOutputImage::PixelType> DefaultRenderingFunctionType; void SetDefaultRenderingFunction() { diff --git a/Code/Visualization/otbSelectAreaActionHandler.h b/Code/Visualization/otbSelectAreaActionHandler.h index 37f77aa30c..846cd5c2df 100644 --- a/Code/Visualization/otbSelectAreaActionHandler.h +++ b/Code/Visualization/otbSelectAreaActionHandler.h @@ -93,37 +93,37 @@ public: switch (event) { - case FL_PUSH: - { - m_FirstPush = false; - m_StartIndex = lIndex; - // ImageView.txx hide the GlComponent when Update - m_RegionGlComponent->SetVisible(true); - break; - } - case FL_RELEASE: - { - if (m_StartIndex[0] != lIndex[0] && m_StartIndex[1] != lIndex[1]) + case FL_PUSH: + { + m_FirstPush = false; + m_StartIndex = lIndex; + // ImageView.txx hide the GlComponent when Update + m_RegionGlComponent->SetVisible(true); + break; + } + case FL_RELEASE: + { + if (m_StartIndex[0] != lIndex[0] && m_StartIndex[1] != lIndex[1]) + { + m_FirstPush = true; + m_StopIndex = lIndex; + m_Model->SetExtractRegionByIndex(m_StartIndex, m_StopIndex); + m_Model->Update(); + } + break; + } + case FL_DRAG: { - m_FirstPush = true; + // only redraw the red box in the widget m_StopIndex = lIndex; m_Model->SetExtractRegionByIndex(m_StartIndex, m_StopIndex); - m_Model->Update(); + m_RegionGlComponent->SetRegion(m_Model->GetExtractRegion()); + m_Widget->redraw(); + break; + } + default: + { } - break; - } - case FL_DRAG: - { - // only redraw the red box in the widget - m_StopIndex = lIndex; - m_Model->SetExtractRegionByIndex(m_StartIndex, m_StopIndex); - m_RegionGlComponent->SetRegion(m_Model->GetExtractRegion()); - m_Widget->redraw(); - break; - } - default: - { - } } return true; } diff --git a/Code/Visualization/otbStandardRenderingFunction.h b/Code/Visualization/otbStandardRenderingFunction.h index 26363b9942..b9ea92bfab 100644 --- a/Code/Visualization/otbStandardRenderingFunction.h +++ b/Code/Visualization/otbStandardRenderingFunction.h @@ -47,11 +47,11 @@ class Identity public: Identity(){} virtual ~Identity(){} - bool operator!=(const Identity&) const + bool operator !=(const Identity&) const { return false; } - bool operator==(const Identity& other) const + bool operator ==(const Identity& other) const { return !(*this != other); } @@ -78,11 +78,11 @@ public: * \ingroup Visualization */ template <class TPixel, class TRGBPixel, - class TPixelRepresentationFunction = ChannelSelectorFunctor<TPixel>, - class TTransferFunction = Identity< - typename itk::NumericTraits<typename itk::NumericTraits<TPixel>::ValueType>::RealType, - typename itk::NumericTraits<typename itk::NumericTraits<TPixel>::ValueType>::RealType - > > + class TPixelRepresentationFunction = ChannelSelectorFunctor<TPixel>, + class TTransferFunction = Identity< + typename itk::NumericTraits<typename itk::NumericTraits<TPixel>::ValueType>::RealType, + typename itk::NumericTraits<typename itk::NumericTraits<TPixel>::ValueType>::RealType + > > class StandardRenderingFunction : public RenderingFunction<TPixel, TRGBPixel> { @@ -118,7 +118,7 @@ public: typedef typename PixelRepresentationFunctionType::Pointer PixelRepresentationFunctionPointerType; typedef typename PixelRepresentationFunctionType::ChannelListType ChannelListType; - typedef typename itk::MetaDataDictionary MetaDataDictionaryType; + typedef typename itk::MetaDataDictionary MetaDataDictionaryType; /** Convert the input pixel to a pixel representation that can be displayed on * RGB. For example, channel selection, modulus computation, etc. @@ -184,7 +184,7 @@ public: return m_PixelRepresentationFunction->GetOutputSize(); } - virtual void Initialize(const MetaDataDictionaryType &metadatadictionary) //FIXME should disappear and be automatic (IsModified()) + virtual void Initialize(const MetaDataDictionaryType& metadatadictionary) //FIXME should disappear and be automatic (IsModified()) { if ((this->GetMTime() > m_UTime) || (this->GetPixelRepresentationFunction()->GetMTime() > m_UTime)) //NOTE: we assume that Transfer function have no parameters @@ -196,10 +196,11 @@ public: if (m_PixelRepresentationFunction->IsUsingDefaultParameters()) { //RGB rendering needs at least 3 channels - if (this->GetListSample()->GetMeasurementVectorSize() >=3) + if (this->GetListSample()->GetMeasurementVectorSize() >= 3) { typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; - ImageMetadataInterfaceType::Pointer metadataInterface = ImageMetadataInterfaceFactory::CreateIMI(metadatadictionary); + ImageMetadataInterfaceType::Pointer metadataInterface = ImageMetadataInterfaceFactory::CreateIMI( + metadatadictionary); m_PixelRepresentationFunction->SetRedChannelIndex(metadataInterface->GetDefaultRBand()); m_PixelRepresentationFunction->SetGreenChannelIndex(metadataInterface->GetDefaultGBand()); m_PixelRepresentationFunction->SetBlueChannelIndex(metadataInterface->GetDefaultBBand()); diff --git a/Code/Visualization/otbUniformAlphaBlendingFunction.h b/Code/Visualization/otbUniformAlphaBlendingFunction.h index 13e798537f..16338934ee 100644 --- a/Code/Visualization/otbUniformAlphaBlendingFunction.h +++ b/Code/Visualization/otbUniformAlphaBlendingFunction.h @@ -41,8 +41,8 @@ public: /** Standard class typedefs */ typedef UniformAlphaBlendingFunction Self; typedef BlendingFunction<TInputRGBPixel1, - TInputRGBPixel2, - TOutputRGBPixel> Superclass; + TInputRGBPixel2, + TOutputRGBPixel> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visualization/otbVectorDataActionHandler.h b/Code/Visualization/otbVectorDataActionHandler.h index 036aa9832b..a06fbbb363 100644 --- a/Code/Visualization/otbVectorDataActionHandler.h +++ b/Code/Visualization/otbVectorDataActionHandler.h @@ -41,11 +41,11 @@ public: /** Method for creation through the object factory */ itkNewMacro(Self) - ; + ; /** Runtime information */ itkTypeMacro(VectorDataActionHandler, ImageWidgetActionHandler) - ; + ; /** Model typedefs */ typedef TModel ModelType; @@ -67,16 +67,15 @@ public: { typename ViewType::ImageWidgetType::Pointer sourceWidget = NULL; - if(widgetId == m_View->GetFullWidget()->GetIdentifier()) + if (widgetId == m_View->GetFullWidget()->GetIdentifier()) { sourceWidget = m_View->GetFullWidget(); } - else if(widgetId == m_View->GetZoomWidget()->GetIdentifier()) + else if (widgetId == m_View->GetZoomWidget()->GetIdentifier()) { sourceWidget = m_View->GetZoomWidget(); } - //Left click if (sourceWidget && event == FL_PUSH && Fl::event_button() == 1) @@ -127,37 +126,37 @@ public: { switch (Fl::event_key()) { - case FL_Delete: - { - m_Model->DeleteGeometry(); - // Update model - m_Model->Update(); - return true; - break; - } - case FL_F + 1: - { - m_Model->SetCurrentNodeType(FEATURE_POINT); - otbMsgDevMacro( + case FL_Delete: + { + m_Model->DeleteGeometry(); + // Update model + m_Model->Update(); + return true; + break; + } + case FL_F + 1: + { + m_Model->SetCurrentNodeType(FEATURE_POINT); + otbMsgDevMacro( << "VectorDataActionHandler::HandleWidgetEvent() : changing node type to point"); - break; - } - case FL_F + 2: - { - m_Model->SetCurrentNodeType(FEATURE_LINE); - otbMsgDevMacro( + break; + } + case FL_F + 2: + { + m_Model->SetCurrentNodeType(FEATURE_LINE); + otbMsgDevMacro( << "VectorDataActionHandler::HandleWidgetEvent() : changing node type to line"); - break; - } - case FL_F + 3: - { - m_Model->SetCurrentNodeType(FEATURE_POLYGON); - otbMsgDevMacro( + break; + } + case FL_F + 3: + { + m_Model->SetCurrentNodeType(FEATURE_POLYGON); + otbMsgDevMacro( << "VectorDataActionHandler::HandleWidgetEvent() : changing node type to polygon"); - break; - } - default: - break; + break; + } + default: + break; } } diff --git a/Code/Visualization/otbVectorDataGlComponent.txx b/Code/Visualization/otbVectorDataGlComponent.txx index 1970342362..94e55b83e0 100644 --- a/Code/Visualization/otbVectorDataGlComponent.txx +++ b/Code/Visualization/otbVectorDataGlComponent.txx @@ -264,28 +264,28 @@ VectorDataGlComponent<TVectorData> // Render the current node switch (node->Get()->GetNodeType()) { - case FEATURE_POINT: - { + case FEATURE_POINT: + { // this->RenderPoint(node->Get()->GetPoint(),extent,space2ScreenTransform); - this->RenderPoint(node->Get(), extent, space2ScreenTransform); - break; + this->RenderPoint(node->Get(), extent, space2ScreenTransform); + break; - } - case FEATURE_LINE: - { - this->RenderLine(node->Get(), extent, space2ScreenTransform); - break; - } - case FEATURE_POLYGON: - { - this->RenderPolygon(node->Get(), extent, space2ScreenTransform); - break; - } - default: - { - // discard - break; - } + } + case FEATURE_LINE: + { + this->RenderLine(node->Get(), extent, space2ScreenTransform); + break; + } + case FEATURE_POLYGON: + { + this->RenderPolygon(node->Get(), extent, space2ScreenTransform); + break; + } + default: + { + // discard + break; + } } // Get the children list from the input node diff --git a/Code/Visualization/otbVectorDataModel.cxx b/Code/Visualization/otbVectorDataModel.cxx index 2b132f4bb9..993381acfb 100644 --- a/Code/Visualization/otbVectorDataModel.cxx +++ b/Code/Visualization/otbVectorDataModel.cxx @@ -22,7 +22,7 @@ namespace otb VectorDataModel::VectorDataModel() : m_VectorData(), m_CurrentNodeType(FEATURE_POLYGON), m_CurrentRootNode(), - m_CurrentGeometry(), m_Origin(),m_Spacing() //, m_UpperModel() + m_CurrentGeometry(), m_Origin(), m_Spacing() //, m_UpperModel() { m_Origin.Fill(0.); m_Spacing.Fill(1.); @@ -45,11 +45,11 @@ void VectorDataModel::Update(void) void VectorDataModel::AddPointToGeometry(VertexType& vertex) { VertexType newPoint; - newPoint[0] = m_Origin[0] + vertex[0]/m_Spacing[0]; - newPoint[1] = m_Origin[1] + vertex[1]/m_Spacing[1]; + newPoint[0] = m_Origin[0] + vertex[0] / m_Spacing[0]; + newPoint[1] = m_Origin[1] + vertex[1] / m_Spacing[1]; // Check if current node type changed, and if so, close current geometry first - if(m_CurrentGeometry.IsNotNull() && m_CurrentNodeType != m_CurrentGeometry->GetNodeType()) + if (m_CurrentGeometry.IsNotNull() && m_CurrentNodeType != m_CurrentGeometry->GetNodeType()) { this->EndGeometry(); } @@ -89,7 +89,7 @@ void VectorDataModel::AddPointToGeometry(VertexType& vertex) } else if (m_CurrentNodeType == FEATURE_LINE) { - if(m_CurrentGeometry.IsNull()) + if (m_CurrentGeometry.IsNull()) { otbMsgDevMacro(<< "VectorDataModel::AddPointToGeometry: Creating new line"); m_CurrentGeometry = DataNodeType::New(); @@ -97,7 +97,7 @@ void VectorDataModel::AddPointToGeometry(VertexType& vertex) m_CurrentGeometry->SetNodeType(FEATURE_LINE); LineType::Pointer line = LineType::New(); m_CurrentGeometry->SetLine(line); - m_VectorData->GetDataTree()->Add(m_CurrentGeometry,m_CurrentRootNode); + m_VectorData->GetDataTree()->Add(m_CurrentGeometry, m_CurrentRootNode); } otbMsgDevMacro(<< "VectorDataModel::AddPoint: Adding point " << newPoint); m_CurrentGeometry->GetLine()->AddVertex(newPoint); @@ -112,7 +112,7 @@ void VectorDataModel::AddPointToGeometry(VertexType& vertex) void VectorDataModel::EndGeometry(void) { // Avoid multiple endings - if(!m_CurrentGeometry) + if (!m_CurrentGeometry) { return; } diff --git a/Code/Visualization/otbVectorDataModel.h b/Code/Visualization/otbVectorDataModel.h index 3617d75123..dde6807c79 100644 --- a/Code/Visualization/otbVectorDataModel.h +++ b/Code/Visualization/otbVectorDataModel.h @@ -62,7 +62,7 @@ public: void Update(void); /** Set/Get the node type used */ - itkSetMacro(CurrentNodeType,NodeType); + itkSetMacro(CurrentNodeType, NodeType); itkGetMacro(CurrentNodeType, NodeType); /** Return a pointer to the vector data */ @@ -77,11 +77,11 @@ public: void SetSelectedGeometry(int n); itkGetObjectMacro(SelectedGeometry, DataNodeType); - itkSetMacro(Origin,PointType); - itkGetConstReferenceMacro(Origin,PointType); + itkSetMacro(Origin, PointType); + itkGetConstReferenceMacro(Origin, PointType); - itkSetMacro(Spacing,SpacingType); - itkGetConstReferenceMacro(Spacing,SpacingType); + itkSetMacro(Spacing, SpacingType); + itkGetConstReferenceMacro(Spacing, SpacingType); protected: /** Constructor */ diff --git a/Examples/BasicFilters/DEMToRainbowExample.cxx b/Examples/BasicFilters/DEMToRainbowExample.cxx index f2c1fd1038..3c7a41567d 100644 --- a/Examples/BasicFilters/DEMToRainbowExample.cxx +++ b/Examples/BasicFilters/DEMToRainbowExample.cxx @@ -125,14 +125,14 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::ScalarToRGBColormapImageFilter<ImageType, - RGBImageType> ColorMapFilterType; + RGBImageType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->UseInputImageExtremaForScalingOff(); if (argc == 9) { typedef otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType, - RGBPixelType> + RGBPixelType> ColorMapFunctorType; ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New(); colormap->SetMinimumInputValue(0); @@ -146,7 +146,7 @@ int main(int argc, char * argv[]) if (strcmp(argv[9], "hot") == 0) { typedef itk::Functor::HotColormapFunctor<PixelType, - RGBPixelType> + RGBPixelType> ColorMapFunctorType; ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New(); colormap->SetMinimumInputValue(0); @@ -156,7 +156,7 @@ int main(int argc, char * argv[]) else { typedef otb::Functor::ReliefColormapFunctor<PixelType, - RGBPixelType> + RGBPixelType> ColorMapFunctorType; ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New(); colormap->SetMinimumInputValue(0); @@ -171,7 +171,6 @@ int main(int argc, char * argv[]) // // Software Guide : EndLatex - // Software Guide : BeginCodeSnippet colormapper->SetInput(demToImage->GetOutput()); // Software Guide : EndCodeSnippet diff --git a/Examples/BasicFilters/HillShadingExample.cxx b/Examples/BasicFilters/HillShadingExample.cxx index 63e2d617a0..3c1823e717 100644 --- a/Examples/BasicFilters/HillShadingExample.cxx +++ b/Examples/BasicFilters/HillShadingExample.cxx @@ -152,12 +152,12 @@ int main(int argc, char * argv[]) writer->SetInput(rescaler->GetOutput()); typedef itk::ScalarToRGBColormapImageFilter<ImageType, - RGBImageType> ColorMapFilterType; + RGBImageType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->UseInputImageExtremaForScalingOff(); typedef otb::Functor::ReliefColormapFunctor<PixelType, - RGBPixelType> ColorMapFunctorType; + RGBPixelType> ColorMapFunctorType; ColorMapFunctorType::Pointer colormap = ColorMapFunctorType::New(); colormap->SetMinimumInputValue(0); colormap->SetMaximumInputValue(4000); @@ -166,10 +166,10 @@ int main(int argc, char * argv[]) colormapper->SetInput(demToImage->GetOutput()); typedef itk::BinaryFunctorImageFilter<RGBImageType, ImageType, RGBImageType, - otb::Functor:: - HillShadeModulationFunctor<RGBPixelType, - PixelType, - RGBPixelType> > + otb::Functor:: + HillShadeModulationFunctor<RGBPixelType, + PixelType, + RGBPixelType> > MultiplyFilterType; MultiplyFilterType::Pointer multiply = MultiplyFilterType::New(); diff --git a/Examples/BasicFilters/IndexedToRGBExample.cxx b/Examples/BasicFilters/IndexedToRGBExample.cxx index 46bbb589fc..b040313323 100644 --- a/Examples/BasicFilters/IndexedToRGBExample.cxx +++ b/Examples/BasicFilters/IndexedToRGBExample.cxx @@ -83,9 +83,9 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::Functor::ScalarToRGBPixelFunctor<unsigned long> - ColorMapFunctorType; + ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<ImageType, RGBImageType, - ColorMapFunctorType> ColorMapFilterType; + ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->SetInput(reader->GetOutput()); @@ -99,9 +99,9 @@ int main(int argc, char * argv[]) writer->Update(); //The following is just to produce the input image for the software guide - typedef otb::Image<unsigned char, 2> OutputImageType; + typedef otb::Image<unsigned char, 2> OutputImageType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetInput(reader->GetOutput()); diff --git a/Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx b/Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx index ca42085dca..2c9ade913f 100644 --- a/Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx +++ b/Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx @@ -68,7 +68,7 @@ int main(int argc, char * argv[]) { if (argc != 12) { - std::cerr << "Usage: " << argv[0] + std::cerr << "Usage: " << argv[0] << " infname filteredfname clusteredfname labeledclusteredfname " << "clusterboundariesfname filteredPretty clusteredPretty " << "spatialRadius rangeRadius minregionsize scale" @@ -91,8 +91,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginLatex // // We start by the classical \code{typedef}s needed for reading and -// writing the images. The EDISON -// \url{http://www.caip.rutgers.edu/riul/research/code/EDISON/index.html} +// writing the images. The EDISON +// \url{http://www.caip.rutgers.edu/riul/research/code/EDISON/index.html} // code upon which OTB's implementation is based, uses float pixel // precision, so we choose to work with a float pixel type. // diff --git a/Examples/BasicFilters/ScalingFilterExample.cxx b/Examples/BasicFilters/ScalingFilterExample.cxx index 371193b647..2606594b41 100644 --- a/Examples/BasicFilters/ScalingFilterExample.cxx +++ b/Examples/BasicFilters/ScalingFilterExample.cxx @@ -72,7 +72,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InputImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetInput(reader->GetOutput()); // Software Guide : EndCodeSnippet diff --git a/Examples/ChangeDetection/ChangeDetectionFrameworkExample.cxx b/Examples/ChangeDetection/ChangeDetectionFrameworkExample.cxx index d40e811dc4..7618ee2c83 100644 --- a/Examples/ChangeDetection/ChangeDetectionFrameworkExample.cxx +++ b/Examples/ChangeDetection/ChangeDetectionFrameworkExample.cxx @@ -117,23 +117,23 @@ public: template <class TInputImage1, class TInputImage2, class TOutputImage> class ITK_EXPORT MyChangeDetectorImageFilter : public otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - MyChangeDetector< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> > + TInputImage1, TInputImage2, TOutputImage, + MyChangeDetector< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MyChangeDetectorImageFilter Self; typedef typename otb::BinaryFunctorNeighborhoodImageFilter< - TInputImage1, TInputImage2, TOutputImage, - MyChangeDetector< - typename itk::ConstNeighborhoodIterator<TInputImage1>, - typename itk::ConstNeighborhoodIterator<TInputImage2>, - typename TOutputImage::PixelType> - > Superclass; + TInputImage1, TInputImage2, TOutputImage, + MyChangeDetector< + typename itk::ConstNeighborhoodIterator<TInputImage1>, + typename itk::ConstNeighborhoodIterator<TInputImage2>, + typename TOutputImage::PixelType> + > Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) typedef otb::ImageFileReader<InputImageType2> ReaderType2; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -217,8 +217,8 @@ int main(int argc, char* argv[]) // SoftwareGuide : EndLatex // Software Guide : BeginCodeSnippet - typedef MyChangeDetectorImageFilter<InputImageType1,InputImageType2, - ChangeImageType> FilterType; + typedef MyChangeDetectorImageFilter<InputImageType1, InputImageType2, + ChangeImageType> FilterType; // Software Guide : EndCodeSnippet ReaderType1::Pointer reader1 = ReaderType1::New(); diff --git a/Examples/ChangeDetection/CorrelChDet.cxx b/Examples/ChangeDetection/CorrelChDet.cxx index c4b18b4266..1a9841ae16 100644 --- a/Examples/ChangeDetection/CorrelChDet.cxx +++ b/Examples/ChangeDetection/CorrelChDet.cxx @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::ShiftScaleImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -122,9 +122,9 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::CorrelationChangeDetector< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/ChangeDetection/DiffChDet.cxx b/Examples/ChangeDetection/DiffChDet.cxx index 8eb841eafa..5762fb3f21 100644 --- a/Examples/ChangeDetection/DiffChDet.cxx +++ b/Examples/ChangeDetection/DiffChDet.cxx @@ -120,9 +120,9 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::AbsImageFilter<ChangeImageType, - ChangeImageType> AbsType; + ChangeImageType> AbsType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet @@ -136,9 +136,9 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::MeanDifferenceImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/ChangeDetection/JHMIChDet.cxx b/Examples/ChangeDetection/JHMIChDet.cxx index 13cac7e5ad..4900598df9 100644 --- a/Examples/ChangeDetection/JHMIChDet.cxx +++ b/Examples/ChangeDetection/JHMIChDet.cxx @@ -50,13 +50,13 @@ int main(int argc, char* argv[]) typedef otb::StreamingImageFileWriter<OutputImageType> WriterType; typedef itk::ShiftScaleImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::JoinHistogramMIImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Examples/ChangeDetection/KullbackLeiblerDistanceChDet.cxx b/Examples/ChangeDetection/KullbackLeiblerDistanceChDet.cxx index 25be4a13f6..91e325cb30 100644 --- a/Examples/ChangeDetection/KullbackLeiblerDistanceChDet.cxx +++ b/Examples/ChangeDetection/KullbackLeiblerDistanceChDet.cxx @@ -123,8 +123,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::KullbackLeiblerDistanceImageFilter<ImageType, - ImageType, - ImageType> FilterType; + ImageType, + ImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -167,7 +167,7 @@ int main(int argc, char * argv[]) // Software Guide : EndCodeSnippet typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescaleFilterType; + OutputImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); rescaler->SetInput(filter->GetOutput()); diff --git a/Examples/ChangeDetection/KullbackLeiblerProfileChDet.cxx b/Examples/ChangeDetection/KullbackLeiblerProfileChDet.cxx index dff2e8a716..e6668746ab 100644 --- a/Examples/ChangeDetection/KullbackLeiblerProfileChDet.cxx +++ b/Examples/ChangeDetection/KullbackLeiblerProfileChDet.cxx @@ -93,22 +93,22 @@ int main(int argc, char * argv[]) typedef otb::Image<PixelType, Dimension> ImageType; typedef otb::VectorImage<PixelType, Dimension> VectorImageType; typedef otb::KullbackLeiblerProfileImageFilter<ImageType, - ImageType, - VectorImageType> FilterType; + ImageType, + VectorImageType> FilterType; // Software Guide : EndCodeSnippet typedef otb::VectorImage<OutPixelType, - Dimension> + Dimension> OutVectorImageType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::ImageFileWriter<OutVectorImageType> WriterType; typedef otb::MultiChannelExtractROI<PixelType, - PixelType> + PixelType> ChannelSelecterType; typedef otb::VectorRescaleIntensityImageFilter<VectorImageType, - OutVectorImageType> + OutVectorImageType> RescalerType; ReaderType::Pointer reader1 = ReaderType::New(); diff --git a/Examples/ChangeDetection/KullbackLeiblerSupervizedDistanceChDet.cxx b/Examples/ChangeDetection/KullbackLeiblerSupervizedDistanceChDet.cxx index 4a1d354d38..b7c665e5dd 100644 --- a/Examples/ChangeDetection/KullbackLeiblerSupervizedDistanceChDet.cxx +++ b/Examples/ChangeDetection/KullbackLeiblerSupervizedDistanceChDet.cxx @@ -90,7 +90,8 @@ int main(int argc, char * argv[]) const char * outputImageFileName = parseResult->GetOutputImage().c_str(); int winSize = 35; - if (parseResult->IsOptionPresent("--winSize")) winSize = + if (parseResult->IsOptionPresent("--winSize")) + winSize = parseResult->GetParameterInt("--winSize"); /* @@ -116,7 +117,7 @@ int main(int argc, char * argv[]) imgRoi = readerRoi->GetOutput(); typedef otb::KullbackLeiblerSupervizedDistanceImageFilter< - ImageType, ImageType, TrainingImageType, ImageType> FilterType; + ImageType, ImageType, TrainingImageType, ImageType> FilterType; FilterType::Pointer changeDetector = FilterType::New(); changeDetector->SetRadius((winSize - 1) / 2); diff --git a/Examples/ChangeDetection/LHMIChDet.cxx b/Examples/ChangeDetection/LHMIChDet.cxx index 57aa2eb0c8..f9649f6adf 100644 --- a/Examples/ChangeDetection/LHMIChDet.cxx +++ b/Examples/ChangeDetection/LHMIChDet.cxx @@ -49,13 +49,13 @@ int main(int argc, char* argv[]) typedef otb::ImageFileReader<InputImageType2> ReaderType2; typedef otb::StreamingImageFileWriter<OutputImageType> WriterType; typedef itk::ShiftScaleImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::LHMIChangeDetector< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Examples/ChangeDetection/RatioChDet.cxx b/Examples/ChangeDetection/RatioChDet.cxx index 3d5630de79..3258e18384 100644 --- a/Examples/ChangeDetection/RatioChDet.cxx +++ b/Examples/ChangeDetection/RatioChDet.cxx @@ -117,7 +117,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::ShiftScaleImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet @@ -131,9 +131,9 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::MeanRatioImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Classification/BayesianPluginClassifier.cxx b/Examples/Classification/BayesianPluginClassifier.cxx index 086cf3a106..e704c557a3 100644 --- a/Examples/Classification/BayesianPluginClassifier.cxx +++ b/Examples/Classification/BayesianPluginClassifier.cxx @@ -120,8 +120,8 @@ int main(int, char *[]) // Software Guide : BeginCodeSnippet typedef itk::Vector<double, - 1> - MeasurementVectorType; + 1> + MeasurementVectorType; typedef itk::Statistics::ListSample<MeasurementVectorType> SampleType; SampleType::Pointer sample = SampleType::New(); sample->SetMeasurementVectorSize(1); // length of measurement vectors @@ -263,7 +263,7 @@ int main(int, char *[]) // Software Guide : BeginCodeSnippet typedef itk::Statistics::GaussianDensityFunction - <MeasurementVectorType> MembershipFunctionType; + <MeasurementVectorType> MembershipFunctionType; typedef itk::MaximumRatioDecisionRule DecisionRuleType; DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); diff --git a/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx b/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx index 794e6b4901..a4b5f6ae5e 100644 --- a/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx +++ b/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx @@ -126,8 +126,8 @@ int main() // Software Guide : BeginCodeSnippet unsigned int numberOfClasses = 2; typedef itk::Vector<double, - 1> - MeasurementVectorType; + 1> + MeasurementVectorType; typedef itk::Statistics::ListSample<MeasurementVectorType> SampleType; SampleType::Pointer sample = SampleType::New(); sample->SetMeasurementVectorSize(1); // length of measurement vectors @@ -221,7 +221,7 @@ int main() // Software Guide : BeginCodeSnippet typedef itk::Statistics::ExpectationMaximizationMixtureModelEstimator< - SampleType> EstimatorType; + SampleType> EstimatorType; EstimatorType::Pointer estimator = EstimatorType::New(); estimator->SetSample(sample); diff --git a/Examples/Classification/KdTreeBasedKMeansClustering.cxx b/Examples/Classification/KdTreeBasedKMeansClustering.cxx index 1e2133b1e9..8ff5937393 100644 --- a/Examples/Classification/KdTreeBasedKMeansClustering.cxx +++ b/Examples/Classification/KdTreeBasedKMeansClustering.cxx @@ -143,8 +143,8 @@ int main() // Software Guide : BeginCodeSnippet typedef itk::Vector<double, - 1> - MeasurementVectorType; + 1> + MeasurementVectorType; typedef itk::Statistics::ListSample<MeasurementVectorType> SampleType; SampleType::Pointer sample = SampleType::New(); sample->SetMeasurementVectorSize(1); @@ -300,7 +300,7 @@ int main() // Software Guide : BeginCodeSnippet typedef itk::Statistics::EuclideanDistance - <MeasurementVectorType> MembershipFunctionType; + <MeasurementVectorType> MembershipFunctionType; typedef itk::MinimumDecisionRule DecisionRuleType; DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); @@ -338,7 +338,7 @@ int main() std::vector<MembershipFunctionType::Pointer> membershipFunctions; MembershipFunctionType::OriginType origin( - sample->GetMeasurementVectorSize()); + sample->GetMeasurementVectorSize()); int index = 0; for (unsigned int i = 0; i < 2; i++) { diff --git a/Examples/Classification/SOMImageClassificationExample.cxx b/Examples/Classification/SOMImageClassificationExample.cxx index e49efc39aa..67023dfb8b 100644 --- a/Examples/Classification/SOMImageClassificationExample.cxx +++ b/Examples/Classification/SOMImageClassificationExample.cxx @@ -78,8 +78,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::SOMMap<ImageType::PixelType> SOMMapType; typedef otb::SOMImageClassificationFilter<ImageType, - LabeledImageType, - SOMMapType> + LabeledImageType, + SOMMapType> ClassificationFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Classification/SVMImageClassifierExample.cxx b/Examples/Classification/SVMImageClassifierExample.cxx index cdc9dc899d..0e483a4bbf 100644 --- a/Examples/Classification/SVMImageClassifierExample.cxx +++ b/Examples/Classification/SVMImageClassifierExample.cxx @@ -78,7 +78,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::SVMImageClassificationFilter - <ImageType, LabeledImageType> ClassificationFilterType; + <ImageType, LabeledImageType> ClassificationFilterType; typedef ClassificationFilterType::ModelType ModelType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Classification/ScalarImageKmeansModelEstimator.cxx b/Examples/Classification/ScalarImageKmeansModelEstimator.cxx index 8c59f994ec..33f74478cd 100644 --- a/Examples/Classification/ScalarImageKmeansModelEstimator.cxx +++ b/Examples/Classification/ScalarImageKmeansModelEstimator.cxx @@ -97,7 +97,7 @@ int main(int argc, char * argv[]) // Create the K-d tree structure typedef itk::Statistics::WeightedCentroidKdTreeGenerator< - AdaptorType> + AdaptorType> TreeGeneratorType; TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); diff --git a/Examples/Classification/ScalarImageMarkovRandomField1.cxx b/Examples/Classification/ScalarImageMarkovRandomField1.cxx index 031a10a268..65809b4600 100644 --- a/Examples/Classification/ScalarImageMarkovRandomField1.cxx +++ b/Examples/Classification/ScalarImageMarkovRandomField1.cxx @@ -161,7 +161,7 @@ int main(int argc, char * argv[]) typedef otb::Image<ArrayPixelType, Dimension> ArrayImageType; typedef itk::ScalarToArrayCastImageFilter< - ImageType, ArrayImageType> ScalarToArrayFilterType; + ImageType, ArrayImageType> ScalarToArrayFilterType; ScalarToArrayFilterType::Pointer scalarToArrayFilter = ScalarToArrayFilterType::New(); @@ -227,8 +227,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::ImageClassifierBase< - ArrayImageType, - LabelImageType> SupervisedClassifierType; + ArrayImageType, + LabelImageType> SupervisedClassifierType; SupervisedClassifierType::Pointer classifier = SupervisedClassifierType::New(); @@ -264,7 +264,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::Statistics::DistanceToCentroidMembershipFunction< - ArrayPixelType> + ArrayPixelType> MembershipFunctionType; typedef MembershipFunctionType::Pointer MembershipFunctionPointer; @@ -382,7 +382,7 @@ int main(int argc, char * argv[]) // Rescale outputs to the dynamic range of the display typedef otb::Image<unsigned char, Dimension> RescaledOutputImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, RescaledOutputImageType> RescalerType; + OutputImageType, RescaledOutputImageType> RescalerType; RescalerType::Pointer intensityRescaler = RescalerType::New(); intensityRescaler->SetOutputMinimum(0); diff --git a/Examples/DataRepresentation/Image/ImageAdaptor2.cxx b/Examples/DataRepresentation/Image/ImageAdaptor2.cxx index 418cf525df..d6fea4a7f1 100644 --- a/Examples/DataRepresentation/Image/ImageAdaptor2.cxx +++ b/Examples/DataRepresentation/Image/ImageAdaptor2.cxx @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) typedef otb::Image<InputPixelType, Dimension> ImageType; typedef itk::ImageAdaptor<ImageType, - RedChannelPixelAccessor> ImageAdaptorType; + RedChannelPixelAccessor> ImageAdaptorType; ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); // Software Guide : EndCodeSnippet @@ -142,8 +142,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::Image<unsigned char, Dimension> OutputImageType; typedef itk::RescaleIntensityImageFilter<ImageAdaptorType, - OutputImageType - > RescalerType; + OutputImageType + > RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); typedef otb::ImageFileWriter<OutputImageType> WriterType; diff --git a/Examples/DataRepresentation/Image/ImageAdaptor3.cxx b/Examples/DataRepresentation/Image/ImageAdaptor3.cxx index dd1ef1b5fe..a65a42097c 100644 --- a/Examples/DataRepresentation/Image/ImageAdaptor3.cxx +++ b/Examples/DataRepresentation/Image/ImageAdaptor3.cxx @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) typedef itk::CovariantVector<float, Dimension> VectorPixelType; typedef otb::Image<VectorPixelType, Dimension> VectorImageType; typedef itk::GradientRecursiveGaussianImageFilter<InputImageType, - VectorImageType> + VectorImageType> GradientFilterType; GradientFilterType::Pointer gradient = GradientFilterType::New(); @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ImageAdaptor<VectorImageType, - VectorPixelAccessor> ImageAdaptorType; + VectorPixelAccessor> ImageAdaptorType; ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/DataRepresentation/Image/ImageAdaptor4.cxx b/Examples/DataRepresentation/Image/ImageAdaptor4.cxx index 1669c95d9c..0192b367bb 100644 --- a/Examples/DataRepresentation/Image/ImageAdaptor4.cxx +++ b/Examples/DataRepresentation/Image/ImageAdaptor4.cxx @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ImageAdaptor<ImageType, - ThresholdingPixelAccessor> ImageAdaptorType; + ThresholdingPixelAccessor> ImageAdaptorType; ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); // Software Guide : EndCodeSnippet @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) // Software Guide : EndCodeSnippet typedef itk::RescaleIntensityImageFilter<ImageAdaptorType, - ImageType> RescalerType; + ImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); typedef otb::ImageFileWriter<ImageType> WriterType; diff --git a/Examples/DisparityMap/EstimateAffineTransformationExample.cxx b/Examples/DisparityMap/EstimateAffineTransformationExample.cxx index db7ddb2fa5..c29a59b26d 100644 --- a/Examples/DisparityMap/EstimateAffineTransformationExample.cxx +++ b/Examples/DisparityMap/EstimateAffineTransformationExample.cxx @@ -294,8 +294,8 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::ResampleImageFilter< - ImageType, - OutputImageType> ResampleFilterType; + ImageType, + OutputImageType> ResampleFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/DisparityMap/NCCRegistrationFilterExample.cxx b/Examples/DisparityMap/NCCRegistrationFilterExample.cxx index 59a0674383..7642cf84d8 100644 --- a/Examples/DisparityMap/NCCRegistrationFilterExample.cxx +++ b/Examples/DisparityMap/NCCRegistrationFilterExample.cxx @@ -90,7 +90,7 @@ int main(int argc, char** argv) typedef otb::Image<PixelType, ImageDimension> MovingImageType; typedef otb::Image<PixelType, ImageDimension> FixedImageType; typedef otb::Image<DeformationPixelType, - ImageDimension> DeformationFieldType; + ImageDimension> DeformationFieldType; // Software Guide : EndCodeSnippet typedef otb::ImageFileReader<FixedImageType> FixedReaderType; @@ -112,14 +112,14 @@ int main(int argc, char** argv) //Blur input images // Software Guide : BeginCodeSnippet typedef itk::RecursiveGaussianImageFilter<FixedImageType, - FixedImageType> FixedBlurType; + FixedImageType> FixedBlurType; FixedBlurType::Pointer fBlur = FixedBlurType::New(); fBlur->SetInput(fReader->GetOutput()); fBlur->SetSigma(atof(argv[7])); typedef itk::RecursiveGaussianImageFilter<MovingImageType, - MovingImageType> MovingBlurType; + MovingImageType> MovingBlurType; MovingBlurType::Pointer mBlur = MovingBlurType::New(); mBlur->SetInput(mReader->GetOutput()); @@ -135,8 +135,8 @@ int main(int argc, char** argv) //Create the filter // Software Guide : BeginCodeSnippet typedef otb::NCCRegistrationFilter<FixedImageType, - MovingImageType, - DeformationFieldType> + MovingImageType, + DeformationFieldType> RegistrationFilterType; RegistrationFilterType::Pointer registrator = RegistrationFilterType::New(); @@ -189,7 +189,7 @@ int main(int argc, char** argv) // Software Guide : EndLatex typedef otb::ImageOfVectorsToMonoChannelExtractROI<DeformationFieldType, - MovingImageType> + MovingImageType> ChannelExtractionFilterType; ChannelExtractionFilterType::Pointer channelExtractor = ChannelExtractionFilterType::New(); @@ -198,7 +198,7 @@ int main(int argc, char** argv) channelExtractor->SetChannel(1); typedef itk::RescaleIntensityImageFilter<MovingImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer fieldRescaler = RescalerType::New(); fieldRescaler->SetInput(channelExtractor->GetOutput()); @@ -217,7 +217,7 @@ int main(int argc, char** argv) dfWriter->Update(); typedef itk::WarpImageFilter<MovingImageType, MovingImageType, - DeformationFieldType> WarperType; + DeformationFieldType> WarperType; WarperType::Pointer warper = WarperType::New(); MovingImageType::PixelType padValue = 4.0; diff --git a/Examples/DisparityMap/SIFTDisparityMapEstimation.cxx b/Examples/DisparityMap/SIFTDisparityMapEstimation.cxx index 8131123c57..fa82a17b76 100644 --- a/Examples/DisparityMap/SIFTDisparityMapEstimation.cxx +++ b/Examples/DisparityMap/SIFTDisparityMapEstimation.cxx @@ -311,8 +311,8 @@ int main(int argc, char* argv[]) typedef otb::Image<VectorType, Dimension> DeformationFieldType; typedef itk::DeformationFieldSource< - DeformationFieldType - > DeformationSourceType; + DeformationFieldType + > DeformationSourceType; DeformationSourceType::Pointer deformer = DeformationSourceType::New(); // Software Guide : EndCodeSnippet @@ -337,9 +337,9 @@ int main(int argc, char* argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet typedef DeformationSourceType::LandmarkContainerPointer - LandmarkContainerPointer; + LandmarkContainerPointer; typedef DeformationSourceType::LandmarkContainer - LandmarkContainerType; + LandmarkContainerType; typedef DeformationSourceType::LandmarkPointType LandmarkPointType; LandmarkContainerType::Pointer sourceLandmarks = @@ -418,7 +418,7 @@ int main(int argc, char* argv[]) } typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescaleType; + OutputImageType> RescaleType; RescaleType::Pointer rescaler = RescaleType::New(); rescaler->SetInput(outdf); diff --git a/Examples/DisparityMap/SimpleDisparityMapEstimationExample.cxx b/Examples/DisparityMap/SimpleDisparityMapEstimationExample.cxx index 0c58526941..4a83612ce5 100644 --- a/Examples/DisparityMap/SimpleDisparityMapEstimationExample.cxx +++ b/Examples/DisparityMap/SimpleDisparityMapEstimationExample.cxx @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::NormalizedCorrelationImageToImageMetric<ImageType, - ImageType> MetricType; + ImageType> MetricType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -138,9 +138,9 @@ int main(int argc, char* argv[]) typedef itk::Function::HammingWindowFunction<3> WindowFunctionType; typedef itk::ZeroFluxNeumannBoundaryCondition<ImageType> ConditionType; typedef itk::WindowedSincInterpolateImageFunction<ImageType, 3, - WindowFunctionType, - ConditionType, - double> InterpolatorType; + WindowFunctionType, + ConditionType, + double> InterpolatorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -178,8 +178,8 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::DisparityMapEstimationMethod<ImageType, - ImageType, - PointSetType> DMEstimationType; + ImageType, + PointSetType> DMEstimationType; typedef DMEstimationType::SizeType SizeType; // Software Guide : EndCodeSnippet @@ -350,7 +350,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::NearestPointDeformationFieldGenerator<PointSetType, - DeformationFieldType> + DeformationFieldType> GeneratorType; // Software GUide : EndCodeSnippet @@ -424,7 +424,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::WarpImageFilter<ImageType, ImageType, - DeformationFieldType> ImageWarperType; + DeformationFieldType> ImageWarperType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -459,7 +459,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer outputRescaler = RescalerType::New(); outputRescaler->SetInput(warper->GetOutput()); @@ -492,7 +492,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::MultiToMonoChannelExtractROI<PixelType, - PixelType> + PixelType> ChannelExtractionFilterType; ChannelExtractionFilterType::Pointer channelExtractor diff --git a/Examples/FeatureExtraction/AlignmentsExample.cxx b/Examples/FeatureExtraction/AlignmentsExample.cxx index a4eae9a6a5..337b2901c3 100644 --- a/Examples/FeatureExtraction/AlignmentsExample.cxx +++ b/Examples/FeatureExtraction/AlignmentsExample.cxx @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::DrawPathFilter<InputImageType, PathType, - OutputImageType> DrawPathFilterType; + OutputImageType> DrawPathFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // We will now go through the list of detected paths and feed them diff --git a/Examples/FeatureExtraction/AssymmetricFusionOfLineDetectorExample.cxx b/Examples/FeatureExtraction/AssymmetricFusionOfLineDetectorExample.cxx index 635983a31b..b78a80332d 100644 --- a/Examples/FeatureExtraction/AssymmetricFusionOfLineDetectorExample.cxx +++ b/Examples/FeatureExtraction/AssymmetricFusionOfLineDetectorExample.cxx @@ -89,7 +89,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::AssymmetricFusionOfLineDetectorImageFilter<InternalImageType, - InternalImageType> + InternalImageType> FilterType; // Software Guide : EndCodeSnippet @@ -125,7 +125,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/CloudDetectionExample.cxx b/Examples/FeatureExtraction/CloudDetectionExample.cxx index b93f1e2f57..7df2467a33 100644 --- a/Examples/FeatureExtraction/CloudDetectionExample.cxx +++ b/Examples/FeatureExtraction/CloudDetectionExample.cxx @@ -115,7 +115,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::Functor::CloudDetectionFunctor<VectorPixelType, - OutputPixelType> FunctorType; + OutputPixelType> FunctorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -128,7 +128,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::CloudDetectionFilter<VectorImageType, OutputImageType, - FunctorType> CloudDetectionFilterType; + FunctorType> CloudDetectionFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -227,23 +227,23 @@ int main(int argc, char * argv[]) // Pretty image creation for printing typedef otb::Image<unsigned char, - Dimension> + Dimension> OutputPrettyImageType; typedef otb::VectorImage<unsigned char, - Dimension> + Dimension> InputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> WriterPrettyOutputType; typedef otb::ImageFileWriter<InputPrettyImageType> WriterPrettyInputType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - OutputPrettyImageType> + OutputPrettyImageType> RescalerOutputType; typedef otb::VectorRescaleIntensityImageFilter<VectorImageType, - InputPrettyImageType> + InputPrettyImageType> RescalerInputType; typedef otb::MultiChannelExtractROI<InputPixelType, - InputPixelType> + InputPixelType> ChannelExtractorType; ChannelExtractorType::Pointer selecter = ChannelExtractorType::New(); diff --git a/Examples/FeatureExtraction/ComplexMomentImageExample.cxx b/Examples/FeatureExtraction/ComplexMomentImageExample.cxx index a5e54dfef2..aedbf9bf9e 100644 --- a/Examples/FeatureExtraction/ComplexMomentImageExample.cxx +++ b/Examples/FeatureExtraction/ComplexMomentImageExample.cxx @@ -76,7 +76,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef std::complex<float> - ComplexType; + ComplexType; typedef otb::ComplexMomentImageFunction<InputImageType, ComplexType> CMType; CMType::Pointer cmFunction = CMType::New(); diff --git a/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx b/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx index 84eeba41e6..1661aed4a1 100644 --- a/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx +++ b/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx @@ -94,7 +94,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LineCorrelationDetectorImageFilter<InternalImageType, - InternalImageType> + InternalImageType> FilterType; // Software Guide : EndCodeSnippet @@ -130,7 +130,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/EdgeDensityExample.cxx b/Examples/FeatureExtraction/EdgeDensityExample.cxx index 38526faaa9..cf669686f9 100644 --- a/Examples/FeatureExtraction/EdgeDensityExample.cxx +++ b/Examples/FeatureExtraction/EdgeDensityExample.cxx @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::EdgeDensityImageFilter<ImageType, ImageType, CannyDetectorType, - CountFunctionType> EdgeDensityFilterType; + CountFunctionType> EdgeDensityFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // diff --git a/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx b/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx index 7f78142bbc..05f39b767d 100644 --- a/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx +++ b/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx @@ -105,7 +105,7 @@ int main(int argc, char * argv[]) typedef otb::VectorRescaleIntensityImageFilter <MultiSpectralImageType, OutputVectorImageType> VectorRescalerType; typedef otb::MultiChannelExtractROI<unsigned char, - unsigned char> ChannelExtractorType; + unsigned char> ChannelExtractorType; // The GenerateOutputInformation() information is required here so // that the number of component per pixel is update and known to set @@ -173,7 +173,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::SpectralAngleDistanceImageFilter<MultiSpectralImageType, - InternalImageType> SAFilterType; + InternalImageType> SAFilterType; SAFilterType::Pointer saFilter = SAFilterType::New(); saFilter->SetReferencePixel(pixelRef); saFilter->SetInput(multispectralReader->GetOutput()); @@ -188,7 +188,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::SqrtImageFilter<InternalImageType, - InternalImageType> SqrtFilterType; + InternalImageType> SqrtFilterType; SqrtFilterType::Pointer sqrtFilter = SqrtFilterType::New(); sqrtFilter->SetInput(saFilter->GetOutput()); // Software Guide : EndCodeSnippet @@ -204,7 +204,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet double sigma = alpha * (1.2 / resolution + 1); typedef itk::GradientRecursiveGaussianImageFilter<InternalImageType, - VectorImageType> + VectorImageType> GradientFilterType; GradientFilterType::Pointer gradientFilter = GradientFilterType::New(); gradientFilter->SetSigma(sigma); @@ -222,8 +222,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::NeighborhoodScalarProductFilter<VectorImageType, - InternalImageType, - InternalImageType> + InternalImageType, + InternalImageType> NeighborhoodScalarProductType; NeighborhoodScalarProductType::Pointer scalarFilter = NeighborhoodScalarProductType::New(); @@ -240,8 +240,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::RemoveIsolatedByDirectionFilter<InternalImageType, - InternalImageType, - InternalImageType> + InternalImageType, + InternalImageType> RemoveIsolatedByDirectionType; RemoveIsolatedByDirectionType::Pointer removeIsolatedByDirectionFilter = RemoveIsolatedByDirectionType::New(); @@ -260,8 +260,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::RemoveWrongDirectionFilter<InternalImageType, - InternalImageType, - InternalImageType> + InternalImageType, + InternalImageType> RemoveWrongDirectionType; RemoveWrongDirectionType::Pointer removeWrongDirectionFilter = RemoveWrongDirectionType::New(); @@ -280,8 +280,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::NonMaxRemovalByDirectionFilter<InternalImageType, - InternalImageType, - InternalImageType> + InternalImageType, + InternalImageType> NonMaxRemovalByDirectionType; NonMaxRemovalByDirectionType::Pointer nonMaxRemovalByDirectionFilter = NonMaxRemovalByDirectionType::New(); @@ -299,8 +299,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::VectorizationPathListFilter<InternalImageType, - InternalImageType, - PathType> VectorizationFilterType; + InternalImageType, + PathType> VectorizationFilterType; VectorizationFilterType::Pointer vectorizationFilter = VectorizationFilterType::New(); vectorizationFilter->SetInput(nonMaxRemovalByDirectionFilter->GetOutput()); @@ -374,7 +374,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LikelihoodPathListFilter<PathType, - InternalImageType> + InternalImageType> PathListToPathListWithValueType; PathListToPathListWithValueType::Pointer pathListConverter = PathListToPathListWithValueType::New(); @@ -406,7 +406,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::DrawPathListFilter<InternalImageType, PathType, - InternalImageType> DrawPathType; + InternalImageType> DrawPathType; DrawPathType::Pointer drawPathListFilter = DrawPathType::New(); drawPathListFilter->SetInput(output); drawPathListFilter->SetInputPath(pathListConverter->GetOutput()); @@ -423,7 +423,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - InternalImageType> RescalerType; + InternalImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetOutputMaximum(255); rescaler->SetOutputMinimum(0); @@ -433,27 +433,27 @@ int main(int argc, char * argv[]) // this small piece of code aims at producing a pretty RGB png result image. typedef otb::MultiToMonoChannelExtractROI<OutputPixelType, - PixelType> - ChannelExtractionFilterType; + PixelType> + ChannelExtractionFilterType; typedef itk::AddImageFilter<InternalImageType, InternalImageType, - InternalImageType> AddFilterType; + InternalImageType> AddFilterType; typedef itk::SubtractImageFilter<InternalImageType, InternalImageType, - InternalImageType> SubtractFilterType; + InternalImageType> SubtractFilterType; typedef itk::ThresholdImageFilter<InternalImageType> - ThresholdFilterType; + ThresholdFilterType; typedef itk::RGBPixel<OutputPixelType> - RGBPixelType; + RGBPixelType; typedef otb::Image<RGBPixelType, - Dimension> RGBImageType; + Dimension> RGBImageType; typedef itk::ComposeRGBImageFilter<InternalImageType, - RGBImageType> ComposeRGBFilterType; + RGBImageType> ComposeRGBFilterType; typedef otb::ImageFileWriter<RGBImageType> - RGBWriterType; + RGBWriterType; typedef itk::BinaryBallStructuringElement<PixelType, - Dimension> StructuringElementType; + Dimension> StructuringElementType; typedef itk::GrayscaleDilateImageFilter <InternalImageType, InternalImageType, - StructuringElementType> DilateFilterType; + StructuringElementType> DilateFilterType; StructuringElementType se; se.SetRadius(1); diff --git a/Examples/FeatureExtraction/ExtractRoadExample.cxx b/Examples/FeatureExtraction/ExtractRoadExample.cxx index 76b0c038f4..0a5a573b33 100644 --- a/Examples/FeatureExtraction/ExtractRoadExample.cxx +++ b/Examples/FeatureExtraction/ExtractRoadExample.cxx @@ -123,7 +123,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::PolyLineParametricPathWithValue<InputPixelType, - Dimension> PathType; + Dimension> PathType; // Software Guide : EndCodeSnippet @@ -137,7 +137,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::RoadExtractionFilter<InputVectorImageType, - PathType> RoadExtractionFilterType; + PathType> RoadExtractionFilterType; // Software Guide : EndCodeSnippet @@ -151,7 +151,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::DrawPathListFilter<InputImageType, PathType, - InputImageType> DrawPathFilterType; + InputImageType> DrawPathFilterType; // Software Guide : EndCodeSnippet @@ -166,7 +166,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InputImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet @@ -389,13 +389,13 @@ int main(int argc, char * argv[]) // output image enhancement typedef itk::BinaryBallStructuringElement<OutputPixelType, - Dimension> + Dimension> StructuringElementType; typedef itk::GrayscaleDilateImageFilter<OutputImageType, OutputImageType, - StructuringElementType> + StructuringElementType> DilateFilterType; typedef itk::InvertIntensityImageFilter<OutputImageType, - OutputImageType> + OutputImageType> InvertFilterType; StructuringElementType se; diff --git a/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx b/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx index e917e942ad..4b20fa7d72 100644 --- a/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx +++ b/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx @@ -105,18 +105,18 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LineRatioDetectorImageFilter<InternalImageType, - InternalImageType> DetectorType; + InternalImageType> DetectorType; typedef otb::PixelSuppressionByDirectionImageFilter<InternalImageType, - InternalImageType> - PixelSuppressionType; + InternalImageType> + PixelSuppressionType; typedef otb::LocalHoughFilter<InternalImageType> LocalHoughType; typedef otb::FillGapsFilter FillGapsType; typedef otb::DrawLineSpatialObjectListFilter<InternalImageType, - OutputImageType> - DrawLineListType; + OutputImageType> + DrawLineListType; typedef itk::RescaleIntensityImageFilter<InternalImageType> RescalerType; // Software Guide : EndCodeSnippet diff --git a/Examples/FeatureExtraction/ExtractSegmentsExample.cxx b/Examples/FeatureExtraction/ExtractSegmentsExample.cxx index a962714a0b..33867b3977 100644 --- a/Examples/FeatureExtraction/ExtractSegmentsExample.cxx +++ b/Examples/FeatureExtraction/ExtractSegmentsExample.cxx @@ -97,9 +97,9 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LineRatioDetectorImageFilter<InternalImageType, - InternalImageType> DetectorType; + InternalImageType> DetectorType; typedef otb::ExtractSegmentsImageFilter<InternalImageType, - InternalImageType> ExtractorType; + InternalImageType> ExtractorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -134,7 +134,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/FlusserMomentImageExample.cxx b/Examples/FeatureExtraction/FlusserMomentImageExample.cxx index 9a2cab2078..0dd0f47b45 100644 --- a/Examples/FeatureExtraction/FlusserMomentImageExample.cxx +++ b/Examples/FeatureExtraction/FlusserMomentImageExample.cxx @@ -77,7 +77,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef float MomentType; typedef otb::FlusserImageFunction<InputImageType, - MomentType> FlusserType; + MomentType> FlusserType; FlusserType::Pointer fmFunction = FlusserType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/FeatureExtraction/HarrisExample.cxx b/Examples/FeatureExtraction/HarrisExample.cxx index e70c74211b..146791fa8c 100644 --- a/Examples/FeatureExtraction/HarrisExample.cxx +++ b/Examples/FeatureExtraction/HarrisExample.cxx @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::HarrisImageFilter<InputImageType, - InputImageType> HarrisFilterType; + InputImageType> HarrisFilterType; // Software Guide : EndCodeSnippet typedef itk::RescaleIntensityImageFilter <InputImageType, OutputImageType> RescalerType; diff --git a/Examples/FeatureExtraction/HuMomentImageExample.cxx b/Examples/FeatureExtraction/HuMomentImageExample.cxx index 91dbeb2714..46d4609c36 100644 --- a/Examples/FeatureExtraction/HuMomentImageExample.cxx +++ b/Examples/FeatureExtraction/HuMomentImageExample.cxx @@ -77,7 +77,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef float MomentType; typedef otb::HuImageFunction<InputImageType, - MomentType> HuType; + MomentType> HuType; HuType::Pointer hmFunction = HuType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/FeatureExtraction/InnerProductPCAExample.cxx b/Examples/FeatureExtraction/InnerProductPCAExample.cxx index 7455fc6a9b..fa86c3bd72 100644 --- a/Examples/FeatureExtraction/InnerProductPCAExample.cxx +++ b/Examples/FeatureExtraction/InnerProductPCAExample.cxx @@ -148,11 +148,11 @@ int main(int argc, char* argv[]) ExtractROIFilterType; typedef otb::Image<unsigned char, - 2> OutputImageType; + 2> OutputImageType; typedef otb::ImageFileWriter<OutputImageType> - WriterType2; + WriterType2; typedef itk::RescaleIntensityImageFilter<MonoImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; for (unsigned int cpt = 0; cpt < numberOfPrincipalComponentsRequired; cpt++) { diff --git a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx index 5c0922d6d4..b81df85d58 100644 --- a/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx +++ b/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx @@ -84,7 +84,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LineSegmentDetector<ImageType, - PrecisionType> LsdFilterType; + PrecisionType> LsdFilterType; LsdFilterType::Pointer lsdFilter = LsdFilterType::New(); // Software Guide : EndCodeSnippet @@ -99,7 +99,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::DrawLineSpatialObjectListFilter<ImageType, - ImageType> DrawLineListType; + ImageType> DrawLineListType; DrawLineListType::Pointer drawLineFilter = DrawLineListType::New(); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/LocalHoughExample.cxx b/Examples/FeatureExtraction/LocalHoughExample.cxx index ec1756302a..3e02352bf3 100644 --- a/Examples/FeatureExtraction/LocalHoughExample.cxx +++ b/Examples/FeatureExtraction/LocalHoughExample.cxx @@ -89,12 +89,12 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LocalHoughFilter<InternalImageType> LocalHoughType; typedef otb::DrawLineSpatialObjectListFilter<InternalImageType, - OutputImageType> + OutputImageType> DrawLineListType; // Software Guide : EndCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); diff --git a/Examples/FeatureExtraction/PanTexExample.cxx b/Examples/FeatureExtraction/PanTexExample.cxx index 1b3ada93b8..0d8617759d 100644 --- a/Examples/FeatureExtraction/PanTexExample.cxx +++ b/Examples/FeatureExtraction/PanTexExample.cxx @@ -84,7 +84,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::ScalarImageToPanTexTextureFilter - <ImageType, ImageType> PanTexTextureFilterType; + <ImageType, ImageType> PanTexTextureFilterType; // Software Guide : EndCodeSnippet typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::ImageFileWriter<ImageType> WriterType; @@ -104,19 +104,19 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet PanTexTextureFilterType::Pointer textureFilter = PanTexTextureFilterType::New(); // Software Guide : EndCodeSnippet - + // Software Guide : BeginLatex // // Then, we set the parameters of the filter.The radius of // the neighborhood to compute the texture. // The number of bins per axis for histogram generation (it is the - // size of the co-occurrence matrix). Moreover, we have to specify + // size of the co-occurrence matrix). Moreover, we have to specify // the Min/Max in the input image. In the example, image Min/Max is set // by the user to 0 and 255. Alternatively you can use the class \doxygen{itk}{MinimumMaximumImageCalculator} // to calculate these values. // // Software Guide : EndLatex - + // Software Guide : BeginCodeSnippet PanTexTextureFilterType::SizeType sradius; sradius.Fill(4); @@ -125,7 +125,7 @@ int main(int argc, char * argv[]) textureFilter->SetInputImageMinimum(0); textureFilter->SetInputImageMaximum(256); // Software Guide : EndCodeSnippet - + // Software Guide : BeginLatex // // We can now plug the pipeline and trigger the execution by calling @@ -157,12 +157,12 @@ int main(int argc, char * argv[]) // Pretty image creation for printing typedef otb::Image<unsigned char, - Dimension> + Dimension> OutputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> WriterPrettyOutputType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputPrettyImageType> + OutputPrettyImageType> RescalerOutputType; RescalerOutputType::Pointer outputRescaler = RescalerOutputType::New(); diff --git a/Examples/FeatureExtraction/RatioLineDetectorExample.cxx b/Examples/FeatureExtraction/RatioLineDetectorExample.cxx index 692d9bbf74..75e2117f1c 100644 --- a/Examples/FeatureExtraction/RatioLineDetectorExample.cxx +++ b/Examples/FeatureExtraction/RatioLineDetectorExample.cxx @@ -129,7 +129,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx index dd59ab7087..46b08bb534 100644 --- a/Examples/FeatureExtraction/RightAngleDetectionExample.cxx +++ b/Examples/FeatureExtraction/RightAngleDetectionExample.cxx @@ -133,8 +133,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LineSpatialObjectListToRightAnglePointSetFilter<ImageType, - LinesListType, - PointSetType> + LinesListType, + PointSetType> RightAngleFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -239,7 +239,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::DrawLineSpatialObjectListFilter<ImageType, - ImageType> DrawLineListType; + ImageType> DrawLineListType; DrawLineListType::Pointer drawLineFilter = DrawLineListType::New(); drawLineFilter->SetInput(reader->GetOutput()); @@ -271,11 +271,11 @@ int main(int argc, char * argv[]) typedef unsigned char OutputPixelType; typedef otb::Image<OutputPixelType, - Dimension> OutputImageType; + Dimension> OutputImageType; typedef otb::ImageFileWriter<OutputImageType> - OutputWriterType; + OutputWriterType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); OutputWriterType::Pointer outwriter = OutputWriterType::New(); diff --git a/Examples/FeatureExtraction/SFSExample.cxx b/Examples/FeatureExtraction/SFSExample.cxx index 488a72b7d6..75a9d4699b 100644 --- a/Examples/FeatureExtraction/SFSExample.cxx +++ b/Examples/FeatureExtraction/SFSExample.cxx @@ -207,11 +207,11 @@ int main(int argc, char * argv[]) /************** pretty images for printing *********/ typedef otb::Image<unsigned char, - 2> OutputImageType; + 2> OutputImageType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; typedef otb::ImageFileWriter<OutputImageType> - OutputWriterType; + OutputWriterType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetOutputMinimum(0); diff --git a/Examples/FeatureExtraction/SIFTExample.cxx b/Examples/FeatureExtraction/SIFTExample.cxx index 08cd12e7ae..4a632d8c31 100644 --- a/Examples/FeatureExtraction/SIFTExample.cxx +++ b/Examples/FeatureExtraction/SIFTExample.cxx @@ -105,11 +105,11 @@ int main(int argc, char * argv[]) typedef itk::VariableLengthVector<RealType> RealVectorType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef itk::PointSet<RealVectorType, - Dimension> PointSetType; + Dimension> PointSetType; typedef otb::ImageToSIFTKeyPointSetFilter<ImageType, - PointSetType> - ImageToSIFTKeyPointSetFilterType; + PointSetType> + ImageToSIFTKeyPointSetFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -268,14 +268,16 @@ int main(int argc, char * argv[]) outputImage->SetPixel(index, keyPixel); if (static_cast<unsigned int>(index[1]) < - static_cast<unsigned int>(size[1] - 1)) outputImage->SetPixel( + static_cast<unsigned int>(size[1] - 1)) + outputImage->SetPixel( index + t, keyPixel); if (index[1] > 0) outputImage->SetPixel(index + b, keyPixel); if (static_cast<unsigned int>(index[0]) < - static_cast<unsigned int>(size[0] - 1)) outputImage->SetPixel( + static_cast<unsigned int>(size[0] - 1)) + outputImage->SetPixel( index + r, keyPixel); diff --git a/Examples/FeatureExtraction/SIFTFastExample.cxx b/Examples/FeatureExtraction/SIFTFastExample.cxx index 6c1df05c9e..34974d0cc0 100644 --- a/Examples/FeatureExtraction/SIFTFastExample.cxx +++ b/Examples/FeatureExtraction/SIFTFastExample.cxx @@ -302,19 +302,23 @@ int main(int argc, char * argv[]) outputImage->SetPixel(index, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - t)) outputImage-> + t)) + outputImage-> SetPixel(index + t, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - b)) outputImage-> + b)) + outputImage-> SetPixel(index + b, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - l)) outputImage-> + l)) + outputImage-> SetPixel(index + l, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - r)) outputImage-> + r)) + outputImage-> SetPixel(index + r, keyPixel); } ++pIt; diff --git a/Examples/FeatureExtraction/SURFExample.cxx b/Examples/FeatureExtraction/SURFExample.cxx index 128a1e1cb1..cf69e7599e 100644 --- a/Examples/FeatureExtraction/SURFExample.cxx +++ b/Examples/FeatureExtraction/SURFExample.cxx @@ -300,19 +300,23 @@ int main(int argc, char * argv[]) outputImage->SetPixel(index, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - t)) outputImage-> + t)) + outputImage-> SetPixel(index + t, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - b)) outputImage-> + b)) + outputImage-> SetPixel(index + b, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - l)) outputImage-> + l)) + outputImage-> SetPixel(index + l, keyPixel); if (outputImage->GetLargestPossibleRegion().IsInside(index + - r)) outputImage-> + r)) + outputImage-> SetPixel(index + r, keyPixel); } ++pIt; diff --git a/Examples/FeatureExtraction/ScaleInvariantFeatureImageFilter.cxx b/Examples/FeatureExtraction/ScaleInvariantFeatureImageFilter.cxx index ebca202f71..069f06f4ef 100644 --- a/Examples/FeatureExtraction/ScaleInvariantFeatureImageFilter.cxx +++ b/Examples/FeatureExtraction/ScaleInvariantFeatureImageFilter.cxx @@ -89,20 +89,20 @@ int main(int argc, char *argv[]) int mode = 's'; typedef float - PixelType; + PixelType; typedef itk::Image<PixelType, - Dimension> FixedImageType; + Dimension> FixedImageType; typedef itk::ScaleInvariantFeatureImageFilter<FixedImageType, - Dimension> SiftFilterType; + Dimension> SiftFilterType; typedef itk::Image<unsigned char, - Dimension> OutputImageType; + Dimension> OutputImageType; typedef itk::ImageSource<FixedImageType> ImageSourceType; ImageSourceType::Pointer fixedImageReader, fixedImageReader2; typedef itk::PointSetToImageFilter<SiftFilterType::PointSetType, - OutputImageType> PointSetFilterType; + OutputImageType> PointSetFilterType; std::cerr << "Dimension = " << Dimension << "\n"; std::cerr << "Test Scale = " << test_scale << "\n"; diff --git a/Examples/FeatureExtraction/SeamCarvingExample.cxx b/Examples/FeatureExtraction/SeamCarvingExample.cxx index 5af8c3a492..d1e956843a 100644 --- a/Examples/FeatureExtraction/SeamCarvingExample.cxx +++ b/Examples/FeatureExtraction/SeamCarvingExample.cxx @@ -66,11 +66,11 @@ int main(int argc, char * argv[]) typedef itk::PolyLineParametricPath<Dimension> PathType; typedef otb::ImageFileReader<ImageType> - ReaderType; + ReaderType; typedef otb::ImageFileWriter<OutputImageType> - WriterType; + WriterType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); diff --git a/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx b/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx index 4f7f12a28b..4561ee2e8c 100644 --- a/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx +++ b/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx @@ -80,11 +80,11 @@ int main(int argc, char * argv[]) // Software Guide : EndCodeSnippet typedef otb::ImageFileReader<ImageType> - ReaderType; + ReaderType; typedef otb::ImageFileWriter<OutputImageType> - WriterType; + WriterType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); diff --git a/Examples/FeatureExtraction/TextureExample.cxx b/Examples/FeatureExtraction/TextureExample.cxx index b26a97ee3e..23177f0dee 100644 --- a/Examples/FeatureExtraction/TextureExample.cxx +++ b/Examples/FeatureExtraction/TextureExample.cxx @@ -83,7 +83,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::ScalarImageToTexturesFilter - <ImageType,ImageType> TexturesFilterType; + <ImageType, ImageType> TexturesFilterType; // Software Guide : EndCodeSnippet typedef otb::ImageFileReader<ImageType> ReaderType; @@ -129,88 +129,88 @@ int main(int argc, char * argv[]) texturesFilter->SetRadius(sradius); - typedef ImageType::OffsetType OffsetType; - OffsetType offset; - offset[0] = xOffset; - offset[1] = yOffset; - - texturesFilter->SetOffset(offset); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // The textures filter will automatically derive the optimal - // bin size for co-occurences histogram, but they need to know - // the input image minimum and maximum. These values can be set - // like this : - // Software Guide : EndLatex - // Software Guide : BeginCodeSnippet - texturesFilter->SetInputImageMinimum(0); - texturesFilter->SetInputImageMaximum(255); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // - // To tune co-occurence histogram resolution, you can use - // the SetNumberOfBinsPerAxis() method. - // - // Software Guide : EndLatex - - // Software Guide : BeginLatex - // - // We can now plug the pipeline. - // - // Software Guide : EndLatex - // Software Guide : BeginCodeSnippet - texturesFilter->SetInput(reader->GetOutput()); - - writer->SetInput(texturesFilter->GetInertiaOutput()); - writer->Update(); - // Software Guide : EndCodeSnippet - - // Software Guide : BeginLatex - // Figure~\ref{fig:TEXTUREFUNCTOR} shows the result of applying - // the contrast texture computation. - // \begin{figure} - // \center - // \includegraphics[width=0.40\textwidth]{ADS40RoiSmall.eps} - // \includegraphics[width=0.40\textwidth]{pretty_TextureOutput.eps} - // \itkcaption[Results of applying Haralick contrast]{Result of applying the - // \doxygen{otb}{ScalarImageToTexturesFilter} to an image. From left to right : - // original image, contrast.} - // \label{fig:TEXTUREFUNCTOR} - // \end{figure} - // - // Software Guide : EndLatex - - // Pretty image creation for printing - - typedef otb::VectorImage<double,2> VectorImageType; - typedef otb::VectorImage<unsigned char,2 > PrettyVectorImageType; - typedef otb::ImageFileWriter<PrettyVectorImageType> - WriterPrettyOutputType; - - typedef otb::ImageToVectorImageCastFilter<ImageType,VectorImageType> VectorCastFilterType; - typedef otb::VectorRescaleIntensityImageFilter<VectorImageType,PrettyVectorImageType> - RescalerOutputType; - - RescalerOutputType::Pointer outputRescaler = RescalerOutputType::New(); - WriterPrettyOutputType::Pointer prettyOutputWriter = + typedef ImageType::OffsetType OffsetType; + OffsetType offset; + offset[0] = xOffset; + offset[1] = yOffset; + + texturesFilter->SetOffset(offset); + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // The textures filter will automatically derive the optimal + // bin size for co-occurences histogram, but they need to know + // the input image minimum and maximum. These values can be set + // like this : + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet + texturesFilter->SetInputImageMinimum(0); + texturesFilter->SetInputImageMaximum(255); + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // + // To tune co-occurence histogram resolution, you can use + // the SetNumberOfBinsPerAxis() method. + // + // Software Guide : EndLatex + + // Software Guide : BeginLatex + // + // We can now plug the pipeline. + // + // Software Guide : EndLatex + // Software Guide : BeginCodeSnippet + texturesFilter->SetInput(reader->GetOutput()); + + writer->SetInput(texturesFilter->GetInertiaOutput()); + writer->Update(); + // Software Guide : EndCodeSnippet + + // Software Guide : BeginLatex + // Figure~\ref{fig:TEXTUREFUNCTOR} shows the result of applying + // the contrast texture computation. + // \begin{figure} + // \center + // \includegraphics[width=0.40\textwidth]{ADS40RoiSmall.eps} + // \includegraphics[width=0.40\textwidth]{pretty_TextureOutput.eps} + // \itkcaption[Results of applying Haralick contrast]{Result of applying the + // \doxygen{otb}{ScalarImageToTexturesFilter} to an image. From left to right : + // original image, contrast.} + // \label{fig:TEXTUREFUNCTOR} + // \end{figure} + // + // Software Guide : EndLatex + + // Pretty image creation for printing + + typedef otb::VectorImage<double, 2> VectorImageType; + typedef otb::VectorImage<unsigned char, 2> PrettyVectorImageType; + typedef otb::ImageFileWriter<PrettyVectorImageType> + WriterPrettyOutputType; + + typedef otb::ImageToVectorImageCastFilter<ImageType, VectorImageType> VectorCastFilterType; + typedef otb::VectorRescaleIntensityImageFilter<VectorImageType, PrettyVectorImageType> + RescalerOutputType; + + RescalerOutputType::Pointer outputRescaler = RescalerOutputType::New(); + WriterPrettyOutputType::Pointer prettyOutputWriter = WriterPrettyOutputType::New(); - VectorCastFilterType::Pointer vectorCastFilter = VectorCastFilterType::New(); - vectorCastFilter->SetInput(texturesFilter->GetInertiaOutput()); - outputRescaler->SetInput(vectorCastFilter->GetOutput()); + VectorCastFilterType::Pointer vectorCastFilter = VectorCastFilterType::New(); + vectorCastFilter->SetInput(texturesFilter->GetInertiaOutput()); + outputRescaler->SetInput(vectorCastFilter->GetOutput()); - PrettyVectorImageType::PixelType min(1),max(1); - min.Fill(0); - max.Fill(255); + PrettyVectorImageType::PixelType min(1), max(1); + min.Fill(0); + max.Fill(255); - outputRescaler->SetOutputMinimum(min); - outputRescaler->SetOutputMaximum(max); + outputRescaler->SetOutputMinimum(min); + outputRescaler->SetOutputMaximum(max); - prettyOutputWriter->SetFileName(outprettyfname); - prettyOutputWriter->SetInput(outputRescaler->GetOutput()); + prettyOutputWriter->SetFileName(outprettyfname); + prettyOutputWriter->SetInput(outputRescaler->GetOutput()); - prettyOutputWriter->Update(); - return EXIT_SUCCESS; + prettyOutputWriter->Update(); + return EXIT_SUCCESS; } diff --git a/Examples/FeatureExtraction/TouziEdgeDetectorExample.cxx b/Examples/FeatureExtraction/TouziEdgeDetectorExample.cxx index 66e79f6047..b331b97be4 100644 --- a/Examples/FeatureExtraction/TouziEdgeDetectorExample.cxx +++ b/Examples/FeatureExtraction/TouziEdgeDetectorExample.cxx @@ -104,7 +104,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::TouziEdgeDetectorImageFilter<InternalImageType, - InternalImageType> FilterType; + InternalImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -139,7 +139,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Filtering/BinaryThresholdImageFilter.cxx b/Examples/Filtering/BinaryThresholdImageFilter.cxx index c01c11e4ef..1bd787f1e9 100644 --- a/Examples/Filtering/BinaryThresholdImageFilter.cxx +++ b/Examples/Filtering/BinaryThresholdImageFilter.cxx @@ -111,7 +111,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryThresholdImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Filtering/CannyEdgeDetectionImageFilter.cxx b/Examples/Filtering/CannyEdgeDetectionImageFilter.cxx index 75751ae9f4..2637c3812d 100644 --- a/Examples/Filtering/CannyEdgeDetectionImageFilter.cxx +++ b/Examples/Filtering/CannyEdgeDetectionImageFilter.cxx @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) typedef otb::ImageFileWriter<CharImageType> WriterType; typedef itk::RescaleIntensityImageFilter<RealImageType, - CharImageType> RescaleFilter; + CharImageType> RescaleFilter; // Software Guide : BeginLatex // @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) // Software Guide : EndLatex typedef itk::CannyEdgeDetectionImageFilter<RealImageType, - RealImageType> CannyFilter; + RealImageType> CannyFilter; //Setting the IO diff --git a/Examples/Filtering/CompositeFilterExample.cxx b/Examples/Filtering/CompositeFilterExample.cxx index 2016b8f636..71e1b90b4f 100644 --- a/Examples/Filtering/CompositeFilterExample.cxx +++ b/Examples/Filtering/CompositeFilterExample.cxx @@ -153,9 +153,9 @@ private: // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - typename GradientType::Pointer m_GradientFilter; + typename GradientType::Pointer m_GradientFilter; typename ThresholdType::Pointer m_ThresholdFilter; - typename RescalerType::Pointer m_RescaleFilter; + typename RescalerType::Pointer m_RescaleFilter; PixelType m_Threshold; }; diff --git a/Examples/Filtering/DanielssonDistanceMapImageFilter.cxx b/Examples/Filtering/DanielssonDistanceMapImageFilter.cxx index eb141ba5dd..5dec704e82 100644 --- a/Examples/Filtering/DanielssonDistanceMapImageFilter.cxx +++ b/Examples/Filtering/DanielssonDistanceMapImageFilter.cxx @@ -102,12 +102,12 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::DanielssonDistanceMapImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet typedef itk::RescaleIntensityImageFilter< - OutputImageType, OutputImageType> RescalerType; + OutputImageType, OutputImageType> RescalerType; RescalerType::Pointer scaler = RescalerType::New(); // diff --git a/Examples/Filtering/DerivativeImageFilter.cxx b/Examples/Filtering/DerivativeImageFilter.cxx index 60505cc6eb..f593fda7ab 100644 --- a/Examples/Filtering/DerivativeImageFilter.cxx +++ b/Examples/Filtering/DerivativeImageFilter.cxx @@ -109,7 +109,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::DerivativeImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet @@ -169,8 +169,8 @@ int main(int argc, char * argv[]) typedef otb::Image<unsigned char, Dimension> WriteImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, - WriteImageType> NormalizeFilterType; + OutputImageType, + WriteImageType> NormalizeFilterType; typedef otb::ImageFileWriter<WriteImageType> NormalizedWriterType; diff --git a/Examples/Filtering/DiscreteGaussianImageFilter.cxx b/Examples/Filtering/DiscreteGaussianImageFilter.cxx index 96679b5159..d6fa0be661 100644 --- a/Examples/Filtering/DiscreteGaussianImageFilter.cxx +++ b/Examples/Filtering/DiscreteGaussianImageFilter.cxx @@ -115,7 +115,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::DiscreteGaussianImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet @@ -180,7 +180,7 @@ int main(int argc, char * argv[]) typedef unsigned char WritePixelType; typedef otb::Image<WritePixelType, 2> WriteImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, WriteImageType> RescaleFilterType; + OutputImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); diff --git a/Examples/Filtering/GradientAnisotropicDiffusionImageFilter.cxx b/Examples/Filtering/GradientAnisotropicDiffusionImageFilter.cxx index 1e4a02326d..bda40b7bde 100644 --- a/Examples/Filtering/GradientAnisotropicDiffusionImageFilter.cxx +++ b/Examples/Filtering/GradientAnisotropicDiffusionImageFilter.cxx @@ -108,7 +108,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::GradientAnisotropicDiffusionImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet @@ -172,7 +172,7 @@ int main(int argc, char * argv[]) typedef unsigned char WritePixelType; typedef otb::Image<WritePixelType, 2> WriteImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, WriteImageType> RescaleFilterType; + OutputImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); diff --git a/Examples/Filtering/GradientMagnitudeImageFilter.cxx b/Examples/Filtering/GradientMagnitudeImageFilter.cxx index 87dc9518f2..288e33f838 100644 --- a/Examples/Filtering/GradientMagnitudeImageFilter.cxx +++ b/Examples/Filtering/GradientMagnitudeImageFilter.cxx @@ -119,7 +119,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::GradientMagnitudeImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet ReaderType::Pointer reader = ReaderType::New(); @@ -174,7 +174,7 @@ int main(int argc, char * argv[]) typedef unsigned char WritePixelType; typedef otb::Image<WritePixelType, 2> WriteImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, WriteImageType> RescaleFilterType; + OutputImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Filtering/GradientMagnitudeRecursiveGaussianImageFilter.cxx b/Examples/Filtering/GradientMagnitudeRecursiveGaussianImageFilter.cxx index a754a4341d..6cd81b9872 100644 --- a/Examples/Filtering/GradientMagnitudeRecursiveGaussianImageFilter.cxx +++ b/Examples/Filtering/GradientMagnitudeRecursiveGaussianImageFilter.cxx @@ -129,7 +129,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet ReaderType::Pointer reader = ReaderType::New(); @@ -199,7 +199,7 @@ int main(int argc, char * argv[]) typedef otb::Image<WritePixelType, 2> WriteImageType; typedef itk::RescaleIntensityImageFilter< - OutputImageType, WriteImageType> RescaleFilterType; + OutputImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Filtering/LaplacianRecursiveGaussianImageFilter1.cxx b/Examples/Filtering/LaplacianRecursiveGaussianImageFilter1.cxx index 81bc30eaa7..07fa70303b 100644 --- a/Examples/Filtering/LaplacianRecursiveGaussianImageFilter1.cxx +++ b/Examples/Filtering/LaplacianRecursiveGaussianImageFilter1.cxx @@ -112,7 +112,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RecursiveGaussianImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet ReaderType::Pointer reader = ReaderType::New(); @@ -280,9 +280,9 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::AddImageFilter< - OutputImageType, - OutputImageType, - OutputImageType> AddFilterType; + OutputImageType, + OutputImageType, + OutputImageType> AddFilterType; AddFilterType::Pointer addFilter = AddFilterType::New(); diff --git a/Examples/Filtering/LaplacianRecursiveGaussianImageFilter2.cxx b/Examples/Filtering/LaplacianRecursiveGaussianImageFilter2.cxx index e09dd804cf..1bd1b3cde6 100644 --- a/Examples/Filtering/LaplacianRecursiveGaussianImageFilter2.cxx +++ b/Examples/Filtering/LaplacianRecursiveGaussianImageFilter2.cxx @@ -114,7 +114,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::LaplacianRecursiveGaussianImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet ReaderType::Pointer reader = ReaderType::New(); diff --git a/Examples/Filtering/MathematicalMorphologyBinaryFilters.cxx b/Examples/Filtering/MathematicalMorphologyBinaryFilters.cxx index c3a50e221b..e8e5f7c19f 100644 --- a/Examples/Filtering/MathematicalMorphologyBinaryFilters.cxx +++ b/Examples/Filtering/MathematicalMorphologyBinaryFilters.cxx @@ -88,7 +88,7 @@ int main(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef itk::BinaryThresholdImageFilter<InputImageType, - InputImageType> ThresholdFilterType; + InputImageType> ThresholdFilterType; // Software Guide : BeginLatex // @@ -110,8 +110,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryBallStructuringElement< - InputPixelType, - Dimension> StructuringElementType; + InputPixelType, + Dimension> StructuringElementType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -123,14 +123,14 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryErodeImageFilter< - InputImageType, - OutputImageType, - StructuringElementType> ErodeFilterType; + InputImageType, + OutputImageType, + StructuringElementType> ErodeFilterType; typedef itk::BinaryDilateImageFilter< - InputImageType, - OutputImageType, - StructuringElementType> DilateFilterType; + InputImageType, + OutputImageType, + StructuringElementType> DilateFilterType; // Software Guide : EndCodeSnippet // Creation of Reader and Writer filters diff --git a/Examples/Filtering/MathematicalMorphologyGrayscaleFilters.cxx b/Examples/Filtering/MathematicalMorphologyGrayscaleFilters.cxx index b2e0b86104..8bb7b262b3 100644 --- a/Examples/Filtering/MathematicalMorphologyGrayscaleFilters.cxx +++ b/Examples/Filtering/MathematicalMorphologyGrayscaleFilters.cxx @@ -108,8 +108,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryBallStructuringElement< - InputPixelType, - Dimension> StructuringElementType; + InputPixelType, + Dimension> StructuringElementType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -121,14 +121,14 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::GrayscaleErodeImageFilter< - InputImageType, - OutputImageType, - StructuringElementType> ErodeFilterType; + InputImageType, + OutputImageType, + StructuringElementType> ErodeFilterType; typedef itk::GrayscaleDilateImageFilter< - InputImageType, - OutputImageType, - StructuringElementType> DilateFilterType; + InputImageType, + OutputImageType, + StructuringElementType> DilateFilterType; // Software Guide : EndCodeSnippet // Creation of Reader and Writer filters diff --git a/Examples/Filtering/MeanImageFilter.cxx b/Examples/Filtering/MeanImageFilter.cxx index 5c716014f7..211aac7a46 100644 --- a/Examples/Filtering/MeanImageFilter.cxx +++ b/Examples/Filtering/MeanImageFilter.cxx @@ -128,7 +128,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::MeanImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/Filtering/MedianImageFilter.cxx b/Examples/Filtering/MedianImageFilter.cxx index 03608b77a8..31eefff2d2 100644 --- a/Examples/Filtering/MedianImageFilter.cxx +++ b/Examples/Filtering/MedianImageFilter.cxx @@ -128,7 +128,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::MedianImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx b/Examples/Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx index f783a08464..a3004d560b 100644 --- a/Examples/Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx +++ b/Examples/Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx @@ -66,8 +66,8 @@ int main(int argc, char * argv[]) typedef itk::ImageDuplicator<OutputImageType> DuplicatorType; typedef itk::RecursiveGaussianImageFilter< - ImageType, - ImageType> FilterType; + ImageType, + ImageType> FilterType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); diff --git a/Examples/Fusion/BayesianFusionImageFilter.cxx b/Examples/Fusion/BayesianFusionImageFilter.cxx index 4935eb31d9..279d1f2c33 100644 --- a/Examples/Fusion/BayesianFusionImageFilter.cxx +++ b/Examples/Fusion/BayesianFusionImageFilter.cxx @@ -142,9 +142,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::BayesianFusionFilter<MultiSpecImageType, - MultiSpecImageType, - PanchroImageType, - OutputImageType> + MultiSpecImageType, + PanchroImageType, + OutputImageType> BayesianFusionFilterType; // Software Guide : EndCodeSnippet @@ -212,21 +212,21 @@ int main(int argc, char *argv[]) typedef otb::VectorImage<OutputPixelType2, Dimension> OutputVectorImageType; typedef otb::ImageFileWriter<OutputVectorImageType> VectorWriterType; typedef otb::VectorRescaleIntensityImageFilter<MultiSpecImageType, - OutputVectorImageType> + OutputVectorImageType> VectorRescalerType; typedef otb::VectorRescaleIntensityImageFilter<OutputImageType, - OutputVectorImageType> + OutputVectorImageType> VectorRescalerBayesianType; typedef otb::Image<OutputPixelType2, - Dimension> - PanchroOutputImageType; + Dimension> + PanchroOutputImageType; typedef otb::ImageToVectorImageCastFilter<PanchroImageType, - MultiSpecImageType> CasterType; + MultiSpecImageType> CasterType; typedef otb::MultiChannelExtractROI<OutputPixelType2, - OutputPixelType2> - ChannelExtractorType; + OutputPixelType2> + ChannelExtractorType; typedef otb::ImageFileWriter<PanchroOutputImageType> - WriterType2; + WriterType2; multiSpectReader->GenerateOutputInformation(); multiSpectInterpReader->GenerateOutputInformation(); diff --git a/Examples/Fusion/PanSharpeningExample.cxx b/Examples/Fusion/PanSharpeningExample.cxx index 525532b46c..849a9f3507 100644 --- a/Examples/Fusion/PanSharpeningExample.cxx +++ b/Examples/Fusion/PanSharpeningExample.cxx @@ -165,8 +165,8 @@ int main(int argc, char* argv[]) PrintableImageType::Pointer printable = PrintableImageType::New(); typedef otb::VectorImage<unsigned char, - 2> - VectorCharImageType; + 2> + VectorCharImageType; typedef otb::StreamingImageFileWriter<VectorCharImageType> PNGWriterType; PNGWriterType::Pointer pngwriter = PNGWriterType::New(); @@ -188,11 +188,11 @@ int main(int argc, char* argv[]) pngwriter->SetInput(printable2->GetOutput()); pngwriter->Update(); - typedef otb::ImageToVectorImageCastFilter<ImageType,VectorImageType> VectorCastFilterType; - - VectorCastFilterType::Pointer vectorCastFilter = VectorCastFilterType::New(); - PNGWriterType::Pointer pngwriterPan = PNGWriterType::New(); - + typedef otb::ImageToVectorImageCastFilter<ImageType, VectorImageType> VectorCastFilterType; + + VectorCastFilterType::Pointer vectorCastFilter = VectorCastFilterType::New(); + PNGWriterType::Pointer pngwriterPan = PNGWriterType::New(); + vectorCastFilter->SetInput(readerPAN->GetOutput()); PrintableImageType2::Pointer printable3 = PrintableImageType2::New(); printable3->SetInput(vectorCastFilter->GetOutput()); @@ -205,6 +205,6 @@ int main(int argc, char* argv[]) pngwriterPan->SetInput(printable3->GetOutput()); pngwriterPan->Update(); - + return EXIT_SUCCESS; } diff --git a/Examples/IO/DEMToImageGenerator.cxx b/Examples/IO/DEMToImageGenerator.cxx index 1364f67e37..38de0bccb0 100644 --- a/Examples/IO/DEMToImageGenerator.cxx +++ b/Examples/IO/DEMToImageGenerator.cxx @@ -201,14 +201,14 @@ int main(int argc, char * argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - Dimension> - OutputPrettyImageType; + Dimension> + OutputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> - WriterPrettyType; + WriterPrettyType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputPrettyImageType> RescalerType; + OutputPrettyImageType> RescalerType; typedef itk::ThresholdImageFilter<ImageType> - ThresholderType; + ThresholderType; ThresholderType::Pointer thresholder = ThresholderType::New(); RescalerType::Pointer rescaler = RescalerType::New(); diff --git a/Examples/IO/DEMToOrthoImageGenerator.cxx b/Examples/IO/DEMToOrthoImageGenerator.cxx index ce3acf230c..0d4affc48e 100644 --- a/Examples/IO/DEMToOrthoImageGenerator.cxx +++ b/Examples/IO/DEMToOrthoImageGenerator.cxx @@ -96,7 +96,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::DEMToOrthoImageGenerator<ImageType, - UtmProjectionType> + UtmProjectionType> DEMToOrthoImageGeneratorType; DEMToOrthoImageGeneratorType::Pointer object = @@ -215,14 +215,14 @@ int main(int argc, char * argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - Dimension> - OutputPrettyImageType; + Dimension> + OutputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> - WriterPrettyType; + WriterPrettyType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputPrettyImageType> RescalerType; + OutputPrettyImageType> RescalerType; typedef itk::ThresholdImageFilter<ImageType> - ThresholderType; + ThresholderType; ThresholderType::Pointer thresholder = ThresholderType::New(); RescalerType::Pointer rescaler = RescalerType::New(); diff --git a/Examples/IO/DXFReaderExample.cxx b/Examples/IO/DXFReaderExample.cxx index 137f4305c1..3bf59db272 100644 --- a/Examples/IO/DXFReaderExample.cxx +++ b/Examples/IO/DXFReaderExample.cxx @@ -84,7 +84,7 @@ int main(int argc, char * argv[]) typedef otb::SpatialObjectToImageDrawingFilter<GroupType, ImageType> SpatialObjectToImageDrawingFilterType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputImageType> CastFilterType; + OutputImageType> CastFilterType; typedef itk::SpatialObject<Dimension> SpatialObjectType; // Instantiating object diff --git a/Examples/IO/ExtractROI.cxx b/Examples/IO/ExtractROI.cxx index 9fd8033677..621cea5b4c 100644 --- a/Examples/IO/ExtractROI.cxx +++ b/Examples/IO/ExtractROI.cxx @@ -114,7 +114,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MultiChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -219,7 +219,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MultiToMonoChannelExtractROI<InputPixelType, - OutputPixelType> + OutputPixelType> ExtractROIMonoFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/IO/ImageReadCastWrite.cxx b/Examples/IO/ImageReadCastWrite.cxx index 00c8addb6e..3fa05a78cf 100644 --- a/Examples/IO/ImageReadCastWrite.cxx +++ b/Examples/IO/ImageReadCastWrite.cxx @@ -107,8 +107,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter< - InputImageType, - OutputImageType> FilterType; + InputImageType, + OutputImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/IO/ImageReadRegionOfInterestWrite.cxx b/Examples/IO/ImageReadRegionOfInterestWrite.cxx index dc1a69a38d..03332f13db 100644 --- a/Examples/IO/ImageReadRegionOfInterestWrite.cxx +++ b/Examples/IO/ImageReadRegionOfInterestWrite.cxx @@ -111,7 +111,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::ExtractROI<InputImageType::PixelType, - OutputImageType::PixelType> FilterType; + OutputImageType::PixelType> FilterType; FilterType::Pointer filter = FilterType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/IO/LidarToImageExample.cxx b/Examples/IO/LidarToImageExample.cxx index 87d936c5bf..b7c44fdb80 100644 --- a/Examples/IO/LidarToImageExample.cxx +++ b/Examples/IO/LidarToImageExample.cxx @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) typedef otb::Image<unsigned char, 2> UCharImageType; typedef itk::RescaleIntensityImageFilter<ImageType, - UCharImageType> RescalerType; + UCharImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetInput(image); rescaler->SetOutputMaximum(255); diff --git a/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx b/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx index 6167de01b0..2356cce8ba 100644 --- a/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx +++ b/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) const unsigned int timeLength = region4D.GetSize()[3]; typedef itk::ImageLinearConstIteratorWithIndex< - Image4DType> IteratorType; + Image4DType> IteratorType; IteratorType it(image4D, region4D); it.SetDirection(3); // Walk along time dimension diff --git a/Examples/Iterators/NeighborhoodIterators1.cxx b/Examples/Iterators/NeighborhoodIterators1.cxx index ce58643b73..6edbab879e 100644 --- a/Examples/Iterators/NeighborhoodIterators1.cxx +++ b/Examples/Iterators/NeighborhoodIterators1.cxx @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) typedef otb::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter< - ImageType, WriteImageType> RescaleFilterType; + ImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/NeighborhoodIterators2.cxx b/Examples/Iterators/NeighborhoodIterators2.cxx index 9c92d8f358..acdb3eb65f 100644 --- a/Examples/Iterators/NeighborhoodIterators2.cxx +++ b/Examples/Iterators/NeighborhoodIterators2.cxx @@ -165,7 +165,7 @@ int main(int argc, char * argv[]) typedef otb::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter< - ImageType, WriteImageType> RescaleFilterType; + ImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/NeighborhoodIterators3.cxx b/Examples/Iterators/NeighborhoodIterators3.cxx index 2e4a71bd41..bb8a3c6ea8 100644 --- a/Examples/Iterators/NeighborhoodIterators3.cxx +++ b/Examples/Iterators/NeighborhoodIterators3.cxx @@ -203,7 +203,7 @@ int main(int argc, char * argv[]) typedef otb::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter< - ImageType, WriteImageType> RescaleFilterType; + ImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/NeighborhoodIterators4.cxx b/Examples/Iterators/NeighborhoodIterators4.cxx index 2e7ad48ba3..90f8b789b4 100644 --- a/Examples/Iterators/NeighborhoodIterators4.cxx +++ b/Examples/Iterators/NeighborhoodIterators4.cxx @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) typedef otb::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter< - ImageType, WriteImageType> RescaleFilterType; + ImageType, WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/NeighborhoodIterators5.cxx b/Examples/Iterators/NeighborhoodIterators5.cxx index 95f46a5a82..8d478a41fe 100644 --- a/Examples/Iterators/NeighborhoodIterators5.cxx +++ b/Examples/Iterators/NeighborhoodIterators5.cxx @@ -191,7 +191,7 @@ int main(int argc, char * argv[]) typedef itk::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ImageType, - WriteImageType> RescaleFilterType; + WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/NeighborhoodIterators6.cxx b/Examples/Iterators/NeighborhoodIterators6.cxx index d6adabe5ed..868a713e97 100644 --- a/Examples/Iterators/NeighborhoodIterators6.cxx +++ b/Examples/Iterators/NeighborhoodIterators6.cxx @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) typedef itk::NeighborhoodIterator<ImageType> NeighborhoodIteratorType; typedef itk::FastMarchingImageFilter<ImageType, - ImageType> FastMarchingFilterType; + ImageType> FastMarchingFilterType; FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) typedef otb::ImageFileWriter<WriteImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ImageType, - WriteImageType> RescaleFilterType; + WriteImageType> RescaleFilterType; RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); diff --git a/Examples/Iterators/ShapedNeighborhoodIterators1.cxx b/Examples/Iterators/ShapedNeighborhoodIterators1.cxx index 689ea75a7d..725768b858 100644 --- a/Examples/Iterators/ShapedNeighborhoodIterators1.cxx +++ b/Examples/Iterators/ShapedNeighborhoodIterators1.cxx @@ -73,8 +73,8 @@ int main(int argc, char * argv[]) typedef otb::Image<PixelType, 2> ImageType; typedef itk::ConstShapedNeighborhoodIterator< - ImageType - > ShapedNeighborhoodIteratorType; + ImageType + > ShapedNeighborhoodIteratorType; typedef itk::ImageRegionIterator<ImageType> IteratorType; // Software Guide : EndCodeSnippet @@ -127,7 +127,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< - ImageType> FaceCalculatorType; + ImageType> FaceCalculatorType; FaceCalculatorType faceCalculator; FaceCalculatorType::FaceListType faceList; diff --git a/Examples/Iterators/ShapedNeighborhoodIterators2.cxx b/Examples/Iterators/ShapedNeighborhoodIterators2.cxx index 8575e42bd9..b634262b2b 100644 --- a/Examples/Iterators/ShapedNeighborhoodIterators2.cxx +++ b/Examples/Iterators/ShapedNeighborhoodIterators2.cxx @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) typedef otb::ImageFileReader<ImageType> ReaderType; typedef itk::ConstShapedNeighborhoodIterator<ImageType> - ShapedNeighborhoodIteratorType; + ShapedNeighborhoodIteratorType; typedef itk::ImageRegionIterator<ImageType> IteratorType; ReaderType::Pointer reader = ReaderType::New(); diff --git a/Examples/Learning/SEMModelEstimatorExample.cxx b/Examples/Learning/SEMModelEstimatorExample.cxx index 9005587380..ba212fc3e3 100644 --- a/Examples/Learning/SEMModelEstimatorExample.cxx +++ b/Examples/Learning/SEMModelEstimatorExample.cxx @@ -213,7 +213,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter<OutputImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetOutputMinimum(itk::NumericTraits<unsigned char>::min()); diff --git a/Examples/Learning/SOMExample.cxx b/Examples/Learning/SOMExample.cxx index a21cfd2ad5..65baa138cf 100644 --- a/Examples/Learning/SOMExample.cxx +++ b/Examples/Learning/SOMExample.cxx @@ -171,7 +171,7 @@ int main(int argc, char* argv[]) typedef otb::Functor::CzihoSOMNeighborhoodBehaviorFunctor NeighborhoodBehaviorFunctorType; typedef otb::SOM<SampleListType, MapType, - LearningBehaviorFunctorType, NeighborhoodBehaviorFunctorType> + LearningBehaviorFunctorType, NeighborhoodBehaviorFunctorType> SOMType; // Software Guide : EndCodeSnippet // @@ -298,13 +298,13 @@ int main(int argc, char* argv[]) //Just for visualization purposes, we zoom the image, and pass it to the printable image filter typedef otb::Image<PixelType, - 2> SingleImageType; + 2> SingleImageType; typedef itk::ExpandImageFilter<SingleImageType, - SingleImageType> ExpandType; + SingleImageType> ExpandType; typedef otb::PerBandVectorImageFilter<MapType, MapType, - ExpandType> VectorExpandType; + ExpandType> VectorExpandType; typedef itk::NearestNeighborInterpolateImageFunction<SingleImageType, - double> + double> InterpolatorType; typedef otb::PrintableImageFilter<MapType> PrintableFilterType; @@ -387,7 +387,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::SOMActivationBuilder<SampleListType, MapType, - OutputImageType> SOMActivationBuilderType; + OutputImageType> SOMActivationBuilderType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex // @@ -424,10 +424,10 @@ int main(int argc, char* argv[]) //Just for visualization purposes, we zoom the image. typedef itk::ExpandImageFilter<OutputImageType, - OutputImageType> ExpandType2; + OutputImageType> ExpandType2; typedef itk::NearestNeighborInterpolateImageFunction<OutputImageType, - double> - InterpolatorType2; + double> + InterpolatorType2; InterpolatorType2::Pointer interpolator2 = InterpolatorType2::New(); ExpandType2::Pointer expand2 = ExpandType2::New(); diff --git a/Examples/Learning/SVMGenericKernelImageClassificationExample.cxx b/Examples/Learning/SVMGenericKernelImageClassificationExample.cxx index 5e210cb13c..ae56c34bd5 100644 --- a/Examples/Learning/SVMGenericKernelImageClassificationExample.cxx +++ b/Examples/Learning/SVMGenericKernelImageClassificationExample.cxx @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) const unsigned int Dimension = 2; typedef otb::Image<itk::FixedArray<PixelType, 3>, - Dimension> InputImageType; + Dimension> InputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; @@ -179,7 +179,7 @@ int main(int argc, char* argv[]) typedef otb::Image<unsigned char, Dimension> FileImageType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - FileImageType> RescalerType; + FileImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetOutputMinimum(itk::NumericTraits<unsigned char>::min()); diff --git a/Examples/Learning/SVMGenericKernelImageModelEstimatorExample.cxx b/Examples/Learning/SVMGenericKernelImageModelEstimatorExample.cxx index be3e1d0831..eb7febdc8e 100644 --- a/Examples/Learning/SVMGenericKernelImageModelEstimatorExample.cxx +++ b/Examples/Learning/SVMGenericKernelImageModelEstimatorExample.cxx @@ -69,7 +69,7 @@ int main(int argc, char* argv[]) typedef otb::Image<InputPixelType, Dimension> TrainingImageType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; typedef otb::ImageFileReader<InputImageType> InputReaderType; typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; diff --git a/Examples/Learning/SVMImageClassificationExample.cxx b/Examples/Learning/SVMImageClassificationExample.cxx index 2fc5ddbfa1..4ae51d9d34 100644 --- a/Examples/Learning/SVMImageClassificationExample.cxx +++ b/Examples/Learning/SVMImageClassificationExample.cxx @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::Image<itk::FixedArray<PixelType, 3>, - Dimension> InputImageType; + Dimension> InputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; // Software Guide : EndCodeSnippet @@ -293,7 +293,7 @@ int main(int argc, char* argv[]) typedef otb::Image<unsigned char, Dimension> FileImageType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - FileImageType> RescalerType; + FileImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); diff --git a/Examples/Learning/SVMImageEstimatorClassificationMultiExample.cxx b/Examples/Learning/SVMImageEstimatorClassificationMultiExample.cxx index 486e15d507..8dad18f521 100644 --- a/Examples/Learning/SVMImageEstimatorClassificationMultiExample.cxx +++ b/Examples/Learning/SVMImageEstimatorClassificationMultiExample.cxx @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; // Software Guide : EndCodeSnippet @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::Image<itk::FixedArray<InputPixelType, 3>, - Dimension> ClassifyImageType; + Dimension> ClassifyImageType; typedef otb::ImageFileReader<ClassifyImageType> ClassifyReaderType; // Software Guide : EndCodeSnippet @@ -380,8 +380,8 @@ int main(int argc, char *argv[]) typedef itk::Functor::ScalarToRGBPixelFunctor<unsigned long> ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<OutputImageType, - RGBImageType, - ColorMapFunctorType> ColorMapFilterType; + RGBImageType, + ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->SetInput(outputImage); diff --git a/Examples/Learning/SVMImageModelEstimatorExample.cxx b/Examples/Learning/SVMImageModelEstimatorExample.cxx index 40547f8540..200ccf388f 100644 --- a/Examples/Learning/SVMImageModelEstimatorExample.cxx +++ b/Examples/Learning/SVMImageModelEstimatorExample.cxx @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; // Software Guide : EndCodeSnippet diff --git a/Examples/Learning/SVMPointSetClassificationExample.cxx b/Examples/Learning/SVMPointSetClassificationExample.cxx index 231117b3e7..863ac21ba7 100644 --- a/Examples/Learning/SVMPointSetClassificationExample.cxx +++ b/Examples/Learning/SVMPointSetClassificationExample.cxx @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::SVMModel<SampleType::MeasurementVectorType::ValueType, - LabelPixelType> ModelType; + LabelPixelType> ModelType; ModelType::Pointer model = ModelType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/Learning/SVMPointSetExample.cxx b/Examples/Learning/SVMPointSetExample.cxx index 100981d3e8..ba81cd8300 100644 --- a/Examples/Learning/SVMPointSetExample.cxx +++ b/Examples/Learning/SVMPointSetExample.cxx @@ -105,7 +105,7 @@ int main(int argc, char* argv[]) lPSet->SetPoints(lCont); typedef otb::SVMPointSetModelEstimator<MeasurePointSetType, - LabelPointSetType> EstimatorType; + LabelPointSetType> EstimatorType; EstimatorType::Pointer estimator = EstimatorType::New(); @@ -161,7 +161,7 @@ int main(int argc, char* argv[]) /** preparing classifier and decision rule object */ typedef otb::SVMModel<SampleType::MeasurementVectorType::ValueType, - LabelPixelType> ModelType; + LabelPixelType> ModelType; ModelType::Pointer model = estimator->GetModel(); diff --git a/Examples/Learning/SVMPointSetModelEstimatorExample.cxx b/Examples/Learning/SVMPointSetModelEstimatorExample.cxx index 7f466fdbac..7a1413471e 100644 --- a/Examples/Learning/SVMPointSetModelEstimatorExample.cxx +++ b/Examples/Learning/SVMPointSetModelEstimatorExample.cxx @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::SVMPointSetModelEstimator<FeaturePointSetType, - LabelPointSetType> EstimatorType; + LabelPointSetType> EstimatorType; EstimatorType::Pointer estimator = EstimatorType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/Markov/MarkovClassification2Example.cxx b/Examples/Markov/MarkovClassification2Example.cxx index ff7444df05..b86291730c 100644 --- a/Examples/Markov/MarkovClassification2Example.cxx +++ b/Examples/Markov/MarkovClassification2Example.cxx @@ -103,7 +103,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::MRFSamplerRandomMAP<InputImageType, - LabelledImageType> SamplerType; + LabelledImageType> SamplerType; // typedef otb::MRFSamplerRandom< InputImageType, LabelledImageType> SamplerType; // Software Guide : EndCodeSnippet diff --git a/Examples/Markov/MarkovRegularizationExample.cxx b/Examples/Markov/MarkovRegularizationExample.cxx index 655c2ef29a..f68337b03f 100644 --- a/Examples/Markov/MarkovRegularizationExample.cxx +++ b/Examples/Markov/MarkovRegularizationExample.cxx @@ -95,7 +95,7 @@ int main(int argc, char* argv[]) <LabelledImageType, LabelledImageType> MarkovRandomFieldFilterType; typedef otb::MRFSamplerRandom<LabelledImageType, - LabelledImageType> SamplerType; + LabelledImageType> SamplerType; typedef otb::MRFOptimizerMetropolis OptimizerType; diff --git a/Examples/MultiScale/MorphologicalPyramidAnalysisFilterExample.cxx b/Examples/MultiScale/MorphologicalPyramidAnalysisFilterExample.cxx index 4967717610..705dd64494 100644 --- a/Examples/MultiScale/MorphologicalPyramidAnalysisFilterExample.cxx +++ b/Examples/MultiScale/MorphologicalPyramidAnalysisFilterExample.cxx @@ -99,7 +99,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryBallStructuringElement<InputPixelType, - Dimension> StructuringElementType; + Dimension> StructuringElementType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -115,8 +115,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::OpeningClosingMorphologicalFilter<InputImageType, - InputImageType, - StructuringElementType> + InputImageType, + StructuringElementType> OpeningClosingFilterType; // Software Guide : EndCodeSnippet @@ -130,8 +130,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MorphologicalPyramidAnalysisFilter<InputImageType, - OutputImageType, - OpeningClosingFilterType> + OutputImageType, + OpeningClosingFilterType> PyramidFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/MultiScale/MorphologicalPyramidSegmentationExample.cxx b/Examples/MultiScale/MorphologicalPyramidSegmentationExample.cxx index dd447e868d..17e3b5e498 100644 --- a/Examples/MultiScale/MorphologicalPyramidSegmentationExample.cxx +++ b/Examples/MultiScale/MorphologicalPyramidSegmentationExample.cxx @@ -107,12 +107,12 @@ int main(int argc, char * argv[]) typedef itk::BinaryBallStructuringElement<InputPixelType, Dimension> StructuringElementType; typedef otb::OpeningClosingMorphologicalFilter<InputImageType, - InputImageType, - StructuringElementType> + InputImageType, + StructuringElementType> OpeningClosingFilterType; typedef otb::MorphologicalPyramidAnalysisFilter<InputImageType, - InputImageType, - OpeningClosingFilterType> + InputImageType, + OpeningClosingFilterType> PyramidFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -125,7 +125,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MorphologicalPyramidSegmentationFilter<InputImageType, - OutputImageType> + OutputImageType> SegmentationFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/MultiScale/MorphologicalPyramidSegmenterExample.cxx b/Examples/MultiScale/MorphologicalPyramidSegmenterExample.cxx index 113bc15424..81937081bc 100644 --- a/Examples/MultiScale/MorphologicalPyramidSegmenterExample.cxx +++ b/Examples/MultiScale/MorphologicalPyramidSegmenterExample.cxx @@ -92,7 +92,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MorphologicalPyramid::Segmenter<InputImageType, - LabelImageType> + LabelImageType> SegmenterType; // Software Guide : EndCodeSnippet @@ -156,8 +156,8 @@ int main(int argc, char * argv[]) typedef itk::Functor::ScalarToRGBPixelFunctor<LabelPixelType> ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<LabelImageType, - RGBImageType, - ColorMapFunctorType> ColorMapFilterType; + RGBImageType, + ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/MultiScale/MorphologicalPyramidSynthesisFilterExample.cxx b/Examples/MultiScale/MorphologicalPyramidSynthesisFilterExample.cxx index 8f7161298a..152526c5f8 100644 --- a/Examples/MultiScale/MorphologicalPyramidSynthesisFilterExample.cxx +++ b/Examples/MultiScale/MorphologicalPyramidSynthesisFilterExample.cxx @@ -116,8 +116,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::OpeningClosingMorphologicalFilter<InputImageType, - InputImageType, - StructuringElementType> + InputImageType, + StructuringElementType> OpeningClosingFilterType; // Software Guide : EndCodeSnippet @@ -131,8 +131,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MorphologicalPyramidAnalysisFilter<InputImageType, - OutputImageType, - OpeningClosingFilterType> + OutputImageType, + OpeningClosingFilterType> PyramidAnalysisFilterType; // Software Guide : EndCodeSnippet @@ -146,7 +146,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::MorphologicalPyramidSynthesisFilter<InputImageType, - OutputImageType> + OutputImageType> PyramidSynthesisFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/OBIA/ImageToLabelToImage.cxx b/Examples/OBIA/ImageToLabelToImage.cxx index 4442bbb41a..461e50793e 100644 --- a/Examples/OBIA/ImageToLabelToImage.cxx +++ b/Examples/OBIA/ImageToLabelToImage.cxx @@ -136,12 +136,12 @@ int main(int argc, char * argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - dim> - OutputPrettyImageType; + dim> + OutputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> - WriterPrettyType; + WriterPrettyType; typedef itk::RescaleIntensityImageFilter<ImageType, - OutputPrettyImageType> RescalerType; + OutputPrettyImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); WriterPrettyType::Pointer prettyWriter = WriterPrettyType::New(); diff --git a/Examples/OBIA/KeepNObjects.cxx b/Examples/OBIA/KeepNObjects.cxx index 657e65be83..34ff89d125 100644 --- a/Examples/OBIA/KeepNObjects.cxx +++ b/Examples/OBIA/KeepNObjects.cxx @@ -69,13 +69,13 @@ int main(int argc, char * argv[]) typedef itk::LabelImageToLabelMapFilter<IType, LabelMapType> LabelizerType; typedef itk::StatisticsLabelMapFilter<LabelMapType, - IType> LabelObjectValuatorType; + IType> LabelObjectValuatorType; typedef LabelObjectType::AttributeType - AttributeType; + AttributeType; typedef itk::StatisticsKeepNObjectsLabelMapFilter<LabelMapType> - KeepNObjectsType; + KeepNObjectsType; typedef itk::LabelMapToLabelImageFilter<LabelMapType, - IType> BinarizerType; + IType> BinarizerType; LabelizerType::Pointer labelizer = LabelizerType::New(); labelizer->SetInput(reader->GetOutput()); diff --git a/Examples/OBIA/LabelMapToVectorData.cxx b/Examples/OBIA/LabelMapToVectorData.cxx index 48db287a6b..4e13b90c7a 100644 --- a/Examples/OBIA/LabelMapToVectorData.cxx +++ b/Examples/OBIA/LabelMapToVectorData.cxx @@ -99,22 +99,22 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::AttributesMapLabelObject<LabelType, Dimension, - double> - LabelObjectType; + double> + LabelObjectType; typedef itk::LabelMap<LabelObjectType> - LabelMapType; + LabelMapType; typedef itk::LabelImageToLabelMapFilter<LabeledImageType, - LabelMapType> - LabelMapFilterType; + LabelMapType> + LabelMapFilterType; typedef otb::Polygon<double> - PolygonType; + PolygonType; typedef otb::Functor::LabelObjectToPolygonFunctor<LabelObjectType, - PolygonType> FunctorType; + PolygonType> FunctorType; // Software Guide : EndCodeSnippet typedef VectorDataType::DataNodeType DataNodeType; typedef otb::VectorDataProjectionFilter<VectorDataType, - VectorDataType> VectorDataFilterType; + VectorDataType> VectorDataFilterType; LabeledReaderType::Pointer lreader = LabeledReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -151,7 +151,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef otb::LabelMapToVectorDataFilter<LabelMapType, - VectorDataType> + VectorDataType> LabelMapToVectorDataFilterType; LabelMapToVectorDataFilterType::Pointer MyFilter = diff --git a/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx b/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx index 243525a565..565d981e50 100644 --- a/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx +++ b/Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx @@ -105,28 +105,28 @@ int main(int argc, char * argv[]) typedef otb::VectorRescaleIntensityImageFilter <VectorImageType, OutputVectorImageType> VectorRescalerType; typedef otb::MultiChannelExtractROI<unsigned char, - unsigned char> ChannelExtractorType; + unsigned char> ChannelExtractorType; // Label map typedef typedef otb::AttributesMapLabelObject<LabelType, Dimension, - double> + double> LabelObjectType; typedef itk::LabelMap<LabelObjectType> LabelMapType; typedef itk::LabelImageToLabelMapFilter<LabeledImageType, - LabelMapType> + LabelMapType> LabelMapFilterType; typedef otb::ShapeAttributesLabelMapFilter<LabelMapType> ShapeLabelMapFilterType; typedef otb::StatisticsAttributesLabelMapFilter<LabelMapType, - ImageType> + ImageType> StatisticsLabelMapFilterType; typedef otb::RadiometricAttributesLabelMapFilter<LabelMapType, - VectorImageType> + VectorImageType> RadiometricLabelMapFilterType; typedef otb::AttributesMapOpeningLabelMapFilter<LabelMapType> OpeningLabelMapFilterType; typedef itk::LabelMapToBinaryImageFilter<LabelMapType, - LabeledImageType> + LabeledImageType> LabelMapToBinaryImageFilterType; ReaderType::Pointer reader = ReaderType::New(); @@ -293,7 +293,7 @@ int main(int argc, char * argv[]) // // Figure~\ref{fig:RADIOMETRIC_LABEL_MAP_FILTER} shows the result of applying // the object selection based on radiometric attributes. -// \begin{figure} [htbp] +// \begin{figure} [htbp] // \center // \includegraphics[width=0.44\textwidth]{qb_ExtractRoad_Radiometry_pretty.eps} // \includegraphics[width=0.44\textwidth]{OBIARadiometricAttribute1.eps} diff --git a/Examples/Patented/FuzzyConnectednessImageFilter.cxx b/Examples/Patented/FuzzyConnectednessImageFilter.cxx index 3dcd6c90f7..e6cfdf77fc 100644 --- a/Examples/Patented/FuzzyConnectednessImageFilter.cxx +++ b/Examples/Patented/FuzzyConnectednessImageFilter.cxx @@ -105,9 +105,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ConfidenceConnectedImageFilter< - InputImageType, - BinaryImageType - > ConfidenceConnectedFilterType; + InputImageType, + BinaryImageType + > ConfidenceConnectedFilterType; ConfidenceConnectedFilterType::Pointer confidenceConnectedFilter = ConfidenceConnectedFilterType::New(); @@ -122,9 +122,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::SimpleFuzzyConnectednessScalarImageFilter< - InputImageType, - BinaryImageType - > FuzzySegmentationFilterType; + InputImageType, + BinaryImageType + > FuzzySegmentationFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Patented/HybridSegmentationFuzzyVoronoi.cxx b/Examples/Patented/HybridSegmentationFuzzyVoronoi.cxx index 9d6a9277d2..a693f66360 100644 --- a/Examples/Patented/HybridSegmentationFuzzyVoronoi.cxx +++ b/Examples/Patented/HybridSegmentationFuzzyVoronoi.cxx @@ -108,9 +108,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::SimpleFuzzyConnectednessScalarImageFilter< - InputImageType, - BinaryImageType - > FuzzySegmentationFilterType; + InputImageType, + BinaryImageType + > FuzzySegmentationFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -158,9 +158,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::VoronoiSegmentationImageFilter< - InputImageType, - OutputImageType, - BinaryImageType> + InputImageType, + OutputImageType, + BinaryImageType> VoronoiSegmentationFilterType; VoronoiSegmentationFilterType::Pointer voronoisegmenter = diff --git a/Examples/Projections/EstimateRPCSensorModelExample.cxx b/Examples/Projections/EstimateRPCSensorModelExample.cxx index b015e1bb9a..22a327f5be 100644 --- a/Examples/Projections/EstimateRPCSensorModelExample.cxx +++ b/Examples/Projections/EstimateRPCSensorModelExample.cxx @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::GCPsToRPCSensorModelImageFilter<ImageType> - GCPsToSensorModelFilterType; + GCPsToSensorModelFilterType; typedef GCPsToSensorModelFilterType::Point2DType Point2DType; typedef GCPsToSensorModelFilterType::Point3DType Point3DType; diff --git a/Examples/Projections/OrthoRectificationExample.cxx b/Examples/Projections/OrthoRectificationExample.cxx index 9b444f5dfb..7af8ee6409 100644 --- a/Examples/Projections/OrthoRectificationExample.cxx +++ b/Examples/Projections/OrthoRectificationExample.cxx @@ -93,7 +93,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::UtmInverseProjection utmMapProjectionType; typedef otb::OrthoRectificationFilter<ImageType, ImageType, - utmMapProjectionType> + utmMapProjectionType> OrthoRectifFilterType; OrthoRectifFilterType::Pointer orthoRectifFilter = @@ -125,8 +125,8 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::PerBandVectorImageFilter<VectorImageType, - VectorImageType, - OrthoRectifFilterType> + VectorImageType, + OrthoRectifFilterType> PerBandFilterType; PerBandFilterType::Pointer perBandFilter = PerBandFilterType::New(); perBandFilter->SetFilter(orthoRectifFilter); diff --git a/Examples/Projections/VectorDataProjectionExample.cxx b/Examples/Projections/VectorDataProjectionExample.cxx index 7e45dff528..168b32cc6c 100644 --- a/Examples/Projections/VectorDataProjectionExample.cxx +++ b/Examples/Projections/VectorDataProjectionExample.cxx @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::VectorDataProjectionFilter<InputVectorDataType, - OutputVectorDataType> + OutputVectorDataType> VectorDataFilterType; VectorDataFilterType::Pointer vectorDataProjection = VectorDataFilterType::New(); diff --git a/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx index 7c5f018592..d71e7f9a99 100644 --- a/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx @@ -142,9 +142,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::Functor::ARVI<InputPixelType, - InputPixelType, - InputPixelType, - OutputPixelType> FunctorType; + InputPixelType, + InputPixelType, + OutputPixelType> FunctorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::MultiChannelRAndBAndNIRIndexImageFilter <InputImageType, - OutputImageType, - FunctorType> + OutputImageType, + FunctorType> MultiChannelRAndBAndNIRIndexImageFilterType; MultiChannelRAndBAndNIRIndexImageFilterType::Pointer @@ -246,23 +246,23 @@ int main(int argc, char *argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - Dimension> + Dimension> OutputPrettyImageType; typedef otb::VectorImage<unsigned char, - Dimension> + Dimension> OutputVectorPrettyImageType; typedef otb::ImageFileWriter<OutputVectorPrettyImageType> WriterVectorPrettyType; typedef otb::ImageFileWriter<OutputPrettyImageType> WriterPrettyType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - OutputPrettyImageType> + OutputPrettyImageType> RescalerType; typedef otb::VectorRescaleIntensityImageFilter<InputImageType, - OutputVectorPrettyImageType> + OutputVectorPrettyImageType> VectorRescalerType; typedef otb::MultiChannelExtractROI<unsigned char, - unsigned char> + unsigned char> ChannelExtractorType; VectorRescalerType::Pointer vectRescaler = diff --git a/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx index b28a09cdeb..7433c4d9bb 100644 --- a/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::Functor::AVI<InputPixelType, InputPixelType, - InputPixelType, OutputPixelType> FunctorType; + InputPixelType, OutputPixelType> FunctorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -227,23 +227,23 @@ int main(int argc, char *argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - Dimension> + Dimension> OutputPrettyImageType; typedef otb::VectorImage<unsigned char, - Dimension> + Dimension> OutputVectorPrettyImageType; typedef otb::ImageFileWriter<OutputVectorPrettyImageType> WriterVectorPrettyType; typedef otb::ImageFileWriter<OutputPrettyImageType> WriterPrettyType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - OutputPrettyImageType> + OutputPrettyImageType> RescalerType; typedef otb::VectorRescaleIntensityImageFilter<InputImageType, - OutputVectorPrettyImageType> + OutputVectorPrettyImageType> VectorRescalerType; typedef otb::MultiChannelExtractROI<unsigned char, - unsigned char> + unsigned char> ChannelExtractorType; VectorRescalerType::Pointer vectRescaler = diff --git a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx index 6d670797ac..48a665506f 100644 --- a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx +++ b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx @@ -452,7 +452,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::ReflectanceToSurfaceReflectanceImageFilter<ImageType, - ImageType> + ImageType> ReflectanceToSurfaceReflectanceImageFilterType; ReflectanceToSurfaceReflectanceImageFilterType::Pointer @@ -535,7 +535,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::SurfaceAdjacencyEffect6SCorrectionSchemeFilter<ImageType, - ImageType> + ImageType> SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::Pointer filterSurfaceAdjacencyEffect6SCorrectionSchemeFilter @@ -559,7 +559,7 @@ int main(int argc, char *argv[]) filterSurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetZenithalViewingAngle( dataAtmosphericCorrectionParameters->GetViewingZenithalAngle()); filterSurfaceAdjacencyEffect6SCorrectionSchemeFilter->SetWindowRadius(atoi(argv - [17])); + [17])); filterSurfaceAdjacencyEffect6SCorrectionSchemeFilter-> SetPixelSpacingInKilometers(static_cast<double>(atof(argv[18]))); diff --git a/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx b/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx index f7e80e9035..f2440590f5 100644 --- a/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx +++ b/Examples/Radiometry/NDVIRAndNIRVegetationIndexImageFilter.cxx @@ -120,8 +120,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::Functor::NDVI<InputPixelType, - InputPixelType, - OutputPixelType> FunctorType; + InputPixelType, + OutputPixelType> FunctorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -133,9 +133,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef otb::RAndNIRIndexImageFilter<InputRImageType, - InputNIRImageType, - OutputImageType, - FunctorType> + InputNIRImageType, + OutputImageType, + FunctorType> RAndNIRIndexImageFilterType; // Software Guide : EndCodeSnippet @@ -200,17 +200,17 @@ int main(int argc, char *argv[]) // Pretty image creation for the printing typedef otb::Image<unsigned char, - Dimension> - OutputPrettyImageType; + Dimension> + OutputPrettyImageType; typedef otb::ImageFileWriter<OutputPrettyImageType> - WriterPrettyType; + WriterPrettyType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - OutputPrettyImageType> RescalerType; + OutputPrettyImageType> RescalerType; typedef itk::RescaleIntensityImageFilter<InputRImageType, - OutputPrettyImageType> RescalerRType; + OutputPrettyImageType> RescalerRType; typedef itk::RescaleIntensityImageFilter<InputNIRImageType, - OutputPrettyImageType> - RescalerNIRType; + OutputPrettyImageType> + RescalerNIRType; RescalerType::Pointer rescaler = RescalerType::New(); WriterPrettyType::Pointer prettyWriter = WriterPrettyType::New(); diff --git a/Examples/Registration/ImageRegistration1.cxx b/Examples/Registration/ImageRegistration1.cxx index 24d0f8a0c6..44a6092d1c 100644 --- a/Examples/Registration/ImageRegistration1.cxx +++ b/Examples/Registration/ImageRegistration1.cxx @@ -170,8 +170,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::MeanSquaresImageToImageMetric< - FixedImageType, - MovingImageType> MetricType; + FixedImageType, + MovingImageType> MetricType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -183,8 +183,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::LinearInterpolateImageFunction< - MovingImageType, - double> InterpolatorType; + MovingImageType, + double> InterpolatorType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -197,8 +197,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ImageRegistrationMethod< - FixedImageType, - MovingImageType> RegistrationType; + FixedImageType, + MovingImageType> RegistrationType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -255,10 +255,10 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::MeanImageFilter< - FixedImageType, FixedImageType> FixedFilterType; + FixedImageType, FixedImageType> FixedFilterType; typedef itk::MeanImageFilter< - MovingImageType, MovingImageType> MovingFilterType; + MovingImageType, MovingImageType> MovingFilterType; FixedFilterType::Pointer fixedFilter = FixedFilterType::New(); MovingFilterType::Pointer movingFilter = MovingFilterType::New(); @@ -542,8 +542,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ResampleImageFilter< - MovingImageType, - FixedImageType> ResampleFilterType; + MovingImageType, + FixedImageType> ResampleFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -626,8 +626,8 @@ int main(int argc, char *argv[]) typedef unsigned char OutputPixelType; typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::CastImageFilter<FixedImageType, - OutputImageType> CastFilterType; - typedef otb::ImageFileWriter<OutputImageType> WriterType; + OutputImageType> CastFilterType; + typedef otb::ImageFileWriter<OutputImageType> WriterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -680,9 +680,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::SubtractImageFilter< - FixedImageType, - FixedImageType, - FixedImageType> DifferenceFilterType; + FixedImageType, + FixedImageType, + FixedImageType> DifferenceFilterType; DifferenceFilterType::Pointer difference = DifferenceFilterType::New(); @@ -715,8 +715,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::RescaleIntensityImageFilter< - FixedImageType, - OutputImageType> RescalerType; + FixedImageType, + OutputImageType> RescalerType; RescalerType::Pointer intensityRescaler = RescalerType::New(); diff --git a/Examples/Registration/ImageRegistration2.cxx b/Examples/Registration/ImageRegistration2.cxx index 3063f95309..a052e7a6cb 100644 --- a/Examples/Registration/ImageRegistration2.cxx +++ b/Examples/Registration/ImageRegistration2.cxx @@ -172,10 +172,10 @@ int main(int argc, char *argv[]) typedef itk::GradientDescentOptimizer OptimizerType; typedef itk::LinearInterpolateImageFunction<InternalImageType, - double> InterpolatorType; + double> InterpolatorType; typedef itk::ImageRegistrationMethod<InternalImageType, - InternalImageType> RegistrationType; + InternalImageType> RegistrationType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -187,8 +187,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::MutualInformationImageToImageMetric< - InternalImageType, - InternalImageType> MetricType; + InternalImageType, + InternalImageType> MetricType; // Software Guide : EndCodeSnippet TransformType::Pointer transform = TransformType::New(); @@ -253,14 +253,14 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::NormalizeImageFilter< - FixedImageType, - InternalImageType - > FixedNormalizeFilterType; + FixedImageType, + InternalImageType + > FixedNormalizeFilterType; typedef itk::NormalizeImageFilter< - MovingImageType, - InternalImageType - > MovingNormalizeFilterType; + MovingImageType, + InternalImageType + > MovingNormalizeFilterType; FixedNormalizeFilterType::Pointer fixedNormalizer = FixedNormalizeFilterType::New(); @@ -279,9 +279,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::DiscreteGaussianImageFilter< - InternalImageType, - InternalImageType - > GaussianFilterType; + InternalImageType, + InternalImageType + > GaussianFilterType; GaussianFilterType::Pointer fixedSmoother = GaussianFilterType::New(); GaussianFilterType::Pointer movingSmoother = GaussianFilterType::New(); @@ -465,8 +465,8 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex typedef itk::ResampleImageFilter< - MovingImageType, - FixedImageType> ResampleFilterType; + MovingImageType, + FixedImageType> ResampleFilterType; TransformType::Pointer finalTransform = TransformType::New(); @@ -489,8 +489,8 @@ int main(int argc, char *argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::CastImageFilter< - FixedImageType, - OutputImageType> CastFilterType; + FixedImageType, + OutputImageType> CastFilterType; typedef otb::ImageFileWriter<OutputImageType> WriterType; diff --git a/Examples/Registration/ImageRegistration5.cxx b/Examples/Registration/ImageRegistration5.cxx index a6ac50c8ce..09a4d769a0 100644 --- a/Examples/Registration/ImageRegistration5.cxx +++ b/Examples/Registration/ImageRegistration5.cxx @@ -149,13 +149,13 @@ int main(int argc, char *argv[]) typedef itk::RegularStepGradientDescentOptimizer OptimizerType; typedef itk::MeanSquaresImageToImageMetric<FixedImageType, - MovingImageType> MetricType; + MovingImageType> MetricType; typedef itk::LinearInterpolateImageFunction<MovingImageType, - double> InterpolatorType; + double> InterpolatorType; typedef itk::ImageRegistrationMethod<FixedImageType, - MovingImageType> RegistrationType; + MovingImageType> RegistrationType; MetricType::Pointer metric = MetricType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); @@ -202,10 +202,10 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::MeanImageFilter< - FixedImageType, FixedImageType> FixedFilterType; + FixedImageType, FixedImageType> FixedFilterType; typedef itk::MeanImageFilter< - MovingImageType, MovingImageType> MovingFilterType; + MovingImageType, MovingImageType> MovingFilterType; FixedFilterType::Pointer fixedFilter = FixedFilterType::New(); MovingFilterType::Pointer movingFilter = MovingFilterType::New(); @@ -513,8 +513,8 @@ int main(int argc, char *argv[]) // Software Guide : EndLatex typedef itk::ResampleImageFilter< - MovingImageType, - FixedImageType> ResampleFilterType; + MovingImageType, + FixedImageType> ResampleFilterType; TransformType::Pointer finalTransform = TransformType::New(); @@ -553,9 +553,9 @@ int main(int argc, char *argv[]) typedef itk::Image<float, Dimension> DifferenceImageType; typedef itk::SubtractImageFilter< - FixedImageType, - FixedImageType, - DifferenceImageType> DifferenceFilterType; + FixedImageType, + FixedImageType, + DifferenceImageType> DifferenceFilterType; DifferenceFilterType::Pointer difference = DifferenceFilterType::New(); @@ -564,8 +564,8 @@ int main(int argc, char *argv[]) typedef itk::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::RescaleIntensityImageFilter< - DifferenceImageType, - OutputImageType> RescalerType; + DifferenceImageType, + OutputImageType> RescalerType; RescalerType::Pointer intensityRescaler = RescalerType::New(); diff --git a/Examples/Registration/ImageRegistration9.cxx b/Examples/Registration/ImageRegistration9.cxx index fadc73c4a2..486c1cc1ce 100644 --- a/Examples/Registration/ImageRegistration9.cxx +++ b/Examples/Registration/ImageRegistration9.cxx @@ -160,20 +160,20 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::AffineTransform< - double, - Dimension> TransformType; + double, + Dimension> TransformType; // Software Guide : EndCodeSnippet typedef itk::RegularStepGradientDescentOptimizer OptimizerType; typedef itk::MeanSquaresImageToImageMetric< - FixedImageType, - MovingImageType> MetricType; + FixedImageType, + MovingImageType> MetricType; typedef itk::LinearInterpolateImageFunction< - MovingImageType, - double> InterpolatorType; + MovingImageType, + double> InterpolatorType; typedef itk::ImageRegistrationMethod< - FixedImageType, - MovingImageType> RegistrationType; + FixedImageType, + MovingImageType> RegistrationType; MetricType::Pointer metric = MetricType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); @@ -218,10 +218,10 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::MeanImageFilter< - FixedImageType, FixedImageType> FixedFilterType; + FixedImageType, FixedImageType> FixedFilterType; typedef itk::MeanImageFilter< - MovingImageType, MovingImageType> MovingFilterType; + MovingImageType, MovingImageType> MovingFilterType; FixedFilterType::Pointer fixedFilter = FixedFilterType::New(); MovingFilterType::Pointer movingFilter = MovingFilterType::New(); @@ -272,9 +272,9 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::CenteredTransformInitializer< - TransformType, - FixedImageType, - MovingImageType> TransformInitializerType; + TransformType, + FixedImageType, + MovingImageType> TransformInitializerType; TransformInitializerType::Pointer initializer = TransformInitializerType::New(); initializer->SetTransform(transform); initializer->SetFixedImage(fixedImageReader->GetOutput()); @@ -526,8 +526,8 @@ int main(int argc, char *argv[]) // before and after registration. We will also rescale the intensities of the // difference images, so that they look better! typedef itk::ResampleImageFilter< - MovingImageType, - FixedImageType> ResampleFilterType; + MovingImageType, + FixedImageType> ResampleFilterType; TransformType::Pointer finalTransform = TransformType::New(); @@ -551,8 +551,8 @@ int main(int argc, char *argv[]) typedef itk::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::CastImageFilter< - FixedImageType, - OutputImageType> CastFilterType; + FixedImageType, + OutputImageType> CastFilterType; typedef otb::ImageFileWriter<OutputImageType> WriterType; @@ -566,9 +566,9 @@ int main(int argc, char *argv[]) writer->Update(); typedef itk::SubtractImageFilter< - FixedImageType, - FixedImageType, - FixedImageType> DifferenceFilterType; + FixedImageType, + FixedImageType, + FixedImageType> DifferenceFilterType; DifferenceFilterType::Pointer difference = DifferenceFilterType::New(); @@ -578,8 +578,8 @@ int main(int argc, char *argv[]) WriterType::Pointer writer2 = WriterType::New(); typedef itk::RescaleIntensityImageFilter< - FixedImageType, - OutputImageType> RescalerType; + FixedImageType, + OutputImageType> RescalerType; RescalerType::Pointer intensityRescaler = RescalerType::New(); diff --git a/Examples/SARPolarimetry/PiOver4ExamplePolarimetricSynthesisFilter.cxx b/Examples/SARPolarimetry/PiOver4ExamplePolarimetricSynthesisFilter.cxx index 765fc7a3f4..66185e393d 100644 --- a/Examples/SARPolarimetry/PiOver4ExamplePolarimetricSynthesisFilter.cxx +++ b/Examples/SARPolarimetry/PiOver4ExamplePolarimetricSynthesisFilter.cxx @@ -77,8 +77,8 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, - InputImageType, InputImageType, - OutputImageType> FilterType; + InputImageType, InputImageType, + OutputImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Segmentation/ConfidenceConnected.cxx b/Examples/Segmentation/ConfidenceConnected.cxx index 89ff474c99..f8f4ffb8a0 100644 --- a/Examples/Segmentation/ConfidenceConnected.cxx +++ b/Examples/Segmentation/ConfidenceConnected.cxx @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ConfidenceConnectedImageFilter<InternalImageType, - InternalImageType> + InternalImageType> ConnectedFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Segmentation/ConnectedThresholdImageFilter.cxx b/Examples/Segmentation/ConnectedThresholdImageFilter.cxx index 58fb20572b..eea4f7c8f3 100644 --- a/Examples/Segmentation/ConnectedThresholdImageFilter.cxx +++ b/Examples/Segmentation/ConnectedThresholdImageFilter.cxx @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::ConnectedThresholdImageFilter<InternalImageType, - InternalImageType> + InternalImageType> ConnectedFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Segmentation/FastMarchingImageFilter.cxx b/Examples/Segmentation/FastMarchingImageFilter.cxx index b3d80847f5..32b9960f3d 100644 --- a/Examples/Segmentation/FastMarchingImageFilter.cxx +++ b/Examples/Segmentation/FastMarchingImageFilter.cxx @@ -216,7 +216,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::BinaryThresholdImageFilter<InternalImageType, - OutputImageType> + OutputImageType> ThresholdingFilterType; ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New(); // Software Guide : EndCodeSnippet @@ -259,8 +259,8 @@ int main(int argc, char *argv[]) // renormalize image before sending them to writers. // typedef itk::RescaleIntensityImageFilter< - InternalImageType, - OutputImageType> CastFilterType; + InternalImageType, + OutputImageType> CastFilterType; // Software Guide : BeginLatex // @@ -271,8 +271,8 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::CurvatureAnisotropicDiffusionImageFilter< - InternalImageType, - InternalImageType> SmoothingFilterType; + InternalImageType, + InternalImageType> SmoothingFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -297,12 +297,12 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< - InternalImageType, - InternalImageType> GradientFilterType; + InternalImageType, + InternalImageType> GradientFilterType; typedef itk::SigmoidImageFilter< - InternalImageType, - InternalImageType> SigmoidFilterType; + InternalImageType, + InternalImageType> SigmoidFilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex @@ -342,7 +342,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::FastMarchingImageFilter<InternalImageType, - InternalImageType> + InternalImageType> FastMarchingFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Segmentation/IsolatedConnectedImageFilter.cxx b/Examples/Segmentation/IsolatedConnectedImageFilter.cxx index 39564ba2e0..b9a2800196 100644 --- a/Examples/Segmentation/IsolatedConnectedImageFilter.cxx +++ b/Examples/Segmentation/IsolatedConnectedImageFilter.cxx @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::IsolatedConnectedImageFilter<InternalImageType, - InternalImageType> + InternalImageType> ConnectedFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Segmentation/LabelizeNeighborhoodConnectedImageFilter.cxx b/Examples/Segmentation/LabelizeNeighborhoodConnectedImageFilter.cxx index d752a91dbd..0eb93fcf45 100644 --- a/Examples/Segmentation/LabelizeNeighborhoodConnectedImageFilter.cxx +++ b/Examples/Segmentation/LabelizeNeighborhoodConnectedImageFilter.cxx @@ -87,7 +87,7 @@ int main(int argc, char * argv[]) // Labelize filter typedef otb::LabelizeNeighborhoodConnectedImageFilter<InputImageType, - OutputImageType> + OutputImageType> LabelizeFilterType; LabelizeFilterType::Pointer filter = LabelizeFilterType::New(); @@ -98,9 +98,9 @@ int main(int argc, char * argv[]) // Label to RGB image typedef itk::Functor::ScalarToRGBPixelFunctor<OutputPixelType> - FunctorType; + FunctorType; typedef itk::UnaryFunctorImageFilter<OutputImageType, RGBImageType, - FunctorType> ColorLabelFilterType; + FunctorType> ColorLabelFilterType; ColorLabelFilterType::Pointer labelToRGB = ColorLabelFilterType::New(); filter->SetInput(reader->GetOutput()); diff --git a/Examples/Segmentation/NeighborhoodConnectedImageFilter.cxx b/Examples/Segmentation/NeighborhoodConnectedImageFilter.cxx index 5b162a109a..b69bb090ef 100644 --- a/Examples/Segmentation/NeighborhoodConnectedImageFilter.cxx +++ b/Examples/Segmentation/NeighborhoodConnectedImageFilter.cxx @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) // Software Guide : BeginCodeSnippet typedef itk::NeighborhoodConnectedImageFilter<InternalImageType, - InternalImageType> + InternalImageType> ConnectedFilterType; // Software Guide : EndCodeSnippet diff --git a/Examples/Segmentation/OtsuMultipleThresholdImageFilter.cxx b/Examples/Segmentation/OtsuMultipleThresholdImageFilter.cxx index 4c4639f223..a27fd2575f 100644 --- a/Examples/Segmentation/OtsuMultipleThresholdImageFilter.cxx +++ b/Examples/Segmentation/OtsuMultipleThresholdImageFilter.cxx @@ -75,7 +75,7 @@ int main(int argc, char * argv[]) typedef itk::Statistics::ScalarImageToHistogramGenerator<InputImageType> ScalarImageToHistogramGeneratorType; typedef itk::OtsuMultipleThresholdsCalculator< - ScalarImageToHistogramGeneratorType::HistogramType> CalculatorType; + ScalarImageToHistogramGeneratorType::HistogramType> CalculatorType; // Software Guide : EndCodeSnippet typedef otb::ImageFileReader<InputImageType> ReaderType; diff --git a/Examples/Segmentation/OtsuThresholdImageFilter.cxx b/Examples/Segmentation/OtsuThresholdImageFilter.cxx index 5793715fbb..aadba4f7f7 100644 --- a/Examples/Segmentation/OtsuThresholdImageFilter.cxx +++ b/Examples/Segmentation/OtsuThresholdImageFilter.cxx @@ -89,7 +89,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet typedef itk::OtsuThresholdImageFilter< - InputImageType, OutputImageType> FilterType; + InputImageType, OutputImageType> FilterType; // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/Segmentation/WatershedSegmentation.cxx b/Examples/Segmentation/WatershedSegmentation.cxx index 8c084fa841..2aa9dc3827 100644 --- a/Examples/Segmentation/WatershedSegmentation.cxx +++ b/Examples/Segmentation/WatershedSegmentation.cxx @@ -122,10 +122,10 @@ int main(int argc, char *argv[]) typedef itk::VectorCastImageFilter<RGBImageType, VectorImageType> CastFilterType; typedef itk::VectorGradientAnisotropicDiffusionImageFilter<VectorImageType, - VectorImageType> + VectorImageType> DiffusionFilterType; typedef itk::VectorGradientMagnitudeImageFilter<VectorImageType, float, - ScalarImageType> + ScalarImageType> GradientMagnitudeFilterType; typedef itk::WatershedImageFilter<ScalarImageType> WatershedFilterType; // Software Guide : EndCodeSnippet @@ -207,8 +207,8 @@ int main(int argc, char *argv[]) typedef itk::Functor::ScalarToRGBPixelFunctor<unsigned long> ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<LabeledImageType, - RGBImageType, - ColorMapFunctorType> ColorMapFilterType; + RGBImageType, + ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); // Software Guide : EndCodeSnippet diff --git a/Examples/Tutorials/BasicApplication/Controller/otbBasicApplicationController.h b/Examples/Tutorials/BasicApplication/Controller/otbBasicApplicationController.h index 8fd7e2bd80..e4d656ef22 100644 --- a/Examples/Tutorials/BasicApplication/Controller/otbBasicApplicationController.h +++ b/Examples/Tutorials/BasicApplication/Controller/otbBasicApplicationController.h @@ -51,10 +51,10 @@ public: typedef ImageWidgetController WidgetsControllerType; typedef WidgetResizingActionHandler <VisualizationModelType, - ImageViewType> ResizingHandlerType; + ImageViewType> ResizingHandlerType; typedef ChangeExtractRegionActionHandler <VisualizationModelType, - ImageViewType> ChangeRegionHandlerType; + ImageViewType> ChangeRegionHandlerType; /** Set the pointer to the view */ void SetView(BasicApplicationView * view); diff --git a/Examples/Tutorials/BasicApplication/Model/otbBasicApplicationModel.h b/Examples/Tutorials/BasicApplication/Model/otbBasicApplicationModel.h index 1575ec7eaa..3ece929f74 100644 --- a/Examples/Tutorials/BasicApplication/Model/otbBasicApplicationModel.h +++ b/Examples/Tutorials/BasicApplication/Model/otbBasicApplicationModel.h @@ -59,18 +59,18 @@ public: typedef itk::RGBPixel<unsigned char> RGBPixelType; typedef Image<RGBPixelType, - 2> + 2> RGBImageType; typedef ImageLayer<VectorImageType, - RGBImageType> + RGBImageType> LayerType; typedef ImageLayerGenerator<LayerType> LayerGeneratorType; typedef ImageLayerRenderingModel<RGBImageType> VisualizationModelType; typedef Function::UniformAlphaBlendingFunction<LayerGeneratorType:: - ImageLayerType:: - OutputPixelType> + ImageLayerType:: + OutputPixelType> BlendingFunctionType; /** Get the unique instanc1e of the model */ diff --git a/Examples/Tutorials/BasicApplication/otbBasicApplication.cxx b/Examples/Tutorials/BasicApplication/otbBasicApplication.cxx index 50c0a655da..fdc5f341dd 100644 --- a/Examples/Tutorials/BasicApplication/otbBasicApplication.cxx +++ b/Examples/Tutorials/BasicApplication/otbBasicApplication.cxx @@ -72,7 +72,8 @@ int main(int argc, char* argv[]) view->SetWidgetsController(controller->GetWidgetsController()); view->Build(); - if (parseResult->IsOptionPresent("--InputImage")) view->GetController()-> + if (parseResult->IsOptionPresent("--InputImage")) + view->GetController()-> OpenImage(parseResult->GetInputImage().c_str()); Fl::run(); diff --git a/Examples/Tutorials/OrthoFusion.cxx b/Examples/Tutorials/OrthoFusion.cxx index 83891f128c..b9d1e159b7 100644 --- a/Examples/Tutorials/OrthoFusion.cxx +++ b/Examples/Tutorials/OrthoFusion.cxx @@ -157,8 +157,8 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::OrthoRectificationFilter<ImageType, DoubleImageType, - utmMapProjectionType> - OrthoRectifFilterType; + utmMapProjectionType> + OrthoRectifFilterType; OrthoRectifFilterType::Pointer orthoRectifPAN = OrthoRectifFilterType::New(); @@ -185,9 +185,9 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet typedef otb::PerBandVectorImageFilter<VectorImageType, - DoubleVectorImageType, - OrthoRectifFilterType> - VectorOrthoRectifFilterType; + DoubleVectorImageType, + OrthoRectifFilterType> + VectorOrthoRectifFilterType; OrthoRectifFilterType::Pointer orthoRectifXS = OrthoRectifFilterType::New(); diff --git a/Examples/Tutorials/SmarterFilteringPipeline.cxx b/Examples/Tutorials/SmarterFilteringPipeline.cxx index 4dd4d34cd8..0e369f3abf 100644 --- a/Examples/Tutorials/SmarterFilteringPipeline.cxx +++ b/Examples/Tutorials/SmarterFilteringPipeline.cxx @@ -239,13 +239,16 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - if (parseResult->IsOptionPresent("--SigmaD")) filter->SetSigmaD( + if (parseResult->IsOptionPresent("--SigmaD")) + filter->SetSigmaD( parseResult->GetParameterDouble("--SigmaD")); - if (parseResult->IsOptionPresent("--SigmaI")) filter->SetSigmaI( + if (parseResult->IsOptionPresent("--SigmaI")) + filter->SetSigmaI( parseResult->GetParameterDouble("--SigmaI")); - if (parseResult->IsOptionPresent("--Alpha")) filter->SetAlpha( + if (parseResult->IsOptionPresent("--Alpha")) + filter->SetAlpha( parseResult->GetParameterDouble("--Alpha")); // Software Guide : EndCodeSnippet diff --git a/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilter.cxx b/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilter.cxx index d780699287..095b0e4045 100644 --- a/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilter.cxx +++ b/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilter.cxx @@ -42,7 +42,7 @@ int otbClosingOpeningMorphologicalFilter(int argc, char * argv[]) typedef itk::BinaryBallStructuringElement<InputPixelType, Dimension> StructuringElementType; typedef otb::ClosingOpeningMorphologicalFilter<InputImageType, OutputImageType, - StructuringElementType> ClosingOpeningFilterType; + StructuringElementType> ClosingOpeningFilterType; // Reading input image ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilterNew.cxx b/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilterNew.cxx index b869fe75ff..9e79de3f1a 100644 --- a/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbClosingOpeningMorphologicalFilterNew.cxx @@ -30,7 +30,7 @@ int otbClosingOpeningMorphologicalFilterNew(int argc, char * argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::BinaryBallStructuringElement<InputPixelType, Dimension> StructuringElementType; typedef otb::ClosingOpeningMorphologicalFilter<InputImageType, OutputImageType, - StructuringElementType> ClosingOpeningFilterType; + StructuringElementType> ClosingOpeningFilterType; // instantiating the opening closing filter ClosingOpeningFilterType::Pointer openingClosing = ClosingOpeningFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilter.cxx b/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilter.cxx index 4699f3b1aa..beebc71c12 100644 --- a/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilter.cxx @@ -37,7 +37,7 @@ int otbMatrixTransposeMatrixImageFilter(int argc, char * argv[]) typedef otb::VectorImage<InputPixelType, Dimension> InputImage1Type; typedef otb::VectorImage<InputPixelType, Dimension> InputImage2Type; typedef otb::StreamingMatrixTransposeMatrixImageFilter<InputImage1Type, - InputImage2Type> MatrixTransposeMatrixImageFilterType; + InputImage2Type> MatrixTransposeMatrixImageFilterType; typedef otb::ImageFileReader<InputImage1Type> ReaderType1; typedef otb::ImageFileReader<InputImage2Type> ReaderType2; diff --git a/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilterNew.cxx b/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilterNew.cxx index 6d4f39bc67..427630b577 100644 --- a/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbMatrixTransposeMatrixImageFilterNew.cxx @@ -30,7 +30,7 @@ int otbMatrixTransposeMatrixImageFilterNew(int argc, char * argv[]) typedef otb::VectorImage<InputPixelType, Dimension> InputImage1Type; typedef otb::VectorImage<InputPixelType, Dimension> InputImage2Type; typedef otb::StreamingMatrixTransposeMatrixImageFilter<InputImage1Type, - InputImage2Type> MatrixTransposeMatrixImageFilterType; + InputImage2Type> MatrixTransposeMatrixImageFilterType; // Instantiation MatrixTransposeMatrixImageFilterType::Pointer filter = MatrixTransposeMatrixImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilter.cxx b/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilter.cxx index 1016734d37..41687b98da 100644 --- a/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilter.cxx +++ b/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilter.cxx @@ -42,7 +42,7 @@ int otbOpeningClosingMorphologicalFilter(int argc, char * argv[]) typedef itk::BinaryBallStructuringElement<InputPixelType, Dimension> StructuringElementType; typedef otb::OpeningClosingMorphologicalFilter<InputImageType, OutputImageType, - StructuringElementType> OpeningClosingFilterType; + StructuringElementType> OpeningClosingFilterType; // Reading input image ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilterNew.cxx b/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilterNew.cxx index 8ea7c7f853..d420a410b1 100644 --- a/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbOpeningClosingMorphologicalFilterNew.cxx @@ -30,7 +30,7 @@ int otbOpeningClosingMorphologicalFilterNew(int argc, char * argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef itk::BinaryBallStructuringElement<InputPixelType, Dimension> StructuringElementType; typedef otb::OpeningClosingMorphologicalFilter<InputImageType, OutputImageType, - StructuringElementType> OpeningClosingFilterType; + StructuringElementType> OpeningClosingFilterType; // instantiating the opening closing filter OpeningClosingFilterType::Pointer openingClosing = OpeningClosingFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbPathLengthFunctor.cxx b/Testing/Code/BasicFilters/otbPathLengthFunctor.cxx index e1f95af003..23cbfde76c 100644 --- a/Testing/Code/BasicFilters/otbPathLengthFunctor.cxx +++ b/Testing/Code/BasicFilters/otbPathLengthFunctor.cxx @@ -79,9 +79,9 @@ int otbPathLengthFunctor(int argc, char * argv[]) } typedef otb::PathLengthFunctor<PolygonType::Pointer> - LengthFunctorType; + LengthFunctorType; typedef otb::UnaryFunctorObjectListBooleanFilter<PolygonListType, PolygonListType, - LengthFunctorType> PathLengthFilterType; + LengthFunctorType> PathLengthFilterType; PathLengthFilterType::Pointer pathLengthFilter = PathLengthFilterType::New(); pathLengthFilter->SetInput(polygonList); pathLengthFilter->GetFunctor().SetThreshold(500); diff --git a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionNew.cxx b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionNew.cxx index 4da21b38ad..43404336d3 100644 --- a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionNew.cxx +++ b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionNew.cxx @@ -26,7 +26,7 @@ int otbPointSetDensityEpanechnikovFunctionNew(int, char*[]) { const unsigned int Dimension = 2; - typedef float PixelType; + typedef float PixelType; typedef itk::VariableLengthVector<PixelType> RealVectorType; typedef itk::PointSet<RealVectorType, Dimension> PointSetType; diff --git a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx index aa69b165af..71ed585c19 100644 --- a/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx +++ b/Testing/Code/BasicFilters/otbPointSetDensityEpanechnikovFunctionTest.cxx @@ -30,7 +30,7 @@ int otbPointSetDensityEpanechnikovFunctionTest(int argc, char* argv[]) const char * outfname = argv[1]; const unsigned int Dimension = 2; - typedef float PixelType; + typedef float PixelType; typedef itk::VariableLengthVector<PixelType> RealVectorType; typedef itk::PointSet<RealVectorType, Dimension> PointSetType; diff --git a/Testing/Code/BasicFilters/otbPointSetExtractROITest.cxx b/Testing/Code/BasicFilters/otbPointSetExtractROITest.cxx index b23c760479..3ab5c83fcf 100644 --- a/Testing/Code/BasicFilters/otbPointSetExtractROITest.cxx +++ b/Testing/Code/BasicFilters/otbPointSetExtractROITest.cxx @@ -19,7 +19,6 @@ #pragma warning ( disable : 4786 ) #endif - #include "otbPointSetExtractROI.h" #include "itkPointSet.h" #include "otbRandomPointSetSource.h" @@ -45,7 +44,7 @@ int otbPointSetExtractROITest(int, char*[]) pointSetSource->Update(); std::cout << "Input PointSet has " << pointSetSource->GetOutput()->GetNumberOfPoints(); - std::cout << " points " << std::endl; + std::cout << " points " << std::endl; typedef otb::PointSetExtractROI<PointSetType, PointSetType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/BasicFilters/otbPolygonCompacityFunctor.cxx b/Testing/Code/BasicFilters/otbPolygonCompacityFunctor.cxx index 605cddac60..0007c5d12a 100644 --- a/Testing/Code/BasicFilters/otbPolygonCompacityFunctor.cxx +++ b/Testing/Code/BasicFilters/otbPolygonCompacityFunctor.cxx @@ -79,9 +79,9 @@ int otbPolygonCompacityFunctor(int argc, char * argv[]) } typedef otb::PolygonCompacityFunctor<PolygonType::Pointer> - CompacityFunctorType; + CompacityFunctorType; typedef otb::UnaryFunctorObjectListBooleanFilter<PolygonListType, PolygonListType, - CompacityFunctorType> CompacityFilterType; + CompacityFunctorType> CompacityFilterType; CompacityFilterType::Pointer compacityFilter = CompacityFilterType::New(); compacityFilter->SetInput(polygonList); compacityFilter->Update(); diff --git a/Testing/Code/BasicFilters/otbScalarImageTextureFunctor.cxx b/Testing/Code/BasicFilters/otbScalarImageTextureFunctor.cxx index 2680eef83b..8d087e18bf 100644 --- a/Testing/Code/BasicFilters/otbScalarImageTextureFunctor.cxx +++ b/Testing/Code/BasicFilters/otbScalarImageTextureFunctor.cxx @@ -48,7 +48,7 @@ int otbScalarImageTextureFunctor(int argc, char * argv[]) typedef otb::Functor::ScalarImageTextureFunctor<IterType, InputImageType, InputPixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodImageFilter<InputImageType, InputImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbScalarImageTextureFunctorNew.cxx b/Testing/Code/BasicFilters/otbScalarImageTextureFunctorNew.cxx index 3486e97d91..3cb0877e0b 100644 --- a/Testing/Code/BasicFilters/otbScalarImageTextureFunctorNew.cxx +++ b/Testing/Code/BasicFilters/otbScalarImageTextureFunctorNew.cxx @@ -35,7 +35,7 @@ int otbScalarImageTextureFunctorNew(int argc, char * argv[]) typedef otb::Functor::ScalarImageTextureFunctor<IterType, InputImageType, InputPixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodImageFilter<InputImageType, InputImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctor.cxx b/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctor.cxx index 8e116eae7a..0cb09cd636 100644 --- a/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctor.cxx +++ b/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctor.cxx @@ -48,7 +48,7 @@ int otbScalarToRainbowRGBPixelFunctor(int argc, char * argv[]) typedef otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType> ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<ImageType, - RGBImageType, ColorMapFunctorType> ColorMapFilterType; + RGBImageType, ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->GetFunctor().SetMaximumInputValue(150); colormapper->GetFunctor().SetMinimumInputValue(70); diff --git a/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctorNew.cxx b/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctorNew.cxx index 5b2bb44a7c..aaa2e98b94 100644 --- a/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctorNew.cxx +++ b/Testing/Code/BasicFilters/otbScalarToRainbowRGBPixelFunctorNew.cxx @@ -40,7 +40,7 @@ int otbScalarToRainbowRGBPixelFunctorNew(int argc, char * argv[]) typedef otb::Functor::ScalarToRainbowRGBPixelFunctor<PixelType> ColorMapFunctorType; typedef itk::UnaryFunctorImageFilter<ImageType, - RGBImageType, ColorMapFunctorType> ColorMapFilterType; + RGBImageType, ColorMapFunctorType> ColorMapFilterType; ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New(); colormapper->GetFunctor().SetMaximum(150); colormapper->GetFunctor().SetMinimum(70); diff --git a/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctor.cxx b/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctor.cxx index 6bb5f091b3..354ca1a590 100644 --- a/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctor.cxx +++ b/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctor.cxx @@ -43,11 +43,11 @@ int otbScalarVectorImageTextureFunctor(int argc, char * argv[]) typedef otb::StreamingImageFileWriter<OutputVectorImageType> WriterType; typedef otb::Functor::ScalarVectorImageTextureFunctor<IterType, InputImageType, - OutputVectorImagePixelType> FunctorType; + OutputVectorImagePixelType> FunctorType; typedef FunctorType::IndexSelectFeaturesType ListIndexType; typedef otb::UnaryFunctorNeighborhoodImageFilter<InputImageType, OutputVectorImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctorNew.cxx b/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctorNew.cxx index 29c4ad7a02..fe82a5c9da 100644 --- a/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctorNew.cxx +++ b/Testing/Code/BasicFilters/otbScalarVectorImageTextureFunctorNew.cxx @@ -38,7 +38,7 @@ int otbScalarVectorImageTextureFunctorNew(int argc, char * argv[]) typedef otb::Functor::ScalarVectorImageTextureFunctor<IterType, InputImageType, VectorImagePixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodImageFilter<InputImageType, InputVectorImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbStreamingResampleImageFilter.cxx b/Testing/Code/BasicFilters/otbStreamingResampleImageFilter.cxx index 8766552f5e..f8866259aa 100644 --- a/Testing/Code/BasicFilters/otbStreamingResampleImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbStreamingResampleImageFilter.cxx @@ -39,7 +39,7 @@ int otbStreamingResampleImageFilter(int argc, char * argv[]) typedef otb::StreamingImageFileWriter<OutputImageType> WriterType; typedef itk::TranslationTransform<InputPixelType, Dimension> TransformType; typedef otb::StreamingResampleImageFilter<InputImageType, OutputImageType, - InterpolatorPrecisionType> StreamingResampleImageFilterType; + InterpolatorPrecisionType> StreamingResampleImageFilterType; // Instantiating object ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/BasicFilters/otbStreamingResampleImageFilterCompareWithITK.cxx b/Testing/Code/BasicFilters/otbStreamingResampleImageFilterCompareWithITK.cxx index 12f4027dbe..dfe0a2952c 100644 --- a/Testing/Code/BasicFilters/otbStreamingResampleImageFilterCompareWithITK.cxx +++ b/Testing/Code/BasicFilters/otbStreamingResampleImageFilterCompareWithITK.cxx @@ -50,9 +50,9 @@ int otbStreamingResampleImageFilterCompareWithITK(int argc, char * argv[]) typedef itk::NearestNeighborInterpolateImageFunction<InputImageType, InterpolatorPrecisionType> NNInterpolatorType; typedef itk::ResampleImageFilter<InputImageType, OutputImageType, - InterpolatorPrecisionType> ITKResampleImageFilterType; + InterpolatorPrecisionType> ITKResampleImageFilterType; typedef otb::StreamingResampleImageFilter<InputImageType, OutputImageType, - InterpolatorPrecisionType> OTBResampleImageFilterType; + InterpolatorPrecisionType> OTBResampleImageFilterType; // Instantiating object ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/BasicFilters/otbStreamingResampleImageFilterNew.cxx b/Testing/Code/BasicFilters/otbStreamingResampleImageFilterNew.cxx index 39d9dd740c..6a139bef68 100644 --- a/Testing/Code/BasicFilters/otbStreamingResampleImageFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbStreamingResampleImageFilterNew.cxx @@ -30,7 +30,7 @@ int otbStreamingResampleImageFilterNew(int argc, char * argv[]) typedef double InterpolatorPrecisionType; typedef otb::StreamingResampleImageFilter<InputImageType, OutputImageType, - InterpolatorPrecisionType> StreamingResampleImageFilterType; + InterpolatorPrecisionType> StreamingResampleImageFilterType; // Instantiating object StreamingResampleImageFilterType::Pointer object = StreamingResampleImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbTransformPointSetFilterTest.cxx b/Testing/Code/BasicFilters/otbTransformPointSetFilterTest.cxx index 0cafc2fa1f..dc151299b3 100644 --- a/Testing/Code/BasicFilters/otbTransformPointSetFilterTest.cxx +++ b/Testing/Code/BasicFilters/otbTransformPointSetFilterTest.cxx @@ -85,9 +85,9 @@ int otbTransformPointSetFilterTest(int, char*[]) // Declare the type for the filter typedef otb::TransformPointSetFilter< - PointSetType, - PointSetType, - TransformType> FilterType; + PointSetType, + PointSetType, + TransformType> FilterType; // Create a Filter FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/BasicFilters/otbUnaryFunctorImageFilterNew.cxx b/Testing/Code/BasicFilters/otbUnaryFunctorImageFilterNew.cxx index 21a3825156..502899da46 100644 --- a/Testing/Code/BasicFilters/otbUnaryFunctorImageFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbUnaryFunctorImageFilterNew.cxx @@ -22,15 +22,15 @@ int otbUnaryFunctorImageFilterNew(int argc, char * argv[]) { - const unsigned int Dimension = 2; + const unsigned int Dimension = 2; typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; typedef InputImageType::InternalPixelType InternalPixelType; typedef otb::Function::PhaseFunctor<InternalPixelType> FunctorType; typedef otb::UnaryFunctorImageFilter<InputImageType, - InputImageType, - FunctorType> FilterType; + InputImageType, + FunctorType> FilterType; FilterType::Pointer filter = FilterType::New(); return EXIT_SUCCESS; diff --git a/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.cxx b/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.cxx index f5dba13082..4bf3a8688b 100644 --- a/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.cxx @@ -38,8 +38,8 @@ int otbUnaryImageFunctorWithVectorImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::UnaryImageFunctorWithVectorImageFilter<InputImageType, - InputImageType, - FunctorType> UnaryImageFunctorWithVectorImageFilterType; + InputImageType, + FunctorType> UnaryImageFunctorWithVectorImageFilterType; // Instantiating object UnaryImageFunctorWithVectorImageFilterType::Pointer filter = UnaryImageFunctorWithVectorImageFilterType::New(); diff --git a/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilterNew.cxx b/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilterNew.cxx index 58aa252644..3525cccd23 100644 --- a/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilterNew.cxx +++ b/Testing/Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilterNew.cxx @@ -30,8 +30,8 @@ int otbUnaryImageFunctorWithVectorImageFilterNew(int argc, char * argv[]) typedef InputImageType::InternalPixelType InternalPixelType; typedef itk::Functor::Cos<InternalPixelType, InternalPixelType> FunctorType; typedef otb::UnaryImageFunctorWithVectorImageFilter<InputImageType, - InputImageType, - FunctorType> UnaryImageFunctorWithVectorImageFilterType; + InputImageType, + FunctorType> UnaryImageFunctorWithVectorImageFilterType; // Instantiating object UnaryImageFunctorWithVectorImageFilterType::Pointer filter = UnaryImageFunctorWithVectorImageFilterType::New(); diff --git a/Testing/Code/ChangeDetection/otbCBAMIChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbCBAMIChangeDetectionTest.cxx index 89141a8765..9ac26b832d 100644 --- a/Testing/Code/ChangeDetection/otbCBAMIChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbCBAMIChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbCBAMIChangeDetectionTest(int argc, char* argv[]) typedef itk::ImageFileReader<InputImageType2> ReaderType2; typedef itk::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::CBAMIChangeDetector< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/ChangeDetection/otbCorrelChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbCorrelChangeDetectionTest.cxx index 15cd145979..5825b8deca 100644 --- a/Testing/Code/ChangeDetection/otbCorrelChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbCorrelChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbCorrelChangeDetectionTest(int argc, char* argv[]) typedef itk::ImageFileReader<InputImageType2> ReaderType2; typedef itk::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::CorrelationChangeDetector< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/ChangeDetection/otbJHMIChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbJHMIChangeDetectionTest.cxx index e35b9eb3dd..19571e4aa1 100644 --- a/Testing/Code/ChangeDetection/otbJHMIChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbJHMIChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbJHMIChangeDetectionTest(int argc, char* argv[]) typedef itk::ImageFileReader<InputImageType2> ReaderType2; typedef itk::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::JoinHistogramMIImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.cxx b/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.cxx index 340d0def5c..e01bdee6bb 100644 --- a/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.cxx +++ b/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilter.cxx @@ -66,7 +66,7 @@ int otbKullbackLeiblerSupervizedDistanceImageFilter(int argc, char * argv[]) imgRoi = readerRoi->GetOutput(); typedef otb::KullbackLeiblerSupervizedDistanceImageFilter< - ImageType, ImageType, TrainingImageType, ImageType> FilterType; + ImageType, ImageType, TrainingImageType, ImageType> FilterType; FilterType::Pointer changeDetector = FilterType::New(); changeDetector->SetRadius((winSize - 1) / 2); diff --git a/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilterNew.cxx b/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilterNew.cxx index b964086939..4fb58b1df7 100644 --- a/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilterNew.cxx +++ b/Testing/Code/ChangeDetection/otbKullbackLeiblerSupervizedDistanceImageFilterNew.cxx @@ -26,11 +26,11 @@ int otbKullbackLeiblerSupervizedDistanceImageFilterNew(int argc, char * argv[]) typedef unsigned char TrainingPixelType; typedef otb::Image<PixelType, - Dimension> ImageType; + Dimension> ImageType; typedef otb::Image<TrainingPixelType, - Dimension> TrainingImageType; + Dimension> TrainingImageType; typedef otb::KullbackLeiblerSupervizedDistanceImageFilter<ImageType, ImageType, TrainingImageType, - ImageType> FilterType; + ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/ChangeDetection/otbLHMIChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbLHMIChangeDetectionTest.cxx index 953d13b822..c7c25dfb10 100644 --- a/Testing/Code/ChangeDetection/otbLHMIChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbLHMIChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbLHMIChangeDetectionTest(int argc, char* argv[]) typedef itk::ImageFileReader<InputImageType2> ReaderType2; typedef itk::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::LHMIChangeDetector< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/ChangeDetection/otbMeanDiffChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbMeanDiffChangeDetectionTest.cxx index 6bd707ab3c..7b166b0ee6 100644 --- a/Testing/Code/ChangeDetection/otbMeanDiffChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbMeanDiffChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbMeanDiffChangeDetectionTest(int argc, char* argv[]) typedef otb::ImageFileReader<InputImageType2> ReaderType2; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::MeanDifferenceImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/ChangeDetection/otbMeanRatioChangeDetectionTest.cxx b/Testing/Code/ChangeDetection/otbMeanRatioChangeDetectionTest.cxx index e37cc0668c..99aa97b94c 100644 --- a/Testing/Code/ChangeDetection/otbMeanRatioChangeDetectionTest.cxx +++ b/Testing/Code/ChangeDetection/otbMeanRatioChangeDetectionTest.cxx @@ -48,13 +48,13 @@ int otbMeanRatioChangeDetectionTest(int argc, char* argv[]) typedef itk::ImageFileReader<InputImageType2> ReaderType2; typedef itk::ImageFileWriter<OutputImageType> WriterType; typedef itk::RescaleIntensityImageFilter<ChangeImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; // Declare the type for the filter typedef otb::MeanRatioImageFilter< - InputImageType1, - InputImageType2, - ChangeImageType> FilterType; + InputImageType1, + InputImageType2, + ChangeImageType> FilterType; ReaderType1::Pointer reader1 = ReaderType1::New(); ReaderType2::Pointer reader2 = ReaderType2::New(); diff --git a/Testing/Code/Common/otbExtractROI.cxx b/Testing/Code/Common/otbExtractROI.cxx index a7706c6eb3..08c8c4e468 100644 --- a/Testing/Code/Common/otbExtractROI.cxx +++ b/Testing/Code/Common/otbExtractROI.cxx @@ -36,7 +36,7 @@ int otbExtractROI(int argc, char * argv[]) typedef unsigned char OutputPixelType; typedef otb::ExtractROI<InputPixelType, - OutputPixelType> FilterType; + OutputPixelType> FilterType; typedef FilterType::InputImageType InputImageType; typedef FilterType::OutputImageType OutputImageType; diff --git a/Testing/Code/Common/otbExtractROI2.cxx b/Testing/Code/Common/otbExtractROI2.cxx index e0d8a7b1d6..92adf195ba 100644 --- a/Testing/Code/Common/otbExtractROI2.cxx +++ b/Testing/Code/Common/otbExtractROI2.cxx @@ -36,7 +36,7 @@ int otbExtractROI2(int argc, char * argv[]) typedef unsigned char OutputPixelType; typedef otb::ExtractROI<InputPixelType, - OutputPixelType> FilterType; + OutputPixelType> FilterType; typedef FilterType::InputImageType InputImageType; typedef FilterType::OutputImageType OutputImageType; diff --git a/Testing/Code/Common/otbExtractROI_RGB.cxx b/Testing/Code/Common/otbExtractROI_RGB.cxx index a306f08ea3..618aa6f4ff 100644 --- a/Testing/Code/Common/otbExtractROI_RGB.cxx +++ b/Testing/Code/Common/otbExtractROI_RGB.cxx @@ -38,7 +38,7 @@ int otbExtractROI_RGB(int argc, char * argv[]) typedef itk::RGBPixel<unsigned char> OutputPixelType; typedef otb::ExtractROI<InputPixelType, - OutputPixelType> FilterType; + OutputPixelType> FilterType; typedef FilterType::InputImageType InputImageType; typedef FilterType::OutputImageType OutputImageType; diff --git a/Testing/Code/Common/otbGISTableToGISTableFilterNew.cxx b/Testing/Code/Common/otbGISTableToGISTableFilterNew.cxx index dc73d83966..863efe4ac5 100644 --- a/Testing/Code/Common/otbGISTableToGISTableFilterNew.cxx +++ b/Testing/Code/Common/otbGISTableToGISTableFilterNew.cxx @@ -24,8 +24,8 @@ int otbGISTableToGISTableFilterNew(int argc, char * argv[]) { - typedef otb::PostGISConnectionImplementation GISConnectionType; - typedef otb::GISTable<GISConnectionType, double, 2> GISTableType; + typedef otb::PostGISConnectionImplementation GISConnectionType; + typedef otb::GISTable<GISConnectionType, double, 2> GISTableType; typedef otb::GISTableToGISTableFilter<GISTableType, GISTableType> GISFilterType; //Instantiation diff --git a/Testing/Code/Common/otbGenericInterpolateImageFunctionNew.cxx b/Testing/Code/Common/otbGenericInterpolateImageFunctionNew.cxx index bd179a4c11..32d8dccfa9 100644 --- a/Testing/Code/Common/otbGenericInterpolateImageFunctionNew.cxx +++ b/Testing/Code/Common/otbGenericInterpolateImageFunctionNew.cxx @@ -55,7 +55,7 @@ int otbGenericInterpolateImageFunctionNew(int argc, char * argv[]) typedef double CoordRepType; typedef otb::GenericInterpolateImageFunction<ImageType, FunctionType, BoundaryConditionType, - CoordRepType> GenericFunctionType; + CoordRepType> GenericFunctionType; // Instantiating object GenericFunctionType::Pointer generic = GenericFunctionType::New(); diff --git a/Testing/Code/Common/otbLineSpatialObjectListToPointSetFilterNew.cxx b/Testing/Code/Common/otbLineSpatialObjectListToPointSetFilterNew.cxx index d62694decb..678d0bb62e 100644 --- a/Testing/Code/Common/otbLineSpatialObjectListToPointSetFilterNew.cxx +++ b/Testing/Code/Common/otbLineSpatialObjectListToPointSetFilterNew.cxx @@ -33,7 +33,7 @@ int otbLineSpatialObjectListToPointSetFilterNew(int argc, char* argv[]) typedef itk::PointSet<InputPixelType> PointSetType; typedef otb::LineSpatialObjectListToPointSetFilter<LinesListType, - PointSetType> FilterType; + PointSetType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/Common/otbMultiChannelExtractROI.cxx b/Testing/Code/Common/otbMultiChannelExtractROI.cxx index a76d665ddf..ec50f39afc 100644 --- a/Testing/Code/Common/otbMultiChannelExtractROI.cxx +++ b/Testing/Code/Common/otbMultiChannelExtractROI.cxx @@ -28,7 +28,7 @@ template <typename InputPixelType /*= unsigned char */, typename OutputPixelTyp int generic_otbMultiChannelExtractROI(int argc, char * argv[], const char * inputFilename, const char * outputFilename) { typedef otb::MultiChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); int cpt(0), nbcanaux(0); @@ -168,51 +168,61 @@ int otbMultiChannelExtractROI(int argc, char * argv[]) std::string pixelType; if ((linputPixelType == "-uchar") && (loutputPixelType == - "-uchar")) return (generic_otbMultiChannelExtractROI<unsigned char, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiChannelExtractROI<unsigned char, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-char") && (loutputPixelType == "-char")) return (generic_otbMultiChannelExtractROI<char, char>(argc, argv, inputFilename, outputFilename)); else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-ushort")) return (generic_otbMultiChannelExtractROI<unsigned short, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiChannelExtractROI<unsigned short, unsigned short>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-uint")) return (generic_otbMultiChannelExtractROI<unsigned int, unsigned int>(argc, argv, inputFilename, - outputFilename)); + "-uint")) + return (generic_otbMultiChannelExtractROI<unsigned int, unsigned int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-float")) return (generic_otbMultiChannelExtractROI<float, float>(argc, argv, inputFilename, - outputFilename)); + "-float")) + return (generic_otbMultiChannelExtractROI<float, float>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-double")) return (generic_otbMultiChannelExtractROI<double, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiChannelExtractROI<double, double>(argc, argv, inputFilename, + outputFilename)); // Type -> uchar else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-uchar")) return (generic_otbMultiChannelExtractROI<unsigned short, unsigned char>(argc, argv, - inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiChannelExtractROI<unsigned short, unsigned char>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-uchar")) return (generic_otbMultiChannelExtractROI<unsigned int, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiChannelExtractROI<unsigned int, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-uchar")) return (generic_otbMultiChannelExtractROI<float, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiChannelExtractROI<float, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-uchar")) return (generic_otbMultiChannelExtractROI<double, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiChannelExtractROI<double, unsigned char>(argc, argv, inputFilename, + outputFilename)); // uchar -> Type else if ((linputPixelType == "-uchar") && (loutputPixelType == - "-double")) return (generic_otbMultiChannelExtractROI<unsigned char, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiChannelExtractROI<unsigned char, double>(argc, argv, inputFilename, + outputFilename)); else { std::cout << " Erreur : le format des images en entree est mal precise dans la ligne de commande !!!" << std::endl; diff --git a/Testing/Code/Common/otbMultiChannelExtractROINew.cxx b/Testing/Code/Common/otbMultiChannelExtractROINew.cxx index 17027ad72c..44509cdcd5 100644 --- a/Testing/Code/Common/otbMultiChannelExtractROINew.cxx +++ b/Testing/Code/Common/otbMultiChannelExtractROINew.cxx @@ -28,7 +28,7 @@ int otbMultiChannelExtractROINew(int argc, char * argv[]) typedef std::complex<double> OutputPixelType; typedef otb::MultiChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx b/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx index 02c7f26f70..6a91ab6180 100644 --- a/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx +++ b/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx @@ -29,7 +29,7 @@ int generic_otbMultiToMonoChannelExtractROI(int argc, const char * outputFilename) { typedef otb::MultiToMonoChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); int cpt(0); @@ -141,160 +141,195 @@ int otbMultiToMonoChannelExtractROI(int argc, char * argv[]) std::string pixelType; if ((linputPixelType == "-uchar") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<unsigned char, unsigned char>(argc, argv, - inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned char, unsigned char>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-short") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<short, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<short, short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<unsigned short, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned short, unsigned short>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-int") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<int, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<int, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-uint")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned int>(argc, argv, - inputFilename, - outputFilename)); + "-uint")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned int>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-float")) return (generic_otbMultiToMonoChannelExtractROI<float, float>(argc, argv, inputFilename, - outputFilename)); + "-float")) + return (generic_otbMultiToMonoChannelExtractROI<float, float>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<double, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<double, double>(argc, argv, inputFilename, + outputFilename)); // Type -> uchar else if ((linputPixelType == "-short") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<short, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<short, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<unsigned short, unsigned char>(argc, argv, - inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned short, unsigned char>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-int") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<int, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<int, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned char>(argc, argv, - inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned char>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<float, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<float, unsigned char>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-uchar")) return (generic_otbMultiToMonoChannelExtractROI<double, unsigned char>(argc, argv, inputFilename, - outputFilename)); + "-uchar")) + return (generic_otbMultiToMonoChannelExtractROI<double, unsigned char>(argc, argv, inputFilename, + outputFilename)); // Type -> ushort else if ((linputPixelType == "-uchar") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<unsigned char, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned char, unsigned short>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-int") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<int, unsigned short>(argc, argv, inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<int, unsigned short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, unsigned short>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<float, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<float, unsigned short>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-ushort")) return (generic_otbMultiToMonoChannelExtractROI<double, unsigned short>(argc, argv, - inputFilename, - outputFilename)); + "-ushort")) + return (generic_otbMultiToMonoChannelExtractROI<double, unsigned short>(argc, argv, + inputFilename, + outputFilename)); // Type -> ushort else if ((linputPixelType == "-uchar") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<unsigned char, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned char, short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-int") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<int, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<int, short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<float, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<float, short>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-short")) return (generic_otbMultiToMonoChannelExtractROI<double, short>(argc, argv, inputFilename, - outputFilename)); + "-short")) + return (generic_otbMultiToMonoChannelExtractROI<double, short>(argc, argv, inputFilename, + outputFilename)); // Type -> int else if ((linputPixelType == "-uchar") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<unsigned char, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned char, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-short") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<short, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<short, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<unsigned short, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned short, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<float, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<float, int>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-double") && (loutputPixelType == - "-int")) return (generic_otbMultiToMonoChannelExtractROI<double, int>(argc, argv, inputFilename, - outputFilename)); + "-int")) + return (generic_otbMultiToMonoChannelExtractROI<double, int>(argc, argv, inputFilename, + outputFilename)); // Type -> double else if ((linputPixelType == "-uchar") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<unsigned char, double>(argc, argv, - inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned char, double>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-short") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<short, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<short, double>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-ushort") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<unsigned short, double>(argc, argv, - inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned short, double>(argc, argv, + inputFilename, + outputFilename)); else if ((linputPixelType == "-int") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<int, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<int, double>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-uint") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<unsigned int, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<unsigned int, double>(argc, argv, inputFilename, + outputFilename)); else if ((linputPixelType == "-float") && (loutputPixelType == - "-double")) return (generic_otbMultiToMonoChannelExtractROI<float, double>(argc, argv, inputFilename, - outputFilename)); + "-double")) + return (generic_otbMultiToMonoChannelExtractROI<float, double>(argc, argv, inputFilename, + outputFilename)); else { diff --git a/Testing/Code/Common/otbMultiToMonoChannelExtractROINew.cxx b/Testing/Code/Common/otbMultiToMonoChannelExtractROINew.cxx index 38c5b0403f..9160f99c5c 100644 --- a/Testing/Code/Common/otbMultiToMonoChannelExtractROINew.cxx +++ b/Testing/Code/Common/otbMultiToMonoChannelExtractROINew.cxx @@ -29,7 +29,7 @@ int otbMultiToMonoChannelExtractROINew(int argc, char * argv[]) typedef std::complex<double> OutputPixelType; typedef otb::MultiToMonoChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/Common/otbRectangle.cxx b/Testing/Code/Common/otbRectangle.cxx index 387547d3e6..3519632e85 100644 --- a/Testing/Code/Common/otbRectangle.cxx +++ b/Testing/Code/Common/otbRectangle.cxx @@ -52,7 +52,8 @@ int otbRectangle(int argc, char * argv[]) std::ofstream outfile(outfname); - if (rectangle1->IsInside(InsideVertex)) outfile << "The point " << InsideVertex << " Is Inside the rectangle" << + if (rectangle1->IsInside(InsideVertex)) + outfile << "The point " << InsideVertex << " Is Inside the rectangle" << std::endl; else outfile << "The point " << InsideVertex << " Is Outside the rectangle" << std::endl; diff --git a/Testing/Code/Common/otbRemoteSensingRegion.cxx b/Testing/Code/Common/otbRemoteSensingRegion.cxx index 222e767c72..2afcd04e3a 100644 --- a/Testing/Code/Common/otbRemoteSensingRegion.cxx +++ b/Testing/Code/Common/otbRemoteSensingRegion.cxx @@ -52,7 +52,8 @@ int otbRemoteSensingRegion(int argc, char * argv[]) indexPt[0] = pointX; indexPt[1] = pointY; - if (region.IsInside(indexPt)) std::cout << "Le point " << indexPt[0] << "," << indexPt[1] << + if (region.IsInside(indexPt)) + std::cout << "Le point " << indexPt[0] << "," << indexPt[1] << " is inside the region " << std::endl; else std::cout << "Le point is OUTSIDE the region " << std::endl; diff --git a/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilter.cxx b/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilter.cxx index 316fd89a20..a9c52d625a 100644 --- a/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilter.cxx +++ b/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilter.cxx @@ -55,7 +55,7 @@ int otbUnaryFunctorNeighborhoodImageFilter(int argc, char * argv[]) typedef itk::ConstNeighborhoodIterator<ImageType> IterType; typedef Functor::UnaryFunctorNeighborhoodImageFilterTest<IterType, PixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilterNew.cxx b/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilterNew.cxx index 62237fb9ec..31d67a0b01 100644 --- a/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilterNew.cxx +++ b/Testing/Code/Common/otbUnaryFunctorNeighborhoodImageFilterNew.cxx @@ -46,7 +46,7 @@ int otbUnaryFunctorNeighborhoodImageFilterNew(int argc, char * argv[]) typedef itk::ConstNeighborhoodIterator<ImageType> IterType; typedef Functor::UnaryFunctorNeighborhoodImageFilterFunctorNewTest<IterType, PixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.cxx b/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.cxx index 541c980baa..0d739b4140 100644 --- a/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.cxx +++ b/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilter.cxx @@ -78,7 +78,7 @@ int otbUnaryFunctorNeighborhoodWithOffsetImageFilter(int argc, char * argv[]) typedef itk::ConstNeighborhoodIterator<ImageType> IterType; typedef Functor::UnaryFunctorNeighborhoodWithOffseImageFilterTest<InputPixelType, InputPixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodWithOffsetImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilterNew.cxx b/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilterNew.cxx index 43e229e51d..6b15348188 100644 --- a/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilterNew.cxx +++ b/Testing/Code/Common/otbUnaryFunctorNeighborhoodWithOffsetImageFilterNew.cxx @@ -68,14 +68,14 @@ int otbUnaryFunctorNeighborhoodWithOffsetImageFilterNew(int argc, char * argv[]) typedef double InputPixelType; const int Dimension = 2; typedef otb::VectorImage<InputPixelType, - Dimension> ImageType; + Dimension> ImageType; typedef ImageType::PixelType - PixelType; + PixelType; typedef itk::ConstNeighborhoodIterator<ImageType> IterType; typedef Functor::UnaryFunctorNeighborhoodWithOffsetImageFilterFunctorNewTest<InputPixelType, - InputPixelType> FunctorType; + InputPixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodWithOffsetImageFilter<ImageType, ImageType, - FunctorType> + FunctorType> UnaryFunctorNeighborhoodWithOffsetImageFilterType; // Instantiating object diff --git a/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilter.cxx b/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilter.cxx index 0d643c37e5..6869f7294d 100644 --- a/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilter.cxx +++ b/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilter.cxx @@ -53,7 +53,7 @@ int otbUnaryFunctorWithIndexImageFilter(int argc, char * argv[]) typedef Functor::UnaryFunctorWithIndexImageFilterFunctorTest<PixelType, PixelType> FunctorType; typedef otb::UnaryFunctorWithIndexImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorWithIndexImageFilterType; + FunctorType> UnaryFunctorWithIndexImageFilterType; // Instantiating object UnaryFunctorWithIndexImageFilterType::Pointer object = UnaryFunctorWithIndexImageFilterType::New(); diff --git a/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilterNew.cxx b/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilterNew.cxx index 266d7f1901..6d908c5e1c 100644 --- a/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilterNew.cxx +++ b/Testing/Code/Common/otbUnaryFunctorWithIndexImageFilterNew.cxx @@ -45,7 +45,7 @@ int otbUnaryFunctorWithIndexImageFilterNew(int argc, char * argv[]) typedef ImageType::PixelType PixelType; typedef Functor::UnaryFunctorWithIndexImageFilterFunctorNewTest<PixelType, PixelType> FunctorType; typedef otb::UnaryFunctorWithIndexImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorWithIndexImageFilterType; + FunctorType> UnaryFunctorWithIndexImageFilterType; // Instantiating object UnaryFunctorWithIndexImageFilterType::Pointer object = UnaryFunctorWithIndexImageFilterType::New(); diff --git a/Testing/Code/DisparityMap/otbCenteredRigidDeformationFieldEstimation.cxx b/Testing/Code/DisparityMap/otbCenteredRigidDeformationFieldEstimation.cxx index 96b2803ae5..0cb094bf53 100644 --- a/Testing/Code/DisparityMap/otbCenteredRigidDeformationFieldEstimation.cxx +++ b/Testing/Code/DisparityMap/otbCenteredRigidDeformationFieldEstimation.cxx @@ -90,11 +90,11 @@ int otbCenteredRigidDeformationFieldEstimation(int argc, char* argv[]) // Interpolator definition typedef itk::Function::HammingWindowFunction<3> - WindowFunctionType; + WindowFunctionType; typedef itk::ZeroFluxNeumannBoundaryCondition<ImageType> - ConditionType; + ConditionType; typedef itk::WindowedSincInterpolateImageFunction<ImageType, 3, WindowFunctionType, ConditionType, - double> InterpolatorType; + double> InterpolatorType; // Optimizer definition typedef itk::GradientDescentOptimizer OptimizerType; @@ -109,22 +109,22 @@ int otbCenteredRigidDeformationFieldEstimation(int argc, char* argv[]) // Deformation fields generator typedef otb::NearestPointDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestPointGeneratorType; + DeformationFieldType> + NearestPointGeneratorType; typedef otb::NNearestPointsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestPointGeneratorType; + DeformationFieldType> + NNearestPointGeneratorType; typedef otb::BSplinesInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> BSplinesGeneratorType; + DeformationFieldType> BSplinesGeneratorType; typedef otb::NearestTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestTransformGeneratorType; + DeformationFieldType> + NearestTransformGeneratorType; typedef otb::NNearestTransformsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestTransformGeneratorType; + DeformationFieldType> + NNearestTransformGeneratorType; typedef otb::BSplinesInterpolateTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - BSplinesTransformGeneratorType; + DeformationFieldType> + BSplinesTransformGeneratorType; // Warper typedef itk::WarpImageFilter<ImageType, ImageType, DeformationFieldType> ImageWarperType; diff --git a/Testing/Code/DisparityMap/otbEuler2DDeformationFieldEstimation.cxx b/Testing/Code/DisparityMap/otbEuler2DDeformationFieldEstimation.cxx index 6196b0e472..c195a6dd09 100644 --- a/Testing/Code/DisparityMap/otbEuler2DDeformationFieldEstimation.cxx +++ b/Testing/Code/DisparityMap/otbEuler2DDeformationFieldEstimation.cxx @@ -90,11 +90,11 @@ int otbEuler2DDeformationFieldEstimation(int argc, char* argv[]) // Interpolator definition typedef itk::Function::HammingWindowFunction<3> - WindowFunctionType; + WindowFunctionType; typedef itk::ZeroFluxNeumannBoundaryCondition<ImageType> - ConditionType; + ConditionType; typedef itk::WindowedSincInterpolateImageFunction<ImageType, 3, WindowFunctionType, ConditionType, - double> InterpolatorType; + double> InterpolatorType; // Optimizer definition typedef itk::GradientDescentOptimizer OptimizerType; @@ -109,22 +109,22 @@ int otbEuler2DDeformationFieldEstimation(int argc, char* argv[]) // Deformation fields generator typedef otb::NearestPointDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestPointGeneratorType; + DeformationFieldType> + NearestPointGeneratorType; typedef otb::NNearestPointsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestPointGeneratorType; + DeformationFieldType> + NNearestPointGeneratorType; typedef otb::BSplinesInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> BSplinesGeneratorType; + DeformationFieldType> BSplinesGeneratorType; typedef otb::NearestTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestTransformGeneratorType; + DeformationFieldType> + NearestTransformGeneratorType; typedef otb::NNearestTransformsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestTransformGeneratorType; + DeformationFieldType> + NNearestTransformGeneratorType; typedef otb::BSplinesInterpolateTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - BSplinesTransformGeneratorType; + DeformationFieldType> + BSplinesTransformGeneratorType; // Warper typedef itk::WarpImageFilter<ImageType, ImageType, DeformationFieldType> ImageWarperType; diff --git a/Testing/Code/DisparityMap/otbNCCRegistrationFilter.cxx b/Testing/Code/DisparityMap/otbNCCRegistrationFilter.cxx index 9b9102253b..df51d06fd3 100644 --- a/Testing/Code/DisparityMap/otbNCCRegistrationFilter.cxx +++ b/Testing/Code/DisparityMap/otbNCCRegistrationFilter.cxx @@ -44,7 +44,7 @@ int otbNCCRegistrationFilter(int argc, char* argv[]) typedef otb::Image<PixelType, ImageDimension> MovingImageType; typedef otb::Image<PixelType, ImageDimension> FixedImageType; typedef otb::Image<DeformationPixelType, - ImageDimension> DeformationFieldType; + ImageDimension> DeformationFieldType; typedef otb::ImageFileReader<FixedImageType> FixedReaderType; FixedReaderType::Pointer fReader = FixedReaderType::New(); @@ -55,22 +55,22 @@ int otbNCCRegistrationFilter(int argc, char* argv[]) mReader->SetFileName(argv[2]); typedef itk::RecursiveGaussianImageFilter<FixedImageType, - FixedImageType> FixedBlurType; + FixedImageType> FixedBlurType; FixedBlurType::Pointer fBlur = FixedBlurType::New(); fBlur->SetInput(fReader->GetOutput()); fBlur->SetSigma(atof(argv[5])); typedef itk::RecursiveGaussianImageFilter<MovingImageType, - MovingImageType> MovingBlurType; + MovingImageType> MovingBlurType; MovingBlurType::Pointer mBlur = MovingBlurType::New(); mBlur->SetInput(mReader->GetOutput()); mBlur->SetSigma(atof(argv[5])); typedef otb::NCCRegistrationFilter<FixedImageType, - MovingImageType, - DeformationFieldType> + MovingImageType, + DeformationFieldType> RegistrationFilterType; RegistrationFilterType::Pointer registrator = RegistrationFilterType::New(); diff --git a/Testing/Code/DisparityMap/otbNCCRegistrationFilterNew.cxx b/Testing/Code/DisparityMap/otbNCCRegistrationFilterNew.cxx index 4352e4eb52..f8793aeaa5 100644 --- a/Testing/Code/DisparityMap/otbNCCRegistrationFilterNew.cxx +++ b/Testing/Code/DisparityMap/otbNCCRegistrationFilterNew.cxx @@ -31,12 +31,12 @@ int otbNCCRegistrationFilterNew(int argc, char* argv[]) typedef otb::Image<PixelType, ImageDimension> MovingImageType; typedef otb::Image<PixelType, ImageDimension> FixedImageType; typedef otb::Image<DeformationPixelType, - ImageDimension> DeformationFieldType; + ImageDimension> DeformationFieldType; //Create the filter typedef otb::NCCRegistrationFilter<FixedImageType, - MovingImageType, - DeformationFieldType> + MovingImageType, + DeformationFieldType> RegistrationFilterType; // Instantiation diff --git a/Testing/Code/DisparityMap/otbTranslationDeformationFieldEstimation.cxx b/Testing/Code/DisparityMap/otbTranslationDeformationFieldEstimation.cxx index b179bbb454..28f34e3c7e 100644 --- a/Testing/Code/DisparityMap/otbTranslationDeformationFieldEstimation.cxx +++ b/Testing/Code/DisparityMap/otbTranslationDeformationFieldEstimation.cxx @@ -88,11 +88,11 @@ int otbTranslationDeformationFieldEstimation(int argc, char* argv[]) // Interpolator definition typedef itk::Function::HammingWindowFunction<3> - WindowFunctionType; + WindowFunctionType; typedef itk::ZeroFluxNeumannBoundaryCondition<ImageType> - ConditionType; + ConditionType; typedef itk::WindowedSincInterpolateImageFunction<ImageType, 3, WindowFunctionType, ConditionType, - double> InterpolatorType; + double> InterpolatorType; // Optimizer definition typedef itk::GradientDescentOptimizer OptimizerType; @@ -107,22 +107,22 @@ int otbTranslationDeformationFieldEstimation(int argc, char* argv[]) // Deformation fields generator typedef otb::NearestPointDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestPointGeneratorType; + DeformationFieldType> + NearestPointGeneratorType; typedef otb::NNearestPointsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestPointGeneratorType; + DeformationFieldType> + NNearestPointGeneratorType; typedef otb::BSplinesInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> BSplinesGeneratorType; + DeformationFieldType> BSplinesGeneratorType; typedef otb::NearestTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NearestTransformGeneratorType; + DeformationFieldType> + NearestTransformGeneratorType; typedef otb::NNearestTransformsLinearInterpolateDeformationFieldGenerator<PointSetType, - DeformationFieldType> - NNearestTransformGeneratorType; + DeformationFieldType> + NNearestTransformGeneratorType; typedef otb::BSplinesInterpolateTransformDeformationFieldGenerator<PointSetType, - DeformationFieldType> - BSplinesTransformGeneratorType; + DeformationFieldType> + BSplinesTransformGeneratorType; // Warper typedef itk::WarpImageFilter<ImageType, ImageType, DeformationFieldType> ImageWarperType; diff --git a/Testing/Code/FeatureExtraction/otbAddCarvingPathFilterNew.cxx b/Testing/Code/FeatureExtraction/otbAddCarvingPathFilterNew.cxx index a94751162e..47b6a6f4b0 100644 --- a/Testing/Code/FeatureExtraction/otbAddCarvingPathFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbAddCarvingPathFilterNew.cxx @@ -34,7 +34,7 @@ int otbAddCarvingPathFilterNew(int argc, char* argv[]) typedef itk::PolyLineParametricPath<Dimension> PathType; typedef otb::AddCarvingPathFilter<InputImageType, PathType, - OutputImageType> AddCarvingPathFilterType; + OutputImageType> AddCarvingPathFilterType; AddCarvingPathFilterType::Pointer addCarvingPathFilter = AddCarvingPathFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetector.cxx b/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetector.cxx index c7ad78b808..bb7479fe10 100644 --- a/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetector.cxx +++ b/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetector.cxx @@ -54,7 +54,7 @@ int otbAssymmetricFusionOfLineDetector(int argc, char * argv[]) typedef itk::LinearInterpolateImageFunction<InputImageType, double> InterpolatorType; typedef otb::AssymmetricFusionOfLineDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> FilterType; + InterpolatorType> FilterType; FilterType::Pointer FilterAssSymSum = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorNew.cxx b/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorNew.cxx index c1b77b37af..2b132e72aa 100644 --- a/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorNew.cxx +++ b/Testing/Code/FeatureExtraction/otbAssymmetricFusionOfLineDetectorNew.cxx @@ -45,7 +45,7 @@ int otbAssymmetricFusionOfLineDetectorNew(int argc, char * argv[]) typedef itk::LinearInterpolateImageFunction<InputImageType, double> InterpolatorType; typedef otb::AssymmetricFusionOfLineDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> FilterType; + InterpolatorType> FilterType; FilterType::Pointer FilterAssSymSum = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbFourierMellinImageFilter.cxx b/Testing/Code/FeatureExtraction/otbFourierMellinImageFilter.cxx index 3cda127813..33853a8cf7 100644 --- a/Testing/Code/FeatureExtraction/otbFourierMellinImageFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbFourierMellinImageFilter.cxx @@ -46,11 +46,11 @@ int otbFourierMellinImageFilter(int argc, char* argv[]) typedef itk::LinearInterpolateImageFunction<InputImageType, double> InterpolatorType; typedef otb::ForwardFourierMellinTransformImageFilter<InputPixelType, InterpolatorType, - Dimension> FourierMellinTransformType; + Dimension> FourierMellinTransformType; typedef FourierMellinTransformType::OutputImageType OutputImageType; typedef itk::ComplexToRealImageFilter<OutputImageType, InputImageType> RealFilterType; typedef itk::ComplexToImaginaryImageFilter<OutputImageType, - InputImageType> ImaginaryFilterType; + InputImageType> ImaginaryFilterType; typedef itk::RescaleIntensityImageFilter<InputImageType, InputImageType> RescalerType; FourierMellinTransformType::Pointer FourierMellinTransform = FourierMellinTransformType::New(); diff --git a/Testing/Code/FeatureExtraction/otbFourierMellinImageFilterNew.cxx b/Testing/Code/FeatureExtraction/otbFourierMellinImageFilterNew.cxx index 60f40deaba..58b6ce2ef2 100644 --- a/Testing/Code/FeatureExtraction/otbFourierMellinImageFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbFourierMellinImageFilterNew.cxx @@ -35,7 +35,7 @@ int otbFourierMellinImageFilterNew(int argc, char* argv[]) typedef itk::LinearInterpolateImageFunction<InputImageType, double> InterpolatorType; typedef otb::ForwardFourierMellinTransformImageFilter<PixelType, - InterpolatorType, Dimension> FourierMellinTransformType; + InterpolatorType, Dimension> FourierMellinTransformType; FourierMellinTransformType::Pointer fourierMellinTransform = FourierMellinTransformType::New(); diff --git a/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.cxx b/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.cxx index 604953efaf..a24e13f316 100644 --- a/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.cxx +++ b/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.cxx @@ -24,172 +24,173 @@ int otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator(int argc, char * argv[]) { - - try { // the rest of the function is in the try block... - - //Data definitions - const unsigned int HISTOGRAM_AXIS_LEN = 25; - - //------------------------------------------------------ - // Create a simple test histogram. The histogram must be - // symmetric and normalized. - //------------------------------------------------------ - const unsigned int Dimension = 2; - typedef float MeasurementType ; - typedef itk::Statistics::Histogram< MeasurementType, Dimension > HistogramType ; - HistogramType::Pointer histogram = HistogramType::New() ; - HistogramType::SizeType size ; - size.Fill(HISTOGRAM_AXIS_LEN) ; - HistogramType::MeasurementVectorType lowerBound ; - HistogramType::MeasurementVectorType upperBound ; - lowerBound[0] = 0 ; - lowerBound[1] = 0 ; - upperBound[0] = HISTOGRAM_AXIS_LEN + 1 ; - upperBound[1] = HISTOGRAM_AXIS_LEN + 1 ; - histogram->Initialize(size, lowerBound, upperBound ) ; - - HistogramType::IndexType index ; - index[0] = 0 ; - index[1] = 0 ; - histogram->SetFrequency(index, 0.1); - index[0] = 3 ; - index[1] = 3 ; - histogram->SetFrequency(index, 0.5); - index[0] = 2 ; - index[1] = 1 ; - histogram->SetFrequency(index, 0.05); - index[0] = 1 ; - index[1] = 2 ; - histogram->SetFrequency(index, 0.05); - index[0] = 7 ; - index[1] = 6 ; - histogram->SetFrequency(index, 0.1); - index[0] = 6 ; - index[1] = 7 ; - histogram->SetFrequency(index, 0.1); - index[0] = 10 ; - index[1] = 10 ; - histogram->SetFrequency(index, 0.1); - - typedef otb::GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< - HistogramType > GLCMCalcType; - GLCMCalcType::Pointer glcmCalc = GLCMCalcType::New(); - - glcmCalc->SetHistogram(histogram); - glcmCalc->Compute(); - - double trueVariance = 7.6475; - double trueMean = 3.95; - double trueSumAverage = 0; - double trueSumVariance = 0; - double trueSumEntropy = 0; - double trueDifferenceEntropy = 0.770746; - double trueDifferenceVariance = 0.1275; - double trueIC1 = 0.557305; - double trueIC2 = 0.908663; - - double variance = glcmCalc->GetVariance(); - double mean = glcmCalc->GetMean(); - double sumAverage = glcmCalc->GetSumAverage(); - double sumVariance = glcmCalc->GetSumVariance(); - double sumEntropy = glcmCalc->GetSumEntropy(); - double differenceEntropy = glcmCalc->GetDifferenceEntropy(); - double differenceVariance = glcmCalc->GetDifferenceVariance(); - double ic1 = glcmCalc->GetIC1(); - double ic2 = glcmCalc->GetIC2(); - - bool passed = true; - - if( vnl_math_abs(variance - trueVariance) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Variance calculated wrong. Expected: " << trueVariance << ", got: " - << variance << std::endl; - passed = false; - } - - if( vnl_math_abs(mean - trueMean) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Mean calculated wrong. Expected: " << trueMean << ", got: " - << mean << std::endl; - passed = false; - } - - if( vnl_math_abs(sumAverage - trueSumAverage) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Sum average calculated wrong. Expected: " << trueSumAverage << ", got: " - << sumAverage << std::endl; - passed = false; - } - - if( vnl_math_abs(sumVariance - trueSumVariance) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Sum variance calculated wrong. Expected: " << trueSumVariance << + + try // the rest of the function is in the try block... + + { //Data definitions + const unsigned int HISTOGRAM_AXIS_LEN = 25; + + //------------------------------------------------------ + // Create a simple test histogram. The histogram must be + // symmetric and normalized. + //------------------------------------------------------ + const unsigned int Dimension = 2; + typedef float MeasurementType; + typedef itk::Statistics::Histogram<MeasurementType, Dimension> HistogramType; + HistogramType::Pointer histogram = HistogramType::New(); + HistogramType::SizeType size; + size.Fill(HISTOGRAM_AXIS_LEN); + HistogramType::MeasurementVectorType lowerBound; + HistogramType::MeasurementVectorType upperBound; + lowerBound[0] = 0; + lowerBound[1] = 0; + upperBound[0] = HISTOGRAM_AXIS_LEN + 1; + upperBound[1] = HISTOGRAM_AXIS_LEN + 1; + histogram->Initialize(size, lowerBound, upperBound); + + HistogramType::IndexType index; + index[0] = 0; + index[1] = 0; + histogram->SetFrequency(index, 0.1); + index[0] = 3; + index[1] = 3; + histogram->SetFrequency(index, 0.5); + index[0] = 2; + index[1] = 1; + histogram->SetFrequency(index, 0.05); + index[0] = 1; + index[1] = 2; + histogram->SetFrequency(index, 0.05); + index[0] = 7; + index[1] = 6; + histogram->SetFrequency(index, 0.1); + index[0] = 6; + index[1] = 7; + histogram->SetFrequency(index, 0.1); + index[0] = 10; + index[1] = 10; + histogram->SetFrequency(index, 0.1); + + typedef otb::GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< + HistogramType> GLCMCalcType; + GLCMCalcType::Pointer glcmCalc = GLCMCalcType::New(); + + glcmCalc->SetHistogram(histogram); + glcmCalc->Compute(); + + double trueVariance = 7.6475; + double trueMean = 3.95; + double trueSumAverage = 0; + double trueSumVariance = 0; + double trueSumEntropy = 0; + double trueDifferenceEntropy = 0.770746; + double trueDifferenceVariance = 0.1275; + double trueIC1 = 0.557305; + double trueIC2 = 0.908663; + + double variance = glcmCalc->GetVariance(); + double mean = glcmCalc->GetMean(); + double sumAverage = glcmCalc->GetSumAverage(); + double sumVariance = glcmCalc->GetSumVariance(); + double sumEntropy = glcmCalc->GetSumEntropy(); + double differenceEntropy = glcmCalc->GetDifferenceEntropy(); + double differenceVariance = glcmCalc->GetDifferenceVariance(); + double ic1 = glcmCalc->GetIC1(); + double ic2 = glcmCalc->GetIC2(); + + bool passed = true; + + if (vnl_math_abs(variance - trueVariance) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Variance calculated wrong. Expected: " << trueVariance << ", got: " + << variance << std::endl; + passed = false; + } + + if (vnl_math_abs(mean - trueMean) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Mean calculated wrong. Expected: " << trueMean << ", got: " + << mean << std::endl; + passed = false; + } + + if (vnl_math_abs(sumAverage - trueSumAverage) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Sum average calculated wrong. Expected: " << trueSumAverage << ", got: " + << sumAverage << std::endl; + passed = false; + } + + if (vnl_math_abs(sumVariance - trueSumVariance) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Sum variance calculated wrong. Expected: " << trueSumVariance << ", got: " << sumVariance << std::endl; - passed = false; - } - - if( vnl_math_abs(sumEntropy - trueSumEntropy) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Sum entropy calculated wrong. Expected: " << + passed = false; + } + + if (vnl_math_abs(sumEntropy - trueSumEntropy) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Sum entropy calculated wrong. Expected: " << trueSumEntropy << ", got: " << sumEntropy << std::endl; - passed = false; - } - - if( vnl_math_abs(differenceEntropy - trueDifferenceEntropy) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Difference entropy calculated wrong. Expected: " << trueDifferenceEntropy << ", got: " - << differenceEntropy << std::endl; - passed = false; - } - - if( vnl_math_abs(differenceVariance - trueDifferenceVariance) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "Difference variance calculated wrong. Expected: " << trueDifferenceVariance << + passed = false; + } + + if (vnl_math_abs(differenceEntropy - trueDifferenceEntropy) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Difference entropy calculated wrong. Expected: " << trueDifferenceEntropy << ", got: " + << differenceEntropy << std::endl; + passed = false; + } + + if (vnl_math_abs(differenceVariance - trueDifferenceVariance) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "Difference variance calculated wrong. Expected: " << trueDifferenceVariance << ", got: " << differenceVariance << std::endl; - passed = false; - } + passed = false; + } + + if (vnl_math_abs(ic1 - trueIC1) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "IC1 calculated wrong. Expected: " + << trueIC1 << ", got: " << ic1 << std::endl; + passed = false; + } + + if (vnl_math_abs(ic2 - trueIC2) > 0.001) + { + std::cerr << "Error:" << std::endl; + std::cerr << "IC2 calculated wrong. Expected: " + << trueIC2 << ", got: " << ic2 << std::endl; + passed = false; + } + + if (!passed) + { + std::cerr << "Test failed" << std::endl; + return EXIT_FAILURE; + } + else + { + std::cerr << "Test succeeded" << std::endl; + return EXIT_SUCCESS; + } - if( vnl_math_abs(ic1 - trueIC1) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "IC1 calculated wrong. Expected: " - << trueIC1 << ", got: " << ic1 << std::endl; - passed = false; - } - - if( vnl_math_abs(ic2 - trueIC2) > 0.001 ) - { - std::cerr << "Error:" << std::endl; - std::cerr << "IC2 calculated wrong. Expected: " - << trueIC2 << ", got: " << ic2 << std::endl; - passed = false; } - - - if (!passed) + catch (itk::ExceptionObject& err) { + std::cerr << "ExceptionObject caught !" << std::endl; + std::cerr << err << std::endl; std::cerr << "Test failed" << std::endl; return EXIT_FAILURE; } - else - { - std::cerr << "Test succeeded" << std::endl; - return EXIT_SUCCESS; - } - - } catch( itk::ExceptionObject & err ) { - std::cerr << "ExceptionObject caught !" << std::endl; - std::cerr << err << std::endl; - std::cerr << "Test failed" << std::endl; - return EXIT_FAILURE; - } return EXIT_SUCCESS; } diff --git a/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculatorNew.cxx b/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculatorNew.cxx index 4ff974c18e..c196630790 100644 --- a/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculatorNew.cxx +++ b/Testing/Code/FeatureExtraction/otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculatorNew.cxx @@ -19,14 +19,13 @@ #include "otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator.h" - int otbGreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculatorNew(int argc, char * argv[]) { const unsigned int Dimension = 2; - typedef float MeasurementType ; - typedef itk::Statistics::Histogram< MeasurementType, Dimension > HistogramType ; + typedef float MeasurementType; + typedef itk::Statistics::Histogram<MeasurementType, Dimension> HistogramType; typedef otb::GreyLevelCooccurrenceMatrixAdvancedTextureCoefficientsCalculator< - HistogramType > FilterType; + HistogramType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbHoughTransform2DLinesImageTest.cxx b/Testing/Code/FeatureExtraction/otbHoughTransform2DLinesImageTest.cxx index ffe3e84386..c28f54f908 100644 --- a/Testing/Code/FeatureExtraction/otbHoughTransform2DLinesImageTest.cxx +++ b/Testing/Code/FeatureExtraction/otbHoughTransform2DLinesImageTest.cxx @@ -112,8 +112,8 @@ int otbHoughTransform2DLinesImageTest(int argc, char* argv[]) /** Apply gradient filter to the input image */ typedef itk::CastImageFilter< - ImageType, - HoughImageType> CastingFilterType; + ImageType, + HoughImageType> CastingFilterType; CastingFilterType::Pointer caster = CastingFilterType::New(); caster->SetInput(m_Image); diff --git a/Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilterDistanceMap.cxx b/Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilterDistanceMap.cxx index cc9351c3fb..2a0ecee41d 100644 --- a/Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilterDistanceMap.cxx +++ b/Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilterDistanceMap.cxx @@ -291,12 +291,11 @@ int otbImageToSIFTKeyPointSetFilterDistanceMap(int argc, char * argv[]) const unsigned int contrastMax = atoi(argv[9]); //redirect cout to a file - ofstream file(outfname); - streambuf* strm_buffer = std::cout.rdbuf();//save the cout to put it + ofstream file(outfname); + streambuf* strm_buffer = std::cout.rdbuf(); //save the cout to put it //back later std::cout.rdbuf(file.rdbuf()); - ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(infname); reader->Update(); diff --git a/Testing/Code/FeatureExtraction/otbLineCorrelationDetectorLinear.cxx b/Testing/Code/FeatureExtraction/otbLineCorrelationDetectorLinear.cxx index f163d490b9..e514424a27 100644 --- a/Testing/Code/FeatureExtraction/otbLineCorrelationDetectorLinear.cxx +++ b/Testing/Code/FeatureExtraction/otbLineCorrelationDetectorLinear.cxx @@ -54,9 +54,9 @@ int otbLineCorrelationDetectorLinear(int argc, char* argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef itk::LinearInterpolateImageFunction<InputImageType, - double> InterpolatorType; + double> InterpolatorType; typedef otb::LineCorrelationDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> FilterType; + InterpolatorType> FilterType; FilterType::Pointer FilterLineCorrelation = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx b/Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx index d18f636fd4..f631dd6d09 100644 --- a/Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx +++ b/Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx @@ -54,9 +54,9 @@ int otbLineRatioDetectorLinear(int argc, char* argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef itk::LinearInterpolateImageFunction<InputImageType, - double> InterpolatorType; + double> InterpolatorType; typedef otb::LineRatioDetectorImageFilter<InputImageType, OutputImageType, OutputImageDirectionType, - InterpolatorType> FilterType; + InterpolatorType> FilterType; FilterType::Pointer FilterLineRatio = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx index 0ead0b0429..cb63d904a3 100644 --- a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx @@ -42,7 +42,7 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int argc, char * argv[]) typedef std::vector<LineType*> VectorLines; typedef itk::PointSet<VectorLines, Dimension> PointSetType; typedef otb::LineSpatialObjectListToRightAnglePointSetFilter<ImageType, LinesListType, - PointSetType> RightAngleFilterType; + PointSetType> RightAngleFilterType; /** Creatop, of an instance of the filters */ RightAngleFilterType::Pointer rightAngleFilter = RightAngleFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx index 7833c18469..b6a528a0b1 100644 --- a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx +++ b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx @@ -47,7 +47,7 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int arg typedef itk::PointSet<VectorLines, Dimension> PointSetType; typedef otb::LineSegmentDetector<ImageType, PixelType> lsdFilterType; typedef otb::LineSpatialObjectListToRightAnglePointSetFilter<ImageType, LinesListType, - PointSetType> RightAngleFilterType; + PointSetType> RightAngleFilterType; /** Creatop, of an instance of the filters */ RightAngleFilterType::Pointer rightAngleFilter = RightAngleFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterNew.cxx b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterNew.cxx index bdc813aeb8..0e04f4005f 100644 --- a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterNew.cxx @@ -33,7 +33,7 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterNew(int argc, char * argv[ typedef std::vector<LineType *> VectorLines; typedef itk::PointSet<VectorLines, Dimension> PointSetType; typedef otb::LineSpatialObjectListToRightAnglePointSetFilter<ImageType, LinesListType, - PointSetType> RightAngleFilterType; + PointSetType> RightAngleFilterType; RightAngleFilterType::Pointer rightAngleFilter = RightAngleFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbModulusAndDirectionImageFiltersNew.cxx b/Testing/Code/FeatureExtraction/otbModulusAndDirectionImageFiltersNew.cxx index af7cfa781c..c0d491968b 100644 --- a/Testing/Code/FeatureExtraction/otbModulusAndDirectionImageFiltersNew.cxx +++ b/Testing/Code/FeatureExtraction/otbModulusAndDirectionImageFiltersNew.cxx @@ -38,15 +38,15 @@ int otbModulusAndDirectionImageFiltersNew(int argc, char* argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageDirectionType; typedef otb::ImageToModulusAndDirectionImageFilter<InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; typedef otb::ImageToModulusAndDirectionImageFilter<InputImageType, OutputImageType, - OutputImageDirectionType> Filter2Type; + OutputImageDirectionType> Filter2Type; FilterType::Pointer Filter = FilterType::New(); Filter2Type::Pointer Filter2 = Filter2Type::New(); typedef otb::ModulusAndDirectionImageToImageFilter<InputImageType, InputImageDirectionType, - OutputImageType> Filter3Type; + OutputImageType> Filter3Type; Filter3Type::Pointer Filter3 = Filter3Type::New(); return EXIT_SUCCESS; diff --git a/Testing/Code/FeatureExtraction/otbMultiplyByScalarImageTest.cxx b/Testing/Code/FeatureExtraction/otbMultiplyByScalarImageTest.cxx index fa12a4b1fd..40076c825c 100644 --- a/Testing/Code/FeatureExtraction/otbMultiplyByScalarImageTest.cxx +++ b/Testing/Code/FeatureExtraction/otbMultiplyByScalarImageTest.cxx @@ -35,10 +35,10 @@ int otbMultiplyByScalarImageFilterTest(int argc, char * argv[]) // Declare Iterator types apropriated for each image typedef itk::ImageRegionIteratorWithIndex< - InputImageType> InputIteratorType; + InputImageType> InputIteratorType; typedef itk::ImageRegionIteratorWithIndex< - OutputImageType> OutputIteratorType; + OutputImageType> OutputIteratorType; // Declare the type of the index to access images typedef itk::Index<ImageDimension> IndexType; diff --git a/Testing/Code/FeatureExtraction/otbRemoveCarvingPathFilterNew.cxx b/Testing/Code/FeatureExtraction/otbRemoveCarvingPathFilterNew.cxx index 4afa734e33..f07e56222e 100644 --- a/Testing/Code/FeatureExtraction/otbRemoveCarvingPathFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbRemoveCarvingPathFilterNew.cxx @@ -34,7 +34,7 @@ int otbRemoveCarvingPathFilterNew(int argc, char* argv[]) typedef itk::PolyLineParametricPath<Dimension> PathType; typedef otb::RemoveCarvingPathFilter<InputImageType, PathType, - OutputImageType> RemoveCarvingPathFilterType; + OutputImageType> RemoveCarvingPathFilterType; RemoveCarvingPathFilterType::Pointer addCarvingPathFilter = RemoveCarvingPathFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.cxx index 91e85cbdb9..e7b525eadb 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilter.cxx @@ -25,25 +25,25 @@ int otbScalarImageToAdvancedTexturesFilter(int argc, char * argv[]) { - if(argc != 7) + if (argc != 7) { - std::cerr<<"Usage: "<<argv[0]<<" infname outprefix nbBins radius offsetx offsety"<<std::endl; + std::cerr << "Usage: " << argv[0] << " infname outprefix nbBins radius offsetx offsety" << std::endl; return EXIT_FAILURE; } - const char * infname = argv[1]; - const char * outprefix = argv[2]; + const char * infname = argv[1]; + const char * outprefix = argv[2]; const unsigned int nbBins = atoi(argv[3]); const unsigned int radius = atoi(argv[4]); - const int offsetx = atoi(argv[5]); - const int offsety = atoi(argv[6]); - + const int offsetx = atoi(argv[5]); + const int offsety = atoi(argv[6]); + const unsigned int Dimension = 2; - typedef float PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; + typedef float PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; typedef otb::ScalarImageToAdvancedTexturesFilter - <ImageType,ImageType> TexturesFilterType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::ImageFileWriter<ImageType> WriterType; + <ImageType, ImageType> TexturesFilterType; + typedef otb::ImageFileReader<ImageType> ReaderType; + typedef otb::ImageFileWriter<ImageType> WriterType; ReaderType::Pointer reader = ReaderType::New(); TexturesFilterType::Pointer filter = TexturesFilterType::New(); @@ -66,7 +66,7 @@ int otbScalarImageToAdvancedTexturesFilter(int argc, char * argv[]) filter->SetRadius(sradius); filter->SetOffset(offset); - otb::StandardFilterWatcher watcher(filter,"Textures filter"); + otb::StandardFilterWatcher watcher(filter, "Textures filter"); filter->SetInputImageMinimum(0); filter->SetInputImageMaximum(256); @@ -77,55 +77,55 @@ int otbScalarImageToAdvancedTexturesFilter(int argc, char * argv[]) writer->SetNumberOfStreamDivisions(2); oss.str(""); - oss<<outprefix<<"Variance.tif"; + oss << outprefix << "Variance.tif"; writer->SetInput(filter->GetVarianceOutput()); writer->SetFileName(oss.str()); writer->Update(); - - oss.str(""); - oss<<outprefix<<"Mean.tif"; + + oss.str(""); + oss << outprefix << "Mean.tif"; writer->SetInput(filter->GetMeanOutput()); writer->SetFileName(oss.str()); writer->Update(); - + oss.str(""); - oss<<outprefix<<"SumAverage.tif"; + oss << outprefix << "SumAverage.tif"; writer->SetInput(filter->GetSumAverageOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"SumVariance.tif"; + oss << outprefix << "SumVariance.tif"; writer->SetInput(filter->GetSumVarianceOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"SumEntropy.tif"; + oss << outprefix << "SumEntropy.tif"; writer->SetInput(filter->GetSumEntropyOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"DifferenceEntropy.tif"; + oss << outprefix << "DifferenceEntropy.tif"; writer->SetInput(filter->GetDifferenceEntropyOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"DifferenceVariance.tif"; + oss << outprefix << "DifferenceVariance.tif"; writer->SetInput(filter->GetDifferenceVarianceOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"IC1.tif"; + oss << outprefix << "IC1.tif"; writer->SetInput(filter->GetIC1Output()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"IC2.tif"; + oss << outprefix << "IC2.tif"; writer->SetInput(filter->GetIC2Output()); writer->SetFileName(oss.str()); writer->Update(); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilterNew.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilterNew.cxx index f87a73e7d5..6a6d4deee3 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToAdvancedTexturesFilterNew.cxx @@ -23,9 +23,9 @@ int otbScalarImageToAdvancedTexturesFilterNew(int argc, char * argv[]) { const unsigned int Dimension = 2; - typedef double PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; - typedef otb::ScalarImageToAdvancedTexturesFilter<ImageType,ImageType> FilterType; + typedef double PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; + typedef otb::ScalarImageToAdvancedTexturesFilter<ImageType, ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.cxx index dd5acbdd2f..9b14ba713e 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilter.cxx @@ -25,27 +25,27 @@ int otbScalarImageToPanTexTextureFilter(int argc, char * argv[]) { - if(argc != 5) + if (argc != 5) { - std::cerr<<"Usage: "<<argv[0]<<" infname outprefix nbBins radius"<<std::endl; + std::cerr << "Usage: " << argv[0] << " infname outprefix nbBins radius" << std::endl; return EXIT_FAILURE; } - const char * infname = argv[1]; - const char * outprefix = argv[2]; + const char * infname = argv[1]; + const char * outprefix = argv[2]; const unsigned int nbBins = atoi(argv[3]); const unsigned int radius = atoi(argv[4]); const unsigned int Dimension = 2; - typedef float PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; + typedef float PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; typedef otb::ScalarImageToPanTexTextureFilter - <ImageType,ImageType> PanTexTextureFilterType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::ImageFileWriter<ImageType> WriterType; + <ImageType, ImageType> PanTexTextureFilterType; + typedef otb::ImageFileReader<ImageType> ReaderType; + typedef otb::ImageFileWriter<ImageType> WriterType; - ReaderType::Pointer reader = ReaderType::New(); + ReaderType::Pointer reader = ReaderType::New(); PanTexTextureFilterType::Pointer filter = PanTexTextureFilterType::New(); - WriterType::Pointer writer = WriterType::New(); + WriterType::Pointer writer = WriterType::New(); // Read image reader->SetFileName(infname); @@ -58,7 +58,7 @@ int otbScalarImageToPanTexTextureFilter(int argc, char * argv[]) filter->SetNumberOfBinsPerAxis(nbBins); filter->SetRadius(sradius); - otb::StandardFilterWatcher watcher(filter,"Textures filter"); + otb::StandardFilterWatcher watcher(filter, "Textures filter"); filter->SetInputImageMinimum(0); filter->SetInputImageMaximum(255); @@ -67,7 +67,7 @@ int otbScalarImageToPanTexTextureFilter(int argc, char * argv[]) itk::OStringStream oss; oss.str(""); - oss<<outprefix<<"PanTex.tif"; + oss << outprefix << "PanTex.tif"; writer->SetInput(filter->GetOutput()); writer->SetFileName(oss.str()); writer->SetNumberOfStreamDivisions(2); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilterNew.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilterNew.cxx index bcdcd8c2de..ddab07df9a 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToPanTexTextureFilterNew.cxx @@ -23,9 +23,9 @@ int otbScalarImageToPanTexTextureFilterNew(int argc, char * argv[]) { const unsigned int Dimension = 2; - typedef double PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; - typedef otb::ScalarImageToPanTexTextureFilter<ImageType,ImageType> FilterType; + typedef double PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; + typedef otb::ScalarImageToPanTexTextureFilter<ImageType, ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilter.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilter.cxx index 622783a23e..ad764cbc14 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilter.cxx @@ -25,25 +25,25 @@ int otbScalarImageToTexturesFilter(int argc, char * argv[]) { - if(argc != 7) + if (argc != 7) { - std::cerr<<"Usage: "<<argv[0]<<" infname outprefix nbBins radius offsetx offsety"<<std::endl; + std::cerr << "Usage: " << argv[0] << " infname outprefix nbBins radius offsetx offsety" << std::endl; return EXIT_FAILURE; } - const char * infname = argv[1]; - const char * outprefix = argv[2]; + const char * infname = argv[1]; + const char * outprefix = argv[2]; const unsigned int nbBins = atoi(argv[3]); const unsigned int radius = atoi(argv[4]); - const int offsetx = atoi(argv[5]); - const int offsety = atoi(argv[6]); + const int offsetx = atoi(argv[5]); + const int offsety = atoi(argv[6]); const unsigned int Dimension = 2; - typedef float PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; + typedef float PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; typedef otb::ScalarImageToTexturesFilter - <ImageType,ImageType> TexturesFilterType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::ImageFileWriter<ImageType> WriterType; + <ImageType, ImageType> TexturesFilterType; + typedef otb::ImageFileReader<ImageType> ReaderType; + typedef otb::ImageFileWriter<ImageType> WriterType; ReaderType::Pointer reader = ReaderType::New(); TexturesFilterType::Pointer filter = TexturesFilterType::New(); @@ -66,7 +66,7 @@ int otbScalarImageToTexturesFilter(int argc, char * argv[]) filter->SetRadius(sradius); filter->SetOffset(offset); - otb::StandardFilterWatcher watcher(filter,"Textures filter"); + otb::StandardFilterWatcher watcher(filter, "Textures filter"); filter->SetInputImageMinimum(0); filter->SetInputImageMaximum(256); @@ -77,49 +77,49 @@ int otbScalarImageToTexturesFilter(int argc, char * argv[]) writer->SetNumberOfStreamDivisions(2); oss.str(""); - oss<<outprefix<<"Energy.tif"; + oss << outprefix << "Energy.tif"; writer->SetInput(filter->GetEnergyOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"Entropy.tif"; + oss << outprefix << "Entropy.tif"; writer->SetInput(filter->GetEntropyOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"Correlation.tif"; + oss << outprefix << "Correlation.tif"; writer->SetInput(filter->GetCorrelationOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"InverseDifferenceMoment.tif"; + oss << outprefix << "InverseDifferenceMoment.tif"; writer->SetInput(filter->GetInverseDifferenceMomentOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"Inertia.tif"; + oss << outprefix << "Inertia.tif"; writer->SetInput(filter->GetInertiaOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"ClusterShade.tif"; + oss << outprefix << "ClusterShade.tif"; writer->SetInput(filter->GetClusterShadeOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"ClusterProminence.tif"; + oss << outprefix << "ClusterProminence.tif"; writer->SetInput(filter->GetClusterProminenceOutput()); writer->SetFileName(oss.str()); writer->Update(); oss.str(""); - oss<<outprefix<<"HaralickCorrelation.tif"; + oss << outprefix << "HaralickCorrelation.tif"; writer->SetInput(filter->GetHaralickCorrelationOutput()); writer->SetFileName(oss.str()); writer->Update(); diff --git a/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilterNew.cxx b/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilterNew.cxx index 0aefa06705..90ad58604b 100644 --- a/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbScalarImageToTexturesFilterNew.cxx @@ -23,9 +23,9 @@ int otbScalarImageToTexturesFilterNew(int argc, char * argv[]) { const unsigned int Dimension = 2; - typedef double PixelType; - typedef otb::Image<PixelType, Dimension> ImageType; - typedef otb::ScalarImageToTexturesFilter<ImageType,ImageType> FilterType; + typedef double PixelType; + typedef otb::Image<PixelType, Dimension> ImageType; + typedef otb::ScalarImageToTexturesFilter<ImageType, ImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbTextureFunctorBase.cxx b/Testing/Code/FeatureExtraction/otbTextureFunctorBase.cxx index 2c954d5cff..f22e2c14d2 100644 --- a/Testing/Code/FeatureExtraction/otbTextureFunctorBase.cxx +++ b/Testing/Code/FeatureExtraction/otbTextureFunctorBase.cxx @@ -64,7 +64,7 @@ int otbTextureFunctorBase(int argc, char * argv[]) typedef itk::ConstNeighborhoodIterator<ImageType> IterType; typedef TextureFunctorTest<InputPixelType, InputPixelType> FunctorType; typedef otb::UnaryFunctorNeighborhoodWithOffsetImageFilter<ImageType, ImageType, - FunctorType> UnaryFunctorNeighborhoodImageFilterType; + FunctorType> UnaryFunctorNeighborhoodImageFilterType; // Instantiating object UnaryFunctorNeighborhoodImageFilterType::Pointer object = UnaryFunctorNeighborhoodImageFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.cxx b/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.cxx index d068c34991..998b019323 100644 --- a/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilter.cxx @@ -36,7 +36,7 @@ int otbUrbanAreaDetectionImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::UrbanAreaDetectionImageFilter<InputVectorImageType, - OutputImageType> UrbanAreaDetectionFilterType; + OutputImageType> UrbanAreaDetectionFilterType; // Instantiating objects UrbanAreaDetectionFilterType::Pointer filter = UrbanAreaDetectionFilterType::New(); diff --git a/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilterNew.cxx b/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilterNew.cxx index c0dbd5acba..ae493266a3 100644 --- a/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilterNew.cxx +++ b/Testing/Code/FeatureExtraction/otbUrbanAreaDetectionImageFilterNew.cxx @@ -29,7 +29,7 @@ int otbUrbanAreaDetectionImageFilterNew(int argc, char * argv[]) typedef otb::Image<unsigned char, Dimension> OutputImageType; typedef otb::UrbanAreaDetectionImageFilter<InputVectorImageType, - OutputImageType> UrbanAreaDetectionFilterType; + OutputImageType> UrbanAreaDetectionFilterType; // Instantiating objects UrbanAreaDetectionFilterType::Pointer filter = UrbanAreaDetectionFilterType::New(); diff --git a/Testing/Code/Fusion/otbBayesianFusionFilter.cxx b/Testing/Code/Fusion/otbBayesianFusionFilter.cxx index cd3260d105..d53294829c 100644 --- a/Testing/Code/Fusion/otbBayesianFusionFilter.cxx +++ b/Testing/Code/Fusion/otbBayesianFusionFilter.cxx @@ -35,17 +35,17 @@ int otbBayesianFusionFilter(int argc, char * argv[]) typedef double PixelType; typedef otb::VectorImage<PixelType, - Dimension> - VectorImageType; + Dimension> + VectorImageType; typedef otb::Image<PixelType, - Dimension> - PanchroImageType; + Dimension> + PanchroImageType; typedef otb::ImageFileReader<VectorImageType> - VectorReaderType; + VectorReaderType; typedef otb::ImageFileReader<PanchroImageType> - ImageReaderType; + ImageReaderType; typedef otb::StreamingImageFileWriter<VectorImageType> - VectorImageWriterType; + VectorImageWriterType; typedef otb::BayesianFusionFilter<VectorImageType, VectorImageType, PanchroImageType, VectorImageType> FilterType; VectorReaderType::Pointer multiSpectReader = VectorReaderType::New(); diff --git a/Testing/Code/Fusion/otbBayesianFusionFilterNew.cxx b/Testing/Code/Fusion/otbBayesianFusionFilterNew.cxx index 389838a4bb..662c75dffe 100644 --- a/Testing/Code/Fusion/otbBayesianFusionFilterNew.cxx +++ b/Testing/Code/Fusion/otbBayesianFusionFilterNew.cxx @@ -30,15 +30,15 @@ int otbBayesianFusionFilterNew(int argc, char * argv[]) typedef double PixelType; typedef otb::VectorImage<PixelType, - Dimension> - VectorImageType; + Dimension> + VectorImageType; typedef otb::Image<PixelType, - Dimension> - PanchroImageType; + Dimension> + PanchroImageType; typedef otb::ImageFileReader<VectorImageType> - VectorReaderType; + VectorReaderType; typedef otb::ImageFileReader<PanchroImageType> - ImageReaderType; + ImageReaderType; typedef otb::BayesianFusionFilter<VectorImageType, VectorImageType, PanchroImageType, VectorImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/Fusion/otbFusionImageBaseNew.cxx b/Testing/Code/Fusion/otbFusionImageBaseNew.cxx index ea61be3a03..57914777b3 100644 --- a/Testing/Code/Fusion/otbFusionImageBaseNew.cxx +++ b/Testing/Code/Fusion/otbFusionImageBaseNew.cxx @@ -50,14 +50,14 @@ int otbFusionImageBaseNew(int argc, char * argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef otb::FusionImageBase<InputMultiSpectralImageType, - InputMultiSpectralInterpImageType, - InputPanchroImageType, - OutputImageType, - Functor::NewFunctorTest<InputMultiSpectralImageType::PixelType, - InputMultiSpectralInterpImageType::PixelType, - InputPanchroImageType::PixelType, - OutputImageType::PixelType> - > FusionImageBaseType; + InputMultiSpectralInterpImageType, + InputPanchroImageType, + OutputImageType, + Functor::NewFunctorTest<InputMultiSpectralImageType::PixelType, + InputMultiSpectralInterpImageType::PixelType, + InputPanchroImageType::PixelType, + OutputImageType::PixelType> + > FusionImageBaseType; // Instantiation FusionImageBaseType::Pointer base = FusionImageBaseType::New(); diff --git a/Testing/Code/IO/otbImageFileReaderERS.cxx b/Testing/Code/IO/otbImageFileReaderERS.cxx index 2619fc9e7b..e4cf9e7d1b 100644 --- a/Testing/Code/IO/otbImageFileReaderERS.cxx +++ b/Testing/Code/IO/otbImageFileReaderERS.cxx @@ -55,7 +55,7 @@ int otbImageFileReaderERS(int argc, char* argv[]) complexReader->SetFileName(inputFilename); typedef otb::MultiChannelExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/IO/otbImageFileReaderMSTAR.cxx b/Testing/Code/IO/otbImageFileReaderMSTAR.cxx index c88382ac7d..2eb7a44337 100644 --- a/Testing/Code/IO/otbImageFileReaderMSTAR.cxx +++ b/Testing/Code/IO/otbImageFileReaderMSTAR.cxx @@ -96,7 +96,7 @@ int otbImageFileReaderMSTAR(int argc, char* argv[]) } typedef itk::RescaleIntensityImageFilter<InternalImageType, - OutputImageType> RescalerType; + OutputImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); rescaler->SetOutputMinimum(itk::NumericTraits<OutputPixelType>::min()); diff --git a/Testing/Code/IO/otbImageFileReaderONERA.cxx b/Testing/Code/IO/otbImageFileReaderONERA.cxx index 53be5a7904..7dc912b3f6 100644 --- a/Testing/Code/IO/otbImageFileReaderONERA.cxx +++ b/Testing/Code/IO/otbImageFileReaderONERA.cxx @@ -46,7 +46,7 @@ int otbImageFileReaderONERATest(int argc, char* argv[]) ReaderType::Pointer Reader = ReaderType::New(); typedef otb::MultiChannelExtractROI<OutputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/IO/otbImageFileReaderONERAComplex.cxx b/Testing/Code/IO/otbImageFileReaderONERAComplex.cxx index 7a917e2e37..836652272a 100644 --- a/Testing/Code/IO/otbImageFileReaderONERAComplex.cxx +++ b/Testing/Code/IO/otbImageFileReaderONERAComplex.cxx @@ -51,7 +51,7 @@ int otbImageFileReaderONERAComplex(int argc, char* argv[]) Reader->SetFileName(inputFilename); typedef otb::ExtractROI<InputPixelType, - InputPixelType> ExtractROIFilterType; + InputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); @@ -62,9 +62,9 @@ int otbImageFileReaderONERAComplex(int argc, char* argv[]) extractROIFilter->SetInput(Reader->GetOutput()); typedef itk::ComplexToRealImageFilter< - InputImageType, OutputImageType> RealFilterType; + InputImageType, OutputImageType> RealFilterType; typedef itk::ComplexToImaginaryImageFilter< - InputImageType, OutputImageType> ImagFilterType; + InputImageType, OutputImageType> ImagFilterType; RealFilterType::Pointer realFilter = RealFilterType::New(); realFilter->SetInput(extractROIFilter->GetOutput()); diff --git a/Testing/Code/IO/otbImageFileReaderRADComplexFloatExtract.cxx b/Testing/Code/IO/otbImageFileReaderRADComplexFloatExtract.cxx index 6aeeee63c5..607b613c23 100644 --- a/Testing/Code/IO/otbImageFileReaderRADComplexFloatExtract.cxx +++ b/Testing/Code/IO/otbImageFileReaderRADComplexFloatExtract.cxx @@ -50,7 +50,7 @@ int otbImageFileReaderRADComplexFloatExtract(int argc, char* argv[]) writer->SetFileName(outputFilename); typedef otb::ExtractROI<InputPixelType, - OutputPixelType> ExtractROIFilterType; + OutputPixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/IO/otbImageFileReaderTestSensorPixelValue.cxx b/Testing/Code/IO/otbImageFileReaderTestSensorPixelValue.cxx index 55eb64587b..cf6a55b63a 100644 --- a/Testing/Code/IO/otbImageFileReaderTestSensorPixelValue.cxx +++ b/Testing/Code/IO/otbImageFileReaderTestSensorPixelValue.cxx @@ -29,10 +29,9 @@ #include <string> #include <algorithm> - int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) { - if (argc < 9) + if (argc < 9) { std::cerr << "Missing Parameters " << std::endl; std::cerr << "Usage: " << argv[0]; @@ -42,11 +41,11 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) return 1; } // Verify the number of parameters in the command line - const char * inputFilename = argv[1]; - const std::string baselineFilename = argv[2]; - const std::string sensorType = argv[3]; - const std::string sensorName = argv[4]; - const std::string sensorMode = argv[5]; + const char * inputFilename = argv[1]; + const std::string baselineFilename = argv[2]; + const std::string sensorType = argv[3]; + const std::string sensorName = argv[4]; + const std::string sensorMode = argv[5]; const unsigned int nbBands = atoi(argv[6]); const unsigned int indexX = atoi(argv[7]); @@ -57,13 +56,13 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) typedef otb::VectorImage<InputPixelType, Dimension> ImageType; typedef otb::ImageFileReader<ImageType> ReaderType; - + ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(inputFilename); reader->UpdateOutputInformation(); - ConfigFile * pixelValuesConfig; + ConfigFile * pixelValuesConfig; try { @@ -74,7 +73,7 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) itkGenericExceptionMacro(<< "Error - File '" << e.filename << "' not found."); } std::string paramName; - + std::string key; key += sensorType; key += "_"; @@ -84,8 +83,8 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) key += "_"; std::stringstream out; - out << nbBands << "_" ; - out << indexX << "_" ; + out << nbBands << "_"; + out << indexX << "_"; out << indexY; key += out.str(); std::transform(key.begin(), key.end(), key.begin(), (int (*)(int))toupper); @@ -102,7 +101,7 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) { itkGenericExceptionMacro(<< "Error - Key '" << e.key << "' not found."); } - + ImageType::IndexType index; index[0] = indexX; index[1] = indexY; @@ -114,26 +113,26 @@ int otbImageFileReaderTestSensorPixelValue(int argc, char* argv[]) ImageType::RegionType region; region.SetSize(size); region.SetIndex(index); - + reader->GetOutput()->UpdateOutputInformation(); reader->GetOutput()->SetRequestedRegion(region); reader->GetOutput()->PropagateRequestedRegion(); reader->GetOutput()->UpdateOutputData(); - - ImageType::PixelType pixelValue = reader->GetOutput()->GetPixel(index); + + ImageType::PixelType pixelValue = reader->GetOutput()->GetPixel(index); ImageType::PixelType::ValueType imagePixelValue; imagePixelValue = pixelValue[nbBands - 1]; otbGenericMsgDebugMacro(<< "Pixel value in image " << imagePixelValue); - + double epsilon = 0.0000000001; double error = vcl_abs(imagePixelValue - baselinePixelValue); - if ( error < epsilon ) + if (error < epsilon) { - return EXIT_SUCCESS; + return EXIT_SUCCESS; } - else + else { - return EXIT_FAILURE; + return EXIT_FAILURE; } } diff --git a/Testing/Code/IO/otbImageFileWriterONERAComplex.cxx b/Testing/Code/IO/otbImageFileWriterONERAComplex.cxx index da7dc391f7..6efd9cd7cb 100644 --- a/Testing/Code/IO/otbImageFileWriterONERAComplex.cxx +++ b/Testing/Code/IO/otbImageFileWriterONERAComplex.cxx @@ -46,7 +46,7 @@ int otbImageFileWriterONERAComplex(int argc, char* argv[]) complexReader->SetFileName(inputFilename); typedef otb::ExtractROI<PixelType, - PixelType> ExtractROIFilterType; + PixelType> ExtractROIFilterType; ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); diff --git a/Testing/Code/IO/otbImageMetadataInterfaceTest.cxx b/Testing/Code/IO/otbImageMetadataInterfaceTest.cxx index 64b69a6953..253b77be08 100644 --- a/Testing/Code/IO/otbImageMetadataInterfaceTest.cxx +++ b/Testing/Code/IO/otbImageMetadataInterfaceTest.cxx @@ -55,13 +55,14 @@ int otbImageMetadataInterfaceTest(int argc, char* argv[]) file << "GetPhysicalBias: " << lImageMetadata->GetPhysicalBias(reader->GetOutput()->GetMetaDataDictionary()) << std::endl; try - { - file << "GetMinute: " << lImageMetadata->GetMinute(reader->GetOutput()->GetMetaDataDictionary()) << std::endl; - } - catch(itk::ExceptionObject &excep) - { + { + file << "GetMinute: " << lImageMetadata->GetMinute(reader->GetOutput()->GetMetaDataDictionary()) << + std::endl; + } + catch (itk::ExceptionObject& excep) + { std::cerr << excep.GetDescription() << endl; - } + } file << "GetHour: " << lImageMetadata->GetHour(reader->GetOutput()->GetMetaDataDictionary()) << std::endl; file << "GetDay: " << lImageMetadata->GetDay(reader->GetOutput()->GetMetaDataDictionary()) << std::endl; diff --git a/Testing/Code/IO/otbTileMapWriter.cxx b/Testing/Code/IO/otbTileMapWriter.cxx index 9ed7a828bc..706a399827 100644 --- a/Testing/Code/IO/otbTileMapWriter.cxx +++ b/Testing/Code/IO/otbTileMapWriter.cxx @@ -107,7 +107,7 @@ int otbTileMapWriter(int argc, char *argv[]) lonLatLR = mapProjection->TransformPoint(pointLRexact); typedef otb::PerBandVectorImageFilter<VectorImageType, - DoubleVectorImageType, OrthoRectifFilterType> VectorOrthoRectifFilterType; + DoubleVectorImageType, OrthoRectifFilterType> VectorOrthoRectifFilterType; OrthoRectifFilterType::Pointer orthoRectifXS = OrthoRectifFilterType::New(); diff --git a/Testing/Code/IO/otbVectorDataFileWriterMultiPolygons.cxx b/Testing/Code/IO/otbVectorDataFileWriterMultiPolygons.cxx index 0c07b0f35a..8b4642ef88 100644 --- a/Testing/Code/IO/otbVectorDataFileWriterMultiPolygons.cxx +++ b/Testing/Code/IO/otbVectorDataFileWriterMultiPolygons.cxx @@ -30,7 +30,7 @@ int otbVectorDataFileWriterMultiPolygons(int argc, char * argv[]) typedef DataNodeType::PointType PointType; typedef DataNodeType::LineType LineType; typedef DataNodeType::PolygonType PolygonType; - typedef DataNodeType::PolygonListType PolygonListType; + typedef DataNodeType::PolygonListType PolygonListType; typedef LineType::VertexType VertexType; //Instantiation @@ -57,7 +57,6 @@ int otbVectorDataFileWriterMultiPolygons(int argc, char * argv[]) polygon5->SetNodeId("FEATURE_MULTIPOLYGON"); polygon1->SetNodeId("FEATURE_POLYGON"); polygon2->SetNodeId("FEATURE_POLYGON"); - VertexType p1; p1.Fill(5); @@ -73,14 +72,12 @@ int otbVectorDataFileWriterMultiPolygons(int argc, char * argv[]) p4[0] = 1; p4[1] = 15; - PolygonType::Pointer poly = PolygonType::New(); poly->AddVertex(p1); poly->AddVertex(p2); poly->AddVertex(p3); polygon1->SetPolygonExteriorRing(poly); - PolygonType::Pointer poly1 = PolygonType::New(); poly1->AddVertex(p1); poly1->AddVertex(p4); @@ -95,10 +92,9 @@ int otbVectorDataFileWriterMultiPolygons(int argc, char * argv[]) data->GetDataTree()->Add(document, root); data->GetDataTree()->Add(folder, document); data->GetDataTree()->Add(polygon5, folder); - data->GetDataTree()->Add(polygon1,polygon5); - data->GetDataTree()->Add(polygon2,polygon5); - data->GetDataTree()->Add(polygon3,polygon5); - + data->GetDataTree()->Add(polygon1, polygon5); + data->GetDataTree()->Add(polygon2, polygon5); + data->GetDataTree()->Add(polygon3, polygon5); writer->SetFileName(argv[1]); writer->SetInput(data); diff --git a/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx b/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx index cfbcffca2c..11a446d149 100644 --- a/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx +++ b/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx @@ -22,55 +22,54 @@ int otbConfusionMatrixCalculatorNew(int argc, char* argv[]) { - typedef itk::VariableLengthVector<int> PLabelType; - typedef itk::Statistics::ListSample<PLabelType> PListLabelType; - typedef itk::FixedArray<int, 1> RLabelType; - typedef itk::Statistics::ListSample<RLabelType> RListLabelType; - typedef otb::ConfusionMatrixCalculator< RListLabelType, - PListLabelType > CalculatorType; + typedef itk::VariableLengthVector<int> PLabelType; + typedef itk::Statistics::ListSample<PLabelType> PListLabelType; + typedef itk::FixedArray<int, 1> RLabelType; + typedef itk::Statistics::ListSample<RLabelType> RListLabelType; + typedef otb::ConfusionMatrixCalculator<RListLabelType, + PListLabelType> CalculatorType; CalculatorType::Pointer calculator = CalculatorType::New(); - + return EXIT_SUCCESS; } int otbConfusionMatrixCalculatorSetListSamples(int argc, char* argv[]) { - if( argc!= 3) + if (argc != 3) { std::cerr << "Usage: " << argv[0] << " nbSamples nbClasses " << std::endl; return EXIT_FAILURE; } - typedef itk::VariableLengthVector<int> PLabelType; - typedef itk::Statistics::ListSample<PLabelType> PListLabelType; - typedef itk::FixedArray<int, 1> RLabelType; - typedef itk::Statistics::ListSample<RLabelType> RListLabelType; - typedef otb::ConfusionMatrixCalculator< RListLabelType, - PListLabelType > CalculatorType; - + typedef itk::VariableLengthVector<int> PLabelType; + typedef itk::Statistics::ListSample<PLabelType> PListLabelType; + typedef itk::FixedArray<int, 1> RLabelType; + typedef itk::Statistics::ListSample<RLabelType> RListLabelType; + typedef otb::ConfusionMatrixCalculator<RListLabelType, + PListLabelType> CalculatorType; + CalculatorType::Pointer calculator = CalculatorType::New(); - RListLabelType::Pointer refLabels = RListLabelType::New(); - PListLabelType::Pointer prodLabels = PListLabelType::New(); + RListLabelType::Pointer refLabels = RListLabelType::New(); + PListLabelType::Pointer prodLabels = PListLabelType::New(); int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - - for(int i=0; i<nbSamples; i++) + for (int i = 0; i < nbSamples; i++) { - int label = (i%nbClasses)+1; + int label = (i % nbClasses) + 1; PLabelType plab; plab.SetSize(1); plab[0] = label; - refLabels->PushBack( label ); - prodLabels->PushBack( plab ); + refLabels->PushBack(label); + prodLabels->PushBack(plab); } - calculator->SetReferenceLabels( refLabels ); - calculator->SetProducedLabels( prodLabels ); + calculator->SetReferenceLabels(refLabels); + calculator->SetProducedLabels(prodLabels); return EXIT_SUCCESS; } @@ -78,45 +77,44 @@ int otbConfusionMatrixCalculatorSetListSamples(int argc, char* argv[]) int otbConfusionMatrixCalculatorWrongSize(int argc, char* argv[]) { - if( argc!= 3) + if (argc != 3) { std::cerr << "Usage: " << argv[0] << " nbSamples nbClasses " << std::endl; return EXIT_FAILURE; } - typedef itk::VariableLengthVector<int> PLabelType; - typedef itk::Statistics::ListSample<PLabelType> PListLabelType; - typedef itk::FixedArray<int, 1> RLabelType; - typedef itk::Statistics::ListSample<RLabelType> RListLabelType; - typedef otb::ConfusionMatrixCalculator< RListLabelType, - PListLabelType > CalculatorType; + typedef itk::VariableLengthVector<int> PLabelType; + typedef itk::Statistics::ListSample<PLabelType> PListLabelType; + typedef itk::FixedArray<int, 1> RLabelType; + typedef itk::Statistics::ListSample<RLabelType> RListLabelType; + typedef otb::ConfusionMatrixCalculator<RListLabelType, + PListLabelType> CalculatorType; CalculatorType::Pointer calculator = CalculatorType::New(); RListLabelType::Pointer refLabels = RListLabelType::New(); - PListLabelType::Pointer prodLabels = PListLabelType::New(); + PListLabelType::Pointer prodLabels = PListLabelType::New(); int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - - for(int i=0; i<nbSamples; i++) + for (int i = 0; i < nbSamples; i++) { - int label = (i%nbClasses)+1; + int label = (i % nbClasses) + 1; PLabelType plab; plab.SetSize(1); plab[0] = label; - refLabels->PushBack( label ); - prodLabels->PushBack( plab ); + refLabels->PushBack(label); + prodLabels->PushBack(plab); } PLabelType plab; plab.SetSize(1); plab[0] = 0; - prodLabels->PushBack( plab ); - - calculator->SetReferenceLabels( refLabels ); - calculator->SetProducedLabels( prodLabels ); + prodLabels->PushBack(plab); + + calculator->SetReferenceLabels(refLabels); + calculator->SetProducedLabels(prodLabels); try { @@ -126,58 +124,55 @@ int otbConfusionMatrixCalculatorWrongSize(int argc, char* argv[]) { return EXIT_FAILURE; } - + return EXIT_SUCCESS; } - int otbConfusionMatrixCalculatorUpdate(int argc, char* argv[]) { - if( argc!= 3) + if (argc != 3) { std::cerr << "Usage: " << argv[0] << " nbSamples nbClasses " << std::endl; return EXIT_FAILURE; } - typedef itk::VariableLengthVector<int> PLabelType; - typedef itk::Statistics::ListSample<PLabelType> PListLabelType; - typedef itk::FixedArray<int, 1> RLabelType; - typedef itk::Statistics::ListSample<RLabelType> RListLabelType; - typedef otb::ConfusionMatrixCalculator< RListLabelType, - PListLabelType > CalculatorType; + typedef itk::VariableLengthVector<int> PLabelType; + typedef itk::Statistics::ListSample<PLabelType> PListLabelType; + typedef itk::FixedArray<int, 1> RLabelType; + typedef itk::Statistics::ListSample<RLabelType> RListLabelType; + typedef otb::ConfusionMatrixCalculator<RListLabelType, + PListLabelType> CalculatorType; CalculatorType::Pointer calculator = CalculatorType::New(); RListLabelType::Pointer refLabels = RListLabelType::New(); - PListLabelType::Pointer prodLabels = PListLabelType::New(); + PListLabelType::Pointer prodLabels = PListLabelType::New(); int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - - for(int i=0; i<nbSamples; i++) + for (int i = 0; i < nbSamples; i++) { - int label = (i%nbClasses)+1; + int label = (i % nbClasses) + 1; PLabelType plab; plab.SetSize(1); plab[0] = label; - refLabels->PushBack( label ); - prodLabels->PushBack( plab ); + refLabels->PushBack(label); + prodLabels->PushBack(plab); } - - calculator->SetReferenceLabels( refLabels ); - calculator->SetProducedLabels( prodLabels ); + calculator->SetReferenceLabels(refLabels); + calculator->SetProducedLabels(prodLabels); calculator->Update(); - if( static_cast<int>(calculator->GetNumberOfClasses()) != nbClasses ) + if (static_cast<int>(calculator->GetNumberOfClasses()) != nbClasses) { std::cerr << "Wrong number of classes" << std::endl; return EXIT_FAILURE; } - if( static_cast<int>(calculator->GetNumberOfSamples()) != nbSamples ) + if (static_cast<int>(calculator->GetNumberOfSamples()) != nbSamples) { std::cerr << "Wrong number of samples" << std::endl; return EXIT_FAILURE; @@ -191,33 +186,29 @@ int otbConfusionMatrixCalculatorUpdate(int argc, char* argv[]) for (int j = 0; j < nbClasses; j++) { double goodValue = 0.0; - if (i == j) - goodValue = nbSamples / nbClasses; + if (i == j) goodValue = nbSamples / nbClasses; else - if (confmat(i, j) != goodValue) - totalError += confmat(i, j); + if (confmat(i, j) != goodValue) totalError += confmat(i, j); } - if( totalError > 0.001 ) + if (totalError > 0.001) { std::cerr << confmat << std::endl; - std::cerr<< "Error = " << totalError << std::endl; + std::cerr << "Error = " << totalError << std::endl; return EXIT_FAILURE; } - if( calculator->GetKappaIndex() != 1.0 ) + if (calculator->GetKappaIndex() != 1.0) { - std::cerr<< "Kappa = " << calculator->GetKappaIndex() << std::endl; + std::cerr << "Kappa = " << calculator->GetKappaIndex() << std::endl; return EXIT_FAILURE; } - if( calculator->GetOverallAccuracy() != 1.0 ) + if (calculator->GetOverallAccuracy() != 1.0) { - std::cerr<< "OA = " << calculator->GetOverallAccuracy() << std::endl; + std::cerr << "OA = " << calculator->GetOverallAccuracy() << std::endl; return EXIT_FAILURE; } - - return EXIT_SUCCESS; } diff --git a/Testing/Code/Learning/otbListSampleGenerator.cxx b/Testing/Code/Learning/otbListSampleGenerator.cxx index 0869918a64..fa211fa1cf 100644 --- a/Testing/Code/Learning/otbListSampleGenerator.cxx +++ b/Testing/Code/Learning/otbListSampleGenerator.cxx @@ -39,21 +39,20 @@ int otbListSampleGenerator(int argc, char* argv[]) if (argc != 8) { - std::cerr << "Usage: " << argv[0] << " inputImage inputVectorData outputTrainingFile outputValidationFile" - << " maxTrainingSize maxValidationSize validationTrainingProportion" - << std::endl; + std::cerr << "Usage: " << argv[0] << " inputImage inputVectorData outputTrainingFile outputValidationFile" + << " maxTrainingSize maxValidationSize validationTrainingProportion" + << std::endl; return EXIT_FAILURE; } - std::string imageFilename = argv[1]; std::string vectorDataFilename = argv[2]; std::string outputSampleList = argv[3]; std::string outputSampleListValidation = argv[4]; - int maxTrainingSize = atoi(argv[5]); - int maxValidationSize = atoi(argv[6]); - double validationTrainingProportion = atof(argv[7]); - + int maxTrainingSize = atoi(argv[5]); + int maxValidationSize = atoi(argv[6]); + double validationTrainingProportion = atof(argv[7]); + std::string classKey = "Class"; typedef double PixelType; @@ -89,18 +88,18 @@ int otbListSampleGenerator(int argc, char* argv[]) std::cout << "Number of classes: " << generator->GetNumberOfClasses() << std::endl; - { + { ListSampleGeneratorType::ListSamplePointerType samples = generator->GetTrainingListSample(); - ListSampleGeneratorType::ListLabelPointerType labels = generator->GetTrainingListLabel(); + ListSampleGeneratorType::ListLabelPointerType labels = generator->GetTrainingListLabel(); typedef ListSampleGeneratorType::ListSampleType::ConstIterator SampleIterator; - typedef ListSampleGeneratorType::ListLabelType::ConstIterator LabelIterator; + typedef ListSampleGeneratorType::ListLabelType::ConstIterator LabelIterator; std::ofstream trainingFile; trainingFile.open(outputSampleList.c_str()); SampleIterator sampleIt = samples->Begin(); - LabelIterator labelIt = labels->Begin(); + LabelIterator labelIt = labels->Begin(); while (sampleIt != samples->End()) { trainingFile << labelIt.GetMeasurementVector()[0]; @@ -120,16 +119,16 @@ int otbListSampleGenerator(int argc, char* argv[]) { ListSampleGeneratorType::ListSamplePointerType samples = generator->GetValidationListSample(); - ListSampleGeneratorType::ListLabelPointerType labels = generator->GetValidationListLabel(); + ListSampleGeneratorType::ListLabelPointerType labels = generator->GetValidationListLabel(); typedef ListSampleGeneratorType::ListSampleType::ConstIterator SampleIterator; - typedef ListSampleGeneratorType::ListLabelType::ConstIterator LabelIterator; + typedef ListSampleGeneratorType::ListLabelType::ConstIterator LabelIterator; std::ofstream validationFile; validationFile.open(outputSampleListValidation.c_str()); SampleIterator sampleIt = samples->Begin(); - LabelIterator labelIt = labels->Begin(); + LabelIterator labelIt = labels->Begin(); while (sampleIt != samples->End()) { validationFile << labelIt.GetMeasurementVector()[0]; @@ -145,6 +144,6 @@ int otbListSampleGenerator(int argc, char* argv[]) validationFile.close(); } - - return EXIT_SUCCESS; + + return EXIT_SUCCESS; } diff --git a/Testing/Code/Learning/otbSOMWithMissingValueNew.cxx b/Testing/Code/Learning/otbSOMWithMissingValueNew.cxx index a2dc08bfcb..75e00b51a2 100644 --- a/Testing/Code/Learning/otbSOMWithMissingValueNew.cxx +++ b/Testing/Code/Learning/otbSOMWithMissingValueNew.cxx @@ -43,7 +43,7 @@ int otbSOMWithMissingValueNew(int argc, char * argv[]) typedef otb::Functor::CzihoSOMLearningBehaviorFunctor LearningBehaviorFunctorType; typedef otb::Functor::CzihoSOMNeighborhoodBehaviorFunctor NeighborhoodBehaviorFunctorType; typedef otb::SOMWithMissingValue<SampleListType, MapType, - LearningBehaviorFunctorType, NeighborhoodBehaviorFunctorType> SOMType; + LearningBehaviorFunctorType, NeighborhoodBehaviorFunctorType> SOMType; SOMType::Pointer som = SOMType::New(); diff --git a/Testing/Code/Learning/otbSVMClassifierImage.cxx b/Testing/Code/Learning/otbSVMClassifierImage.cxx index 274bac9364..91108d8e4e 100644 --- a/Testing/Code/Learning/otbSVMClassifierImage.cxx +++ b/Testing/Code/Learning/otbSVMClassifierImage.cxx @@ -165,7 +165,7 @@ int otbSVMClassifierImage(int argc, char* argv[]) typedef otb::Image<unsigned char, Dimension> FileImageType; typedef itk::RescaleIntensityImageFilter<OutputImageType, - FileImageType> RescalerType; + FileImageType> RescalerType; RescalerType::Pointer rescaler = RescalerType::New(); diff --git a/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx b/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx index 5f30e66da0..acde097ddd 100644 --- a/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx +++ b/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx @@ -45,7 +45,7 @@ int otbSVMImageModelEstimatorModelAccessor(int argc, char* argv[]) typedef otb::Image<int, Dimension> TrainingImageType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; typedef otb::ImageFileReader<InputImageType> InputReaderType; typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; diff --git a/Testing/Code/Learning/otbSVMImageModelEstimatorNew.cxx b/Testing/Code/Learning/otbSVMImageModelEstimatorNew.cxx index 83f2903cd0..109f7d795a 100644 --- a/Testing/Code/Learning/otbSVMImageModelEstimatorNew.cxx +++ b/Testing/Code/Learning/otbSVMImageModelEstimatorNew.cxx @@ -39,7 +39,7 @@ int otbSVMImageModelEstimatorNew(int argc, char* argv[]) typedef std::vector<double> VectorType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; EstimatorType::Pointer svmModel = EstimatorType::New(); diff --git a/Testing/Code/Learning/otbSVMImageModelEstimatorTrain.cxx b/Testing/Code/Learning/otbSVMImageModelEstimatorTrain.cxx index 9889cf7fa1..756f6b0248 100644 --- a/Testing/Code/Learning/otbSVMImageModelEstimatorTrain.cxx +++ b/Testing/Code/Learning/otbSVMImageModelEstimatorTrain.cxx @@ -42,7 +42,7 @@ int otbSVMImageModelEstimatorTrain(int argc, char* argv[]) typedef otb::Image<int, Dimension> TrainingImageType; typedef std::vector<double> VectorType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; typedef otb::ImageFileReader<InputImageType> InputReaderType; typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; diff --git a/Testing/Code/Learning/otbSVMImageModelEstimatorTrainOneClass.cxx b/Testing/Code/Learning/otbSVMImageModelEstimatorTrainOneClass.cxx index 633d516037..4cee90dca4 100644 --- a/Testing/Code/Learning/otbSVMImageModelEstimatorTrainOneClass.cxx +++ b/Testing/Code/Learning/otbSVMImageModelEstimatorTrainOneClass.cxx @@ -41,7 +41,7 @@ int otbSVMImageModelEstimatorTrainOneClass(int argc, char* argv[]) typedef otb::Image<int, Dimension> TrainingImageType; typedef std::vector<double> VectorType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; + TrainingImageType> EstimatorType; typedef otb::ImageFileReader<InputImageType> InputReaderType; typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; diff --git a/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest.cxx b/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest.cxx index 78dcf0887c..0f06206df1 100644 --- a/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest.cxx +++ b/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest.cxx @@ -39,15 +39,15 @@ int otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest(int argc, const char* trainingImageFileName = argv[2]; const char* outputModelFileName = argv[3]; - typedef double InputPixelType; - const unsigned int Dimension = 2; + typedef double InputPixelType; + const unsigned int Dimension = 2; typedef otb::VectorImage<InputPixelType, Dimension> InputImageType; typedef otb::Image<int, Dimension> TrainingImageType; typedef std::vector<double> VectorType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; - typedef otb::ImageFileReader<InputImageType> InputReaderType; - typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; + TrainingImageType> EstimatorType; + typedef otb::ImageFileReader<InputImageType> InputReaderType; + typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; InputReaderType::Pointer inputReader = InputReaderType::New(); TrainingReaderType::Pointer trainingReader = TrainingReaderType::New(); @@ -75,7 +75,7 @@ int otbSVMInverseCosSpectralAngleKernelFunctorImageClassificationTest(int argc, svmEstimator->GetModel()->SaveModel(outputModelFileName); typedef otb::SVMImageClassificationFilter<InputImageType, - TrainingImageType> ClassifierType; + TrainingImageType> ClassifierType; ClassifierType::Pointer classifier = ClassifierType::New(); diff --git a/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageModelEstimatorTest.cxx b/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageModelEstimatorTest.cxx index f47e1acecc..c63c5c4d99 100644 --- a/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageModelEstimatorTest.cxx +++ b/Testing/Code/Learning/otbSVMInverseCosSpectralAngleKernelFunctorImageModelEstimatorTest.cxx @@ -38,15 +38,15 @@ int otbSVMInverseCosSpectralAngleKernelFunctorImageModelEstimatorTest(int argc, const char* trainingImageFileName = argv[2]; const char* outputModelFileName = argv[3]; - typedef double InputPixelType; - const unsigned int Dimension = 2; + typedef double InputPixelType; + const unsigned int Dimension = 2; typedef otb::VectorImage<InputPixelType, Dimension> InputImageType; typedef otb::Image<int, Dimension> TrainingImageType; typedef std::vector<double> VectorType; typedef otb::SVMImageModelEstimator<InputImageType, - TrainingImageType> EstimatorType; - typedef otb::ImageFileReader<InputImageType> InputReaderType; - typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; + TrainingImageType> EstimatorType; + typedef otb::ImageFileReader<InputImageType> InputReaderType; + typedef otb::ImageFileReader<TrainingImageType> TrainingReaderType; InputReaderType::Pointer inputReader = InputReaderType::New(); TrainingReaderType::Pointer trainingReader = TrainingReaderType::New(); diff --git a/Testing/Code/Learning/otbSVMModelAccessor.cxx b/Testing/Code/Learning/otbSVMModelAccessor.cxx index dd89d146e3..5da43e53ef 100644 --- a/Testing/Code/Learning/otbSVMModelAccessor.cxx +++ b/Testing/Code/Learning/otbSVMModelAccessor.cxx @@ -41,7 +41,6 @@ int otbSVMModelAccessor(int argc, char* argv[]) ptrModel->LoadModel(argv[1]); - std::ofstream f; unsigned int nbClass = ptrModel->GetNumberOfClasses(); unsigned int nbSupportVector = ptrModel->GetNumberOfSupportVectors(); diff --git a/Testing/Code/Learning/otbSVMPointSetModelEstimatorNew.cxx b/Testing/Code/Learning/otbSVMPointSetModelEstimatorNew.cxx index 2e7d57b7a0..6d3e0ff412 100644 --- a/Testing/Code/Learning/otbSVMPointSetModelEstimatorNew.cxx +++ b/Testing/Code/Learning/otbSVMPointSetModelEstimatorNew.cxx @@ -35,7 +35,7 @@ int otbSVMPointSetModelEstimatorNew(int argc, char* argv[]) typedef itk::PointSet<InputPixelType, Dimension> MeasurePointSetType; typedef itk::PointSet<LabelPixelType, Dimension> LabelPointSetType; typedef otb::SVMPointSetModelEstimator<MeasurePointSetType, - LabelPointSetType> EstimatorType; + LabelPointSetType> EstimatorType; EstimatorType::Pointer estimator = EstimatorType::New(); diff --git a/Testing/Code/Learning/otbSVMSampleListModelEstimatorNew.cxx b/Testing/Code/Learning/otbSVMSampleListModelEstimatorNew.cxx index 2bdfc5b051..247e5fa68c 100644 --- a/Testing/Code/Learning/otbSVMSampleListModelEstimatorNew.cxx +++ b/Testing/Code/Learning/otbSVMSampleListModelEstimatorNew.cxx @@ -33,11 +33,11 @@ int otbSVMSampleListModelEstimatorNew(int argc, char* argv[]) typedef itk::VariableLengthVector<InputPixelType> SampleType; typedef itk::Statistics::ListSample<SampleType> ListSampleType; - typedef itk::FixedArray<LabelPixelType,1> TrainingSampleType; + typedef itk::FixedArray<LabelPixelType, 1> TrainingSampleType; typedef itk::Statistics::ListSample<TrainingSampleType> TrainingListSampleType; typedef otb::SVMSampleListModelEstimator<ListSampleType, - TrainingListSampleType> EstimatorType; + TrainingListSampleType> EstimatorType; EstimatorType::Pointer estimator = EstimatorType::New(); diff --git a/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.cxx b/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.cxx index 041365d74c..88b82f2138 100644 --- a/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.cxx +++ b/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilter.cxx @@ -33,12 +33,12 @@ int otbGeodesicMorphologyDecompositionImageFilter(int argc, char * argv[]) typedef otb::Image<double, 2> ImageType; typedef itk::BinaryBallStructuringElement<double, - 2> StructuringElementType; + 2> StructuringElementType; typedef StructuringElementType::RadiusType RadiusType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::StreamingImageFileWriter<ImageType> WriterType; typedef otb::GeodesicMorphologyDecompositionImageFilter<ImageType, ImageType, - StructuringElementType> + StructuringElementType> GeodesicMorphologyDecompositionImageFilterType; // Instantiating object diff --git a/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilterNew.cxx b/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilterNew.cxx index 873fa0b051..87692a2a63 100644 --- a/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilterNew.cxx +++ b/Testing/Code/MultiScale/otbGeodesicMorphologyDecompositionImageFilterNew.cxx @@ -23,9 +23,9 @@ int otbGeodesicMorphologyDecompositionImageFilterNew(int argc, char * argv[]) { typedef otb::Image<double, 2> ImageType; typedef itk::BinaryBallStructuringElement<double, - 2> StructuringElementType; + 2> StructuringElementType; typedef otb::GeodesicMorphologyDecompositionImageFilter<ImageType, ImageType, - StructuringElementType> + StructuringElementType> GeodesicMorphologyDecompositionImageFilterType; // Instantiating object diff --git a/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.cxx b/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.cxx index 32f34128a9..1f7a9c1208 100644 --- a/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.cxx +++ b/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilter.cxx @@ -42,11 +42,11 @@ int otbGeodesicMorphologyIterativeDecompositionImageFilter(int argc, char * argv typedef otb::ImageFileWriter<InputImageType> WriterType; typedef itk::BinaryBallStructuringElement<InputPixelType, - Dimension> StructuringElementType; + Dimension> StructuringElementType; typedef otb::GeodesicMorphologyIterativeDecompositionImageFilter<InputImageType, - StructuringElementType> DecompositionImageFilterType; + StructuringElementType> DecompositionImageFilterType; typedef DecompositionImageFilterType::OutputImageListType::Iterator - ImageListIterator; + ImageListIterator; // Reading input image ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilterNew.cxx b/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilterNew.cxx index 58a90118b9..ce9926d4bf 100644 --- a/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilterNew.cxx +++ b/Testing/Code/MultiScale/otbGeodesicMorphologyIterativeDecompositionImageFilterNew.cxx @@ -29,9 +29,9 @@ int otbGeodesicMorphologyIterativeDecompositionImageFilterNew(int argc, char * a typedef otb::Image<InputPixelType, Dimension> InputImageType; typedef itk::BinaryBallStructuringElement<InputPixelType, - Dimension> StructuringElementType; + Dimension> StructuringElementType; typedef otb::GeodesicMorphologyIterativeDecompositionImageFilter<InputImageType, - StructuringElementType> DecompositionFilterType; + StructuringElementType> DecompositionFilterType; // Instantiation DecompositionFilterType::Pointer decomposition = DecompositionFilterType::New(); diff --git a/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.cxx b/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.cxx index b869eebc20..003ae03827 100644 --- a/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.cxx +++ b/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilter.cxx @@ -57,7 +57,7 @@ int otbMultiScaleConvexOrConcaveClassificationFilter(int argc, char * argv[]) typedef otb::ProfileDerivativeToMultiScaleCharacteristicsFilter<InputImageType, OutputImageType, LabeledImageType> MultiScaleCharacteristicsFilterType; typedef otb::MultiScaleConvexOrConcaveClassificationFilter<InputImageType, - LabeledImageType> MultiScaleClassificationFilterType; + LabeledImageType> MultiScaleClassificationFilterType; // Reading input image ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilterNew.cxx b/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilterNew.cxx index bbde444e58..5669545709 100644 --- a/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilterNew.cxx +++ b/Testing/Code/MultiScale/otbMultiScaleConvexOrConcaveClassificationFilterNew.cxx @@ -32,7 +32,7 @@ int otbMultiScaleConvexOrConcaveClassificationFilterNew(int argc, char * argv[]) typedef otb::Image<LabeledPixelType, 2> LabeledImageType; typedef otb::MultiScaleConvexOrConcaveClassificationFilter<InputImageType, - LabeledImageType> MultiScaleClassificationFilterType; + LabeledImageType> MultiScaleClassificationFilterType; // Instantiation MultiScaleClassificationFilterType::Pointer classificationFilter = MultiScaleClassificationFilterType::New(); diff --git a/Testing/Code/Projections/otbProjectionBaseNew.cxx b/Testing/Code/Projections/otbProjectionBaseNew.cxx index 9be9123fbc..0c1c197459 100644 --- a/Testing/Code/Projections/otbProjectionBaseNew.cxx +++ b/Testing/Code/Projections/otbProjectionBaseNew.cxx @@ -31,7 +31,7 @@ int otbProjectionBaseNew(int argc, char* argv[]) otb::AlbersInverseProjection::Pointer lAlbersProjection = otb::AlbersInverseProjection::New(); otb::AzimEquDistForwardProjection::Pointer lAzimEquDistProjection = otb::AzimEquDistForwardProjection::New(); typedef otb::MapToMapProjection<otb::AlbersInverseProjection, - otb::AzimEquDistForwardProjection> MapToMapProjectionType; + otb::AzimEquDistForwardProjection> MapToMapProjectionType; MapToMapProjectionType::Pointer lMapToMapProjection = MapToMapProjectionType::New(); return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbAVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbAVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx index 76637c8a95..d5aa6b49ff 100644 --- a/Testing/Code/Radiometry/otbAVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbAVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx @@ -32,9 +32,9 @@ int otbAVIMultiChannelRAndGAndNIRVegetationIndexImageFilter(int argc, char * arg typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::AVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef otb::MultiChannelRAndGAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndGAndNIRIndexImageFilterType; diff --git a/Testing/Code/Radiometry/otbAVIRAndGAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbAVIRAndGAndNIRVegetationIndexImageFilter.cxx index 627b65c601..733c8a6b14 100644 --- a/Testing/Code/Radiometry/otbAVIRAndGAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbAVIRAndGAndNIRVegetationIndexImageFilter.cxx @@ -38,15 +38,15 @@ int otbAVIRAndGAndNIRVegetationIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::AVI<InputRImageType::PixelType, - InputGImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputGImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef otb::RAndGAndNIRIndexImageFilter<InputRImageType, - InputGImageType, - InputNIRImageType, - OutputImageType, - FunctorType> RAndGAndNIRIndexImageFilterType; + InputGImageType, + InputNIRImageType, + OutputImageType, + FunctorType> RAndGAndNIRIndexImageFilterType; // Instantiating object RAndGAndNIRIndexImageFilterType::Pointer filter = RAndGAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx index 3969bbb7db..89a8812be6 100644 --- a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx +++ b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx @@ -48,7 +48,8 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) std::cerr << " atmosphericPressure , waterVaporAmount , ozoneAmount , aerosolModel , AerosolOptical," << std::endl; std::cerr << - " wavelengthSpectralBandFileName , adjacencyEffect6SCorrectionWindowRadius, pixelSpacingInKilometers" << std::endl; + " wavelengthSpectralBandFileName , adjacencyEffect6SCorrectionWindowRadius, pixelSpacingInKilometers" << + std::endl; std::cerr << std::endl; return 1; } @@ -201,7 +202,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) //------------------------------- typedef otb::ReflectanceToSurfaceReflectanceImageFilter<ImageType, - ImageType> ReflectanceToSurfaceReflectanceImageFilterType; + ImageType> ReflectanceToSurfaceReflectanceImageFilterType; ReflectanceToSurfaceReflectanceImageFilterType::Pointer filterReflectanceToSurfaceReflectanceImageFilter = ReflectanceToSurfaceReflectanceImageFilterType::New(); @@ -211,7 +212,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) //------------------------------- typedef otb::SurfaceAdjacencyEffect6SCorrectionSchemeFilter<ImageType, - ImageType> SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; + ImageType> SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::Pointer filterSurfaceAdjacencyEffect6SCorrectionSchemeFilter = SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::New(); diff --git a/Testing/Code/Radiometry/otbEVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbEVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx index be19dc1be3..db547cc0e4 100644 --- a/Testing/Code/Radiometry/otbEVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbEVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx @@ -79,13 +79,13 @@ int otbEVIMultiChannelRAndBAndNIRVegetationIndexImageFilter(int argc, char * arg argv++; if (strArgv == "EVI") return (generic_EVIMultiChannelRAndBAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::EVI<InputImageType:: - InternalPixelType, - InputImageType:: - InternalPixelType, - InputImageType:: - InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::EVI<InputImageType:: + InternalPixelType, + InputImageType:: + InternalPixelType, + InputImageType:: + InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbEVIRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbEVIRAndBAndNIRVegetationIndexImageFilter.cxx index 04e794ace2..9a0b8f97f2 100644 --- a/Testing/Code/Radiometry/otbEVIRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbEVIRAndBAndNIRVegetationIndexImageFilter.cxx @@ -83,11 +83,11 @@ int otbEVIRAndBAndNIRVegetationIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "EVI") return (generic_EVIRAndBAndNIRVegetationIndexImageFilter<InputRImageType, InputBImageType, InputNIRImageType, - OutputImageType, - otb::Functor::EVI<InputRImageType::PixelType, - InputBImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + OutputImageType, + otb::Functor::EVI<InputRImageType::PixelType, + InputBImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbGAndRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbGAndRIndexImageFilter.cxx index 4f71e187ed..4e2f1a43c3 100644 --- a/Testing/Code/Radiometry/otbGAndRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbGAndRIndexImageFilter.cxx @@ -67,21 +67,21 @@ int otbGAndRIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "IR") return (generic_GAndRIndexImageFilter<InputGImageType, InputRImageType, OutputImageType, - otb::Functor::IR<InputRImageType::PixelType, - InputRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::IR<InputRImageType::PixelType, + InputRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IC") return (generic_GAndRIndexImageFilter<InputGImageType, InputRImageType, OutputImageType, - otb::Functor::IC<InputGImageType::PixelType, - InputRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::IC<InputGImageType::PixelType, + InputRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IB") return (generic_GAndRIndexImageFilter<InputGImageType, InputRImageType, OutputImageType, - otb::Functor::IB<InputGImageType::PixelType, - InputRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::IB<InputGImageType::PixelType, + InputRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbIBGAndRAndNIRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbIBGAndRAndNIRIndexImageFilter.cxx index aff1bbf607..3e930a3469 100644 --- a/Testing/Code/Radiometry/otbIBGAndRAndNIRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbIBGAndRAndNIRIndexImageFilter.cxx @@ -38,16 +38,16 @@ int otbIBGAndRAndNIRIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::IB2<InputGImageType::PixelType, - InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; // Warning : the order of the channels are not the same between the functor and the filter typedef otb::RAndGAndNIRIndexImageFilter<InputRImageType, - InputGImageType, - InputNIRImageType, - OutputImageType, - FunctorType> RAndGAndNIRIndexImageFilterType; + InputGImageType, + InputNIRImageType, + OutputImageType, + FunctorType> RAndGAndNIRIndexImageFilterType; // Instantiating object RAndGAndNIRIndexImageFilterType::Pointer filter = RAndGAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbIBMultiChannelGAndRAndNIRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbIBMultiChannelGAndRAndNIRIndexImageFilter.cxx index 64ba40255e..da92ccfe32 100644 --- a/Testing/Code/Radiometry/otbIBMultiChannelGAndRAndNIRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbIBMultiChannelGAndRAndNIRIndexImageFilter.cxx @@ -32,9 +32,9 @@ int otbIBMultiChannelGAndRAndNIRIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::IB2<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; // Warning : the order of the channels are not the same between the functor and the filter typedef otb::MultiChannelRAndGAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> diff --git a/Testing/Code/Radiometry/otbISUMultiChannelRAndNIRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbISUMultiChannelRAndNIRIndexImageFilter.cxx index f2fed7c457..42111ab0c3 100644 --- a/Testing/Code/Radiometry/otbISUMultiChannelRAndNIRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbISUMultiChannelRAndNIRIndexImageFilter.cxx @@ -32,8 +32,8 @@ int otbISUMultiChannelRAndNIRIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::ISU <InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef otb::MultiChannelRAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndNIRIndexImageFilterType; diff --git a/Testing/Code/Radiometry/otbISURAndNIRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbISURAndNIRIndexImageFilter.cxx index e283f1ed2d..a821054ced 100644 --- a/Testing/Code/Radiometry/otbISURAndNIRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbISURAndNIRIndexImageFilter.cxx @@ -36,13 +36,13 @@ int otbISURAndNIRIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::ISU <InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputNIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef otb::RAndNIRIndexImageFilter<InputRImageType, - InputNIRImageType, - OutputImageType, - FunctorType> RAndNIRIndexImageFilterType; + InputNIRImageType, + OutputImageType, + FunctorType> RAndNIRIndexImageFilterType; // Instantiating object RAndNIRIndexImageFilterType::Pointer filter = RAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbLuminanceToReflectanceImageFilterAuto.cxx b/Testing/Code/Radiometry/otbLuminanceToReflectanceImageFilterAuto.cxx index 7610bf4df7..6904663df0 100644 --- a/Testing/Code/Radiometry/otbLuminanceToReflectanceImageFilterAuto.cxx +++ b/Testing/Code/Radiometry/otbLuminanceToReflectanceImageFilterAuto.cxx @@ -38,7 +38,7 @@ int otbLuminanceToReflectanceImageFilterAuto(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::ImageToLuminanceImageFilter<InputImageType, OutputImageType> ImageToLuminanceImageFilterType; typedef otb::LuminanceToReflectanceImageFilter<OutputImageType, - OutputImageType> LuminanceToReflectanceImageFilterType; + OutputImageType> LuminanceToReflectanceImageFilterType; typedef ImageToLuminanceImageFilterType::VectorType VectorType; typedef otb::MultiChannelExtractROI<PixelType, PixelType> RoiFilterType; diff --git a/Testing/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.cxx b/Testing/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.cxx index 4d02bc320f..c381cbcdb6 100644 --- a/Testing/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelGAndRIndexImageFilter.cxx @@ -64,21 +64,21 @@ int otbMultiChannelGAndRIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "IR") return (generic_MultiChannelGAndRIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::IR<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::IR<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IC") return (generic_MultiChannelGAndRIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::IC<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::IC<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IB") return (generic_MultiChannelGAndRIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::IB<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::IB<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx index 54862a6d12..bd11e8590d 100644 --- a/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx @@ -69,13 +69,13 @@ int otbMultiChannelRAndBAndNIRVegetationIndexImageFilter(int argc, char * argv[] argv++; if (strArgv == "ARVI") return (generic_MultiChannelRAndBAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::ARVI<InputImageType:: - InternalPixelType, - InputImageType:: - InternalPixelType, - InputImageType:: - InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::ARVI<InputImageType:: + InternalPixelType, + InputImageType:: + InternalPixelType, + InputImageType:: + InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; diff --git a/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilterNew.cxx b/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilterNew.cxx index 680349db96..4ae587719d 100644 --- a/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelRAndBAndNIRVegetationIndexImageFilterNew.cxx @@ -27,7 +27,7 @@ int otbMultiChannelRAndBAndNIRVegetationIndexImageFilterNew(int argc, char * arg typedef otb::VectorImage<unsigned char, Dimension> InputImageType; typedef otb::Image<float, Dimension> OutputImageType; typedef otb::MultiChannelRAndBAndNIRIndexImageFilter<InputImageType, - OutputImageType> MultiChannelRAndBAndNIRIndexImageFilterType; + OutputImageType> MultiChannelRAndBAndNIRIndexImageFilterType; // Instantiating object MultiChannelRAndBAndNIRIndexImageFilterType::Pointer object = MultiChannelRAndBAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilterNew.cxx b/Testing/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilterNew.cxx index 570413e7e3..e5ed380e27 100644 --- a/Testing/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelRAndGAndNIRIndexImageFilterNew.cxx @@ -27,7 +27,7 @@ int otbMultiChannelRAndGAndNIRIndexImageFilterNew(int argc, char * argv[]) typedef otb::VectorImage<unsigned char, Dimension> InputImageType; typedef otb::Image<float, Dimension> OutputImageType; typedef otb::MultiChannelRAndGAndNIRIndexImageFilter<InputImageType, - OutputImageType> MultiChannelRAndGAndNIRIndexImageFilterType; + OutputImageType> MultiChannelRAndGAndNIRIndexImageFilterType; // Instantiating object MultiChannelRAndGAndNIRIndexImageFilterType::Pointer object = MultiChannelRAndGAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.cxx index 021c53ca9e..096982e883 100644 --- a/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilter.cxx @@ -64,59 +64,59 @@ int otbMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "NDVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::NDVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::NDVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "RVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::RVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::RVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "SAVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::SAVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::SAVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "TSAVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::TSAVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::TSAVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "MSAVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::MSAVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::MSAVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "MSAVI2") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::MSAVI2<InputImageType:: - InternalPixelType, - InputImageType:: - InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::MSAVI2<InputImageType:: + InternalPixelType, + InputImageType:: + InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "GEMI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::GEMI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::GEMI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IPVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::IPVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::IPVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "TNDVI") return (generic_MultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::TNDVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::TNDVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilterNew.cxx b/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilterNew.cxx index 220901a437..d1d72ba001 100644 --- a/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbMultiChannelRAndNIRVegetationIndexImageFilterNew.cxx @@ -27,7 +27,7 @@ int otbMultiChannelRAndNIRVegetationIndexImageFilterNew(int argc, char * argv[]) typedef otb::VectorImage<unsigned char, Dimension> InputImageType; typedef otb::Image<float, Dimension> OutputImageType; typedef otb::MultiChannelRAndNIRIndexImageFilter<InputImageType, - OutputImageType> MultiChannelRAndNIRIndexImageFilterType; + OutputImageType> MultiChannelRAndNIRIndexImageFilterType; // Instantiating object MultiChannelRAndNIRIndexImageFilterType::Pointer object = MultiChannelRAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbNDBIMultiChannelTM4AndTM5IndexImageFilter.cxx b/Testing/Code/Radiometry/otbNDBIMultiChannelTM4AndTM5IndexImageFilter.cxx index 371d83d22b..9c57f538fd 100644 --- a/Testing/Code/Radiometry/otbNDBIMultiChannelTM4AndTM5IndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbNDBIMultiChannelTM4AndTM5IndexImageFilter.cxx @@ -32,8 +32,8 @@ int otbNDBIMultiChannelTM4AndTM5IndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::NDBI <InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef itk::UnaryFunctorImageFilter<InputImageType, OutputImageType, FunctorType> UnaryFunctorImageFilterType; diff --git a/Testing/Code/Radiometry/otbNDBITM4AndTM5IndexImageFilter.cxx b/Testing/Code/Radiometry/otbNDBITM4AndTM5IndexImageFilter.cxx index d772cf48e5..71345e8bff 100644 --- a/Testing/Code/Radiometry/otbNDBITM4AndTM5IndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbNDBITM4AndTM5IndexImageFilter.cxx @@ -36,13 +36,13 @@ int otbNDBITM4AndTM5IndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::NDBI <InputTM4ImageType::PixelType, - InputTM5ImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputTM5ImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef itk::BinaryFunctorImageFilter<InputTM4ImageType, - InputTM5ImageType, - OutputImageType, - FunctorType> BinaryFunctorImageFilterType; + InputTM5ImageType, + OutputImageType, + FunctorType> BinaryFunctorImageFilterType; // Instantiating object BinaryFunctorImageFilterType::Pointer filter = BinaryFunctorImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbNDWIMultiChannelWaterIndexImageFilter.cxx b/Testing/Code/Radiometry/otbNDWIMultiChannelWaterIndexImageFilter.cxx index be55b48b77..078525f220 100644 --- a/Testing/Code/Radiometry/otbNDWIMultiChannelWaterIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbNDWIMultiChannelWaterIndexImageFilter.cxx @@ -32,8 +32,8 @@ int otbNDWIMultiChannelWaterIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::NDWI <InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef itk::UnaryFunctorImageFilter<InputImageType, OutputImageType, FunctorType> UnaryFunctorImageFilterType; diff --git a/Testing/Code/Radiometry/otbNDWIWaterIndexImageFilter.cxx b/Testing/Code/Radiometry/otbNDWIWaterIndexImageFilter.cxx index dfa9fac758..4350c7bdcc 100644 --- a/Testing/Code/Radiometry/otbNDWIWaterIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbNDWIWaterIndexImageFilter.cxx @@ -36,13 +36,13 @@ int otbNDWIWaterIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::NDWI <InputNIRImageType::PixelType, - InputMIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputMIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef itk::BinaryFunctorImageFilter<InputNIRImageType, - InputMIRImageType, - OutputImageType, - FunctorType> BinaryFunctorImageFilterType; + InputMIRImageType, + OutputImageType, + FunctorType> BinaryFunctorImageFilterType; // Instantiating object BinaryFunctorImageFilterType::Pointer filter = BinaryFunctorImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.cxx index 0c5d734fff..204a0bee25 100644 --- a/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilter.cxx @@ -75,11 +75,11 @@ int otbRAndBAndNIRVegetationIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "ARVI") return (generic_RAndBAndNIRVegetationIndexImageFilter<InputRImageType, InputBImageType, InputNIRImageType, - OutputImageType, - otb::Functor::ARVI<InputRImageType::PixelType, - InputBImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + OutputImageType, + otb::Functor::ARVI<InputRImageType::PixelType, + InputBImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilterNew.cxx b/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilterNew.cxx index e437f39a5e..6c44055455 100644 --- a/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbRAndBAndNIRVegetationIndexImageFilterNew.cxx @@ -34,7 +34,7 @@ int otbRAndBAndNIRVegetationIndexImageFilterNew(int argc, char * argv[]) typedef otb::Image<PixelType, Dimension> OutputImageType; typedef otb::RAndBAndNIRIndexImageFilter<InputRImageType, InputBImageType, InputNIRImageType, - OutputImageType> RAndBAndNIRIndexImageFilterType; + OutputImageType> RAndBAndNIRIndexImageFilterType; // Instantiating object RAndBAndNIRIndexImageFilterType::Pointer object = RAndBAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilterNew.cxx b/Testing/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilterNew.cxx index 11f7e0cd72..0fde28a304 100644 --- a/Testing/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbRAndGAndNIRVegetationIndexImageFilterNew.cxx @@ -34,7 +34,7 @@ int otbRAndGAndNIRVegetationIndexImageFilterNew(int argc, char * argv[]) typedef otb::Image<PixelType, Dimension> OutputImageType; typedef otb::RAndGAndNIRIndexImageFilter<InputRImageType, InputGImageType, InputNIRImageType, - OutputImageType> RAndGAndNIRIndexImageFilterType; + OutputImageType> RAndGAndNIRIndexImageFilterType; // Instantiating object RAndGAndNIRIndexImageFilterType::Pointer object = RAndGAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.cxx index a20b940a82..02bdee7134 100644 --- a/Testing/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbRAndNIRVegetationIndexImageFilter.cxx @@ -67,57 +67,57 @@ int otbRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "NDVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::NDVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::NDVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "RVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::RVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::RVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "SAVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::SAVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::SAVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "TSAVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::TSAVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::TSAVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "MSAVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::MSAVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::MSAVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "MSAVI2") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::MSAVI2<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::MSAVI2<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "GEMI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::GEMI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::GEMI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "IPVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::IPVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::IPVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else if (strArgv == "TNDVI") return (generic_RAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::TNDVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::TNDVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv)); else return EXIT_FAILURE; return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.cxx b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.cxx index 9e0526fdb2..2e5ca01bb5 100644 --- a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.cxx +++ b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilter.cxx @@ -35,7 +35,7 @@ int otbReflectanceToSurfaceReflectanceImageFilter(int argc, char * argv[]) typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::ReflectanceToSurfaceReflectanceImageFilter<InputImageType, - OutputImageType> + OutputImageType> ReflectanceToSurfaceReflectanceImageFilterType; typedef otb::AtmosphericRadiativeTerms::DataVectorType DataVectorType; otb::AtmosphericRadiativeTerms::Pointer atmo = otb::AtmosphericRadiativeTerms::New(); diff --git a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterNew.cxx b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterNew.cxx index 1e12f48213..8e6fc0f79e 100644 --- a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterNew.cxx +++ b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterNew.cxx @@ -27,7 +27,7 @@ int otbReflectanceToSurfaceReflectanceImageFilterNew(int argc, char * argv[]) typedef otb::VectorImage<PixelType, Dimension> InputImageType; typedef otb::ReflectanceToSurfaceReflectanceImageFilter<InputImageType, - InputImageType> + InputImageType> ReflectanceToSurfaceReflectanceImageFilterType; // Instantiating object diff --git a/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx b/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx index 8f56bb7604..979f04cfea 100644 --- a/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx +++ b/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx @@ -42,8 +42,8 @@ int otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter(int argc, char * typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::ReflectanceToSurfaceReflectanceImageFilter<InputImageType, - OutputImageType> - ReflectanceToSurfaceReflectanceImageFilterType; + OutputImageType> + ReflectanceToSurfaceReflectanceImageFilterType; typedef otb::AtmosphericRadiativeTerms::DataVectorType DataVectorType; typedef otb::AtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms CorrectionParametersTo6SRadiativeTermsType; diff --git a/Testing/Code/Radiometry/otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter.cxx index 88b9100099..a2a05892f9 100644 --- a/Testing/Code/Radiometry/otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter.cxx @@ -66,9 +66,9 @@ int otbSetASetBMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * ar argv++; if (strArgv == "PVI") generic_SetASetBMultiChannelRAndNIRVegetationIndexImageFilter<InputImageType, OutputImageType, - otb::Functor::PVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> > + otb::Functor::PVI<InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> > (argc, argv); return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbSetASetBRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbSetASetBRAndNIRVegetationIndexImageFilter.cxx index f368c68b65..02666b5b89 100644 --- a/Testing/Code/Radiometry/otbSetASetBRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbSetASetBRAndNIRVegetationIndexImageFilter.cxx @@ -68,9 +68,9 @@ int otbSetASetBRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) argv++; if (strArgv == "PVI") generic_SetASetBRAndNIRVegetationIndexImageFilter<InputRImageType, InputNIRImageType, OutputImageType, - otb::Functor::PVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> > + otb::Functor::PVI<InputRImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> > (argc, argv); return EXIT_SUCCESS; } diff --git a/Testing/Code/Radiometry/otbSpectralSensitivityReaderNew.cxx b/Testing/Code/Radiometry/otbSpectralSensitivityReaderNew.cxx index 4e24fa0221..ebe245dc9b 100644 --- a/Testing/Code/Radiometry/otbSpectralSensitivityReaderNew.cxx +++ b/Testing/Code/Radiometry/otbSpectralSensitivityReaderNew.cxx @@ -20,7 +20,7 @@ using namespace otb; -int otbSpectralSensitivityReaderNew(int argc,char* argv[]) +int otbSpectralSensitivityReaderNew(int argc, char* argv[]) { SpectralSensitivityReader::Pointer spectSen = SpectralSensitivityReader::New(); diff --git a/Testing/Code/Radiometry/otbSpectralSensitivityReaderTest.cxx b/Testing/Code/Radiometry/otbSpectralSensitivityReaderTest.cxx index cfa936d1da..aca41b269d 100644 --- a/Testing/Code/Radiometry/otbSpectralSensitivityReaderTest.cxx +++ b/Testing/Code/Radiometry/otbSpectralSensitivityReaderTest.cxx @@ -23,12 +23,12 @@ using namespace otb; -int otbSpectralSensitivityReaderTest(int argc,char* argv[]) +int otbSpectralSensitivityReaderTest(int argc, char* argv[]) { const char * dataPath = argv[1]; - const char * imageName = argv[2]; + const char * imageName = argv[2]; const char * output = argv[3]; - + typedef VectorImage<double> ImageType; typedef ImageFileReader<ImageType> ReaderType; @@ -38,13 +38,13 @@ int otbSpectralSensitivityReaderTest(int argc,char* argv[]) SpectralSensitivityReader::Pointer spectSen = SpectralSensitivityReader::New(); - spectSen->SetDataPath( dataPath ); - spectSen->SetImage( reader->GetOutput() ); + spectSen->SetDataPath(dataPath); + spectSen->SetImage(reader->GetOutput()); spectSen->Update(); std::ofstream fout(output); - fout <<spectSen<<std::endl; + fout << spectSen << std::endl; fout.close(); return EXIT_SUCCESS; diff --git a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx index 316f4d3b1f..a10fa7fbb4 100644 --- a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx +++ b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx @@ -42,8 +42,8 @@ int otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::SurfaceAdjacencyEffect6SCorrectionSchemeFilter<InputImageType, - OutputImageType> - SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; + OutputImageType> + SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; typedef SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::WeightingMatrixType WeightingMatrixType; typedef SurfaceAdjacencyEffect6SCorrectionSchemeFilterType::WeightingValuesContainerType WeightingValuesContainerType; diff --git a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilterNew.cxx b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilterNew.cxx index 4b4eb8bd65..6114558a73 100644 --- a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilterNew.cxx +++ b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilterNew.cxx @@ -27,7 +27,7 @@ int otbSurfaceAdjacencyEffect6SCorrectionSchemeFilterNew(int argc, char * argv[] typedef double PixelType; typedef otb::VectorImage<PixelType, Dimension> InputImageType; typedef otb::SurfaceAdjacencyEffect6SCorrectionSchemeFilter<InputImageType, - InputImageType> + InputImageType> SurfaceAdjacencyEffect6SCorrectionSchemeFilterType; // Instantiating object diff --git a/Testing/Code/Radiometry/otbTSARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbTSARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx index db0d857ef3..76ac3a011b 100644 --- a/Testing/Code/Radiometry/otbTSARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbTSARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx @@ -32,9 +32,9 @@ int otbTSARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter(int argc, char * typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::TSARVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef otb::MultiChannelRAndBAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndBAndNIRIndexImageFilterType; diff --git a/Testing/Code/Radiometry/otbTSARVIRAndBAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbTSARVIRAndBAndNIRVegetationIndexImageFilter.cxx index 4e1b354eca..229e732340 100644 --- a/Testing/Code/Radiometry/otbTSARVIRAndBAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbTSARVIRAndBAndNIRVegetationIndexImageFilter.cxx @@ -38,15 +38,15 @@ int otbTSARVIRAndBAndNIRVegetationIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::TSARVI<InputRImageType::PixelType, - InputBImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputBImageType::PixelType, + InputNIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef otb::RAndBAndNIRIndexImageFilter<InputRImageType, - InputBImageType, - InputNIRImageType, - OutputImageType, - FunctorType> RAndBAndNIRIndexImageFilterType; + InputBImageType, + InputNIRImageType, + OutputImageType, + FunctorType> RAndBAndNIRIndexImageFilterType; // Instantiating object RAndBAndNIRIndexImageFilterType::Pointer filter = RAndBAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/Radiometry/otbWDVIMultiChannelRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbWDVIMultiChannelRAndNIRVegetationIndexImageFilter.cxx index 11c98ac511..1c5f8b34ed 100644 --- a/Testing/Code/Radiometry/otbWDVIMultiChannelRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbWDVIMultiChannelRAndNIRVegetationIndexImageFilter.cxx @@ -32,8 +32,8 @@ int otbWDVIMultiChannelRAndNIRVegetationIndexImageFilter(int argc, char * argv[] typedef otb::ImageFileReader<InputImageType> ReaderType; typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::WDVI<InputImageType::InternalPixelType, - InputImageType::InternalPixelType, - OutputImageType::PixelType> FunctorType; + InputImageType::InternalPixelType, + OutputImageType::PixelType> FunctorType; typedef otb::MultiChannelRAndNIRIndexImageFilter<InputImageType, OutputImageType, FunctorType> MultiChannelRAndNIRIndexImageFilterType; diff --git a/Testing/Code/Radiometry/otbWDVIRAndNIRVegetationIndexImageFilter.cxx b/Testing/Code/Radiometry/otbWDVIRAndNIRVegetationIndexImageFilter.cxx index 92168bc3e8..c0f13b3307 100644 --- a/Testing/Code/Radiometry/otbWDVIRAndNIRVegetationIndexImageFilter.cxx +++ b/Testing/Code/Radiometry/otbWDVIRAndNIRVegetationIndexImageFilter.cxx @@ -36,13 +36,13 @@ int otbWDVIRAndNIRVegetationIndexImageFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::Functor::WDVI<InputRImageType::PixelType, - InputNIRImageType::PixelType, - OutputImageType::PixelType> FunctorType; + InputNIRImageType::PixelType, + OutputImageType::PixelType> FunctorType; typedef otb::RAndNIRIndexImageFilter<InputRImageType, - InputNIRImageType, - OutputImageType, - FunctorType> RAndNIRIndexImageFilterType; + InputNIRImageType, + OutputImageType, + FunctorType> RAndNIRIndexImageFilterType; // Instantiating object RAndNIRIndexImageFilterType::Pointer filter = RAndNIRIndexImageFilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbHHnHVPolarimetricSynthesisFilter.cxx b/Testing/Code/SARPolarimetry/otbHHnHVPolarimetricSynthesisFilter.cxx index 78e528a27e..a5485b3701 100644 --- a/Testing/Code/SARPolarimetry/otbHHnHVPolarimetricSynthesisFilter.cxx +++ b/Testing/Code/SARPolarimetry/otbHHnHVPolarimetricSynthesisFilter.cxx @@ -51,7 +51,7 @@ int otbHHnHVPolarimetricSynthesisFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, InputImageType, InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; FilterType::Pointer polarimetricSynthesis = FilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbHHnHVnVVPolarimetricSynthesisFilter.cxx b/Testing/Code/SARPolarimetry/otbHHnHVnVVPolarimetricSynthesisFilter.cxx index 590e45c45a..3f09f9b630 100644 --- a/Testing/Code/SARPolarimetry/otbHHnHVnVVPolarimetricSynthesisFilter.cxx +++ b/Testing/Code/SARPolarimetry/otbHHnHVnVVPolarimetricSynthesisFilter.cxx @@ -52,7 +52,7 @@ int otbHHnHVnVVPolarimetricSynthesisFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, InputImageType, InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; FilterType::Pointer polarimetricSynthesis = FilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.cxx b/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.cxx index 7a838d9b9a..2d79a64772 100644 --- a/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.cxx +++ b/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilter.cxx @@ -53,7 +53,7 @@ int otbPolarimetricSynthesisFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, InputImageType, InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; FilterType::Pointer polarimetricSynthesis = FilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilterNew.cxx b/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilterNew.cxx index 862369cadf..718e186083 100644 --- a/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilterNew.cxx +++ b/Testing/Code/SARPolarimetry/otbPolarimetricSynthesisFilterNew.cxx @@ -36,7 +36,7 @@ int otbPolarimetricSynthesisFilterNew(int argc, char * argv[]) typedef otb::Image<OutputPixelType, Dimension> OutputImageType; typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, InputImageType, InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbVHnVVPolarimetricSynthesisFilter.cxx b/Testing/Code/SARPolarimetry/otbVHnVVPolarimetricSynthesisFilter.cxx index 72eb18fd51..c8a73d38a6 100644 --- a/Testing/Code/SARPolarimetry/otbVHnVVPolarimetricSynthesisFilter.cxx +++ b/Testing/Code/SARPolarimetry/otbVHnVVPolarimetricSynthesisFilter.cxx @@ -51,7 +51,7 @@ int otbVHnVVPolarimetricSynthesisFilter(int argc, char * argv[]) typedef otb::ImageFileWriter<OutputImageType> WriterType; typedef otb::PolarimetricSynthesisFilter<InputImageType, InputImageType, InputImageType, InputImageType, - OutputImageType> FilterType; + OutputImageType> FilterType; FilterType::Pointer polarimetricSynthesis = FilterType::New(); diff --git a/Testing/Code/SpatialReasoning/otbRCC8GraphFileReader.cxx b/Testing/Code/SpatialReasoning/otbRCC8GraphFileReader.cxx index 15b9786b60..641d37706f 100644 --- a/Testing/Code/SpatialReasoning/otbRCC8GraphFileReader.cxx +++ b/Testing/Code/SpatialReasoning/otbRCC8GraphFileReader.cxx @@ -59,57 +59,57 @@ int otbRCC8GraphFileReader(int argc, char* argv[]) { switch (count) { - case 0: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_EC, - "eIt.GetValue()!=otb::OTB_RCC8_EC"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, - "eIt.GetSourceIndex()!=0"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 1, - "eIt.GetTargetIndex()!=1"); - break; - case 1: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_PO, - "eIt.GetValue()!=otb::OTB_RCC8_PO"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 1, - "eIt.GetSourceIndex()!=1"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 2, - "eIt.GetTargetIndex()!=2"); - break; - case 2: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_TPP, - "eIt.GetValue()!=otb::OTB_RCC8_TPP"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 2, - "eIt.GetSourceIndex()!=2"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, - "eIt.GetTargetIndex()!=3"); - break; - case 3: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_TPPI, - "eIt.GetValue()!=otb::OTB_RCC8_TPPI"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, - "eIt.GetSourceIndex()!=0"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 2, - "eIt.GetTargetIndex()!=2"); - break; - case 4: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_NTPP, - "eIt.GetValue()!=otb::OTB_RCC8_NTPP"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 1, - "eIt.GetSourceIndex()!=1"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, - "eIt.GetTargetIndex()!=3"); - break; - case 5: - otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_NTPPI, - "eIt.GetValue()!=otb::OTB_RCC8_NTPPI"); - otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, - "eIt.GetSourceIndex()!=0"); - otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, - "eIt.GetTargetIndex()!=3"); - break; - default: - otbControlConditionTestMacro(true, "Error in graph reading."); - break; + case 0: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_EC, + "eIt.GetValue()!=otb::OTB_RCC8_EC"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, + "eIt.GetSourceIndex()!=0"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 1, + "eIt.GetTargetIndex()!=1"); + break; + case 1: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_PO, + "eIt.GetValue()!=otb::OTB_RCC8_PO"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 1, + "eIt.GetSourceIndex()!=1"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 2, + "eIt.GetTargetIndex()!=2"); + break; + case 2: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_TPP, + "eIt.GetValue()!=otb::OTB_RCC8_TPP"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 2, + "eIt.GetSourceIndex()!=2"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, + "eIt.GetTargetIndex()!=3"); + break; + case 3: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_TPPI, + "eIt.GetValue()!=otb::OTB_RCC8_TPPI"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, + "eIt.GetSourceIndex()!=0"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 2, + "eIt.GetTargetIndex()!=2"); + break; + case 4: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_NTPP, + "eIt.GetValue()!=otb::OTB_RCC8_NTPP"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 1, + "eIt.GetSourceIndex()!=1"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, + "eIt.GetTargetIndex()!=3"); + break; + case 5: + otbControlConditionTestMacro(eIt.GetValue() != otb::OTB_RCC8_NTPPI, + "eIt.GetValue()!=otb::OTB_RCC8_NTPPI"); + otbControlConditionTestMacro(eIt.GetSourceIndex() != 0, + "eIt.GetSourceIndex()!=0"); + otbControlConditionTestMacro(eIt.GetTargetIndex() != 3, + "eIt.GetTargetIndex()!=3"); + break; + default: + otbControlConditionTestMacro(true, "Error in graph reading."); + break; } } diff --git a/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.cxx b/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.cxx index a6f76704dc..cc9bdf533a 100644 --- a/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.cxx +++ b/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilter.cxx @@ -28,13 +28,13 @@ int otbVectorImageToColorAnaglyphVectorImageFilter(int argc, char * argv[]) typedef unsigned char PixelType; typedef otb::VectorImage<PixelType, - Dimension> VectorImageType; + Dimension> VectorImageType; typedef otb::VectorImageToColorAnaglyphVectorImageFilter<VectorImageType, VectorImageType, - VectorImageType> FilterType; + VectorImageType> FilterType; typedef otb::ImageFileReader<VectorImageType> - ReaderType; + ReaderType; typedef otb::StreamingImageFileWriter<VectorImageType> - WriterType; + WriterType; // Instantiating object FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilterNew.cxx b/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilterNew.cxx index 840b85bfc1..5af9117a96 100644 --- a/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilterNew.cxx +++ b/Testing/Code/Visu/otbVectorImageToColorAnaglyphVectorImageFilterNew.cxx @@ -26,9 +26,9 @@ int otbVectorImageToColorAnaglyphVectorImageFilterNew(int argc, char * argv[]) typedef unsigned char PixelType; typedef otb::VectorImage<PixelType, - Dimension> VectorImageType; + Dimension> VectorImageType; typedef otb::VectorImageToColorAnaglyphVectorImageFilter<VectorImageType, VectorImageType, - VectorImageType> FilterType; + VectorImageType> FilterType; // Instantiating object FilterType::Pointer object = FilterType::New(); diff --git a/Testing/Code/Visualization/otbHistogramCurveNew.cxx b/Testing/Code/Visualization/otbHistogramCurveNew.cxx index e8f81747ef..2b30e956e4 100644 --- a/Testing/Code/Visualization/otbHistogramCurveNew.cxx +++ b/Testing/Code/Visualization/otbHistogramCurveNew.cxx @@ -22,7 +22,7 @@ int otbHistogramCurveNew(int argc, char * argv[]) { typedef itk::Statistics::Histogram<double, 1, - itk::Statistics::DenseFrequencyContainer> HistogramType; + itk::Statistics::DenseFrequencyContainer> HistogramType; typedef otb::HistogramCurve<HistogramType> HistogramCurveType; HistogramCurveType::Pointer curve = HistogramCurveType::New(); diff --git a/Testing/Code/Visualization/otbImageViewerEndToEndWithVectorData.cxx b/Testing/Code/Visualization/otbImageViewerEndToEndWithVectorData.cxx index 4dd732f38b..8d8bce5269 100644 --- a/Testing/Code/Visualization/otbImageViewerEndToEndWithVectorData.cxx +++ b/Testing/Code/Visualization/otbImageViewerEndToEndWithVectorData.cxx @@ -79,7 +79,7 @@ int otbImageViewerEndToEndWithVectorData(int argc, char * argv[]) typedef otb::VectorData<double> VectorDataType; typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; typedef otb::VectorDataProjectionFilter<VectorDataType, - VectorDataType> + VectorDataType> VectorDataProjectionFilterType; typedef otb::VectorDataGlComponent<VectorDataType> VectorDataGlComponentType; diff --git a/Testing/Code/Visualization/otbRenderingImageFilterAmplitude.cxx b/Testing/Code/Visualization/otbRenderingImageFilterAmplitude.cxx index 01c745fec7..8b9a8f7dc4 100644 --- a/Testing/Code/Visualization/otbRenderingImageFilterAmplitude.cxx +++ b/Testing/Code/Visualization/otbRenderingImageFilterAmplitude.cxx @@ -36,7 +36,7 @@ int otbRenderingImageFilterAmplitude(int argc, char * argv[]) typedef otb::Function::AmplitudeFunctor<VectorPixelType> PixelRepresentationFunctionType; typedef otb::Function::StandardRenderingFunction <VectorPixelType, itk::RGBPixel<unsigned char>, - PixelRepresentationFunctionType> RenderingFunctionType; + PixelRepresentationFunctionType> RenderingFunctionType; typedef RenderingFilterType::RenderingFunctionType::ParametersType ParametersType; // Instantiation diff --git a/Testing/Code/Visualization/otbRenderingImageFilterPhase.cxx b/Testing/Code/Visualization/otbRenderingImageFilterPhase.cxx index b0bce5d8b6..20323039ca 100644 --- a/Testing/Code/Visualization/otbRenderingImageFilterPhase.cxx +++ b/Testing/Code/Visualization/otbRenderingImageFilterPhase.cxx @@ -36,7 +36,7 @@ int otbRenderingImageFilterPhase(int argc, char * argv[]) typedef otb::Function::PhaseFunctor<VectorPixelType> PixelRepresentationFunctionType; typedef otb::Function::StandardRenderingFunction <VectorPixelType, itk::RGBPixel<unsigned char>, - PixelRepresentationFunctionType> RenderingFunctionType; + PixelRepresentationFunctionType> RenderingFunctionType; typedef RenderingFilterType::RenderingFunctionType::ParametersType ParametersType; // Instantiation diff --git a/Testing/Code/Visualization/otbRenderingImageFilterVector.cxx b/Testing/Code/Visualization/otbRenderingImageFilterVector.cxx index 7a5e55464b..a5921224cd 100644 --- a/Testing/Code/Visualization/otbRenderingImageFilterVector.cxx +++ b/Testing/Code/Visualization/otbRenderingImageFilterVector.cxx @@ -33,7 +33,7 @@ int otbRenderingImageFilterVector(int argc, char * argv[]) typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::StreamingImageFileWriter<RGBImageType> WriterType; typedef otb::Function::StandardRenderingFunction<VectorPixelType, - itk::RGBPixel<unsigned char> > RenderingFunctionType; + itk::RGBPixel<unsigned char> > RenderingFunctionType; typedef RenderingFilterType::RenderingFunctionType::ParametersType ParametersType; // Instantiation diff --git a/Testing/Code/Visualization/otbRenderingImageFilterVectorWithExpNegativeTransfer.cxx b/Testing/Code/Visualization/otbRenderingImageFilterVectorWithExpNegativeTransfer.cxx index 51845ec833..52515f6b4e 100644 --- a/Testing/Code/Visualization/otbRenderingImageFilterVectorWithExpNegativeTransfer.cxx +++ b/Testing/Code/Visualization/otbRenderingImageFilterVectorWithExpNegativeTransfer.cxx @@ -37,10 +37,10 @@ int otbRenderingImageFilterVectorWithExpNegativeTransfer(int argc, char * argv[] typedef otb::Function::ChannelSelectorFunctor<VectorPixelType> PixelRepresentationFunctionType; typedef itk::Function::ExpNegative<PixelType, PixelType> ExpNegativeFunctionType; typedef otb::Function::StandardRenderingFunction< - VectorPixelType, - itk::RGBPixel<unsigned char>, - PixelRepresentationFunctionType, - ExpNegativeFunctionType> RenderingFunctionType; + VectorPixelType, + itk::RGBPixel<unsigned char>, + PixelRepresentationFunctionType, + ExpNegativeFunctionType> RenderingFunctionType; typedef RenderingFunctionType::ParametersType ParametersType; // Instantiation diff --git a/Testing/Code/Visualization/otbVectorDataModelTest.cxx b/Testing/Code/Visualization/otbVectorDataModelTest.cxx index 5f20673ece..fa8d2b6222 100644 --- a/Testing/Code/Visualization/otbVectorDataModelTest.cxx +++ b/Testing/Code/Visualization/otbVectorDataModelTest.cxx @@ -69,20 +69,20 @@ int otbVectorDataModelTest(int argc, char * argv[]) <ModelType, ViewType> ChangeRegionHandlerType; typedef otb::ChangeScaleActionHandler <ModelType, ViewType> ChangeScaleHandlerType; - typedef otb::PixelDescriptionModel<OutputImageType> PixelDescriptionModelType; + typedef otb::PixelDescriptionModel<OutputImageType> PixelDescriptionModelType; typedef otb::PixelDescriptionActionHandler <PixelDescriptionModelType, ViewType> PixelDescriptionActionHandlerType; typedef otb::PixelDescriptionView <PixelDescriptionModelType> PixelDescriptionViewType; typedef otb::VectorDataActionHandler - <otb::VectorDataModel,ViewType> VectorDataActionHandlerType; + <otb::VectorDataModel, ViewType> VectorDataActionHandlerType; // VectorData - typedef otb::VectorDataModel::VectorDataType VectorDataType; - typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; + typedef otb::VectorDataModel::VectorDataType VectorDataType; + typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; typedef otb::VectorDataProjectionFilter<VectorDataType, - VectorDataType> - VectorDataProjectionFilterType; - typedef otb::VectorDataGlComponent<VectorDataType> VectorDataGlComponentType; + VectorDataType> + VectorDataProjectionFilterType; + typedef otb::VectorDataGlComponent<VectorDataType> VectorDataGlComponentType; // Instantiation ModelType::Pointer model = ModelType::New(); @@ -107,11 +107,11 @@ int otbVectorDataModelTest(int argc, char * argv[]) view->SetModel(model); // Build the VectorDataModel - otb::VectorDataModel::Pointer vdModel = otb::VectorDataModel::New(); - vdModel->RegisterListener(view); + otb::VectorDataModel::Pointer vdModel = otb::VectorDataModel::New(); + vdModel->RegisterListener(view); - VectorDataGlComponentType::Pointer vgl = VectorDataGlComponentType::New(); - vgl->SetVectorData(vdModel->GetVectorData()); + VectorDataGlComponentType::Pointer vgl = VectorDataGlComponentType::New(); + vgl->SetVectorData(vdModel->GetVectorData()); view->GetScrollWidget()->AddGlComponent(vgl); view->GetFullWidget()->AddGlComponent(vgl); diff --git a/Testing/Fa/0000169-fftcomplextocomplex.cxx b/Testing/Fa/0000169-fftcomplextocomplex.cxx index 38cc24ae09..9f27eb6356 100644 --- a/Testing/Fa/0000169-fftcomplextocomplex.cxx +++ b/Testing/Fa/0000169-fftcomplextocomplex.cxx @@ -19,9 +19,9 @@ #include "itkExceptionObject.h" #include "itkFFTComplexToComplexImageFilter.h" -int main( int argc, char * argv [] ) +int main(int argc, char * argv[]) { - typedef itk::FFTComplexToComplexImageFilter < float, 2> FFTFilterType; + typedef itk::FFTComplexToComplexImageFilter <float, 2> FFTFilterType; FFTFilterType::Pointer fftFilter = FFTFilterType::New(); fftFilter->DebugOn(); -- GitLab