ITK  5.2.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  * 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 itkVelocityFieldTransform_h
19 #define itkVelocityFieldTransform_h
20 
22 
23 namespace itk
24 {
25 
35 template <typename TParametersValueType, unsigned int NDimensions>
36 class ITK_TEMPLATE_EXPORT VelocityFieldTransform : public DisplacementFieldTransform<TParametersValueType, NDimensions>
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_MOVE(VelocityFieldTransform);
40 
46 
49 
51  itkNewMacro(Self);
52 
54  using InverseTransformBasePointer = typename Superclass::InverseTransformBasePointer;
55 
58 
60  using FixedParametersType = typename Superclass::FixedParametersType;
61  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
62  using ParametersType = typename Superclass::ParametersType;
63  using ParametersValueType = typename Superclass::ParametersValueType;
64 
66  using TransformCategoryEnum = typename Superclass::TransformCategoryEnum;
67 
69  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
70 
72  using InputPointType = typename Superclass::InputPointType;
73  using OutputPointType = typename Superclass::OutputPointType;
74 
76  using InputVectorType = typename Superclass::InputVectorType;
77  using OutputVectorType = typename Superclass::OutputVectorType;
78 
79  using InputVectorPixelType = typename Superclass::InputVectorPixelType;
80  using OutputVectorPixelType = typename Superclass::OutputVectorPixelType;
81 
83  using DerivativeType = typename Superclass::DerivativeType;
84 
86  static constexpr unsigned int VelocityFieldDimension = NDimensions + 1;
87 
89  static constexpr unsigned int Dimension = NDimensions;
90 
92  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
94 
98 
107 
110 
114 
119  virtual void
120  SetVelocityField(VelocityFieldType *);
121  itkGetModifiableObjectMacro(VelocityField, VelocityFieldType);
123 
124  void
125  SetFixedParameters(const FixedParametersType &) override;
126 
129  virtual void
130  SetVelocityFieldInterpolator(VelocityFieldInterpolatorType *);
131  itkGetModifiableObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType);
133 
135  itkGetConstReferenceMacro(VelocityFieldSetTime, unsigned long);
136 
142  void
143  SetDisplacementField(DisplacementFieldType * displacementField) override
144  {
145  itkDebugMacro("setting DisplacementField to " << displacementField);
146  if (this->m_DisplacementField != displacementField)
147  {
148  this->m_DisplacementField = displacementField;
149  this->Modified();
150  }
151  }
153 
154  void
155  UpdateTransformParameters(const DerivativeType & update, ScalarType factor = 1.0) override;
156 
158  bool
159  GetInverse(Self * inverse) const;
160 
162  InverseTransformBasePointer
163  GetInverseTransform() const override;
164 
166  virtual void
168 
173  itkSetClampMacro(LowerTimeBound, ScalarType, 0.0, 1.0);
174 
179  itkGetConstMacro(LowerTimeBound, ScalarType);
180 
185  itkSetClampMacro(UpperTimeBound, ScalarType, 0.0, 1.0);
186 
191  itkGetConstMacro(UpperTimeBound, ScalarType);
192 
196  itkSetMacro(NumberOfIntegrationSteps, unsigned int);
197 
201  itkGetConstMacro(NumberOfIntegrationSteps, unsigned int);
202 
203 protected:
205  ~VelocityFieldTransform() override = default;
206  void
207  PrintSelf(std::ostream & os, Indent indent) const override;
208 
210  typename LightObject::Pointer
211  InternalClone() const override;
212 
213  typename DisplacementFieldType::Pointer
214  CopyDisplacementField(const DisplacementFieldType *) const;
215 
218 
220 
222 
225 
228  unsigned long m_VelocityFieldSetTime;
229 
230 private:
235  virtual void
236  SetFixedParametersFromVelocityField() const;
237 };
238 } // end namespace itk
239 
240 #ifndef ITK_MANUAL_INSTANTIATION
241 # include "itkVelocityFieldTransform.hxx"
242 #endif
243 
244 #endif // itkVelocityFieldTransform_h
itk::VelocityFieldTransform::m_VelocityField
VelocityFieldPointer m_VelocityField
Definition: itkVelocityFieldTransform.h:221
itk::DisplacementFieldTransform::IndexType
typename DisplacementFieldType::IndexType IndexType
Definition: itkDisplacementFieldTransform.h:167
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::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
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::VelocityFieldTransform::m_VelocityFieldInterpolator
VelocityFieldInterpolatorType::Pointer m_VelocityFieldInterpolator
Definition: itkVelocityFieldTransform.h:224
itk::VelocityFieldTransform::m_NumberOfIntegrationSteps
unsigned int m_NumberOfIntegrationSteps
Definition: itkVelocityFieldTransform.h:219
itk::DisplacementFieldTransform
Provides local/dense/high-dimensionality transformation via a a displacement field.
Definition: itkDisplacementFieldTransform.h:86
itk::DisplacementFieldTransform::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkDisplacementFieldTransform.h:154
itk::DisplacementFieldTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkDisplacementFieldTransform.h:107
itk::DisplacementFieldTransform::SpacingType
typename DisplacementFieldType::SpacingType SpacingType
Definition: itkDisplacementFieldTransform.h:170
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::DisplacementFieldTransform::InputVectorType
typename Superclass::InputVectorType InputVectorType
Definition: itkDisplacementFieldTransform.h:131
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::DisplacementFieldTransform::RegionType
typename DisplacementFieldType::RegionType RegionType
Definition: itkDisplacementFieldTransform.h:168
itk::DisplacementFieldTransform::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkDisplacementFieldTransform.h:127
itk::DisplacementFieldTransform::DirectionType
typename DisplacementFieldType::DirectionType DirectionType
Definition: itkDisplacementFieldTransform.h:171
itk::DisplacementFieldTransform::SizeType
typename DisplacementFieldType::SizeType SizeType
Definition: itkDisplacementFieldTransform.h:169
itk::VelocityFieldTransform
Provides local/dense/high-dimensionality transformation via a a velocity field.
Definition: itkVelocityFieldTransform.h:36
itk::DisplacementFieldTransform::InputVectorPixelType
typename Superclass::InputVectorPixelType InputVectorPixelType
Definition: itkDisplacementFieldTransform.h:134
itk::VelocityFieldTransform::VelocityFieldPointer
typename VelocityFieldType::Pointer VelocityFieldPointer
Definition: itkVelocityFieldTransform.h:97
itk::TransformBaseTemplateEnums::TransformCategory
TransformCategory
Definition: itkTransformBase.h:45
itk::VelocityFieldTransform::VelocityFieldInterpolatorPointer
typename VelocityFieldInterpolatorType::Pointer VelocityFieldInterpolatorPointer
Definition: itkVelocityFieldTransform.h:109
itk::DisplacementFieldTransform::OutputPointType
typename Superclass::OutputPointType OutputPointType
Definition: itkDisplacementFieldTransform.h:128
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:106
itk::TransformBaseTemplate::FixedParametersValueType
double FixedParametersValueType
Definition: itkTransformBase.h:83
itk::DisplacementFieldTransform::OutputVectorType
typename Superclass::OutputVectorType OutputVectorType
Definition: itkDisplacementFieldTransform.h:132
itk::Image::SpacingType
typename Superclass::SpacingType SpacingType
Definition: itkImage.h:154
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DisplacementFieldTransform::InverseTransformBasePointer
typename Superclass::InverseTransformBasePointer InverseTransformBasePointer
Definition: itkDisplacementFieldTransform.h:104
itk::VelocityFieldTransform::m_VelocityFieldSetTime
unsigned long m_VelocityFieldSetTime
Definition: itkVelocityFieldTransform.h:228
itk::VelocityFieldTransform::SetDisplacementField
void SetDisplacementField(DisplacementFieldType *displacementField) override
Definition: itkVelocityFieldTransform.h:143
itk::VelocityFieldTransform::m_UpperTimeBound
ScalarType m_UpperTimeBound
Definition: itkVelocityFieldTransform.h:217
itk::TransformBaseTemplate::ParametersValueType
TParametersValueType ParametersValueType
Definition: itkTransformBase.h:81
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::VelocityFieldTransform::m_LowerTimeBound
ScalarType m_LowerTimeBound
Definition: itkVelocityFieldTransform.h:216
itk::TransformBaseTemplate::NumberOfParametersType
IdentifierType NumberOfParametersType
Definition: itkTransformBase.h:91
itk::DisplacementFieldTransform::PixelType
typename DisplacementFieldType::PixelType PixelType
Definition: itkDisplacementFieldTransform.h:173
itk::DisplacementFieldTransform::PointType
typename DisplacementFieldType::PointType PointType
Definition: itkDisplacementFieldTransform.h:172
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::VelocityFieldTransform::IntegrateVelocityField
virtual void IntegrateVelocityField()
Definition: itkVelocityFieldTransform.h:167
itk::DisplacementFieldTransform::OutputVectorPixelType
typename Superclass::OutputVectorPixelType OutputVectorPixelType
Definition: itkDisplacementFieldTransform.h:135
itk::DisplacementFieldTransform::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkDisplacementFieldTransform.h:161