ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVelocityFieldTransform.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 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 :
37  public DisplacementFieldTransform<TParametersValueType, NDimensions>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_ASSIGN(VelocityFieldTransform);
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 TransformCategoryType = typename Superclass::TransformCategoryType;
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 VelocityFieldDimension = NDimensions + 1;
88 
90  static constexpr unsigned int Dimension = NDimensions;
91 
93  using DisplacementFieldType = typename Superclass::DisplacementFieldType;
95 
99 
108 
111 
115 
120  virtual void SetVelocityField( VelocityFieldType * );
121  itkGetModifiableObjectMacro(VelocityField, VelocityFieldType );
123 
124  void SetFixedParameters( const FixedParametersType & ) override;
125 
128  virtual void SetVelocityFieldInterpolator( VelocityFieldInterpolatorType * );
129  itkGetModifiableObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType );
131 
133  itkGetConstReferenceMacro( VelocityFieldSetTime, unsigned long );
134 
140  void SetDisplacementField( DisplacementFieldType * displacementField) override
141  {
142  itkDebugMacro("setting DisplacementField to " << displacementField);
143  if ( this->m_DisplacementField != displacementField )
144  {
145  this->m_DisplacementField = displacementField;
146  this->Modified();
147  }
148  }
150 
151  void UpdateTransformParameters( const DerivativeType & update, ScalarType factor = 1.0 ) override;
152 
154  bool GetInverse( Self *inverse ) const;
155 
157  InverseTransformBasePointer GetInverseTransform() const override;
158 
160  virtual void IntegrateVelocityField() {};
161 
166  itkSetClampMacro( LowerTimeBound, ScalarType, 0.0, 1.0 );
167 
172  itkGetConstMacro( LowerTimeBound, ScalarType );
173 
178  itkSetClampMacro( UpperTimeBound, ScalarType, 0.0, 1.0 );
179 
184  itkGetConstMacro( UpperTimeBound, ScalarType );
185 
189  itkSetMacro( NumberOfIntegrationSteps, unsigned int );
190 
194  itkGetConstMacro( NumberOfIntegrationSteps, unsigned int );
195 
196 protected:
197 
199  ~VelocityFieldTransform() override = default;
200  void PrintSelf( std::ostream& os, Indent indent ) const override;
201 
203  typename LightObject::Pointer InternalClone() const override;
204 
205  typename DisplacementFieldType::Pointer CopyDisplacementField( const DisplacementFieldType * ) const;
206 
209 
211 
213 
216 
219  unsigned long m_VelocityFieldSetTime;
220 
221 private:
226  virtual void SetFixedParametersFromVelocityField() const;
227 
228 };
229 } // end namespace itk
230 
231 #ifndef ITK_MANUAL_INSTANTIATION
232 #include "itkVelocityFieldTransform.hxx"
233 #endif
234 
235 #endif // itkVelocityFieldTransform_h
TPixel PixelType
Definition: itkImage.h:95
Light weight base class for most itk classes.
typename DisplacementFieldType::RegionType RegionType
typename Superclass::OutputVectorType OutputVectorType
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
typename VelocityFieldInterpolatorType::Pointer VelocityFieldInterpolatorPointer
typename DisplacementFieldType::SpacingType SpacingType
typename Superclass::OutputPointType OutputPointType
typename Superclass::InverseTransformBasePointer InverseTransformBasePointer
typename DisplacementFieldType::SizeType SizeType
typename DisplacementFieldType::PixelType PixelType
typename Superclass::InputPointType InputPointType
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 DisplacementFieldType::IndexType IndexType
typename Superclass::OutputVectorPixelType OutputVectorPixelType
typename Superclass::SpacingType SpacingType
Definition: itkImage.h:143
typename Superclass::InputVectorPixelType InputVectorPixelType
typename Superclass::DerivativeType DerivativeType
typename DisplacementFieldType::DirectionType DirectionType
typename DisplacementFieldType::Pointer DisplacementFieldPointer
IdentifierType NumberOfParametersType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
VelocityFieldInterpolatorType::Pointer m_VelocityFieldInterpolator
Base class for all vector image interpolaters.
typename Superclass::ScalarType ScalarType
typename Superclass::InputVectorType InputVectorType
typename VelocityFieldType::Pointer VelocityFieldPointer
Templated n-dimensional image class.
Definition: itkImage.h:75
Provides local/dense/high-dimensionality transformation via a a velocity field.
void SetDisplacementField(DisplacementFieldType *displacementField) override
typename DisplacementFieldType::PointType PointType
TParametersValueType ParametersValueType