00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-05-12 19:31:16 +0200 (Di, 12 Mai 2009) $ 00006 Version: $Revision: $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html 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 #include "mitkOdfScaleByProperty.h" 00019 00020 // ODFN_NONE, ODFN_GFA, ODFN_PC 00021 00022 mitk::OdfScaleByProperty::OdfScaleByProperty( ) 00023 { 00024 this->AddInterpolationTypes(); 00025 this->SetValue( static_cast<IdType>( ODFSB_NONE ) ); 00026 } 00027 00028 00029 mitk::OdfScaleByProperty::OdfScaleByProperty( const IdType& value ) 00030 { 00031 this->AddInterpolationTypes(); 00032 if ( IsValidEnumerationValue( value ) ) 00033 { 00034 this->SetValue( value ) ; 00035 } 00036 else 00037 { 00038 this->SetValue( static_cast<IdType>( ODFSB_NONE ) ); 00039 } 00040 } 00041 00042 mitk::OdfScaleByProperty::OdfScaleByProperty( const std::string& value ) 00043 { 00044 this->AddInterpolationTypes(); 00045 if ( IsValidEnumerationValue( value ) ) 00046 { 00047 this->SetValue( value ); 00048 } 00049 else 00050 { 00051 this->SetValue( static_cast<IdType>( ODFSB_NONE ) ); 00052 } 00053 } 00054 00055 00056 int mitk::OdfScaleByProperty::GetScaleBy() 00057 { 00058 return static_cast<int>( this->GetValueAsId() ); 00059 } 00060 00061 void mitk::OdfScaleByProperty::AddInterpolationTypes() 00062 { 00063 AddEnum( "None", static_cast<IdType>( ODFSB_NONE ) ); 00064 AddEnum( "GFA", static_cast<IdType>( ODFSB_GFA ) ); 00065 AddEnum( "Principal Curvature", static_cast<IdType>( ODFSB_PC ) ); 00066 } 00067 00068 void mitk::OdfScaleByProperty::SetScaleByNothing() 00069 { 00070 SetValue(ODFSB_NONE); 00071 } 00072 00073 void mitk::OdfScaleByProperty::SetScaleByGFA() 00074 { 00075 SetValue(ODFSB_GFA); 00076 } 00077 00078 void mitk::OdfScaleByProperty::SetScaleByPrincipalCurvature() 00079 { 00080 SetValue(ODFSB_PC); 00081 } 00082 00083 bool mitk::OdfScaleByProperty::AddEnum( const std::string& name, const IdType& id ) 00084 { 00085 return Superclass::AddEnum( name, id ); 00086 }