Skip to content
Snippets Groups Projects
Commit da11eed4 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: various improvements to radiometric indices needed to wrap them

* make sure there is a == and != operator
* remove the 'const' from the non-static const members since they are not default-copiable
parent 7f411524
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,17 @@ public:
/// input images
typedef itk::VariableLengthVector<TInput1> InputVectorType;
//operators !=
bool operator !=(const TM4AndTM5IndexBase&) const
{
return true;
}
//operator ==
bool operator ==(const TM4AndTM5IndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector) const
{
......
......@@ -50,6 +50,17 @@ public:
/// input images
typedef itk::VariableLengthVector<TInput1> InputVectorType;
//operators !=
bool operator !=(const GAndRIndexBase&) const
{
return true;
}
//operator ==
bool operator ==(const GAndRIndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector) const
{
......@@ -141,6 +152,17 @@ public:
/// input images
typedef itk::VariableLengthVector<TInput1> InputVectorType;
//operators !=
bool operator !=(const GAndRAndNirIndexBase&) const
{
return true;
}
//operator ==
bool operator ==(const GAndRAndNirIndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector) const
{
......
......@@ -51,13 +51,14 @@ public:
//operators !=
bool operator !=(const RAndNIRIndexBase&) const
{
return false;
return true;
}
//operator ==
bool operator ==(const RAndNIRIndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector) const
{
......@@ -155,7 +156,7 @@ public:
//operators !=
bool operator !=(const RAndBAndNIRIndexBase&) const
{
return false;
return true;
}
//operator ==
......@@ -279,6 +280,17 @@ public:
/// input images
typedef itk::VariableLengthVector<TInput1> InputVectorType;
//operators !=
bool operator !=(const RAndGAndNIRIndexBase&) const
{
return true;
}
//operator ==
bool operator ==(const RAndGAndNIRIndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector)
{
......@@ -369,7 +381,7 @@ protected:
// This method must be reimplemented in subclasses to actually
// compute the index value
virtual TOutput Evaluate(const TInput1& r, const TInput2& g, const TInput3& nir) const = 0;
const double m_EpsilonToBeConsideredAsZero;
double m_EpsilonToBeConsideredAsZero;
private:
unsigned int m_RedIndex;
......@@ -747,7 +759,7 @@ protected:
private:
/** Slope of soil line */
double m_S;
const NDVIFunctorType m_NDVIfunctor;
NDVIFunctorType m_NDVIfunctor;
WDVIFunctorType m_WDVIfunctor;
};
......@@ -1234,7 +1246,7 @@ protected:
}
}
private:
const NDVIFunctorType m_NDVIfunctor;
NDVIFunctorType m_NDVIfunctor;
};
/** \class LAIFromNDVILogarithmic
......@@ -1313,7 +1325,7 @@ protected:
}
}
private:
const NDVIFunctorType m_NDVIfunctor;
NDVIFunctorType m_NDVIfunctor;
double m_NdviSoil;
double m_NdviInf;
double m_ExtinctionCoefficient;
......@@ -1378,7 +1390,7 @@ protected:
return (static_cast<TOutput>(m_RedCoef*r+m_NirCoef*nir));
}
private:
const NDVIFunctorType m_NDVIfunctor;
NDVIFunctorType m_NDVIfunctor;
double m_RedCoef;
double m_NirCoef;
};
......
......@@ -47,6 +47,17 @@ public:
/// input images
typedef itk::VariableLengthVector<TInput1> InputVectorType;
//operators !=
bool operator !=(const WaterIndexBase&) const
{
return true;
}
//operator ==
bool operator ==(const WaterIndexBase& other) const
{
return !(*this != other);
}
// Operator on vector pixel type
inline TOutput operator ()(const InputVectorType& inputVector) const
{
......@@ -247,7 +258,7 @@ protected:
}
private:
// Water Index Classic Functor
const WIFunctorType m_WIFunctor;
WIFunctorType m_WIFunctor;
};
/** \class NDWI2
......@@ -330,7 +341,7 @@ protected:
}
private:
// Water Index Classic Functor
const WIFunctorType m_WIFunctor;
WIFunctorType m_WIFunctor;
};
/** \class MNDWI
......@@ -413,7 +424,7 @@ protected:
}
private:
// Water Index Classic Functor
const WIFunctorType m_WIFunctor;
WIFunctorType m_WIFunctor;
};
/** \class NDPI
......@@ -496,7 +507,7 @@ protected:
}
private:
// Water Index Classic Functor
const WIFunctorType m_WIFunctor;
WIFunctorType m_WIFunctor;
};
/** \class NDTI
......@@ -581,7 +592,7 @@ protected:
}
private:
// Water Index Classic Functor
const WIFunctorType m_WIFunctor;
WIFunctorType m_WIFunctor;
};
/** \class WaterSqrtSpectralAngleFunctor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment