MeVisLab Toolbox Reference
SoView2DVoxelValue.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 
19 
20 #include <Inventor/fields/SoSFInt32.h>
21 #include <Inventor/fields/SoSFVec3f.h>
22 #include <Inventor/fields/SoSFString.h>
23 
26 {
27  SO_NODE_HEADER(SoView2DVoxelValue);
28 
29 public:
31  SoSFBool valuesValid;
32 
34  SoSFVec3f voxelPosition;
36  SoSFVec3f worldPosition;
38  SoSFVec3f integerPosition;
40  SoSFString viewerId;
41 
43  SoSFFloat storedValue;
45  SoSFFloat outputValue;
47  SoSFString modality;
48 
52 
55 
58 
60  SoSFInt32 maxPrecision;
61  SoSFString storedValueString;
62  SoSFString outputValueString;
64 
66  static void initClass();
67 
70 
72  bool evalEvent(SoView2D* view2d, View2DSliceList* slicelist,
73  View2DEvent* ec, View2DEventPhase phase) override;
74 
75 protected:
77  void updateVoxelPosition(const SbVec3f& voxelPos, SoView2D* view2d, View2DSliceList* slicelist);
78 
79  void setValuesValid(bool valid);
82 
85  void startPressAt(const SoPointerPosition& pos) override;
86  void dragMoveTo(const SoPointerPosition& pos) override;
88 
90  void editingOnChanged(SoField* field) override;
91 
93  void pointerPosition(const SoPointerPosition& pos) override;
94  void pointerLeftWindow() override;
95 
96 private:
98  int _timePoint;
100  unsigned int _imageSerialNumber;
101 };
View2DEventPhase
event phase for simple extensions that grab the focus, do something (motion) and are released afterwa...
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoPointerPosition manages the current position of the mouse cursor.
SoView2DInteractionExtension is base class for all SoView2DExtensions that want to support the Manage...
Reads the voxel value at the mouse position on a SoView2D.
SoSFInt32 maxPrecision
Pixel value as string to support registered/composed ML data types and their precision.
SoSFVec3f worldPosition
the current world position
void setValuesValid(bool valid)
void updateVoxelPosition(const SbVec3f &voxelPos, SoView2D *view2d, View2DSliceList *slicelist)
update voxelPosition
SoSFFloat storedValue
the real value that is stored in the image
SoView2DVoxelValue()
Constructor.
SoSFString modality
modality of the image (so that the correct units can be displayed)
SoSFBool valuesValid
this is set to false if the mouse position is not on the image
SoSFFloat outputValue
the medical adjusted image value
static void initClass()
inventor runtime type system
void invalidateUndefinedOutputValuesChanged(SoField *f)
void pointerLeftWindow() override
This is called when the mouse cursor leaves the window.
SoSFString viewerId
viewerId of the viewer where the mouse was on
void startPressAt(const SoPointerPosition &pos) override
interface forwarded from SoPointingAction:
SoSFBool showColorChannelValues
If true then color channel values are displayed, separated by channelSep, otherwise only the value of...
SoSFString storedValueString
SoSFString outputValueString
void editingOnChanged(SoField *field) override
called when editingOn field is touched:
SoSFString colorChannelSeparator
String value placed as separator between color channel values in storedValueString.
SoSFBool invalidateUndefinedOutputValues
If set, output fields are set to empty string/NaN if valuesUpToDate is False.
SoSFVec3f voxelPosition
the current voxel position
void pointerPosition(const SoPointerPosition &pos) override
interface inherited from SoInteractionProvider
void dragMoveTo(const SoPointerPosition &pos) override
bool evalEvent(SoView2D *view2d, View2DSliceList *slicelist, View2DEvent *ec, View2DEventPhase phase) override
reimplemented from SoView2DExtension
SoSFVec3f integerPosition
the current voxel position rounded to integer
SoView2D is a 2D viewer for image data.
Definition: SoView2D.h:62
View2DEvent stores all information on an event on a SoView2D.
a list that holds all View2DSlice objects (lazily created) of a SoView2D