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
22 #include "clitkFilterBase.h"
26 //--------------------------------------------------------------------
28 Try to extract the LymphStations part of a thorax CT.
34 //--------------------------------------------------------------------
36 template <class TImageType>
37 class ITK_EXPORT ExtractLymphStationsFilter:
38 public clitk::FilterBase,
39 public itk::ImageToImageFilter<TImageType, TImageType>
43 /** Standard class typedefs. */
44 typedef itk::ImageToImageFilter<TImageType, TImageType> Superclass;
45 typedef ExtractLymphStationsFilter Self;
46 typedef itk::SmartPointer<Self> Pointer;
47 typedef itk::SmartPointer<const Self> ConstPointer;
49 /** Method for creation through the object factory. */
52 /** Run-time type information (and related methods). */
53 itkTypeMacro(ExtractLymphStationsFilter, InPlaceImageFilter);
56 /** Some convenient typedefs. */
57 typedef TImageType ImageType;
58 typedef typename ImageType::ConstPointer ImageConstPointer;
59 typedef typename ImageType::Pointer ImagePointer;
60 typedef typename ImageType::RegionType ImageRegionType;
61 typedef typename ImageType::PixelType ImagePixelType;
62 typedef typename ImageType::SizeType ImageSizeType;
63 typedef typename ImageType::IndexType ImageIndexType;
66 void SetInputMediastinumLabelImage(const TImageType * image, ImagePixelType bg=0);
67 void SetInputTracheaLabelImage(const TImageType * image, ImagePixelType bg=0);
69 /** ImageDimension constants */
70 itkStaticConstMacro(ImageDimension, unsigned int, TImageType::ImageDimension);
72 // Set all options at a time
73 template<class ArgsInfoType>
74 void SetArgsInfo(ArgsInfoType arg);
76 // Background / Foreground
77 itkSetMacro(BackgroundValueMediastinum, ImagePixelType);
78 itkGetConstMacro(BackgroundValueMediastinum, ImagePixelType);
79 //GGO_DefineOption(MediastinumBG, SetBackgroundValueMediastinum, ImagePixelType);
81 itkSetMacro(BackgroundValueTrachea, ImagePixelType);
82 itkGetConstMacro(BackgroundValueTrachea, ImagePixelType);
83 //GGO_DefineOption(TracheaBG, SetBackgroundValueTrachea, ImagePixelType);
85 itkGetConstMacro(BackgroundValue, ImagePixelType);
86 itkGetConstMacro(ForegroundValue, ImagePixelType);
88 itkSetMacro(CarenaZPositionInMM, double);
89 itkGetConstMacro(CarenaZPositionInMM, double);
90 GGO_DefineOption(carenaZposition, SetCarenaZPositionInMM, double);
92 itkSetMacro(MiddleLobeBronchusZPositionInMM, double);
93 itkGetConstMacro(MiddleLobeBronchusZPositionInMM, double);
94 GGO_DefineOption(middleLobeBronchusZposition, SetMiddleLobeBronchusZPositionInMM, double);
96 itkSetMacro(IntermediateSpacing, double);
97 itkGetConstMacro(IntermediateSpacing, double);
98 GGO_DefineOption(spacing, SetIntermediateSpacing, double);
100 itkSetMacro(FuzzyThreshold1, double);
101 itkGetConstMacro(FuzzyThreshold1, double);
102 GGO_DefineOption(fuzzy1, SetFuzzyThreshold1, double);
107 ExtractLymphStationsFilter();
108 virtual ~ExtractLymphStationsFilter() {}
110 virtual void GenerateOutputInformation();
111 virtual void GenerateInputRequestedRegion();
112 virtual void GenerateData();
114 itkSetMacro(BackgroundValue, ImagePixelType);
115 itkSetMacro(ForegroundValue, ImagePixelType);
117 ImageConstPointer m_mediastinum;
118 ImageConstPointer m_trachea;
119 ImagePointer m_working_image;
120 ImagePointer m_working_trachea;
121 ImagePointer m_output;
123 ImagePixelType m_BackgroundValueMediastinum;
124 ImagePixelType m_BackgroundValueTrachea;
125 ImagePixelType m_BackgroundValue;
126 ImagePixelType m_ForegroundValue;
128 double m_CarenaZPositionInMM;
129 double m_MiddleLobeBronchusZPositionInMM;
130 double m_IntermediateSpacing;
131 double m_FuzzyThreshold1;
134 ExtractLymphStationsFilter(const Self&); //purposely not implemented
135 void operator=(const Self&); //purposely not implemented
138 //--------------------------------------------------------------------
140 } // end namespace clitk
141 //--------------------------------------------------------------------
143 #ifndef ITK_MANUAL_INSTANTIATION
144 #include "clitkExtractLymphStationsFilter.txx"