Medical Imaging Interaction Toolkit  2024.06.00
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 (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 #include <nlohmann/json_fwd.hpp>
18 
19 namespace mitk
20 {
21  class Image;
22 
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 
266 
267 } // namespace mitk
268 #endif
mitk::to_json
void to_json(nlohmann::json &j, const GenericLookupTable< T > &t)
Definition: mitkGenericLookupTable.h:98
mitk::LevelWindow::m_IsFloatingImage
bool m_IsFloatingImage
Definition: mitkLevelWindow.h:238
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::LevelWindow::m_RangeMax
ScalarType m_RangeMax
Definition: mitkLevelWindow.h:223
mitk::from_json
void from_json(const nlohmann::json &, GenericLookupTable< T > &)
Definition: mitkGenericLookupTable.h:104
mitk
Find image slices visible on a given plane.
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:45
mitk::LevelWindow::m_Fixed
bool m_Fixed
Definition: mitkLevelWindow.h:244
json
nlohmann::json json
Definition: mitkModelTestFixture.h:29
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:213
mitk::LevelWindow::m_DefaultUpperBound
ScalarType m_DefaultUpperBound
Definition: mitkLevelWindow.h:233
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:218
mitk::LevelWindow::m_DefaultLowerBound
ScalarType m_DefaultLowerBound
Definition: mitkLevelWindow.h:228
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::LevelWindow::m_LowerWindowBound
ScalarType m_LowerWindowBound
Definition: mitkLevelWindow.h:208