From ff5905ac5cf040ef0f531abf725724671f02cbdc Mon Sep 17 00:00:00 2001 From: Cyrille Valladeau <cyrille.valladeau@c-s.fr> Date: Wed, 15 Jun 2011 18:38:08 +0200 Subject: [PATCH] ENH: add NoData value accessor --- Code/Visualization/otbRenderingFunction.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Code/Visualization/otbRenderingFunction.h b/Code/Visualization/otbRenderingFunction.h index de0d7c6db2..0826a06aaf 100644 --- a/Code/Visualization/otbRenderingFunction.h +++ b/Code/Visualization/otbRenderingFunction.h @@ -151,6 +151,14 @@ public: } } + + /** NoData Vaue setter */ + itkSetMacro( NoDataValue, ScalarType ); + + /** NoData Vaue gtter */ + itkGetMacro( NoDataValue, ScalarType ); + itkGetConstMacro( NoDataValue, ScalarType ); + /** This method is available to allow implementation of * preprocessing. */ @@ -165,6 +173,7 @@ protected: { m_HistogramList = NULL; m_ListSample = NULL; + m_NoDataValue = itk::NumericTraits<ScalarType>::Zero; } /** Destructor */ virtual ~RenderingFunction() {} @@ -192,6 +201,7 @@ protected: histogramFilter->SetNumberOfBins(m_NumberOfHistogramBins); histogramFilter->NoDataFlagOn(); + histogramFilter->SetNoDataValue(m_NoDataValue); // Generate histogramFilter->Update(); @@ -206,11 +216,13 @@ protected: return m_ListSample; } + private: RenderingFunction(const Self&); //purposely not implemented void operator =(const Self&); //purposely not implemented HistogramListPointerType m_HistogramList; ListSamplePointerType m_ListSample; + ScalarType m_NoDataValue; }; } // end namespace Function } // end namepsace otb -- GitLab