Orfeo Toolbox  4.0
otbBinaryFunctorNeighborhoodImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbBinaryFunctorNeighborhoodImageFilter_h
19 #define __otbBinaryFunctorNeighborhoodImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
24 #include "itkSize.h"
25 
26 namespace otb
27 {
28 
41 template <class TInputImage1, class TInputImage2,
42  class TOutputImage, class TFunction>
43 class ITK_EXPORT BinaryFunctorNeighborhoodImageFilter : public itk::ImageToImageFilter<TInputImage1, TOutputImage>
44 {
45 public:
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(BinaryFunctorNeighborhoodImageFilter, BinaryFunctorImageFilter);
57 
59  typedef TFunction FunctorType;
60  typedef TInputImage1 Input1ImageType;
61  typedef typename Input1ImageType::ConstPointer Input1ImageConstPointer;
62  typedef typename Input1ImageType::Pointer Input1ImagePointer;
63  typedef typename Input1ImageType::RegionType Input1ImageRegionType;
64  typedef typename Input1ImageType::PixelType Input1ImagePixelType;
65  typedef TInputImage2 Input2ImageType;
66  typedef typename Input2ImageType::ConstPointer Input2ImageConstPointer;
67  typedef typename Input2ImageType::Pointer Input2ImagePointer;
68  typedef typename Input2ImageType::RegionType Input2ImageRegionType;
69  typedef typename Input2ImageType::PixelType Input2ImagePixelType;
70  typedef TOutputImage OutputImageType;
71  typedef typename OutputImageType::Pointer OutputImagePointer;
72  typedef typename OutputImageType::RegionType OutputImageRegionType;
73  typedef typename OutputImageType::PixelType OutputImagePixelType;
74 
76 
78  void SetInput1(const TInputImage1 * image1);
79 
81  void SetInput2(const TInputImage2 * image2);
82 
84  const TInputImage1 * GetInput1();
85  const TInputImage2 * GetInput2();
86 
91  FunctorType& GetFunctor()
92  {
93  return m_Functor;
94  }
95 
102  void SetFunctor(const FunctorType& functor)
103  {
104  m_Functor = functor;
105  this->Modified();
106  }
107 
112 
115 
117 
118  itkSetMacro(Radius, RadiusSizeType);
119 
121  void SetRadius(unsigned int radius)
122  {
123  m_Radius.Fill(radius);
124  }
125 
126 protected:
129 
140  virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
141  itk::ThreadIdType threadId);
142 
146  virtual void GenerateInputRequestedRegion(void);
147 
149 
150 private:
151  BinaryFunctorNeighborhoodImageFilter(const Self &); //purposely not implemented
152  void operator =(const Self&); //purposely not implemented
153 
155 };
156 
157 } // end namespace otb
158 
159 #ifndef OTB_MANUAL_INSTANTIATION
161 #endif
162 
163 #endif

Generated at Sat Mar 8 2014 15:51:01 for Orfeo Toolbox with doxygen 1.8.3.1