From eff9b281ab2ac3df0c694f6bdefb2e85c21d245b Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Wed, 6 Apr 2011 15:26:41 +0200
Subject: [PATCH] SARPol documentation improvement and template simplification

---
 ...MuellerToCircularPolarisationImageFilter.h |  17 ++-
 ...rToPolarisationDegreeAndPowerImageFilter.h |  17 ++-
 ...uellerToReciprocalCovarianceImageFilter.h} | 105 ++++++++++--------
 ...bReciprocalCoherencyToMuellerImageFilter.h |  19 +++-
 ...alCovarianceToCoherencyDegreeImageFilter.h |  15 ++-
 ...varianceToReciprocalCoherencyImageFilter.h |  15 ++-
 .../otbReciprocalHAlphaImageFilter.h          |  15 ++-
 ...oReciprocalCircularCovarianceImageFilter.h |  14 ++-
 Code/SARPolarimetry/otbSinclairImageFilter.h  |   9 ++
 .../otbSinclairReciprocalImageFilter.h        |  10 +-
 Testing/Code/SARPolarimetry/CMakeLists.txt    |  12 +-
 ...llerToReciprocalCovarianceImageFilter.cxx} |  15 +--
 ...rToReciprocalCovarianceImageFilterNew.cxx} |   6 +-
 .../otbSARPolarimetryTests2.cxx               |   4 +-
 14 files changed, 171 insertions(+), 102 deletions(-)
 rename Code/SARPolarimetry/{otbMuellerToCovarianceImageFilter.h => otbMuellerToReciprocalCovarianceImageFilter.h} (50%)
 rename Testing/Code/SARPolarimetry/{otbMuellerToCovarianceImageFilter.cxx => otbMuellerToReciprocalCovarianceImageFilter.cxx} (74%)
 rename Testing/Code/SARPolarimetry/{otbMuellerToCovarianceImageFilterNew.cxx => otbMuellerToReciprocalCovarianceImageFilterNew.cxx} (82%)

diff --git a/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h b/Code/SARPolarimetry/otbMuellerToCircularPolarisationImageFilter.h
index f8dbb63242..b55ecaa2d1 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 e07d220676..b6bebcf38f 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 fbaac7b713..bfc1f8e930 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 39977f8d21..184e6340e5 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 f83fa46e82..cdac1d58e3 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 85ad74e3fd..e6255f891f 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 97287c7890..d34d360128 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 7fa9efaa1e..9ad961437c 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 ad58fec992..d584232feb 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 ae40d45e9a..033442c1ac 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 961233edba..3118006081 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 2eede1bb4e..02d3ff7e5e 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 995acd55b6..56285eb316 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 97a6220613..ccbcb41292 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);
 }
-- 
GitLab