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);
00083 
00085   itkSetObjectMacro( Transform,   TransformType   );
00086 
00088   typedef   TFixedImage              FixedImageType;
00089   typedef   TMovingImage             MovingImageType;
00090 
00091   typedef   typename FixedImageType::ConstPointer   FixedImagePointer;
00092   typedef   typename MovingImageType::ConstPointer  MovingImagePointer;
00093 
00094 
00101   void SetFixedImage( const FixedImageType * image )
00102     {
00103     this->m_FixedImage = image;
00104     itkLegacyBody( SetFixedImage, 2.2 );
00105     }
00106 
00107 
00114   void SetMovingImage( const MovingImageType * image )
00115     {
00116     this->m_MovingImage = image;
00117     itkLegacyBody( SetMovingImage, 2.2 );
00118     }
00119     
00120 
00122   itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension );
00123       
00125   typedef typename TransformType::InputPointType   InputPointType;
00126   typedef typename TransformType::OutputVectorType  OutputVectorType;
00127   typedef Point< double, itkGetStaticConstMacro(ImageDimension) > LandmarkPointType;
00128   typedef std::vector< LandmarkPointType >              LandmarkPointContainer;
00129   typedef typename
00130           LandmarkPointContainer::const_iterator        PointsContainerConstIterator;
00131   typedef typename TransformType::ParametersType ParametersType;
00132   typedef typename ParametersType::ValueType     ParameterValueType;
00133 
00134 
00135     
00137   void SetFixedLandmarks(LandmarkPointContainer & fixedLandmarks)
00138     {
00139     this->m_FixedLandmarks = fixedLandmarks;
00140     } 
00141   
00143   void SetMovingLandmarks(LandmarkPointContainer & movingLandmarks)
00144     {
00145     this->m_MovingLandmarks = movingLandmarks;
00146     }
00147     
00148 
00150   typedef VersorRigid3DTransform< ParameterValueType >   
00151                                         VersorRigid3DTransformType;
00152   typedef Rigid2DTransform< ParameterValueType > Rigid2DTransformType;
00153   
00155   virtual void InitializeTransform() ;
00156   
00157 
00158 protected:
00159   LandmarkBasedTransformInitializer();
00160   ~LandmarkBasedTransformInitializer(){};
00161 
00162   void PrintSelf(std::ostream &os, Indent indent) const;
00163 
00164   // Supported Transform types
00165   typedef enum{
00166     VersorRigid3Dtransform=1,
00167     Rigid2Dtransfrom,
00168     Else
00169   }InputTransformType;
00170 
00171 private:
00172   LandmarkBasedTransformInitializer(const Self&); //purposely not implemented
00173   void operator=(const Self&); //purposely not implemented
00174 
00175   FixedImagePointer   m_FixedImage;
00176   MovingImagePointer  m_MovingImage;
00177 
00178   LandmarkPointContainer m_FixedLandmarks;
00179   LandmarkPointContainer m_MovingLandmarks;
00180  
00181   TransformPointer    m_Transform;
00182   
00183 }; //class LandmarkBasedTransformInitializer
00184 
00185 
00186 }  // namespace itk
00187 
00188 
00189 #ifndef ITK_MANUAL_INSTANTIATION
00190 #include "itkLandmarkBasedTransformInitializer.txx"
00191 #endif
00192 
00193 #endif /* __itkLandmarkBasedTransformInitializer_h */

Generated at Wed May 24 23:32:02 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000