ITK  5.2.0
Insight Toolkit
itkConstantVelocityFieldTransform.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 itkConstantVelocityFieldTransform_h
19 #define itkConstantVelocityFieldTransform_h
20 
22 
23 namespace itk
24 {
25 
35 template <typename TParametersValueType, unsigned int NDimensions>
36 class ITK_TEMPLATE_EXPORT ConstantVelocityFieldTransform
37  : public DisplacementFieldTransform<TParametersValueType, NDimensions>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(ConstantVelocityFieldTransform);
41 
47 
50 
52  itkNewMacro(Self);
53 
55  using InverseTransformBasePointer = typename Superclass::InverseTransformBasePointer;
56 
59 
61  using FixedParametersType = typename Superclass::FixedParametersType;
62  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
63  using ParametersType = typename Superclass::ParametersType;
64  using ParametersValueType = typename Superclass::ParametersValueType;
65 
67  using TransformCategoryEnum = typename Superclass::TransformCategoryEnum;
68 
70  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
71 
73  using InputPointType = typename Superclass::InputPointType;
74  using OutputPointType = typename Superclass::OutputPointType;
75 
77  using InputVectorType = typename Superclass::InputVectorType;
78  using OutputVectorType = typename Superclass::OutputVectorType;
79 
80  using InputVectorPixelType = typename Superclass::InputVectorPixelType;
81  using OutputVectorPixelType = typename Superclass::OutputVectorPixelType;
82 
84  using DerivativeType = typename Superclass::DerivativeType;
85 
87  static constexpr unsigned int ConstantVelocityFieldDimension = NDimensions;
88 
90  static constexpr unsigned int Dimension = NDimensions;
91 
93  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
94  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
95 
99 
108 
110 
113 
117 
122  virtual void
123  SetConstantVelocityField(ConstantVelocityFieldType *);
124  itkGetModifiableObjectMacro(ConstantVelocityField, ConstantVelocityFieldType);
126 
127  void
128  SetFixedParameters(const FixedParametersType &) override;
129 
132  virtual void
133  SetConstantVelocityFieldInterpolator(ConstantVelocityFieldInterpolatorType *);
134  itkGetModifiableObjectMacro(ConstantVelocityFieldInterpolator, ConstantVelocityFieldInterpolatorType);
136 
138  itkGetConstReferenceMacro(ConstantVelocityFieldSetTime, ModifiedTimeType);
139 
140  void
141  UpdateTransformParameters(const DerivativeType & update, ScalarType factor = 1.0) override;
142 
144  bool
145  GetInverse(Self * inverse) const;
146 
149  GetInverseTransform() const override;
150 
153  virtual void
154  IntegrateVelocityField();
155 
156  // Set/get compute number of exp. integration steps automatically
157  itkSetMacro(CalculateNumberOfIntegrationStepsAutomatically, bool);
158  itkGetConstMacro(CalculateNumberOfIntegrationStepsAutomatically, bool);
159  itkBooleanMacro(CalculateNumberOfIntegrationStepsAutomatically);
160 
165  itkSetClampMacro(LowerTimeBound, ScalarType, 0, 1);
166 
171  itkGetConstMacro(LowerTimeBound, ScalarType);
172 
177  itkSetClampMacro(UpperTimeBound, ScalarType, 0, 1);
178 
183  itkGetConstMacro(UpperTimeBound, ScalarType);
184 
188  itkSetMacro(NumberOfIntegrationSteps, unsigned int);
189 
193  itkGetConstMacro(NumberOfIntegrationSteps, unsigned int);
194 
195 protected:
197  ~ConstantVelocityFieldTransform() override = default;
198  void
199  PrintSelf(std::ostream & os, Indent indent) const override;
200 
202  typename LightObject::Pointer
203  InternalClone() const override;
204 
205  typename DisplacementFieldType::Pointer
206  CopyDisplacementField(const DisplacementFieldType *) const;
207 
209 
210  bool m_CalculateNumberOfIntegrationStepsAutomatically{ false };
211 
214 
217  ModifiedTimeType m_ConstantVelocityFieldSetTime{ 0 };
218 
221 
223 
224 private:
229  virtual void
230  SetFixedParametersFromConstantVelocityField() const;
231 };
232 
233 } // end namespace itk
234 
235 #ifndef ITK_MANUAL_INSTANTIATION
236 # include "itkConstantVelocityFieldTransform.hxx"
237 #endif
238 
239 #endif // itkConstantVelocityFieldTransform_h
itk::ConstantVelocityFieldTransform::InputVectorPixelType
typename Superclass::InputVectorPixelType InputVectorPixelType
Definition: itkConstantVelocityFieldTransform.h:80
itk::ConstantVelocityFieldTransform::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkConstantVelocityFieldTransform.h:73
itk::OptimizerParameters
Class to hold and manage different parameter types used during optimization.
Definition: itkOptimizerParameters.h:36
itk::ConstantVelocityFieldTransform::OutputVectorPixelType
typename Superclass::OutputVectorPixelType OutputVectorPixelType
Definition: itkConstantVelocityFieldTransform.h:81
itkDisplacementFieldTransform.h
itk::ConstantVelocityFieldTransform::m_UpperTimeBound
ScalarType m_UpperTimeBound
Definition: itkConstantVelocityFieldTransform.h:220
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::ConstantVelocityFieldTransform::ConstantVelocityFieldPointer
typename ConstantVelocityFieldType::Pointer ConstantVelocityFieldPointer
Definition: itkConstantVelocityFieldTransform.h:98
itk::ConstantVelocityFieldTransform::InverseTransformBasePointer
typename Superclass::InverseTransformBasePointer InverseTransformBasePointer
Definition: itkConstantVelocityFieldTransform.h:55
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::ConstantVelocityFieldTransform::PointType
typename ConstantVelocityFieldType::PointType PointType
Definition: itkConstantVelocityFieldTransform.h:106
itk::ConstantVelocityFieldTransform::ConstantVelocityFieldInterpolatorPointer
typename ConstantVelocityFieldInterpolatorType::Pointer ConstantVelocityFieldInterpolatorPointer
Definition: itkConstantVelocityFieldTransform.h:112
itk::ConstantVelocityFieldTransform::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkConstantVelocityFieldTransform.h:84
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::ConstantVelocityFieldTransform::OutputPointType
typename Superclass::OutputPointType OutputPointType
Definition: itkConstantVelocityFieldTransform.h:74
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ConstantVelocityFieldTransform::RegionType
typename ConstantVelocityFieldType::RegionType RegionType
Definition: itkConstantVelocityFieldTransform.h:102
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::ConstantVelocityFieldTransform::OutputVectorType
typename Superclass::OutputVectorType OutputVectorType
Definition: itkConstantVelocityFieldTransform.h:78
itk::ConstantVelocityFieldTransform::m_NumberOfIntegrationSteps
unsigned int m_NumberOfIntegrationSteps
Definition: itkConstantVelocityFieldTransform.h:222
itk::DisplacementFieldTransform
Provides local/dense/high-dimensionality transformation via a a displacement field.
Definition: itkDisplacementFieldTransform.h:86
itk::DisplacementFieldTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkDisplacementFieldTransform.h:107
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ConstantVelocityFieldTransform::DirectionType
typename ConstantVelocityFieldType::DirectionType DirectionType
Definition: itkConstantVelocityFieldTransform.h:105
itk::ConstantVelocityFieldTransform::PixelType
typename ConstantVelocityFieldType::PixelType PixelType
Definition: itkConstantVelocityFieldTransform.h:107
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ConstantVelocityFieldTransform::SizeType
typename ConstantVelocityFieldType::SizeType SizeType
Definition: itkConstantVelocityFieldTransform.h:103
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ConstantVelocityFieldTransform::IndexType
typename ConstantVelocityFieldType::IndexType IndexType
Definition: itkConstantVelocityFieldTransform.h:101
itk::ConstantVelocityFieldTransform::SpacingType
typename ConstantVelocityFieldType::SpacingType SpacingType
Definition: itkConstantVelocityFieldTransform.h:104
itk::ConstantVelocityFieldTransform::DisplacementFieldType
typename Superclass::DisplacementFieldType DisplacementFieldType
Definition: itkConstantVelocityFieldTransform.h:93
itk::TransformBaseTemplateEnums::TransformCategory
TransformCategory
Definition: itkTransformBase.h:45
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:106
itk::TransformBaseTemplate::FixedParametersValueType
double FixedParametersValueType
Definition: itkTransformBase.h:83
itk::Image::SpacingType
typename Superclass::SpacingType SpacingType
Definition: itkImage.h:154
itk::ConstantVelocityFieldTransform::m_ConstantVelocityFieldInterpolator
ConstantVelocityFieldInterpolatorPointer m_ConstantVelocityFieldInterpolator
Definition: itkConstantVelocityFieldTransform.h:213
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstantVelocityFieldTransform::InputVectorType
typename Superclass::InputVectorType InputVectorType
Definition: itkConstantVelocityFieldTransform.h:77
itk::ConstantVelocityFieldTransform::ScalarType
typename Superclass::ScalarType ScalarType
Definition: itkConstantVelocityFieldTransform.h:58
itk::ConstantVelocityFieldTransform::m_LowerTimeBound
ScalarType m_LowerTimeBound
Definition: itkConstantVelocityFieldTransform.h:219
itk::ConstantVelocityFieldTransform::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkConstantVelocityFieldTransform.h:94
itk::TransformBaseTemplate::ParametersValueType
TParametersValueType ParametersValueType
Definition: itkTransformBase.h:81
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::TransformBaseTemplate::NumberOfParametersType
IdentifierType NumberOfParametersType
Definition: itkTransformBase.h:91
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::ConstantVelocityFieldTransform::m_ConstantVelocityField
ConstantVelocityFieldPointer m_ConstantVelocityField
Definition: itkConstantVelocityFieldTransform.h:208
itk::ConstantVelocityFieldTransform
Provides local/dense/high-dimensionality transformation via a a constant velocity field.
Definition: itkConstantVelocityFieldTransform.h:36