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://www.centreleonberard.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 ===========================================================================**/
18 #ifndef clitkMotionMaskGenericFilter_h
19 #define clitkMotionMaskGenericFilter_h
21 /* =================================================
22 * @file clitkMotionMaskGenericFilter.h
28 ===================================================*/
33 #include "clitkCommon.h"
34 #include "clitkImageCommon.h"
35 #include "clitkMotionMask_ggo.h"
36 #include "clitkSetBackgroundImageFilter.h"
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>
61 class ITK_EXPORT MotionMaskGenericFilter : public itk::LightObject
64 //----------------------------------------
66 //----------------------------------------
67 typedef MotionMaskGenericFilter Self;
68 typedef itk::LightObject Superclass;
69 typedef itk::SmartPointer<Self> Pointer;
70 typedef itk::SmartPointer<const Self> ConstPointer;
72 // Method for creation through the object factory
75 // Run-time type information (and related methods)
76 itkTypeMacro( MotionMaskGenericFilter, LightObject );
78 //----------------------------------------
80 //----------------------------------------
81 typedef int InternalPixelType;
84 //----------------------------------------
86 //----------------------------------------
87 void SetArgsInfo(const args_info_clitkMotionMask & a) {
89 m_Verbose=m_ArgsInfo.verbose_flag;
90 m_InputFileName=m_ArgsInfo.input_arg;
94 //----------------------------------------
96 //----------------------------------------
101 //----------------------------------------
102 // Constructor & Destructor
103 //----------------------------------------
104 MotionMaskGenericFilter();
105 ~MotionMaskGenericFilter() {};
108 //----------------------------------------
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);
124 template <unsigned int Dimension> void UpdateWithDim(std::string PixelType);
125 template <unsigned int Dimension, class PixelType> void UpdateWithDimAndPixelType();
128 //----------------------------------------
130 //----------------------------------------
131 args_info_clitkMotionMask m_ArgsInfo;
133 std::string m_InputFileName;
138 } // end namespace clitk
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "clitkMotionMaskGenericFilter.txx"
144 #endif // #define clitkMotionMaskGenericFilter_h