Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkModalityProperty.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkModalityProperty.h"
14 
16 {
18 }
19 
21 {
23  if (IsValidEnumerationValue(value))
24  {
25  SetValue(value);
26  }
27  else
28  {
29  SetValue(0);
30  }
31 }
32 
34 {
36  if (IsValidEnumerationValue(value))
37  {
38  SetValue(value);
39  }
40  else
41  {
42  SetValue("undefined");
43  }
44 }
45 
47 {
48 }
49 
51 {
52  auto newId = static_cast<IdType>(EnumerationProperty::Size());
53 
54  AddEnum("undefined", newId++);
55  AddEnum("CR", newId++); // computer radiography
56  AddEnum("CT", newId++); // computed tomography
57  AddEnum("MR", newId++); // magnetic resonance
58  AddEnum("NM", newId++); // nuclear medicine
59  AddEnum("US", newId++); // ultrasound
60  AddEnum("Color Doppler", newId++); // ultrasound
61  AddEnum("Power Doppler", newId++); // ultrasound
62 }
63 
64 itk::LightObject::Pointer mitk::ModalityProperty::InternalClone() const
65 {
66  itk::LightObject::Pointer result(new Self(*this));
67  result->UnRegister();
68  return result;
69 }
virtual bool SetValue(const std::string &name)
virtual EnumIdsContainerType::size_type Size() const
virtual bool AddEnum(const std::string &name, const IdType &id)
virtual bool IsValidEnumerationValue(const IdType &id) const