freSetupParameterTraits.cxx

Go to the documentation of this file.
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: freSetupParameterTraits.cxx,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 #include "freSetupParameterTraits.h"
00024 
00025 
00026 namespace FREE
00027 {
00028 
00032 
00033 
00034 
00035 bool
00036 SetupParameterTraits::
00037 ValueIsValid (double dValue) const
00038 {
00039         if (this->IsBoundedBelow())
00040         {
00041                 if (dValue<m_dLowerBound) return false;
00042         }
00043         if (this->IsBoundedAbove())
00044         {
00045                 if (dValue>m_dUpperBound) return false;
00046         }
00047         if (m_dQuantisation)
00048         {
00049                 double dTemp = dValue/m_dQuantisation;
00050                 if (dTemp - floor(dTemp) != 0) return false;
00051         }
00052 
00053         return true;
00054 };
00055 
00056 SetupParameterTraits::
00057 SetupParameterTraits(double dInitialValue, ParameterType parameterType,
00058                            double dLowerBound, bool bBoundedBelow,
00059                            double dUpperBound, bool bBoundedAbove,
00060                                                                                  double dQuantisation)
00061 {
00062         m_dInitialValue = dInitialValue;
00063   m_ParameterType = parameterType;
00064         m_dLowerBound = dLowerBound;
00065         m_bBoundedBelow = bBoundedBelow;
00066         m_dUpperBound = dUpperBound;
00067         m_bBoundedBelow = bBoundedAbove;
00068         if (dQuantisation<0.0) throwExceptionMacro("Error, negativ quantisation passed. Only values greater or equal 0 are allowed.");
00069   m_dQuantisation = dQuantisation;
00070 };
00071 
00072 }//End of Namespace free

Generated at Sat Oct 13 17:27:43 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000