ITK  4.13.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:
45 
48 
50  itkNewMacro( Self );
51 
53  typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
54 
57 
59  typedef typename Superclass::FixedParametersType FixedParametersType;
60  typedef typename Superclass::FixedParametersValueType FixedParametersValueType;
61  typedef typename Superclass::ParametersType ParametersType;
62  typedef typename Superclass::ParametersValueType ParametersValueType;
63 
65  typedef typename Superclass::TransformCategoryType TransformCategoryType;
66 
68  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
69 
71  typedef typename Superclass::InputPointType InputPointType;
72  typedef typename Superclass::OutputPointType OutputPointType;
73 
75  typedef typename Superclass::InputVectorType InputVectorType;
76  typedef typename Superclass::OutputVectorType OutputVectorType;
77 
78  typedef typename Superclass::InputVectorPixelType InputVectorPixelType;
79  typedef typename Superclass::OutputVectorPixelType OutputVectorPixelType;
80 
82  typedef typename Superclass::DerivativeType DerivativeType;
83 
85  itkStaticConstMacro( VelocityFieldDimension, unsigned int, NDimensions + 1 );
86 
88  itkStaticConstMacro( Dimension, unsigned int, NDimensions );
89 
91  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
93 
97 
106 
109 
113 
118  virtual void SetVelocityField( VelocityFieldType * );
119  itkGetModifiableObjectMacro(VelocityField, VelocityFieldType );
121 
122  virtual void SetFixedParameters( const FixedParametersType & ) ITK_OVERRIDE;
123 
126  virtual void SetVelocityFieldInterpolator( VelocityFieldInterpolatorType * );
127  itkGetModifiableObjectMacro(VelocityFieldInterpolator, VelocityFieldInterpolatorType );
129 
131  itkGetConstReferenceMacro( VelocityFieldSetTime, unsigned long );
132 
138  virtual void SetDisplacementField( DisplacementFieldType * displacementField) ITK_OVERRIDE
139  {
140  itkDebugMacro("setting DisplacementField to " << displacementField);
141  if ( this->m_DisplacementField != displacementField )
142  {
143  this->m_DisplacementField = displacementField;
144  this->Modified();
145  }
146  }
148 
149  virtual void UpdateTransformParameters( const DerivativeType & update, ScalarType factor = 1.0 ) ITK_OVERRIDE;
150 
152  bool GetInverse( Self *inverse ) const;
153 
155  virtual InverseTransformBasePointer GetInverseTransform() const ITK_OVERRIDE;
156 
158  virtual void IntegrateVelocityField() {};
159 
164  itkSetClampMacro( LowerTimeBound, ScalarType, 0.0, 1.0 );
165 
170  itkGetConstMacro( LowerTimeBound, ScalarType );
171 
176  itkSetClampMacro( UpperTimeBound, ScalarType, 0.0, 1.0 );
177 
182  itkGetConstMacro( UpperTimeBound, ScalarType );
183 
187  itkSetMacro( NumberOfIntegrationSteps, unsigned int );
188 
192  itkGetConstMacro( NumberOfIntegrationSteps, unsigned int );
193 
194 protected:
195 
197  virtual ~VelocityFieldTransform() ITK_OVERRIDE;
198  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
199 
201  virtual typename LightObject::Pointer InternalClone() const ITK_OVERRIDE;
202 
203  typename DisplacementFieldType::Pointer CopyDisplacementField( const DisplacementFieldType * ) const;
204 
205  ScalarType m_LowerTimeBound;
206  ScalarType m_UpperTimeBound;
207 
208  unsigned int m_NumberOfIntegrationSteps;
209 
210  VelocityFieldPointer m_VelocityField;
211 
213  typename VelocityFieldInterpolatorType::Pointer m_VelocityFieldInterpolator;
214 
217  unsigned long m_VelocityFieldSetTime;
218 
219 private:
220  ITK_DISALLOW_COPY_AND_ASSIGN(VelocityFieldTransform);
221 
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
Superclass::FixedParametersValueType FixedParametersValueType
Superclass::RegionType RegionType
Definition: itkImage.h:137
SmartPointer< const Self > ConstPointer
VelocityFieldType::RegionType RegionType
Light weight base class for most itk classes.
Superclass::DisplacementFieldType DisplacementFieldType
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
Superclass::ParametersType ParametersType
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
VelocityFieldType::IndexType IndexType
Superclass::ParametersValueType ParametersValueType
Superclass::InputVectorType InputVectorType
DisplacementFieldType::Pointer DisplacementFieldPointer
DisplacementFieldTransform< TParametersValueType, NDimensions > Superclass
TPixel PixelType
Definition: itkImage.h:89
Superclass::NumberOfParametersType NumberOfParametersType
VelocityFieldType::PixelType PixelType
VelocityFieldInterpolatorType::Pointer VelocityFieldInterpolatorPointer
Superclass::InverseTransformBasePointer InverseTransformBasePointer
VelocityFieldType::DirectionType DirectionType
Image< OutputVectorType, VelocityFieldDimension > VelocityFieldType
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.
ImageVectorOptimizerParametersHelper< ScalarType, Dimension, VelocityFieldDimension > OptimizerParametersHelperType
VelocityFieldType::PointType PointType
VelocityFieldType::SpacingType SpacingType
VectorInterpolateImageFunction< VelocityFieldType, ScalarType > VelocityFieldInterpolatorType
VelocityFieldType::SizeType SizeType
Superclass::DerivativeType DerivativeType
Superclass::InputPointType InputPointType
Superclass::InputVectorPixelType InputVectorPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all vector image interpolaters.
VelocityFieldType::Pointer VelocityFieldPointer
Superclass::OutputPointType OutputPointType
Superclass::OutputVectorPixelType OutputVectorPixelType
Superclass::TransformCategoryType TransformCategoryType
Superclass::OutputVectorType OutputVectorType
Templated n-dimensional image class.
Definition: itkImage.h:75
Provides local/dense/high-dimensionality transformation via a a velocity field.
Superclass::FixedParametersType FixedParametersType