MeVisLab Toolbox Reference
mlLUTFCompose.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_LUTFCOMPOSE_H
14 #define ML_LUTFCOMPOSE_H
15 
16 
19 
20 #include "mlLUTSystem.h"
21 #include "mlLUTFunction.h"
22 
23 
24 
25 ML_START_NAMESPACE
26 
27 
30 {
31 public:
32 
34  LUTFCompose (void);
35 
36 
39 
41  bool isValid (void) const override;
42 
44  double getNativeMinIndex (void) const override;
45 
47  double getNativeMaxIndex (void) const override;
48 
50  int getHeight (void) const override;
51 
53  int getDepth (void) const override;
54 
56  double getNativeMinValue (void) const override;
57 
59  double getNativeMaxValue (void) const override;
60 
62 
63 
66 
68  void clear (void);
69 
71  void addInputLUT (const LUTFunction &inputLUT);
72 
74  unsigned int getNumInputLUTs (void) const;
75 
77  const LUTFunction *getInputLUT (unsigned int i) const;
78 
80  void setResolution (unsigned int resolution) { _resolution = resolution; changed(); }
81 
83  unsigned int getResolution (void) const { return _resolution; }
84 
86  static unsigned int defaultResolution; // = 4096
87 
89 
90 
94 
99  bool render (LUTDataBase *lutData) const override;
100 
107  bool renderRescaled (LUTDataBase *lutData, double minIndex, double maxIndex) const override;
108 
110 
111 
112 protected:
113 
116 
122  LUTVisualType getRenderType (LUTDataBase *lutData) const override { return lutData->getVisualType(); }
123 
128  bool renderLUTNative (LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override;
129 
136  bool renderLUTRescaled (LUTDataBase *lutData, LUTIteratorBase *lutIterator,
137  double minIndex, double maxIndex) const override;
138 
141  template <typename T>
142  bool renderLUT (LUTData<T> *lutData, LUTIterator<T> *lutIterator, double minIndex, double maxIndex,
143  bool rescale) const;
144 
146  unsigned int getInputLUTWidth (unsigned int index) const;
147 
149 
150 
152  std::vector<const LUTFunction*> _inputLUTs;
153 
155  unsigned int _resolution;
156 
157 
159 
160 };
161 
162 
163 ML_END_NAMESPACE
164 
165 
166 #endif
167 // __mlLUTFCompose_H
Untyped base class for LUTData template classes.
Definition: mlLUTData.h:64
LUTVisualType getVisualType(void) const
Get visual type.
Definition: mlLUTData.h:110
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Definition: mlLUTData.h:243
A LUT function composing several input LUTs into a single output LUT.
Definition: mlLUTFCompose.h:30
double getNativeMinValue(void) const override
Get native minimum LUT value.
int getHeight(void) const override
Get native LUT height (= number of rows, numbering starts at 0)
int getDepth(void) const override
Get native LUT depth (= number of layers, numbering starts at 0)
static unsigned int defaultResolution
Default value for the intermediate resolution.
Definition: mlLUTFCompose.h:86
double getNativeMaxIndex(void) const override
Get native maximum index.
bool renderRescaled(LUTDataBase *lutData, double minIndex, double maxIndex) const override
Render rescaled LUT in (previously initialized) LUTData object.
double getNativeMaxValue(void) const override
Get native maximum LUT value.
bool isValid(void) const override
Return true if the LUT function is valid.
void clear(void)
Clear list of input LUTs.
LUTVisualType getRenderType(LUTDataBase *lutData) const override
Get visual type used for rendering.
ML_CLASS_HEADER(LUTFCompose)
unsigned int getResolution(void) const
Get intermediate resolution.
Definition: mlLUTFCompose.h:83
unsigned int getNumInputLUTs(void) const
Get number of input LUTs.
double getNativeMinIndex(void) const override
Get native minimum index.
unsigned int _resolution
Intermediate resolution.
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.
bool render(LUTDataBase *lutData) const override
Render LUT in (previously initialized) LUTData object.
unsigned int getInputLUTWidth(unsigned int index) const
Get the width of the index range for which the specified input LUT needs to be rendered.
bool renderLUT(LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex, bool rescale) const
Render the output LUT into lutData using lutIterator to access and increment the LUT pointers.
void setResolution(unsigned int resolution)
Set intermediate resolution (if not obtained from input LUT)
Definition: mlLUTFCompose.h:80
void addInputLUT(const LUTFunction &inputLUT)
Add an input LUT.
std::vector< const LUTFunction * > _inputLUTs
List of input LUTs.
LUTFCompose(void)
Constructor.
bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.
const LUTFunction * getInputLUT(unsigned int i) const
Get pointer to i-th input LUT (or NULL if out of range)
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
The LUTIterator class template is used by a LUTFunction object for rendering into a LUTData object.
#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