diff --git a/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h b/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h index f8dbb63242a03d609f723cae888742cb6ea9a0ea..b55ecaa2d178619338b1d86adc25b55d0e12ec68 100644 --- a/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h +++ b/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h @@ -46,7 +46,7 @@ namespace Functor { * \ingroup Functor * \ingroup SARPolarimetry * - * \sa MuellerToMLCImageFilter + * \sa MuellerToReciprocalCovarianceFunctor * \sa MuellerToPolarisationDegreeAndPowerImageFilter * */ @@ -94,16 +94,23 @@ private: /** \class otbMuellerToCircularPolarisationImageFilter * \brief Compute the circular polarisation image (3 channels : LL, RR and LR) * from the Mueller image (16 real channels) + * For more details, please refer to the class MuellerToCircularPolarisationFunctor. + * + * \ingroup SARPolarimetry + * \sa MuellerToCircularPolarisationFunctor + * */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::MuellerToCircularPolarisationFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT MuellerToCircularPolarisationImageFilter : - public UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::MuellerToCircularPolarisationFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MuellerToCircularPolarisationImageFilter Self; - typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::MuellerToCircularPolarisationFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbMuellerToPolarisationDegreeAndPowerImageFilter.h b/Code/SARPolarimetry/otbMuellerToPolarisationDegreeAndPowerImageFilter.h index e07d220676508ec7f4dca356d4919699280e37a5..b6bebcf38f0975fbb97e17ca8082bfa35cd1e3b0 100644 --- a/Code/SARPolarimetry/otbMuellerToPolarisationDegreeAndPowerImageFilter.h +++ b/Code/SARPolarimetry/otbMuellerToPolarisationDegreeAndPowerImageFilter.h @@ -67,7 +67,7 @@ namespace Functor { * \ingroup SARPolarimetry * * \sa MuellerToCircularPolarisationImageFilter - * \sa MuellerToMLCImageFilter + * \sa MuellerToReciprocalCovarianceFunctor * */ template< class TInput, class TOutput> @@ -193,16 +193,23 @@ private: /** \class otbMuellerToPolarisationDegreeAndPowerImageFilter * \brief Compute the polarization degree and power (4 channels : Power min and max, Polarization degree min and max) * from the Mueller image (16 real channels) + * For more details, please refer to the class MuellerToPolarisationDegreeAndPowerFunctor. + * + * \ingroup SARPolarimetry + * \sa MuellerToPolarisationDegreeAndPowerFunctor + * */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::MuellerToPolarisationDegreeAndPowerFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT MuellerToPolarisationDegreeAndPowerImageFilter : - public UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::MuellerToPolarisationDegreeAndPowerFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef MuellerToPolarisationDegreeAndPowerImageFilter Self; - typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::MuellerToPolarisationDegreeAndPowerFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.h b/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.h similarity index 50% rename from Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.h rename to Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.h index fbaac7b7131936dff3264a3522751cfdd5eae54e..bfc1f8e9305bea934a6f4c932db87dc93a22a54c 100644 --- a/Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.h +++ b/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.h @@ -16,8 +16,8 @@ =========================================================================*/ -#ifndef __MuellerToCovarianceImageFilter_h -#define __MuellerToCovarianceImageFilter_h +#ifndef __MuellerToReciprocalCovarianceImageFilter_h +#define __MuellerToReciprocalCovarianceImageFilter_h #include "otbUnaryFunctorImageFilter.h" @@ -26,7 +26,7 @@ namespace otb namespace Functor { -/** \class otbMuellerToCovarianceFunctor +/** \class otbMuellerToReciprocalCovarianceFunctor * \brief Evaluate the MLC image from the Mueller image * * Output value are: @@ -34,7 +34,7 @@ namespace Functor { * channel #1 : \f$ M_{11} - M_{22} \f$ \\ * channel #2 : \f$ M_{11} + M_{22} - 2*M_{12} \f$ \\ * channel #3 : \f$ M_{13} + M_{23} + i*(M_{14}+M_{24}) \f$ \\ - * channel #4 : \f$ M_{3Coherency3} - M_{44} - 2*i*M_{34} \f$ \\ + * channel #4 : \f$ M_{33} - M_{44} - 2*i*M_{34} \f$ \\ * channel #5 : \f$ M_{13} - M_{23} - i*(M_{14}-M_{24}) \f$ \\ * * Where \f$ M_{ij} are the coefficients of the input Mueller matrix. @@ -59,7 +59,7 @@ namespace Functor { */ template< class TInput, class TOutput> -class MuellerToCovarianceFunctor +class MuellerToReciprocalCovarianceFunctor { public: typedef std::complex<double> ComplexType; @@ -67,38 +67,38 @@ public: inline TOutput operator()( const TInput & Mueller ) const - { - TOutput result; - result.SetSize(m_NumberOfComponentsPerPixel); - - // Keep the upper diagonal of the matrix - const double M11 = static_cast<double>(Mueller[0]); - const double M12 = static_cast<double>(Mueller[1]); - const double M13 = static_cast<double>(Mueller[2]); - const double M14 = static_cast<double>(Mueller[3]); - const double M22 = static_cast<double>(Mueller[5]); - const double M23 = static_cast<double>(Mueller[6]); - const double M24 = static_cast<double>(Mueller[7]); - const double M33 = static_cast<double>(Mueller[10]); - const double M34 = static_cast<double>(Mueller[11]); - const double M44 = static_cast<double>(Mueller[15]); - - const ComplexType hhhh(M11+M22+2.*M12, 0.0); - const ComplexType hvhv(M11-M22, 0.0); - const ComplexType vvvv(M11+M22-2.*M12, 0.0); - const ComplexType hhhv(M13+M23, -1.*(M14+M24)); - const ComplexType hhvv(M33-M44, -2.*M34); - const ComplexType hvvv(M13-M23, -1.*(M14-M24)); - - result[0] = static_cast<OutputValueType>( hhhh ); - result[1] = static_cast<OutputValueType>( 2.* hhhv ); - result[2] = static_cast<OutputValueType>( hhvv ); - result[3] = static_cast<OutputValueType>( 4.* hvhv ); - result[4] = static_cast<OutputValueType>( 2.* hvvv ); - result[5] = static_cast<OutputValueType>( vvvv ); - - return result; - } + { + TOutput result; + result.SetSize(m_NumberOfComponentsPerPixel); + + // Keep the upper diagonal of the matrix + const double M11 = static_cast<double>(Mueller[0]); + const double M12 = static_cast<double>(Mueller[1]); + const double M13 = static_cast<double>(Mueller[2]); + const double M14 = static_cast<double>(Mueller[3]); + const double M22 = static_cast<double>(Mueller[5]); + const double M23 = static_cast<double>(Mueller[6]); + const double M24 = static_cast<double>(Mueller[7]); + const double M33 = static_cast<double>(Mueller[10]); + const double M34 = static_cast<double>(Mueller[11]); + const double M44 = static_cast<double>(Mueller[15]); + + const ComplexType hhhh(M11+M22+2.*M12, 0.0); + const ComplexType hvhv(M11-M22, 0.0); + const ComplexType vvvv(M11+M22-2.*M12, 0.0); + const ComplexType hhhv(M13+M23, M14+M24); + const ComplexType hhvv(-M33-M44, -2.*M34); + const ComplexType hvvv(M13-M23, M14-M24); + + result[0] = static_cast<OutputValueType>( hhhh ); + result[1] = static_cast<OutputValueType>( 2.* hhhv ); + result[2] = static_cast<OutputValueType>( hhvv ); + result[3] = static_cast<OutputValueType>( 4.* hvhv ); + result[4] = static_cast<OutputValueType>( 2.* hvvv ); + result[5] = static_cast<OutputValueType>( vvvv ); + + return result; + } unsigned int GetOutputSize() { @@ -106,10 +106,10 @@ public: } /** Constructor */ - MuellerToCovarianceFunctor() : m_NumberOfComponentsPerPixel(6) {} + MuellerToReciprocalCovarianceFunctor() : m_NumberOfComponentsPerPixel(6) {} /** Destructor */ - virtual ~MuellerToCovarianceFunctor() {} + virtual ~MuellerToReciprocalCovarianceFunctor() {} private: unsigned int m_NumberOfComponentsPerPixel; @@ -117,19 +117,26 @@ public: } -/** \class otbMuellerToCovarianceImageFilter +/** \class otbMuellerToReciprocalCovarianceImageFilter * \brief Compute the MLC image * from the Mueller image (16 real channels) + * For more details, lease refer to the class MuellerToReciprocalCovarianceFunctor. + * + * \ingroup SARPolarimetry + * \sa MuellerToReciprocalCovarianceFunctor + * */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::MuellerToCovarianceFunctor< +template <class TInputImage, class TOutputImage> +class ITK_EXPORT MuellerToReciprocalCovarianceImageFilter : + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::MuellerToReciprocalCovarianceFunctor< ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > -class ITK_EXPORT MuellerToCovarianceImageFilter : - public UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> { public: /** Standard class typedefs. */ - typedef MuellerToCovarianceImageFilter Self; - typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef MuellerToReciprocalCovarianceImageFilter Self; + typedef Functor::MuellerToReciprocalCovarianceFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -137,15 +144,15 @@ public: itkNewMacro(Self); /** Runtime information support. */ - itkTypeMacro(MuellerToCovarianceImageFilter, UnaryFunctorImageFilter); + itkTypeMacro(MuellerToReciprocalCovarianceImageFilter, UnaryFunctorImageFilter); protected: - MuellerToCovarianceImageFilter() {} - virtual ~MuellerToCovarianceImageFilter() {} + MuellerToReciprocalCovarianceImageFilter() {} + virtual ~MuellerToReciprocalCovarianceImageFilter() {} private: - MuellerToCovarianceImageFilter(const Self&); // purposely not implemented + MuellerToReciprocalCovarianceImageFilter(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented }; diff --git a/Code/SARPolarimetry/otbReciprocalCoherencyToMuellerImageFilter.h b/Code/SARPolarimetry/otbReciprocalCoherencyToMuellerImageFilter.h index 39977f8d2118219d9b7132d0c319048cba8b36e6..184e6340e50b822628cb15f38ecd6694a5e40ae9 100644 --- a/Code/SARPolarimetry/otbReciprocalCoherencyToMuellerImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalCoherencyToMuellerImageFilter.h @@ -102,18 +102,26 @@ private: /** \class otbReciprocalCoherencyToMuellerImageFilter - * \brief Compute the Mueller matrix image (9 real channels) + * \brief Compute the Mueller matrix image (10 real channels) * from the Reciprocal coherency image (6 complex channels) + * + * For more datails, please refer to ReciprocalCoherencyToMuellerFunctor. + * + * \ingroup SARPolarimetry + * \sa ReciprocalCoherencyToMuellerFunctor + * */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::ReciprocalCoherencyToMuellerFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT ReciprocalCoherencyToMuellerImageFilter : - public otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalCoherencyToMuellerFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ReciprocalCoherencyToMuellerImageFilter Self; - typedef otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::ReciprocalCoherencyToMuellerFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -128,6 +136,7 @@ protected: ReciprocalCoherencyToMuellerImageFilter() {} virtual ~ReciprocalCoherencyToMuellerImageFilter() {} + private: ReciprocalCoherencyToMuellerImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented diff --git a/Code/SARPolarimetry/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h b/Code/SARPolarimetry/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h index f83fa46e82e8fdfb630d16ddb91d7780421e372d..cdac1d58e3a6dcba1712ca355634bcebbddb8e93 100644 --- a/Code/SARPolarimetry/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalCovarianceToCoherencyDegreeImageFilter.h @@ -109,16 +109,23 @@ private: /** \class otbReciprocalCovarianceToCoherencyDegreeImageFilter * \brief Compute the Coherency Degree coefficient * from the MLC image (6 complex channels) + * For more details, lease refer to the class ReciprocalCovarianceToCoherencyDegreeFunctor. + * + * \ingroup SARPolarimetry + * \sa ReciprocalCovarianceToCoherencyDegreeFunctor + * */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::ReciprocalCovarianceToCoherencyDegreeFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT ReciprocalCovarianceToCoherencyDegreeImageFilter : - public UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalCovarianceToCoherencyDegreeFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ReciprocalCovarianceToCoherencyDegreeImageFilter Self; - typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::ReciprocalCovarianceToCoherencyDegreeFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h b/Code/SARPolarimetry/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h index 85ad74e3fde5e082e0a5f68c8268140910fe1609..e6255f891fe75f807564fb554ec01f03cc066a58 100644 --- a/Code/SARPolarimetry/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalCovarianceToReciprocalCoherencyImageFilter.h @@ -107,16 +107,23 @@ private: /** \class otbReciprocalCovarianceToReciprocalCoherencyImageFilter * \brief Compute the Coherency image (6 complex channels) * from the Covariance image (6 complex channels) + * + * For more details, please refer to the class ReciprocalCovarianceToReciprocalCoherencyFunctor. + * + * \ingroup SARPolarimetry + * \sa ReciprocalCovarianceToReciprocalCoherencyFunctor */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT ReciprocalCovarianceToReciprocalCoherencyImageFilter : - public UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ReciprocalCovarianceToReciprocalCoherencyImageFilter Self; - typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef Functor::ReciprocalCovarianceToReciprocalCoherencyFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctorType; + typedef UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctorType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h index 97287c7890f89b1ac73c78613879e20bd01dd7bd..d34d360128415697a6e18c65dc8855c6625c6709 100644 --- a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h @@ -202,16 +202,23 @@ private: /** \class otbHAlphaImageFilter * \brief Compute the H-Alpha image (3 channels) * from the Reciprocal coherency image (6 complex channels) + * + * For more details, please refer to the class ReciprocalHAlphaFunctor. + * + * \ingroup SARPOlarimetry + * \sa ReciprocalHAlphaFunctor */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::ReciprocalHAlphaFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > +template <class TInputImage, class TOutputImage> class ITK_EXPORT ReciprocalHAlphaImageFilter : - public otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalHAlphaFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ReciprocalHAlphaImageFilter Self; - typedef otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::ReciprocalHAlphaFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef otb::UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h b/Code/SARPolarimetry/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h index 7fa9efaa1e51c4a70f2220360291f882eec6b71b..9ad961437caaf99737b3841426473f430f4d4e7e 100644 --- a/Code/SARPolarimetry/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter.h @@ -121,16 +121,22 @@ private: /** \class otbReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter * \brief Compute the reciprocal Covariance circular matrix image from the reciprocal Covariance linear matrix image. + * For more details, please refer to the class ReciprocalLinearCovarianceToReciprocalCircularCovarianceFunctor. + * + * \ingroup SARPolarimetry + * \sa ReciprocalLinearCovarianceToReciprocalCircularCovarianceFunctor */ -template <class TInputImage, class TOutputImage, class TFunction = Functor::ReciprocalLinearCovarianceToReciprocalCircularCovarianceFunctor< - ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > + template <class TInputImage, class TOutputImage> class ITK_EXPORT ReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter : - public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> + public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, Functor::ReciprocalLinearCovarianceToReciprocalCircularCovarianceFunctor< + ITK_TYPENAME TInputImage::PixelType, ITK_TYPENAME TOutputImage::PixelType> > { public: /** Standard class typedefs. */ typedef ReciprocalLinearCovarianceToReciprocalCircularCovarianceImageFilter Self; - typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass; + typedef typename Functor::ReciprocalLinearCovarianceToReciprocalCircularCovarianceFunctor< + typename TInputImage::PixelType, typename TOutputImage::PixelType> FunctionType; + typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctionType> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/SARPolarimetry/otbSinclairImageFilter.h b/Code/SARPolarimetry/otbSinclairImageFilter.h index ad58fec992ee0b581ff6426a335611426243b29c..d584232febee665cceb0c66ddfcf148f9f6c896d 100644 --- a/Code/SARPolarimetry/otbSinclairImageFilter.h +++ b/Code/SARPolarimetry/otbSinclairImageFilter.h @@ -35,6 +35,15 @@ namespace otb * The output image has 10 channels : the diagonal and the upper element of the matrix. * Element are stored from left to right, line by line. * + * The class is templated by the 4 input image (HH, HV, VH and VV) and the used functor. + * Available functors are : + * \begin{itemize} + * \item SinclairToCircularCovarianceMatrixFunctor (default one) + * \item SinclairToCoherencyMatrixFunctor + * \item SinclairToCovarianceMatrixFunctor + * \item SinclairToMuelleMatrixrFunctor + * \end{itemize} + * * \ingroup SARPolarimetry * * \sa SinclairImageFilter diff --git a/Code/SARPolarimetry/otbSinclairReciprocalImageFilter.h b/Code/SARPolarimetry/otbSinclairReciprocalImageFilter.h index ae40d45e9aca7699d6cea1908d6937140d72f51b..033442c1ac8e4a95cb06372bc4a9e43f644a83d9 100644 --- a/Code/SARPolarimetry/otbSinclairReciprocalImageFilter.h +++ b/Code/SARPolarimetry/otbSinclairReciprocalImageFilter.h @@ -29,12 +29,20 @@ namespace otb * \brief Convert the Sinclair reciprocal matrix. * * This class is parameterized over the type of the input images and - * the type of the output image. It is also parameterized by the + * the type of the output image. It is also parameterized by the * operation to be applied, using a Functor style. * * The output image has 6 channels : the diagonal and the upper element of the reciprocal matrix. * Element a sotored from left to right, line by line. * + * The class is templated by the 4 input image (HH, HV, VH and VV) and the used functor. + * Available functors are : + * \begin{itemize} + * \item SinclairToReciprocalCovarianceMatrixFunctor (default one) + * \item SinclairToReciprocalCircularCovarianceMatrixFunctor + * \item SinclairToReciprocalCoherencyMatrixFunctor + * \end{itemize} + * * \ingroup SARPolarimetry * * \sa SinclairImageFilter diff --git a/Testing/Code/SARPolarimetry/CMakeLists.txt b/Testing/Code/SARPolarimetry/CMakeLists.txt index 961233edba385a049325618b63dece8dbfbb49bb..31180060810d755a4c5fe37facc6769126acd473 100644 --- a/Testing/Code/SARPolarimetry/CMakeLists.txt +++ b/Testing/Code/SARPolarimetry/CMakeLists.txt @@ -350,14 +350,14 @@ ADD_TEST(saTvMuellerToPolarisationDegreeAndPowerImageFilter ${SARPOLARIMETRY_TES ) # Mueller To Covariance Image Filter -ADD_TEST(saTuMuellerToCovarianceImageFilterNew ${SARPOLARIMETRY_TESTS2} - otbMuellerToCovarianceImageFilterNew +ADD_TEST(saTuMuellerToReciprocalCovarianceImageFilterNew ${SARPOLARIMETRY_TESTS2} + otbMuellerToReciprocalCovarianceImageFilterNew ) -ADD_TEST(saTvMuellerToCovarianceImageFilter ${SARPOLARIMETRY_TESTS2} +ADD_TEST(saTvMuellerToReciprocalCovarianceImageFilter ${SARPOLARIMETRY_TESTS2} --compare-image ${EPSILON_12} ${BASELINE}/saTvMuellerToMLCImageFilter.tif ${TEMP}/saTvMuellerToMLCImageFilter.tif - otbMuellerToCovarianceImageFilter + otbMuellerToReciprocalCovarianceImageFilter ${BASELINE}/saTvSinclairImageFilter_SinclairToMueller.tif ${TEMP}/saTvMuellerToMLCImageFilter.tif ) @@ -412,8 +412,8 @@ otbMuellerToCircularPolarisationImageFilterNew.cxx otbMuellerToCircularPolarisationImageFilter.cxx otbMuellerToPolarisationDegreeAndPowerImageFilterNew.cxx otbMuellerToPolarisationDegreeAndPowerImageFilter.cxx -otbMuellerToCovarianceImageFilterNew.cxx -otbMuellerToCovarianceImageFilter.cxx +otbMuellerToReciprocalCovarianceImageFilterNew.cxx +otbMuellerToReciprocalCovarianceImageFilter.cxx otbPolarimetricData.cxx ) diff --git a/Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.cxx b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.cxx similarity index 74% rename from Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.cxx rename to Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.cxx index 2eede1bb4e1304a63da4b9df2fa7ada8e2a11def..02d3ff7e5e6621830bf973a2b241515bcd0d2900 100644 --- a/Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilter.cxx +++ b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilter.cxx @@ -24,11 +24,10 @@ #include "otbVectorImage.h" #include "otbImageFileReader.h" #include "otbImageFileWriter.h" -#include "otbMuellerToCovarianceImageFilter.h" -#include "otbComplexToVectorImageCastFilter.h" +#include "otbMuellerToReciprocalCovarianceImageFilter.h" #include "otbExtractROI.h" -int otbMuellerToCovarianceImageFilter(int argc, char * argv[]) +int otbMuellerToReciprocalCovarianceImageFilter(int argc, char * argv[]) { const char * inputFilename = argv[1]; const char * outputFilename = argv[2]; @@ -38,11 +37,10 @@ int otbMuellerToCovarianceImageFilter(int argc, char * argv[]) typedef otb::VectorImage<PixelType> RealImageType; typedef otb::VectorImage<ComplexPixelType> ComplexImageType; - typedef otb::MuellerToCovarianceImageFilter<RealImageType, ComplexImageType> FilterType; - typedef otb::ComplexToVectorImageCastFilter<ComplexImageType, RealImageType> Castertype; + typedef otb::MuellerToReciprocalCovarianceImageFilter<RealImageType, ComplexImageType> FilterType; typedef otb::ImageFileReader<RealImageType> ReaderType; - typedef otb::ImageFileWriter<RealImageType> WriterType; + typedef otb::ImageFileWriter<ComplexImageType> WriterType; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); @@ -52,11 +50,8 @@ int otbMuellerToCovarianceImageFilter(int argc, char * argv[]) FilterType::Pointer filter = FilterType::New(); filter->SetInput(reader->GetOutput()); - Castertype::Pointer caster = Castertype::New(); - caster->SetInput(filter->GetOutput()); - writer->SetFileName(outputFilename); - writer->SetInput(caster->GetOutput()); + writer->SetInput(filter->GetOutput()); writer->Update(); return EXIT_SUCCESS; diff --git a/Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilterNew.cxx b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilterNew.cxx similarity index 82% rename from Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilterNew.cxx rename to Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilterNew.cxx index 995acd55b623f9242efc7c0b411276c20b52c4a8..56285eb316cb8976eb77f8d6fc55a1860cbc4f86 100644 --- a/Testing/Code/SARPolarimetry/otbMuellerToCovarianceImageFilterNew.cxx +++ b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceImageFilterNew.cxx @@ -23,9 +23,9 @@ #include <iostream> #include "otbVectorImage.h" -#include "otbMuellerToCovarianceImageFilter.h" +#include "otbMuellerToReciprocalCovarianceImageFilter.h" -int otbMuellerToCovarianceImageFilterNew(int argc, char * argv[]) +int otbMuellerToReciprocalCovarianceImageFilterNew(int argc, char * argv[]) { const unsigned int Dimension = 2; @@ -34,7 +34,7 @@ int otbMuellerToCovarianceImageFilterNew(int argc, char * argv[]) typedef otb::VectorImage<PixelType, Dimension> ImageType; typedef otb::VectorImage<ComplexPixelType, Dimension> ComplexImageType; - typedef otb::MuellerToCovarianceImageFilter<ImageType, ComplexImageType> FilterType; + typedef otb::MuellerToReciprocalCovarianceImageFilter<ImageType, ComplexImageType> FilterType; FilterType::Pointer filter = FilterType::New(); diff --git a/Testing/Code/SARPolarimetry/otbSARPolarimetryTests2.cxx b/Testing/Code/SARPolarimetry/otbSARPolarimetryTests2.cxx index 97a622061338743fcbf26f51075f6c820ca6d614..ccbcb412928ddecf7a9f817ca34d877772b4ac2c 100644 --- a/Testing/Code/SARPolarimetry/otbSARPolarimetryTests2.cxx +++ b/Testing/Code/SARPolarimetry/otbSARPolarimetryTests2.cxx @@ -40,8 +40,8 @@ void RegisterTests() REGISTER_TEST(otbMuellerToCircularPolarisationImageFilter); REGISTER_TEST(otbMuellerToPolarisationDegreeAndPowerImageFilterNew); REGISTER_TEST(otbMuellerToPolarisationDegreeAndPowerImageFilter); - REGISTER_TEST(otbMuellerToCovarianceImageFilterNew); - REGISTER_TEST(otbMuellerToCovarianceImageFilter); + REGISTER_TEST(otbMuellerToReciprocalCovarianceImageFilterNew); + REGISTER_TEST(otbMuellerToReciprocalCovarianceImageFilter); REGISTER_TEST(otbPolarimetricDataNew); REGISTER_TEST(otbPolarimetricDataTest); }