ITK  5.4.0
Insight Toolkit
itkVelocityFieldTransform.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  * https://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 itkVelocityFieldTransform_h
19 #define itkVelocityFieldTransform_h
20 
22 
23 namespace itk
24 {
25 
35 template <typename TParametersValueType, unsigned int VDimension>
36 class ITK_TEMPLATE_EXPORT VelocityFieldTransform : public DisplacementFieldTransform<TParametersValueType, VDimension>
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_MOVE(VelocityFieldTransform);
40 
46 
48  itkOverrideGetNameOfClassMacro(VelocityFieldTransform);
49 
51  itkNewMacro(Self);
52 
54  using typename Superclass::InverseTransformBasePointer;
55 
57  using typename Superclass::ScalarType;
58 
60  using typename Superclass::FixedParametersType;
61  using typename Superclass::FixedParametersValueType;
62  using typename Superclass::ParametersType;
63  using typename Superclass::ParametersValueType;
64 
66  using typename Superclass::TransformCategoryEnum;
67 
69  using typename Superclass::NumberOfParametersType;
70 
72  using typename Superclass::InputPointType;
73  using typename Superclass::OutputPointType;
74 
76  using typename Superclass::InputVectorType;
77  using typename Superclass::OutputVectorType;
78 
79  using typename Superclass::InputVectorPixelType;
80  using typename Superclass::OutputVectorPixelType;
81 
83  using typename Superclass::DerivativeType;
84 
86  static constexpr unsigned int VelocityFieldDimension = VDimension + 1;
87 
89  static constexpr unsigned int Dimension = VDimension;
90 
92  using typename Superclass::DisplacementFieldType;
94 
96  using typename Superclass::VectorImageDisplacementFieldType;
97 
101 
110 
113 
117 
118  using Superclass::SetDisplacementField;
119 
124  virtual void
125  SetVelocityField(VelocityFieldType *);
126  itkGetModifiableObjectMacro(VelocityField, VelocityFieldType);
129  void
130  SetFixedParameters(const FixedParametersType &) override;
131 
134  virtual void
135  SetVelocityFieldInterpolator(VelocityFieldInterpolatorType *);
136  itkGetModifiableObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType);
140  itkGetConstReferenceMacro(VelocityFieldSetTime, unsigned long);
141 
147  void
148  SetDisplacementField(DisplacementFieldType * displacementField) override
149  {
150  itkDebugMacro("setting DisplacementField to " << displacementField);
151  if (this->m_DisplacementField != displacementField)
152  {
153  this->m_DisplacementField = displacementField;
154  this->Modified();
155  }
156  }
159  void
160  UpdateTransformParameters(const DerivativeType & update, ScalarType factor = 1.0) override;
161 
163  bool
164  GetInverse(Self * inverse) const;
165 
167  InverseTransformBasePointer
168  GetInverseTransform() const override;
169 
171  virtual void
173 
178  itkSetClampMacro(LowerTimeBound, ScalarType, 0.0, 1.0);
179 
184  itkGetConstMacro(LowerTimeBound, ScalarType);
185 
190  itkSetClampMacro(UpperTimeBound, ScalarType, 0.0, 1.0);
191 
196  itkGetConstMacro(UpperTimeBound, ScalarType);
197 
201  itkSetMacro(NumberOfIntegrationSteps, unsigned int);
202 
206  itkGetConstMacro(NumberOfIntegrationSteps, unsigned int);
207 
208 protected:
210  ~VelocityFieldTransform() override = default;
211  void
212  PrintSelf(std::ostream & os, Indent indent) const override;
213 
215  typename LightObject::Pointer
216  InternalClone() const override;
217 
219  CopyDisplacementField(const DisplacementFieldType *) const;
220 
221  ScalarType m_LowerTimeBound{};
222  ScalarType m_UpperTimeBound{};
223 
224  unsigned int m_NumberOfIntegrationSteps{};
225 
226  VelocityFieldPointer m_VelocityField{};
227 
229  typename VelocityFieldInterpolatorType::Pointer m_VelocityFieldInterpolator{};
230 
233  unsigned long m_VelocityFieldSetTime{};
234 
235 private:
240  virtual void
241  SetFixedParametersFromVelocityField() const;
242 };
243 } // end namespace itk
244 
245 #ifndef ITK_MANUAL_INSTANTIATION
246 # include "itkVelocityFieldTransform.hxx"
247 #endif
248 
249 #endif // itkVelocityFieldTransform_h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::OptimizerParameters
Class to hold and manage different parameter types used during optimization.
Definition: itkOptimizerParameters.h:36
itkDisplacementFieldTransform.h
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::VelocityFieldTransform::SetDisplacementField
void SetDisplacementField(DisplacementFieldType *displacementField) override
Definition: itkVelocityFieldTransform.h:148
itk::DisplacementFieldTransform::DirectionType
typename DisplacementFieldType::DirectionType DirectionType
Definition: itkDisplacementFieldTransform.h:173
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Vector< SpacingValueType, VImageDimension >
itk::DisplacementFieldTransform::IndexType
typename DisplacementFieldType::IndexType IndexType
Definition: itkDisplacementFieldTransform.h:169
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::DisplacementFieldTransform::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkDisplacementFieldTransform.h:163
itk::VelocityFieldTransform::VelocityFieldInterpolatorPointer
typename VelocityFieldInterpolatorType::Pointer VelocityFieldInterpolatorPointer
Definition: itkVelocityFieldTransform.h:112
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageVectorOptimizerParametersHelper
Class to hold and manage parameters of type Image<Vector<...>,...>, used in Transforms,...
Definition: itkImageVectorOptimizerParametersHelper.h:37
itk::VectorInterpolateImageFunction
Base class for all vector image interpolators.
Definition: itkVectorInterpolateImageFunction.h:47
itk::DisplacementFieldTransform
Provides local/dense/high-dimensionality transformation via a a displacement field.
Definition: itkDisplacementFieldTransform.h:87
itk::DisplacementFieldTransform::PointType
typename DisplacementFieldType::PointType PointType
Definition: itkDisplacementFieldTransform.h:174
itk::DisplacementFieldTransform::SizeType
typename DisplacementFieldType::SizeType SizeType
Definition: itkDisplacementFieldTransform.h:171
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::DisplacementFieldTransform::RegionType
typename DisplacementFieldType::RegionType RegionType
Definition: itkDisplacementFieldTransform.h:170
itk::VelocityFieldTransform
Provides local/dense/high-dimensionality transformation via a a velocity field.
Definition: itkVelocityFieldTransform.h:36
itk::Transform< TParametersValueType, VDimension, VDimension >::ScalarType
ParametersValueType ScalarType
Definition: itkTransform.h:141
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:108
itk::VelocityFieldTransform::IntegrateVelocityField
virtual void IntegrateVelocityField()
Definition: itkVelocityFieldTransform.h:172
itk::DisplacementFieldTransform::PixelType
typename DisplacementFieldType::PixelType PixelType
Definition: itkDisplacementFieldTransform.h:175
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DisplacementFieldTransform::SpacingType
typename DisplacementFieldType::SpacingType SpacingType
Definition: itkDisplacementFieldTransform.h:172
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
AddImageFilter
Definition: itkAddImageFilter.h:81
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::VelocityFieldTransform::VelocityFieldPointer
typename VelocityFieldType::Pointer VelocityFieldPointer
Definition: itkVelocityFieldTransform.h:100