ImFusion SDK 4.3
RadiologyDisplay Class Reference

#include <ImFusion/GUI/RadiologyDisplay.h>

Specialization of a Display that provides an off-the-shelf setup typically present in radiology workstations. More...

+ Inheritance diagram for RadiologyDisplay:

Detailed Description

Specialization of a Display that provides an off-the-shelf setup typically present in radiology workstations.

This class serves as convenience wrapper aggregating several helper classes and providing syntactic sugar:

  • It has a RadiologyViewGroup so that a 2D image view, as well as 3 MPR views and a VolumeView are present.
  • It has a RadiologyViewOverlays instance so that you can easily add and maintain common ViewOverlays. The RadiologyDisplay constructor will not ask it to create any overlays, thus this has to be done by the user.
  • It has a DisplayAutoLayouter so that all views are automatically shown in a useful default way.
  • You can optionally enable setAutomaticallyShowHideViews() so that only Views with active datasets are shown.
  • It provides a set of convenience getter functions to directly access important entities inside.
// create common ViewOverlays as needed
display.mainViewOverlays().addOverlays(display.views(), RadiologyViewOverlays::OverlayType::AllOverlays);
// select a particular view layout
display.layouter().setFocusedView(&display.main3dView());
// show a dataset
display.mainViewGroup().showData(image);
@ FocusPlusStack
Shows a large focus view and vertically stacks all other views to the right.
Definition DisplayAutoLayouter.h:67
void setFocusedView(const View *value)
Sets the view that is in focus if supported by the current layout mode.
void setCurrentMode(Mode value)
Sets the current view layout mode.
std::vector< View * > views() const override
Returns all views hosted by this display.
Specialization of a Display that provides an off-the-shelf setup typically present in radiology works...
Definition RadiologyDisplay.h:48
VolumeView & main3dView()
Returns the VolumeView of mainViewGroup() for showing 3D data.
Definition RadiologyDisplay.h:74
DisplayAutoLayouter & layouter()
Returns the DisplayAutoLayouter used to perform automatic layouting of the views.
Definition RadiologyDisplay.h:85
RadiologyViewOverlays & mainViewOverlays()
Returns the RadiologyViewOverlays instance enabling you to easily create and maintain common ViewOver...
Definition RadiologyDisplay.h:82
RadiologyViewGroup & mainViewGroup()
Returns the main RadiologyViewGroup hosting the 2D view, the three MPR views, and the 3D VolumeView.
Definition RadiologyDisplay.h:79
int showData(Data *dataset)
Appends data to the visible data on all compatible views of this group by calling showData() on them.
void addOverlays(View &view, Flags< OverlayType > overlayTypes)
Create and add the given overlayTypes the the given view.

Public Member Functions

 RadiologyDisplay (DataModel *dataModel)
 
bool automaticallyShowsHidesViews () const
 Returns the flag whether to automatically show a view when it shows datasets and hide it when it becomes empty.
 
void setAutomaticallyShowHideViews (bool value)
 Sets the flag whether to automatically show a view when it shows datasets and hide it when it becomes empty.
 
void requestViewVisibility (const std::vector< const View * > views, bool value)
 Sets whether the given set of views should be shown by the layouter() if applicable or not.
 
SliceViewmain2dView ()
 Returns the SliceView of mainViewGroup() for showing 2D data.
 
SliceViewmainAxialView ()
 Returns the axial MPR SliceView of mainViewGroup() for showing 3D data.
 
SliceViewmainCoronalView ()
 Returns the sagittal MPR SliceView of mainViewGroup() for showing 3D data.
 
SliceViewmainSagittalView ()
 Returns the coronal MPR SliceView of mainViewGroup() for showing 3D data.
 
VolumeViewmain3dView ()
 Returns the VolumeView of mainViewGroup() for showing 3D data.
 
std::vector< SliceView * > mainMprViews ()
 Returns the three MPR views of mainViewGroup for showing 3D data.
 
RadiologyViewGroupmainViewGroup ()
 Returns the main RadiologyViewGroup hosting the 2D view, the three MPR views, and the 3D VolumeView.
 
RadiologyViewOverlaysmainViewOverlays ()
 Returns the RadiologyViewOverlays instance enabling you to easily create and maintain common ViewOverlays.
 
DisplayAutoLayouterlayouter ()
 Returns the DisplayAutoLayouter used to perform automatic layouting of the views.
 
