![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/Base/DisplayOptions2d.h>
Configures the display options for 2D slice rendering of images. More...
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.
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 DisplayOptions2d & | operator= (const DisplayOptions2d &other) |
| bool | operator== (const DisplayOptions2d &other) const |
| bool | windowingInitialized () const |
| Returns whether the windowing has been (non-default) initialized. | |
| const Data * | data () 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 ImFusion::DataComponent< DisplayOptions2d > | |
| std::unique_ptr< DataComponentBase > | clone () const override |
| Creates a clone of this data component. | |
| std::unique_ptr< Subclass > | cloneDerived () 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 ImFusion::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 | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
| Public Member Functions inherited from ImFusion::SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (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 ImFusion::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 GlImage * | colormap () const |
| Returns the color map to use during rendering, the pointer is owned by the DisplayOptions2d object, may be 0. | |
| TransferFunction & | transferFunction () |
| Returns the transfer function storing window/level as well as the optional color map. | |
| const TransferFunction & | transferFunction () 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 ImFusion::LazyInstantiatedDataComponent< DisplayOptions2d > | |
| static DisplayOptions2d & | get (const Data &data) |
| Returns the specific options of type T that are associated with the given data. | |
| Protected Member Functions inherited from ImFusion::DataComponentBase | |
| DataComponentBase (const DataComponentBase &)=default | |
| DataComponentBase & | operator= (const DataComponentBase &other)=default |
| Protected Member Functions inherited from ImFusion::SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
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. |
|
explicit |
Standard constructor for the given data.
|
overridevirtual |
Returns a unique string identifier for this type of data component.
Implements ImFusion::DataComponentBase.
|
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.
Reimplemented from ImFusion::Configurable.
|
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.
Reimplemented from ImFusion::Configurable.