ImFusion SDK 4.3
DisplayOptions2d Class Reference

#include <ImFusion/Base/DisplayOptions2d.h>

Configures the display options for 2D slice rendering of images. More...

+ Inheritance diagram for DisplayOptions2d:

Detailed Description

Configures the display options for 2D slice rendering of images.

2D display options are mainly consumed by GlSlice which implements 2D rendering of image data. Usually, DisplayOptions2d are attached as a DataComponent to the image for which they define the rendering options. However, classes like ImageView2D may use special (e.g. view-specific) display options for rendering their images and therefore use the same interface.

Note
Window/level parameters are defined in original pixel value domain (e.g. Hounsfield Units). Conversion of pixel values to display intensities is performed using the LINEAR_EXACT VOI LUT function as described in section C.11.2.1.3.2 of the DICOM standard. http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.11.2.html#sect_C.11.2.1.3
See also
GlSlice, ImageView2D, DisplayOptions3d

Classes

struct  WindowLevelPreset
 Window-level configuration that can be stored as a preset. More...
 

Public Types

enum class  MaskingMode {
  Ignore , Discard , AdditiveBlend , MultiplicativeBlend ,
  DiscardZerosAdditiveOnes , DiscardZerosMultiplicativeOnes
}
 Enumeration of options for how masked image pixels should be rendered. More...
 

Public Member Functions

 DisplayOptions2d (const DisplayOptions2d &other)
 
 DisplayOptions2d (const Data *data)
 Standard constructor for the given data.
 
virtual DisplayOptions2doperator= (const DisplayOptions2d &other)
 
bool operator== (const DisplayOptions2d &other) const
 
bool windowingInitialized () const
 Returns whether the windowing has been (non-default) initialized.
 
const Datadata () const
 Return the optional reference Data.
 
void setOriginalTransferFunction (const TransferFunction &lut)
 Setter and getter for the original LUT-Transfer Function of this data.
 
const std::optional< TransferFunction > & originalTransferFunction ()
 
- Public Member Functions inherited from DataComponent< DisplayOptions2d >
std::unique_ptr< DataComponentBaseclone () const override
 Creates a clone of this data component.
 
std::unique_ptr< SubclasscloneDerived () const
 
bool assign (const DataComponentBase &other) override
 Assigns the content of other to this data component.
 
bool equals (const DataComponentBase &other) const override
 Compares this data component to other for equality.
 
- 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
 
- 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 Attributes

Signal< DisplayOptions2d * > signalChanged
 Signal emitted when the display options have changed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Getters/Setters

double window () const
 Returns the windowing width corresponding to the image.
 
void setWindow (double value)
 Sets the windowing width corresponding to the image.
 
double level () const
 Returns the windowing level corresponding to the image.
 
void setLevel (double value)
 Sets the windowing level corresponding to the image.
 
void setWindowLevel (double window, double level)
 Convenience method for setting the windowing range based on window and level.
 
double alpha () const
 Returns the alpha blending factor of the corresponding image.
 
void setAlpha (double value)
 Sets the alpha blending factor of the corresponding image.
 
double gamma () const
 Returns the gamma level corresponding to the image.
 
void setGamma (double value)
 Sets the gamma level corresponding to the image.
 
bool invert () const
 Returns the flag whether to invert the intensities.
 
void setInvert (bool value)
 Sets the flag whether to invert the intensities.
 
MaskingMode maskingMode () const
 Returns the mode how masked image pixels should be rendered.
 
void setMaskingMode (MaskingMode value)
 Sets the mode how masked image pixels should be rendered.
 
const vec4 & maskingColor () const
 Returns the color used for the Multiply options of maskingMode().
 
void setMaskingColor (const vec4 &value)
 Sets the color used for the Multiply options of maskingMode().
 
const GlImagecolormap () const
 Returns the color map to use during rendering, the pointer is owned by the DisplayOptions2d object, may be 0.
 
TransferFunctiontransferFunction ()
 Returns the transfer function storing window/level as well as the optional color map.
 
const TransferFunctiontransferFunction () const
 Returns the transfer function storing window/level as well as the optional color map.
 

Manage window/level presets

const std::vector< WindowLevelPreset > & windowLevelPresets () const
 Returns the list of window-level presets.
 
void addWindowLevelPreset (WindowLevelPreset preset)
 Adds a new window-level preset.
 
void removeWindowLevelPreset (int index)
 Removes the window-level preset of the given index.
 
void applyWindowLevelPreset (int index)
 Applies the window-level preset of the given index.
 

DataComponent interface

std::string id () const override
 Returns a unique string identifier for this type of data component.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from LazyInstantiatedDataComponent< DisplayOptions2d >
static DisplayOptions2dget (const Data &data)
 Returns the specific options of type T that are associated with the given data.
 
static DisplayOptions2dget (const Data *data)
 Returns the specific options of type T that are associated with the given data.
 
- Protected Member Functions inherited from DataComponentBase
 DataComponentBase (const DataComponentBase &)=default
 
DataComponentBaseoperator= (const DataComponentBase &other)=default
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Enumeration Documentation

◆ MaskingMode

enum class MaskingMode
strong

Enumeration of options for how masked image pixels should be rendered.

Enumerator
Ignore 

Ignore the mask, render the pixels normally.

Discard 

Discard masked pixels (where the mask value is 0)

AdditiveBlend 

Add maskingColor() to masked pixels (where the mask value is 0)

MultiplicativeBlend 

Multiply masked pixels with the maskingColor() (where the mask value is 0)

DiscardZerosAdditiveOnes 

Discard pixels where the mask value is 0, add maskingColor() to pixels where the mask value is 1.

DiscardZerosMultiplicativeOnes 

Discard pixels where the mask value is 0, multiply pixels with maskingColor() where the mask value is 1.

Constructor & Destructor Documentation

◆ DisplayOptions2d()

DisplayOptions2d ( const Data * data)
explicit

Standard constructor for the given data.

Note
If data is not null and a SharedImageSet, window/level will be initialized to match the value range of the underlying image type without considering any actual pixel data. In all other cases it will be initialized to match a value range of [0..255].

Member Function Documentation

◆ id()

std::string id ( ) const
overridevirtual

Returns a unique string identifier for this type of data component.

Note
To avoid conflicts make sure to include potential plugin names into this ID. Due to the modular architecture of the ImFusion library, uniqueness of IDs cannot be checked at compile time. However, DataComponentFactory will check the uniqueness of the ID during registration.

Implements DataComponentBase.

◆ 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.


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