MeVisLab Toolbox Reference
SoView2DVoxelView.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
15
16#pragma once
17
18#include "SoView2DSystem.h"
19#include "SoView2DExtension.h"
20#include "SoView2D.h"
21
22#include <Inventor/fields/SoFields.h>
23#include "mlLUTData.h"
24#include "SoSFMLBase.h"
25#include "SoSFMLImage.h"
26
27// Forward declaration.
28class View2DFont;
29
30//----------------------------------------------------------------------------------
32//----------------------------------------------------------------------------------
34{
38 SO_NODE_HEADER(SoView2DVoxelView);
39
40public:
41
46 static void initClass(void);
47
50
55 void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override;
56
57
62
66 SoSFString defaultFitString;
67
70
73
76 SoSFBool useCommas;
77
79 SoSFBool outLineVoxels;
80
84 SoSFBool useLut;
85
87 SoSFFloat defaultAlpha;
88
90 SoSFFloat fontSize;
91
94
98
104
109
110
111protected:
112
130 virtual void _drawCellInformation(View2DSliceList * /*dsl */,
131 View2DSlice * /*dslice */,
132 int /*slice */,
133 bool /*drawTexts */,
134 int /*numRowComps*/,
135 const MLTypeInfos & /*dtInfo */,
136 MLDataType /*dType */,
137 MLTypeData * /*vBuf1 */,
138 int /*numDTComps */,
139 GLfloat /*rgba */[4],
140 float /*xPos */,
141 float /*yPos */,
142 View2DFont & /*font */,
143 float /*fSize */) { }
144
146 ML_NAMESPACE::LUTData<MLfloat> _lutData;
147
150 void _getGLColor(double dblVoxVal, GLfloat rgba[4]);
151
159 float _drawVoxelValue(bool drawTexts,
160 int numRowComps,
161 MLDataType dType,
162 MLTypeData *vBuf1,
163 int numDTComponents,
164 GLfloat rgba[4],
165 float xPos,
166 float yPos,
167 View2DFont &font,
168 float fSize);
169
178 float _drawStringVoxelValue(bool drawTexts,
179 MLDataType dType,
180 MLTypeData *vBuf1,
181 int numDTComponents,
182 GLfloat rgba[4],
183 float xPos,
184 float yPos,
185 View2DFont &font,
186 float fSize);
187
192 void _drawCoordinateComponents(bool drawTexts,
193 int numComps,
194 XVImageSize &pos,
195 GLfloat rgba[4],
196 float xPos,
197 float yPos,
198 View2DFont &font,
199 float fSize);
200
206
207private:
209 bool _lutIsValid;
210
212 double _lutShift;
213
215 double _lutScale;
216};
View2DLutPrecision
allows to set the precision of the LUT
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoView2DExtension()
Constructor.
virtual void _drawCellInformation(View2DSliceList *, View2DSlice *, int, bool, int, const MLTypeInfos &, MLDataType, MLTypeData *, int, GLfloat[4], float, float, View2DFont &, float)
SoSFFloat defaultAlpha
Transparency from [0,1] used if no LUT is used; default is 0.5 (half transparent).
SoView2DVoxelView(void)
Creates a detail viewer for voxels.
void _getGLColor(double dblVoxVal, GLfloat rgba[4])
SoSFFloat fontSize
Size of font for voxel value; default is 10, minimum is 6, maximum is 250.
void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) override
void _updateLutData(SoSFMLImage &inImg, View2DLutPrecision precision)
SoSFString defaultFitString
float _drawStringVoxelValue(bool drawTexts, MLDataType dType, MLTypeData *vBuf1, int numDTComponents, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
static void initClass(void)
SoSFBool outLineVoxels
If enabled then on voxel the border pixels are drawn; default is FALSE.
SoSFBool drawCornerDots
If enabled dots are drawn in all corners of each voxel; default is false.
ml::LUTData< MLfloat > _lutData
Data table for voxel value look up.
float _drawVoxelValue(bool drawTexts, int numRowComps, MLDataType dType, MLTypeData *vBuf1, int numDTComponents, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
void _drawCoordinateComponents(bool drawTexts, int numComps, XVImageSize &pos, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
SoSFInt32 numCoordinateComponents
The number of coordinate components to be shown; default is 0.
SoSFBool drawCenterDots
If enabled a pixel is drawn in the center of each voxel; default is false.
Abstract GL font drawing using FTGL.
Definition View2DFont.h:30
a list that holds all View2DSlice objects (lazily created) of a SoView2D
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
Definition View2DSlice.h:48
SoSFMLImage - field interface to ML images and related classes.
Definition SoSFMLImage.h:32
MLint32 MLDataType
Definition mlTypeDefs.h:595
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.