ITK  4.9.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> >
50  public GPUImageToImageFilter< TInputImage, TOutputImage, TParentImageFilter >
51 {
52 public:
55  typedef TParentImageFilter CPUSuperclass;
59 
61  itkNewMacro(Self);
62 
65 
68  typedef typename TOutputImage::PixelType OutputPixelType;
69  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
70  typedef typename TInputImage::PixelType InputPixelType;
71  typedef typename TInputImage::InternalPixelType InputInternalPixelType;
72  typedef TOperatorValueType OperatorValueType;
73 
76 
78 
80  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
81  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
82  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
84 
86  typedef TInputImage InputImageType;
87  typedef TOutputImage OutputImageType;
88  typedef typename InputImageType::Pointer InputImagePointer;
89 
93 
96 
99 
102  itkGetStaticConstMacro(ImageDimension) > OutputNeighborhoodType;
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  }
156 
171  void GPUGenerateData() ITK_OVERRIDE;
172 
173  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
174  {
175  GPUSuperclass::PrintSelf(os, indent);
176  }
177 
178 private:
179  GPUNeighborhoodOperatorImageFilter(const Self &) ITK_DELETE_FUNCTION;
180  void operator=(const Self &) ITK_DELETE_FUNCTION;
181 
193 
195 };
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkGPUNeighborhoodOperatorImageFilter.hxx"
200 #endif
201 
202 #endif
class to abstract the behaviour of the GPU filters.
NumericTraits< InputPixelType >::ValueType InputPixelValueType
Superclass::OutputImageRegionType OutputImageRegionType
void SetOperator(const OutputNeighborhoodType &p)
ImageBoundaryCondition< InputImageType > * ImageBoundaryConditionPointerType
Neighborhood< OperatorValueType, itkGetStaticConstMacro(ImageDimension) > OutputNeighborhoodType
A light-weight container object for storing an N-dimensional neighborhood of values.
itkGPUKernelClassMacro(GPUImageOpsKernel)
Applies a single NeighborhoodOperator to an image region using the GPU.
GPUImage< TOperatorValueType, itkGetStaticConstMacro(ImageDimension)> NeighborhoodGPUBufferType
Templated n-dimensional image class for the GPU.
Definition: itkGPUImage.h:40
GPUSuperclass::OutputImageRegionType OutputImageRegionType
itkGetOpenCLSourceFromKernelMacro(GPUNeighborhoodOperatorImageFilterKernel)
NumericTraits< OutputPixelType >::RealType ComputingPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void PrintSelf(std::ostream &os, Indent indent) const override
GPUImageToImageFilter< TInputImage, TOutputImage, TParentImageFilter > GPUSuperclass
Define additional traits for native types such as int or float.
ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryCondition
void PrintSelf(std::ostream &os, Indent indent) const override