ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkGPUPDEDeformableRegistrationFilter.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 __itkGPUPDEDeformableRegistrationFilter_h
19 #define __itkGPUPDEDeformableRegistrationFilter_h
20 
24 
25 namespace itk
26 {
76 itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel);
77 
78 template< class TFixedImage, class TMovingImage, class TDeformationField,
79  class TParentImageFilter = PDEDeformableRegistrationFilter< TFixedImage, TMovingImage, TDeformationField >
80  >
82  public GPUDenseFiniteDifferenceImageFilter< TDeformationField, TDeformationField, TParentImageFilter >
83 {
84 public:
91 
93  itkNewMacro(Self);
94 
98 
100  typedef TFixedImage FixedImageType;
101  typedef typename FixedImageType::Pointer FixedImagePointer;
102  typedef typename FixedImageType::ConstPointer FixedImageConstPointer;
103 
105  typedef TMovingImage MovingImageType;
106  typedef typename MovingImageType::Pointer MovingImagePointer;
107  typedef typename MovingImageType::ConstPointer MovingImageConstPointer;
108 
110  typedef TDeformationField DeformationFieldType;
111  typedef typename DeformationFieldType::Pointer DeformationFieldPointer;
112 
115 
119 
125 
127  itkStaticConstMacro(ImageDimension, unsigned int,
128  GPUSuperclass::ImageDimension);
129 
131 itkGetOpenCLSourceFromKernelMacro(GPUPDEDeformableRegistrationFilterKernel);
132 
134  void SetFixedImage(const FixedImageType *ptr);
135 
137  const FixedImageType * GetFixedImage(void) const;
138 
140  void SetMovingImage(const MovingImageType *ptr);
141 
143  const MovingImageType * GetMovingImage(void) const;
144 
146  void SetInitialDeformationField(const DeformationFieldType *ptr)
147  {
148  this->SetInput(ptr);
149  }
150 
152  DeformationFieldType * GetDeformationField()
153  {
154  return this->GetOutput();
155  }
156 
162  virtual std::vector< SmartPointer< DataObject > >::size_type GetNumberOfValidRequiredInputs() const;
163 
165 
166 protected:
169  }
170  void PrintSelf(std::ostream & os, Indent indent) const;
171 
174  virtual void CopyInputToOutput();
175 
178  virtual void InitializeIteration();
179 
183  virtual void SmoothDisplacementField();
184 
185  virtual void GPUSmoothDisplacementField();
186 
187  virtual void AllocateSmoothingBuffer();
188 
192  virtual void SmoothUpdateField();
193 
196  virtual void PostProcessOutput();
197 
199  virtual void Initialize();
200 
205  virtual void GenerateOutputInformation();
206 
213  virtual void GenerateInputRequestedRegion();
214 
215 private:
216  GPUPDEDeformableRegistrationFilter(const Self &); //purposely not implemented
217  void operator=(const Self &); //purposely not implemented
218 
222 private:
223 
230 
231  /* GPU kernel handle for GPUSmoothDeformationField */
233 
234 };
235 } // end namespace itk
236 
237 #ifndef ITK_MANUAL_INSTANTIATION
238 #include "itkGPUPDEDeformableRegistrationFilter.hxx"
239 #endif
240 
241 #endif
242