MeVisLab Toolbox Reference
SoCSOImageStatistics Class Reference

Extension for gathering voxel information inside CSOs on the current slice. More...

#include <SoCSOImageStatistics.h>

Inheritance diagram for SoCSOImageStatistics:
SoCSOEditorExtension

Public Member Functions

 SoCSOImageStatistics ()
 Standard constructor.
 
void draw (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, SoView2DCSOExtensibleEditor *editor) override
 Drawing routine.
 
void createStartPressAt (const SoPointerPosition &) override
 
void createDragMoveTo (const SoPointerPosition &) override
 
bool createEndPress (int) override
 
void pointerPositionIfAllowedAt (const SoPointerPosition &) override
 Sets seed points while moving the mouse – but not while dragging.
 
void selectAndMoveStartPressAt (const SoPointerPosition &) override
 
void selectAndMoveDragMoveTo (const SoPointerPosition &) override
 
SoPointingActionselectAndMoveEndPress (int) override
 
int cursorShape () const override
 Returns the cursor shape that indicates the next creation.
 
bool shouldRenderGeneral (ml::CSO *) const override
 Returns whether a given CSO should be rendered by this general extension.
 
- Public Member Functions inherited from SoCSOEditorExtension
void setExtensibleEditor (SoView2DCSOExtensibleEditor *extensibleEditor)
 Sets the pointer to the calling extensible editor.
 
virtual void activate (SoView2DCSOExtensibleEditor *extensibleEditor)
 Is called when an extension is activated by the SoView2DExtensibleEditor.
 
virtual void deactivate ()
 Is called when an extension is deactivated by the SoView2DExtensibleEditor.
 
virtual void buttonMaskChanged ()
 Is called when the button mask of the SoView2DExtensibleEditor has changed.
 
virtual void editingOnChanged ()
 Is called when the editingOn field of the SoView2DExtensibleEditor has changed.
 
virtual void startDrawing (View2DSliceList *)
 Is called before drawing.
 
virtual void drawingDone ()
 Is called when all drawing is done.
 
virtual void setVisibleCSOs (const std::vector< CSODrawCSOInfos > &drawCSOInformation, const CSODrawView2DInfos &view2DInfos, SoView2DCSOExtensibleEditor *editor)
 Sets visible CSOs that have been determined in the extensible editor.
 
virtual void drawSecondPass (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &sliceInfo, SoView2DCSOExtensibleEditor *editor)
 Drawing routine that comes between 'main' and 'overlay'.
 
virtual void drawOverlay (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &sliceInfo, SoView2DCSOExtensibleEditor *editor)
 Routine for drawing after the main routine has drawn.
 
virtual void drawAdditionalGeometry (const CSODrawView2DInfos &view2DInfos, SoView2DCSOExtensibleEditor *editor)
 Routine for drawing additional geometry of the extension.
 
virtual void insertSeedPointStartPressAt (const SoPointerPosition &)
 
virtual void insertSeedPointDragMoveTo (const SoPointerPosition &)
 
virtual SoPointingActioninsertSeedPointEndPress (int)
 
virtual void bulgeStartPressAt (const SoPointerPosition &)
 
virtual void bulgeDragMoveTo (const SoPointerPosition &)
 
virtual SoPointingActionbulgeEndPress (int)
 
virtual void pointerPosition (const SoPointerPosition &)
 Is called when the mouse moves over a viewer.
 
virtual void pointerLeftWindow ()
 Is called when mouse pointer leaves the window.
 
virtual bool isCreationAllowed () const
 Returns whether the editor is allowed to create a new CSO.
 
virtual bool isCreationAllowedAt (const SoPointerPosition &) const
 Returns whether the editor is allowed to create a new CSO at the given position, by default calls the previous method.
 
virtual bool isModificationAllowed () const
 Returns whether the editor is allowed to modify an existing CSO.
 
virtual bool shouldRenderCSOs () const
 Returns whether the editor should render.
 
virtual bool canCreateCSOs () const
 Returns whether the editor can create a CSO.
 
virtual ml::CSOgetActiveCSO () const
 Returns the currently active CSO.
 
virtual bool expectsToCreateCSO ()
 Returns whether an editor is awaiting to create a new CSO, depending on the requireMousemovement flag.
 
SbString getCreatorExtensionId () const
 
void setActiveCSOList (ml::CSOList *hitCSOList)
 
