ITK  4.3.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 <class TScalar, unsigned int NDimensions>
38  public DisplacementFieldTransform<TScalar, NDimensions>
39 {
40 public:
46 
49 
51  itkNewMacro( Self );
52 
54  typedef typename Superclass:: InverseTransformBasePointer InverseTransformBasePointer;
55 
58 
60  typedef typename Superclass::ParametersType ParametersType;
61  typedef typename Superclass::ParametersValueType ParametersValueType;
62 
64  typedef typename Superclass::TransformCategoryType TransformCategoryType;
65 
67  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
68 
70  typedef typename Superclass::InputPointType InputPointType;
71  typedef typename Superclass::OutputPointType OutputPointType;
72 
74  typedef typename Superclass::InputVectorType InputVectorType;
75  typedef typename Superclass::OutputVectorType OutputVectorType;
76 
77  typedef typename Superclass::InputVectorPixelType InputVectorPixelType;
78  typedef typename Superclass::OutputVectorPixelType OutputVectorPixelType;
79 
81  typedef typename Superclass::DerivativeType DerivativeType;
82 
84  itkStaticConstMacro( ConstantVelocityFieldDimension, unsigned int, NDimensions );
85 
87  itkStaticConstMacro( Dimension, unsigned int, NDimensions );
88 
90  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
91  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
92 
96 
105 
107 
112 
116 
118  itkGetObjectMacro( ConstantVelocityField, ConstantVelocityFieldType );
119 
123  virtual void SetConstantVelocityField( ConstantVelocityFieldType * );
124 
125  virtual void SetFixedParameters( const ParametersType & );
126 
128  itkGetObjectMacro( ConstantVelocityFieldInterpolator, ConstantVelocityFieldInterpolatorType );
129  /* Create out own set accessor that assigns the velocity field */
130  virtual void SetConstantVelocityFieldInterpolator( ConstantVelocityFieldInterpolatorType * );
132 
134  itkGetConstReferenceMacro( ConstantVelocityFieldSetTime, ModifiedTimeType );
135 
136  virtual void UpdateTransformParameters( const DerivativeType & update, ScalarType factor = 1.0 );
137 
139  bool GetInverse( Self *inverse ) const;
140 
142  virtual InverseTransformBasePointer GetInverseTransform() const;
143 
146  virtual void IntegrateVelocityField();
147 
148  // Set/get compute number of exp. integration steps automatically
149  itkSetMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
150  itkGetConstMacro( CalculateNumberOfIntegrationStepsAutomatically, bool );
151  itkBooleanMacro( CalculateNumberOfIntegrationStepsAutomatically );
152 
157  itkSetClampMacro( LowerTimeBound, ScalarType, 0, 1 );
158 
163  itkGetConstMacro( LowerTimeBound, ScalarType );
164 
169  itkSetClampMacro( UpperTimeBound, ScalarType, 0, 1 );
170 
175  itkGetConstMacro( UpperTimeBound, ScalarType );
176 
180  itkSetMacro( NumberOfIntegrationSteps, unsigned int );
181 
185  itkGetConstMacro( NumberOfIntegrationSteps, unsigned int );
186 
187 protected:
188 
191  void PrintSelf( std::ostream& os, Indent indent ) const;
192 
194  virtual typename LightObject::Pointer InternalClone() const;
195 
196  typename DisplacementFieldType::Pointer CopyDisplacementField( const DisplacementFieldType * ) const;
197 
199 
201 
204 
208 
211 
213 
214 private:
215  ConstantVelocityFieldTransform( const Self & ); // purposely not implemented
216  void operator=( const Self & ); // purposely not implemented
217 
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
233