ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkGPUUnaryFunctorImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkGPUUnaryFunctorImageFilter_h
19 #define __itkGPUUnaryFunctorImageFilter_h
20 
21 #include "itkGPUFunctorBase.h"
24 
25 namespace itk
26 {
35 template< class TInputImage, class TOutputImage, class TFunction, class TParentImageFilter =
36  InPlaceImageFilter< TInputImage, TOutputImage > >
37 class ITK_EXPORT GPUUnaryFunctorImageFilter : public GPUInPlaceImageFilter< TInputImage, TOutputImage,
38  TParentImageFilter >
39 {
40 public:
47 
49  itkNewMacro(Self);
50 
53 
55  typedef TFunction FunctorType;
56 
57  typedef TInputImage InputImageType;
58  typedef typename InputImageType::ConstPointer InputImagePointer;
59  typedef typename InputImageType::RegionType InputImageRegionType;
60  typedef typename InputImageType::PixelType InputImagePixelType;
61 
62  typedef TOutputImage OutputImageType;
63  typedef typename OutputImageType::Pointer OutputImagePointer;
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65  typedef typename OutputImageType::PixelType OutputImagePixelType;
66 
68  return m_Functor;
69  }
70  const FunctorType & GetFunctor() const {
71  return m_Functor;
72  }
73 
75  void SetFunctor(const FunctorType & functor)
76  {
77  if ( m_Functor != functor )
78  {
79  m_Functor = functor;
80  this->Modified();
81  }
82  }
84 
85 protected:
87  }
89  }
90 
91  virtual void GenerateOutputInformation();
92 
93  virtual void GPUGenerateData();
94 
98 private:
99  GPUUnaryFunctorImageFilter(const Self &); //purposely not implemented
100  void operator=(const Self &); //purposely not implemented
102 
104 
105 };
106 
107 } // end of namespace itk
108 
109 #if ITK_TEMPLATE_TXX
110 #include "itkGPUUnaryFunctorImageFilter.hxx"
111 #endif
112 
113 #endif
114