void setSelectAndMoveInformation (ml::CSOList *hitCSOList, ml::CSO *hitCSO, ml::CSOSeedPoint *hitSeedPoint, ml::CSOPathPoints *hitPathPoints, float hitDistance)
 
void setCSOUnderMouse (ml::CSO *cso)
 
ml::CSOgetCSOUnderMouse () const
 
bool hasSelectedSeedPoint () const
 
bool hasSelectedCSO () const
 
virtual SbString getSubType () const
 Returns the sub type string of the derived class.
 
virtual bool shouldRenderSpecific (ml::CSO *cso) const
 Returns whether a given CSO should be rendered by this specific extension.
 
virtual bool isDefaultRenderer () const
 Returns whether the editor is the default editor.
 
virtual bool isModificationEditor () const
 Returns whether the editor is a modification editor.
 
virtual void resetCache ()
 Resets internal module caches, if there are any.
 
virtual void cancel ()
 Cancels an action like generating a CSO. Depends on concrete editor.
 
virtual bool deleteSeedPoint (ml::CSO *cso, ml::CSOSeedPoint *)
 Removes the given seed point from the given CSO and returns whether that was successful.
 
ml::CSOSeedPointgetPreviousSeedPoint (ml::CSOSeedPoint *seedPoint) const
 Returns the previous seed point of the given seed point for setting it as the next selected seed point.
 
virtual void mouseWheelEventReceived (SoMouseWheelEvent::Orientation, int, View2DEvent *)
 Method is called when the extensible editor received a mouse wheel event.
 
virtual bool evaluateHitPoint (const ml::Vector3 &worldPosition, View2DSliceList *slicelist, ml::CSOList *csoList, const ml::CSOBoundingBox &slabBB, SoView2DCSOExtensibleEditor *editor, ml::CSO *&localHitCSO, ml::CSOSeedPoint *&localHitSeedPoint, ml::CSOPathPoints *&localHitPathPoints, float &distance)
 Returns whether the given world position is within the selection distance set in the editor and fills the selection distance.
 
void reset ()
 
ml::CSOVisualizationSettingsgetVisualizationSettings ()
 Returns a pointer to the visual settings that are either the default ones or the ones set to the extensible editor (if present).
 
