MeVisLab Toolbox Reference
SoView2D Class Reference

SoView2D is a 2D viewer for image data. More...

#include <SoView2D.h>

Inheritance diagram for SoView2D:
SoInteractionOwner SoInteractionProvider

Public Member Functions

 SoView2D ()
 constructor
SbString getViewerId () const
 returns the viewer id of this viewer
View2DSliceListgetSliceList ()
 returns the slicelist that is used to manage the slices
SbVec2f getSliceSize ()
 get slice size x/y in millimeters (used by SoOrthoView2D)
SoAction * getAction ()
void GLRender (SoGLRenderAction *action) override
 reimplemented Inventor method which renders the slices
void updateSliceListOnImageChange ()
 update the slice list if the image has changed
void updateLayout (int viewportX, int viewportY, int viewportWidth, int viewportHeight, bool is3D=false)
 Update layout for given viewport size.
void handleEvent (SoHandleEventAction *action) override
 handle the mouse and keyboard events and send them to extensions
bool handleKeyboardEvent (int nKey, bool shift, bool alt, bool ctrl)
 handle standard key, returns true if handles
void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center) override
 when rendering in 3D, calculate the bounding box of the drawn slice(s)
void generatePrimitives (SoAction *action) override
 used for 3D picking
void rayPick (SoRayPickAction *action) override
 implements 3D picking
bool getEventLocation (SoHandleEventAction *action, bool &hit, float &dx, float &dy, SbVec3f &voxelHit, int &sliceID)
void setSliceInitFunc (SliceInitFunc fn, void *user)
SliceInitFunc getSliceInitFunc (void)
 Get slice position initialization callback.
int getCurrentCenterSlice ()
 returns the central of all currently visible slices (e.g. startSlice, if numSlices is 1)
void adjustSliceOriginToCenter (float newSliceZoom)
void translateInnerSlice (float x, float y)
 translates the inner slice x/y pixel on the screen
void getStatusString (SbString &string)
 access status string
ml::LUTFunctiongetDefaultLut ()
 get the default lut object (just a relative ramp from 0 to 1)
ml::LUTFunctiongetLutFromScene (SoAction *action)
 get the lut from the scene (default ramp if no lut is set)
bool updateLutData (ml::LUTFunction *lut, View2DLut *data, SoSFMLImage *img, View2DLutPrecision precision)
void startCineMode ()
 start the cine mode
void stopCineMode ()
 stop the cine mode
SbVec2f getSingleSliceSize (int windowX, int windowY)
int getMaxStartSlice ()
 returns the highest sensible value for startSlice
Public Member Functions inherited from SoInteractionOwner
 SoInteractionOwner ()
 Default constructor.
 ~SoInteractionOwner () override
 The destructor will destroy all interactions created with this object as owner.
std::list< SoInteraction * > getInteractions (SoState *state) override
 Returns the list of all interactions of this provider.
void pointerPosition (SoState *state, const SoPointerPosition &pos) override
 Same as below, with additional SoState argument. By default, simply calls the below version.
void pointerLeftWindow (SoState *state) override
 Same as below, with additional SoState argument. By defaults, simply calls the below version.
void addListener (SoInteractionOwnerListenerInterface *listener)
 Adds a listener object that is notified of changes in the interaction list.
void removeListener (SoInteractionOwnerListenerInterface *listener)
 Removes a listener object that was notified of changes in the interaction list.
Public Member Functions inherited from SoInteractionProvider
 SoInteractionProvider ()
 Default constructor.
virtual ~SoInteractionProvider ()
template<class T>
std::list< T * > getInteractionsOfType (SoState *state)
 Returns list of interactions of a specific type.
virtual std::list< SoCommandAction * > getCommandActions (SoState *state)
virtual std::list< SoPointingAction * > getPointingActions (SoState *state)
virtual std::list< SoOffsetAction * > getOffsetActions (SoState *state)

Static Public Member Functions

static void initClass ()
 inventor runtime type system
static View2DFontglobalFont ()
static View2DFontglobalFont (int)
 DEPRECATED: cache context id is no longer needed.
static View2DFontglobalFontRef ()
static std::string getDICOMTagValue (SoSFMLImage *image, const std::string &dicomTagName)
static SoInteractionProvidergetInteractionProvider (SoNode *node)
 static method to register with SoInteractionProvider for this class
static void registerInteractionProviderNode (SoType type, GetProviderFunc func)
 Registers a function to obtain a SoInteractionProvider from a SoNode.
static SoInteractionProvidergetInteractionProvider (SoNode *node)

Public Attributes

SoSFTrigger renderingDone
 output field is triggered from the inside when all rendering is done.
SoSFString instanceName
 Fields.
SoSFString interactionProviderID
 This field overrides the instanceName as providerID if specified.
SoSFMLImage image
 input ML image
SoSFBool drawImageData
 if set to false, only the extensions of the SoView2D are drawn, not the images
SoSFString viewerId
 id string, needs to be unique in a network if used
SoSFString userInfo
 user supplied string, can be displayed by SoView2DAnnotation
SoSFEnum blendMode
 blend mode for rendering
SoSFEnum filterMode
 filter mode for rendering
SoSFEnum cacheMode
 caching of slices
SoSFFloat alphaFactor
 alpha factor for rendering
SoSFColor baseColor
 base color in which the slices are drawn
SoSFBool useShaders
SoSFBool applyLut
 select if the View2d should apply the scene LUT to the slice data (default is true)
SoSFEnum lutPrecision
 defines the precision of the LUT
SoSFInt32 startSlice
 current start slice
SoSFInt32 sliceStep
 step to next rendered slice
SoSFInt32 numSlices
 number of slices that are rendered
SoSFInt32 numXSlices
 number of slices that are rendered in X
SoSFInt32 maxSlice
 the maximum slice number, read from the image, used to restrict startSlice
SoSFBool keepSlicesInView
SoSFInt32 timePoint
 the timepoint the viewers is currently showing
SoSFInt32 maxTimePoint
 the maximum timepoint, read from the image, used to restrict timePoint
SoSFInt32 userIndex
 the user index the viewers is currently showing
SoSFInt32 maxUserIndex
 the maximum user index, read from the image, used to restrict userIndex
SoSFInt32 slab
 the slab that is rendered (1=only one slice)
