ITK  5.3.0
Insight Toolkit
itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.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 itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
19 #define itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
20 
22 
26 
27 namespace itk
28 {
29 
86 template <typename TFixedImage,
87  typename TMovingImage,
88  typename TOutputTransform = TimeVaryingBSplineVelocityFieldTransform<double, TFixedImage::ImageDimension>,
89  typename TVirtualImage = TFixedImage,
90  typename TPointSet = PointSet<unsigned int, TFixedImage::ImageDimension>>
92  : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet>
93 {
94 public:
96 
102 
104  itkNewMacro(Self);
105 
107  static constexpr unsigned int ImageDimension = TFixedImage::ImageDimension;
108 
110  itkTypeMacro(TimeVaryingBSplineVelocityFieldImageRegistrationMethod, SimpleImageRegistrationMethod);
111 
113  using FixedImageType = TFixedImage;
114  using FixedImagePointer = typename FixedImageType::Pointer;
115  using typename Superclass::FixedImagesContainerType;
116  using MovingImageType = TMovingImage;
117  using MovingImagePointer = typename MovingImageType::Pointer;
118  using typename Superclass::MovingImagesContainerType;
119 
120  using InputPointSetType = TPointSet;
121  using InputPointSetPointer = typename InputPointSetType::Pointer;
122  using typename Superclass::PointSetsContainerType;
123 
125  using typename Superclass::ImageMetricType;
129 
130  using typename Superclass::VirtualImageType;
131  using typename Superclass::VirtualImageBaseType;
132  using typename Superclass::VirtualImageBaseConstPointer;
133 
134  using typename Superclass::MetricType;
135  using typename Superclass::MultiMetricType;
137  using typename Superclass::PointSetMetricType;
138 
141  using typename Superclass::FixedImageMaskType;
143  using typename Superclass::FixedImageMasksContainerType;
144  using typename Superclass::MovingImageMaskType;
146  using typename Superclass::MovingImageMasksContainerType;
147 
148  using typename Superclass::InitialTransformType;
149  using OutputTransformType = TOutputTransform;
150  using OutputTransformPointer = typename OutputTransformType::Pointer;
151  using RealType = typename OutputTransformType::ScalarType;
152  using DerivativeType = typename OutputTransformType::DerivativeType;
153  using DerivativeValueType = typename DerivativeType::ValueType;
154  using DisplacementFieldType = typename OutputTransformType::DisplacementFieldType;
156 
158 
160  typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType;
162  typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer;
163  using TimeVaryingVelocityFieldType = typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType;
165  typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer;
166  using DisplacementVectorType = typename TimeVaryingVelocityFieldControlPointLatticeType::PixelType;
167 
168  using typename Superclass::CompositeTransformType;
170 
171  using typename Superclass::DecoratedOutputTransformType;
173 
175 
178 
181  using BSplineFilterType =
184  using WeightsElementType = typename WeightsContainerType::Element;
187 
189  itkSetMacro(LearningRate, RealType);
190  itkGetConstMacro(LearningRate, RealType);
192 
194  itkSetMacro(NumberOfIterationsPerLevel, NumberOfIterationsArrayType);
195  itkGetConstMacro(NumberOfIterationsPerLevel, NumberOfIterationsArrayType);
197 
199  itkSetMacro(ConvergenceThreshold, RealType);
200  itkGetConstMacro(ConvergenceThreshold, RealType);
202 
204  itkSetMacro(ConvergenceWindowSize, unsigned int);
205  itkGetConstMacro(ConvergenceWindowSize, unsigned int);
207 
209  itkSetMacro(NumberOfTimePointSamples, SizeValueType);
210  itkGetConstMacro(NumberOfTimePointSamples, SizeValueType);
212 
213 protected:
216  void
217  PrintSelf(std::ostream & os, Indent indent) const override;
218 
220  void
221  GenerateData() override;
222 
224  virtual void
225  StartOptimization();
226 
228  void
229  GetMetricDerivativePointSetForAllTimePoints(VelocityFieldPointSetType *, WeightsContainerType *);
230 
231  void
232  AttachMetricGradientPointSetAtSpecificTimePoint(const RealType,
237  const TransformBaseType *,
240  const TransformBaseType *,
242 
243 private:
245 
247 
249  unsigned int m_ConvergenceWindowSize{ 10 };
250 
252 
253  SizeValueType m_NumberOfTimePointSamples{ 4 };
254 
256 };
257 } // end namespace itk
258 
259 #ifndef ITK_MANUAL_INSTANTIATION
260 # include "itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx"
261 #endif
262 
263 #endif
itk::ImageRegistrationMethodv4::MovingImageType
TMovingImage MovingImageType
Definition: itkImageRegistrationMethodv4.h:142
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TimeVaryingVelocityFieldPointer
typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:165
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::DisplacementFieldTransformPointer
typename DisplacementFieldTransformType::Pointer DisplacementFieldTransformPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:177
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::DisplacementVectorType
typename TimeVaryingVelocityFieldControlPointLatticeType::PixelType DisplacementVectorType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:166
itk::PointSet
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:82
itk::ImageRegistrationMethodv4::PointSetsContainerType
std::vector< PointSetConstPointer > PointSetsContainerType
Definition: itkImageRegistrationMethodv4.h:149
itk::ImageRegistrationMethodv4::FixedImagePointer
typename FixedImageType::Pointer FixedImagePointer
Definition: itkImageRegistrationMethodv4.h:139
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::MetricDerivativeType
typename ImageMetricType::DerivativeType MetricDerivativeType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:128
itkTimeVaryingBSplineVelocityFieldTransform.h
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::InputPointSetPointer
typename InputPointSetType::Pointer InputPointSetPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:121
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::DisplacementFieldType
typename OutputTransformType::DisplacementFieldType DisplacementFieldType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:154
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::FixedMaskImageType
typename ImageMaskSpatialObjectType::ImageType FixedMaskImageType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:142
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::BSplineScatteredDataPointSetToImageFilter
Image filter which provides a B-spline output approximation.
Definition: itkBSplineScatteredDataPointSetToImageFilter.h:132
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_IdentityDisplacementFieldTransform
DisplacementFieldTransformPointer m_IdentityDisplacementFieldTransform
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:244
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_BoundaryWeight
WeightsElementType m_BoundaryWeight
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:255
itk::ImageRegistrationMethodv4::MovingImagesContainerType
std::vector< MovingImageConstPointer > MovingImagesContainerType
Definition: itkImageRegistrationMethodv4.h:145
itk::ImageRegistrationMethodv4::MetricPointer
typename MetricType::Pointer MetricPointer
Definition: itkImageRegistrationMethodv4.h:165
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_ConvergenceThreshold
RealType m_ConvergenceThreshold
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:248
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::ImageMetricPointer
typename ImageMetricType::Pointer ImageMetricPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:126
itkImageRegistrationMethodv4.h
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_LearningRate
RealType m_LearningRate
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:246
itk::DisplacementFieldTransform
Provides local/dense/high-dimensionality transformation via a a displacement field.
Definition: itkDisplacementFieldTransform.h:86
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TimeVaryingVelocityFieldControlPointLatticeType
typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldControlPointLatticeType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:160
itk::ImageRegistrationMethodv4::RealType
typename OutputTransformType::ScalarType RealType
Definition: itkImageRegistrationMethodv4.h:154
itk::SingleValuedCostFunctionv4Template::MeasureType
TInternalComputationValueType MeasureType
Definition: itkSingleValuedCostFunctionv4.h:67
itk::ImageRegistrationMethodv4::FixedImageMasksContainerType
std::vector< FixedImageMaskConstPointer > FixedImageMasksContainerType
Definition: itkImageRegistrationMethodv4.h:180
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_NumberOfIterationsPerLevel
NumberOfIterationsArrayType m_NumberOfIterationsPerLevel
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:251
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TimeVaryingVelocityFieldControlPointLatticePointer
typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldControlPointLatticePointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:162
itk::ImageRegistrationMethodv4::FixedImageType
TFixedImage FixedImageType
Definition: itkImageRegistrationMethodv4.h:138
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::VelocityFieldPointSetPointer
typename VelocityFieldPointSetType::Pointer VelocityFieldPointSetPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:180
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::InputPointSetType
TPointSet InputPointSetType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:120
itkBSplineScatteredDataPointSetToImageFilter.h
itk::ImageRegistrationMethodv4::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition: itkImageRegistrationMethodv4.h:143
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TransformBaseType
typename CompositeTransformType::TransformType TransformBaseType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:169
itk::ImageMaskSpatialObject
Implementation of an image mask as spatial object.
Definition: itkImageMaskSpatialObject.h:45
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::MovingMaskImageType
typename ImageMaskSpatialObjectType::ImageType MovingMaskImageType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:145
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::WeightsContainerType
typename BSplineFilterType::WeightsContainerType WeightsContainerType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:183
itk::ImageRegistrationMethodv4::FixedImagesContainerType
std::vector< FixedImageConstPointer > FixedImagesContainerType
Definition: itkImageRegistrationMethodv4.h:141
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::MeasureType
typename ImageMetricType::MeasureType MeasureType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:127
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkImageMaskSpatialObject.h
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod
Interface method for the current registration framework using the time varying velocity field transfo...
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:91
itk::ImageRegistrationMethodv4
Interface method for the current registration framework.
Definition: itkImageRegistrationMethodv4.h:117
itk::ContinuousIndex
A templated class holding a point in n-Dimensional image space.
Definition: itkContinuousIndex.h:46
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::WeightsElementType
typename WeightsContainerType::Element WeightsElementType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:184
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::DisplacementFieldPointType
typename DisplacementFieldType::PointType DisplacementFieldPointType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:155
itk::ImageRegistrationMethodv4::OutputTransformPointer
typename OutputTransformType::Pointer OutputTransformPointer
Definition: itkImageRegistrationMethodv4.h:153
itk::Array< TInternalComputationValueType >
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itk::ImageRegistrationMethodv4::DecoratedOutputTransformPointer
typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer
Definition: itkImageRegistrationMethodv4.h:190
itk::ImageRegistrationMethodv4::OutputTransformType
TOutputTransform OutputTransformType
Definition: itkImageRegistrationMethodv4.h:152
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::MaskImageType
typename ImageMaskSpatialObjectType::ImageType MaskImageType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:140
itk::ImageRegistrationMethodv4::DerivativeValueType
typename DerivativeType::ValueType DerivativeValueType
Definition: itkImageRegistrationMethodv4.h:156
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TimeVaryingVelocityFieldType
typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:163
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageRegistrationMethodv4::DerivativeType
typename OutputTransformType::DerivativeType DerivativeType
Definition: itkImageRegistrationMethodv4.h:155