MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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:
45 static void initClass(void);
46
49
54 void draw(View2DSliceList* dsl, View2DSlice* dslice, int slice) override;
55
56
61
66
69
72
76
79
84
87
90
93
97
103
108
109
110protected:
128 virtual void _drawCellInformation(View2DSliceList* /*dsl */, View2DSlice* /*dslice */, int /*slice */,
129 bool /*drawTexts */, int /*numRowComps*/, const MLTypeInfos& /*dtInfo */,
130 MLDataType /*dType */, MLTypeData* /*vBuf1 */, int /*numDTComps */,
131 GLfloat /*rgba */[4], float /*xPos */, float /*yPos */,
132 View2DFont& /*font */, float /*fSize */)
133 {}
134
136 ML_NAMESPACE::LUTData<MLfloat> _lutData;
137
141
150 GLfloat rgba[4], float xPos, float yPos, View2DFont& font, float fSize);
151
161 float xPos, float yPos, View2DFont& font, float fSize);
162
168 float yPos, View2DFont& font, float fSize);
169
175
176private:
178 bool _lutIsValid;
179
181 double _lutShift;
182
184 double _lutScale;
185};
View2DLutPrecision
allows to set the precision of the LUT
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
The SoSFMLBase field is the interface used by Inventor nodes to output ML Base objects to the outside...
Definition SoSFMLBase.h:46
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
Definition SoSFMLImage.h:84
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
SoView2DExtension for detailed voxel viewing.
SoSFBool useLut
If enabled a connected look up table will be used to draw everything in the "looked up" values of the...
virtual void _drawCellInformation(View2DSliceList *, View2DSlice *, int, bool, int, const MLTypeInfos &, MLDataType, MLTypeData *, int, GLfloat[4], float, float, View2DFont &, float)
User defined function to draw additional stuff in derived classes.
SoSFInt32 numPrecisionDigits
The maximum number of digits after "." in floating point numbers; default is 1.
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])
Set correct color value in rgba dependent on the current settings and the voxel value dblVoxVal.
SoSFBool useCommas
If enabled then all spaces in multicomponent voxel values are replaced by commas for better readabili...
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
Virtual method called by the SoView2D node.
void _updateLutData(SoSFMLImage &inImg, View2DLutPrecision precision)
Update the look up table according to the image data.
SoSFString defaultFitString
String which should fit into a voxel to be shown, that means if it does not fit no voxel values are s...
float _drawStringVoxelValue(bool drawTexts, MLDataType dType, MLTypeData *vBuf1, int numDTComponents, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
Still incomplete and unused.
static void initClass(void)
Initialization function of this class.
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.
SoSFInt32 numRowComponents
The number of coordinate components to be shown in one row; 0 means automatic row size,...
float _drawVoxelValue(bool drawTexts, int numRowComps, MLDataType dType, MLTypeData *vBuf1, int numDTComponents, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
If drawTexts is true, the default string fits into a voxel then draw the voxel value from voxel data ...
SoSFMLBase inputLut
Optional node input for an optional lookup table node which controls color mapping of drawn stuff.
void _drawCoordinateComponents(bool drawTexts, int numComps, XVImageSize &pos, GLfloat rgba[4], float xPos, float yPos, View2DFont &font, float fSize)
If drawTexts is true then draw numComps coordinate components of position pos with the color rgba at ...
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
MLDataType.
Definition mlTypeDefs.h:592
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
unsigned char MLTypeData
This is the pointer type used to point to the data of MLType data instances.
Structure containing all data type features and pointers to all functions needed to implement operati...