ITK  5.0.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:
41  ITK_DISALLOW_COPY_AND_ASSIGN(GPUUnaryFunctorImageFilter);
42 
45  using CPUSuperclass = TParentImageFilter;
49 
51  itkNewMacro(Self);
52 
55 
57  using FunctorType = TFunction;
58 
59  using InputImageType = TInputImage;
60  using InputImagePointer = typename InputImageType::ConstPointer;
62  using InputImagePixelType = typename InputImageType::PixelType;
63 
64  using OutputImageType = TOutputImage;
65  using OutputImagePointer = typename OutputImageType::Pointer;
67  using OutputImagePixelType = typename OutputImageType::PixelType;
68 
70  return m_Functor;
71  }
72  const FunctorType & GetFunctor() const {
73  return m_Functor;
74  }
75 
77  void SetFunctor(const FunctorType & functor)
78  {
79  if ( m_Functor != functor )
80  {
81  m_Functor = functor;
82  this->Modified();
83  }
84  }
86 
87 protected:
89  }
91 
92  void GenerateOutputInformation() override;
93 
94  void GPUGenerateData() override;
95 
99 
100 private:
102 
103 };
104 
105 } // end of namespace itk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "itkGPUUnaryFunctorImageFilter.hxx"
109 #endif
110 
111 #endif
void SetFunctor(const FunctorType &functor)
typename OutputImageType::Pointer OutputImagePointer
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
Binarize an input image by thresholding.
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
Base class for GPU filters that take an image as input and overwrite that image as the output...
TOutputImage OutputImageType
typename InputImageType::RegionType InputImageRegionType
Implements pixel-wise generic operation on one image using the GPU.