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
21ML_START_NAMESPACE
22class BaseEvent;
23ML_END_NAMESPACE
24
26
29{
30 SO_NODE_HEADER(SoCSOImageStatistics);
31
32public:
33
36
38 SoSFInt32 currentCSOId;
40 SoSFInt32 numVoxels;
42 SoSFFloat imageMinValue;
44 SoSFFloat imageMaxValue;
46 SoSFFloat imageMeanValue;
56 SoSFFloat imageSumValue;
58 SoSFString imageModality;
69 SoSFString viewerId;
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
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
94protected:
95
97
98private:
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
SoCSOEditorExtension()
Hidden constructor.
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.
SoSFFloat imageRescaleIntercept
The image value rescale intercept as read out from DICOM tag (0028,1052).
~SoCSOImageStatistics() override
bool shouldRenderGeneral(ml::CSO *) const override
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.
SoPointingAction * selectAndMoveEndPress(int) override
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).
SoSFFloat imageMaxValue
The image max value inside the current CSO.
void pointerPositionIfAllowedAt(const SoPointerPosition &) override
SoPointerPosition manages the current position of the mouse cursor.
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
Definition CSO.h:44