void addView (std::unique_ptr< View > view) override
 Adds the given view to this display surface.
 
std::unique_ptr< ViewremoveView (View *view) override
 Remove view from this display surface again.
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from Display
std::vector< View * > views () const override
 Returns all views hosted by this display.
 
DisplayLayoutlayout () override
 Returns the DisplayLayout determining how views are distributed within the viewport.
 
GL::Viewport viewport () const override
 Returns the viewport of this display surface in OpenGL coordinates (origin in lower-left corner).
 
virtual void setViewport (const GL::Viewport &viewport)
 Sets the viewport size of this display surface in OpenGL coordinates (origin in lower-left corner) and re-layouts the layout() if applicable.
 
const std::optional< vec3 > & backgroundColor () const
 Returns the optional background color of the rendering area.
 
void setBackgroundColor (const std::optional< vec3 > &value)
 Sets the optional background color of the rendering area.
 
void setWatermark (const SharedImage &image)
 Sets a watermark image to be rendered on top of the display.
 
virtual void render (std::string *outCriticalGlErrorMessage=nullptr) const
 Perform OpenGL-based rendering of the Display and all its Views.
 
EventResult handleInputEvent (const InputEvent &event)
 Entry point for the dispatching of input events from users.
 
void requestUpdate () override
 Request an update of the rendered display content.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Protected Member Functions

std::optional< DisplayLayoutConfigdefaultLayoutConfig () const override
 
void onViewVisibleDataChanged (View &view, const DataList &before, const DataList &after)
 
- Protected Member Functions inherited from Display
virtual EventResult handleKeyEvent (const KeyEvent &event)
 
virtual EventResult handleMouseEvent (const MouseEvent &event)
 
virtual EventResult handleTouchEvent (const TouchEvent &event)
 
virtual EventResult handleContextMenuEvent (const ContextMenuEvent &event)
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

std::unique_ptr< DisplayAutoLayouterm_layouter
 
std::unique_ptr< RadiologyViewGroupm_rvg
 
std::unique_ptr< RadiologyViewOverlaysm_viewOverlays
 
bool m_automaticallyShowHideViews = false
 
- Protected Attributes inherited from Display
std::vector< std::unique_ptr< View > > m_views
 
DisplayLayout m_layout
 
std::shared_ptr< DataDisplayDispatcher > m_dataDisplayDispatcher
 
GL::Viewport m_viewport
 
std::optional< vec3 > m_backgroundColor = vec3::Zero()
 
std::unique_ptr< GL::VertexBufferm_vbo
 
std::shared_ptr< const GlImagem_watermark
 
Viewm_mouseEventReceiver = nullptr
 View where the mouse was pressed and that therefore has the mouse focus.
 
Viewm_touchEventReceiver = nullptr
 View where a touch event was pressed and that therefore has the touch focus.
 
Viewm_lastEnteredView = nullptr
 View that where the last mouse enter event was posted to.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Additional Inherited Members

- Public Attributes inherited from Display
Signal< View * > signalViewAdded
 Signal emitted when a View was added.
 
Signal< View * > signalViewRemoved
 Signal emitted when a View was removed.
 
Signal signalUpdateRequested
 Signal emitted when scene has changed and a re-render is requested.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Member Function Documentation

◆ requestViewVisibility()

void requestViewVisibility ( const std::vector< const View * > views,
bool value )

Sets whether the given set of views should be shown by the layouter() if applicable or not.

This is a convenience function simply forwarding to layouter->setViewsHidden(views, !value).

Note
The underlying layouting algorithm may still decide to not show a view even if it was set to visible here. See DisplayAutoLayouter::setViewHidden() for a detailed explanation.

◆ addView()

void addView ( std::unique_ptr< View > view)
overridevirtual

Adds the given view to this display surface.

The default implementation will reset the DisplayLayout with the return value of defaultLayoutConfig() if valid.

Reimplemented from Display.

◆ removeView()

std::unique_ptr< View > removeView ( View * view)
overridevirtual

Remove view from this display surface again.

The default implementation will reset the DisplayLayout with the return value of defaultLayoutConfig() if valid.

Reimplemented from Display.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from Configurable.

◆ defaultLayoutConfig()

std::optional< DisplayLayoutConfig > defaultLayoutConfig ( ) const
overrideprotectedvirtual

Reimplemented from Display.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close