From 7dd4acd953625feb4bf6ce3c86a05b71526ddf0d Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Tue, 25 Feb 2014 16:23:22 +0100
Subject: [PATCH] BUG: surely don't want to customize the histogram number of
 dimensions

---
 ...inaryFunctorNeighborhoodJoinHistogramImageFilter.h | 11 +----------
 ...aryFunctorNeighborhoodJoinHistogramImageFilter.txx |  7 ++++---
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h
index 23c0bdd8e8..64ee4ff48f 100644
--- a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h
+++ b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.h
@@ -121,15 +121,9 @@ public:
     this->Modified();
   }
 
+  /** Neighborhood radius */
   itkSetMacro(Radius, RadiusSizeType);
 
-  /** Sets the histogram size. Note this function must be called before
-    \c Initialize(). */
-  itkSetMacro(HistogramSize, HistogramSizeType);
-
-  /** Gets the histogram size. */
-  itkGetConstReferenceMacro(HistogramSize, HistogramSizeType);
-
   /** Factor to increase the upper bound for the samples in the histogram.
       Default value is 0.001 */
   itkSetMacro(UpperBoundIncreaseFactor, double);
@@ -190,9 +184,6 @@ private:
       padding value should be ignored when calculating the similarity
       measure. */
   bool m_UsePaddingValue;
-
-  /** The histogram size. */
-  HistogramSizeType m_HistogramSize;
   
   /** The increase in the upper bound. */
   double m_UpperBoundIncreaseFactor;
diff --git a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx
index a25517df88..b2491f8d87 100644
--- a/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx
+++ b/Code/ChangeDetection/otbBinaryFunctorNeighborhoodJoinHistogramImageFilter.txx
@@ -33,11 +33,10 @@ namespace otb
 template <class TInputImage1, class TInputImage2,
     class TOutputImage, class TFunction>
 BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction>
-::BinaryFunctorNeighborhoodJoinHistogramImageFilter(): m_HistogramSize(2)
+::BinaryFunctorNeighborhoodJoinHistogramImageFilter()
 {
   this->SetNumberOfRequiredInputs(2);
   m_Radius = 3;
-  m_HistogramSize.Fill(256);
   m_UsePaddingValue = false;
   m_UpperBoundIncreaseFactor = 0.001;
 }
@@ -268,8 +267,10 @@ BinaryFunctorNeighborhoodJoinHistogramImageFilter<TInputImage1, TInputImage2, TO
   Input2IteratorType ti2(pInput2Image, input2Region);
 
   typename HistogramType::Pointer histogram = HistogramType::New();
+  HistogramSizeType histogramSize(2);
+  histogramSize.Fill(256);
   histogram->SetMeasurementVectorSize(2);
-  histogram->Initialize(m_HistogramSize, lowerBound, upperBound);
+  histogram->Initialize(histogramSize, lowerBound, upperBound);
 
   ti1.GoToBegin();
   ti2.GoToBegin();
-- 
GitLab