MeVisLab Toolbox Reference
mlLUTFPrimitive.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_LUTFPRIMITIVE_H
14#define ML_LUTFPRIMITIVE_H
15
16
18
19#include "mlLUTSystem.h"
20#include "mlLUTFunction.h"
21
22
23
25
26
29{
30public:
31
33 typedef enum {
34 Ramp = 0,
38
39 numShapes
40 } ShapeType;
41
43 static const char *shapeNames[numShapes];
44
45
48
49
52
54 virtual ShapeType getShape (void) const { return _shape; }
55
57 virtual void setShape (ShapeType shape) { _shape = shape; changed(); }
58
60 virtual double getCenter (void) const { return _center; }
61
63 virtual void setCenter (double center) { _center = center; changed(); }
64
66 virtual double getWidth (void) const { return _width; }
67
69 virtual void setWidth (double width) { _width = width; changed(); }
70
72 virtual double getEdgeWidth (void) const { return _edgeWidth; }
73
75 virtual void setEdgeWidth (double edgeWidth) { _edgeWidth = edgeWidth; changed(); }
76
78 virtual double getBaseValue (void) const { return _baseValue; }
79
81 virtual void setBaseValue (double baseValue) { _baseValue = baseValue; changed(); }
82
84 virtual double getPeakValue (void) const { return _peakValue; }
85
87 virtual void setPeakValue (double peakValue) { _peakValue = peakValue; changed(); }
88
90
91
94
96 double getNativeMinIndex (void) const override;
97
99 double getNativeMaxIndex (void) const override;
100
102
103
104protected:
105
108
114
122 double minIndex, double maxIndex) const override;
123
127 template <typename T>
129 double width, double edgeWidth) const;
130
132
133
136
138 double _center;
139
141 double _width;
142
145
148
151
152
153
155
156};
157
158
160
161
162#endif
163// __mlLUTFPrimitive_H
Untyped base class for LUTData template classes.
Definition mlLUTData.h:64
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Definition mlLUTData.h:243
A single channel LUT with predefined primitives of different shapes.
LUTFPrimitive(void)
Constructor.
double _peakValue
Center LUT output level, relative to [0,1].
virtual void setPeakValue(double peakValue)
Set peak value.
virtual void setShape(ShapeType shape)
Set shape.
virtual void setEdgeWidth(double edgeWidth)
Set edge width.
double getNativeMaxIndex(void) const override
Get native maximum index.
virtual void setBaseValue(double baseValue)
Set base value.
virtual void setWidth(double width)
Set ramp width.
ML_CLASS_HEADER(LUTFPrimitive)
ShapeType _shape
Function Type.
virtual double getEdgeWidth(void) const
Get edge width.
double _center
Ramp center.
double getNativeMinIndex(void) const override
Get native minimum index.
bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
Render the lookup table into lutData using lutIterator to access and increment the LUT pointers.
virtual double getWidth(void) const
Get ramp width.
ShapeType
Shape constants.
@ Gauss
Gaussian shape.
@ Sigmoid
Sigmoid shape.
@ Wall
Double ramp.
virtual double getBaseValue(void) const
Get base value.
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.
virtual ShapeType getShape(void) const
Get shape.
virtual double getCenter(void) const
Get ramp center.
virtual double getPeakValue(void) const
Get peak value.
double _edgeWidth
Edge width (used for Wall shape only)
double _width
Ramp width.
bool renderLUT(LUTData< T > *lutData, LUTIterator< T > *lutIterator, double center, double width, double edgeWidth) const
Render a LUT primitive (as selected by the _shape member variable) into lutData using lutIterator to ...
double _baseValue
Base LUT output level, relative to [0,1].
virtual void setCenter(double center)
Set ramp center.
Common base class for lookup tables.
void changed(void)
Assign a new LUT ID.
LUT iterator base class with type independent functionality and declarations.
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
Target mlrange_cast(Source arg)
Generic version of checked ML casts.