]> Creatis software - clitk.git/blob - segmentation/clitkMotionMaskGenericFilter.h
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / segmentation / clitkMotionMaskGenericFilter.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://www.centreleonberard.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 #ifndef clitkMotionMaskGenericFilter_h
19 #define clitkMotionMaskGenericFilter_h
20
21 /* =================================================
22  * @file   clitkMotionMaskGenericFilter.h
23  * @author
24  * @date
25  *
26  * @brief
27  *
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkCommon.h"
34 #include "clitkImageCommon.h"
35 #include "clitkMotionMask_ggo.h"
36 #include "clitkSetBackgroundImageFilter.h"
37
38 //itk include
39 #include <itkLightObject.h>
40 #include <itkBinaryThresholdImageFilter.h>
41 #include <itkConnectedComponentImageFilter.h>
42 #include <itkRelabelComponentImageFilter.h>
43 #include <itkThresholdImageFilter.h>
44 #include <itkMirrorPadImageFilter.h>
45 #include <itkImageMomentsCalculator.h>
46 #include <itkResampleImageFilter.h>
47 #include <itkNearestNeighborInterpolateImageFunction.h>
48 #include <itkGeodesicActiveContourLevelSetImageFilter.h>
49 #include <itkSignedDanielssonDistanceMapImageFilter.h>
50 #include <itkLabelStatisticsImageFilter.h>
51 #include <itkCastImageFilter.h>
52 #include <itkCropImageFilter.h>
53 #include <itkBinaryMorphologicalClosingImageFilter.h>
54 #include <itkBinaryMorphologicalOpeningImageFilter.h>
55 #include <itkBinaryBallStructuringElement.h>
56 #include <itkImageRegionIteratorWithIndex.h>
57 #include <itkApproximateSignedDistanceMapImageFilter.h>
58
59 namespace clitk
60 {
61 class ITK_EXPORT MotionMaskGenericFilter : public itk::LightObject
62 {
63 public:
64   //----------------------------------------
65   // ITK
66   //----------------------------------------
67   typedef MotionMaskGenericFilter                   Self;
68   typedef itk::LightObject                   Superclass;
69   typedef itk::SmartPointer<Self>            Pointer;
70   typedef itk::SmartPointer<const Self>      ConstPointer;
71
72   // Method for creation through the object factory
73   itkNewMacro(Self);
74
75   // Run-time type information (and related methods)
76   itkTypeMacro( MotionMaskGenericFilter, LightObject );
77
78   //----------------------------------------
79   // Typedefs
80   //----------------------------------------
81   typedef int InternalPixelType;
82
83
84   //----------------------------------------
85   // Set & Get
86   //----------------------------------------
87   void SetArgsInfo(const args_info_clitkMotionMask & a) {
88     m_ArgsInfo=a;
89     m_Verbose=m_ArgsInfo.verbose_flag;
90     m_InputFileName=m_ArgsInfo.input_arg;
91   }
92
93
94   //----------------------------------------
95   // Update
96   //----------------------------------------
97   void Update();
98
99 protected:
100
101   //----------------------------------------
102   // Constructor & Destructor
103   //----------------------------------------
104   MotionMaskGenericFilter();
105   ~MotionMaskGenericFilter() {};
106
107
108   //----------------------------------------
109   // Templated members
110   //----------------------------------------
111   template <unsigned int Dimension, class PixelType>
112   typename itk::Image<InternalPixelType, Dimension>::Pointer GetAirImage(typename itk::Image<PixelType, Dimension>::Pointer input,
113       typename itk::Image<MotionMaskGenericFilter::InternalPixelType, Dimension>::Pointer lungs);
114   template <unsigned int Dimension, class PixelType>
115   typename itk::Image<InternalPixelType, Dimension>::Pointer GetBonesImage(typename itk::Image<PixelType, Dimension>::Pointer input );
116   template <unsigned int Dimension, class PixelType>
117   typename itk::Image<InternalPixelType, Dimension>::Pointer GetLungsImage(typename itk::Image<PixelType, Dimension>::Pointer input );
118   template <unsigned int Dimension, class PixelType>
119   typename itk::Image<InternalPixelType, Dimension>::Pointer Resample(typename itk::Image<InternalPixelType, Dimension>::Pointer input );
120   template <unsigned int Dimension, class PixelType>
121   typename itk::Image<InternalPixelType, Dimension>::Pointer InitializeEllips( typename itk::Vector<double,Dimension> center, typename itk::Image<InternalPixelType, Dimension>::Pointer bones_low, typename itk::Image<InternalPixelType,Dimension>::Pointer lungs_low);
122
123
124   template <unsigned int Dimension>  void UpdateWithDim(std::string PixelType);
125   template <unsigned int Dimension, class PixelType>  void UpdateWithDimAndPixelType();
126
127
128   //----------------------------------------
129   // Data members
130   //----------------------------------------
131   args_info_clitkMotionMask m_ArgsInfo;
132   bool m_Verbose;
133   std::string m_InputFileName;
134
135 };
136
137
138 } // end namespace clitk
139
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "clitkMotionMaskGenericFilter.txx"
142 #endif
143
144 #endif // #define clitkMotionMaskGenericFilter_h