Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 (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 #ifndef mitkLevelWindow_h
13 #define mitkLevelWindow_h
14 
15 #include "mitkNumericTypes.h"
16 #include <MitkCoreExports.h>
17 
18 namespace mitk
19 {
20  class Image;
21 
45  {
46  public:
47  LevelWindow(ScalarType level = 127.5, ScalarType window = 255.0);
48  LevelWindow(const mitk::LevelWindow &levWin);
49  virtual ~LevelWindow();
50 
55  ScalarType GetLevel() const;
56 
60  ScalarType GetWindow() const;
61 
65  ScalarType GetDefaultLevel() const;
66 
70  ScalarType GetDefaultWindow() const;
71 
75  void ResetDefaultLevelWindow();
76 
80  ScalarType GetLowerWindowBound() const;
81 
85  ScalarType GetUpperWindowBound() const;
86 
90  void SetLevelWindow(ScalarType level, ScalarType window, bool expandRangesIfNecessary = true);
91 
95  void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary = true);
96 
100  void SetToMaxWindowSize();
101 
105  void SetRangeMinMax(ScalarType min, ScalarType max);
106 
110  ScalarType GetRangeMin() const;
111 
115  ScalarType GetRangeMax() const;
116 
120  ScalarType GetDefaultLowerBound() const;
121 
125  ScalarType GetDefaultUpperBound() const;
126 
130  void ResetDefaultRangeMinMax();
131 
135  ScalarType GetRange() const;
136 
140  void SetDefaultLevelWindow(ScalarType level, ScalarType window);
141 
145  void SetDefaultBoundaries(ScalarType low, ScalarType up);
146 
150  void SetAuto(const Image *image,
151  bool tryPicTags = true,
152  bool guessByCentralSlice = true,
153  unsigned selectedComponent = 0);
154 
158  void SetToImageRange(const Image *image);
159 
165  void SetFixed(bool fixed);
166 
170  bool GetFixed() const;
171 
175  bool IsFixed() const;
176 
180  virtual bool operator==(const LevelWindow &levWin) const;
181 
185  virtual bool operator!=(const LevelWindow &levWin) const;
186 
191  virtual LevelWindow &operator=(const LevelWindow &levWin);
192 
196  bool IsFloatingValues() const;
197 
201  void SetFloatingValues(bool value);
202 
203  protected:
208 
213 
218 
223 
228 
233 
238 
243  bool m_Fixed;
244 
260  inline void EnsureConsistency();
261  };
262 } // namespace mitk
263 #endif
mitk::LevelWindow::m_IsFloatingImage
bool m_IsFloatingImage
Definition: mitkLevelWindow.h:237
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::LevelWindow::m_RangeMax
ScalarType m_RangeMax
Definition: mitkLevelWindow.h:222
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::operator!=
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
mitk::LevelWindow
The LevelWindow class Class to store level/window values.
Definition: mitkLevelWindow.h:44
mitk::LevelWindow::m_Fixed
bool m_Fixed
Definition: mitkLevelWindow.h:243
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
MitkCoreExports.h
mitkNumericTypes.h
mitk::LevelWindow::m_UpperWindowBound
ScalarType m_UpperWindowBound
Definition: mitkLevelWindow.h:212
mitk::LevelWindow::m_DefaultUpperBound
ScalarType m_DefaultUpperBound
Definition: mitkLevelWindow.h:232
itk::Image
class ITK_EXPORT Image
Definition: mitkGeometryClipImageFilter.h:25
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::LevelWindow::m_RangeMin
ScalarType m_RangeMin
Definition: mitkLevelWindow.h:217
mitk::LevelWindow::m_DefaultLowerBound
ScalarType m_DefaultLowerBound
Definition: mitkLevelWindow.h:227
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::LevelWindow::m_LowerWindowBound
ScalarType m_LowerWindowBound
Definition: mitkLevelWindow.h:207