SoSFBool unzoomOnImageChange
 If enabled, the module unzooms automatically on an input image change.
SoSFTrigger forceImageUpdate
 Forces an immediate update of all fields that depend on the input image.
SoSFVec2f margin
 margin to the border of the viewer
SoSFVec2f spacing
 spacing between slices
SoSFPlane plane
 plane representing the slice in world coordinates
SoSFVec2f lowerLeft
 restrict the rendering to a subpart of the viewer, in normalized coordinated
SoSFVec2f upperRight
 restrict the rendering to a subpart of the viewer, in normalized coordinated
SoSFBool snapToCenter
 if set, the viewer snaps to center of image on each input image change
SoSFBool standardKeys
 enable the keypad and 0-9 keys
SoSFBool standardKeysNumbers
 enable number keys 0-9, depends on standardKeys being enabled
SoSFBool standardKeysNeedValidPosition
 set if the keys work anywhere or only if pressed with mouse inside of a slice (needed for SoOrthoView2D)
SoSFBool passHandledFlagToInventor
SoSFBool reverseExtensionDrawingOrder
 Reverse drawing order of extensions.
SoSFVec2f sliceOrigin
 the internal origin of the slice in voxels (for shifting inside of the view)
SoSFFloat sliceZoom
 the internal zoom of the slice (for zooming inside if the view)
SoSFFloat sliceZoomSynchronized
 same as sliceZoom, except that changes to this member update the slice origin so that the viewing center remains in the center of the viewer
SoSFVec2f zoomCenter
 center of zoom/scale operation in normalized coordinates
SoSFVec3f viewingCenter
 world position of the current center of the viewer
SoSFBool enableViewingCenter
 If enabled, the viewing center is activated for reading and writing.
SoSFFloat minSliceZoomKeyboard
 minimum slice zoom for keyboard modifications (always clamped by MIN_MIN_SLICE_ZOOM and 1.0)
SoSFTrigger unzoom
 sets sliceOrigin to (0,0) and sliceZoom to 1.0
SoSFEnum sliceAlignX
 align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER
SoSFEnum sliceAlignY
 align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER
SoSFEnum zoomMode
 zoom mode that defines mapping to the viewer area
SoSFFloat zoomModeParameter
 zoom mode parameter, depends on zoomMode what its value means
SoSFBool invertKeyPanningDirections
 invert panning by keyboard
SoSFBool invertKeySlicingDirection
 invert slicing by keyboard
SoSFBool wrapAroundTimePointScrolling
 wrap-around timepoint scrolling
SoSFBool overrideAspectRatio
 set if the aspect ratio should be overwritten by user aspect ratio
SoSFFloat overrideAspectRatioValue
 user defined aspect ratio, is only used if overrideAspectRatio is set to true
SoSFColor backgroundColor
 fill slice background with given color
SoSFFloat backgroundAlphaFactor
 background alpha factor (0=background invisible)
SoSFBool clipBackgroundToImage
 clip background to image rect
SoSFBool handle2DEvents
 handle events when rendering in 2D
SoSFBool handle3DEvents
 handle events when rendering in 3D
SoSFBool useManagedInteraction
 prefer to use managed interaction instead of classical event handling if a SoView2DExtension provides it
SoSFBool enableZBuffer
 use Z buffer in 3D rendering
SoSFBool enableZWrite
 write Z buffer in 3D rendering
SoSFFloat devicePixelSize
 size of a pixel in mm when rendering in 3D
SoSFTrigger startCine
 Cinemode fields.
SoSFTrigger stopCine
 stop the cine mode
SoSFInt32 cineCenterT
 center of timepoint cine
SoSFInt32 cineIntervalT
 interval of timepoint cine
SoSFInt32 cineCenterZ
 center of z cine
SoSFInt32 cineIntervalZ
 interval of z cine
SoSFEnum cineMode
 mode of the Cinemode (Z,T,ZT)
SoSFEnum cineDirection
 direction of Cinemode
SoSFEnum cineRepeat
 flag to indicated if loop or ping-pong is used
SoSFFloat cineSpeed
 speed of cine mode (in seconds), minimum cine speed is fixed to one repaint per image
SoSFBool cineFullRangeZ
 flag if the full z range or the z interval is used
SoSFBool cineFullRangeT
 flag if the full time range or the time interval is used
SoSFBool cineAlwaysReset
SoSFBool cineModeActive
 read-only flag indicating whether cine mode is active or not
SoSFTrigger deleteSelected
 Interaction fields for extensions.
SoSFTrigger edit
 set the extensions into edit mode
SoSFString status
 status of current extension
SoSFString seriesInstanceUID
 the DICOM seriesInstanceUID of the image currently displayed
SoSFString frameOfReferenceUID
 the DICOM frameOfReferenceUID of the image currently displayed.
SoSFBool deletingEnabled
 enable/disable delete-events for SoView2D-Extensions

Protected Member Functions

 ~SoView2D () override
 destructor
void updateKeyboardActionEnabledStateCB (SoField *)
 update enabled state of the keyboard actions
void updateKeyboardActionEnabledState ()
void forceImageUpdateChangedCB (SoField *field=nullptr)
SbBool isMouseButtonPressed (int i)
bool isDeviceCoordInViewerArea (float dx, float dy, const SbVec2s &viewportSize) const
void imageChangedCB (SoField *)
 callback that calls imageChanged();
void imageChanged ()
 React on image changed.
void maxSizeChangedCB (SoField *)
 callback that prevents maxSizes go out of image size
void sliceUnzoomCB (SoField *)
 callback that calls sliceUnzoomAction();
void sliceUnzoomAction (void)
 Reset slice zoom and translation.
void updateViewingCenterAndPlaneCB (SoField *)
 callback which forwards to updateViewingCenterAndPlane()
void updateViewingCenterAndPlane ()
 update viewing center from sliceOrigin and sliceNumber
void enableViewingCenterChangedCB (SoField *)
void viewingCenterChangedCB (SoField *)
 callback which forwards to viewingCenterChanged()
void viewingCenterChanged ()
void updateSliceRepresentingPlane (const SbVec3f &worldCenter)
void sliceZoomChangedCB (SoField *)
 callback which forwards to sliceToomChanged
