Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
00020 #define LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
00021
00022 #include "mitkVector.h"
00023 #include "mitkCommon.h"
00024
00025 struct mitkIpPicDescriptor;
00026
00027 namespace mitk {
00028
00029 class Image;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 class MITK_CORE_EXPORT LevelWindow
00045 {
00046 public:
00047 LevelWindow(ScalarType level=127.5, ScalarType window=255.0);
00048 LevelWindow(const mitk::LevelWindow& levWin);
00049 virtual ~LevelWindow();
00050
00055 ScalarType GetLevel() const;
00056
00060 ScalarType GetWindow() const;
00061
00065 ScalarType GetDefaultLevel() const;
00066
00070 ScalarType GetDefaultWindow() const;
00071
00075 void ResetDefaultLevelWindow();
00076
00080 ScalarType GetLowerWindowBound() const;
00081
00085 ScalarType GetUpperWindowBound() const;
00086
00090 void SetLevelWindow(ScalarType level, ScalarType window);
00091
00095 void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound);
00096
00100 void SetToMaxWindowSize();
00101
00105 void SetRangeMinMax(ScalarType min, ScalarType max);
00106
00110 ScalarType GetRangeMin() const;
00111
00115 ScalarType GetRangeMax() const;
00116
00120 ScalarType GetDefaultLowerBound() const;
00121
00125 ScalarType GetDefaultUpperBound() const;
00126
00130 void ResetDefaultRangeMinMax();
00131
00135 ScalarType GetRange() const;
00136
00140 void SetDefaultLevelWindow(ScalarType level, ScalarType window);
00141
00145 void SetDefaultBoundaries(ScalarType low, ScalarType up);
00146
00150 void SetAuto(const mitk::Image* image, bool tryPicTags = true, bool guessByCentralSlice = true);
00151
00157 void SetFixed( bool fixed );
00158
00162 bool GetFixed() const;
00163
00167 bool IsFixed() const;
00168
00172 virtual bool operator==(const LevelWindow& levWin) const;
00173
00177 virtual bool operator!=(const LevelWindow& levWin) const;
00178
00183 virtual LevelWindow& operator=(const LevelWindow& levWin);
00184
00185 protected:
00186
00191 bool SetAutoByPicTags(const mitkIpPicDescriptor* pic);
00192
00196 ScalarType m_LowerWindowBound;
00197
00201 ScalarType m_UpperWindowBound;
00202
00206 ScalarType m_RangeMin;
00207
00211 ScalarType m_RangeMax;
00212
00216 ScalarType m_DefaultLowerBound;
00217
00221 ScalarType m_DefaultUpperBound;
00222
00223
00228 bool m_Fixed;
00229
00230
00241 inline void EnsureConsistency();
00242
00243 };
00244
00245 }
00246 #endif