From 6c6db582c6319e28cdf3aa596002e339a940ffde Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Thu, 3 Mar 2011 12:19:51 +0100
Subject: [PATCH] BUG: Fixed bad inheritence of the
 ConnectedComponentFunctorImageFilter

---
 .../itkConnectedComponentFunctorImageFilter.h | 33 +++++++++++++++++--
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/Utilities/ITK/Code/BasicFilters/itkConnectedComponentFunctorImageFilter.h b/Utilities/ITK/Code/BasicFilters/itkConnectedComponentFunctorImageFilter.h
index f67448e025..0c9df5b351 100644
--- a/Utilities/ITK/Code/BasicFilters/itkConnectedComponentFunctorImageFilter.h
+++ b/Utilities/ITK/Code/BasicFilters/itkConnectedComponentFunctorImageFilter.h
@@ -52,14 +52,14 @@ namespace itk
 
 template <class TInputImage, class TOutputImage, class TFunctor, class TMaskImage=TInputImage>
 class ITK_EXPORT ConnectedComponentFunctorImageFilter : 
-    public ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage > 
+    public ImageToImageFilter< TInputImage, TOutputImage > 
 {
 public:
   /**
    * Standard "Self" & Superclass typedef.
    */
   typedef ConnectedComponentFunctorImageFilter Self;
-  typedef ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage > Superclass;
+  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
 
   /**
    * Types from the Superclass
@@ -150,9 +150,33 @@ public:
     (Concept::IncrementDecrementOperators<OutputPixelType>));
   /** End concept checking */
 #endif
+  
+  
+  /**
+   * Set/Get whether the connected components are defined strictly by
+   * face connectivity or by face+edge+vertex connectivity.  Default is
+   * FullyConnectedOff.  For objects that are 1 pixel wide, use
+   * FullyConnectedOn.
+   */
+  itkSetMacro(FullyConnected, bool);
+  itkGetConstReferenceMacro(FullyConnected, bool);
+  itkBooleanMacro(FullyConnected);
+
+  void SetMaskImage(TMaskImage* mask)
+  {
+    this->SetNthInput(1, const_cast<TMaskImage *>( mask ));
+  }
+
+  const TMaskImage* GetMaskImage() const
+  {
+    return (static_cast<const TMaskImage*>(this->ProcessObject::GetInput(1)));
+  }
 
 protected:
-  ConnectedComponentFunctorImageFilter() {}
+  ConnectedComponentFunctorImageFilter() 
+    {
+    m_FullyConnected = false;
+    }
   virtual ~ConnectedComponentFunctorImageFilter() {}
   ConnectedComponentFunctorImageFilter(const Self&) {}
 
@@ -163,6 +187,9 @@ protected:
    */
   void GenerateData();
 
+  bool m_FullyConnected;
+
+
 };
   
 } // end namespace itk
-- 
GitLab