go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGPUUnaryFunctorImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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/*=========================================================================
19 *
20 * Copyright Insight Software Consortium
21 *
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
25 *
26 * http://www.apache.org/licenses/LICENSE-2.0.txt
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 *=========================================================================*/
35#ifndef itkGPUUnaryFunctorImageFilter_h
36#define itkGPUUnaryFunctorImageFilter_h
37
38#include "itkGPUFunctorBase.h"
40#include "itkUnaryFunctorImageFilter.h"
41
42namespace itk
43{
59template <typename TInputImage,
60 typename TOutputImage,
61 typename TFunction,
62 typename TParentImageFilter = InPlaceImageFilter<TInputImage, TOutputImage>>
64 : public GPUInPlaceImageFilter<TInputImage, TOutputImage, TParentImageFilter>
65{
66public:
68
71 using CPUSuperclass = TParentImageFilter;
73 using Pointer = SmartPointer<Self>;
74 using ConstPointer = SmartPointer<const Self>;
75
77 itkNewMacro(Self);
78
81
83 using FunctorType = TFunction;
84
85 using InputImageType = TInputImage;
86 using InputImagePointer = typename InputImageType::ConstPointer;
87 using InputImageRegionType = typename InputImageType::RegionType;
88 using InputImagePixelType = typename InputImageType::PixelType;
89
90 using OutputImageType = TOutputImage;
91 using OutputImagePointer = typename OutputImageType::Pointer;
92 using OutputImageRegionType = typename OutputImageType::RegionType;
93 using OutputImagePixelType = typename OutputImageType::PixelType;
94
96 itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
97 itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
98
101 {
102 return m_Functor;
103 }
104
105
106 const FunctorType &
108 {
109 return m_Functor;
110 }
111
112
114 void
115 SetFunctor(const FunctorType & functor)
116 {
117 if (m_Functor != functor)
118 {
119 m_Functor = functor;
120 this->Modified();
121 }
122 }
123
124
125protected:
127
128 ~GPUUnaryFunctorImageFilter() override = default;
129
130 void
132
133 void
134 GPUGenerateData() override;
135
139
140private:
142};
143
144} // end of namespace itk
145
146#ifndef ITK_MANUAL_INSTANTIATION
147# include "itkGPUUnaryFunctorImageFilter.hxx"
148#endif
149
150#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)
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::ConstPointer InputImagePointer
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
typename OutputImageType::RegionType OutputImageRegionType
~GPUUnaryFunctorImageFilter() override=default
typename OutputImageType::Pointer OutputImagePointer
ITK_DISALLOW_COPY_AND_MOVE(GPUUnaryFunctorImageFilter)
void GenerateOutputInformation() override
typename InputImageType::PixelType InputImagePixelType
#define ITKOpenCL_EXPORT


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo