ITK  4.6.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 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();
77 
78  virtual void GraftOutput(DataObject *output);
79 
80  virtual void GraftOutput(const DataObjectIdentifierType & key, DataObject *output);
81 
82 protected:
85 
86  virtual void PrintSelf(std::ostream & os, Indent indent) const;
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  GPUImageToImageFilter(const Self &); //purposely not implemented
100  void operator=(const Self &); //purposely not implemented
101 
103 };
104 
105 } // end namespace itk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "itkGPUImageToImageFilter.hxx"
109 #endif
110 
111 #endif
DataObject::DataObjectIdentifierType DataObjectIdentifierType
class to abstract the behaviour of the GPU filters.
Superclass::OutputImageRegionType OutputImageRegionType
static const unsigned int OutputImageDimension
Superclass::DataObjectIdentifierType DataObjectIdentifierType
Base class for all process objects that output image data.
virtual void PrintSelf(std::ostream &os, Indent indent) const
void operator=(const Self &)
InputImageType::Pointer InputImagePointer
InputImageType::PixelType InputImagePixelType
virtual void GraftOutput(DataObject *output)
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
static const unsigned int InputImageDimension
Superclass::OutputImagePixelType OutputImagePixelType