ITK  4.13.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;
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  }
88  virtual ~GPUUnaryFunctorImageFilter() ITK_OVERRIDE {}
89 
90  virtual void GenerateOutputInformation() ITK_OVERRIDE;
91 
92  virtual void GPUGenerateData() ITK_OVERRIDE;
93 
96  int m_UnaryFunctorImageFilterGPUKernelHandle;
97 
98 private:
99  ITK_DISALLOW_COPY_AND_ASSIGN(GPUUnaryFunctorImageFilter);
100 
101  FunctorType m_Functor;
102 
103 };
104 
105 } // end of namespace itk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "itkGPUUnaryFunctorImageFilter.hxx"
109 #endif
110 
111 #endif
OutputImageType::PixelType OutputImagePixelType
void SetFunctor(const FunctorType &functor)
OutputImageType::RegionType OutputImageRegionType
Base class for all process objects that output image data.
InputImageType::RegionType InputImageRegionType
Base class for GPU filters that take an image as input and overwrite that image as the output...
InputImageType::ConstPointer InputImagePointer
Implements pixel-wise generic operation on one image using the GPU.
GPUInPlaceImageFilter< TInputImage, TOutputImage > GPUSuperclass