ITK  6.0.0
Insight Toolkit
itkGPUNeighborhoodOperatorImageFilter.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 itkGPUNeighborhoodOperatorImageFilter_h
19#define itkGPUNeighborhoodOperatorImageFilter_h
20
21#include "itkGPUImage.h"
25#include "itkImage.h"
28
29namespace itk
30{
44itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel);
45
46template <typename TInputImage,
47 typename TOutputImage,
48 typename TOperatorValueType = typename TOutputImage::PixelType,
50class ITK_TEMPLATE_EXPORT GPUNeighborhoodOperatorImageFilter
51 : public GPUImageToImageFilter<TInputImage, TOutputImage, TParentImageFilter>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(GPUNeighborhoodOperatorImageFilter);
55
58 using CPUSuperclass = TParentImageFilter;
62
64 itkNewMacro(Self);
65
67 itkOverrideGetNameOfClassMacro(GPUNeighborhoodOperatorImageFilter);
68
71 using OutputPixelType = typename TOutputImage::PixelType;
72 using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
73 using InputPixelType = typename TInputImage::PixelType;
74 using InputInternalPixelType = typename TInputImage::InternalPixelType;
75 using OperatorValueType = TOperatorValueType;
76
79
81
83 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
84 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
85 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
86
88 using InputImageType = TInputImage;
89 using OutputImageType = TOutputImage;
91
94
97
100
103
105 itkGetOpenCLSourceFromKernelMacro(GPUNeighborhoodOperatorImageFilterKernel);
106
110 void
112
138#ifdef ITK_USE_CONCEPT_CHECKING
139 // Begin concept checking
140 // itkConceptMacro( SameDimensionCheck,
141 // ( Concept::SameDimension< InputImageDimension, ImageDimension > ) );
142 // itkConceptMacro( OperatorConvertibleToOutputCheck,
143 // ( Concept::Convertible< OperatorValueType, OutputPixelType > ) );
144 // itkConceptMacro( InputConvertibleToOperatorCheck,
145 // ( Concept::Convertible< InputPixelValueType, OperatorValueType > ) );
146 // itkConceptMacro( OperatorMultiplyOperatorCheck,
147 // ( Concept::MultiplyOperator< OperatorValueType > ) );
148 // itkConceptMacro( OperatorAdditiveOperatorsCheck,
149 // ( Concept::AdditiveOperators< OperatorValueType > ) );
150 // End concept checking
151#endif
152
153protected:
156
171 void
172 GPUGenerateData() override;
173
174 void
175 PrintSelf(std::ostream & os, Indent indent) const override
176 {
177 GPUSuperclass::PrintSelf(os, indent);
178 }
179
180private:
191 int m_NeighborhoodOperatorFilterGPUKernelHandle{};
192
193 typename NeighborhoodGPUBufferType::Pointer m_NeighborhoodGPUBuffer{};
194};
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkGPUNeighborhoodOperatorImageFilter.hxx"
199#endif
200
201#endif
class to abstract the behaviour of the GPU filters.
Templated n-dimensional image class for the GPU.
Definition: itkGPUImage.h:41
Applies a single NeighborhoodOperator to an image region using the GPU.
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
void SetOperator(const OutputNeighborhoodType &p)
~GPUNeighborhoodOperatorImageFilter() override=default
typename TOutputImage::InternalPixelType OutputInternalPixelType
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
itkGetOpenCLSourceFromKernelMacro(GPUNeighborhoodOperatorImageFilterKernel)
typename TInputImage::InternalPixelType InputInternalPixelType
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Applies a single NeighborhoodOperator to an image region.
Define additional traits for native types such as int or float.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
itkGPUKernelClassMacro(GPUImageOpsKernel)