00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-02-17 13:14:37 +0100 (Di, 17 Feb 2009) $ 00006 Version: $Revision: 16318 $ 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 "mitkModalityProperty.h" 00019 00020 mitk::ModalityProperty::ModalityProperty() 00021 { 00022 AddEnumerationTypes(); 00023 } 00024 00025 mitk::ModalityProperty::ModalityProperty( const IdType& value ) 00026 { 00027 AddEnumerationTypes(); 00028 if ( IsValidEnumerationValue( value ) ) 00029 { 00030 SetValue( value ) ; 00031 } 00032 else 00033 { 00034 SetValue( 0 ); 00035 } 00036 } 00037 00038 mitk::ModalityProperty::ModalityProperty( const std::string& value ) 00039 { 00040 AddEnumerationTypes(); 00041 if ( IsValidEnumerationValue( value ) ) 00042 { 00043 SetValue( value ); 00044 } 00045 else 00046 { 00047 SetValue( "undefined" ); 00048 } 00049 } 00050 00051 00052 mitk::ModalityProperty::~ModalityProperty() 00053 { 00054 } 00055 00056 00057 void mitk::ModalityProperty::AddEnumerationTypes() 00058 { 00059 IdType newId = EnumerationProperty::Size(); 00060 00061 AddEnum( "undefined", newId++ ); 00062 AddEnum( "CR", newId++ ); // computer radiography 00063 AddEnum( "CT", newId++ ); // computed tomography 00064 AddEnum( "MR", newId++ ); // magnetic resonance 00065 AddEnum( "NM", newId++ ); // nuclear medicine 00066 AddEnum( "US", newId++ ); // ultrasound 00067 AddEnum( "Color Doppler", newId++ ); // ultrasound 00068 AddEnum( "Power Doppler", newId++ ); // ultrasound 00069 } 00070 00071