bool shouldShowCSOForCurrentTimePoint (const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns whether the given CSO should be rendered for the current time point.
 
void sendCSOEventsOnCancel (ml::CSO *cso)
 Sends CSO events for completing a creation or interaction when canceling it.
 
virtual void sendCSOEventsOnCancel (ml::CSOList *csoList)
 

Static Public Member Functions

static void initClass ()
 init class in inventor runtime
 
- Static Public Member Functions inherited from SoCSOEditorExtension
static void initClass ()
 init class in inventor runtime
 

Public Attributes

SoSFInt32 currentCSOId
 Shows the id of the current CSO.
 
SoSFInt32 numVoxels
 The number of voxels inside the current CSO.
 
SoSFFloat imageMinValue
 The image min value inside the current CSO.
 
SoSFFloat imageMaxValue
 The image max value inside the current CSO.
 
SoSFFloat imageMeanValue
 The image mean value inside the current CSO.
 
SoSFFloat imageAbsMeanValue
 The image mean of absolute values inside the current CSO.
 
SoSFFloat imageVarianceValue
 The image value variance inside the current CSO.
 
SoSFFloat imageStdDeviationValue
 The image value standard deviation inside the current CSO.
 
SoSFFloat imageAverageSquaredSumValue
 The average of the sum of squared image values inside the current CSO.
 
SoSFFloat imageSumValue
 The sum of the image values inside the current CSO.
 
SoSFString imageModality
 The image's modality string as read out from DICOM tag (0008,0060).
 
SoSFFloat imageRescaleIntercept
 The image value rescale intercept as read out from DICOM tag (0028,1052).
 
SoSFFloat imageRescaleSlope
 The image value rescale slope as read out from DICOM tag (0028,1053).
 
SoSFBool imageValuesValid
 Shows whether the image value fields are valid.
 
SoSFString viewerId
 Optional viewer id, this string is concatenated to the user data name for each statistics value, divided by an underscore.
 
SoSFTrigger markAllCSOsForUpdate
 If pressed, all CSO are being processed at the next draw() call.
 
SoSFMLImage inputImage
 Input image field.
 
- Public Attributes inherited from SoCSOEditorExtension
SoSFString extensionId
 ID for a editor, needs to be unique per editor extension instance.
 
SoSFBool allowCreation
 Shall the editor allow creation?
 
SoSFBool allowModification
 Shall the editor allow modification of CSOs of its type?
 
SoSFBool allowSeedPointInteraction
 Should the interaction with seed points be allowed?
 
SoSFBool shouldRender
 Shall the editor render its CSOs?
 
SoSFMLBase inVisualizationSettings
 Optionally attached visualization settings, overrides the vis.
 
SoSFEnum selectionCursor
 
SoSFEnum interactionForbiddenCursor
 
SoSFInt32 csoIdUnderMouseCursor
 The id of the CSO currently under the mouse (or -1 if no CSO is under the mouse).
 

Protected Member Functions

 ~SoCSOImageStatistics () override
 
- Protected Member Functions inherited from SoCSOEditorExtension
 SoCSOEditorExtension ()
 Hidden constructor.
 
 ~SoCSOEditorExtension () override
 Hidden destructor.
 
virtual void initMembers ()
 
void sendCSONotificationRepaint ()
 Sends a CSO notification to repaint the CSOList.
 
void sendCSONotificationMove ()
 Sends a CSO notification on moving a CSO or seed point.
 
void sendCSONotificationFinishInteraction ()
 Sends a CSO notification on finishing an interaction with a CSO.
 
void sendCSONotificationResetInteractionState ()
 Sends a CSO notification on having the interaction state being reset.
 
void sendCSONotificationInsertSeedPoint ()
 Sends a CSO notification on inserting a seed point.
 
void sendCSONotificationNewCSOStarted ()
 Sends a CSO notification on having started to create a new CSO.
 
void setExtensionIdAsSubType ()
 Sets the subtype member to the value of the extension id string.
 
virtual void setCreationData (const SoPointerPosition &pos, ml::CSO *newCSO)
 Sets creation data to a newly created CSO.
 
void extensionIdCB (SoField *)
 
SoCSOEditorTools::LineRenderSettings getLineRenderSettingsOnSlice ()
 Creates a LineRenderSettings struct from the editors visualization settings "onSlice" section.
 
SoCSOEditorTools::LineRenderSettings getLineRenderSettingsForCSO (ml::CSO *cso)
 Creates a LineRenderSettings struct from the visualization attributes of the given CSO.
 
void drawPathPoints (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, const SbVec2f &shadowOffsetDevice, SoView2DCSOExtensibleEditor *editor)
 Draws the CSO by drawing lines between the path points. Renders different types of CSOs.
 
void renderPathPoints (const CSOPathPointsRenderSettings &renderSettings, const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const std::vector< CSOSliceCrossing > &pathPointsLists, GLint lineMode, const SbVec2f &shadowOffsetDevice)
 Draws path points with given render settings.
 
void drawPathAndCrossingPoints (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const SbVec2f &shadowOffsetDevice, const std::vector< CSOSliceCrossing > &pathAndCrossingPoints, GLint lineMode)
 Draws the path and crossing points.
 
void drawShape (int style, SoView2DCSOExtensibleEditor *editor, ml::CSOVisualizationSettings *visualizationSettings, float deviceX, float deviceY, float size, float lineWidth=1.f)
 Draws the shape with the given style with the given center and size.
 
void drawSeedPoints (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, SoView2DCSOExtensibleEditor *editor)
 Draws the seed points of the CSO.
 
void drawFixedSizeCircleAt (float deviceX, float deviceY)
 Renders a fixed size circle at the given position.
 
bool isCSOVisible (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const CSODrawSliceInformation &drawSliceInfo, SoView2DCSOExtensibleEditor *editor)
 Returns whether the CSO is visible on the current slice.
 
ml::Vector3 getTransformedPosition (const CSODrawView2DInfos &view2DInfos, const ml::Vector3 &position)
 If a SoCSOTransform exists, this method returns the transformed position.
 
void mapWorldToDevice (const SoPointerPosition &pos, const ml::Vector3 &worldPosition, float &deviceX, float &deviceY)
 Returns device coordinates for a given world position.
 
void mapWorldToDevice (View2DSliceList *slicelist, const ml::Vector3 &worldPosition, float &deviceX, float &deviceY)
 Returns device coordinates for a given world position.
 
ml::Vector3 mapDeviceToWorld (const SoPointerPosition &pos, float deviceX, float deviceY)
 Returns world coordinates for given device position.
 
ml::Vector3 mapWorldToVoxel (const SoPointerPosition &pos, const ml::Vector3 &worldPosition)
 Returns a voxel position for a given world position.
 
ml::Vector3 mapWorldToVoxel (const SoPointerPosition &pos, const SbVec3f &worldPosition)
 Returns a voxel position for a given world position.
 
ml::Vector3 mapVoxelToWorld (const SoPointerPosition &pos, const ml::Vector3 &voxelPosition)
 Returns a world position for a given voxel position.
 
SbVec2f nonShadowOffset () const
 Returns the default offset for non-shadows in pixels.
 
SbVec2f shadowOffset () const
 Returns the default offset for shadows in pixels.
 
GLint getLineMode (ml::CSO *cso)
 Returns the correct line mode for open and for closed CSOs.
 
void setupGLForCSO (const CSODrawCSOInfos &csoInfos)
 Sets up GL state for color, line width, and point size.
 
void setupGLShadow (float generalAlpha=1.0f)
 Sets up the GL state for shadow rendering (color and line width).
 
void glSetAlpha (float alpha)
 Sets an alpha value but retains the set color.
 
float getDepthAlpha (int maxSliceDistance, int currentSliceDistance) const
 Returns an alpha factor based on the max distance and the current distance.
 
bool doesCSOTimePointMatchCurrentTimePoint (const CSODrawView2DInfos &view2DInfos, ml::CSO *cso)
 Returns true if the CSO's time point matches the (overwritten) current time point.
 

Additional Inherited Members

- Protected Attributes inherited from SoCSOEditorExtension
SoView2DCSOExtensibleEditor_editor
 
ml::CSOListPtr _hitCSOList
 Pointer to internal/interactive states.
 
ml::CSO_hitCSO
 
ml::CSOSeedPoint_hitSeedPoint
 
ml::CSOPathPoints_hitPathPoints
 
float _hitDistance
 
ml::CSO_csoUnderMouse
 
ml::CSOVisualizationSettings _visualizationSettings
 Default visual settings. Access them via the method getVisualSettings().
 
SbString _subType
 Member for subtype of generated CSOs.
 

Detailed Description

Extension for gathering voxel information inside CSOs on the current slice.

Definition at line 28 of file SoCSOImageStatistics.h.

Constructor & Destructor Documentation

◆ SoCSOImageStatistics()

SoCSOImageStatistics::SoCSOImageStatistics ( )

Standard constructor.

◆ ~SoCSOImageStatistics()

SoCSOImageStatistics::~SoCSOImageStatistics ( )
overrideprotected

Member Function Documentation

◆ createDragMoveTo()

void SoCSOImageStatistics::createDragMoveTo ( const SoPointerPosition & )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 82 of file SoCSOImageStatistics.h.

◆ createEndPress()

bool SoCSOImageStatistics::createEndPress ( int )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 83 of file SoCSOImageStatistics.h.

◆ createStartPressAt()

void SoCSOImageStatistics::createStartPressAt ( const SoPointerPosition & )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 81 of file SoCSOImageStatistics.h.

◆ cursorShape()

int SoCSOImageStatistics::cursorShape ( ) const
inlineoverridevirtual

Returns the cursor shape that indicates the next creation.

Reimplemented from SoCSOEditorExtension.

Definition at line 90 of file SoCSOImageStatistics.h.

References SoViewerProxy::DEFAULT_CURSOR.

◆ draw()

void SoCSOImageStatistics::draw ( const CSODrawCSOInfos & csoInfos,
const CSODrawView2DInfos & view2DInfos,
const CSODrawSliceInformation & drawSliceInfo,
SoView2DCSOExtensibleEditor * editor )
overridevirtual

Drawing routine.

Reimplemented from SoCSOEditorExtension.

◆ initClass()

static void SoCSOImageStatistics::initClass ( )
static

init class in inventor runtime

◆ pointerPositionIfAllowedAt()

void SoCSOImageStatistics::pointerPositionIfAllowedAt ( const SoPointerPosition & pos)
inlineoverridevirtual

Sets seed points while moving the mouse – but not while dragging.

Is called in isSensitiveAt only while interacting on the same slice where the interaction has started.

Implements SoCSOEditorExtension.

Definition at line 84 of file SoCSOImageStatistics.h.

◆ selectAndMoveDragMoveTo()

void SoCSOImageStatistics::selectAndMoveDragMoveTo ( const SoPointerPosition & )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 87 of file SoCSOImageStatistics.h.

◆ selectAndMoveEndPress()

SoPointingAction * SoCSOImageStatistics::selectAndMoveEndPress ( int )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 88 of file SoCSOImageStatistics.h.

◆ selectAndMoveStartPressAt()

void SoCSOImageStatistics::selectAndMoveStartPressAt ( const SoPointerPosition & )
inlineoverridevirtual

Implements SoCSOEditorExtension.

Definition at line 86 of file SoCSOImageStatistics.h.

◆ shouldRenderGeneral()

bool SoCSOImageStatistics::shouldRenderGeneral ( ml::CSO * ) const
inlineoverridevirtual

Returns whether a given CSO should be rendered by this general extension.

Overwrite this in general renderers.

Reimplemented from SoCSOEditorExtension.

Definition at line 92 of file SoCSOImageStatistics.h.

Member Data Documentation

◆ currentCSOId

SoSFInt32 SoCSOImageStatistics::currentCSOId

Shows the id of the current CSO.

Definition at line 38 of file SoCSOImageStatistics.h.

◆ imageAbsMeanValue

SoSFFloat SoCSOImageStatistics::imageAbsMeanValue

The image mean of absolute values inside the current CSO.

Definition at line 48 of file SoCSOImageStatistics.h.

◆ imageAverageSquaredSumValue

SoSFFloat SoCSOImageStatistics::imageAverageSquaredSumValue

The average of the sum of squared image values inside the current CSO.

Definition at line 54 of file SoCSOImageStatistics.h.

◆ imageMaxValue

SoSFFloat SoCSOImageStatistics::imageMaxValue

The image max value inside the current CSO.

Definition at line 44 of file SoCSOImageStatistics.h.

◆ imageMeanValue

SoSFFloat SoCSOImageStatistics::imageMeanValue

The image mean value inside the current CSO.

Definition at line 46 of file SoCSOImageStatistics.h.

◆ imageMinValue

SoSFFloat SoCSOImageStatistics::imageMinValue

The image min value inside the current CSO.

Definition at line 42 of file SoCSOImageStatistics.h.

◆ imageModality

SoSFString SoCSOImageStatistics::imageModality

The image's modality string as read out from DICOM tag (0008,0060).

Definition at line 58 of file SoCSOImageStatistics.h.

◆ imageRescaleIntercept

SoSFFloat SoCSOImageStatistics::imageRescaleIntercept

The image value rescale intercept as read out from DICOM tag (0028,1052).

Definition at line 60 of file SoCSOImageStatistics.h.

◆ imageRescaleSlope

SoSFFloat SoCSOImageStatistics::imageRescaleSlope

The image value rescale slope as read out from DICOM tag (0028,1053).

Definition at line 62 of file SoCSOImageStatistics.h.

◆ imageStdDeviationValue

SoSFFloat SoCSOImageStatistics::imageStdDeviationValue

The image value standard deviation inside the current CSO.

Definition at line 52 of file SoCSOImageStatistics.h.

◆ imageSumValue

SoSFFloat SoCSOImageStatistics::imageSumValue

The sum of the image values inside the current CSO.

Definition at line 56 of file SoCSOImageStatistics.h.

◆ imageValuesValid

SoSFBool SoCSOImageStatistics::imageValuesValid

Shows whether the image value fields are valid.

Definition at line 64 of file SoCSOImageStatistics.h.

◆ imageVarianceValue

SoSFFloat SoCSOImageStatistics::imageVarianceValue

The image value variance inside the current CSO.

Definition at line 50 of file SoCSOImageStatistics.h.

◆ inputImage

SoSFMLImage SoCSOImageStatistics::inputImage

Input image field.

Definition at line 73 of file SoCSOImageStatistics.h.

◆ markAllCSOsForUpdate

SoSFTrigger SoCSOImageStatistics::markAllCSOsForUpdate

If pressed, all CSO are being processed at the next draw() call.

Definition at line 71 of file SoCSOImageStatistics.h.

◆ numVoxels

SoSFInt32 SoCSOImageStatistics::numVoxels

The number of voxels inside the current CSO.

Definition at line 40 of file SoCSOImageStatistics.h.

◆ viewerId

SoSFString SoCSOImageStatistics::viewerId

Optional viewer id, this string is concatenated to the user data name for each statistics value, divided by an underscore.

If left blank, nothing will be concatenated to the user data names, otherwise the statistics values will only be updated for CSOs in the viewer with the same id.

Definition at line 69 of file SoCSOImageStatistics.h.


The documentation for this class was generated from the following file: