ITK  4.4.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 {
26 
39 template< class TInputImage, class TOutputImage, class TParentImageFilter =
40  ImageToImageFilter< TInputImage, TOutputImage > >
41 class ITK_EXPORT GPUImageToImageFilter : public TParentImageFilter
42 {
43 public:
46  typedef TParentImageFilter Superclass;
49 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(GPUImageToImageFilter, TParentImageFilter);
54 
57  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
58  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
59 
61  typedef TInputImage InputImageType;
62  typedef typename InputImageType::Pointer InputImagePointer;
63  typedef typename InputImageType::ConstPointer InputImageConstPointer;
64  typedef typename InputImageType::RegionType InputImageRegionType;
65  typedef typename InputImageType::PixelType InputImagePixelType;
66 
68  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
69  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
71 
72  // macro to set if GPU is used
73  itkSetMacro(GPUEnabled, bool);
74  itkGetConstMacro(GPUEnabled, bool);
75  itkBooleanMacro(GPUEnabled);
76 
77  void GenerateData();
78 
79  virtual void GraftOutput(DataObject *output);
80 
81  virtual void GraftOutput(const DataObjectIdentifierType & key, DataObject *output);
82 
83 protected:
86 
87  virtual void PrintSelf(std::ostream & os, Indent indent) const;
88 
89  virtual void GPUGenerateData() {
90  }
91 
92  // GPU kernel manager
94 
95  // GPU kernel handle - kernel should be defined in specific filter (not in the
96  // base class)
97  //int m_KernelHandle;
98 
99 private:
100  GPUImageToImageFilter(const Self &); //purposely not implemented
101  void operator=(const Self &); //purposely not implemented
102 
104 };
105 
106 } // end namespace itk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "itkGPUImageToImageFilter.hxx"
110 #endif
111 
112 #endif
113