ITK  6.0.0
Insight Toolkit
itkGPUUnaryFunctorImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
25namespace itk
26{
35template <typename TInputImage,
36 typename TOutputImage,
37 typename TFunction,
38 typename TParentImageFilter = InPlaceImageFilter<TInputImage, TOutputImage>>
39class ITK_TEMPLATE_EXPORT GPUUnaryFunctorImageFilter
40 : public GPUInPlaceImageFilter<TInputImage, TOutputImage, TParentImageFilter>
41{
42public:
43 ITK_DISALLOW_COPY_AND_MOVE(GPUUnaryFunctorImageFilter);
44
47 using CPUSuperclass = TParentImageFilter;
51
53 itkNewMacro(Self);
54
56 itkOverrideGetNameOfClassMacro(GPUUnaryFunctorImageFilter);
57
59 using FunctorType = TFunction;
60
61 using InputImageType = TInputImage;
64 using InputImagePixelType = typename InputImageType::PixelType;
65
66 using OutputImageType = TOutputImage;
69 using OutputImagePixelType = typename OutputImageType::PixelType;
70
71#if !defined(ITK_WRAPPING_PARSER)
74 {
75 return m_Functor;
76 }
77
78 const FunctorType &
79 GetFunctor() const
80 {
81 return m_Functor;
82 }
83
85 void
86 SetFunctor(const FunctorType & functor)
87 {
88 if (m_Functor != functor)
89 {
90 m_Functor = functor;
91 this->Modified();
92 }
93 }
94#endif // !defined( ITK_WRAPPING_PARSER )
97protected:
99 ~GPUUnaryFunctorImageFilter() override = default;
100
101 void
103
104 void
105 GPUGenerateData() override;
106
109 int m_UnaryFunctorImageFilterGPUKernelHandle{};
110
111private:
112 FunctorType m_Functor{};
113};
114
115} // end of namespace itk
116
117#ifndef ITK_MANUAL_INSTANTIATION
118# include "itkGPUUnaryFunctorImageFilter.hxx"
119#endif
120
121#endif
Base class for GPU filters that take an image as input and overwrite that image as the output.
Implements pixel-wise generic operation on one image using the GPU.
void SetFunctor(const FunctorType &functor)
~GPUUnaryFunctorImageFilter() override=default
void GenerateOutputInformation() override
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....