ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkConstantVelocityFieldTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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
36 <typename TParametersValueType, unsigned int NDimensions>
37 class ITK_TEMPLATE_EXPORT ConstantVelocityFieldTransform :
38  public DisplacementFieldTransform<TParametersValueType, NDimensions>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(ConstantVelocityFieldTransform);
42 
48 
51 
53  itkNewMacro( Self );
54 
56  using InverseTransformBasePointer = typename Superclass:: InverseTransformBasePointer;
57 
60 
62  using FixedParametersType = typename Superclass::FixedParametersType;
63  using FixedParametersValueType = typename Superclass::FixedParametersValueType;
64  using ParametersType = typename Superclass::ParametersType;
65  using ParametersValueType = typename Superclass::ParametersValueType;
66 
68  using TransformCategoryType = typename Superclass::TransformCategoryType;
69 
71  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
72 
74  using InputPointType = typename Superclass::InputPointType;
75  using OutputPointType = typename Superclass::OutputPointType;
76 
78  using InputVectorType = typename Superclass::InputVectorType;
79  using OutputVectorType = typename Superclass::OutputVectorType;
80 
81  using InputVectorPixelType = typename Superclass::InputVectorPixelType;
82  using OutputVectorPixelType = typename Superclass::OutputVectorPixelType;
83 
85  using DerivativeType = typename Superclass::DerivativeType;
86 
88  static constexpr unsigned int ConstantVelocityFieldDimension = NDimensions;
89 
91  static constexpr unsigned int Dimension = NDimensions;
92 
94  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
95  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
96 
100 
109 
111 
115 
119 
124  virtual void SetConstantVelocityField( ConstantVelocityFieldType * );
125  itkGetModifiableObjectMacro(ConstantVelocityField, ConstantVelocityFieldType );
127 
128  void SetFixedParameters( const FixedParametersType & ) override;
129 
132  virtual void SetConstantVelocityFieldInterpolator( ConstantVelocityFieldInterpolatorType * );
133  itkGetModifiableObjectMacro(ConstantVelocityFieldInterpolator, ConstantVelocityFieldInterpolatorType );
135 
137  itkGetConstReferenceMacro( ConstantVelocityFieldSetTime, ModifiedTimeType );
138 
139  void UpdateTransformParameters( const DerivativeType & update, ScalarType factor = 1.0 ) override;
140 
142  bool GetInverse( Self *inverse ) const;
143 
145  InverseTransformBasePointer GetInverseTransform() const override;
146 
149  virtual void IntegrateVelocityField();
150 
151  // Set/get compute number of exp. integration steps automatically
152  itkSetMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
153  itkGetConstMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
154  itkBooleanMacro( CalculateNumberOfIntegrationStepsAutomatically );
155 
160  itkSetClampMacro( LowerTimeBound, ScalarType, 0, 1 );
161 
166  itkGetConstMacro( LowerTimeBound, ScalarType );
167 
172  itkSetClampMacro( UpperTimeBound, ScalarType, 0, 1 );
173 
178  itkGetConstMacro( UpperTimeBound, ScalarType );
179 
183  itkSetMacro( NumberOfIntegrationSteps, unsigned int );
184 
188  itkGetConstMacro( NumberOfIntegrationSteps, unsigned int );
189 
190 protected:
191 
193  ~ConstantVelocityFieldTransform() override = default;
194  void PrintSelf( std::ostream& os, Indent indent ) const override;
195 
197  typename LightObject::Pointer InternalClone() const override;
198 
199  typename DisplacementFieldType::Pointer CopyDisplacementField( const DisplacementFieldType * ) const;
200 
202 
203  bool m_CalculateNumberOfIntegrationStepsAutomatically{ false };
204 
207 
210  ModifiedTimeType m_ConstantVelocityFieldSetTime{ 0 };
211 
214 
216 
217 private:
222  virtual void SetFixedParametersFromConstantVelocityField() const;
223 
224 };
225 
226 } // end namespace itk
227 
228 #ifndef ITK_MANUAL_INSTANTIATION
229 #include "itkConstantVelocityFieldTransform.hxx"
230 #endif
231 
232 #endif // itkConstantVelocityFieldTransform_h
typename ConstantVelocityFieldType::SpacingType SpacingType
Provides local/dense/high-dimensionality transformation via a a constant velocity field...
typename Superclass::DisplacementFieldType DisplacementFieldType
TPixel PixelType
Definition: itkImage.h:95
Light weight base class for most itk classes.
typename Superclass::OutputVectorType OutputVectorType
typename ConstantVelocityFieldInterpolatorType::Pointer ConstantVelocityFieldInterpolatorPointer
typename ConstantVelocityFieldType::DirectionType DirectionType
typename Superclass::InputPointType InputPointType
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
typename ConstantVelocityFieldType::IndexType IndexType
typename ConstantVelocityFieldType::PointType PointType
Class to hold and manage parameters of type Image&lt;Vector&lt;...&gt;,...&gt;, used in Transforms, etc.
Class to hold and manage different parameter types used during optimization.
typename Superclass::InputVectorType InputVectorType
typename ConstantVelocityFieldType::PixelType PixelType
typename Superclass::InputVectorPixelType InputVectorPixelType
typename Superclass::SpacingType SpacingType
Definition: itkImage.h:143
typename Superclass::InverseTransformBasePointer InverseTransformBasePointer
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
typename Superclass::DerivativeType DerivativeType
typename ConstantVelocityFieldType::Pointer ConstantVelocityFieldPointer
typename DisplacementFieldType::Pointer DisplacementFieldPointer
IdentifierType NumberOfParametersType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all vector image interpolaters.
typename Superclass::OutputPointType OutputPointType
typename Superclass::ScalarType ScalarType
typename ConstantVelocityFieldType::SizeType SizeType
typename Superclass::OutputVectorPixelType OutputVectorPixelType
typename ConstantVelocityFieldType::RegionType RegionType
ConstantVelocityFieldInterpolatorPointer m_ConstantVelocityFieldInterpolator
Templated n-dimensional image class.
Definition: itkImage.h:75
TParametersValueType ParametersValueType