]> Creatis software - clitk.git/blob - itk/clitkLabelImageOverlapMeasureFilter.h
Fix deprecated warning (Begin -> GoToBegin)
[clitk.git] / itk / clitkLabelImageOverlapMeasureFilter.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 CLITKLABELIMAGEOVERLAPMEASUREFILTER_H
20 #define CLITKLABELIMAGEOVERLAPMEASUREFILTER_H
21
22 // clitk
23 #include "clitkFilterBase.h"
24 #include "clitkCropLikeImageFilter.h"
25 #include "clitkSegmentationUtils.h"
26 // #include "itkLabelOverlapMeasuresImageFilter.h"
27
28 // itk
29 #include <itkImageToImageFilter.h>
30 #include <itkLabelStatisticsImageFilter.h>
31
32 #include <iomanip>
33
34 namespace clitk {
35   
36   //--------------------------------------------------------------------
37   /*
38     Analyze the relative position of a Target (mask image) according
39     to some Object, in a given Support. Indicate the main important
40     position of this Target according the Object. 
41   */
42   //--------------------------------------------------------------------
43   
44   template <class ImageType>
45   class LabelImageOverlapMeasureFilter:
46     public virtual FilterBase,
47     public itk::ImageToImageFilter<ImageType, ImageType>
48   {
49
50   public:
51     /** Standard class typedefs. */
52     typedef itk::ImageToImageFilter<ImageType, ImageType>      Superclass;
53     typedef LabelImageOverlapMeasureFilter<ImageType>          Self;
54     typedef itk::SmartPointer<Self>                            Pointer;
55     typedef itk::SmartPointer<const Self>                      ConstPointer;
56        
57     /** Method for creation through the object factory. */
58     itkNewMacro(Self);
59     
60     /** Run-time type information (and related methods). */
61     itkTypeMacro(LabelImageOverlapMeasureFilter, ImageToImageFilter);
62
63     /** Some convenient typedefs. */
64     typedef typename ImageType::ConstPointer ImageConstPointer;
65     typedef typename ImageType::Pointer      ImagePointer;
66     typedef typename ImageType::RegionType   RegionType; 
67     typedef typename ImageType::PixelType    PixelType;
68     typedef typename ImageType::SpacingType  SpacingType;
69     typedef typename ImageType::SizeType     SizeType;
70     typedef typename ImageType::IndexType    IndexType;
71     typedef typename ImageType::PointType    PointType;
72     
73     /** ImageDimension constants */
74     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
75     FILTERBASE_INIT;
76  
77     // Options
78     itkGetConstMacro(BackgroundValue, PixelType);
79     itkSetMacro(BackgroundValue, PixelType);
80
81     itkGetConstMacro(Label1, PixelType);
82     itkSetMacro(Label1, PixelType);
83
84     itkGetConstMacro(Label2, PixelType);
85     itkSetMacro(Label2, PixelType);
86
87     // I dont want to verify inputs information
88     virtual void VerifyInputInformation() { }
89     
90    protected:
91     LabelImageOverlapMeasureFilter();
92     virtual ~LabelImageOverlapMeasureFilter() {}
93     
94     PixelType m_BackgroundValue;
95     PixelType m_Label1;
96     PixelType m_Label2;
97     ImagePointer m_Input1;
98     ImagePointer m_Input2;
99
100     virtual void GenerateOutputInformation();
101     virtual void GenerateInputRequestedRegion();
102     virtual void GenerateData();
103
104   private:
105     LabelImageOverlapMeasureFilter(const Self&); //purposely not implemented
106     void operator=(const Self&); //purposely not implemented
107     
108   }; // end class
109   //--------------------------------------------------------------------
110
111 } // end namespace clitk
112 //--------------------------------------------------------------------
113
114 #include "clitkLabelImageOverlapMeasureFilter.txx"
115
116 #endif