go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGPUImageToImageFilter.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 itkGPUImageToImageFilter_h
36#define itkGPUImageToImageFilter_h
37
38#include "itkImageToImageFilter.h"
40
41namespace itk
42{
62template <typename TInputImage,
63 typename TOutputImage,
64 typename TParentImageFilter = ImageToImageFilter<TInputImage, TOutputImage>>
65class ITK_TEMPLATE_EXPORT ITKOpenCL_EXPORT GPUImageToImageFilter : public TParentImageFilter
66{
67public:
69
72 using Superclass = TParentImageFilter;
73 using Pointer = SmartPointer<Self>;
74 using ConstPointer = SmartPointer<const Self>;
75
77 itkNewMacro(Self);
78
80 itkTypeMacro(GPUImageToImageFilter, TParentImageFilter);
81
83 using typename Superclass::DataObjectIdentifierType;
84 using typename Superclass::OutputImageRegionType;
85 using typename Superclass::OutputImagePixelType;
86
88 using InputImageType = TInputImage;
89 using InputImagePointer = typename InputImageType::Pointer;
90 using InputImageConstPointer = typename InputImageType::ConstPointer;
91 using InputImageRegionType = typename InputImageType::RegionType;
92 using InputImagePixelType = typename InputImageType::PixelType;
93 using OutputImageType = TOutputImage;
94
96 itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
97 itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
98
99 // macro to set if GPU is used
100 itkSetMacro(GPUEnabled, bool);
101 itkGetConstMacro(GPUEnabled, bool);
102 itkBooleanMacro(GPUEnabled);
103
104 void
105 GraftOutput(DataObject * graft) override;
106
107 void
108 GraftOutput(const DataObjectIdentifierType & key, DataObject * graft) override;
109
110 void
111 SetNumberOfWorkUnits(ThreadIdType _arg) override;
112
113protected:
115 ~GPUImageToImageFilter() override = default;
116
117 void
118 PrintSelf(std::ostream & os, Indent indent) const override;
119
120 void
121 GenerateData() override;
122
123 virtual void
126
127 // GPU kernel manager
128 typename OpenCLKernelManager::Pointer m_GPUKernelManager{};
129
130private:
131 bool m_GPUEnabled{};
132};
133
134} // end namespace itk
135
136#ifndef ITK_MANUAL_INSTANTIATION
137# include "itkGPUImageToImageFilter.hxx"
138#endif
139
140#endif
class to abstract the behaviour of the GPU filters.
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)
void GenerateData() override
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension)
typename InputImageType::RegionType InputImageRegionType
~GPUImageToImageFilter() override=default
void GraftOutput(DataObject *graft) override
typename InputImageType::ConstPointer InputImageConstPointer
SmartPointer< const Self > ConstPointer
void SetNumberOfWorkUnits(ThreadIdType _arg) override
void GraftOutput(const DataObjectIdentifierType &key, DataObject *graft) override
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
void PrintSelf(std::ostream &os, Indent indent) const override
ITK_DISALLOW_COPY_AND_MOVE(GPUImageToImageFilter)
#define ITKOpenCL_EXPORT


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo