Medical Imaging Interaction Toolkit  2018.4.99-65942676
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 LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
13 #define LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
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 /* LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C */
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
ScalarType m_DefaultLowerBound
#define MITKCORE_EXPORT
double ScalarType
ScalarType m_DefaultUpperBound
DataCollection - Class to facilitate loading/accessing structured data.
The LevelWindow class Class to store level/window values.
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
class ITK_EXPORT Image
Image class for storing images.
Definition: mitkImage.h:72
ScalarType m_UpperWindowBound
ScalarType m_LowerWindowBound