Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
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 (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 
14 
16 {
17 }
18 
20  : BaseProperty(other), m_LevWin(other.m_LevWin)
21 {
22 }
23 
25 {
26  SetLevelWindow(levWin);
27 }
28 
30 {
31 }
32 
33 bool mitk::LevelWindowProperty::IsEqual(const BaseProperty &property) const
34 {
35  return this->m_LevWin == static_cast<const Self &>(property).m_LevWin;
36 }
37 
38 bool mitk::LevelWindowProperty::Assign(const BaseProperty &property)
39 {
40  this->m_LevWin = static_cast<const Self &>(property).m_LevWin;
41  return true;
42 }
43 
45 {
46  return m_LevWin;
47 }
48 
50 {
51  return GetLevelWindow();
52 }
53 
55 {
56  if (m_LevWin != levWin)
57  {
58  m_LevWin = levWin;
59  Modified();
60  }
61 }
62 
64 {
65  SetLevelWindow(levWin);
66 }
67 
69 {
70  std::stringstream myStr;
71  myStr << "L:" << m_LevWin.GetLevel() << " W:" << m_LevWin.GetWindow();
72  return myStr.str();
73 }
74 
75 itk::LightObject::Pointer mitk::LevelWindowProperty::InternalClone() const
76 {
77  itk::LightObject::Pointer result(new Self(*this));
78  result->UnRegister();
79  return result;
80 }
ScalarType GetLevel() const
method that returns the level value, i.e. the center of the current grey value interval ...
The LevelWindowProperty class Property for the mitk::LevelWindow.
The LevelWindow class Class to store level/window values.
void SetLevelWindow(const LevelWindow &levWin)
const mitk::LevelWindow & GetLevelWindow() const
Abstract base class for properties.
std::string GetValueAsString() const override
const mitk::LevelWindow & GetValue() const
ScalarType GetWindow() const
returns the current window size, i.e the range size of the current grey value interval ...
void SetValue(const ValueType &levWin)