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: 2005/08/10 20:29:02 $
00007   Version:   $Revision: 1.5 $
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 
00057 template < class TTransform,
00058            class TFixedImage,
00059            class TMovingImage > 
00060 class ITK_EXPORT LandmarkBasedTransformInitializer : 
00061             public Object
00062 {
00063 public:
00065   typedef LandmarkBasedTransformInitializer     Self;
00066   typedef Object                           Superclass;
00067   typedef SmartPointer<Self>               Pointer;
00068   typedef SmartPointer<const Self>         ConstPointer;
00069 
00071   itkNewMacro( Self );
00072 
00074   itkTypeMacro( LandmarkBasedTransformInitializer, Object );
00075 
00077   typedef TTransform                        TransformType;
00078   typedef typename TransformType::Pointer   TransformPointer;
00079 
00081   itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
00082   itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
00084 
00086   itkSetObjectMacro( Transform,   TransformType   );
00087 
00089   typedef   TFixedImage              FixedImageType;
00090   typedef   TMovingImage             MovingImageType;
00091 
00092   typedef   typename FixedImageType::ConstPointer   FixedImagePointer;
00093   typedef   typename MovingImageType::ConstPointer  MovingImagePointer;
00094 
00095 
00102   void SetFixedImage( const FixedImageType * image )
00103     {
00104     this->m_FixedImage = image;
00105     itkLegacyBody( SetFixedImage, 2.2 );
00106     }
00108 
00109 
00116   void SetMovingImage( const MovingImageType * image )
00117     {
00118     this->m_MovingImage = image;
00119     itkLegacyBody( SetMovingImage, 2.2 );
00120     }
00122 
00123 
00125   itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00126 
00128   typedef typename TransformType::InputPointType   InputPointType;
00129   typedef typename TransformType::OutputVectorType  OutputVectorType;
00130   typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00131   typedef std::vector< LandmarkPointType >              LandmarkPointContainer;
00132   typedef typename
00133           LandmarkPointContainer::const_iterator        PointsContainerConstIterator;
00134   typedef typename TransformType::ParametersType ParametersType;
00135   typedef typename ParametersType::ValueType     ParameterValueType;
00136 
00137 
00138     
00140   void SetFixedLandmarks(LandmarkPointContainer & fixedLandmarks)
00141     {
00142     this->m_FixedLandmarks = fixedLandmarks;
00143     } 
00144 
00146   void SetMovingLandmarks(LandmarkPointContainer & movingLandmarks)
00147     {
00148     this->m_MovingLandmarks = movingLandmarks;
00149     }
00150 
00151 
00153   typedef VersorRigid3DTransform< ParameterValueType >   
00154                                         VersorRigid3DTransformType;
00155   typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00156 
00158   virtual void InitializeTransform() ;
00159 
00160 
00161 protected:
00162   LandmarkBasedTransformInitializer();
00163   ~LandmarkBasedTransformInitializer(){};
00164 
00165   void PrintSelf(std::ostream &os, Indent indent) const;
00166 
00167   // Supported Transform types
00168   typedef enum{
00169     VersorRigid3Dtransform=1,
00170     Rigid2Dtransfrom,
00171     Else
00172   }InputTransformType;
00173 
00174 private:
00175   LandmarkBasedTransformInitializer(const Self&); //purposely not implemented
00176   void operator=(const Self&); //purposely not implemented
00177 
00178   FixedImagePointer   m_FixedImage;
00179   MovingImagePointer  m_MovingImage;
00180 
00181   LandmarkPointContainer m_FixedLandmarks;
00182   LandmarkPointContainer m_MovingLandmarks;
00183  
00184   TransformPointer    m_Transform;
00185   
00186 }; //class LandmarkBasedTransformInitializer
00187 
00188 
00189 }  // namespace itk
00190 
00191 
00192 #ifndef ITK_MANUAL_INSTANTIATION
00193 #include "itkLandmarkBasedTransformInitializer.txx"
00194 #endif
00195 
00196 #endif /* __itkLandmarkBasedTransformInitializer_h */
00197 

Generated at Sun Sep 23 13:21:16 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000