void sliceZoomChanged ()
 updates the member sliceZoomSynchronized
void sliceZoomSynchronizedChangedCB (SoField *)
 callback which forwards to sliceZoomSynchronizedChanged
void sliceZoomSynchronizedChanged ()
 updates the sliceZoom and corrects the slice origin, so that the viewing center of the slice remains in thew center of the view
void keepSlicesInViewCB (SoField *)
 if keepSlicesInView is activated, set startSlice to a permitted value
int setStartSlice (int slice, bool keepInView=false, bool noCB=false)
void minSliceZoomKeyboardCB (SoField *)
 callback for minimum slice zoom modification that performs clamping to value range
void startCineModeCB (SoField *)
 callback that calls startCineMode();
void stopCineModeCB (SoField *)
 callback that calls stopCineMode();
void cineParametersChangedCB (SoField *)
 callback that calls updateCineParameters()
void updateCineParameters ()
 updates the cine parameters to the current field values
void deleteSelectedObjectCB (SoField *)
 callback that calls deleteSelectedObjectAction();
void deleteSelectedObjectAction ()
 delete the selected object
void editObjectsCB (SoField *)
 callback that calls deleteSelectedObjectAction();
void editObjectsAction ()
 switch extensions to edit mode
void handleScheduledActions (const SoNodeList *primitives)
 handle the actions given by deleteSelectedObject and editObjects
void getLutFromScene (SoAction *action, View2DLut *data)
 render the lut into the given lut data object
void layoutSlices (int wx, int wy)
 layout slices inside of the window area
void updateLayoutAndDraw (int originX, int originY, int width, int height, bool updateLayoutOnly, SoNodeList *primitives=nullptr, int sharedCacheContext=-1, bool is3D=false, bool reverse=false)
 update layout and draw in 2D or 3D
bool checkValid ()
 checks if image, start slice, timepoint, and user index are valid
void updateHighColorDepthFlag ()
void objRef () override
 Overriding SoInteractionProvider methods:
void objUnref () override
std::string getID () const override
 Returns the id string for identifying the provider (and its actions).
Protected Member Functions inherited from SoInteractionOwner
virtual void pointerPosition (const SoPointerPosition &)
 Override this if you always need to be informed of the current mouse cursor position.
virtual void pointerLeftWindow ()
 This is called when the mouse cursor leaves the window.
bool hasInteractions () const
 Returns whether there are any actions defined by this owner.
template<class T>
bool hasInteractionsOfType () const
 Same as above, but asking for a specific type of interaction.
void addPointingAction (SoPointingAction *)
void addCommandAction (SoCommandAction *)
void addOffsetAction (SoOffsetAction *)

Protected Attributes

SoAction * _action
 pointer to current action
View2DSliceList_sliceList
 the internal slice list which stores and handles rendered slices
View2DLut_lutData
 the currently allocated lut data
View2DCine_cine
SbBool _mouseButton [3]
 state of the mouse buttons (kept up-to-date with the handleEvent method)
SoFieldSensor * _viewingCenterSensor
 sensor for start slice
SoFieldSensor * _startSliceSensor
 sensor for start slice
SoFieldSensor * _sliceZoomSynchronizedSensor
SoFieldSensor * _sliceOriginSensor
 sensor for slice origin
bool _editObjectsScheduled
 flag if edit mode on extensions should be activated
bool _deleteSelectedObjectScheduled
 flag if delete of object on extension should be activated
bool _dragging
 remember if we are during a drag operation
bool _mouseOverViewer
 remember if the mouse cursor is over the viewer area
SliceInitFunc _sliceInitFunc
 external slice initialization callback
void * _sliceInitUser
 user data for _sliceInitFunc
unsigned int _imageSerialNumber
 last serial number of image
bool _useHighColorDepth
bool _allowHighColorDepthUpgrade
MLDataType _currentLUTImageDataType
 current LUT settings
double _currentLUTImageMin
double _currentLUTImageMax
int _currentLUTImageNumChannels

Static Protected Attributes

static ml::LUTFunction_localLut
 an internal lut which is used if there is no lut in the scene
SoInteractionHandler_interactionHandler
 Delegate that handles events for the new interaction scheme.
SoInteractionProvider_interactionProvider
 Delegate that provides the interaction objects from the SoView2DExtensions.
class View2DInteractionHandler
 support for new interaction scheme
class View2DInteractionProvider

Additional Inherited Members

typedef SoInteractionProvider *(* GetProviderFunc) (SoNode *)

Detailed Description

SoView2D is a 2D viewer for image data.

It is integrated into OpenInventor and provides event handling and drawing on slices by the use of the SoView2DExtension classes. For a detailed description of its usage, see the html documentation in MeVisLab.

Definition at line 61 of file SoView2D.h.

Constructor & Destructor Documentation

◆ SoView2D()

SoView2D::SoView2D ( )

constructor

◆ ~SoView2D()

SoView2D::~SoView2D ( )
overrideprotected

destructor

Member Function Documentation

◆ adjustSliceOriginToCenter()

void SoView2D::adjustSliceOriginToCenter ( float newSliceZoom)

sets the new sliceZoom value and adjusts the sliceOrigin to zoom to the center of the ROI

◆ checkValid()

bool SoView2D::checkValid ( )
protected

checks if image, start slice, timepoint, and user index are valid

◆ cineParametersChangedCB()

void SoView2D::cineParametersChangedCB ( SoField * )
protected

callback that calls updateCineParameters()

◆ computeBBox()

void SoView2D::computeBBox ( SoAction * action,
SbBox3f & box,
SbVec3f & center )
override

when rendering in 3D, calculate the bounding box of the drawn slice(s)

◆ deleteSelectedObjectAction()

void SoView2D::deleteSelectedObjectAction ( )
protected

delete the selected object

◆ deleteSelectedObjectCB()

void SoView2D::deleteSelectedObjectCB ( SoField * )
protected

callback that calls deleteSelectedObjectAction();

◆ editObjectsAction()

void SoView2D::editObjectsAction ( )
protected

switch extensions to edit mode

◆ editObjectsCB()

void SoView2D::editObjectsCB ( SoField * )
protected

callback that calls deleteSelectedObjectAction();

◆ enableViewingCenterChangedCB()

void SoView2D::enableViewingCenterChangedCB ( SoField * )
protected

