]> Creatis software - clitk.git/blob - segmentation/clitkConnectedComponentLabelingGenericFilter.h
Add 2 options to clitkImage2Dicom
[clitk.git] / segmentation / clitkConnectedComponentLabelingGenericFilter.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 CLITKCONNECTEDCOMPONENTLABELINGSGENERICFILTER_H
20 #define CLITKCONNECTEDCOMPONENTLABELINGSGENERICFILTER_H
21
22 #include "clitkIO.h"
23 #include "clitkImageToImageGenericFilter.h"
24 #include "itkMacro.h"
25
26 //--------------------------------------------------------------------
27 namespace clitk 
28 {
29   
30   template<class ArgsInfoType>
31   class ITK_EXPORT ConnectedComponentLabelingGenericFilter: 
32     public ImageToImageGenericFilter<ConnectedComponentLabelingGenericFilter<ArgsInfoType> >
33   {
34     
35   public:
36     //--------------------------------------------------------------------
37     ConnectedComponentLabelingGenericFilter();
38
39     //--------------------------------------------------------------------
40     typedef ConnectedComponentLabelingGenericFilter Self;
41     typedef itk::SmartPointer<Self>                 Pointer;
42     typedef itk::SmartPointer<const Self>           ConstPointer;
43
44     //--------------------------------------------------------------------
45     itkNewMacro(Self);  
46     itkTypeMacro(ConnectedComponentLabelingGenericFilter, LightObject);
47
48     //--------------------------------------------------------------------
49     void SetArgsInfo(const ArgsInfoType & a);
50     std::vector<float> GetSizeOfObjectsInPixels() const { return m_SizeOfObjectsInPixels; }
51     std::vector<float> GetSizeOfObjectsInPhysicalUnits() const { return m_SizeOfObjectsInPhysicalUnits; }
52     itkGetConstMacro(OriginalNumberOfObjects, unsigned long int);
53
54     //--------------------------------------------------------------------
55     // Main function called each time the filter is updated
56     template<class ImageType>  
57     void UpdateWithInputImageType();
58
59   protected:
60     void Modified() {} // Need for using itkMacros
61     template<unsigned int Dim> void InitializeImageType();
62     ArgsInfoType mArgsInfo;
63     std::vector<float> m_SizeOfObjectsInPixels;
64     std::vector<float> m_SizeOfObjectsInPhysicalUnits;
65     unsigned long int m_OriginalNumberOfObjects;
66     
67   }; // end class
68   //--------------------------------------------------------------------
69     
70 } // end namespace clitk
71
72 #ifndef ITK_MANUAL_INSTANTIATION
73 #include "clitkConnectedComponentLabelingGenericFilter.txx"
74 #endif
75
76 #endif // #define CLITKCONNECTEDCOMPONENTLABELINGSGENERICFILTER_H