ITK  5.0.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  >
81 class ITK_TEMPLATE_EXPORT GPUPDEDeformableRegistrationFilter :
82  public GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >
83 {
84 public:
85  ITK_DISALLOW_COPY_AND_ASSIGN(GPUPDEDeformableRegistrationFilter);
86 
90  using CPUSuperclass = TParentImageFilter;
93 
95  itkNewMacro(Self);
96 
100 
102  using FixedImageType = TFixedImage;
103  using FixedImagePointer = typename FixedImageType::Pointer;
104  using FixedImageConstPointer = typename FixedImageType::ConstPointer;
105 
107  using MovingImageType = TMovingImage;
108  using MovingImagePointer = typename MovingImageType::Pointer;
109  using MovingImageConstPointer = typename MovingImageType::ConstPointer;
110 
112  using DisplacementFieldType = TDisplacementField;
113  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
114  using DeformationVectorType = typename TDisplacementField::PixelType;
115  using DeformationScalarType = typename TDisplacementField::PixelType::ValueType;
116 
119 
122 
128 
130  static constexpr unsigned int ImageDimension = GPUSuperclass::ImageDimension;
131 
133  itkGetOpenCLSourceFromKernelMacro(GPUPDEDeformableRegistrationFilterKernel);
134 
137  {
138  return this->GetOutput();
139  }
140 
142 
143 protected:
146 
147  void PrintSelf(std::ostream & os, Indent indent) const override;
148 
151  void CopyInputToOutput() override;
152 
155  void InitializeIteration() override;
156 
160  void SmoothDisplacementField() override;
161 
164  virtual void GPUSmoothVectorField(DisplacementFieldPointer field,
165  typename GPUDataManager::Pointer GPUSmoothingKernels[],
166  int GPUSmoothingKernelSizes[]);
167 
168  virtual void AllocateSmoothingBuffer();
169 
173  void SmoothUpdateField() override;
174 
177  void PostProcessOutput() override;
178 
180  void Initialize() override;
181 
186  void GenerateOutputInformation() override;
187 
194  void GenerateInputRequestedRegion() override;
195 
196 private:
200 
201 private:
203  int m_SmoothingKernelSizes[ImageDimension];
204  DeformationScalarType* m_SmoothingKernels[ImageDimension];
205  typename GPUDataManager::Pointer m_GPUSmoothingKernels[ImageDimension];
206 
208  int m_UpdateFieldSmoothingKernelSizes[ImageDimension];
209  DeformationScalarType* m_UpdateFieldSmoothingKernels[ImageDimension];
210  typename GPUDataManager::Pointer m_UpdateFieldGPUSmoothingKernels[ImageDimension];
211 
214 
215  /* GPU kernel handle for GPUSmoothDisplacementField */
217 
218 };
219 } // end namespace itk
220 
221 #ifndef ITK_MANUAL_INSTANTIATION
222 #include "itkGPUPDEDeformableRegistrationFilter.hxx"
223 #endif
224 
225 #endif
typename GPUSuperclass::OutputImageType OutputImageType
typename FixedImageType::ConstPointer FixedImageConstPointer
typename TDisplacementField::PixelType DeformationVectorType
itkGPUKernelClassMacro(GPUImageOpsKernel)
typename MovingImageType::ConstPointer MovingImageConstPointer
Deformably register two images using a PDE algorithm.
typename DisplacementFieldType::Pointer DisplacementFieldPointer
typename GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TDisplacementField::PixelType::ValueType DeformationScalarType