enable / disable viewing center usage. Can only be enabled if alignX and alignY are set to CENTER

◆ forceImageUpdateChangedCB()

void SoView2D::forceImageUpdateChangedCB ( SoField * field = nullptr)
protected

◆ generatePrimitives()

void SoView2D::generatePrimitives ( SoAction * action)
override

used for 3D picking

◆ getAction()

SoAction * SoView2D::getAction ( )
inline

get pointer to current action. If there is no current action the function returns NULL. May be used to access the Open Inventor state.

Definition at line 314 of file SoView2D.h.

References _action.

◆ getCurrentCenterSlice()

int SoView2D::getCurrentCenterSlice ( )

returns the central of all currently visible slices (e.g. startSlice, if numSlices is 1)

◆ getDefaultLut()

ml::LUTFunction * SoView2D::getDefaultLut ( )
inline

get the default lut object (just a relative ramp from 0 to 1)

Definition at line 387 of file SoView2D.h.

References _localLut.

◆ getDICOMTagValue()

std::string SoView2D::getDICOMTagValue ( SoSFMLImage * image,
const std::string & dicomTagName )
static

Returns the value of a DICOM tag with the given name as a string, or an empty string if the tag was not found in the given image.

References image.

◆ getEventLocation()

bool SoView2D::getEventLocation ( SoHandleEventAction * action,
bool & hit,
float & dx,
float & dy,
SbVec3f & voxelHit,
int & sliceID )

get event location of the event contained in action, returns if the image is hit, the device location and the voxel position (extracted from handleEvent). If sliceID is set to NO_SLICE_ID, it will be set to the index of the slice that was hit by this test. If sliceID is any other value, it is taken to be the index of a slice and the test is only performed on this slice. This is used to grab the mouse for this slice at a mouse press.

◆ getID()

std::string SoView2D::getID ( ) const
overrideprotectedvirtual

Returns the id string for identifying the provider (and its actions).

Reimplemented from SoInteractionOwner.

◆ getInteractionProvider()

SoInteractionProvider * SoView2D::getInteractionProvider ( SoNode * node)
static

static method to register with SoInteractionProvider for this class

References SoInteractionProvider::SoInteractionProvider().

◆ getLutFromScene() [1/2]

ml::LUTFunction * SoView2D::getLutFromScene ( SoAction * action)

get the lut from the scene (default ramp if no lut is set)

◆ getLutFromScene() [2/2]

void SoView2D::getLutFromScene ( SoAction * action,
View2DLut * data )
protected

render the lut into the given lut data object

◆ getMaxStartSlice()

int SoView2D::getMaxStartSlice ( )

returns the highest sensible value for startSlice

◆ getSingleSliceSize()

SbVec2f SoView2D::getSingleSliceSize ( int windowX,
int windowY )

get the size of a single slice in the window area (this can be used to align annotation font size across several SoView2Ds)

◆ getSliceInitFunc()

SliceInitFunc SoView2D::getSliceInitFunc ( void )
inline

Get slice position initialization callback.

Definition at line 371 of file SoView2D.h.

References _sliceInitFunc.

◆ getSliceList()

View2DSliceList * SoView2D::getSliceList ( )

returns the slicelist that is used to manage the slices

◆ getSliceSize()

SbVec2f SoView2D::getSliceSize ( )

get slice size x/y in millimeters (used by SoOrthoView2D)

◆ getStatusString()

void SoView2D::getStatusString ( SbString & string)

access status string

◆ getViewerId()

SbString SoView2D::getViewerId ( ) const
inline

returns the viewer id of this viewer

Definition at line 305 of file SoView2D.h.

References viewerId.

◆ globalFont() [1/2]

View2DFont * SoView2D::globalFont ( )
static

get the global font used for annotations etc. (only call this within a valid GL context!) (This just forwards the call to View2DFont::globalFont())

◆ globalFont() [2/2]

View2DFont * SoView2D::globalFont ( int )
inlinestatic

DEPRECATED: cache context id is no longer needed.

Definition at line 354 of file SoView2D.h.

References globalFont().

Referenced by globalFont().

◆ globalFontRef()

View2DFont & SoView2D::globalFontRef ( )
static

Always return an existing font singleton as from globalFont(); used for annotations etc. To be called only from within a valid GL context!

◆ GLRender()

void SoView2D::GLRender ( SoGLRenderAction * action)
override

reimplemented Inventor method which renders the slices

◆ handleEvent()

void SoView2D::handleEvent ( SoHandleEventAction * action)
override

handle the mouse and keyboard events and send them to extensions

◆ handleKeyboardEvent()

bool SoView2D::handleKeyboardEvent ( int nKey,
bool shift,
bool alt,
bool ctrl )

handle standard key, returns true if handles

◆ handleScheduledActions()

void SoView2D::handleScheduledActions ( const SoNodeList * primitives)
protected

handle the actions given by deleteSelectedObject and editObjects

◆ imageChanged()

void SoView2D::imageChanged ( )
protected

React on image changed.

◆ imageChangedCB()

void SoView2D::imageChangedCB ( SoField * )
protected

callback that calls imageChanged();

◆ initClass()

void SoView2D::initClass ( )
static

inventor runtime type system

◆ isDeviceCoordInViewerArea()

bool SoView2D::isDeviceCoordInViewerArea ( float dx,
float dy,
const SbVec2s & viewportSize ) const
protected

Returns if the event of the given action is located over the viewer area for a given viewportSize The coordinate must be relative to the current viewport origin.

◆ isMouseButtonPressed()

SbBool SoView2D::isMouseButtonPressed ( int i)
protected

returns if given mousebutton (0-2) is currently pressed this is handles by the View2D, since Inventor only sends down individual MouseButtonPressed events and doesn't keep this state information

◆ keepSlicesInViewCB()

void SoView2D::keepSlicesInViewCB ( SoField * )
protected

if keepSlicesInView is activated, set startSlice to a permitted value

◆ layoutSlices()

void SoView2D::layoutSlices ( int wx,
int wy )
protected

layout slices inside of the window area

◆ maxSizeChangedCB()

void SoView2D::maxSizeChangedCB ( SoField * )
protected

callback that prevents maxSizes go out of image size

◆ minSliceZoomKeyboardCB()

