00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkTransformFactory.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-03-03 15:10:26 $ 00007 Version: $Revision: 1.6 $ 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 Portions of this code are covered under the VTK copyright. 00013 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. 00014 00015 This software is distributed WITHOUT ANY WARRANTY; without even 00016 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 PURPOSE. See the above copyright notices for more information. 00018 00019 =========================================================================*/ 00020 #ifndef __itkTransformFactory_h 00021 #define __itkTransformFactory_h 00022 00023 #include "itkTransformFactoryBase.h" 00024 00025 namespace itk 00026 { 00031 template <class T> 00032 class TransformFactory : public TransformFactoryBase 00033 { 00034 public: 00035 static void RegisterTransform () 00036 { 00037 typename T::Pointer t = T::New(); 00038 00039 TransformFactoryBase::Pointer f = TransformFactoryBase::GetFactory(); 00040 00041 f->RegisterTransform ( t->GetTransformTypeAsString().c_str(), 00042 t->GetTransformTypeAsString().c_str(), 00043 t->GetTransformTypeAsString().c_str(), 00044 1, 00045 CreateObjectFunction<T>::New() ); 00046 } 00047 }; 00048 } // end namespace itk 00049 00050 #endif 00051