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 some Mediastinal Vessels in a thorax CT.
31 Need a set of Anatomical Features (AFDB)
33 //--------------------------------------------------------------------
35 template <class TImageType>
36 class ITK_EXPORT ExtractMediastinalVesselsFilter:
37 public virtual clitk::FilterBase,
38 public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
39 public itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> >
43 /** Standard class typedefs. */
44 typedef itk::ImageToImageFilter<TImageType, itk::Image<uchar, 3> > Superclass;
45 typedef ExtractMediastinalVesselsFilter 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(ExtractMediastinalVesselsFilter, ImageToImageFilter);
55 /** Some convenient typedefs. */
56 typedef TImageType ImageType;
57 typedef typename ImageType::ConstPointer ImageConstPointer;
58 typedef typename ImageType::Pointer ImagePointer;
59 typedef typename ImageType::RegionType ImageRegionType;
60 typedef typename ImageType::PixelType ImagePixelType;
61 typedef typename ImageType::SizeType ImageSizeType;
62 typedef typename ImageType::IndexType ImageIndexType;
63 typedef typename ImageType::PointType ImagePointType;
65 typedef uchar MaskImagePixelType;
66 typedef itk::Image<MaskImagePixelType, 3> MaskImageType;
67 typedef typename MaskImageType::Pointer MaskImagePointer;
68 typedef typename MaskImageType::RegionType MaskImageRegionType;
69 typedef typename MaskImageType::SizeType MaskImageSizeType;
70 typedef typename MaskImageType::IndexType MaskImageIndexType;
71 typedef typename MaskImageType::PointType MaskImagePointType;
73 typedef itk::Image<MaskImagePixelType, 2> MaskSliceType;
74 typedef typename MaskSliceType::Pointer MaskSlicePointer;
75 typedef typename MaskSliceType::PointType MaskSlicePointType;
77 typedef long LabelType;
78 /** ImageDimension constants */
79 itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
82 itkGetConstMacro(BackgroundValue, MaskImagePixelType);
83 itkSetMacro(BackgroundValue, MaskImagePixelType);
85 itkGetConstMacro(ForegroundValue, MaskImagePixelType);
86 itkSetMacro(ForegroundValue, MaskImagePixelType);
88 itkGetConstMacro(TemporaryForegroundValue, MaskImagePixelType);
89 itkSetMacro(TemporaryForegroundValue, MaskImagePixelType);
91 itkGetConstMacro(OutputFolder, std::string);
92 itkSetMacro(OutputFolder, std::string);
94 itkGetConstMacro(Threshold, ImagePixelType);
95 itkSetMacro(Threshold, ImagePixelType);
98 ExtractMediastinalVesselsFilter();
99 virtual ~ExtractMediastinalVesselsFilter() {}
101 virtual void GenerateOutputInformation();
102 virtual void GenerateInputRequestedRegion();
103 virtual void GenerateData();
105 std::string m_OutputFolder;
106 ImagePointer m_Input;
107 MaskImagePointer m_Working_Support;
108 MaskImagePointer m_Mediastinum;
109 MaskImagePointer m_Mask;
110 MaskImagePixelType m_BackgroundValue;
111 MaskImagePixelType m_ForegroundValue;
112 MaskImagePixelType m_TemporaryForegroundValue;
113 ImagePixelType m_Threshold;
115 std::vector<MaskSlicePointer> m_slice_recon;
118 //void SearchBrachioCephalicArtery(int & BCA_first_slice, LabelType & BCA_first_label);
119 void TrackBifurcationFromPoint(MaskImagePointer & recon,
120 std::vector<MaskSlicePointer> & slices_recon,
121 MaskImagePointType BCA_p,
123 std::vector<MaskImagePointType> & bif);
126 ExtractMediastinalVesselsFilter(const Self&); //purposely not implemented
127 void operator=(const Self&); //purposely not implemented
130 //--------------------------------------------------------------------
132 } // end namespace clitk
133 //--------------------------------------------------------------------
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "clitkExtractMediastinalVesselsFilter.txx"