void SoView2D::minSliceZoomKeyboardCB ( SoField * )
protected

callback for minimum slice zoom modification that performs clamping to value range

◆ objRef()

void SoView2D::objRef ( )
inlineoverrideprotectedvirtual

Overriding SoInteractionProvider methods:

Memory management by reference counting for SoInteractionProvider

Implements SoInteractionOwner.

Definition at line 425 of file SoView2D.h.

◆ objUnref()

void SoView2D::objUnref ( )
inlineoverrideprotectedvirtual

Implements SoInteractionOwner.

Definition at line 426 of file SoView2D.h.

◆ rayPick()

void SoView2D::rayPick ( SoRayPickAction * action)
override

implements 3D picking

◆ setSliceInitFunc()

void SoView2D::setSliceInitFunc ( SliceInitFunc fn,
void * user )
inline

Set slice position initialization callback The callback function set by this method is called when the input image changes. If the callback return value is >= 0, it determines the initial slice position, otherwise it is ignored. At the time the callback is executed, most of the View2D's properties are not initialized, so the View2D* pointer passed to the callback should be used for object identification only.

Definition at line 367 of file SoView2D.h.

References _sliceInitFunc, and _sliceInitUser.

◆ setStartSlice()

int SoView2D::setStartSlice ( int slice,
bool keepInView = false,
bool noCB = false )
protected

set start slice, but obey possible restrictions (returns effective value) if keepInView is set, the slice will be restricted to the visible range if noCB is set, the field sensor is temporarily disabled when changing the value

◆ sliceUnzoomAction()

void SoView2D::sliceUnzoomAction ( void )
protected

Reset slice zoom and translation.

◆ sliceUnzoomCB()

void SoView2D::sliceUnzoomCB ( SoField * )
protected

callback that calls sliceUnzoomAction();

◆ sliceZoomChanged()

void SoView2D::sliceZoomChanged ( )
protected

updates the member sliceZoomSynchronized

◆ sliceZoomChangedCB()

void SoView2D::sliceZoomChangedCB ( SoField * )
protected

callback which forwards to sliceToomChanged

◆ sliceZoomSynchronizedChanged()

void SoView2D::sliceZoomSynchronizedChanged ( )
protected

updates the sliceZoom and corrects the slice origin, so that the viewing center of the slice remains in thew center of the view

◆ sliceZoomSynchronizedChangedCB()

void SoView2D::sliceZoomSynchronizedChangedCB ( SoField * )
protected

callback which forwards to sliceZoomSynchronizedChanged

◆ startCineMode()

void SoView2D::startCineMode ( )

start the cine mode

◆ startCineModeCB()

void SoView2D::startCineModeCB ( SoField * )
protected

callback that calls startCineMode();

◆ stopCineMode()

void SoView2D::stopCineMode ( )

stop the cine mode

◆ stopCineModeCB()

void SoView2D::stopCineModeCB ( SoField * )
protected

callback that calls stopCineMode();

◆ translateInnerSlice()

void SoView2D::translateInnerSlice ( float x,
float y )

translates the inner slice x/y pixel on the screen

◆ updateCineParameters()

void SoView2D::updateCineParameters ( )
protected

updates the cine parameters to the current field values

◆ updateHighColorDepthFlag()

void SoView2D::updateHighColorDepthFlag ( )
protected

Checks if the current GL context has a bigger bit depth than 8 per channel and if so upgrades the flag to true. REQUIRES VALID GL CONTEXT

◆ updateKeyboardActionEnabledState()

void SoView2D::updateKeyboardActionEnabledState ( )
protected

◆ updateKeyboardActionEnabledStateCB()

void SoView2D::updateKeyboardActionEnabledStateCB ( SoField * )
protected

update enabled state of the keyboard actions

◆ updateLayout()

void SoView2D::updateLayout ( int viewportX,
int viewportY,
int viewportWidth,
int viewportHeight,
bool is3D = false )

Update layout for given viewport size.

◆ updateLayoutAndDraw()

void SoView2D::updateLayoutAndDraw ( int originX,
int originY,
int width,
int height,
bool updateLayoutOnly,
SoNodeList * primitives = nullptr,
int sharedCacheContext = -1,
bool is3D = false,
bool reverse = false )
protected

update layout and draw in 2D or 3D

◆ updateLutData()

bool SoView2D::updateLutData ( ml::LUTFunction * lut,
View2DLut * data,
SoSFMLImage * img,
View2DLutPrecision precision )

renders the lut data from the lut function according to the image data (lut may be NULL, SoView2D will then use a default ramp) returns if the lut could be rendered or if the rendering failed. When the rendering fails, you can always call with lut==NULL and will get a correct default ramp)

◆ updateSliceListOnImageChange()

void SoView2D::updateSliceListOnImageChange ( )

update the slice list if the image has changed

◆ updateSliceRepresentingPlane()

void SoView2D::updateSliceRepresentingPlane ( const SbVec3f & worldCenter)
protected

◆ updateViewingCenterAndPlane()

void SoView2D::updateViewingCenterAndPlane ( )
protected

update viewing center from sliceOrigin and sliceNumber

◆ updateViewingCenterAndPlaneCB()

void SoView2D::updateViewingCenterAndPlaneCB ( SoField * )
protected

callback which forwards to updateViewingCenterAndPlane()

◆ viewingCenterChanged()

void SoView2D::viewingCenterChanged ( )
protected

sets slice origins of all viewers according to current viewing center if synchronizePanning is on

◆ viewingCenterChangedCB()

void SoView2D::viewingCenterChangedCB ( SoField * )
protected

callback which forwards to viewingCenterChanged()

◆ View2DInteractionHandler

friend class View2DInteractionHandler
friend

support for new interaction scheme

Definition at line 584 of file SoView2D.h.

References View2DInteractionHandler.

Referenced by View2DInteractionHandler.

◆ View2DInteractionProvider

friend class View2DInteractionProvider
friend

Definition at line 585 of file SoView2D.h.

References View2DInteractionProvider.

Referenced by View2DInteractionProvider.

Member Data Documentation

◆ _action

SoAction* SoView2D::_action
protected

pointer to current action

Definition at line 533 of file SoView2D.h.

Referenced by getAction().

◆ _allowHighColorDepthUpgrade

