Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkLandmarkBasedTransformInitializer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLandmarkBasedTransformInitializer.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-05 19:05:00 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkLandmarkBasedTransformInitializer_h
00019 #define __itkLandmarkBasedTransformInitializer_h
00020 
00021 #include "itkObject.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkVersorRigid3DTransform.h"
00024 #include "itkRigid2DTransform.h"
00025 #include <vector>
00026 #include <iostream>
00027 
00028 namespace itk
00029 {
00030 
00058 template < class TTransform,
00059            class TFixedImage,
00060            class TMovingImage > 
00061 class ITK_EXPORT LandmarkBasedTransformInitializer : 
00062             public Object
00063 {
00064 public:
00066   typedef LandmarkBasedTransformInitializer     Self;
00067   typedef Object                                Superclass;
00068   typedef SmartPointer<Self>                    Pointer;
00069   typedef SmartPointer<const Self>              ConstPointer;
00070 
00072   itkNewMacro( Self );
00073 
00075   itkTypeMacro( LandmarkBasedTransformInitializer, Object );
00076 
00078   typedef TTransform                        TransformType;
00079   typedef typename TransformType::Pointer   TransformPointer;
00080 
00082   itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
00083   itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
00085 
00087   itkSetObjectMacro( Transform,   TransformType   );
00088 
00090   typedef   TFixedImage              FixedImageType;
00091   typedef   TMovingImage             MovingImageType;
00092 
00093   typedef   typename FixedImageType::ConstPointer   FixedImagePointer;
00094   typedef   typename MovingImageType::ConstPointer  MovingImagePointer;
00095 
00096 
00103   void SetFixedImage( const FixedImageType * image )
00104     {
00105     this->m_FixedImage = image;
00106     itkLegacyBodyMacro( SetFixedImage, 2.2 );
00107     }
00109 
00110 
00117   void SetMovingImage( const MovingImageType * image )
00118     {
00119     this->m_MovingImage = image;
00120     itkLegacyBodyMacro( SetMovingImage, 2.2 );
00121     }
00123 
00124 
00126   itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00127 
00129   typedef typename TransformType::InputPointType                  InputPointType;
00130   typedef typename TransformType::OutputVectorType                OutputVectorType;
00131   typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00132   typedef std::vector< LandmarkPointType >                        LandmarkPointContainer;
00133   typedef typename
00134           LandmarkPointContainer::const_iterator                  PointsContainerConstIterator;
00135   typedef typename TransformType::ParametersType                  ParametersType;
00136   typedef typename ParametersType::ValueType                      ParameterValueType;
00137 
00138 
00139     
00141   void SetFixedLandmarks(const LandmarkPointContainer & fixedLandmarks)
00142     {
00143     this->m_FixedLandmarks = fixedLandmarks;
00144     } 
00145 
00147   void SetMovingLandmarks(const LandmarkPointContainer & movingLandmarks)
00148     {
00149     this->m_MovingLandmarks = movingLandmarks;
00150     }
00151 
00152 
00154   typedef VersorRigid3DTransform< ParameterValueType >   
00155                                                  VersorRigid3DTransformType;
00156   typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00157 
00159   virtual void InitializeTransform();
00160 
00161 
00162 protected:
00163   LandmarkBasedTransformInitializer();
00164   ~LandmarkBasedTransformInitializer(){};
00165 
00166   void PrintSelf(std::ostream &os, Indent indent) const;
00167 
00168   // Supported Transform types
00169   typedef enum{
00170     VersorRigid3Dtransform=1,
00171     Rigid2Dtransfrom,
00172     Else
00173   }InputTransformType;
00174 
00175 private:
00176   LandmarkBasedTransformInitializer(const Self&); //purposely not implemented
00177   void operator=(const Self&); //purposely not implemented
00178 
00179   FixedImagePointer   m_FixedImage;
00180   MovingImagePointer  m_MovingImage;
00181 
00182   LandmarkPointContainer m_FixedLandmarks;
00183   LandmarkPointContainer m_MovingLandmarks;
00184  
00185   TransformPointer    m_Transform;
00186   
00187 }; //class LandmarkBasedTransformInitializer
00188 
00189 
00190 }  // namespace itk
00191 
00192 
00193 #ifndef ITK_MANUAL_INSTANTIATION
00194 #include "itkLandmarkBasedTransformInitializer.txx"
00195 #endif
00196 
00197 #endif /* __itkLandmarkBasedTransformInitializer_h */
00198 

Generated at Tue Sep 15 03:49:34 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000