]> Creatis software - clitk.git/blob - segmentation/clitkFillMaskFilter.h
Add clitkImage2Dicom tool
[clitk.git] / segmentation / clitkFillMaskFilter.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
19 #ifndef CLITKFILLMASKFILTER_H
20 #define CLITKFILLMASKFILTER_H
21
22 // clitk 
23 #include "clitkCommon.h"
24
25 //itk 
26 #include "itkLightObject.h"
27 #include "itkJoinSeriesImageFilter.h"
28 #include "itkBinaryThresholdImageFilter.h"
29 #include "itkConnectedComponentImageFilter.h"
30 #include "itkRelabelComponentImageFilter.h"
31 #include "itkThresholdImageFilter.h"
32 #include "itkPermuteAxesImageFilter.h"
33 #include "itkExtractImageFilter.h"
34 #include "itkCastImageFilter.h"
35
36 namespace clitk 
37 {
38   
39   //--------------------------------------------------------------------
40   template <class TImageType>
41   class ITK_EXPORT FillMaskFilter: 
42     public itk::ImageToImageFilter<TImageType, TImageType > 
43   {
44   public:
45     /** Standard class typedefs. */
46     typedef itk::ImageToImageFilter<TImageType, TImageType> Superclass;
47     typedef FillMaskFilter                 Self;
48     typedef itk::SmartPointer<Self>        Pointer;
49     typedef itk::SmartPointer<const Self>  ConstPointer;
50     
51     /** Method for creation through the object factory */
52     itkNewMacro(Self);  
53
54     /**  Run-time type information (and related methods)*/
55     itkTypeMacro(FillMaskFilter, ImageToImageFilter);
56
57     /** Some convenient typedefs */
58     typedef TImageType                       ImageType;
59     typedef typename ImageType::ConstPointer InputImageConstPointer;
60     typedef typename ImageType::Pointer      InputImagePointer;
61     typedef typename ImageType::RegionType   InputImageRegionType; 
62     typedef typename ImageType::PixelType    InputImagePixelType; 
63     typedef typename ImageType::SizeType     InputImageSizeType; 
64     typedef typename ImageType::IndexType    InputImageIndexType; 
65     typedef typename ImageType::PointType    InputImagePointType; 
66     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
67
68     /** Options */
69     void AddDirection(int dir);
70     void ResetDirections();
71     const std::vector<int> & GetDirections() const { return m_Directions; }
72
73     // Set all options at a time
74     template<class ArgsInfoType> void SetOptionsFromArgsInfo(ArgsInfoType & arg);
75     template<class ArgsInfoType> void SetOptionsToArgsInfo(ArgsInfoType & arg);
76  
77   protected:
78     FillMaskFilter();
79     virtual ~FillMaskFilter() {};
80
81     // Main members
82     InputImageConstPointer input;
83     std::vector<int> m_Directions;
84
85    // Main function
86     virtual void GenerateData();
87     
88    private:
89     FillMaskFilter(const Self&); //purposely not implemented
90     void operator=(const Self&); //purposely not implemented
91     
92   }; // end class
93   //--------------------------------------------------------------------
94
95 } // end namespace clitk
96 //--------------------------------------------------------------------
97
98 #ifndef ITK_MANUAL_INSTANTIATION
99 #include "clitkFillMaskFilter.txx"
100 #endif
101
102 #endif