bool SoView2D::_allowHighColorDepthUpgrade
protected

Definition at line 599 of file SoView2D.h.

◆ _cine

View2DCine* SoView2D::_cine
protected

Definition at line 549 of file SoView2D.h.

◆ _currentLUTImageDataType

MLDataType SoView2D::_currentLUTImageDataType
protected

current LUT settings

Definition at line 543 of file SoView2D.h.

◆ _currentLUTImageMax

double SoView2D::_currentLUTImageMax
protected

Definition at line 545 of file SoView2D.h.

◆ _currentLUTImageMin

double SoView2D::_currentLUTImageMin
protected

Definition at line 544 of file SoView2D.h.

◆ _currentLUTImageNumChannels

int SoView2D::_currentLUTImageNumChannels
protected

Definition at line 546 of file SoView2D.h.

◆ _deleteSelectedObjectScheduled

bool SoView2D::_deleteSelectedObjectScheduled
protected

flag if delete of object on extension should be activated

Definition at line 568 of file SoView2D.h.

◆ _dragging

bool SoView2D::_dragging
protected

remember if we are during a drag operation

Definition at line 571 of file SoView2D.h.

◆ _editObjectsScheduled

bool SoView2D::_editObjectsScheduled
protected

flag if edit mode on extensions should be activated

Definition at line 566 of file SoView2D.h.

◆ _imageSerialNumber

unsigned int SoView2D::_imageSerialNumber
protected

last serial number of image

Definition at line 581 of file SoView2D.h.

◆ _interactionHandler

SoInteractionHandler* SoView2D::_interactionHandler
protected

Delegate that handles events for the new interaction scheme.

Definition at line 588 of file SoView2D.h.

◆ _interactionProvider

SoInteractionProvider* SoView2D::_interactionProvider
protected

Delegate that provides the interaction objects from the SoView2DExtensions.

Definition at line 590 of file SoView2D.h.

◆ _localLut

ml::LUTFunction* SoView2D::_localLut
staticprotected

an internal lut which is used if there is no lut in the scene

Definition at line 538 of file SoView2D.h.

Referenced by getDefaultLut().

◆ _lutData

View2DLut* SoView2D::_lutData
protected

the currently allocated lut data

Definition at line 540 of file SoView2D.h.

◆ _mouseButton

SbBool SoView2D::_mouseButton[3]
protected

state of the mouse buttons (kept up-to-date with the handleEvent method)

Definition at line 552 of file SoView2D.h.

◆ _mouseOverViewer

bool SoView2D::_mouseOverViewer
protected

remember if the mouse cursor is over the viewer area

Definition at line 573 of file SoView2D.h.

◆ _sliceInitFunc

SliceInitFunc SoView2D::_sliceInitFunc
protected

external slice initialization callback

Definition at line 576 of file SoView2D.h.

Referenced by getSliceInitFunc(), and setSliceInitFunc().

◆ _sliceInitUser

void* SoView2D::_sliceInitUser
protected

user data for _sliceInitFunc

Definition at line 578 of file SoView2D.h.

Referenced by setSliceInitFunc().

◆ _sliceList

View2DSliceList* SoView2D::_sliceList
protected

the internal slice list which stores and handles rendered slices

Definition at line 536 of file SoView2D.h.

◆ _sliceOriginSensor

SoFieldSensor* SoView2D::_sliceOriginSensor
protected

sensor for slice origin

Definition at line 563 of file SoView2D.h.

◆ _sliceZoomSynchronizedSensor

SoFieldSensor* SoView2D::_sliceZoomSynchronizedSensor
protected

Definition at line 560 of file SoView2D.h.

◆ _startSliceSensor

SoFieldSensor* SoView2D::_startSliceSensor
protected

sensor for start slice

Definition at line 558 of file SoView2D.h.

◆ _useHighColorDepth

bool SoView2D::_useHighColorDepth
protected

Definition at line 598 of file SoView2D.h.

◆ _viewingCenterSensor

SoFieldSensor* SoView2D::_viewingCenterSensor
protected

sensor for start slice

Definition at line 555 of file SoView2D.h.

◆ alphaFactor

SoSFFloat SoView2D::alphaFactor

alpha factor for rendering

Definition at line 94 of file SoView2D.h.

◆ applyLut

SoSFBool SoView2D::applyLut

select if the View2d should apply the scene LUT to the slice data (default is true)

Definition at line 101 of file SoView2D.h.

◆ backgroundAlphaFactor

SoSFFloat SoView2D::backgroundAlphaFactor

background alpha factor (0=background invisible)

Definition at line 212 of file SoView2D.h.

◆ backgroundColor

SoSFColor SoView2D::backgroundColor

fill slice background with given color

Definition at line 210 of file SoView2D.h.

◆ baseColor

SoSFColor SoView2D::baseColor

base color in which the slices are drawn

Definition at line 96 of file SoView2D.h.

◆ blendMode

SoSFEnum SoView2D::blendMode

blend mode for rendering

Definition at line 88 of file SoView2D.h.

◆ cacheMode

SoSFEnum SoView2D::cacheMode

caching of slices

Definition at line 92 of file SoView2D.h.

◆ cineAlwaysReset

SoSFBool SoView2D::cineAlwaysReset

Always reset to start slice/time point and forward direction on start press (start with current position and direction otherwise)

Definition at line 267 of file SoView2D.h.

◆ cineCenterT

SoSFInt32 SoView2D::cineCenterT

center of timepoint cine

Definition at line 244 of file SoView2D.h.

◆ cineCenterZ

SoSFInt32 SoView2D::cineCenterZ

center of z cine

Definition at line 248 of file SoView2D.h.

◆ cineDirection

SoSFEnum SoView2D::cineDirection

direction of Cinemode

Definition at line 254 of file SoView2D.h.

◆ cineFullRangeT

SoSFBool SoView2D::cineFullRangeT

flag if the full time range or the time interval is used

Definition at line 263 of file SoView2D.h.

◆ cineFullRangeZ

SoSFBool SoView2D::cineFullRangeZ

flag if the full z range or the z interval is used

Definition at line 261 of file SoView2D.h.

◆ cineIntervalT

SoSFInt32 SoView2D::cineIntervalT

interval of timepoint cine

Definition at line 246 of file SoView2D.h.

