Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkLevelWindow.h
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 #ifndef LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
17 #define LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
18 
19 #include "mitkNumericTypes.h"
20 #include <MitkCoreExports.h>
21 
22 namespace mitk
23 {
24  class Image;
25 
46  {
47  public:
48  LevelWindow(ScalarType level = 127.5, ScalarType window = 255.0);
49  LevelWindow(const mitk::LevelWindow &levWin);
50  virtual ~LevelWindow();
51 
56  ScalarType GetLevel() const;
57 
61  ScalarType GetWindow() const;
62 
66  ScalarType GetDefaultLevel() const;
67 
71  ScalarType GetDefaultWindow() const;
72 
76  void ResetDefaultLevelWindow();
77 
81  ScalarType GetLowerWindowBound() const;
82 
86  ScalarType GetUpperWindowBound() const;
87 
91  void SetLevelWindow(ScalarType level, ScalarType window, bool expandRangesIfNecessary = true);
92 
96  void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary = true);
97 
101  void SetToMaxWindowSize();
102 
106  void SetRangeMinMax(ScalarType min, ScalarType max);
107 
111  ScalarType GetRangeMin() const;
112 
116  ScalarType GetRangeMax() const;
117 
121  ScalarType GetDefaultLowerBound() const;
122 
126  ScalarType GetDefaultUpperBound() const;
127 
131  void ResetDefaultRangeMinMax();
132 
136  ScalarType GetRange() const;
137 
141  void SetDefaultLevelWindow(ScalarType level, ScalarType window);
142 
146  void SetDefaultBoundaries(ScalarType low, ScalarType up);
147 
151  void SetAuto(const Image *image,
152  bool tryPicTags = true,
153  bool guessByCentralSlice = true,
154  unsigned selectedComponent = 0);
155 
159  void SetToImageRange(const Image *image);
160 
166  void SetFixed(bool fixed);
167 
171  bool GetFixed() const;
172 
176  bool IsFixed() const;
177 
181  virtual bool operator==(const LevelWindow &levWin) const;
182 
186  virtual bool operator!=(const LevelWindow &levWin) const;
187 
192  virtual LevelWindow &operator=(const LevelWindow &levWin);
193 
197  bool IsFloatingValues() const;
198 
202  void SetFloatingValues(bool value);
203 
204  protected:
209 
214 
219 
224 
229 
234 
239 
244  bool m_Fixed;
245 
261  inline void EnsureConsistency();
262  };
263 } // namespace mitk
264 #endif /* LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C */
ScalarType m_DefaultLowerBound
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
#define MITKCORE_EXPORT
double ScalarType
ScalarType m_DefaultUpperBound
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
The LevelWindow class Class to store level/window values.
class ITK_EXPORT Image
Image class for storing images.
Definition: mitkImage.h:76
ScalarType m_UpperWindowBound
static T max(T x, T y)
Definition: svm.cpp:70
static T min(T x, T y)
Definition: svm.cpp:67
ScalarType m_LowerWindowBound