ITK  6.0.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 
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  {}
174 
179  itkSetClampMacro(LowerTimeBound, ScalarType, 0.0, 1.0);
180 
185  itkGetConstMacro(LowerTimeBound, ScalarType);
186 
191  itkSetClampMacro(UpperTimeBound, ScalarType, 0.0, 1.0);
192 
197  itkGetConstMacro(UpperTimeBound, ScalarType);
198 
202  itkSetMacro(NumberOfIntegrationSteps, unsigned int);
203 
207  itkGetConstMacro(NumberOfIntegrationSteps, unsigned int);
208 
209 protected:
211  ~VelocityFieldTransform() override = default;
212  void
213  PrintSelf(std::ostream & os, Indent indent) const override;
214 
216  typename LightObject::Pointer
217  InternalClone() const override;
218 
220  CopyDisplacementField(const DisplacementFieldType *) const;
221 
222  ScalarType m_LowerTimeBound{};
223  ScalarType m_UpperTimeBound{};
224 
225  unsigned int m_NumberOfIntegrationSteps{};
226 
227  VelocityFieldPointer m_VelocityField{};
228 
230  typename VelocityFieldInterpolatorType::Pointer m_VelocityFieldInterpolator{};
231 
234  unsigned long m_VelocityFieldSetTime{};
235 
236 private:
241  virtual void
242  SetFixedParametersFromVelocityField() const;
243 };
244 } // end namespace itk
245 
246 #ifndef ITK_MANUAL_INSTANTIATION
247 # include "itkVelocityFieldTransform.hxx"
248 #endif
249 
250 #endif // itkVelocityFieldTransform_h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
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::Transform< TParametersValueType, VDimension, VDimension >::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkTransform.h:167
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
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::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:127
itk::VariableLengthVector
Represents an array whose length can be defined at run-time.
Definition: itkConstantBoundaryCondition.h:28
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: itkAnatomicalOrientation.h:29
itk::TransformCategory::VelocityField
itk::DisplacementFieldTransform::SpacingType
typename DisplacementFieldType::SpacingType SpacingType
Definition: itkDisplacementFieldTransform.h:172
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Transform< TParametersValueType, VDimension, VDimension >
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