◆ cineIntervalZ

SoSFInt32 SoView2D::cineIntervalZ

interval of z cine

Definition at line 250 of file SoView2D.h.

◆ cineMode

SoSFEnum SoView2D::cineMode

mode of the Cinemode (Z,T,ZT)

Definition at line 252 of file SoView2D.h.

◆ cineModeActive

SoSFBool SoView2D::cineModeActive

read-only flag indicating whether cine mode is active or not

Definition at line 270 of file SoView2D.h.

◆ cineRepeat

SoSFEnum SoView2D::cineRepeat

flag to indicated if loop or ping-pong is used

Definition at line 256 of file SoView2D.h.

◆ cineSpeed

SoSFFloat SoView2D::cineSpeed

speed of cine mode (in seconds), minimum cine speed is fixed to one repaint per image

Definition at line 258 of file SoView2D.h.

◆ clipBackgroundToImage

SoSFBool SoView2D::clipBackgroundToImage

clip background to image rect

Definition at line 215 of file SoView2D.h.

◆ deleteSelected

SoSFTrigger SoView2D::deleteSelected

Interaction fields for extensions.

delete current object in active SoView2DExtension

Definition at line 278 of file SoView2D.h.

◆ deletingEnabled

SoSFBool SoView2D::deletingEnabled

enable/disable delete-events for SoView2D-Extensions

Definition at line 291 of file SoView2D.h.

◆ devicePixelSize

SoSFFloat SoView2D::devicePixelSize

size of a pixel in mm when rendering in 3D

Definition at line 233 of file SoView2D.h.

◆ drawImageData

SoSFBool SoView2D::drawImageData

if set to false, only the extensions of the SoView2D are drawn, not the images

Definition at line 79 of file SoView2D.h.

◆ edit

SoSFTrigger SoView2D::edit

set the extensions into edit mode

Definition at line 280 of file SoView2D.h.

◆ enableViewingCenter

SoSFBool SoView2D::enableViewingCenter

If enabled, the viewing center is activated for reading and writing.

Definition at line 178 of file SoView2D.h.

◆ enableZBuffer

SoSFBool SoView2D::enableZBuffer

use Z buffer in 3D rendering

Definition at line 227 of file SoView2D.h.

◆ enableZWrite

SoSFBool SoView2D::enableZWrite

write Z buffer in 3D rendering

Definition at line 230 of file SoView2D.h.

◆ filterMode

SoSFEnum SoView2D::filterMode

filter mode for rendering

Definition at line 90 of file SoView2D.h.

◆ forceImageUpdate

SoSFTrigger SoView2D::forceImageUpdate

Forces an immediate update of all fields that depend on the input image.

Definition at line 132 of file SoView2D.h.

◆ frameOfReferenceUID

SoSFString SoView2D::frameOfReferenceUID

the DICOM frameOfReferenceUID of the image currently displayed.

Definition at line 288 of file SoView2D.h.

◆ handle2DEvents

SoSFBool SoView2D::handle2DEvents

handle events when rendering in 2D

Definition at line 218 of file SoView2D.h.

◆ handle3DEvents

SoSFBool SoView2D::handle3DEvents

handle events when rendering in 3D

Definition at line 221 of file SoView2D.h.

◆ image

SoSFMLImage SoView2D::image

input ML image

Definition at line 76 of file SoView2D.h.

Referenced by getDICOMTagValue().

◆ instanceName

SoSFString SoView2D::instanceName

Fields.

Defines interface field to store the instance name.

Definition at line 70 of file SoView2D.h.

◆ interactionProviderID

SoSFString SoView2D::interactionProviderID

This field overrides the instanceName as providerID if specified.

Definition at line 73 of file SoView2D.h.

◆ invertKeyPanningDirections

SoSFBool SoView2D::invertKeyPanningDirections

invert panning by keyboard

Definition at line 198 of file SoView2D.h.

◆ invertKeySlicingDirection

SoSFBool SoView2D::invertKeySlicingDirection

invert slicing by keyboard

Definition at line 200 of file SoView2D.h.

◆ keepSlicesInView

SoSFBool SoView2D::keepSlicesInView

if this is set, the slices are prevented from leaving the visible area. This option can interfere with option enableViewingCenter

Definition at line 117 of file SoView2D.h.

◆ lowerLeft

SoSFVec2f SoView2D::lowerLeft

restrict the rendering to a subpart of the viewer, in normalized coordinated

Definition at line 143 of file SoView2D.h.

◆ lutPrecision

SoSFEnum SoView2D::lutPrecision

defines the precision of the LUT

Definition at line 103 of file SoView2D.h.

◆ margin

SoSFVec2f SoView2D::margin

margin to the border of the viewer

Definition at line 135 of file SoView2D.h.

◆ maxSlice

SoSFInt32 SoView2D::maxSlice

the maximum slice number, read from the image, used to restrict startSlice

Definition at line 114 of file SoView2D.h.

◆ maxTimePoint

SoSFInt32 SoView2D::maxTimePoint

the maximum timepoint, read from the image, used to restrict timePoint

Definition at line 121 of file SoView2D.h.

◆ maxUserIndex

SoSFInt32 SoView2D::maxUserIndex

the maximum user index, read from the image, used to restrict userIndex

Definition at line 125 of file SoView2D.h.

◆ minSliceZoomKeyboard

SoSFFloat SoView2D::minSliceZoomKeyboard

minimum slice zoom for keyboard modifications (always clamped by MIN_MIN_SLICE_ZOOM and 1.0)

Definition at line 181 of file SoView2D.h.

◆ numSlices

SoSFInt32 SoView2D::numSlices

number of slices that are rendered

Definition at line 110 of file SoView2D.h.

◆ numXSlices

SoSFInt32 SoView2D::numXSlices

number of slices that are rendered in X

Definition at line 112 of file SoView2D.h.

◆ overrideAspectRatio

SoSFBool SoView2D::overrideAspectRatio

set if the aspect ratio should be overwritten by user aspect ratio

Definition at line 205 of file SoView2D.h.

◆ overrideAspectRatioValue

SoSFFloat SoView2D::overrideAspectRatioValue

user defined aspect ratio, is only used if overrideAspectRatio is set to true

Definition at line 207 of file SoView2D.h.

◆ passHandledFlagToInventor

