]> Creatis software - clitk.git/blob - itk/clitkRelativePositionAnalyzerFilter.h
Add first version of RelativePositionAnalyzer
[clitk.git] / itk / clitkRelativePositionAnalyzerFilter.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 CLITKRELATIVEPOSITIONANALYZERFILTER_H
20 #define CLITKRELATIVEPOSITIONANALYZERFILTER_H
21
22 // clitk
23 #include "clitkCommon.h"
24
25 // itk
26 #include <itkImageToImageFilter.h>
27
28 namespace clitk {
29   
30   //--------------------------------------------------------------------
31   /*
32     TODO
33   */
34   //--------------------------------------------------------------------
35   
36   template <class ImageType>
37   class ITK_EXPORT RelativePositionAnalyzerFilter:
38     public itk::ImageToImageFilter<ImageType, ImageType> 
39   {
40
41   public:
42     /** Standard class typedefs. */
43     typedef itk::ImageToImageFilter<ImageType, ImageType>      Superclass;
44     typedef RelativePositionAnalyzerFilter                     Self;
45     typedef itk::SmartPointer<Self>                            Pointer;
46     typedef itk::SmartPointer<const Self>                      ConstPointer;
47        
48     /** Method for creation through the object factory. */
49     itkNewMacro(Self);
50     
51     /** Run-time type information (and related methods). */
52     itkTypeMacro(RelativePositionAnalyzerFilter, ImageToImageFilter);
53
54     /** Some convenient typedefs. */
55     typedef typename ImageType::ConstPointer ImageConstPointer;
56     typedef typename ImageType::Pointer      ImagePointer;
57     typedef typename ImageType::RegionType   RegionType; 
58     typedef typename ImageType::PixelType    PixelType;
59     typedef typename ImageType::SpacingType  SpacingType;
60     typedef typename ImageType::SizeType     SizeType;
61     typedef typename ImageType::IndexType    IndexType;
62     typedef typename ImageType::PointType    PointType;
63     
64     /** ImageDimension constants */
65     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
66     typedef itk::Image<float, ImageDimension> FloatImageType;
67
68      /** Input : initial image and object */
69     void SetInputSupport(const ImageType * image);
70     void SetInputObject(const ImageType * image);
71     void SetInputTarget(const ImageType * image);
72     
73     // Options
74     itkSetMacro(VerboseFlag, bool);
75     itkGetConstMacro(VerboseFlag, bool);
76     itkBooleanMacro(VerboseFlag);
77
78     itkGetConstMacro(BackgroundValue, PixelType);
79     itkSetMacro(BackgroundValue, PixelType);
80
81     itkGetConstMacro(ForegroundValue, PixelType);
82     itkSetMacro(ForegroundValue, PixelType);
83
84     // For debug
85     void PrintOptions();
86
87   protected:
88     RelativePositionAnalyzerFilter();
89     virtual ~RelativePositionAnalyzerFilter() {}
90     
91     bool m_VerboseFlag;
92     PixelType m_BackgroundValue;
93     PixelType m_ForegroundValue;
94     ImagePointer m_Support;
95     ImagePointer m_Object;
96     ImagePointer m_Target;
97
98     virtual void GenerateData();
99
100   private:
101     RelativePositionAnalyzerFilter(const Self&); //purposely not implemented
102     void operator=(const Self&); //purposely not implemented
103     
104   }; // end class
105   //--------------------------------------------------------------------
106
107 } // end namespace clitk
108 //--------------------------------------------------------------------
109
110 #ifndef ITK_MANUAL_INSTANTIATION
111 #include "clitkRelativePositionAnalyzerFilter.txx"
112 #endif
113
114 #endif