ITK  5.4.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  * 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 itkConstantVelocityFieldTransform_h
19 #define itkConstantVelocityFieldTransform_h
20 
22 
23 namespace itk
24 {
25 
35 template <typename TParametersValueType, unsigned int VDimension>
36 class ITK_TEMPLATE_EXPORT ConstantVelocityFieldTransform
37  : public DisplacementFieldTransform<TParametersValueType, VDimension>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(ConstantVelocityFieldTransform);
41 
47 
49  itkOverrideGetNameOfClassMacro(ConstantVelocityFieldTransform);
50 
52  itkNewMacro(Self);
53 
55  using typename Superclass::InverseTransformBasePointer;
56 
58  using typename Superclass::ScalarType;
59 
61  using typename Superclass::FixedParametersType;
62  using typename Superclass::FixedParametersValueType;
63  using typename Superclass::ParametersType;
64  using typename Superclass::ParametersValueType;
65 
67  using typename Superclass::TransformCategoryEnum;
68 
70  using typename Superclass::NumberOfParametersType;
71 
73  using typename Superclass::InputPointType;
74  using typename Superclass::OutputPointType;
75 
77  using typename Superclass::InputVectorType;
78  using typename Superclass::OutputVectorType;
79 
80  using typename Superclass::InputVectorPixelType;
81  using typename Superclass::OutputVectorPixelType;
82 
84  using typename Superclass::DerivativeType;
85 
87  static constexpr unsigned int ConstantVelocityFieldDimension = VDimension;
88 
90  static constexpr unsigned int Dimension = VDimension;
91 
93  using typename Superclass::DisplacementFieldType;
95 
99 
108 
110 
113 
117 
122  virtual void
123  SetConstantVelocityField(ConstantVelocityFieldType *);
124  itkGetModifiableObjectMacro(ConstantVelocityField, ConstantVelocityFieldType);
127  void
128  SetFixedParameters(const FixedParametersType &) override;
129 
132  virtual void
133  SetConstantVelocityFieldInterpolator(ConstantVelocityFieldInterpolatorType *);
134  itkGetModifiableObjectMacro(ConstantVelocityFieldInterpolator, ConstantVelocityFieldInterpolatorType);
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 
206  CopyDisplacementField(const DisplacementFieldType *) const;
207 
208  ConstantVelocityFieldPointer m_ConstantVelocityField{};
209 
210  bool m_CalculateNumberOfIntegrationStepsAutomatically{ false };
211 
213  ConstantVelocityFieldInterpolatorPointer m_ConstantVelocityFieldInterpolator{};
214 
217  ModifiedTimeType m_ConstantVelocityFieldSetTime{ 0 };
218 
219  ScalarType m_LowerTimeBound{};
220  ScalarType m_UpperTimeBound{};
221 
222  unsigned int m_NumberOfIntegrationSteps{};
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ConstantVelocityFieldTransform::IndexType
typename ConstantVelocityFieldType::IndexType IndexType
Definition: itkConstantVelocityFieldTransform.h:101
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::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::Transform< TParametersValueType, VDimension, VDimension >::InverseTransformBasePointer
typename InverseTransformBaseType::Pointer InverseTransformBasePointer
Definition: itkTransform.h:181
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::Vector< SpacingValueType, VImageDimension >
itk::ConstantVelocityFieldTransform::DirectionType
typename ConstantVelocityFieldType::DirectionType DirectionType
Definition: itkConstantVelocityFieldTransform.h:105
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::DisplacementFieldTransform
Provides local/dense/high-dimensionality transformation via a a displacement field.
Definition: itkDisplacementFieldTransform.h:87
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ConstantVelocityFieldTransform::ConstantVelocityFieldInterpolatorPointer
typename ConstantVelocityFieldInterpolatorType::Pointer ConstantVelocityFieldInterpolatorPointer
Definition: itkConstantVelocityFieldTransform.h:112
itk::ConstantVelocityFieldTransform::PointType
typename ConstantVelocityFieldType::PointType PointType
Definition: itkConstantVelocityFieldTransform.h:106
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::ConstantVelocityFieldTransform::ConstantVelocityFieldPointer
typename ConstantVelocityFieldType::Pointer ConstantVelocityFieldPointer
Definition: itkConstantVelocityFieldTransform.h:98
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:108
itk::ConstantVelocityFieldTransform::SpacingType
typename ConstantVelocityFieldType::SpacingType SpacingType
Definition: itkConstantVelocityFieldTransform.h:104
itk::ConstantVelocityFieldTransform::DisplacementFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Definition: itkConstantVelocityFieldTransform.h:94
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstantVelocityFieldTransform::RegionType
typename ConstantVelocityFieldType::RegionType RegionType
Definition: itkConstantVelocityFieldTransform.h:102
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ConstantVelocityFieldTransform::SizeType
typename ConstantVelocityFieldType::SizeType SizeType
Definition: itkConstantVelocityFieldTransform.h:103
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::ConstantVelocityFieldTransform
Provides local/dense/high-dimensionality transformation via a a constant velocity field.
Definition: itkConstantVelocityFieldTransform.h:36
itk::ConstantVelocityFieldTransform::PixelType
typename ConstantVelocityFieldType::PixelType PixelType
Definition: itkConstantVelocityFieldTransform.h:107