ITK  4.6.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< typename TFixedImage, typename TMovingImage, typename TDisplacementField,
79  typename TParentImageFilter = PDEDeformableRegistrationFilter< TFixedImage, TMovingImage, TDisplacementField >
80  >
82  public GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >
83 {
84 public:
88  typedef TParentImageFilter CPUSuperclass;
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 TDisplacementField DisplacementFieldType;
111  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
112  typedef typename TDisplacementField::PixelType DeformationVectorType;
113  typedef typename TDisplacementField::PixelType::ValueType
115 
118 
122 
128 
130  itkStaticConstMacro(ImageDimension, unsigned int,
132 
134  itkGetOpenCLSourceFromKernelMacro(GPUPDEDeformableRegistrationFilterKernel);
135 
137  void SetFixedImage(const FixedImageType *ptr);
138 
140  const FixedImageType * GetFixedImage(void) const;
141 
143  void SetMovingImage(const MovingImageType *ptr);
144 
146  const MovingImageType * GetMovingImage(void) const;
147 
150  {
151  this->SetInput(ptr);
152  }
153 
156  {
157  return this->GetOutput();
158  }
159 
165  virtual std::vector< SmartPointer< DataObject > >::size_type GetNumberOfValidRequiredInputs() const;
166 
168 
169 protected:
172  }
173  void PrintSelf(std::ostream & os, Indent indent) const;
174 
177  virtual void CopyInputToOutput();
178 
181  virtual void InitializeIteration();
182 
186  virtual void SmoothDisplacementField();
187 
191  typename GPUDataManager::Pointer GPUSmoothingKernels[],
192  int GPUSmoothingKernelSizes[]);
193 
194  virtual void AllocateSmoothingBuffer();
195 
199  virtual void SmoothUpdateField();
200 
203  virtual void PostProcessOutput();
204 
206  virtual void Initialize();
207 
212  virtual void GenerateOutputInformation();
213 
220  virtual void GenerateInputRequestedRegion();
221 
222 private:
223  GPUPDEDeformableRegistrationFilter(const Self &); //purposely not implemented
224  void operator=(const Self &); //purposely not implemented
225 
229 
230 private:
235 
240 
243 
244  /* GPU kernel handle for GPUSmoothDisplacementField */
246 
247 };
248 } // end namespace itk
249 
250 #ifndef ITK_MANUAL_INSTANTIATION
251 #include "itkGPUPDEDeformableRegistrationFilter.hxx"
252 #endif
253 
254 #endif
const MovingImageType * GetMovingImage(void) const
GPUDataManager::Pointer m_UpdateFieldGPUSmoothingKernels[ImageDimension]
GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
DeformationScalarType * m_UpdateFieldSmoothingKernels[ImageDimension]
const FixedImageType * GetFixedImage(void) const
DeformationScalarType * m_SmoothingKernels[ImageDimension]
virtual std::vector< SmartPointer< DataObject > >::size_type GetNumberOfValidRequiredInputs() const
itkGPUKernelClassMacro(GPUImageOpsKernel)
void SetFixedImage(const FixedImageType *ptr)
void SetInitialDisplacementField(const DisplacementFieldType *ptr)
itkGetOpenCLSourceFromKernelMacro(GPUPDEDeformableRegistrationFilterKernel)
GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter > GPUSuperclass
Deformably register two images using a PDE algorithm.
TDisplacementField::PixelType::ValueType DeformationScalarType
void PrintSelf(std::ostream &os, Indent indent) const
void SetMovingImage(const MovingImageType *ptr)
GPUPDEDeformableRegistrationFunction< FixedImageType, MovingImageType, DisplacementFieldType > GPUPDEDeformableRegistrationFunctionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
GPUDataManager::Pointer m_GPUSmoothingKernels[ImageDimension]
FixedArray< double, ImageDimension > StandardDeviationsType
virtual void GPUSmoothVectorField(DisplacementFieldPointer field, typename GPUDataManager::Pointer GPUSmoothingKernels[], int GPUSmoothingKernelSizes[])