ITK  5.4.0
Insight Toolkit
itkGPUCastImageFilter.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 itkGPUCastImageFilter_h
19#define itkGPUCastImageFilter_h
20
21#include "itkCastImageFilter.h"
23
24#include "itkGPUFunctorBase.h"
25#include "itkGPUKernelManager.h"
27
28namespace itk
29{
30
32itkGPUKernelClassMacro(GPUCastImageFilterKernel);
33
48namespace Functor
49{
50
51template <typename TInput, typename TOutput>
52class ITK_TEMPLATE_EXPORT GPUCast : public GPUFunctorBase
53{
54public:
56
58
62 int
63 SetGPUKernelArguments(GPUKernelManager::Pointer itkNotUsed(kernelManager), int itkNotUsed(kernelHandle))
64 {
65 return 0;
66 }
67};
68
69} // end of namespace Functor
70
71template <typename TInputImage, typename TOutputImage>
72class ITK_TEMPLATE_EXPORT GPUCastImageFilter
74 TInputImage,
75 TOutputImage,
76 Functor::GPUCast<typename TInputImage::PixelType, typename TOutputImage::PixelType>,
77 CastImageFilter<TInputImage, TOutputImage>>
78{
79public:
80 ITK_DISALLOW_COPY_AND_MOVE(GPUCastImageFilter);
81
86 TOutputImage,
92
94 itkNewMacro(Self);
95
97 itkOverrideGetNameOfClassMacro(GPUCastImageFilter);
98
100 using InputPixelType = typename TInputImage::PixelType;
101 using OutputPixelType = typename TOutputImage::PixelType;
102
105
106protected:
109
112 void
113 GPUGenerateData() override;
114
115private:
116};
117
118} // end of namespace itk
119
120#ifndef ITK_MANUAL_INSTANTIATION
121# include "itkGPUCastImageFilter.hxx"
122#endif
123
124#endif /* itkGPUCastImageFilter_h */
Casts input pixels to output pixel type.
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::PixelType InputPixelType
int SetGPUKernelArguments(GPUKernelManager::Pointer, int)
Base functor class for GPU functor image filters.
GPU version of CastImageFilter.
void GPUGenerateData() override
Implements pixel-wise generic operation on one image using the GPU.
Base class for all process objects that output image data.
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
itkGPUKernelClassMacro(GPUImageOpsKernel)