ITK  4.13.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:
46 
49 
51  itkNewMacro( Self );
52 
54  typedef typename Superclass:: InverseTransformBasePointer InverseTransformBasePointer;
55 
58 
60  typedef typename Superclass::FixedParametersType FixedParametersType;
61  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
62  typedef typename Superclass::ParametersType ParametersType;
63  typedef typename Superclass::ParametersValueType ParametersValueType;
64 
66  typedef typename Superclass::TransformCategoryType TransformCategoryType;
67 
69  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
70 
72  typedef typename Superclass::InputPointType InputPointType;
73  typedef typename Superclass::OutputPointType OutputPointType;
74 
76  typedef typename Superclass::InputVectorType InputVectorType;
77  typedef typename Superclass::OutputVectorType OutputVectorType;
78 
79  typedef typename Superclass::InputVectorPixelType InputVectorPixelType;
80  typedef typename Superclass::OutputVectorPixelType OutputVectorPixelType;
81 
83  typedef typename Superclass::DerivativeType DerivativeType;
84 
86  itkStaticConstMacro( ConstantVelocityFieldDimension, unsigned int, NDimensions );
87 
89  itkStaticConstMacro( Dimension, unsigned int, NDimensions );
90 
92  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
93  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
94 
98 
107 
109 
114 
118 
123  virtual void SetConstantVelocityField( ConstantVelocityFieldType * );
124  itkGetModifiableObjectMacro(ConstantVelocityField, ConstantVelocityFieldType );
126 
127  virtual void SetFixedParameters( const FixedParametersType & ) ITK_OVERRIDE;
128 
131  virtual void SetConstantVelocityFieldInterpolator( ConstantVelocityFieldInterpolatorType * );
132  itkGetModifiableObjectMacro(ConstantVelocityFieldInterpolator, ConstantVelocityFieldInterpolatorType );
134 
136  itkGetConstReferenceMacro( ConstantVelocityFieldSetTime, ModifiedTimeType );
137 
138  virtual void UpdateTransformParameters( const DerivativeType & update, ScalarType factor = 1.0 ) ITK_OVERRIDE;
139 
141  bool GetInverse( Self *inverse ) const;
142 
144  virtual InverseTransformBasePointer GetInverseTransform() const ITK_OVERRIDE;
145 
148  virtual void IntegrateVelocityField();
149 
150  // Set/get compute number of exp. integration steps automatically
151  itkSetMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
152  itkGetConstMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
153  itkBooleanMacro( CalculateNumberOfIntegrationStepsAutomatically );
154 
159  itkSetClampMacro( LowerTimeBound, ScalarType, 0, 1 );
160 
165  itkGetConstMacro( LowerTimeBound, ScalarType );
166 
171  itkSetClampMacro( UpperTimeBound, ScalarType, 0, 1 );
172 
177  itkGetConstMacro( UpperTimeBound, ScalarType );
178 
182  itkSetMacro( NumberOfIntegrationSteps, unsigned int );
183 
187  itkGetConstMacro( NumberOfIntegrationSteps, unsigned int );
188 
189 protected:
190 
192  virtual ~ConstantVelocityFieldTransform() ITK_OVERRIDE;
193  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
194 
196  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
197 
198  typename DisplacementFieldType::Pointer CopyDisplacementField( const DisplacementFieldType * ) const;
199 
200  ConstantVelocityFieldPointer m_ConstantVelocityField;
201 
202  bool m_CalculateNumberOfIntegrationStepsAutomatically;
203 
205  ConstantVelocityFieldInterpolatorPointer m_ConstantVelocityFieldInterpolator;
206 
209  ModifiedTimeType m_ConstantVelocityFieldSetTime;
210 
211  ScalarType m_LowerTimeBound;
212  ScalarType m_UpperTimeBound;
213 
214  unsigned int m_NumberOfIntegrationSteps;
215 
216 private:
217  ITK_DISALLOW_COPY_AND_ASSIGN(ConstantVelocityFieldTransform);
218 
223  virtual void SetFixedParametersFromConstantVelocityField() const;
224 
225 };
226 
227 } // end namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkConstantVelocityFieldTransform.hxx"
231 #endif
232 
233 #endif // itkConstantVelocityFieldTransform_h
ConstantVelocityFieldType::IndexType IndexType
Provides local/dense/high-dimensionality transformation via a a constant velocity field...
Superclass::RegionType RegionType
Definition: itkImage.h:137
ConstantVelocityFieldType::DirectionType DirectionType
Light weight base class for most itk classes.
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
Superclass::NumberOfParametersType NumberOfParametersType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
Superclass::InputVectorPixelType InputVectorPixelType
ConstantVelocityFieldType::PixelType PixelType
Superclass::OutputVectorPixelType OutputVectorPixelType
ImageVectorOptimizerParametersHelper< ScalarType, Dimension, ConstantVelocityFieldDimension > OptimizerParametersHelperType
ConstantVelocityFieldType::Pointer ConstantVelocityFieldPointer
TPixel PixelType
Definition: itkImage.h:89
Superclass::InverseTransformBasePointer InverseTransformBasePointer
ConstantVelocityFieldType::PointType PointType
Class to hold and manage parameters of type Image&lt;Vector&lt;...&gt;,...&gt;, used in Transforms, etc.
VectorInterpolateImageFunction< ConstantVelocityFieldType, ScalarType > ConstantVelocityFieldInterpolatorType
ConstantVelocityFieldType::SizeType SizeType
Class to hold and manage different parameter types used during optimization.
Superclass::SizeType SizeType
Definition: itkImage.h:126
Superclass::FixedParametersType FixedParametersType
ConstantVelocityFieldInterpolatorType::Pointer ConstantVelocityFieldInterpolatorPointer
Superclass::ParametersValueType ParametersValueType
ConstantVelocityFieldType::SpacingType SpacingType
DisplacementFieldTransform< TParametersValueType, NDimensions > Superclass
DisplacementFieldType::Pointer DisplacementFieldPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::DisplacementFieldType DisplacementFieldType
Base class for all vector image interpolaters.
Superclass::TransformCategoryType TransformCategoryType
Image< OutputVectorType, ConstantVelocityFieldDimension > ConstantVelocityFieldType
Superclass::FixedParametersValueType FixedParametersValueType
ConstantVelocityFieldType::RegionType RegionType
Templated n-dimensional image class.
Definition: itkImage.h:75