ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkTimeVaryingBSplineVelocityFieldTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkTimeVaryingBSplineVelocityFieldTransform_h
00019 #define __itkTimeVaryingBSplineVelocityFieldTransform_h
00020 
00021 #include "itkTimeVaryingVelocityFieldTransform.h"
00022 
00023 namespace itk
00024 {
00025 
00062 template<class TScalar, unsigned int NDimensions>
00063 class ITK_EXPORT TimeVaryingBSplineVelocityFieldTransform :
00064   public TimeVaryingVelocityFieldTransform<TScalar, NDimensions>
00065 {
00066 public:
00067 
00069   typedef TimeVaryingBSplineVelocityFieldTransform                 Self;
00070   typedef TimeVaryingVelocityFieldTransform<TScalar, NDimensions>  Superclass;
00071   typedef SmartPointer<Self>                                       Pointer;
00072   typedef SmartPointer<const Self>                                 ConstPointer;
00073 
00075   itkTypeMacro( TimeVaryingBSplineVelocityFieldTransform, TimeVaryingVelocityFieldTransform );
00076 
00078   itkSimpleNewMacro( Self );
00079 
00081   typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
00082 
00084   typedef typename Superclass::ScalarType              ScalarType;
00085 
00087   typedef typename Superclass::ParametersType          ParametersType;
00088   typedef typename ParametersType::ValueType           ParametersValueType;
00089   typedef typename Superclass::NumberOfParametersType  NumberOfParametersType;
00090 
00092   typedef typename Superclass::JacobianType        JacobianType;
00093 
00095   typedef typename Superclass::InputPointType      InputPointType;
00096   typedef typename Superclass::OutputPointType     OutputPointType;
00097 
00099   typedef typename Superclass::InputVectorType     InputVectorType;
00100   typedef typename Superclass::OutputVectorType    OutputVectorType;
00101 
00103   typedef typename Superclass::DerivativeType       DerivativeType;
00104 
00106   itkStaticConstMacro( Dimension, unsigned int, NDimensions );
00107 
00109   itkStaticConstMacro( TimeVaryingVelocityFieldDimension, unsigned int, NDimensions+1 );
00110 
00114   typedef Image<OutputVectorType, TimeVaryingVelocityFieldDimension>          TimeVaryingVelocityFieldControlPointLatticeType;
00115   typedef typename TimeVaryingVelocityFieldControlPointLatticeType::Pointer   TimeVaryingVelocityFieldControlPointLatticePointer;
00116   typedef TimeVaryingVelocityFieldControlPointLatticeType                     TimeVaryingVelocityFieldType;
00117 
00118   typedef typename TimeVaryingVelocityFieldControlPointLatticeType::PointType         VelocityFieldPointType;
00119   typedef typename TimeVaryingVelocityFieldControlPointLatticeType::SizeType          VelocityFieldSizeType;
00120   typedef typename TimeVaryingVelocityFieldControlPointLatticeType::SpacingType       VelocityFieldSpacingType;
00121   typedef typename TimeVaryingVelocityFieldControlPointLatticeType::DirectionType     VelocityFieldDirectionType;
00122 
00123   typedef typename Superclass::DisplacementFieldType                       DisplacementFieldControlPointLatticeType;
00124   typedef typename Superclass::DisplacementFieldType                       DisplacementFieldType;
00125   typedef typename DisplacementFieldType::PixelType                        DisplacementVectorType;
00126   typedef typename DisplacementFieldType::SizeType                         DisplacementFieldSizeType;
00127   typedef typename DisplacementFieldType::SpacingType                      DisplacementFieldSpacingType;
00128   typedef typename DisplacementFieldType::PointType                        DisplacementFieldPointType;
00129   typedef typename DisplacementFieldType::DirectionType                    DisplacementFieldDirectionType;
00130 
00132   itkGetObjectMacro( TimeVaryingVelocityFieldControlPointLattice, TimeVaryingVelocityFieldControlPointLatticeType );
00133 
00135   virtual void SetTimeVaryingVelocityFieldControlPointLattice( TimeVaryingVelocityFieldControlPointLatticeType * );
00136 
00138   virtual void SetFixedParameters( const ParametersType & );
00139 
00147   virtual void UpdateTransformParameters( DerivativeType & update, ScalarType factor = 1.0 );
00148 
00150   virtual void IntegrateVelocityField();
00151 
00153   bool GetInverse( Self *inverse ) const;
00154 
00156   virtual InverseTransformBasePointer GetInverseTransform() const;
00157 
00159   itkSetMacro( SplineOrder, unsigned int );
00160   itkGetConstMacro( SplineOrder, unsigned int );
00162 
00164   itkSetMacro( TemporalPeriodicity, bool );
00165   itkGetConstMacro( TemporalPeriodicity, bool );
00166   itkBooleanMacro( TemporalPeriodicity );
00168 
00170   itkSetMacro( VelocityFieldOrigin, VelocityFieldPointType );
00171   itkGetConstMacro( VelocityFieldOrigin, VelocityFieldPointType );
00173 
00175   itkSetMacro( VelocityFieldSpacing, VelocityFieldSpacingType );
00176   itkGetConstMacro( VelocityFieldSpacing, VelocityFieldSpacingType );
00178 
00180   itkSetMacro( VelocityFieldSize, VelocityFieldSizeType );
00181   itkGetConstMacro( VelocityFieldSize, VelocityFieldSizeType );
00183 
00185   itkSetMacro( VelocityFieldDirection, VelocityFieldDirectionType );
00186   itkGetConstMacro( VelocityFieldDirection, VelocityFieldDirectionType );
00188 
00189 protected:
00190   TimeVaryingBSplineVelocityFieldTransform();
00191   virtual ~TimeVaryingBSplineVelocityFieldTransform();
00192   void PrintSelf( std::ostream& os, Indent indent ) const;
00193 
00194 private:
00195   TimeVaryingBSplineVelocityFieldTransform( const Self& ); //purposely not implementen
00196   void operator=( const Self& ); //purposely not implemented
00197 
00199   TimeVaryingVelocityFieldControlPointLatticePointer             m_TimeVaryingVelocityFieldControlPointLattice;
00200 
00201   unsigned int                                                   m_SplineOrder;
00202   bool                                                           m_TemporalPeriodicity;
00203 
00204   VelocityFieldPointType                                         m_VelocityFieldOrigin;
00205   VelocityFieldSpacingType                                       m_VelocityFieldSpacing;
00206   VelocityFieldDirectionType                                     m_VelocityFieldDirection;
00207   VelocityFieldSizeType                                          m_VelocityFieldSize;
00208 };
00209 
00210 } // end namespace itk
00211 
00212 #if ITK_TEMPLATE_EXPLICIT
00213 # include "Templates/itkTimeVaryingBSplineVelocityFieldTransform+-.h"
00214 #endif
00215 
00216 #if ITK_TEMPLATE_TXX
00217 # include "itkTimeVaryingBSplineVelocityFieldTransform.hxx"
00218 #endif
00219 
00220 #endif // __itkTimeVaryingBSplineVelocityFieldTransform_h
00221