ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGPUNeighborhoodOperatorImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 #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, typename TOutputImage,
47  typename TOperatorValueType = typename TOutputImage::PixelType,
48  typename TParentImageFilter = NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType> >
49 class ITK_TEMPLATE_EXPORT GPUNeighborhoodOperatorImageFilter :
50  public GPUImageToImageFilter< TInputImage, TOutputImage, TParentImageFilter >
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_ASSIGN(GPUNeighborhoodOperatorImageFilter);
54 
57  using CPUSuperclass = TParentImageFilter;
61 
63  itkNewMacro(Self);
64 
67 
70  using OutputPixelType = typename TOutputImage::PixelType;
71  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
72  using InputPixelType = typename TInputImage::PixelType;
73  using InputInternalPixelType = typename TInputImage::InternalPixelType;
74  using OperatorValueType = TOperatorValueType;
75 
78 
80 
82  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
83  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
84  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
85 
87  using InputImageType = TInputImage;
88  using OutputImageType = TOutputImage;
89  using InputImagePointer = typename InputImageType::Pointer;
90 
93 
96 
99 
102  Self::ImageDimension >;
103 
105  itkGetOpenCLSourceFromKernelMacro(GPUNeighborhoodOperatorImageFilterKernel);
106 
110  void SetOperator(const OutputNeighborhoodType & p);
111 
137 #ifdef ITK_USE_CONCEPT_CHECKING
138  // Begin concept checking
139  // itkConceptMacro( SameDimensionCheck,
140  // ( Concept::SameDimension< InputImageDimension, ImageDimension > ) );
141  // itkConceptMacro( OperatorConvertibleToOutputCheck,
142  // ( Concept::Convertible< OperatorValueType, OutputPixelType > ) );
143  // itkConceptMacro( InputConvertibleToOperatorCheck,
144  // ( Concept::Convertible< InputPixelValueType, OperatorValueType > ) );
145  // itkConceptMacro( OperatorMultiplyOperatorCheck,
146  // ( Concept::MultiplyOperator< OperatorValueType > ) );
147  // itkConceptMacro( OperatorAdditiveOperatorsCheck,
148  // ( Concept::AdditiveOperators< OperatorValueType > ) );
149  // End concept checking
150 #endif
151 
152 protected:
155 
170  void GPUGenerateData() override;
171 
172  void PrintSelf(std::ostream & os, Indent indent) const override
173  {
174  GPUSuperclass::PrintSelf(os, indent);
175  }
176 
177 private:
189 
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkGPUNeighborhoodOperatorImageFilter.hxx"
196 #endif
197 
198 #endif
typename TInputImage::InternalPixelType InputInternalPixelType
class to abstract the behaviour of the GPU filters.
typename InputImageType::Pointer InputImagePointer
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
Define numeric traits for std::vector.
typename Superclass::OutputImageRegionType OutputImageRegionType
itkGPUKernelClassMacro(GPUImageOpsKernel)
Applies a single NeighborhoodOperator to an image region using the GPU.
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
Templated n-dimensional image class for the GPU.
Definition: itkGPUImage.h:40
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TOutputImage::InternalPixelType OutputInternalPixelType
void PrintSelf(std::ostream &os, Indent indent) const override