]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStationsFilter.old.h
Add one slice for the S1RL support
[clitk.git] / segmentation / clitkExtractLymphStationsFilter.old.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17   ======================================================================-====*/
18
19 #ifndef CLITKEXTRACTLYMPHSTATIONSFILTER_H
20 #define CLITKEXTRACTLYMPHSTATIONSFILTER_H
21
22 // clitk
23 #include "clitkFilterBase.h"
24 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
25
26 namespace clitk {
27   
28   //--------------------------------------------------------------------
29   /*
30     Try to extract the LymphStations part of a thorax CT.
31     Inputs : 
32     - Patient label image
33     - Lungs label image
34     - Bones label image
35   */
36   //--------------------------------------------------------------------
37   
38   template <class TImageType>
39   class ITK_EXPORT ExtractLymphStationsFilter: 
40     public virtual clitk::FilterBase, 
41     public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
42     public itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> >
43   {
44
45   public:
46     /** Standard class typedefs. */
47     typedef itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> > Superclass;
48     typedef ExtractLymphStationsFilter          Self;
49     typedef itk::SmartPointer<Self>             Pointer;
50     typedef itk::SmartPointer<const Self>       ConstPointer;
51     
52     /** Method for creation through the object factory. */
53     itkNewMacro(Self);
54     
55     /** Run-time type information (and related methods). */
56     itkTypeMacro(ExtractLymphStationsFilter, InPlaceImageFilter);
57
58     /** Some convenient typedefs. */
59     typedef TImageType                       ImageType;
60     typedef typename ImageType::ConstPointer ImageConstPointer;
61     typedef typename ImageType::Pointer      ImagePointer;
62     typedef typename ImageType::RegionType   ImageRegionType; 
63     typedef typename ImageType::PixelType    ImagePixelType; 
64     typedef typename ImageType::SizeType     ImageSizeType; 
65     typedef typename ImageType::IndexType    ImageIndexType; 
66     typedef typename ImageType::PointType    ImagePointType; 
67         
68     typedef uchar MaskImagePixelType;
69     typedef itk::Image<MaskImagePixelType, 3> MaskImageType;  
70     typedef typename MaskImageType::Pointer   MaskImagePointer;
71
72     /** Connect inputs */
73     //    void SetInput(const TImageType * image);
74   
75     /** ImageDimension constants */
76     itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension);
77     FILTERBASE_INIT;
78    
79     itkGetConstMacro(BackgroundValue, ImagePixelType);
80     itkGetConstMacro(ForegroundValue, ImagePixelType);
81     itkSetMacro(BackgroundValue, ImagePixelType);
82     itkSetMacro(ForegroundValue, ImagePixelType);
83     
84     itkSetMacro(FuzzyThreshold, double);
85     itkGetConstMacro(FuzzyThreshold, double);
86
87   protected:
88     ExtractLymphStationsFilter();
89     virtual ~ExtractLymphStationsFilter() {}
90     
91     virtual void GenerateOutputInformation();
92     virtual void GenerateInputRequestedRegion();
93     virtual void GenerateData();
94        
95     MaskImagePointer m_mediastinum;
96     MaskImagePointer m_trachea;
97     MaskImagePointer m_working_mediastinum;
98     MaskImagePointer m_working_trachea;  
99     MaskImagePointer m_output;  
100     
101     ImagePixelType m_BackgroundValue;
102     ImagePixelType m_ForegroundValue;
103     double m_CarinaZPositionInMM;
104     bool   m_CarinaZPositionInMMIsSet;
105     double m_MiddleLobeBronchusZPositionInMM; 
106
107     double m_IntermediateSpacing;
108     double m_FuzzyThreshold;
109     
110   private:
111     ExtractLymphStationsFilter(const Self&); //purposely not implemented
112     void operator=(const Self&); //purposely not implemented
113     
114   }; // end class
115   //--------------------------------------------------------------------
116
117 } // end namespace clitk
118 //--------------------------------------------------------------------
119
120 #ifndef ITK_MANUAL_INSTANTIATION
121 #include "clitkExtractLymphStationsFilter.txx"
122 #endif
123
124 #endif