diff --git a/Modules/Core/ImageBase/include/otbNoDataHelper.h b/Modules/Core/ImageBase/include/otbNoDataHelper.h index a1a5d9363d1800f7dfe1c3a61d4eee1090f0a306..d626e49f296e87a9bb2fda4aa56016df063e2eff 100644 --- a/Modules/Core/ImageBase/include/otbNoDataHelper.h +++ b/Modules/Core/ImageBase/include/otbNoDataHelper.h @@ -53,6 +53,18 @@ std::vector<bool> & flags, const std::vector<double> & values) { } /** +* Reads a pixel and change the no data value if it is found. No data +* value is changed either if the pixel value is NaN or if the pixel +* value equals the no data value and flag is true. +* +* \param pixel The pixel to process \param flags A vector of size > 1 +* containing a flag per band to indicate if a no data value is +* available for this band +* \param values A vector of size > 1 corresponding to the current no data +* value for each band. If flag is 0, the value will be ignored. +* \param newValues A vector of size > 1 corresponding to the new no data +* value for each band. If flag is 0, the value will be ignored. +* */ template<typename T> T ChangeNoData(const T & pixel, const std::vector<bool> & flags, @@ -99,6 +111,10 @@ template <typename T> bool IsNoData(const itk::VariableLengthVector<T> & pixel, return false; } + +/** + * Specialization of ChangeNoData function to handle itk::VariableLengthVector + */ template <typename T> itk::VariableLengthVector<T> ChangeNoData(const itk::VariableLengthVector<T> & pixel, const std::vector<bool> & flags, const std::vector<double> & values,