ITK  5.2.0
Insight Toolkit
itkGPUPDEDeformableRegistrationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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,
79  typename TMovingImage,
80  typename TDisplacementField,
81  typename TParentImageFilter = PDEDeformableRegistrationFilter<TFixedImage, TMovingImage, TDisplacementField>>
82 class ITK_TEMPLATE_EXPORT GPUPDEDeformableRegistrationFilter
83  : public GPUDenseFiniteDifferenceImageFilter<TDisplacementField, TDisplacementField, TParentImageFilter>
84 {
85 public:
86  ITK_DISALLOW_COPY_AND_MOVE(GPUPDEDeformableRegistrationFilter);
87 
91  using CPUSuperclass = TParentImageFilter;
94 
96  itkNewMacro(Self);
97 
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 
138  {
139  return this->GetOutput();
140  }
141 
143 
144 protected:
146  ~GPUPDEDeformableRegistrationFilter() override = default;
147 
148  void
149  PrintSelf(std::ostream & os, Indent indent) const override;
150 
153  void
154  CopyInputToOutput() override;
155 
158  void
159  InitializeIteration() override;
160 
164  void
165  SmoothDisplacementField() override;
166 
169  virtual void
170  GPUSmoothVectorField(DisplacementFieldPointer field,
171  typename GPUDataManager::Pointer GPUSmoothingKernels[],
172  int GPUSmoothingKernelSizes[]);
173 
174  virtual void
175  AllocateSmoothingBuffer();
176 
180  void
181  SmoothUpdateField() override;
182 
185  void
186  PostProcessOutput() override;
187 
189  void
190  Initialize() override;
191 
196  void
197  GenerateOutputInformation() override;
198 
205  void
206  GenerateInputRequestedRegion() override;
207 
208 private:
212 
213 private:
215  int m_SmoothingKernelSizes[ImageDimension];
216  DeformationScalarType * m_SmoothingKernels[ImageDimension];
217  typename GPUDataManager::Pointer m_GPUSmoothingKernels[ImageDimension];
218 
220  int m_UpdateFieldSmoothingKernelSizes[ImageDimension];
221  DeformationScalarType * m_UpdateFieldSmoothingKernels[ImageDimension];
222  typename GPUDataManager::Pointer m_UpdateFieldGPUSmoothingKernels[ImageDimension];
223 
226 
227  /* GPU kernel handle for GPUSmoothDisplacementField */
229 };
230 } // end namespace itk
231 
232 #ifndef ITK_MANUAL_INSTANTIATION
233 # include "itkGPUPDEDeformableRegistrationFilter.hxx"
234 #endif
235 
236 #endif
itk::GPUPDEDeformableRegistrationFilter::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: itkGPUPDEDeformableRegistrationFilter.h:112
itkGPUPDEDeformableRegistrationFunction.h
itk::GPUPDEDeformableRegistrationFilter::m_TempField
DisplacementFieldPointer m_TempField
Definition: itkGPUPDEDeformableRegistrationFilter.h:211
itk::GPUPDEDeformableRegistrationFilter::FixedImagePointer
typename FixedImageType::Pointer FixedImagePointer
Definition: itkGPUPDEDeformableRegistrationFilter.h:103
itk::GPUPDEDeformableRegistrationFilter::m_GPUImageSizes
GPUDataManager::Pointer m_GPUImageSizes
Definition: itkGPUPDEDeformableRegistrationFilter.h:225
itk::GPUPDEDeformableRegistrationFilter::GetDisplacementField
DisplacementFieldType * GetDisplacementField()
Definition: itkGPUPDEDeformableRegistrationFilter.h:137
itk::GPUPDEDeformableRegistrationFilter
Deformably register two images using a PDE algorithm.
Definition: itkGPUPDEDeformableRegistrationFilter.h:82
itk::GPUPDEDeformableRegistrationFilter::DeformationVectorType
typename TDisplacementField::PixelType DeformationVectorType
Definition: itkGPUPDEDeformableRegistrationFilter.h:114
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GPUPDEDeformableRegistrationFilter::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition: itkGPUPDEDeformableRegistrationFilter.h:108
itk::GPUPDEDeformableRegistrationFilter::FixedImageType
TFixedImage FixedImageType
Definition: itkGPUPDEDeformableRegistrationFilter.h:102
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::FiniteDifferenceFunctionType
typename GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:74
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::OutputImageType
typename GPUSuperclass::OutputImageType OutputImageType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:73
itk::GPUPDEDeformableRegistrationFilter::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkGPUPDEDeformableRegistrationFilter.h:113
itk::GPUPDEDeformableRegistrationFilter::m_SmoothDisplacementFieldGPUKernelHandle
int m_SmoothDisplacementFieldGPUKernelHandle
Definition: itkGPUPDEDeformableRegistrationFilter.h:228
itk::GPUPDEDeformableRegistrationFilter::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkGPUPDEDeformableRegistrationFilter.h:104
itk::GPUPDEDeformableRegistrationFilter::OutputImageType
typename GPUSuperclass::OutputImageType OutputImageType
Definition: itkGPUPDEDeformableRegistrationFilter.h:118
itk::FixedArray< double, ImageDimension >
itk::GPUPDEDeformableRegistrationFilter::m_ImageSizes
int * m_ImageSizes
Definition: itkGPUPDEDeformableRegistrationFilter.h:224
itk::GPUDenseFiniteDifferenceImageFilter
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:55
itk::GPUPDEDeformableRegistrationFilter::FiniteDifferenceFunctionType
typename GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkGPUPDEDeformableRegistrationFilter.h:121
itk::GPUPDEDeformableRegistrationFilter::CPUSuperclass
TParentImageFilter CPUSuperclass
Definition: itkGPUPDEDeformableRegistrationFilter.h:91
itk::itkGPUKernelClassMacro
itkGPUKernelClassMacro(GPUImageOpsKernel)
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkGPUDenseFiniteDifferenceImageFilter.h
itk::GPUPDEDeformableRegistrationFilter::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkGPUPDEDeformableRegistrationFilter.h:109
itkPDEDeformableRegistrationFilter.h
itk::GPUPDEDeformableRegistrationFunction
Definition: itkGPUPDEDeformableRegistrationFunction.h:41
itk::GPUPDEDeformableRegistrationFilter::MovingImageType
TMovingImage MovingImageType
Definition: itkGPUPDEDeformableRegistrationFilter.h:107
itk::GPUPDEDeformableRegistrationFilter::DeformationScalarType
typename TDisplacementField::PixelType::ValueType DeformationScalarType
Definition: itkGPUPDEDeformableRegistrationFilter.h:115