]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractLymphStationsFilter.h
Add New(), GetValueTag and Path (to search for image)
[clitk.git] / segmentation / clitkExtractLymphStationsFilter.h
index 8bbc3013f424cda711e3b500c4d4a28678e66507..b7b8c3b939bf0039542db04cb0a6e1411c688820 100644 (file)
@@ -20,8 +20,7 @@
 #define CLITKEXTRACTLYMPHSTATIONSFILTER_H
 
 // clitk
-#include "clitkFilterBase.h"
-#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
+#include "clitkStructuresExtractionFilter.h"
 
 // vtk
 #include <vtkPolyData.h>
@@ -37,14 +36,12 @@ namespace clitk {
   
   template <class TImageType>
   class ITK_EXPORT ExtractLymphStationsFilter: 
-    public virtual clitk::FilterBase, 
-    public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
-    public itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> >
+    public clitk::StructuresExtractionFilter<TImageType>
   {
 
   public:
     /** Standard class typedefs. */
-    typedef itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> > Superclass;
+    typedef clitk::StructuresExtractionFilter<TImageType> Superclass;
     typedef ExtractLymphStationsFilter          Self;
     typedef itk::SmartPointer<Self>             Pointer;
     typedef itk::SmartPointer<const Self>       ConstPointer;
@@ -83,15 +80,13 @@ namespace clitk {
     /** ImageDimension constants */
     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
     FILTERBASE_INIT;
-   
+     
     itkGetConstMacro(BackgroundValue, MaskImagePixelType);
     itkGetConstMacro(ForegroundValue, MaskImagePixelType);
     itkSetMacro(BackgroundValue, MaskImagePixelType);
     itkSetMacro(ForegroundValue, MaskImagePixelType);
 
     // Station 8
-    // itkSetMacro(DistanceMaxToAnteriorPartOfTheSpine, double);
-    //itkGetConstMacro(DistanceMaxToAnteriorPartOfTheSpine, double);
     itkSetMacro(EsophagusDiltationForAnt, MaskImagePointType);
     itkGetConstMacro(EsophagusDiltationForAnt, MaskImagePointType);
     itkSetMacro(EsophagusDiltationForRight, MaskImagePointType);
@@ -109,6 +104,8 @@ namespace clitk {
     void AddComputeStation(std::string station) ;
     void SetFuzzyThreshold(std::string station, std::string tag, double value);
     double GetFuzzyThreshold(std::string station, std::string tag);
+    void SetThreshold(std::string station, std::string tag, double value);
+    double GetThreshold(std::string station, std::string tag);
     itkGetConstMacro(ComputeStationsSupportsFlag, bool);
     itkSetMacro(ComputeStationsSupportsFlag, bool);
     itkBooleanMacro(ComputeStationsSupportsFlag);
@@ -121,6 +118,17 @@ namespace clitk {
     virtual void GenerateInputRequestedRegion();
     virtual void GenerateData();
     
+    // To avoid repeat "this->"
+    AnatomicalFeatureDatabase * GetAFDB() { return clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB(); }
+    void WriteAFDB() { clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB(); }
+    void LoadAFDB() {  clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB(); }  
+    void StartNewStep(std::string s) { clitk::FilterBase::StartNewStep(s); }
+    void StartSubStep() { clitk::FilterBase::StartSubStep(); }
+    template<class TInternalImageType>
+      void StopCurrentStep(typename TInternalImageType::Pointer p, std::string txt="") { clitk::FilterBase::StopCurrentStep<TInternalImageType>(p, txt); }
+    void StopCurrentStep() {clitk::FilterBase::StopCurrentStep(); }
+    void StopSubStep() {clitk::FilterBase::StopSubStep(); }
+
     ImageConstPointer  m_Input;
     MaskImagePointer   m_Mediastinum;
     MaskImagePointer   m_Working_Support;
@@ -140,12 +148,14 @@ namespace clitk {
     double FindInferiorBorderOfAorticArch();
     void FindLeftAndRightBronchi();
     void FindLineForS7S8Separation(MaskImagePointType & A, MaskImagePointType & B);
-    MaskImagePointer FindAntPostVessels();
+    MaskImagePointer FindAntPostVesselsOLD();
     MaskImagePointer FindAntPostVessels2();
 
     // Global parameters
     typedef std::map<std::string, double> FuzzyThresholdByStructureType;
     std::map<std::string, FuzzyThresholdByStructureType> m_FuzzyThreshold;    
+    typedef std::map<std::string, double> ThresholdByStructureType;
+    std::map<std::string, ThresholdByStructureType> m_Threshold;    
 
     // Station's supports
     void ExtractStationSupports();
@@ -167,9 +177,7 @@ namespace clitk {
     MaskImagePointer LimitsWithTrachea(MaskImageType * input, 
                                        int extremaDirection, int lineDirection, 
                                        double offset);
-
     // Station 8
-    // double m_DistanceMaxToAnteriorPartOfTheSpine;
     double m_DiaphragmInferiorLimit;
     double m_OriginOfRightMiddleLobeBronchusZ;
     double m_InjectedThresholdForS8;
@@ -197,32 +205,46 @@ namespace clitk {
     // Station 3A
     void ExtractStation_3A();
     void ExtractStation_3A_SetDefaultValues();
-    void ExtractStation_3A_AntPost_S5();
-    void ExtractStation_3A_AntPost_S6();
+    void ExtractStation_3A_Post_Left_Limits_With_Aorta_S5_Support();
+    void ExtractStation_3A_Post_Limits_With_Dilated_Aorta_S6_Support();
     void ExtractStation_3A_AntPost_Superiorly();
-    void ExtractStation_3A_SI_Limits();
-    void ExtractStation_3A_Ant_Limits();
-    void ExtractStation_3A_Post_Limits();
+    void ExtractStation_3A_Remove_Structures();
 
     // Station 2RL
     void ExtractStation_2RL();
     void ExtractStation_2RL_SetDefaultValues();
-    void ExtractStation_2RL_SI_Limits();
-    void ExtractStation_2RL_Ant_Limits();
-    void ExtractStation_2RL_Ant_Limits2();
-    void ExtractStation_2RL_Post_Limits();
-    void ExtractStation_2RL_LR_Limits();
-    void ExtractStation_2RL_Remove_Structures();
-    void ExtractStation_2RL_SeparateRL();
+    void ExtractStation_2RL_Ant_Limits(std::string s);
+    void ExtractStation_2RL_Remove_Structures(std::string s);
+    void ExtractStation_2RL_Cut_BrachioCephalicVein_superiorly_when_it_split();
     vtkSmartPointer<vtkPolyData> Build3DMeshFrom2DContour(const std::vector<ImagePointType> & points);
 
+    // Station 1RL
+    void ExtractStation_1RL();
+    void ExtractStation_1RL_SetDefaultValues();
+    void ExtractStation_1RL_Ant_Limits();
+    void ExtractStation_1RL_Post_Limits();
+
+    // Station 4RL
+    void ExtractStation_4RL_SetDefaultValues();
+    void ExtractStation_4RL();
+    void ExtractStation_S4L_S5_Limits_Aorta_LeftPulmonaryArtery(int KeepPoint);
+
+    // Station 5
+    void ExtractStation_5_SetDefaultValues();
+    void ExtractStation_5();
+    void ExtractStation_5_Limits_AscendingAorta_Ant();
+
+    // Station 6
+    void ExtractStation_6_SetDefaultValues();
+    void ExtractStation_6();
+
+
     // Station 7
     void ExtractStation_7();
     void ExtractStation_7_SetDefaultValues();
     void ExtractStation_7_SI_Limits();
     void ExtractStation_7_RL_Interior_Limits();
 
-
     void ExtractStation_7_RL_Limits_OLD();
     void ExtractStation_7_Posterior_Limits();   
     void ExtractStation_7_Remove_Structures();
@@ -245,14 +267,6 @@ namespace clitk {
                                     ListOfPointsType & LR, 
                                     ListOfPointsType & Ant, 
                                     ListOfPointsType & Post);
-    // Station 4RL
-    void ExtractStation_4RL();
-    void ExtractStation_4RL_SI_Limits();
-    void ExtractStation_4RL_LR_Limits();
-    void ExtractStation_4RL_AP_Limits();
-    MaskImagePointer m_RightSupport;
-    MaskImagePointer m_LeftSupport;
-
   private:
     ExtractLymphStationsFilter(const Self&); //purposely not implemented
     void operator=(const Self&); //purposely not implemented
@@ -266,12 +280,16 @@ namespace clitk {
 #ifndef ITK_MANUAL_INSTANTIATION
 #include "clitkExtractLymphStationsFilter.txx"
 #include "clitkExtractLymphStation_Supports.txx"
-#include "clitkExtractLymphStation_8.txx"
 #include "clitkExtractLymphStation_3P.txx"
 #include "clitkExtractLymphStation_2RL.txx"
 #include "clitkExtractLymphStation_3A.txx"
-#include "clitkExtractLymphStation_7.txx"
 #include "clitkExtractLymphStation_4RL.txx"
+#include "clitkExtractLymphStation_1RL.txx"
+#include "clitkExtractLymphStation_5.txx"
+#include "clitkExtractLymphStation_6.txx"
+
+#include "clitkExtractLymphStation_8.txx"
+#include "clitkExtractLymphStation_7.txx"
 #endif
 
 #endif