ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkGPUImageToImageFilter.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 itkGPUImageToImageFilter_h
19 #define itkGPUImageToImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkGPUKernelManager.h"
23 
24 namespace itk
25 {
38 template< typename TInputImage, typename TOutputImage, typename TParentImageFilter =
39  ImageToImageFilter< TInputImage, TOutputImage > >
40 class ITK_TEMPLATE_EXPORT GPUImageToImageFilter : public TParentImageFilter
41 {
42 public:
45  typedef TParentImageFilter Superclass;
48 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(GPUImageToImageFilter, TParentImageFilter);
53 
56  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
57  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
58 
60  typedef TInputImage InputImageType;
61  typedef typename InputImageType::Pointer InputImagePointer;
62  typedef typename InputImageType::ConstPointer InputImageConstPointer;
63  typedef typename InputImageType::RegionType InputImageRegionType;
64  typedef typename InputImageType::PixelType InputImagePixelType;
65 
67  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
68  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
70 
71  // macro to set if GPU is used
72  itkSetMacro(GPUEnabled, bool);
73  itkGetConstMacro(GPUEnabled, bool);
74  itkBooleanMacro(GPUEnabled);
75 
76  void GenerateData() ITK_OVERRIDE;
77  virtual void GraftOutput(typename itk::GPUTraits< TOutputImage >::Type *output);
78  virtual void GraftOutput(const DataObjectIdentifierType & key, typename itk::GPUTraits< TOutputImage >::Type *output);
79 
80 protected:
81  virtual void GraftOutput(DataObject *output) ITK_OVERRIDE;
82  virtual void GraftOutput(const DataObjectIdentifierType & key, DataObject *output) ITK_OVERRIDE;
84  ~GPUImageToImageFilter() ITK_OVERRIDE;
85 
86  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
87 
88  virtual void GPUGenerateData() {
89  }
90 
91  // GPU kernel manager
93 
94  // GPU kernel handle - kernel should be defined in specific filter (not in the
95  // base class)
96  //int m_KernelHandle;
97 
98 private:
99  ITK_DISALLOW_COPY_AND_ASSIGN(GPUImageToImageFilter);
100 
101  bool m_GPUEnabled;
102 };
103 
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkGPUImageToImageFilter.hxx"
108 #endif
109 
110 #endif
DataObject::DataObjectIdentifierType DataObjectIdentifierType
class to abstract the behaviour of the GPU filters.
Superclass::OutputImageRegionType OutputImageRegionType
Superclass::DataObjectIdentifierType DataObjectIdentifierType
Base class for all process objects that output image data.
InputImageType::Pointer InputImagePointer
InputImageType::PixelType InputImagePixelType
Superclass::DataObjectIdentifierType DataObjectIdentifierType
SmartPointer< const Self > ConstPointer
InputImageType::ConstPointer InputImageConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
GPUKernelManager::Pointer m_GPUKernelManager
Base class for all data objects in ITK.
InputImageType::RegionType InputImageRegionType
Superclass::OutputImagePixelType OutputImagePixelType