00001 /*========================================================================= 00002 00003 Program: F.R.E.E. - flexible registration evaluation engine 00004 Version: v.1.0.0 00005 Date: $Date: 2006/09/01 12:00:00 $ 00006 Module: $RCSfile: freImageRegistrationProcessorBase.txx,v $ 00007 Language: C++ 00008 00009 00010 00011 Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics, 00012 Institute for Medical Biometry and Informatics, University of Heidelberg, 00013 Germany). All rights reserved. 00014 See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm 00015 for details. 00016 00017 This software is distributed WITHOUT ANY WARRANTY; without even 00018 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00019 PURPOSE. See the above copyright notices for more information. 00020 00021 =========================================================================*/ 00022 00023 #ifndef __freImageRegistrationProcessorBase_txx 00024 #define __freImageRegistrationProcessorBase_txx 00025 00026 #include "freImageRegistrationProcessorBase.h" 00027 00028 namespace FREE 00029 { 00030 00031 template <unsigned int VImageDimension> 00032 void 00033 ImageRegistrationProcessorBase< VImageDimension>:: 00034 SetFixedImage(ImageType* pImage) 00035 { 00036 if (this->m_smpFixedImage != pImage) 00037 { 00038 this->m_smpFixedImage = pImage; 00039 00040 this->m_FixedOrigin = this->m_smpFixedImage->GetOrigin(); 00041 this->m_FixedRegion = this->m_smpFixedImage->GetLargestPossibleRegion(); 00042 this->m_FixedSpacing = this->m_smpFixedImage->GetSpacing(); 00043 } 00044 }; 00045 00046 template <unsigned int VImageDimension> 00047 typename ImageRegistrationProcessorBase< VImageDimension>::ImageType* 00048 ImageRegistrationProcessorBase< VImageDimension>:: 00049 GetFixedImage() 00050 { 00051 return this->m_smpFixedImage; 00052 }; 00053 00054 template <unsigned int VImageDimension> 00055 void 00056 ImageRegistrationProcessorBase< VImageDimension>:: 00057 SetMovingImage(ImageType* pImage) 00058 { 00059 if (this->m_smpMovingImage != pImage) this->m_smpMovingImage = pImage; 00060 }; 00061 00062 template <unsigned int VImageDimension> 00063 typename ImageRegistrationProcessorBase< VImageDimension>::ImageType* 00064 ImageRegistrationProcessorBase< VImageDimension>:: 00065 GetMovingImage() 00066 { 00067 return this->m_smpMovingImage; 00068 }; 00069 00070 template <unsigned int VImageDimension> 00071 typename ImageRegistrationProcessorBase< VImageDimension>::TransformFieldPointer 00072 ImageRegistrationProcessorBase< VImageDimension>:: 00073 GetTransformationField() 00074 { 00075 if (!this->m_bRegistrationStarted) throwExceptionMacro("Cannot return transformation field before registration has started."); 00076 return ComputeTransformationField(this->m_FixedOrigin,this->m_FixedRegion,this->m_FixedSpacing); 00077 }; 00078 00079 template <unsigned int VImageDimension> 00080 void 00081 ImageRegistrationProcessorBase< VImageDimension>:: 00082 ComputeRegistration() 00083 { 00084 Superclass::ComputeRegistration(); 00085 00086 if (this->m_smpFixedImage.IsNull()) throwExceptionMacro("Cannot start registration; no fixed image is defined."); 00087 if (this->m_smpMovingImage.IsNull()) throwExceptionMacro("Cannot start registration; no moving image is defined."); 00088 //Rest will be defined in derived versions of the base class; 00089 }; 00090 00091 00092 template <unsigned int VImageDimension> 00093 ImageRegistrationProcessorBase< VImageDimension>:: 00094 ImageRegistrationProcessorBase() 00095 { 00096 this->m_smpFixedImage = NULL; 00097 this->m_smpMovingImage = NULL; 00098 this->m_ReleaseInputsAfterRegistration = false; 00099 }; 00100 00101 template <unsigned int VImageDimension> 00102 void 00103 ImageRegistrationProcessorBase< VImageDimension>:: 00104 ReleaseInputs() 00105 { 00106 Superclass::ReleaseInputs(); 00107 this->m_smpFixedImage = NULL; 00108 this->m_smpMovingImage = NULL; 00109 }; 00110 00111 }//End of Namespace free 00112 00113 #endif
1.5.3 written by Dimitri van Heesch,
© 1997-2000