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, TImageType>
46 /** Standard class typedefs. */
47 typedef itk::ImageToImageFilter<TImageType, TImageType> 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);
59 /** Some convenient typedefs. */
60 typedef TImageType ImageType;
61 typedef typename ImageType::ConstPointer ImageConstPointer;
62 typedef typename ImageType::Pointer ImagePointer;
63 typedef typename ImageType::RegionType ImageRegionType;
64 typedef typename ImageType::PixelType ImagePixelType;
65 typedef typename ImageType::SizeType ImageSizeType;
66 typedef typename ImageType::IndexType ImageIndexType;
67 typedef typename ImageType::PointType ImagePointType;
70 void SetInputMediastinumLabelImage(const TImageType * image, ImagePixelType bg=0);
71 void SetInputTracheaLabelImage(const TImageType * image, ImagePixelType bg=0);
73 /** ImageDimension constants */
74 itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension);
76 // Set all options at a time
77 template<class ArgsInfoType>
78 void SetArgsInfo(ArgsInfoType arg);
80 // Background / Foreground
81 itkSetMacro(BackgroundValueMediastinum, ImagePixelType);
82 itkGetConstMacro(BackgroundValueMediastinum, ImagePixelType);
83 //GGO_DefineOption(MediastinumBG, SetBackgroundValueMediastinum, ImagePixelType);
85 itkSetMacro(BackgroundValueTrachea, ImagePixelType);
86 itkGetConstMacro(BackgroundValueTrachea, ImagePixelType);
87 //GGO_DefineOption(TracheaBG, SetBackgroundValueTrachea, ImagePixelType);
89 itkGetConstMacro(BackgroundValue, ImagePixelType);
90 itkGetConstMacro(ForegroundValue, ImagePixelType);
92 //itkSetMacro(CarinaZPositionInMM, double);
93 void SetCarinaZPositionInMM(double d) { m_CarinaZPositionInMM = d; Modified(); m_CarinaZPositionInMMIsSet = true; }
94 itkGetConstMacro(CarinaZPositionInMM, double);
95 GGO_DefineOption(carenaZposition, SetCarinaZPositionInMM, double);
97 itkSetMacro(MiddleLobeBronchusZPositionInMM, double);
98 itkGetConstMacro(MiddleLobeBronchusZPositionInMM, double);
99 GGO_DefineOption(middleLobeBronchusZposition, SetMiddleLobeBronchusZPositionInMM, double);
101 itkSetMacro(IntermediateSpacing, double);
102 itkGetConstMacro(IntermediateSpacing, double);
103 GGO_DefineOption(spacing, SetIntermediateSpacing, double);
105 itkSetMacro(FuzzyThreshold1, double);
106 itkGetConstMacro(FuzzyThreshold1, double);
107 GGO_DefineOption(fuzzy1, SetFuzzyThreshold1, double);
110 ExtractLymphStationsFilter();
111 virtual ~ExtractLymphStationsFilter() {}
113 virtual void GenerateOutputInformation();
114 virtual void GenerateInputRequestedRegion();
115 virtual void GenerateData();
117 itkSetMacro(BackgroundValue, ImagePixelType);
118 itkSetMacro(ForegroundValue, ImagePixelType);
120 ImageConstPointer m_mediastinum;
121 ImageConstPointer m_trachea;
122 ImagePointer m_working_image;
123 ImagePointer m_working_trachea;
124 ImagePointer m_output;
126 ImagePixelType m_BackgroundValueMediastinum;
127 ImagePixelType m_BackgroundValueTrachea;
128 ImagePixelType m_BackgroundValue;
129 ImagePixelType m_ForegroundValue;
131 double m_CarinaZPositionInMM;
132 bool m_CarinaZPositionInMMIsSet;
133 double m_MiddleLobeBronchusZPositionInMM;
134 double m_IntermediateSpacing;
135 double m_FuzzyThreshold1;
138 ExtractLymphStationsFilter(const Self&); //purposely not implemented
139 void operator=(const Self&); //purposely not implemented
142 //--------------------------------------------------------------------
144 } // end namespace clitk
145 //--------------------------------------------------------------------
147 #ifndef ITK_MANUAL_INSTANTIATION
148 #include "clitkExtractLymphStationsFilter.txx"