MeVisLab Toolbox Reference
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 
24 
25 ML_START_NAMESPACE
26 
27 
31 {
32 public:
33 
35  LUTFRescale (void);
36 
37 
39  virtual void setInputLUT (const LUTFunction *inLUT);
40 
41 
44 
47  void setRelative (bool relative) override;
48 
50  virtual bool getAutoSourceRange (void) const { return _autoSourceRange; }
51 
53  virtual void setAutoSourceRange (bool autoSourceRange) { _autoSourceRange = autoSourceRange; changed(); }
54 
56  virtual double getSourceMin (void) const;
57 
59  virtual double getSourceMax (void) const;
60 
62  virtual void setSourceRange (double sourceMin, double sourceMax);
63 
65  virtual double getTargetMin (void) const { return _targetMin; }
66 
68  virtual double getTargetMax (void) const { return _targetMax; }
69 
71  virtual void setTargetRange (double targetMin, double targetMax);
72 
74 
75 
78 
80  bool isValid (void) const override;
81 
83  LUTVisualType getVisualType (void) const override;
84 
86  double getNativeMinIndex (void) const override;
87 
89  double getNativeMaxIndex (void) const override;
90 
92  int getHeight (void) const override;
93 
95  int getDepth (void) const override;
96 
98  double getNativeMinValue (void) const override;
99 
101  double getNativeMaxValue (void) const override;
102 
104 
105 
106 protected:
107 
110 
112  virtual double transformForward (double index) const;
113 
115  virtual double transformInverse (double index) const;
116 
118 
121 
126  bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override;
127 
134  bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator,
135  double minIndex, double maxIndex) const override;
136 
138 
139 
142 
145 
147  double _sourceMin, _sourceMax;
148 
150  double _targetMin, _targetMax;
151 
152 
154 
155 };
156 
157 
158 ML_END_NAMESPACE
159 
160 #endif
161 // __mlLUTFRescale_H
Untyped base class for LUTData template classes.
Definition: mlLUTData.h:64
LUT transform to rescale a LUT's index range and to convert an absolute to a relative LUT.
Definition: mlLUTFRescale.h:31
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.
Definition: mlLUTFRescale.h:53
virtual bool getAutoSourceRange(void) const
Get auto source index range flag.
Definition: mlLUTFRescale.h:50
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.
Definition: mlLUTFRescale.h:65
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.
Definition: mlLUTFRescale.h:68
Common base class for lookup tables.
Definition: mlLUTFunction.h:55
void changed(void)
Assign a new LUT ID.
LUT iterator base class with type independent functionality and declarations.
Definition: mlLUTIterator.h:30
#define MLLUT_EXPORT
System specific macro definitions.
Definition: mlLUTSystem.h:25
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.
Definition: mlLUTBasic.h:30