]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractLungFilter.h
move clitkConfiguration.h out of clitkCommon to avoid costly recompilations
[clitk.git] / segmentation / clitkExtractLungFilter.h
index 6a316d2c81f9d219f8a30187c10c1da5f108dc6c..6ec698d3a204bc98dddd17190dafa44ba8e83209 100644 (file)
@@ -54,30 +54,10 @@ namespace clitk {
   */
   //--------------------------------------------------------------------
   
-
-  //--------------------------------------------------------------------
-template<class IndexType, class PixelType>
-class Bifurcation
-{
-public:
-  Bifurcation(IndexType _index, PixelType _l, PixelType _l1, PixelType _l2) {
-    index = _index;
-    _l = l;
-    _l1 = l1;
-    _l2 = l2;
-  }
-  IndexType index;
-  PixelType l;
-  PixelType l1;
-  PixelType l2;
-};
-  //--------------------------------------------------------------------
-
-
   //--------------------------------------------------------------------
   template <class TImageType, class TMaskImageType>
   class ITK_EXPORT ExtractLungFilter: 
-    public clitk::FilterBase, 
+    public virtual clitk::FilterBase, 
     public itk::ImageToImageFilter<TImageType, TMaskImageType> 
   {
     
@@ -103,6 +83,7 @@ public:
     typedef typename ImageType::PixelType    InputImagePixelType; 
     typedef typename ImageType::SizeType     InputImageSizeType; 
     typedef typename ImageType::IndexType    InputImageIndexType; 
+    typedef typename ImageType::PointType    InputImagePointType; 
         
     typedef TMaskImageType                       MaskImageType;
     typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
@@ -111,6 +92,7 @@ public:
     typedef typename MaskImageType::PixelType    MaskImagePixelType; 
     typedef typename MaskImageType::SizeType     MaskImageSizeType; 
     typedef typename MaskImageType::IndexType    MaskImageIndexType; 
+    typedef typename MaskImageType::PointType    MaskImagePointType; 
 
     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
     typedef int InternalPixelType;
@@ -197,15 +179,15 @@ public:
     itkGetConstMacro(LabelizeParameters3, LabelParamType*);
     GGO_DefineOption_LabelParam(3, SetLabelizeParameters3, LabelParamType);
 
-    // Step 5 options LungSeparation
-    //     itkSetMacro(FinalOpenClose, bool);
-    //     itkGetConstMacro(FinalOpenClose, bool);
-    //     itkBooleanMacro(FinalOpenClose);
+    // Step 5 final openclose
+    itkSetMacro(FinalOpenClose, bool);
+    itkGetConstMacro(FinalOpenClose, bool);
+    itkBooleanMacro(FinalOpenClose);
+    GGO_DefineOption_Flag(openclose, SetFinalOpenClose);
 
-    // Bronchial bifurcations
-    itkSetMacro(FindBronchialBifurcations, bool);
-    itkGetConstMacro(FindBronchialBifurcations, bool);
-    itkBooleanMacro(FindBronchialBifurcations);
+    itkSetMacro(FinalOpenCloseRadius, int);
+    itkGetConstMacro(FinalOpenCloseRadius, int);
+    GGO_DefineOption(opencloseRadius, SetFinalOpenCloseRadius, int);
 
   protected:
     ExtractLungFilter();
@@ -251,20 +233,14 @@ public:
     LabelParamType* m_LabelizeParameters3;
 
     // Step 5
-    //     bool m_FinalOpenClose;
-    
-    bool m_FindBronchialBifurcations;
-    
+    bool m_FinalOpenClose;    
+    int m_FinalOpenCloseRadius;
+
+    // Main functions
     virtual void GenerateOutputInformation();
     virtual void GenerateData();
-
-    typedef Bifurcation<MaskImageIndexType,MaskImagePixelType> BifurcationType;
-    void TrackFromThisIndex(std::vector<BifurcationType> & listOfBifurcations, 
-                            MaskImagePointer skeleton, 
-                            MaskImageIndexType index,
-                            MaskImagePixelType label);
-        
-
+    
+    // Functions for trachea extraction
     bool SearchForTracheaSeed(int skip);
     void SearchForTrachea();
     void TracheaRegionGrowing();