ITK  4.8.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() const;
141 
143  void SetMovingImage(const MovingImageType *ptr);
144 
146  const MovingImageType * GetMovingImage() const;
147 
150  {
151  this->SetInput(ptr);
152  }
153 
156  {
157  return this->GetOutput();
158  }
159 
161 
162 protected:
165  }
166  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
167 
170  virtual void CopyInputToOutput() ITK_OVERRIDE;
171 
174  virtual void InitializeIteration() ITK_OVERRIDE;
175 
179  virtual void SmoothDisplacementField() ITK_OVERRIDE;
180 
184  typename GPUDataManager::Pointer GPUSmoothingKernels[],
185  int GPUSmoothingKernelSizes[]);
186 
187  virtual void AllocateSmoothingBuffer();
188 
192  virtual void SmoothUpdateField() ITK_OVERRIDE;
193 
196  virtual void PostProcessOutput() ITK_OVERRIDE;
197 
199  virtual void Initialize() ITK_OVERRIDE;
200 
205  virtual void GenerateOutputInformation() ITK_OVERRIDE;
206 
213  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
214 
215 private:
216  GPUPDEDeformableRegistrationFilter(const Self &); //purposely not implemented
217  void operator=(const Self &); //purposely not implemented
218 
222 
223 private:
227  typename GPUDataManager::Pointer m_GPUSmoothingKernels[ImageDimension];
228 
233 
236 
237  /* GPU kernel handle for GPUSmoothDisplacementField */
239 
240 };
241 } // end namespace itk
242 
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkGPUPDEDeformableRegistrationFilter.hxx"
245 #endif
246 
247 #endif
virtual void SmoothDisplacementField() override
GPUDataManager::Pointer m_UpdateFieldGPUSmoothingKernels[ImageDimension]
GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
DeformationScalarType * m_UpdateFieldSmoothingKernels[ImageDimension]
DeformationScalarType * m_SmoothingKernels[ImageDimension]
const MovingImageType * GetMovingImage() const
itkGPUKernelClassMacro(GPUImageOpsKernel)
void PrintSelf(std::ostream &os, Indent indent) const override
GPU memory manager implemented using OpenCL. Required by GPUImage class.
void SetFixedImage(const FixedImageType *ptr)
virtual void GenerateInputRequestedRegion() override
const FixedImageType * GetFixedImage() const
void SetInitialDisplacementField(const DisplacementFieldType *ptr)
itkGetOpenCLSourceFromKernelMacro(GPUPDEDeformableRegistrationFilterKernel)
GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter > GPUSuperclass
Deformably register two images using a PDE algorithm.
TDisplacementField::PixelType::ValueType DeformationScalarType
virtual void InitializeIteration() override
virtual void PostProcessOutput() override
void SetMovingImage(const MovingImageType *ptr)
virtual void SmoothUpdateField() override
GPUPDEDeformableRegistrationFunction< FixedImageType, MovingImageType, DisplacementFieldType > GPUPDEDeformableRegistrationFunctionType
virtual void Initialize() override
virtual void CopyInputToOutput() override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void GenerateOutputInformation() override
GPUDataManager::Pointer m_GPUSmoothingKernels[ImageDimension]
FixedArray< double, ImageDimension > StandardDeviationsType
virtual void GPUSmoothVectorField(DisplacementFieldPointer field, typename GPUDataManager::Pointer GPUSmoothingKernels[], int GPUSmoothingKernelSizes[])