go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkDeformationFieldInterpolatingTransform.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __itkDeformationFieldInterpolatingTransform_h
00016 #define __itkDeformationFieldInterpolatingTransform_h
00017 
00018 #include <iostream>
00019 #include "itkAdvancedTransform.h"
00020 #include "itkExceptionObject.h"
00021 #include "itkImage.h"
00022 #include "itkVectorInterpolateImageFunction.h"
00023 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
00024 
00025 
00026 namespace itk
00027 {
00028 
00040   template <
00041     class TScalarType=double,          // Data type for scalars (float or double)
00042     unsigned int NDimensions=3,        // Number of input dimensions
00043     class TComponentType=double>       // ComponentType of the deformation field
00044   class DeformationFieldInterpolatingTransform :
00045     public AdvancedTransform< TScalarType, NDimensions, NDimensions >
00046   {
00047   public:
00049     typedef DeformationFieldInterpolatingTransform Self;
00050     typedef AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass;
00051     typedef SmartPointer<Self>        Pointer;
00052     typedef SmartPointer<const Self>  ConstPointer;
00053 
00055     itkNewMacro( Self );
00056 
00058     itkTypeMacro( DeformationFieldInterpolatingTransform, AdvancedTransform );
00059 
00061     itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension);
00062     itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension);
00063 
00065     typedef typename Superclass::ScalarType ScalarType;
00066     typedef typename Superclass::ParametersType ParametersType;
00067     typedef typename Superclass::JacobianType JacobianType;
00068     typedef typename Superclass::InputVectorType InputVectorType;
00069     typedef typename Superclass::OutputVectorType OutputVectorType;
00070     typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00071     typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00072     typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00073     typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00074     typedef typename Superclass::InputPointType InputPointType;
00075     typedef typename Superclass::OutputPointType OutputPointType;
00076 
00077     typedef TComponentType                            DeformationFieldComponentType;
00078     typedef Vector<DeformationFieldComponentType,
00079       itkGetStaticConstMacro(OutputSpaceDimension) >  DeformationFieldVectorType;
00080     typedef Image< DeformationFieldVectorType,
00081       itkGetStaticConstMacro(InputSpaceDimension) >   DeformationFieldType;
00082 
00083     typedef VectorInterpolateImageFunction<
00084       DeformationFieldType, ScalarType >
00085                         DeformationFieldInterpolatorType;
00086     typedef VectorNearestNeighborInterpolateImageFunction<
00087       DeformationFieldType, ScalarType >
00088                         DefaultDeformationFieldInterpolatorType;
00089 
00090 
00094     OutputPointType TransformPoint( const InputPointType & point ) const;
00095 
00098     void SetIdentity( void );
00099 
00101     virtual void SetDeformationField( DeformationFieldType * _arg );
00102     itkGetObjectMacro(DeformationField, DeformationFieldType);
00103 
00105     virtual void SetDeformationFieldInterpolator( DeformationFieldInterpolatorType * _arg );
00106     itkGetObjectMacro(DeformationFieldInterpolator, DeformationFieldInterpolatorType);
00107 
00108     virtual bool IsLinear( void ) const { return false; };
00109 
00110     virtual void SetParameters( const ParametersType & ) 
00111     {
00112       itkExceptionMacro( << "ERROR: The DeformationFieldInterpolatingTransform is "
00113         << "NOT suited for image registration. Just use it as an (initial) fixed transform "
00114         << "that is not optimized." );
00115     }
00116 
00117 
00118   protected:
00119     DeformationFieldInterpolatingTransform();
00120     ~DeformationFieldInterpolatingTransform();
00121 
00123     typedef typename DeformationFieldInterpolatorType::ContinuousIndexType
00124       InputContinuousIndexType;
00125     typedef typename DeformationFieldInterpolatorType::OutputType InterpolatorOutputType;
00126 
00128     void PrintSelf(std::ostream &os, Indent indent) const;
00129 
00130     typename DeformationFieldType::Pointer m_DeformationField;
00131     typename DeformationFieldType::Pointer m_ZeroDeformationField;
00132     typename DeformationFieldInterpolatorType::Pointer m_DeformationFieldInterpolator;
00133 
00134   private:
00135     DeformationFieldInterpolatingTransform(const Self&); //purposely not implemented
00136     void operator=(const Self&); //purposely not implemented
00137 
00138 
00139   }; //class DeformationFieldInterpolatingTransform
00140 
00141 
00142 }  // namespace itk
00143 
00144 
00145 #ifndef ITK_MANUAL_INSTANTIATION
00146 #include "itkDeformationFieldInterpolatingTransform.txx"
00147 #endif
00148 
00149 #endif /* __itkDeformationFieldInterpolatingTransform_h */


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo