ITK  5.2.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 FixedImagesContainerType = typename Superclass::FixedImagesContainerType;
116  using MovingImageType = TMovingImage;
117  using MovingImagePointer = typename MovingImageType::Pointer;
118  using MovingImagesContainerType = typename Superclass::MovingImagesContainerType;
119 
120  using InputPointSetType = TPointSet;
121  using InputPointSetPointer = typename InputPointSetType::Pointer;
122  using PointSetsContainerType = typename Superclass::PointSetsContainerType;
123 
125  using ImageMetricType = typename Superclass::ImageMetricType;
129 
130  using VirtualImageType = typename Superclass::VirtualImageType;
131  using VirtualImageBaseType = typename Superclass::VirtualImageBaseType;
132  using VirtualImageBaseConstPointer = typename Superclass::VirtualImageBaseConstPointer;
133 
134  using MetricType = typename Superclass::MetricType;
135  using MultiMetricType = typename Superclass::MultiMetricType;
137  using PointSetMetricType = typename Superclass::PointSetMetricType;
138 
141  using FixedImageMaskType = typename Superclass::FixedImageMaskType;
143  using FixedImageMasksContainerType = typename Superclass::FixedImageMasksContainerType;
144  using MovingImageMaskType = typename Superclass::MovingImageMaskType;
146  using MovingImageMasksContainerType = typename Superclass::MovingImageMasksContainerType;
147 
148  using InitialTransformType = 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 CompositeTransformType = typename Superclass::CompositeTransformType;
170 
171  using DecoratedOutputTransformType = 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::ImageToImageMetricv4::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkImageToImageMetricv4.h:352
itk::ImageRegistrationMethodv4::MovingImageType
TMovingImage MovingImageType
Definition: itkImageRegistrationMethodv4.h:142
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::TimeVaryingVelocityFieldPointer
typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:165
itk::CompositeTransform
This class contains a list of transforms and concatenates them by composition.
Definition: itkCompositeTransform.h:87
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::ObjectToObjectMultiMetricv4
This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives to comp...
Definition: itkObjectToObjectMultiMetricv4.h:96
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::MetricDerivativeType
typename ImageMetricType::DerivativeType MetricDerivativeType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:128
itk::ImageBase
Base class for templated image classes.
Definition: itkImageBase.h:105
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
itk::ImageToImageMetricv4::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkImageToImageMetricv4.h:355
itkImageRegistrationMethodv4.h
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::m_LearningRate
RealType m_LearningRate
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:246
itk::ImageRegistrationMethodv4::VirtualImageBaseConstPointer
typename VirtualImageBaseType::ConstPointer VirtualImageBaseConstPointer
Definition: itkImageRegistrationMethodv4.h:172
itk::DataObjectDecorator
Decorates any subclass of itkObject with a DataObject API.
Definition: itkDataObjectDecorator.h:66
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::PointSetToPointSetMetricWithIndexv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricWithIndexv4.h:72
itk::ImageRegistrationMethodv4::RealType
typename OutputTransformType::ScalarType RealType
Definition: itkImageRegistrationMethodv4.h:154
itk::ImageRegistrationMethodv4::MovingImageMasksContainerType
std::vector< MovingImageMaskConstPointer > MovingImageMasksContainerType
Definition: itkImageRegistrationMethodv4.h:183
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::ImageRegistrationMethodv4::MovingImageMaskType
typename ImageMetricType::MovingImageMaskType MovingImageMaskType
Definition: itkImageRegistrationMethodv4.h:181
itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod::InputPointSetType
TPointSet InputPointSetType
Definition: itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.h:120
itkBSplineScatteredDataPointSetToImageFilter.h
itk::ImageRegistrationMethodv4::MovingImagePointer
typename MovingImageType::Pointer MovingImagePointer
Definition: itkImageRegistrationMethodv4.h:143
itk::ObjectToObjectMetricBaseTemplate
Base class for all object-to-object similarity metrics added in ITKv4.
Definition: itkObjectToObjectMetricBase.h:90
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
itk::ImageRegistrationMethodv4::FixedImageMaskType
typename ImageMetricType::FixedImageMaskType FixedImageMaskType
Definition: itkImageRegistrationMethodv4.h:178
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::CompositeTransform::TransformType
typename Superclass::TransformType TransformType
Definition: itkCompositeTransform.h:105
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::ImageToImageMetricv4
Definition: itkImageToImageMetricv4.h:174
itk::ImageRegistrationMethodv4::OutputTransformPointer
typename OutputTransformType::Pointer OutputTransformPointer
Definition: itkImageRegistrationMethodv4.h:153
itk::Array< SizeValueType >
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ImageRegistrationMethodv4::VirtualImageType
TVirtualImage VirtualImageType
Definition: itkImageRegistrationMethodv4.h:169
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
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::ImageMaskSpatialObject::ImageType
typename Superclass::ImageType ImageType
Definition: itkImageMaskSpatialObject.h:57
itk::ImageRegistrationMethodv4::DerivativeType
typename OutputTransformType::DerivativeType DerivativeType
Definition: itkImageRegistrationMethodv4.h:155