diff --git a/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx b/Code/BasicFilters/otbBSplineDecompositionImageFilter.txx index adb5161004b1c837c30ff99c0c988d898afa0c5a..f2dc28687f144fbc969d6dd0a17becab9c89f932 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 9bec9c2a829d22ef9cdda0945512066c0c3930ea..346e0a5ce604dbf7157d023ef7fa025dfa4617f6 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 c8ac86b4afa495d629196bfeb794765ac1a66d36..3aa1274b92146a8e32be8170d5c2114d1a162796 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 a2a7c57e0ab9a47fa2a72f3472f5ad53ecbfa1d7..1c92c19bfcb5e01e4c27c3e460c3a6b5ac667774 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 e3bb0b7b99b4569c28ed37d4108760ca3669cafd..89084330803aa2a61c8e79a9a58afe058502a686 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 8fb10486981d37475933efd86ba7408fa225ca61..013e97a8388e8d9f991fcc23bb6f95465b6309e6 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 e2a0753235130f7b086a189d9ed8a7ed44594021..261935df8785a40cef72b79c47043d45b39518de 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 b9005a98d714e85e018261a769b25d65409360eb..8b5f5661c3ce4dcc46cf852b53503ac69d366b9d 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 6b51fc6a078d4d004d01feb46e4f308e5cbeb8f9..94f95a30dda5c38b80d88fafca04b8649bfb8be3 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 3b9f68796a51676711b4fe1dd77f3a92ac7f6959..db2684eef2f7c5eb32d2beb644e82855a8d97e4d 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 ff783ab57f98c58b21149fee362b731574074c3a..1ae63bd910899704f7d23658e9fa88dfee77a584 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 29447fb1a033ac128af6d539e5ad7016cc051a6c..d6e8ff654439ca6216415c780ade6aaa103f745a 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 2eb13a9627f56c6374fa821ef5da26c6fce43817..16d8baf457644c03988e02f83b4103414b38c324 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 e5c99db6bcf7efc99cfac0e11115251a851b534f..de232f24e03d188bf95e43320886dc4675d5d0c4 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 c462a86a7c2dda6c185bf390a0a574282b80ae5f..5a165e3afbb449e154d3d6f759e658e43797e6db 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 aff2bdc62f884227249a4897f43fcac07e31775b..0bde804a59a21186f7ce8779ce2c915a1c347fa2 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 88003b8c91ebdd9e3c32ba5945b355e1a98fc0eb..8f332d1b66314d7de2eeda21bf606ffd961200bf 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 494656170a135983a233b501090e5cee8ea16052..e9e4d7eb948d8975c66263fb4b84cdb9fda68ce7 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 ad977d3cb5024e8af9a5698a4844a70888f51a77..75076fd937b2fb09512ee961d2877c684e871320 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 9ac3a4badbf2947bc53bfd02a331ea390dabb01f..66888df416d830559927546eb3292c58d61a7d64 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 62e063078c2fceaccf0abf928ba930b09a9df763..171f0bd27bc600b7030d6e9d258d742cc378d00f 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 5170fcb811f1477ec17f9a88f44cbfd2e81ff9a0..021d3943275bbd45693c0ad61bdfe06d93af95c8 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 b16a354e10222bc2699503b7dbba240033a1851b..773b3d965d4f385c814288ff85a66d9047587a1e 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 ee89c7018f4754307ade21d6b70e5b6db06b4ac3..f68655dd488cef4fca926babe7c48b132f5c407d 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 b3b8e5e22d0fc0e6a4033070f97a74a6e626788e..9d8614950eadd46135dcd357fe596d61b9ca16f1 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 02c5e2f2d41a371bc3bd4bb28512164358125a2d..031038046b0f8cbbfd72a84591142725d2989ad7 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 d77075f112d87c0f46e83ebfbddfb467ec47d549..e9090c48107547746e7fc8634668210b91e7911f 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 9c5798f2f29dffb160912f838f0b162a7f1c5ab7..759d23bb811333e32d0beb9cd497363105d7e90a 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 4206833267183f1c6e77d82c89e66e3225fbdac4..2e8e0d1cbab4a3786b5c74e92e3fc3bd5df6cd10 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 ba4b7a9d9029b9dd97a6a6425602429a6a8a362f..8e802b338fc5265e5f22884e91854c98d28d6688 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 b06390ad55ebbc55604cd0785daf62ba39eba382..e1217b5ac8b5638749d982394adddb85eae1219e 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 e258ee449fd2200855d6255731606775fdfaaed2..b153d18fa47be69f3176a843e2acdcbf035400d9 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 c600c16241e7983f97ea49b0a1356cb37089d72a..7207e53e5890dd5fabbfa963b8147358e5e82a84 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 cfe52467cd47233137990a704d3b08594c497ab5..11c7f27ffed54e86b583c0c72fdec64dbbceb9e1 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 0458ddfe7b06eee52512404ddb6d744e88b35404..b1890fa008259fbb0956eaa729ead015660c6f05 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 512f9615fc279baccb8f869c87f0d594fd0dd4bb..309cd6e2a255b5f3e6071497ed1ff5305daa4770 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 f53d53076b06e278fb5d8e463a112210bcb7cd35..95e5e4ead0bc9bab875fc7e07872e0aac3809dec 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 87a43fb56a46b922a497b3cc083a54c4e08ad61e..633ba87bb5700707afa7538a17ac9e2464727f33 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 cdc051bba1da74770133afb55514db5da9388fdc..e3243b5e7100d4ccb3b9880855cd540fe15b6d1c 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 3886e0d648148d7bae234ae348af0184f49f9a54..736132af472e60ae84b9984129655c38d85aa5e4 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 4dbbc14d3275ebb4992870aa33da95884fe84b7b..e9b20e8feb8ec569573596319e39ea56f5e664af 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 4cd1fe90d33c8a9806daa9dd8e2cd600bd4c8968..bffef469cd5ab57a49ad42eb1fc4fe17592db34b 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 4741dc0b5c5a3b1b7a57672b530b79bf3a628eb5..320a0572987a743efa0bda3e3ede793c385204b7 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 c572b9ab3131a09fecab777c427148430d09b815..354a7fe9171c5d37ec35ce137f347684008ce953 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 1ee14d88bdbe1600468faa5c33b87658e67d8d69..7191a9f567eaea5b8618aed87d2d9f1caa0e6bb5 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 848aad7c9e5df24c032e38809488d569aaccd1b1..38128a7f20d816ba6180824b1b790caee5678de7 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 7834e4fd08510f66b4d9114b01dcfa03208cb138..da2f190531cc9391b4b439030603792a13a84d7c 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 f78181a93564300b45b691aae2535b8c2390a485..67a2c626f2c5cb121486b361c246fa7a92fff68e 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 6e91c342ef5942cecfd18e8d2763e524e40a117d..c4eafe8dd447d43d4b5ae2bf13113526f4245a36 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 c19061a4c1c5fddaa5a2140dfe338088a9d64cab..e4a5ea739de06114eefcdd444b9d2085eeb2def5 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 01ac15a1c8344909ef62acdd328de0aca3e3f8c9..a33d6ea3ecf07b63aba52897803f585269197ea6 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 eea0214968276360bb0a1e3982d4e773c4cd400f..995fb6aa6f567e1cfe1f819b079e59f6aa3750b9 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 e8efdc5dade19463a3082e313582bfa19ed4d82c..fe653dcef64efa41a8716a63c85973157e82e4b0 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 6529791b49e1ad1ff861506b53dc11e375726ed0..5f106aee99d73eea8f510e86f093fb0081e5a82d 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 986254f7ad679ad1f8b8b05df5b91741845f0428..8879943d1d6e4071353b476101256ec8bff05d05 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 e5153b47c99b62b8a086717215d5a6cbcfb06d2b..64c58662665221ee1c2f102d0602eb3d0c5fef81 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 9406801588d7758dfc343a126db6320895ff17da..e3401cf1b163fcf6d788b876bc10d7ced7962d8e 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 835757244c72c77783a275a531f34b9d3988674f..d1259bef647e8ea1837585074b5da77d19fd0961 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 1aa5b7881781849a99f762e799f1591ee3a89a38..5f869fa795ebbbaee244dcdf4207c4f6cd46bfd0 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 044a652c5b41ebd446bdf0903b5bdab49264fca6..416c00559661cc845384fc499a74aeb40d1307bd 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 3e3153217414aad385783ba0175377075a4c7124..83f3aa9173cf471564d59e975a60f9c6c87e700a 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 16773ec981d4ce1da1751aa423718168f6a9180a..f0454a6b8031c808b050294bb1cf7bc3906bbcdc 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 35fdfc6f44d54e0ac442cc147ae516353325b7d4..21b7eee1b9c0c1fc1abc8a3a4d7aa24b262302f0 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 94eca3e616c3949f2de086ed3567e6d38c8987ae..6aba5ba0433e5d2e091bffe3ff56905765ed1df6 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 01f08889acd9b7934aecba2d6253563d906b83ed..3aa53e8df25c66283d2f67258985f4c8343a33ce 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 074dff19e46e15eb7ee2b73287ef49c9122c6afb..6717a0ab9701f7eb7251a28597d27be3a8243a76 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 746c58e357d02b19c3ccfae9894879a3735fe377..2063a5738f5581a015549b7da7356987f43e0228 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 1ae41fe584e4b0d16a826a0b7a30334f2e8af525..93dcd808c561481df55d627e0217eb58d59d6eed 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 f2684feb564c276a51f0f61f53b2e2f215fd2a22..82a4d2b13d311c797dc50ea522fb0029313f30a7 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 ede2658f5f6fdf04ee9ce9014c25e7057d840bd5..24f007f83bcaf410366cca665ef84d97ceecd846 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 a7766e0520200d65c4a664d2bfbece5a3bd3272f..06219812e5b0b99bd00280df1197617b702532e1 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 26212de666c14e9f9258d3526738c180e9103705..46a307578401b8bf7e3f4485c2ea51f8c29724bc 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 b356c7680e8b844a8e396c280e77b83485a131ee..189282dc3e75083b70fba3822ecd2bf5557cd0f4 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 e7c28384efecee71c8b54ef29e42740384951b9e..94502e58a5ede32053b639df116f32634fc606da 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 c9bfb4e5e7f83482114c05c69267131a65c9d5be..5d63870591174dc269f3d72d52fb746725d78383 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 efb3bf94393786b9d6e4a6f0535d924418b25452..521600f859a728874abd4d265cb576894333d2ea 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 a227fdc34e95a63a0795f348ca2c6cb7fd1baa30..9789169c976122b059b4327d138acc6d59bca754 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 dae21529aac52b55157c4e65db7d473653452cfc..fa3751a0104870f0da979e3ddf41fe51679ca0fd 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 6b6ca577b23105661b4bb95f933be67065221b18..77c81c95fee35926086836e09018220bb022a944 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 6a1bb4620b8ab2cf8ad55c9b4106f9dc92730c12..80caff27976469cc3b4e0e9c950a5745b961bedc 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 b9f692a4b5be4373019be8c63d6d6926fbd5eb12..8e8ae4726298a1c0c63ae6c1afb1f8b840b0a553 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 8d9fe4f107b3fbd1c4d867b7b0cc2915118571c0..8f740df7a1a484b0b8e301f098d08c3de246a14f 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 8d91617664fdfae4cc48a4f31851aea59ac63be8..2c0b6cfbe7085f7e2180061893e79e9670f57ab1 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 129e359475d75ada2397ee7eda1c9efa206a2c87..0bb14e0eeb35ca543b4b7028e6e4161036320faf 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 fbd2c0d1be422bb99abd7bcc788c89538a9a5a28..76b8110b282ecd5de62017bdaa8be833acdd639c 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 95c7dc5e054adf65047caff546055eb361049df3..d26feeec75e1e9d21610d970e695111deb0c9ca7 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 19d757bdf931602841f462dd3746dea76a5087ad..f9bc3cfcf85ac2d28a31800b7544aee10bc1dba2 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 90f58109b3ffcb23cb3a16aee132be9c140f4dbd..2654de0b92c2fa3b34ed3e2cbebb0f3a501b51d8 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 872489e7db855d6d84017813981ac918a8b9556e..eee0b31cdb5ae33486e61e99d648545b01882256 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 0282207ce344a43142fe1eaa526c061b0ba52b44..dd500a2beee6dbf4506b72e8244f57450a22b93b 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 ce37d0d19118898c3d8594c43b3b186bd2b655f9..befd72d3d98a103d183e7ed997a467a175763a42 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 33269b543735fd03c98e6922d491eedcd2155d3d..2e08a1efac1ed991467308c7d33a1fc11a509ac5 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 f4fe97a4b4bebe64dc7731a6bb6fe084f38abeb5..bc4ba9c0f9f421fa9bdf2eb60d78a3e510ec87bd 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 15ceca9b9cf7674f0230cba789f1e96a41c191b6..0bb0806591341066bca7e204fb95e69051448a0e 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 8497c7401a7f8664716a351042fc1d604691b0ac..f833a7de335c2af32bd3329e7b1df980b05a7ae7 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 f8ebb6e9b75e5f6d42b99f5ee307993b0ea3a0d7..f7f7f765c65c214d215f2042d8f6baefc23a00f6 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 f488b84c2218340def2f5ab1eaee91cfd7bd6ffa..cd913b2a40f90a29ab2d0c5b1d621a4113ff1c5c 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 282fac9f72e2baaee446c571531b2b03e88ceebe..4b46df2ca408790cbd99c5a29878b2bba3c1e855 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 10f28d3f881ae391be7ce26513e6747c3d4f382d..a1bf6dc9408ec127907ed9acb92dc07f1ba3622e 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 2b609bb21e9573bfc547204f74f3457d44ed1aa7..3e91b3e09f21d40337a5675448d6b08d5d9c8007 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 e5bfa9bce9dff89dc3057a2d664364eab22f1de4..5bd8100694ad9ca6fd4f61bacffec1e02720203f 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 bd9cba4338af4f4a5db69b7b6baed5e367c71041..55f821a2d1c3e1b86c24ef3cde38a06e6ac3c777 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 a4d6ef40269e81e9f54532401741e2e047f2e208..ed31924dd769b1744df0bbe1aebdb40b98e1f250 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 84fa2a297a951b5b12e4d1ff9c91dd1ebf05912d..145a66c62a33c9fbca6a94ad904e23b438dc4063 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 b588ed48c0d113e04b3bcb5707bd4580d5caab4d..5a71709fd5862b910b13954a1b584fa9c0fbcc1e 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 b82e509616e783673d5f9179b8f5ce8a22ea6c14..89ff4107992800bb2e9d84c911538a49f6b1aae4 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 61003b27fee25f51745e278a7b21619417a98c83..bc47f812b3ae19a360f5cc2339190d4c81d9f617 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 e1748e8a21d2db26b007944ae692ff69cc910a83..30a1689bd2394a20c4163eaec42e66e51e0987c2 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 df9472489fa93d186b4fce116df2cbb230693be9..3ce58c8afcd0224babea225a165311cbb6378663 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 fa6dcfdb515abedfa0699fa0fffea6cdab160cc6..31c8ba7b512136304b84894069729640ea94ed4c 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 bfa3f9c9e026c3a6c1293580f68db2bf6bd65a8b..a16261ab82a47f08e892f514eb39527a85868fa1 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 09ebfb13519b403768cae888a8fdc04c3618f864..e7a46244a7842ed70a07de2dc702d37b86d57fa6 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 75361bf53bc2c66ec87f0fcc3819f7037feb9301..bffc74afc2c0cab72fca1aa21140821b837bef16 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 76d3a848a7995e03a65d8afd160bd66629eef5e7..1b086db60a4aad8403a5a353ab277b1957eae9af 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 b55e43669e735abc14b25f6816e0c14e7736009f..c197ac438f327d715330414bee99b25cd50545ac 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 2e0b6a5b0a11480d7a40604cae8a221f68f17948..c1f879ceeca200a150191fc5248483d807e0d8a6 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 d1653201a5645ce890758385cc83281e6bf40cee..847c1161cb8a912a9536c6dad43eb468d1cd0619 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 d6a203b38b807051e7aeed30b2cd1c3eb87a3035..b7af1e7f3cda95be4c54a9eb6f9ee6a12bfb221a 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 5f798780a3e7b983400c47ae6fd8804d9c4341b9..49ab4c81c16f2d6f3646946aafbfa04eaede6799 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 23a7e2e6f6a63326a71d67979cfaacfd6d9d6059..968040272262d087f67acf45d73fc9443ef22fde 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 c4018af0a19da21ab641c8be276603693f4bd879..d5eac225cd400cd14a9b3618ab143208b97b4063 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 cde80e8601f0fcc2e613098a7ce4aaf4b4439696..e8274de0b8669c63697d0d874174ecc245c94aab 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 31f1c29b1f4a25f68fea7357c63f14dab91bcfde..2ff7e767a32d1ce785ffe3d481b37a48cd9b3ac5 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 9bab392bd9e6ff3cf626fa6c8ac44130d64e0b3e..2c55546afd0c1f5a90b1dfd4827e437970a9130e 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 ea96f1bf42c216fe55321dfd8fdb84c513216459..e93ff2b76d21a7bbd2e14f532cbc02c3a85dfdb8 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 d4b4d17760beb7305799d25f4ce49a9b300ad14a..a7335f2d0214216ef59866ba442fe62013ed1639 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 6228b6451d9215c3b58dda79a2ebc7aee09a8d2f..f721ddb8cbd0579513d50e68fbff5f7b6eb7d19e 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 ca399944d843e5ba6776f434dc7cbeb23d8ec51b..a5900915fa6b7abb02e3a961c3ad782a51a2ab4c 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 b40d274d40f9a59c174215e78d0bdb5945fffeb5..984db6033fd818b1f095b15e729a8388d2c00442 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 c75af60b05eb890baf9be62f679439b26c15dc93..9d787ec802df969382c79d2192a2eabc2a974001 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 d8cc8ce8f9e5c27dae401b8ba47731306212160f..a4ac71896172ac4ad9b0fd38ab807e69db3866a5 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 dd7c479f3695941eade19d2222a9a95342d388fd..3ca9f92054fac44794f3a11bd1b8175be0c5c8dd 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 c8379004b3b223d7036560ffbb980a1a8ab5d33c..2a463e866df3bb7aebab02b8b6a1dec519decd2d 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 28896db70ce87283798e70ad696c960afa4a519b..656c8929937de86c3a2c5e22785d521c35eda131 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 8bb695c485ef93c5527fac56130c5f70aa131005..9010631c8f3dd3b9a48ff827a79ae6d01c0af56a 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 980a058fc5c4e4591e852fe99b6774addbe4ed24..a363944c541c79233cf296d094e4c7d99139366c 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 05ba8174cbe76b039d7347aba1028352e96cae5a..08d04b45a6695211e6f9e2ef7dfa6e8bb541c96e 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 3caa9b903e88597e67d688abd58140b214aa10f2..dffce7d20932fdfb69b192a981a8cf41ff7a6ed7 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 ccd306e38090e5eb72f45ac85abbe24bcf792260..91afd981139e803b2bb6d971d8cca3d44dd6365d 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 d60babf17db3a4cd6b93ff59af53cafbc430207b..3e21d24ebd8a14289ba27508c1f2a1275902f88b 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 af4795cfaf85436daf561321063d1569f93b1f8a..98fc3cd3ee977d8f424a82200ac5e0c748892eb5 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 137f428c2f5291a94cd13848a8e2603ce7dddc85..c8d25f74ab8a051672d54c3a1bdfa1443db72e26 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 942e94bc772af2dfc6e43773e9681c7c687199fb..2208e387eadc1abddb9fefc6cf6da8b58fbe56b5 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 5dc11f928bc429a100cf7831bbe7c9baea324596..0231a8c78f879e15fb42f7093a105b6bea2d352e 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 18472c515fd31727efec35a48ae24fa745cc1ac9..98bf32539b10efac3ee6e4a925153b3f5898ed43 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 4a82c7d40922cb405eca96e15ac38bdb4f428ae8..423441a58aaa261c1321814ae5bf9f3f959ad791 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 d720d50d2666027ed8096d53d48aae6d9cd123e7..fa3c763e0d0b782d8dc43281c9930ed162564810 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 922d2471fcd0e0fff2a778e44d50697247969360..61579858468efd85fbbee651e2c5e98f32efecfa 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 4c787065f2bcf6d99247d1b4bee0bf17049b2325..d2a954c343aed72db7a530f05166d0ecbb135eb4 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 f9283032c102d112f607384da45dba267fa33f42..7cda01913f801d9217737e833aca1203d486404a 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 55a06c5e6509c42da6c9b15ed095b2b64193c6f8..fca9ad52d4a6d286413e88e09e141d02c203eb89 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 6ad2fce665ed5f18a288b1cb4a0834a1787aee05..74c07f6c82fe9939dbb5f7a0de3fd4c9a7eab8fd 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 d919c49d025b4fff90785601228da58d92d14190..abed186141a69ed4e4931110856caef2898d95df 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 6228b8deded353a3f0d349740a9b64d710fb8f36..88211f6bf7b9d5e72b9b672300d5688464b5bd05 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 c82e93a25f00b6c7e98b7bf33d5b5dd8919d7cbe..234aed491326b90070fe127066b8cc1ac11be0d3 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 ec6dd801e3cbe5862e5a4c9009d0a2fc7a6011e6..ab09be6b0cdfae701a6d99414afa2d06d024f9d4 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 7a380541252d77f8ff5b529ccbc49ee89f288a1b..23b3da4dceeea648611b21af41db4cc406f094bc 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 208512683b774a2da8cc6a746decfbbc01c63809..cfe758d3bd69b452c484cdb7dde481259aa3263b 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 416bfb3889c0cbdfe119481c030d9026154243d9..46a08cf2258601b5ca1ad0c45082b447139c6149 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 9fde16deb03ff76ff17a02df02f21ff962fd5d02..ec8b76ad48192484098e54d38866e50e00bf8c97 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 305edd5496a87e0d53327a7bae38cd33dcaf341f..c65bf412c33202287fb6a0629cfca735ed9c4618 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 49a9f70b6e0e9bd6bd3d255c2b6a8c3ed67b9809..498cabbff3923aef5830195961a8c75c30ec971e 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 6b0106ae33f64d15b0a8a93b2988a9c984578481..8a7e1bc47c452ddbdc906fd7df85dd3715034e15 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 15628be399a2cc8aea96f57fbc1ce9dfb1ef1309..4e3095847bea76871b6d8aa9ed2db93685800c3b 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 785789690464c046fc1ae7498008d1ea936b5a0d..224225f3021ce030a80395175d2cd703ba7d53c3 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 2966a04fa05bd9679c5f75f81923ebfabb1dc779..fff36845635f177417fe4b1d04d9e6a1d054e169 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 861b4008cc7571e78a3ad9275c9136548721d1cb..a34e54e4afa969ab1ca36ec26ee511ce176b9ac5 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 15238eb1768c32b18fd62f015bee7dc16e266292..26d811cbc3ec9e7a2aa22bdee122654011f62f51 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 c1617ad8f1d4b4c35cf1a6c8774118db6fbca02a..19b1775b0a2c02af48beb9c29043bc9991c6d87a 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 7c1a5e411a572521f7aa15454a2eaeca89da3f5b..ae844a897d5a538aeb0399a3d900a5bfbf648e5d 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 34b692c4fd165fef76cdbcc79ccb431ea3348fdc..88ad15ef5d70b0e25bf745e2f62a16955ead3fb0 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 7172d689017dd8c97a92d12e93539113f54880e3..f07af2976978420495670a7e6ecf34a2782e31a7 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 58597aa578a209d3a247baa06377b5f04814ca18..279791de7d0105611be1f6eb5c289cdfbbcd676d 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 b0e5d31b43a5e32697d568bb000806bb2d89c62a..3bdb78ad0cedf59a20a1656289a1b3145aafa2a7 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 5b135dda67ecad08848db24f4fb80b3a0362147e..8eee1733dca2184541f18d4cd51cc54d1d47ab07 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 076b61be8e506801fbe58d7b0f45c980613f75b3..acd3063b902f51a4e6209265b94038b2d97c8f8c 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 2d1398b3e3a5569cf7aa0d47b16ae18f8a1854dc..dd8f1184a0330655752d738065f94d1a41981d46 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 baba885600305808b6cb75b4bd93c3519e83263f..cef91cafbfe720f4e0589735ec8f232e3f13c328 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 c7706a0512bd391b6f991a6c3cbe3f5010d1f5ea..f0599f82db9bdb31746a8bd8f0440edb7a5afc26 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 50221ed28673d5a669a8cd9362e4404ad199fa56..5114ddee507860f81026b3ddfe2c0b9826786f55 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 d23b623b7e52795445392bfbb556cf8a50d5486a..bbc57acc6b9cfad9610b9bbfba32eeb5b00650cb 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 85d5d63757695cce40573fad5b39344fae938891..994bdecda2fb7d727b81f402b89caad8a574ede3 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 404c9346af9dfa0a0751ecbe47f3a68be34d3ad5..5c63808a276bdb9ea1292554c7e80c95595728d5 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 0e96c03bfa7f4a3b10b63d6a8e618fe7d108028d..653638bc25a8383680525aaf3e033725074f3ff4 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 1f70c0aff1c3b2d5122253c2a086ea6fee214901..f8094ce8b2d9dc5ae70eb4f5919ba4945cee1790 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 237d35a797e59c9c25eabe9a796393cf2b3e1321..7a4bbd4dd6aec848af8c651a528521fca0742031 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 c6f740c601112b16ef671f4f3eafa48f5c4af796..cee9af9197f9cd682c31759693d08d3f4583e27e 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 ef7d1ecd19744858bcb79f43f45577ec49903979..4647499ed9e94e1250f3f9020d73236ea38f03fa --- 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 b4b600195ef298f2a8e6f4cfd4395a8eff310a60..ff5b3a9bb390e82ae1117499042b33c28e032b6e 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 4eaf7b80b6c242b192e74f23866a36d1776eaafe..3c9c8b5fa948d873e91a9250b68d295fbb2814ba 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 4148340fbdeb7dbd65f575080647e3b24f522189..0cb544d97e47f9750551c08d13aafd1f32659107 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 8ed8c1aa13ec44ff5ff8505ac233e461b80c57ca..36514348809c0937322413337b9ca94ddd259961 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 fba391f8f4761e876363d84ff96331fcee775823..37d6caffac599b7638c39d8f518ec7149f99645c 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 1746b40b243d90a3eacc41a8d18c70b1755c16c2..7cbb14d5bc467b2e7b39aae9a14a7bd6a4dbaf21 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 12be3191466a4733cc6e12e4ccbf55d4370f5fa6..bbe5b3e70868f2133da9b26ba45a440730061cd0 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 1377335cf4d129fc44f493086a8e4e648374dffe..1ce892719e090b08319a4001b9b4c6fbce3759dd 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 6a42bbf3016992f7ee99b6c385f0b50edfe9bc84..372c5e755334a843ae8c0de6e547f81698b8f4bf 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 127969375bac584ba8765f5bef50d5b2c8b6faa0..2d33ff714ed1b247becd1abbb2fc8ba6555fee00 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 a8da1501636da888fca04a8a2d9a7dc92e7a9dba..73a997481350c37ff40f5beb00e4211855a22ae9 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 da43cf26b291cc517f1f6a0f594cc86257290c6e..037e25e81a198d5edde358710676471a6eacf37f 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 78b9ef2979f029dbaa47bcf5f237cc87220c16ee..d2a3b60747311dc4e4ee2320883ae48770a50944 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 4f7de4e81087491b983e1cf12a2d505052b2c871..97c69273d353cff50b32853995fb9101d5c37069 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 4852df9dbca3653f0ecae5825043032c55b7dde6..a422dd7c1c90eb24fee42ebad09823c8739a1858 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 d1dbc5d52d1d824bde6166444e2520d63ea545e5..5358c1f52bcd8530ca146737418e16b2f4b80444 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 0a54f533fc56cadec5bfb9397237282bb621c1da..f944b7ebcca4c0ad01640a77cbee43a71c2c7056 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 6fac447a539d45f12a12c837ec927ac545d0990a..2263145c9b8f5e665d98a8aa1b2f94d6782a8c3d 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 718d15ee9aec916d3659cd67e5486ece92f3fa9e..a7eb7788985e260003dc9680f301f57a9b33485d 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 5dca3ed87228deb7c64a93263397d0cc77dddaa1..32b413e7c3ce4619ad60829d27e3c869788bdac0 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 2640057dab557f6e9183b2a9087c67e6c007bbb1..e99470b03ab93955eb280f65bce51fa26cec45ab 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 8986b779e0f220e67cff474426158c5b6e3d2937..1de251bf497095c3c3383e9fd74cf53f5bb6f414 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 755e28555c6fa6e266dfb4118b08b682e89f83bd..69a87b690882b6c02ef27fc554c2083c6c370902 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 39622010b9ec6728d9758c9902fc42ddfaeb1a5a..165e25171a459ee028b55ba682ddaccbe434afdf 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 4bf0c7f67b0fac0fd6d0719975f854049643879d..fd31dc3cc9a57ef3db1401c89368e7093f6ea955 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 d31d0006274a59fe0513b44e52bc692284d319fc..001a95b4690f980c591521b704949cb9631d323c 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 e881b0b07ab397b14d54c58d9002f54199209caf..b0d8842919ca01dabdc73d1f2bb9eedf644dcc2c 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 10859ef395378d946f0a58748458dd86749b7319..c46a533a877a92fd38fe0d379aae55eda3e64aff 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 474186622a12141833acee5105f48729aba9e80b..cbb5190a8aaa372e9646ee19279a73515dcd2810 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 d7848bc1163b01be7816f101f9d00bad108f4bda..f534db151dcca6c412e7235ddb4f31a7d89294e7 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 2d62ab9d3e08862701704313ee636db004d5422c..d149b69e318f640553a93a71bfba111568c9a1cc 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 d13af11a5658a078689945e80cdd6adc83979b78..6d2d1847239cac0b662322e3b93c62ed810a3b06 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 bcf5ae4da5a349c7bcdac7693a71bdd0473c4438..d47b5ebe67bb2b3460f8a5fb6aee80e1df0223d4 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 cd9be3878ececddb8fd0e52b10b55353d6011eeb..2d15f680d0c38e8768c15fef5bffc9cf953a317e 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 219d2fa8fa16d5fd76463daa509cd28fd056f983..177cfbe02d5654f1476d55633cef30ec7bac564c 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 2dee5e5ab02d59fbd2dd362a46182fb6f88aec7d..c55dd3082a518c37622b87873ecf7d3ebc824865 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 203e4e6d6588c5d2ffe456f75a1b38cf49ce95fa..211b6fb57493c866e9bf1ef4e2448cb717f8cb85 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 356294f0debe61cdac699f5d553c537e624ac5f3..f6866ba622a0ad03f7d4d0c09741a920f327a073 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 8c068497430c9bba06869142a8afc93d58f47018..bd64f870565163aa91cde7d9a3167b47849e2f2e 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 6fe2648d71f5c39b48304be8f820ca8b5f8c540b..80c8ea7407a467f929c51d96c7517ba2747b7911 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 2f47213337995aff3859892e58f05bbfa131770d..6b217c85c4ce6f96f9532441bcfac301a8fd9bc7 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 08d937db1dceb592854bb08eb2d8b3a26f54b6b9..4b3c55fbe0b93c07c65f6c483524a4d5a7200282 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 480f4c1ba6bcaa4cceb45d32a3dfafd36e8ea388..89e49b2f067bb8ac323846ad7bf025fdc8fe24bd 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 ad2ed43b061a893f8f98d9977c4ab9306e5d8d12..edb0f12c30024e7abaa5c6615cc971bfa2729f1f 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 48bcafa7898f39987cda23195c9812b03f608947..686abdb2a7b67a6197b0ad2447adeddca6ac5f93 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 ded05b26d9a09fddc12b496cddef1afc9acafdd2..f977ef79a447e2c4e4f1b313daf80b4e73cb2ea5 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 5a063e690de0b209866d7e0158eda24b11164767..64d19dd197b1b7a070cc1061585e43fe1f24974d 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 782333b0f70f0db93eb4549f430aa63fbfd75e7c..2a162cf49ef24f181fe6e6b774cf38b97134fb3a 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 b2e1dcda187c849424f29d79a250855a7d6ebbec..25a0d39445c07bfd7a5021f5627a0f0e687f34bb 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 16a4efa46714c794c1033107ecaae860944f7580..f74ad67b90803617f189200431d60ffe3f207e58 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 e2ac4eb5bb9f4b3e6a916d33a5c1ba6c071c9239..cac9fb7ec8aed087c1c7dc122e58235544fc42f4 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 ac2ac67468124e0e71c8075cadbf55738edc7ce0..80ba90ef1534f8ef56e2f4d9cc43d773a2dc66d3 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 116cdd4e7ea46b4ad7d5861361dc12d45c8562df..a532359e8ab0c09b30aeffa516314878a6e46bf5 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 d9f60e08fb0c736ad1835dc0ece70909affd6201..a92f66da2dc4457781dd99a26a33152bb80ca53e 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 b9b22653c35e752520eefb54abfaa5dd92db8ca7..fdf862a5fd9934d6b509cd90b92a588f8fa3bd89 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 c31b6bfb8e97c3e339f3fcbac6d9443fb390c823..623ddd1ea4bc33828ad8df3a87c0e2c2f5f4330b 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 86034943809f982cb661f7aa37e0a5fc4451a59a..c2f0ccc8c8280f8e07ba96f92187ce4d4c69d03a 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 0b04b48c06dbc5255de97e9fcbe1f06b9a5e9a7f..345d084c4a97b605c740ec0dbd6042d091fd8e4b 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 67570bab1e1862b358b2622c3463796d356d4597..959f732e7e8d39fb4ffeb2534acc65ea4bcc99e6 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 1448a2ca9d2fad57ea7b63662258054a57851527..beb66c89843592011ba74138a348b0d299df9e94 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 fa4343229c31677147cc7afc7a40cab4d4b574d9..ed442b8052fba33495775074acfb5f9240ba6b45 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 67dfa5bfd0d8b0101d2d431c12a5728264910233..b360a7ddf089a852591e343f9c90bb361da02d9c 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 5af907685255258832c496f500e5f24b8586c58b..e285479dad82b6881ea15bd83afc7ca4ad28ca7c 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 59b151d4ee8bfa7e22ddc98220b8abbec4c7e8a7..2b72ee68ec03ff338171f25d84cbbc381aefa55a 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 669ca99c27adddcf0467a6afb7e3d09f3ad9bcf3..c33f55843c6cb542e0848525602c64881063367f 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 04dd14bc3b31a4ad3f4460607a8018ff21bdb892..c52a876d2fd113486dbf5d1b7757119e85b771a5 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 5f5f01a681804f386b1a5b80d8e6d41bc8aec1c4..37eea11a50fa87206899fc57871d7ff0f9240683 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 4c243724ff846b66cf8000f2acd48e252566d4bd..b616326640f186190b802d04dfeb9bdf270a0aaa 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 ff0ea5b5e704c7b0d303c3701917704de5f0a4c4..13ecf3d7ce4112e9ca7fc183f9b18012cc177e5a 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 264184b7468f499d29a1808d5a9985a096bd1142..54f6c60fe66afcd68113c409e0cc3600beeb6f86 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 149652668993e745a5b6faaa42308a372d6680f9..c85dfe482c1e1b6d3d52944af017d80ab611f6c7 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 f794e8dea3ffcfec15e3c59271855c9d620d5d34..a42ef307b5b8443b11e006fe4089195be8b193e3 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 385b270a2d1f9a162d56965217812e3fb5c22a88..8972b4de98e2e0f8a5c93ba789bc68a408f421e5 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 a7be421dae91079b7eba56c9eead2c64ae6ad6eb..07ef7c5da8ac4500d6eee89c00e1ec689a74b1de 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 f570f454db61908bb2a2cbbe18f5b040f718dfeb..b8d1ef6d1f1481066b2bec9c2c71d4baec103210 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 35b91e029ea8a52ce0fdb0ecb8b6dc3f9d04f2f8..61a78a01a54833e74c5ba6773cabd92c190606db 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 6f4ba55c02a8136d3fc747b14c1e958aac5da1fa..189b464ebcb26d767afb670d4267fb3ddb974949 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 14755858c49d3084d806e9411b51c590882bb88b..ed93d1bdb74be4bf04382bc2e0c57b9ee933d1fa 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 57bb827a9b3de6175b81790c2488e62d88b610d9..4c9f1bce5cb7d57b0673f735bd2af575cca4d691 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 610059adaeb76e6d5e71c9854073d335befdbf67..5ed52dd0896872da74ab461e83c3172ab5275e0c 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 9a6611e66b2383f05b6c135fece4f0da9d0d3ab8..dd09c515cdedc9a80f2685ce602e1c8650e659b7 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 07c35d41c83013bd0dcf6b61d49a484141dcc881..a2b0f8861323ed369861f51933abb57c92419779 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 725bc685254d4e9a24ef8ee610dfc9d2026410de..f5fa472ce592e708e9ad9745177e1f6f656df284 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 0074d4829a113be3a70696d141fb1ccc07ce2a56..18d2e7e210191c0407661eebc6852e412caad6ed 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 3a531805c50a6a0ecfbfebcd76a15e389bd46823..25a1ad01e6d424be4b15622e90bbca7560e1b43e 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 9a2132ad6b6541bd8f71974bba57fe458cb851ca..2ee5308901e8fa20ad556725a732bb42266e4282 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 3371e5c3169442999337065bb4c1e74ead900907..b29888b9801e0ffbe3a9baf5c056d0dd5c3c75ca 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 d3eab396e80c5e8a02da71b21ea8f410ffd86ce0..854b1fac5add442baeca7734a357a7450f170ca3 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 e7f2cd92d9f1cb2b8345316e72b3a67206b5c845..336ac9863964f7563ac8771c92199c4bb9f10768 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 d62a0619d25ff4bec1806c7acafc716407782288..8417719a197d20a1f00253409d4ab9f5ba53e871 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 5828d6b92c05814aa641fc04e88ea0a6483b3a10..5589d71ea6272a3d954bc3cda1c0ca8de5d1c0ed 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 719747774dcf635570eaca184788333fc1ef29fa..025b5b05c621a11fe7ad9bf09e4ad040477a46be 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 d3cd3cd84e3671c1b654fdcd32da7eae2574a417..1ffb4c93f6fbc23207b24884d8a7aee9dc2bdc5e 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 554a5a09e39717db2ccfbcf52dc32e7fdd0a848f..c05fa4fe2d870dc2bd92c2b81bb5ee2314a4ca6e 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 3a1c98bbac36c5e6eb54dcc34fe1fb5aa02894c6..721c8b09e38052ffc8d18d027fe6e4180efaa384 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 14ef9b61ed1ffc0d1fe45621b809964f5b5e212c..f2b3f2d1784732148557e49953015fd34033ae16 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 634aec7837afbe27c087be7943e4ef593535683d..33e6cf5d74fb179793fe79ad025667dd0356281c 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 1321950bec159f14940b639748d9ff50c8f22d10..eef0a6aa13f626ac5ebef9a93047f81e00623434 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 91394eabe0df97e056928a468843bf05d7e0d6c2..0cef1e2a1a349f78f18ad1b50e287aae128ecd80 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 69fde5eba9ef9b30ba462b060ac77eb989fab90e..8d9998213b5c1e7c02e6144d81d50a2683f7a265 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 391f5d6347bdd071b35b7dd96feaeb245b792094..53da381cbfd642029861ec0206e9d710bf7fd393 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 7c6d6365d66e50df0238a97d5645ebc84638e657..8d196912a6cc62a19f3815d2cfbb963d7331772f 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 92ab31b5e44a32d0fcdbecf990eb7199f747d7bd..33229964525748980078611e320e2367337bffa8 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 0d66eb96e4c85efdf70f3a7eb2e5c0e68a85cf40..d14088414bc6779a2c59338d660421cc78f32cd7 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 e00ddaf1f53817590c7263205b74a876ddc84657..58efd86bb19a028dd81884533ac1108410ef0ecf 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 88977f21e58132bb9f8ff4690398a5662260a3dd..9908b92f6728726a5d887be0bd7ef65084d48ca4 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 f1bef13738e32cf2da30911731bfad3702294a33..b9d11c4918d954a203dd5f9de94296f7c202d3cf 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 cf77a8666491b806fc4cd7cb49228fa89858415b..0137666949c19a39c581f35382d7ed02ba966c63 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 6dd4a0409ddacd657d907b7c45dff258af2a892a..5b6d18e38645a6d2a60c0aa670dffb4491cae70c 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 d12bee65e39198c37da4509a1cfc30479d3a5369..0ef3a223c671607856c85c72683413dad462c077 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 5da011e00cc3c076363c2b6674df7b16683f4ca9..f99a0794f4f383308e4821d43ace07e9925ac28b 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 a1b48a57fb86956dee78de18d57f00a9e9dfd411..15a798b2e6c7beb258cf7902263b6d99017df259 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 e215ef7d8d8bfd9668392f90cc7f321590433528..a21b3a45885d4d09f9d3f151a753321f11b0d7c1 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 886d3acd2505c40fa510df1dd6fb7ddd7d7957c1..ee7169ca028a3912ee03a02566d622d68c28a1d9 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 cc18fc0f6ea0cee575586dc94caba51fd6e4b39b..4797aa4086432becc8f096d9a88611ff9b162110 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 70fc3f09edf07767720f286aa073cc17c8802db1..e86813e2c8207381c52ec62068470017dc269f3a 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 98cb2b739e8563f81f28e18ee7c9f0e8d4c298b1..28566f04bffed8eda0be8e9e84d0985838adeda5 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 486ee44393094379bacb89e2187f9df65b44e652..d20c37df047646e9ca22539ecb46c4101a546dc9 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 65e6fbf33f4d38ad7b4c476dad5b5e9c9eee3672..8ae674a331366064784165ad712f5c138724bb82 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 8450c8f1029bbc3de1b2201609d884e4066fd893..c785722170c7f4f71a6778278de82017247529cc 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 638187a81c07cbfc05386f380a9391727625c2f5..7d6f513f9f6c128bfc8f3fb10f778c3eb68aa8d8 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 2c16ddb1c169e9ef19560315170de97c33c3d236..dd66420de1e9db9f0e6ca6433a43214a04e07174 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 9adfca8b4f4b3f335ca40feef7ac3bf1067d5853..2223053a4bb3c30349d167840d47209f4345b8f8 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 bbd11a268499840eaa00189b44a6a1d8afb1d4d6..632f4c6f9603d9507a286be41ab7388b148bb965 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 091890213438f211d752881abf928d0b71fceaf2..dec21d411e12123af9f4b066b155c9969b01fc06 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 cc2b0e13d2604a2d0397268296d213430c9dce55..be38f6a6e20e475c36a06b612dbba890be3f029b 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 539bd4e3e4eac6e0a4e2d0356a490f99ddfbfb2c..08e5d3b79b855bde30f570ac9e09f7c9d0caad51 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 85921c29ee2b3b673bd46c9aeceadd0073106128..6632b7d34e386def1ca5f319e3fe0608254c79eb 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 088b601cdbc1d89f12fd3b6b55888a0b79c51f78..bde1f9ad66f51077ffbdafd7ff6a64f7d74724df 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 0231d1eb0dbd0c82d6820f95a5b7257de3e6dba0..c4ef8819520220ea5130571efd0e13ffaaaa4305 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 d1b15aa5b3e72859a00d22ad634986549881b99c..167ef8f8ccb188fd7575b6d2b60674db546906df 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 37c756bad89ee50995da2c18b79f546de8507eaa..04951bd427c6b04e36b70c198235495f510fad6b 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 6f572f4920b0e5e10003a3ada03037ff91d8bbd8..3fbe86a1cabf51308c8372cd219317767e18c89a 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 ae8286f2acb379f9421deb1f4fa222715865a18b..896c54f143e4ca51c88b1b936c822d87718ec67d 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 858a9f3a43a4ed6567ee0a30c17aad1b579c6446..89c3223d5f2cf26bd90b1daa8f105777e2b59d1f 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 e14d501baf5d30aedf6abdf30c6057a7c03f03bd..82d7acebf908a5cb23c481d647eee9b4af8eff9a 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 bbc5834714f905749e966f5f1dbbfd127a7ca622..8a9114a2f949f00f621a74d8dc149565a94d5f52 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 8a9e25eaddfeae9d62f786416ccc7e45ea779742..b6c6255632e579a27d3b21589a8a1bc231428e87 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 45bf710bae854690966416d8a94e5567d18278e9..dc9b065f3a1d2e8ca9361162dae7bbcfe1092e22 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 8d831f811d5b8e6119fadbb0066a39b6d7761b51..6f5c611c0daf10c7e74272c1afa5e79cb9690572 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 d23fb4dfd9b50b59b34dcd1df5cec8536e2fc62e..b5c84311ddb6cad14d4596b471a44a7f62426d70 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 7f7cb37137bca4ccc7eac912851bcd87808dadc8..0bd9820d4243017e530e01dc14119050f767d0c3 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 d00fd3346b3ed706153132f96d464abd965c5570..f226754dc5a69d1728afd8dcb1dbec414eee51e9 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 eaa1b677dae0d160f3d3929029663aa7aaae2a51..d1707185048a9ad2c42b8869879cc72fd29d799d 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 4d34a3912bb8dec67211ff337ee70e4f9b697f9c..f57d541b5e4ffad21580e9dfd59c44374c0fbc8a 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 78c3e9c64a7dc5e8b3e981fa58fbf233eae4bc1c..296a7351aad4db6b85c9e7db39f38b5e2f391c20 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 6b1f97fa2dc43deefeef8f18304ee57e25cef980..3f48fb625876bd441601add147f625ee34ad1fce 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 1bca9eed8402598f0ea1781b9afec66ec8cfaad0..449fd3a826fd90f32ad13ede5d079a64d3fcaeca 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 b347887cfe9a150af0f5e5d012f49f28d5ce3850..1e08fed512f3bbe38238ad6120f91d6a180a3818 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 e5906cbfb8aeb041199046fa1395928ed782081b..852085428eb01306ce43499e6087e763689db1a1 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 3dccf57fa444d8e0cd2475139087369e3e3ae8aa..dd23f85ee763f87744d75e0b406ccf7d46938e7d 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 323f3d32fb096a9225996a7651834421126ff916..8b12f462cd54c0b23236d1051987608aace1c723 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 c68f4ca4c8837485be0acbb0a63b74c70c5d202f..6818ab677ffb73dc370617bf77d4a85adae72da0 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 38eb7cf9e430c59678dc8034dba1524d7e357b52..f0ae9ae45946b3b0bba39f8b5ee6ae647b57a51a 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 4748f4321b508c235cc8107c5a201aab846ef1bd..0454b115e70ae8cd557cd11a110c4a13510f4056 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 35b521619b660646925be6122d72a1ea57ff9780..232c13f26158559f1c78c0e38d7fc0b3b5976283 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 777a605ba36e314712deb967112115ee84230a0a..21af533d256431a4f158c3d6075c83822bcb2c16 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 a947c10ca147bcd9a4e3eee43e7f145ca0ca9d0b..1e8a6b9b668f2c2dff4bccaf508ffcfa397155ab 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 d20fc89e69052254b20d2beca76df3952d9f9c99..2f987e01cff62103d581289195bc54f7f53b5040 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 163984352992432bcfa11eff1ec288fca80997a3..3d988219ab7a47d35b19748919183901556f7091 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 82b02f3fc270ace461301c953d571ee4e21e6dbe..da263ef53426d19d6796c948a9c6556fc21a7ead 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 5a8bf1eb34b17777222f43253b0870143468f812..ea253fb2b8a1baae7b0b10d9f2f96acbb77b57a4 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 63b17dfd9300b8428614f4c10795e169aa33fa07..7cfd6fde261c434dc404f20194b63ec419d6d46a 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 7af39ebb2fa509f7d50b66d9df6447235604fa39..18b0fcb47628af76a705509f51480cea9d80df84 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 37f77aa30ccfcebb0a8c1116e0e8c4224e4a5263..846cd5c2dfdc94853a2d726953553db26228d661 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 26363b9942b5b0f25bf8134de3ca7f9c5012aef3..b9ea92bfab5d160931aa5d049af1924b9b216871 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 13e798537f9bf3e2356378c63793a1748ef89e53..16338934eedfe7075f0d203d5ef4580f10b351d2 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 036aa9832b36856385dcf50e9d9c33637aff0fae..a06fbbb36332cb1cfc87a1ecb4c7634a520e4b04 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 1970342362027ca8e8c68e6b1761fd06dc71c694..94e55b83e081485fda85e790d0d37ebf14a73c3c 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 2b132f4bb98adcd09425658fba38bac2ed98e3f1..993381acfb8e47cc2e0c6d49f41d7f694a5ab298 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 3617d7512380c51446e00430a18652b7eaf0170d..dde6807c79bcd40cf22cd97c75a46e3798693dfe 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 f2c1fd1038753ed5e41365fd637570e846036b6b..3c7a41567dc75b59d9a40acd58669a090f790428 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 63e2d617a002942fd3497f0e7f4f56c3c057250f..3c1823e71728be4edf01e102346423c995c45a00 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 46bbb589fc4dcc51a0fd085e09886a31effcc9f6..b040313323331902084da0c2d9e58a996d96878e 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 ca42085dcae0e9c841f4f44f4ebdc471fde45105..2c9ade913f157fd2848007e8fa375f6ed22d3473 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 371193b64779aff0d130ea018694ccd557a1f277..2606594b41485c9320115e02801fd947ab0816ca 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 d40e811dc48074f3e5af23e8536c352907ad8716..7618ee2c83aa557911176be09b2de06886c2464b 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 c4b18b42662e334362de5dc724d56e596df83b83..1a9841ae16f486f8a9147d4acaf3e1314aef6eb8 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 8eb841eafa2e3a8aa420aa0d08b71d0b32ccabd4..5762fb3f2183a2bec75c1cf8642826497fccaa81 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 13cac7e5adc92e9adb5a2c68f2c5e3fcf6d898a4..4900598df955aedba7a21ce67329f7a527fa7458 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 25be4a13f6c820e112814fba1ac2765658ec27f1..91e325cb30c9f17a2bc1e7c653c1917cd7ece3b0 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 dff2e8a7160b67f92935c19f88e3a8e7df735033..e6668746ab6893382ce1e3841233f0b5df78b835 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 4a1d354d38240ca0b0de0f0d433f743b862f4816..b7c665e5dd81170a3001aa3a2b99cc7cc60012d6 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 57aa2eb0c8a5174e84fdfa2733c8a091fbf96c9e..f9649f6adf87974bce8346d9826f53cf18c044c0 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 3d5630de7940dca7b141d527d924b844adb54675..3258e18384ac71b54f9409033df13648d9c6ce5a 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 086cf3a1062d61cd5bd07d340e1b3b7eb012bb36..e704c557a3c6fc955cb30cbed310b889a35dd4f8 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 794e6b490122f5a54489af48296ba364e26e1b5a..a4b5f6ae5e7e3dd285156de9315efef46accdf99 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 1e2133b1e9c28648d745453960d1a37845671b6a..8ff59373938298b2ca4488405025acfc303c2a2f 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 e49efc39aa28a19199a5cd9e1bddee4a66545b69..67023dfb8badb1ea3972f041b491b3c8fd36f604 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 cdc9dc899d3ce4e27afb7a57346114b8a503a31e..0e483a4bbfb4316b68d4267b34174297f47d4cb5 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 8c59f994ec36f89b3f1764a51867226418281e43..33f74478cdea90b5a80accc78afb6df12c82640b 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 031a10a268f33db9bc09310b03252c67227a90da..65809b4600264636d4b902d172237899e919ef64 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 418cf525df7584e4aca6dfe3eac515c05fa8b4a6..d6fea4a7f162da8b909ef04b1606407b64b69a5c 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 dd1ef1b5fe14b963ff478792554596f0ca9640a6..a65a42097cf75020fe5ec9cdaba721ea4179adfd 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 1669c95d9c8fd0adbadd78bf3259bcf262d371b1..0192b367bb50be8e5ae263672d5f2051fe004eca 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 db7ddb2fa586974c556468613129c0bdd514df06..c29a59b26d3c2586f72007d4467bdcac10179c76 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 59a06743830ea1f4029770578378be3d452cd0f6..7642cf84d851c54c1ad3a02b02c787eb2faeb4bf 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 8131123c579a05b4f3d4341de1cdd85b7f506ef9..fa82a17b763e2db31a98055e70e6e36332de7a6a 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 0c5852694136f232c158f7505f5a8a7cc2d60957..4a83612ce51b689608788a9a056efdd8637f159a 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 a4eae9a6a5389a3c03458c833c172cba5f0531af..337b2901c34f3115ae0e8eed31f36556dc22ee00 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 635983a31baa0792e2e3537967afb1ab5716a4fe..b78a80332d0524c7871bc812bbc218ede948554d 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 b93f1e2f577d71b0b9e0e798cd9a0a0c146c0271..7df2467a33d056b9c76ce410517e6b803fec586e 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 a5e54dfef26c1821685f0e81171f994ef8af1459..aedbf9bf9e015a431055f8148c5e11a09b0d439a 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 84eeba41e6b024c260d625643899867911f9f9dc..1661aed4a106d69880a9967ad4b54394bcb084b4 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 38526faaa91dcac4952f591176f341950f7400cb..cf669686f916a3875a01ae2b6361c4a28ed54f9f 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 7f78142bbc141c1bbf03e88aac505221e7d15218..05f39b767d7eafaf4bbc7e5e1d3fbc845ac32eac 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 76b0c038f4b04ae351960cf811d1827e0931f95d..0a5a573b338eb667d48d83e0cdc72bad4ea79338 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 e917e942adde8a13bfbc0e21b7a5d35bd27562f2..4b20fa7d727ed8faec04294994cc98a48b2f0525 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 a962714a0be4d3ae86668a1f3ba99f47a4df5e81..33867b3977ee08a3e2b9815ca715e45ef32f1e07 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 9a2cab2078691a1a5a620eb880b972d2dbc92035..0dd0f47b4540168609066d17e6542dabafc5cdfe 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 e70c74211b0d9020ea7a96b0aa1a8d25eaaeef62..146791fa8ca31c023fa2a992cb91e8637129aac3 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 91dbeb2714294901d553590e005359bdd8ae2ab6..46d4609c36b30aba7cdeb676ca1ad52629912623 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 7455fc6a9b9af77f8ac43367bbfda5b3260943bd..fa86c3bd724f81396e9b3f70e6dfa403064212ec 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 5c0922d6d4e80c536f93667b907c00ff04147d45..b81df85d58448db8e16180b58c13dbeeca86faad 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 ec1756302acbbea5e013a2ee1bed478df2c35bf2..3e02352bf3f89778e9c4fba17e8216b502044399 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 1b3ada93b83446b9bca29dea2d147053f6e901ac..0d8617759dc7926472c2b8222b940a36bc4b0ad1 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 692d9bbf74615399a7d1d693c9a4766e8a9e9d47..75e2117f1c76e8257675be4280f12dd490e2262a 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 dd59ab7087c292be8a272b1c7bdda798f080d007..46b08bb5348278f5731183f51191c365067bbb13 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 488a72b7d688ef6685688086127eda3f9a1b7bf4..75a9d4699b65a08ff7f97c93172e167c0188ca02 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 08cd12e7aee0c8b4a66b15d6d54b7f47d72c0348..4a632d8c3162df85544c4e68f5d54fdc10ad8cbb 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 6c1df05c9ec3ad683896f9f186dcb74ff6dcbe11..34974d0cc0d86f20e9428052f51cc149c2665c99 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 128a1e1cb1edf5c7514a7948b544cb5793a093b8..cf69e7599ecbbedb5529e1671d1eeb16d337c304 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 ebca202f713cef8f53daafc0a50e1655e27a9239..069f06f4efbf61d1cd1273cbe9a2520db65461ce 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 5af8c3a492734687970d6b1e8c5f3b641f2c284d..d1e956843a82c9e489cd1be38ccdb34cca8304c1 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 4f7f12a28b9737b1bfc6dee55667fdafff544d4a..4561ee2e8cd274ee6f4b1303d05a9c259d497307 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 b26a97ee3e4408c45e9f2423e07c941164bd2403..23177f0dee9d2be7af962acc6504f5a9470b9138 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 66e79f6047d330318ae7b20ec5e58b5df7c29c62..b331b97be4c3940db3ab9b1b6be993cb1998ce26 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 c01c11e4ef8e9493dfb30ac043cefe412dde26f6..1bd787f1e93b17389a2dd6ed236dce9a3bad4732 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 75751ae9f4d6fd5c88619734176d61a5db0c7005..2637c3812de62b897c303b8f097b944a85ceca9c 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 2016b8f636d8523075cd27d762a89cb265837daa..71e1b90b4f1aae40503b8b49859fc987c4333907 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 eb141ba5dd0e4e4c2fff1a35b4502f0546c94f37..5dec704e823e2a721adae78a7470ca8b362b8fc6 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 60505cc6eb4810de6a104f166f248f67224b975d..f593fda7ab1404b710b80306033b4f2e64810051 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 96679b5159646bea70facb7c16357df39e6d8bdc..d6fa0be6616f8eccc7381e930ccf73eccbeb5385 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 1e4a02326d59cdff80236ce483f726e70eb641d2..bda40b7bde2c5fdf183f9a656de940b88dcf44cf 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 87dc9518f2a5ac2ea5d4b7c1ae818894e1c9bfbb..288e33f8383e1f3dcd47076a3f3d489cbee0850d 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 a754a4341d6f8f0436bcfce7c10f3e46a666cb1c..6cd81b9872f97c6f57d4ba9b1a0df85b5d5540ed 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 81bc30eaa7ff3cbfa8f1723709b6527ef69382e7..07fa70303b5bde52c808cc86bd899acc77b2320d 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 e09dd804cfd02942ec829d5a92fdb3911da4f5dd..1bd1b3cde6aa3a08dbbae8748d7ca1fb8bf896f7 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 c3a50e221b66a888bc04e19ac46fd5ec6ac1c7d7..e8e5f7c19fdd85184505d4b3319af970db437b0e 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 b2e0b8610455614ecd2b075a8c56e923026a7654..8bb7b262b3b03b70d8f3a3480861eb09f6320b74 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 5c716014f7c8a25af4761ab940e6c980c85d01c4..211aac7a466bdf84f7bdcace0dd5a4d3be759eb3 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 03608b77a8afc9656f0857ab75ac1df678de1a14..31eefff2d27885da62239c83528ede0ae7082ef0 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 f783a08464de71d23385a8ead440d9dce6004387..a3004d560bc49454587317f30d3c3c236ac786cb 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 4935eb31d9ec6869f5b2bf5aad2e779f4ee64260..279d1f2c339901a67557c112c06f5113867dcd3c 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 525532b46ccb13632649fb69f96d95f6cbb79532..849a9f35071b4018ece8e08d704289de160118eb 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 1364f67e37e4ccb3a3238f6a4790920eac7d5255..38de0bccb0ed291a228d68b4f84a5b86daeb87eb 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 ce3acf230cfc9d57a074cce8b7aa10c0f4338991..0d4affc48e0dfb1bde1a191ddedb1be25ccad949 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 137f4305c1bc76d04663ece96e66cc6160d3fe44..3bf59db272a5c5798418a4c48324a20797289b9b 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 9fd803367767ec539bcd8117d34edaa239ca46e0..621cea5b4ca5db357adf63142bd5a4268f422416 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 00c8addb6e0a1667dfd97601288562b8b7ae3d74..3fa05a78cf9bbbd6fef198f60bae563feccc0e8a 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 dc1a69a38ded04141ca274972afb186189ab7263..03332f13db724bb1375ee9d4d01be9bc159ac502 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 87d936c5bf15024a2d43c05bad035947b75f2f76..b7c44fdb807f173fa27120eb3218289e48034e83 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 6167de01b0f30da46c771ec2803ba77c29baf64a..2356cce8ba62654315aac9789c37468ec3a3694c 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 ce58643b737a6bba7abca8a03c530becd02c9a65..6edbab879e5245bcb0e4ae027dc41f833cc79eb9 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 9c92d8f358533c0f1ce8e342d32413e1c3d70615..acdb3eb65fbead799125f6a88a82e1259fab7f97 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 2e4a71bd41bcbb4365900adf3b07cb41bcf32aa9..bb8a3c6ea8d60d26fab1371ba57d134b19a364f4 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 2e7ad48ba3c58e7680e8abf0b444db49b6bf49f7..90f8b789b4796583a61c96a41ecbbf4900810376 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 95f46a5a82b52399f208234d211715aa81fd96bb..8d478a41fe1d6706ad5434f3ea9fe9bf24e2af64 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 d6adabe5ed64b774fe1edffae0fe3ed8bec485f0..868a713e97b1728802dfa2b98698e6a9ad95ddba 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 689ea75a7d0339cd81b26c751c21573c21b0700b..725768b8583133e8fa4e48f8b655e18d739cdd17 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 8575e42bd9d713062dbde505ea140c71619f2cc2..b634262b2b298755babaafca8df48e13b05f3d6c 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 90055873805278d129fa618e1b6c16c5217162ba..ba212fc3e336c162bad39fb72698acf416568a4a 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 a21cfd2ad5fddb6eb3e8c6dbb5de8553016309bf..65baa138cf1366dad5a08ef023f4a048c81dd86b 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 5e210cb13cdc43825c1b1af65e63e2cc2a5c27f3..ae56c34bd5ff51f20d65877e43b8ebfb9e8276e7 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 be3e1d08319faf6de95ab05e77da8ddd64e76211..eb7febdc8e2f9453aac7549624c9e19b922171ac 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 2fc5ddbfa1e8d3a1a4f9714520f6ede05e11e5b5..4ae51d9d34da764bebc59c044c2d2541c7f0fd60 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 486e15d5079428e78cb866d3f0afae335adf4c34..8dad18f521a2b76016513ef31cd508b94105e608 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 40547f8540980204f622544b298ec35d20ff4829..200ccf388f6144c727295528f09bd00debfa1dda 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 231117b3e7d10a39201d2bad10db97020da82d82..863ac21ba771ba0bc499e3f2dab65c0f9d856584 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 100981d3e850a1188d30422f5d859c20d77ff45c..ba81cd830062fb0eaea50e23a5e1fa4337c5d8d0 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 7f466fdbac8d062f735cdd3134462ea45a0d5cfa..7a1413471e9d62e649292804ebbc8e39a5ab4e49 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 ff7444df05e814131aa229aff665d5be56838224..b86291730c10f1a5281a020a5cbc1f74ec8b6656 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 655c2ef29a0016cdea251fea71e3cf6c5e21b1f8..f68337b03f106b60fd626e50a48c6f962a969f19 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 49677176100f826dd62143795e56a06c430c8ada..705dd644944531c2ac7ec384f099965e2a066d82 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 dd447e868d515c3a9822d28e89c9c03993f36d0d..17e3b5e498a36a104d6abcec350ac333ee3b21a8 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 113bc15424518ebc340761541135a5989edb3be9..81937081bc0fce19f19b66ab34ab484bd1e3f597 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 8f7161298af08f47a1689350b12b97a82786e82b..152526c5f889411cc8d9758871e62f98f63e6a14 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 4442bbb41a9b71b2bf84e98fd4862cee9956fcb9..461e50793e8ffef66e0a295b5a41d2917ad802c4 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 657e65be83e048f0a34a4a1396a25c82ebe3d496..34ff89d1251948dd101e52097d416ac57fbf6ac5 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 48db287a6b4ce4ac71507c5175297427ec56a5cc..4e13b90c7a24e79e2e587a055462d9ca5a08e0ef 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 243525a56567d4cc1e7a22b9fd73be94b2e83b83..565d981e50bf09eccc7fb86d8d4e549136e79472 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 3dcd6c90f7615cd1bda1daac9fe274743a4b97b0..e6cfdf77fc3389b1eaced43a54fec15d60a9f724 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 9d6a9277d22aefa00548c91f2f9cd1135f939cc7..a693f663602b9bb3b822cdd4adb940ccefbdf0ca 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 b015e1bb9a65eedf7517991997818f5a0c21120e..22a327f5be24be6bad0f42b3e756f9d40961a58a 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 9b444f5dfb17c4d46d89a6fe390a7f5cf8afcfff..7af8ee64098bd19a3968086762bdc7133611aced 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 7e45dff528d91764a123f4f26644d430555fcc92..168b32cc6c36507a579002ee87635a4ef3afc77c 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 7c5f01859206f357c54460c4da8792a1c26829f7..d71e7f9a99e00e3d117f3c082e8c1c30b6bc4fa5 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 b28a09cdeb31800ec38807525df7502aaf764227..7433c4d9bb89d8ec5c8f1bbf6e8f64364e160c9c 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 6d670797ac63d7e55fd128eba9426f4f0e869ec6..48a665506f4529c78049fa3aab09ed1a1b3a24b1 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 f7e80e9035ac83d01e461c63d210c7956aee2da4..f2440590f541d5c6a2bdfb3cc6f36de31524de25 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 24d0f8a0c6d18f64aac558f9a853887e116291c1..44a6092d1c19849232099a86e503223d9b6d9fd8 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 3063f95309a9e23e075b6f26ee26f32461248df6..a052e7a6cb4710a290372ccc3ff0eea7d1695785 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 a6ac50c8ced52e700c3afc3fd4715aee6654fa02..09a4d769a0a7127e6601ca6dfc695508f09c9324 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 fadc73c4a2e3d1f25cab1abe57c0d7f16e4cea21..486c1cc1ce4e32194b31651a745614fd5b56c351 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 765fc7a3f479cdc3b202b14ae53baa4941ac69c2..66185e393d21b929614393a388872bc80bb3816d 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 89ff474c99b531ced635d64646293b64098c43cd..f8f4ffb8a0b40ce6ea542654480a5419de9cb702 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 58fb20572b45caf27660106bb451ac912faca728..eea4f7c8f3521fcf8e283263915f9e2e707ba425 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 b3d80847f5e3ea40421532878ec153778013db66..32b9960f3d9d914551a8da02ca595084588a3964 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 39564ba2e0eb13f160bde64590f80db77bd87ad7..b9a28001961d2dcaf3759b13834e64bff0213864 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 d752a91dbdc8bde98c28ddeb0bfd10d2dae13d5a..0eb93fcf4537b1663f8ed2e7ef3ff487838a111b 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 5b162a109ae52b2c66cee701b5247bf44fc95f91..b69bb090efb0df36fe57da243f868208c200f8b0 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 4c4639f22384e610dae4f980d7addf5f4177daf8..a27fd2575f8e314b77d8797d521583772ad8e59d 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 5793715fbb54c53747e8c15e83a9d067d3870745..aadba4f7f7487e9b5df819c54e37a1e64a57a8d9 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 8c084fa8412f8ed541a5fdd362987623bf1459f8..2aa9dc3827c9440424524375316d74f2ff8de4b5 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 8fd7e2bd8060af9684b2cc7a0a6690aa337cdc8b..e4d656ef2288b5f8efb870562a9d5a6a2cf4011b 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 1575ec7eaa3be62e7e8d69d6b69410ca70101e79..3ece929f747eae718fd2606d41455350b2087092 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 50c0a655dad7808c072b467333a4125036f920be..fdc5f341dd2380ba8021e4752bbdd1941b2f0bf4 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 83891f128c3681ba1ef658df7c384d21e140fcf3..b9d1e159b7da61f81063d2d2dbe91d03a31cca85 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 4dd4d34cd89a7ae049048dbf56563f4824973bbb..0e369f3abfd0d0a9ff5c5df06a25a5c9405cdaa6 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 d780699287d9a2ee69ab580110367858736a5832..095b0e4045dc12ebb83438018a6b75aa05b0a9c7 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 b869fe75ff91c272d5c9108986b2be5f2eda2f99..9e79de3f1a8d03a47faba834c6aa42b34b06050f 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 4699f3b1aab7638b2232ce5f3327ccd0dcb0f317..beebc71c1231462c0535364c697f48eab7e090c4 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 6d4f39bc6700434ebd585be881dc233708e01b7f..427630b577a0e87534a95a4f6cfabbfd876337b2 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 1016734d37ac4c7cf3a19594b51e6ed6c638e05d..41687b98da40c73f7592257e490f52209b934ee9 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 8ea7c7f853fb3ca602e1ed8f09d5189b0733e6a4..d420a410b138939736bae75a812911fc3892820a 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 e1f95af003d77cf4e4eb19da6d236c3fdbcbffd5..23cbfde76c35cd123070510380eb4ca64fc60c2c 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 4da21b38ad9d897180b3a1e8700b8f3c2adceb80..43404336d34b00699c42e3578267b24979e075c6 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 aa69b165af8d506d2a738c97ee43172a2eb65d2d..71ed585c1925ae2f8de100d4e0cc65379469d0a9 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 b23c7604796121f7001328fd6f7dcd41df1b8783..3ab5c83fcfb1f68a36de11d6c565a980f8162594 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 605cddac60c3839cdbd7f434020771ae1fc8a69b..0007c5d12a8d928e3919b104c94a49e3ef9148fa 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 2680eef83b7bcc76e74a1ae9c92e79aca56888b1..8d087e18bfef3e87dbaa7ac1c0fe36ba3a279787 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 3486e97d91b530eee47cc8f045515695c033593e..3cb0877e0b12d9995e31e9af96e287338ac480d2 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 8e116eae7a12d0a97c7e2a40e9682fd375bf9bc2..0cb09cd636a057e2ee60fd26c7313bee0da1d8d3 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 5b2bb44a7cb4921102f1cc2b8f307e16f28bd99c..aaa2e98b94ce957b6ddac2ff15bb4a0431773710 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 6bb5f091b3030c32c30627d26e6d0b49dfc2de88..354ca1a5902450cee533c46b80c0c947acc3df2b 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 29c4ad7a026ec7c9da59806bc17546ad8a1a8832..fe82a5c9da4dc2d37b43ad9c62ff0cd9c675b281 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 8766552f5ef49f72f82ec4f73775b549161a9a50..f8866259aae4455134b408e732d12a935ac4ca94 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 12f4027dbe2b582d2251d29e7d3d3b6c06a0788e..dfe0a2952c7268e4022d0deb86bc6905f76877ef 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 39d9dd740c48f998aa0daa88bd1d299f1f90e1bc..6a139bef680831ce9957882c096a9697d15e7a9c 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 0cafc2fa1fc05552f88217b9f58b57f30a54cd0b..dc151299b3c1c47d105a78f7565e0ec1e6a12581 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 21a38251563a589642203b123a2e9bbe97329bf7..502899da46cd18c827639705f36fd9e74975186a 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 f5dba130821f3a4cdec8a368ee9f593b51ad1d1c..4bf3a8688b16d45cc2f82eb3820c40b413ff35db 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 58aa2526440e34a04b80bf3c4924ed0531a4f4d7..3525cccd230777dcdf131f0137a6c2328a598fff 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 89141a876544c29a731848c3d643d64ceb4f7a57..9ac26b832dd03a9de5e7972ac0a7e09b83a00096 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 15cd14597912c070ad9793cc1bb9a990668b1180..5825b8decadd2c38dad754d0f0056787928b2655 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 e35b9eb3dd2fb0305a66a4ce6e93404e5afaec11..19571e4aa1e862a0ce61585bf93bc3c0387456a5 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 340d0def5ccde6e42c345df5908f142282fa5fea..e01bdee6bbf783d7bc1aab962237d3cd2039dcc1 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 b964086939af1e0883e32a7907e9a344bbba9d26..4fb58b1df71d913409b0dda3baeea193589b440a 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 953d13b822115a6f7a326ea4ad5b8522ea6dc7f2..c7c25dfb10ff4a56f4d042f85b40e12330237e24 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 6bd707ab3c196d1c131b4cbbce81a9af4fcecf27..7b166b0ee671d8d5c61284f21c3107511bac3612 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 e37cc0668cae76b3ff29361a128edcc845d2afdc..99aa97b94c83270bc4d368bc43f41bbf75793d7e 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 a7706c6eb35ffa78e02226d483e5c35bc6142e04..08c8c4e4682985156853d24aea33cd8fef334e2c 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 e0d8a7b1d6863556a6f2ecbbce8b3a9c8e76d086..92adf195ba21fe86c9c7646ad9bb9951a16441b8 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 a306f08ea3af1a27329c45c53893c4280b56e3a4..618aa6f4ff2c5c16de24cecc7bfc54344aa8d12c 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 dc73d8396653fda9cc5d6d3e1fa1ec7e5f2d47e0..863efe4ac5312fbdf860f1c68739acee0bc1398e 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 bd179a4c117f913342d314a9a623cc3345fe08b8..32d8dccfa9a3ffdd663dfc3f7aa336d3e2c607d7 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 d62694decb509e4f0d31653ee12118c83bc98b40..678d0bb62ee4a6b40c1a2ca0020e24c7cfd3c64d 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 a76d665ddf0f80cf442aa9a1c9af2fa384991892..ec50f39afc29411a79e883a6b15c59ef041c1de7 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 17027ad72c67ca5ea9cf1bb65a3853bf5e5cde4c..44509cdcd54cf0b823a2e3e4cbdcf7dffc0d3770 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 02c7f26f70049ab2b58a8912f40776a2a25d4719..6a91ab618012fff7da6bea159d790e0c4fcc3106 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 38c5b0403f78b62bc8dca39fc408b6c19ab4de5d..9160f99c5cf302b80b145f045f2fb8ccc1f9d367 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 387547d3e6b3b4c7a4a8e1cbb05dc7d50c94388c..3519632e85cabbe0fec86dcfb0bc392482609eaf 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 222e767c72a1a85b6d306e211af8e37bd967a1c0..2afcd04e3a44f89e6c294970fa25b23738d3e8f9 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 316fd89a207454e96096a49c0d6f8451a8dec47e..a9c52d625ab4bd04f02183fb1095beb4a5b83217 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 62237fb9ecc6fb4ced0b16cca592146397d6a5cb..31d67a0b01c793c422a1c4b223da6bc79e85b6e1 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 541c980baaf3d9b5fc0123a87e220a1a5a3dfebd..0d739b4140103f02839c7ccef499e1fdcd441e56 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 43e229e51dcbb40a154fcbd4cbe8af0386482063..6b153481884704cedd8ae4e7a16c91651a81e0b0 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 0d643c37e514086ad2c51378fbc6936a17121c42..6869f7294df9a90a92c3d2881efb1c6fa4c513a8 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 266d7f190166c477da5935cc41a1d62b580703fa..6d908c5e1c6f78c4497e3aaf6f589501b36a9c09 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 96b2803ae579eaebe3f780423e12f82b9b066f5f..0cb094bf5353328586d3c6044ec6df7c67985d3c 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 6196b0e472c2b066c3cc5097e6e3e7dc1de8a0d5..c195a6dd0983553caf4cb3a4ef600b9180c567c7 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 9b9102253b57c140b0d0ca78906c2f39cb143776..df51d06fd36a7512176c596ba271307933360c1e 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 4352e4eb529148ccd51086170c46f4ae6df2ad09..f8793aeaa54b58c41ca58c06ecf40cf825034c02 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 b179bbb454f0a19494adef5f5ec95b24a8ab9657..28f34e3c7e71290abc1be920c0d450160aac51bf 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 a94751162e173fe0a6ba14d5e162b0de59acd9fa..47b6a6f4b01f6c0bb8d76c274772bc6046464d5c 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 c7ad78b808b830ba88cae09b7ef5b8285d94bf6f..bb7479fe10ae8847626abb6240babb6e48cd1741 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 c1b77b37af11c79eb0bffe0b7f830e24d4ea4449..2b132e72aa7bd1dc2c67b5568ce92f193b97e7a0 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 3cda127813a5c2cbb025c86b1914e4119cb016d7..33853a8cf7f845f7cfd00a673ee77f29656eb9da 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 60f40deaba09be4898c6d7d4ad784295d7f1dc61..58b6ce2ef25845a63194a68a1c7832b9de48250d 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 604953efafa09808bea351c127ac38309036deff..a24e13f31632ea1f7e907ca7b11ccd098dfbf7de 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 4ff974c18ef194bf891bc6834ac90545de218c74..c196630790e9f5d2afe6ef380f9091af3699bc26 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 ffe3e843861e47756c42fa318f48a86924271097..c28f54f908c082ba12ab46a83a6b6f0de610d60b 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 cc9351c3fbdcd3840a1f7c17f0fce9fd939673a0..2a0ecee41d35e384bb0f64e11f85d00af184639c 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 f163d490b95404bedf033159926ab482691c0a97..e514424a273047d220f063a8d8e2df025b3ae2b7 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 d18f636fd4f5296c244ae6b70a12537dad65e81f..f631dd6d099bf98ab556f11589db186ebd2bce39 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 0ead0b04296a012c49ef503a215ee1ba5b67a4a1..cb63d904a3a9273ef0b2c96af6a3dc548df9914a 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 7833c184697b256ad81bbb239f83491d102c946e..b6a528a0b14b7939b1fb7788f3ed74ebd0083eee 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 bdc813aeb8240568809453369b2067d691e20927..0e04f4005fadf32146b3a6c8d90a53fbe37458be 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 af7cfa781c1d92f0cadcc1969ffdc6a3b3078f5e..c0d491968b9b44184d30eeb07bbd37ef9b2b5960 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 fa12a4b1fd5fd99d3e8cdba8f539a42a469c1506..40076c825c1161d6f72ffacacd07dfd2ed678502 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 4afa734e33b218784a8007ad6b6dedd54c2b0618..f07e56222e3021fcffacd0627a36bc30dc010c49 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 91e85cbdb978d0bb1c01be7cb3123df289102bb2..e7b525eadb2b47370492aea701c1467a622c69c2 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 f87a73e7d58bffbb57641cd2c1c4c59298001bf7..6a6d4deee3f78f117d799185d7f600cbe8c564a2 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 dd5acbdd2f8253cc3cbc6628a83492e29da2671c..9b14ba713e7ad27b57ca011a2a4feb61839a6214 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 bcdcd8c2deaf8d841670075e87e68294b606e73f..ddab07df9a85dc65be639421a2a23db305a5e201 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 622783a23e0ef0e0bec1a91b23ebfc12e2d99644..ad764cbc1468a98070df9e5c0b0a120a4997d5f5 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 0aefa067057358c0632ac42e3ae963f067abc438..90ad58604b6e6731f3be3d3a077211a4ab25366e 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 2c954d5cff6bd2a75b701492626dfa96e81ca566..f22e2c14d23260a55affa1fde4f59f0feb4f952a 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 d068c349912578e3dd198619d52bdc30833d81d7..998b01932366ab8e8994260a44fcc039b2d56dc6 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 c0dbd5acba31d90c4d542af2792e44750c9aad1f..ae493266a342ee6a31315e69f09afca7b6a30c1f 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 cd3260d105df6e26e47b10711182a35c012616dc..d53294829c0647707ba74620a20cda855171eae8 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 389838a4bb64c41c808613cddcf14251121cadfc..662c75dffeceb21e0240dc284e4771fe064d8a14 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 ea61be3a0367e3e1ca4e9ad09434f4068dcc1d57..57914777b362704fbd662c4f4c3588e4c1682c83 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 2619fc9e7bc4b044ff73fb7ea2bcaddfda775f81..e4cf9e7d1bf041544d10b6a656f6ed1d4ec56045 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 c88382ac7dbfa073531fc64db0209f9ea4b98970..2eb7a443379b3bae266df5383c20efde7caf53b9 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 53be5a79046588d76e3f5d70601c0ef480c73b1d..7dc912b3f6360eaef13225d963ec0ed48f4cb6b3 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 7a917e2e37f664113f19628b9487fc46e75387dd..836652272a97bbbc395766db9606aa6697e5cca2 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 6aeeee63c563ff00d51094ff4a5b013b46bad899..607b613c23980accb5ef2a58e8444f627a2c3ab0 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 55eb64587b4f602c336b48199f04d74a13723f8e..cf6a55b63af15286f0e3e0a3cd49e6da2daca875 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 da7dc391f743f04b3758b390133532f7aa32ad9a..6efd9cd7cb9385b7266793673ccb83f0664f1f77 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 64b69a6953d18da5e512ddc4aa03a293716d6f56..253b77be08959680000f44562f46562179755de8 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 9ed7a828bc832cb554cd5b5b4317e39e09523773..706a3998279aea81961ab9c7446670589daae525 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 0c07b0f35ab36973ee96beed397044b596f59397..8b4642ef883d2af6cf88c86d9c337207038f61b6 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 cfbcffca2ca46b3b8e230ff4a07c0f43a52a5ad9..11a446d149204aa885996a06b5262682e705b710 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 0869918a644cc229f0fa415c82ff26798dd4b9b6..fa211fa1cf67fc792f22027fa63030f5ebbd6254 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 a2dc08bfcbb387beb6df9207490641d86cf755e5..75e00b51a2feed11d23295f77feb30e27355d53b 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 274bac9364882c6cf3a80742b23f2454dc52a91b..91108d8e4ebbcf87aea42d65bf36b4b997fddc44 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 5f30e66da049ae75b98297c76dbae2ba7c66ba4d..acde097ddd4bdd1751e24ada4b337d9fb71ca884 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 83f2903cd09a2f493a69e068b8d7da6e47c21fdb..109f7d795a7d9aec98f6f6c346779c3e1199b372 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 9889cf7fa147ca4c4b4130feca13461f3090b77d..756f6b02488190eb84a6ccb1daa8cbfbd17e3f17 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 633d5160370018e76b1d9fabcb9e14a16cccc712..4cee90dca46ac37366e22403544894fc81a3fc93 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 78dcf0887c6d5b60d76965b1d7f0179e9b6b3702..0f06206df122ea8d8f9c3434a4bcc2e1277007aa 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 f47e1aceccd9baa95619dec975f7fe9ecc376512..c63c5c4d996563b273feb2a5c3a240c6dfd109c5 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 dd89d146e3b788209a5fc3655932f8cba04733ff..5da43e53ef4e204ae9f5d16c29ed64740fcc96c9 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 2e7d57b7a01a067ae128fed4adec49c7618f0f62..6d3e0ff4126e9b582befcb622c51ef3598d0d1dd 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 2bdfc5b0511faa4fc393744964ff09ef68d17388..247e5fa68cc634b159f6c8c595dba1fd0a4779fc 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 041365d74ce9f03a6fa5ef6ab82a014938d5a448..88b82f2138fb2702c11e69cc66010ad99b8d1211 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 873fa0b0514f7a6def0f5596a6a734e63a4e917b..87692a2a63acda8ad292b0bf848836ca0c4bee21 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 32f34128a9f67b12430b64d7014dab3c6cfd4a1b..1f7a9c12082a5fc64b9c9eed9afedc34235b1c74 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 58a90118b982e6d7b752f47e6f0e5ce0317539b5..ce9926d4bfe7c36e29aa6df5e32655f91c8616aa 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 b869eebc200c1ac8a00f8b4beea9b5eb9fe5485f..003ae03827a7bd92438fbe3e0b7a6ae4bc38a401 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 bbde444e58eb3ad534d725267732f2c1afe36d41..5669545709ebdc5862744af8e565f646ed9612f6 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 9be9123fbc827030e51ff32e082b93a6796dcf33..0c1c197459c276d942a16053a374167b4efa9d67 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 76637c8a952a0e771ce52f1c86b04418332beb98..d5aa6b49ffbc3808c77270b7e2db44d9dd32fa18 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 627b65c6015f84a355057c19c90f6c3b48888aee..733c8a6b14da13acd62d8c3110fa5dfdd42b4004 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 3969bbb7dbb7f0a0198ea7eb042412c7ae45982e..89a8812be673ef967fc8a41d3010d7e914dd440c 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 be19dc1be30200624cf3d31fa20df9883d7b7188..db547cc0e403533e0e46b9d7d3b862a3b8ac74d9 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 04e794ace26d09874cc5858e8763c3b2bda747ab..9a0b8f97f2d7c291d02aee8b01a549cdbbd8c2d5 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 4f71e187ed38aa86f76f62dcaa230b593835794b..4e2f1a43c3f4b644380ad072946ca4457bbf71b3 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 aff1bbf607a57525496d0276bb412a80d22e6890..3e930a3469a4f9db7d7b67a64e6e1fe72603fbaf 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 64ba40255eb16553492455a191c9ae897e4d273b..da92ccfe325a5d6c187958def79ef9eb42869063 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 f2fed7c457d13fa5dc04ef2d007ab6de7bae7992..42111ab0c324e6ddc39e7daaaa4c7ef05079b59d 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 e283f1ed2d37279aef973f17f1bb95dc5ce48a02..a821054ced3da6e861e052281bdb72a81989a3c5 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 7610bf4df77617d6fc082f087d975c0ba4b20254..6904663df065df247fbeb7874a09e4aa3d5afbe2 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 4d02bc320fc87456b6c4f079add0e27419b88615..c381cbcdb691756684c9988dd5b715327593f631 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 54862a6d122df62e4b7ded21c50784697c4dc92f..bd11e8590da9e97db4ba8c6eae0494361b1aebb0 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 680349db9685e4eb15bc422b77cee710d29396cf..4ae587719d43cb27c48a55bf9d46343cdecacf68 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 570413e7e36fa728aa903d2a32a2e906a492e4be..e5ed380e27ce1bad439a4b4367d55922f4cd52b0 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 021c53ca9e9431070a93eef9ecd3b3876c103e43..096982e883e1c9177788349e07a65a586460a150 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 220901a437dafd353a3e5ec2afbe6ac80323df08..d1d72ba001bad922f7715b37a7e2265ffe1bcd10 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 371d83d22b1daa4c15e3e0c381644c87bd6ac8de..9c57f538fdacfb6378b2ae457f4af298fd642704 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 d772cf48e53a87ed3454dfc9544075bc2ddcd89d..71345e8bff4968eb2370d4ad590e9e2978d95c24 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 be55b48b7700ce803ce2260a0eb1154818e59861..078525f2202229072dfb27201c6f4daeffbee39d 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 dfa9fac758cd9f4d3fee62118f824c5afd804726..4350c7bdcc965c61b6b9d728e5247b998d0fb3bc 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 0c5d734fffcf660393b578cbdb6f03deb51b5eed..204a0bee25684617e3138d1ca328a4df7dd7b9ce 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 e437f39a5ee5740d275a827ab3b7ee149682eb07..6c440554551cdf8322f267930919d70f6bd3a288 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 11f7e0cd72f2e028dd2697315be70e2fcd5c7bb3..0fde28a304419befc90e01dbc20ee1ec15bb44cf 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 a20b940a821c4e66e95be3544221e0c2dab70a44..02bdee7134015ef9b2bc02439810b27f5d39a29d 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 9e0526fdb204212ee17c11e7930e7b7cc01813e6..2e5ca01bb5344ca3c0444106903ea33865758d79 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 1e12f482130cbc9806f8e51906633dc15cb19463..8e6fc0f79e789d841bbcac82b4112e601648f90f 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 8f56bb760482c9a327fca7395e1ed30eeb0e2c2e..979f04cfeaee96cb76e02e22eee8a3e8550bf566 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 88b910009921cc97d84053546ef0d7eaa7d03f7f..a2a05892f9aa456ea55b7e710244d459fc79ef3d 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 f368c68b656ad082511837d06b33c87ee6c97173..02666b5b89f715448595fd93459bff46e81645f5 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 4e24fa0221bceb9e8b6573c67bbf0caa1b002798..ebe245dc9b161c6c38ce9803c1f253395c2eea98 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 cfa936d1da9c7ef3847e4e8e22448abb28575bf8..aca41b269d03a85ff6bf5ca84eceec8081da2d5b 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 316f4d3b1f2adcb5e74337d65d264e9fd6a97e0f..a10fa7fbb4c1429ab2a796099a85e66120aa50e3 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 4b4eb8bd65cb95ca5def4ca5be348e5f8ed05e48..6114558a7366dea1676c641dc3394553608f9d4a 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 db0d857ef325f21d4b08356d5f7c306cd4aed8d0..76ac3a011bb142ce586a807097a83fa5dc02f6f1 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 4e1b354eca22a4e3cf631b87786c431e5c499621..229e7323407aae64825b04d317279c1125de3f03 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 11c98ac51123b05f3616a451c39ee538e6afc9bb..1c5f8b34ed3254ffa5c52c5cd5709b8c66ef0c76 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 92168bc3e876a575f1ffd362481abc491983826b..c0f13b3307f6205644dce1a56b91c32836914e17 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 78e528a27e85b41c2b62672c26740093401439cd..a5485b37014dd2bf37d734afcbec40f9678a1a77 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 590e45c45a1eb0f9db4c6d24c4ff99ce686f496e..3f09f9b630edb54071196b5516c35c4f3ab01e60 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 7a838d9b9a939c7d06b8410d33c96dbc09dc2afd..2d79a64772826b7fbe82022d105a5b1bc2ef3dee 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 862369cadf91e29ec880311aa45b8de0d76b8a55..718e186083e9dc248b050fedae5eb0d5e0857936 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 72eb18fd5187bab675bcc24a66d6704075f51e58..c8a73d38a6f579907cb2ffd01c35f712be2c1e26 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 15b9786b6037b94f5c45a1fc1bb3bec7345be554..641d37706fc4f9b39cfe6506e0535a9f58047422 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 a6f76704dc04a19a0b64557f7dce0e1a065a322f..cc9bdf533ab00ffcefae5990303ec87665af8f35 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 840b85bfc1c5599ba24a13a7862c0eccf4aab9bc..5af9117a961b5786f32806ec680985e80fcddd19 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 e8f81747ef4a50355e99355557e7cdf66834a710..2b30e956e49ca13e2759da28d1b5ed7383922838 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 4dd732f38b4280dfc015f18c73729cbab95fc761..8d8bce5269b19e60c0512c0c639679e4e6ceb5f5 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 01c745fec77a512871c47fa462a06c94394ab262..8b9a8f7dc448c9ff10079dd24bdf7437cddd3daf 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 b0bce5d8b6224a1ac2161511de80a96d9b0e6826..20323039ca507935409df56ef5a1322a41170399 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 7a5e55464b75104b52269943890a4e751af57a89..a5921224cdcd8ff3a92e7b6f4c01bb56eb919d9a 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 51845ec833c27e32680b1f92d3890938a59d8ad0..52515f6b4e3cc53f4b12fccc1ebd2f0575e6ede9 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 5f20673eceb1ac3a565eb4046e8647c48cf68c4c..fa8d2b62221a6a3a4d361f1b9d7ff293910f7d20 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 38cc24ae09c45e59b8570f4794ef07f50c74a396..9f27eb63566ffd8b4fb3766c09da3db93a67a1e7 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();