MeVisLab Toolbox Reference
SoCSOImageStatistics.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2012, 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 #include <set>
20 
21 ML_START_NAMESPACE
22 class BaseEvent;
23 ML_END_NAMESPACE
24 
26 
29 {
30  SO_NODE_HEADER(SoCSOImageStatistics);
31 
32 public:
33 
36 
38  SoSFInt32 currentCSOId;
40  SoSFInt32 numVoxels;
42  SoSFFloat imageMinValue;
44  SoSFFloat imageMaxValue;
46  SoSFFloat imageMeanValue;
48  SoSFFloat imageAbsMeanValue;
50  SoSFFloat imageVarianceValue;
56  SoSFFloat imageSumValue;
58  SoSFString imageModality;
62  SoSFFloat imageRescaleSlope;
64  SoSFBool imageValuesValid;
69  SoSFString viewerId;
71  SoSFTrigger markAllCSOsForUpdate;
74 
76  void draw(const CSODrawCSOInfos& csoInfos, const CSODrawView2DInfos& view2DInfos, const CSODrawSliceInformation& drawSliceInfo, SoView2DCSOExtensibleEditor* editor) override;
77 
79  static void initClass();
80 
81  void createStartPressAt(const SoPointerPosition& ) override {}
82  void createDragMoveTo(const SoPointerPosition& ) override {}
83  bool createEndPress(int ) override { return false; }
85 
86  void selectAndMoveStartPressAt(const SoPointerPosition& ) override {}
87  void selectAndMoveDragMoveTo(const SoPointerPosition& ) override {}
88  SoPointingAction* selectAndMoveEndPress(int ) override { return nullptr; }
89 
90  int cursorShape() const override { return SoViewerProxy::DEFAULT_CURSOR; }
91 
92  bool shouldRenderGeneral(ml::CSO*) const override { return true; }
93 
94 protected:
95 
97 
98 private:
99 
100  void _inputImageCB(SoField*);
101 
102  void _markAllCSOsForUpdatePressedCB(SoField*);
103  bool _allCSOsNeedUpdate;
104 
108  SoSFMLImage* getInputImage(View2DSlice* slice);
110  bool haveSameSize(const XVImageSize& size1, const XVImageSize& size2) const;
112  bool haveSameWorldToVoxelMatrix(SoSFMLImage* image1, SoSFMLImage* image2) const;
114  void setAllCSOsNeedUpdate(ml::CSOList* csoList);
115 
117  static void baseEventCB(void* userData, ml::BaseEvent* event);
120  bool needsUpdate(ml::CSO* cso);
123  void attachAsListenerTo(ml::CSOList* csoList);
125  ml::CSOListPtr _listenToCSOList;
127  std::set<int> _needsUpdateCSOIds;
128 };
129 
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition: SoCSOSystem.h:21
Base class for an editor extension for the SoView2DCSOExtensibleEditor.
Extension for gathering voxel information inside CSOs on the current slice.
SoSFFloat imageSumValue
The sum of the image values inside the current CSO.
void draw(const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, SoView2DCSOExtensibleEditor *editor) override
Drawing routine.
SoSFString viewerId
Optional viewer id, this string is concatenated to the user data name for each statistics value,...
SoSFFloat imageRescaleIntercept
The image value rescale intercept as read out from DICOM tag (0028,1052).
~SoCSOImageStatistics() override
bool shouldRenderGeneral(ml::CSO *) const override
Returns whether a given CSO should be rendered by this general extension.
SoSFFloat imageVarianceValue
The image value variance inside the current CSO.
SoSFFloat imageAbsMeanValue
The image mean of absolute values inside the current CSO.
void selectAndMoveStartPressAt(const SoPointerPosition &) override
void createDragMoveTo(const SoPointerPosition &) override
SoSFBool imageValuesValid
Shows whether the image value fields are valid.
static void initClass()
init class in inventor runtime
SoSFMLImage inputImage
Input image field.
void createStartPressAt(const SoPointerPosition &) override
bool createEndPress(int) override
SoSFFloat imageAverageSquaredSumValue
The average of the sum of squared image values inside the current CSO.
SoSFInt32 numVoxels
The number of voxels inside the current CSO.
SoSFFloat imageStdDeviationValue
The image value standard deviation inside the current CSO.
SoSFFloat imageMeanValue
The image mean value inside the current CSO.
SoSFInt32 currentCSOId
Shows the id of the current CSO.
SoSFFloat imageMinValue
The image min value inside the current CSO.
void selectAndMoveDragMoveTo(const SoPointerPosition &) override
int cursorShape() const override
Returns the cursor shape that indicates the next creation.
SoCSOImageStatistics()
Standard constructor.
SoSFTrigger markAllCSOsForUpdate
If pressed, all CSO are being processed at the next draw() call.
SoSFString imageModality
The image's modality string as read out from DICOM tag (0008,0060).
SoSFFloat imageRescaleSlope
The image value rescale slope as read out from DICOM tag (0028,1053).
SoPointingAction * selectAndMoveEndPress(int) override
SoSFFloat imageMaxValue
The image max value inside the current CSO.
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
Sets seed points while moving the mouse – but not while dragging.
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current im...
Definition: SoSFMLImage.h:70
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
BaseEvent is the base class for all events emitted from EventSourceBase.
Definition: mlEventSource.h:86
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
The CSO represents a contour segmentation object.
Definition: CSO.h:44