ITK  5.4.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"
23 #include "itkImageToImageFilter.h"
25 #include "itkImage.h"
28 
29 namespace itk
30 {
44 itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel);
45 
46 template <typename TInputImage,
47  typename TOutputImage,
48  typename TOperatorValueType = typename TOutputImage::PixelType,
49  typename TParentImageFilter = NeighborhoodOperatorImageFilter<TInputImage, TOutputImage, TOperatorValueType>>
50 class ITK_TEMPLATE_EXPORT GPUNeighborhoodOperatorImageFilter
51  : public GPUImageToImageFilter<TInputImage, TOutputImage, TParentImageFilter>
52 {
53 public:
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 
99  using OutputImageRegionType = typename GPUSuperclass::OutputImageRegionType;
100 
103 
105  itkGetOpenCLSourceFromKernelMacro(GPUNeighborhoodOperatorImageFilterKernel);
106 
110  void
111  SetOperator(const OutputNeighborhoodType & p);
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 
153 protected:
155  ~GPUNeighborhoodOperatorImageFilter() override = default;
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 
180 private:
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::GPUImage
Templated n-dimensional image class for the GPU.
Definition: itkGPUImage.h:40
itk::GPUNeighborhoodOperatorImageFilter::InputPixelValueType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:77
itk::GPUImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkGPUImageToImageFilter.h:64
itkNeighborhoodOperator.h
itk::Neighborhood< OperatorValueType, Self::ImageDimension >
itkImage.h
itk::GPUNeighborhoodOperatorImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:74
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GPUNeighborhoodOperatorImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkGPUNeighborhoodOperatorImageFilter.h:175
itk::GPUNeighborhoodOperatorImageFilter
Applies a single NeighborhoodOperator to an image region using the GPU.
Definition: itkGPUNeighborhoodOperatorImageFilter.h:50
itk::GPUNeighborhoodOperatorImageFilter::OutputImageRegionType
typename GPUSuperclass::OutputImageRegionType OutputImageRegionType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:99
itk::GPUNeighborhoodOperatorImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:73
itk::ImageBoundaryCondition< InputImageType >
itkGPUImageToImageFilter.h
itk::GPUImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkGPUImageToImageFilter.h:63
itkGPUImage.h
itk::GPUNeighborhoodOperatorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:89
itk::GPUImageToImageFilter
class to abstract the behaviour of the GPU filters.
Definition: itkGPUImageToImageFilter.h:41
itkImageToImageFilter.h
itk::GPUNeighborhoodOperatorImageFilter::CPUSuperclass
TParentImageFilter CPUSuperclass
Definition: itkGPUNeighborhoodOperatorImageFilter.h:58
itk::GPUNeighborhoodOperatorImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:71
itkNeighborhoodOperatorImageFilter.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::GPUNeighborhoodOperatorImageFilter::ComputingPixelType
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:78
itk::itkGPUKernelClassMacro
itkGPUKernelClassMacro(GPUImageOpsKernel)
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::GPUNeighborhoodOperatorImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:72
itk::ZeroFluxNeumannBoundaryCondition< InputImageType >
itkZeroFluxNeumannBoundaryCondition.h
itk::GPUNeighborhoodOperatorImageFilter::OperatorValueType
TOperatorValueType OperatorValueType
Definition: itkGPUNeighborhoodOperatorImageFilter.h:75