1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
19 #ifndef CLITKEXTRACTLYMPHSTATIONSFILTER_H
20 #define CLITKEXTRACTLYMPHSTATIONSFILTER_H
23 #include "clitkFilterBase.h"
24 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
28 //--------------------------------------------------------------------
30 Try to extract the LymphStations part of a thorax CT.
36 //--------------------------------------------------------------------
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> >
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;
52 /** Method for creation through the object factory. */
55 /** Run-time type information (and related methods). */
56 itkTypeMacro(ExtractLymphStationsFilter, InPlaceImageFilter);
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;
68 typedef uchar MaskImagePixelType;
69 typedef itk::Image<MaskImagePixelType, 3> MaskImageType;
70 typedef typename MaskImageType::Pointer MaskImagePointer;
73 // void SetInput(const TImageType * image);
75 /** ImageDimension constants */
76 itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension);
79 itkGetConstMacro(BackgroundValue, ImagePixelType);
80 itkGetConstMacro(ForegroundValue, ImagePixelType);
81 itkSetMacro(BackgroundValue, ImagePixelType);
82 itkSetMacro(ForegroundValue, ImagePixelType);
84 itkSetMacro(FuzzyThreshold, double);
85 itkGetConstMacro(FuzzyThreshold, double);
88 ExtractLymphStationsFilter();
89 virtual ~ExtractLymphStationsFilter() {}
91 virtual void GenerateOutputInformation();
92 virtual void GenerateInputRequestedRegion();
93 virtual void GenerateData();
95 MaskImagePointer m_mediastinum;
96 MaskImagePointer m_trachea;
97 MaskImagePointer m_working_mediastinum;
98 MaskImagePointer m_working_trachea;
99 MaskImagePointer m_output;
101 ImagePixelType m_BackgroundValue;
102 ImagePixelType m_ForegroundValue;
103 double m_CarinaZPositionInMM;
104 bool m_CarinaZPositionInMMIsSet;
105 double m_MiddleLobeBronchusZPositionInMM;
107 double m_IntermediateSpacing;
108 double m_FuzzyThreshold;
111 ExtractLymphStationsFilter(const Self&); //purposely not implemented
112 void operator=(const Self&); //purposely not implemented
115 //--------------------------------------------------------------------
117 } // end namespace clitk
118 //--------------------------------------------------------------------
120 #ifndef ITK_MANUAL_INSTANTIATION
121 #include "clitkExtractLymphStationsFilter.txx"