ITK  4.12.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< typename TInputImage, typename TOutputImage, typename TFunction, typename TParentImageFilter =
36  InPlaceImageFilter< TInputImage, TOutputImage > >
37 class ITK_TEMPLATE_EXPORT GPUUnaryFunctorImageFilter : public GPUInPlaceImageFilter< TInputImage, TOutputImage,
38  TParentImageFilter >
39 {
40 public:
43  typedef TParentImageFilter CPUSuperclass;
47 
49  itkNewMacro(Self);
50 
53 
55  typedef TFunction FunctorType;
56 
57  typedef TInputImage InputImageType;
59  typedef typename InputImageType::RegionType InputImageRegionType;
60  typedef typename InputImageType::PixelType InputImagePixelType;
61 
62  typedef TOutputImage OutputImageType;
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() ITK_OVERRIDE;
92 
93  virtual void GPUGenerateData() ITK_OVERRIDE;
94 
97  int m_UnaryFunctorImageFilterGPUKernelHandle;
98 
99 private:
100  ITK_DISALLOW_COPY_AND_ASSIGN(GPUUnaryFunctorImageFilter);
101 
102  FunctorType m_Functor;
103 
104 };
105 
106 } // end of namespace itk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "itkGPUUnaryFunctorImageFilter.hxx"
110 #endif
111 
112 #endif
OutputImageType::PixelType OutputImagePixelType
void SetFunctor(const FunctorType &functor)
OutputImageType::RegionType OutputImageRegionType
Base class for all process objects that output image data.
SmartPointer< Self > Pointer
InputImageType::RegionType InputImageRegionType
Base class for GPU filters that take an image as input and overwrite that image as the output...
InputImageType::ConstPointer InputImagePointer
SmartPointer< const Self > ConstPointer
Implements pixel-wise generic operation on one image using the GPU.
GPUInPlaceImageFilter< TInputImage, TOutputImage > GPUSuperclass