MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
24
25
28{
29public:
31 typedef enum {
32 Ramp = 0,
36
37 numShapes
38 } ShapeType;
39
41 static const char* shapeNames[numShapes];
42
43
46
47
50
52 virtual ShapeType getShape(void) const
53 {
54 return _shape;
55 }
56
58 virtual void setShape(ShapeType shape)
59 {
60 _shape = shape;
61 changed();
62 }
63
65 virtual double getCenter(void) const
66 {
67 return _center;
68 }
69
71 virtual void setCenter(double center)
72 {
73 _center = center;
74 changed();
75 }
76
78 virtual double getWidth(void) const
79 {
80 return _width;
81 }
82
84 virtual void setWidth(double width)
85 {
86 _width = width;
87 changed();
88 }
89
91 virtual double getEdgeWidth(void) const
92 {
93 return _edgeWidth;
94 }
95
97 virtual void setEdgeWidth(double edgeWidth)
98 {
99 _edgeWidth = edgeWidth;
100 changed();
101 }
102
104 virtual double getBaseValue(void) const
105 {
106 return _baseValue;
107 }
108
110 virtual void setBaseValue(double baseValue)
111 {
112 _baseValue = baseValue;
113 changed();
114 }
115
117 virtual double getPeakValue(void) const
118 {
119 return _peakValue;
120 }
121
123 virtual void setPeakValue(double peakValue)
124 {
125 _peakValue = peakValue;
126 changed();
127 }
128
130
131
134
136 double getNativeMinIndex(void) const override;
137
139 double getNativeMaxIndex(void) const override;
140
142
143
144protected:
147
153
161 double maxIndex) const override;
162
166 template <typename T>
167 bool renderLUT(LUTData<T>* lutData, LUTIterator<T>* lutIterator, double center, double width, double edgeWidth) const;
168
170
171
174
176 double _center;
177
179 double _width;
180
183
186
189
190
192};
193
194
196
197
198#endif
199// __mlLUTFPrimitive_H
Untyped base class for LUTData template classes.
Definition mlLUTData.h:65
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Definition mlLUTData.h:308
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.