MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlLUTFRescale.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_LUTFRESCALE_H
14#define ML_LUTFRESCALE_H
15
16
19
20#include "mlLUTSystem.h"
21#include "mlLUTFunction.h"
22
23
25
26
30{
31public:
34
35
37 virtual void setInputLUT(const LUTFunction* inLUT);
38
39
42
45 void setRelative(bool relative) override;
46
48 virtual bool getAutoSourceRange(void) const
49 {
50 return _autoSourceRange;
51 }
52
55 {
56 _autoSourceRange = autoSourceRange;
57 changed();
58 }
59
61 virtual double getSourceMin(void) const;
62
64 virtual double getSourceMax(void) const;
65
67 virtual void setSourceRange(double sourceMin, double sourceMax);
68
70 virtual double getTargetMin(void) const
71 {
72 return _targetMin;
73 }
74
76 virtual double getTargetMax(void) const
77 {
78 return _targetMax;
79 }
80
82 virtual void setTargetRange(double targetMin, double targetMax);
83
85
86
89
91 bool isValid(void) const override;
92
94 LUTVisualType getVisualType(void) const override;
95
97 double getNativeMinIndex(void) const override;
98
100 double getNativeMaxIndex(void) const override;
101
103 int getHeight(void) const override;
104
106 int getDepth(void) const override;
107
109 double getNativeMinValue(void) const override;
110
112 double getNativeMaxValue(void) const override;
113
115
116
117protected:
120
122 virtual double transformForward(double index) const;
123
125 virtual double transformInverse(double index) const;
126
128
131
137
145 double maxIndex) const override;
146
148
149
152
155
157 double _sourceMin, _sourceMax;
158
160 double _targetMin, _targetMax;
161
162
164};
165
166
168
169#endif
170// __mlLUTFRescale_H
Untyped base class for LUTData template classes.
Definition mlLUTData.h:65
LUT transform to rescale a LUT's index range and to convert an absolute to a relative LUT.
double getNativeMaxIndex(void) const override
Get native maximum index.
int getHeight(void) const override
Get native LUT height (= number of rows, numbering starts at 0)
const LUTFunction * _inLUT
Input LUT.
bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.
virtual void setSourceRange(double sourceMin, double sourceMax)
Set source index range.
virtual void setAutoSourceRange(bool autoSourceRange)
Set auto source index range flag.
virtual bool getAutoSourceRange(void) const
Get auto source index range flag.
LUTVisualType getVisualType(void) const override
Get LUT visual type.
int getDepth(void) const override
Get native LUT depth (= number of layers, numbering starts at 0)
LUTFRescale(void)
Constructor.
void setRelative(bool relative) override
Set/reset relative flag, can only be set if input LUT is absolute.
virtual double transformInverse(double index) const
Apply inverse rescaling to index.
virtual double getTargetMin(void) const
Get minimum target index.
virtual double getSourceMax(void) const
Get maximum source index.
double getNativeMinValue(void) const override
Get native minimum LUT value.
double getNativeMinIndex(void) const override
Get native minimum index.
virtual void setInputLUT(const LUTFunction *inLUT)
Set input LUT, set relative flag to true if input LUT is relative.
bool renderLUTRescaled(LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override
Render rescaled LUT into lutData using lutIterator to access and increment the LUT pointers.
double getNativeMaxValue(void) const override
Get native maximum LUT value.
bool _autoSourceRange
Source index range is determined from input LUT.
bool isValid(void) const override
Return true if the LUT function is valid.
virtual double transformForward(double index) const
Apply rescaling to index.
ML_CLASS_HEADER(LUTFRescale)
virtual void setTargetRange(double targetMin, double targetMax)
Set target index range.
virtual double getSourceMin(void) const
Get minimum source index.
virtual double getTargetMax(void) const
Get maximum target index.
Common base class for lookup tables.
void changed(void)
Assign a new LUT ID.
LUT iterator base class with type independent functionality and declarations.
#define MLLUT_EXPORT
System specific macro definitions.
Definition mlLUTSystem.h:25
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.
Definition mlLUTBasic.h:30