SoSFBool SoView2D::passHandledFlagToInventor

Set this true if following inventor nodes should not react to events that have been handled by a SoView2DExtension Depricated name: updateInventorEvent;

Definition at line 160 of file SoView2D.h.

◆ plane

SoSFPlane SoView2D::plane

plane representing the slice in world coordinates

Definition at line 140 of file SoView2D.h.

◆ renderingDone

SoSFTrigger SoView2D::renderingDone

output field is triggered from the inside when all rendering is done.

Definition at line 296 of file SoView2D.h.

◆ reverseExtensionDrawingOrder

SoSFBool SoView2D::reverseExtensionDrawingOrder

Reverse drawing order of extensions.

Definition at line 163 of file SoView2D.h.

◆ seriesInstanceUID

SoSFString SoView2D::seriesInstanceUID

the DICOM seriesInstanceUID of the image currently displayed

Definition at line 286 of file SoView2D.h.

◆ slab

SoSFInt32 SoView2D::slab

the slab that is rendered (1=only one slice)

Definition at line 127 of file SoView2D.h.

◆ sliceAlignX

SoSFEnum SoView2D::sliceAlignX

align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER

Definition at line 187 of file SoView2D.h.

◆ sliceAlignY

SoSFEnum SoView2D::sliceAlignY

align the image inside of the slice if there is space left, default is VIEW2D_ALIGN_CENTER

Definition at line 189 of file SoView2D.h.

◆ sliceOrigin

SoSFVec2f SoView2D::sliceOrigin

the internal origin of the slice in voxels (for shifting inside of the view)

Definition at line 166 of file SoView2D.h.

◆ sliceStep

SoSFInt32 SoView2D::sliceStep

step to next rendered slice

Definition at line 108 of file SoView2D.h.

◆ sliceZoom

SoSFFloat SoView2D::sliceZoom

the internal zoom of the slice (for zooming inside if the view)

Definition at line 168 of file SoView2D.h.

◆ sliceZoomSynchronized

SoSFFloat SoView2D::sliceZoomSynchronized

same as sliceZoom, except that changes to this member update the slice origin so that the viewing center remains in the center of the viewer

Definition at line 170 of file SoView2D.h.

◆ snapToCenter

SoSFBool SoView2D::snapToCenter

if set, the viewer snaps to center of image on each input image change

Definition at line 148 of file SoView2D.h.

◆ spacing

SoSFVec2f SoView2D::spacing

spacing between slices

Definition at line 137 of file SoView2D.h.

◆ standardKeys

SoSFBool SoView2D::standardKeys

enable the keypad and 0-9 keys

Definition at line 151 of file SoView2D.h.

◆ standardKeysNeedValidPosition

SoSFBool SoView2D::standardKeysNeedValidPosition

set if the keys work anywhere or only if pressed with mouse inside of a slice (needed for SoOrthoView2D)

Definition at line 155 of file SoView2D.h.

◆ standardKeysNumbers

SoSFBool SoView2D::standardKeysNumbers

enable number keys 0-9, depends on standardKeys being enabled

Definition at line 153 of file SoView2D.h.

◆ startCine

SoSFTrigger SoView2D::startCine

Cinemode fields.

start the cine mode

Definition at line 240 of file SoView2D.h.

◆ startSlice

SoSFInt32 SoView2D::startSlice

current start slice

Definition at line 106 of file SoView2D.h.

◆ status

SoSFString SoView2D::status

status of current extension

Definition at line 283 of file SoView2D.h.

◆ stopCine

SoSFTrigger SoView2D::stopCine

stop the cine mode

Definition at line 242 of file SoView2D.h.

◆ timePoint

SoSFInt32 SoView2D::timePoint

the timepoint the viewers is currently showing

Definition at line 119 of file SoView2D.h.

◆ unzoom

SoSFTrigger SoView2D::unzoom

sets sliceOrigin to (0,0) and sliceZoom to 1.0

Definition at line 184 of file SoView2D.h.

◆ unzoomOnImageChange

SoSFBool SoView2D::unzoomOnImageChange

If enabled, the module unzooms automatically on an input image change.

Definition at line 129 of file SoView2D.h.

◆ upperRight

SoSFVec2f SoView2D::upperRight

restrict the rendering to a subpart of the viewer, in normalized coordinated

Definition at line 145 of file SoView2D.h.

◆ useManagedInteraction

SoSFBool SoView2D::useManagedInteraction

prefer to use managed interaction instead of classical event handling if a SoView2DExtension provides it

Definition at line 224 of file SoView2D.h.

◆ userIndex

SoSFInt32 SoView2D::userIndex

the user index the viewers is currently showing

Definition at line 123 of file SoView2D.h.

◆ userInfo

SoSFString SoView2D::userInfo

user supplied string, can be displayed by SoView2DAnnotation

Definition at line 85 of file SoView2D.h.

◆ useShaders

SoSFBool SoView2D::useShaders

if enabled, the SoView2D tries to emulate a hardware lut by using hardware shaders, only works on hardware that supports shaders and is ignored otherwise

Definition at line 99 of file SoView2D.h.

◆ viewerId

SoSFString SoView2D::viewerId

id string, needs to be unique in a network if used

Definition at line 82 of file SoView2D.h.

Referenced by getViewerId().

◆ viewingCenter

SoSFVec3f SoView2D::viewingCenter

world position of the current center of the viewer

Definition at line 175 of file SoView2D.h.

◆ wrapAroundTimePointScrolling

SoSFBool SoView2D::wrapAroundTimePointScrolling

wrap-around timepoint scrolling

Definition at line 202 of file SoView2D.h.

◆ zoomCenter

SoSFVec2f SoView2D::zoomCenter

center of zoom/scale operation in normalized coordinates

Definition at line 172 of file SoView2D.h.

◆ zoomMode

SoSFEnum SoView2D::zoomMode

zoom mode that defines mapping to the viewer area

Definition at line 193 of file SoView2D.h.

◆ zoomModeParameter

SoSFFloat SoView2D::zoomModeParameter

zoom mode parameter, depends on zoomMode what its value means

Definition at line 195 of file SoView2D.h.


The documentation for this class was generated from the following file:
  • MeVisLab/Standard/Sources/Inventor/SoView2D/SoView2D.h