Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkLevelWindowProperty.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
20 {
21 }
22 
24  : BaseProperty(other), m_LevWin(other.m_LevWin)
25 {
26 }
27 
29 {
30  SetLevelWindow(levWin);
31 }
32 
34 {
35 }
36 
37 bool mitk::LevelWindowProperty::IsEqual(const BaseProperty &property) const
38 {
39  return this->m_LevWin == static_cast<const Self &>(property).m_LevWin;
40 }
41 
42 bool mitk::LevelWindowProperty::Assign(const BaseProperty &property)
43 {
44  this->m_LevWin = static_cast<const Self &>(property).m_LevWin;
45  return true;
46 }
47 
49 {
50  return m_LevWin;
51 }
52 
54 {
55  return GetLevelWindow();
56 }
57 
59 {
60  if (m_LevWin != levWin)
61  {
62  m_LevWin = levWin;
63  Modified();
64  }
65 }
66 
68 {
69  SetLevelWindow(levWin);
70 }
71 
73 {
74  std::stringstream myStr;
75  myStr << "L:" << m_LevWin.GetLevel() << " W:" << m_LevWin.GetWindow();
76  return myStr.str();
77 }
78 
79 itk::LightObject::Pointer mitk::LevelWindowProperty::InternalClone() const
80 {
81  itk::LightObject::Pointer result(new Self(*this));
82  result->UnRegister();
83  return result;
84 }
const mitk::LevelWindow & GetLevelWindow() const
itk::SmartPointer< Self > Pointer
The LevelWindowProperty class Property for the mitk::LevelWindow.
The LevelWindow class Class to store level/window values.
void SetLevelWindow(const LevelWindow &levWin)
Abstract base class for properties.
virtual std::string GetValueAsString() const override
const mitk::LevelWindow & GetValue() const
void SetValue(const ValueType &levWin)