ImFusion C++ SDK 4.4.0
ImFusion::Settings Class Reference

#include <ImFusion/Base/Settings.h>

This class provides a way for getting and setting base settings for ImFusionLib. More...

Inheritance diagram for ImFusion::Settings:

Detailed Description

This class provides a way for getting and setting base settings for ImFusionLib.

A Settings object should only be instantiated once GlobalSettings has been initialized.

bool showToolbarText = Settings().showToolbarText; // read from global settings
Settings().showToolbarText = true; // write to global settings
Settings()
Creates a new Settings object.
Setting< bool > showToolbarText
Settings of the ImFusionSuite.
Definition Settings.h:133

This class also provides two deprecated interfaces:

Deprecated
Setting is a type-safe way to access a setting value. A typical usage would require you to inherit from the Settings class, and pass the m_settings member to the Setting constructor for each of your Setting members. You can then use your Settings-derived class to access the settings in a similar manner to this class. Instead of this, it is recommended that you simply (de-)serialize your Configurable classes directly using GlobalSettings.
See also
GlobalSettings
Deprecated
addCustomSettings() is a way to register custom settings so they can be controlled through the SettingsDialog. Use SettingsDialog::addCustomSettings() instead.

Classes

struct  LegacyInterfaceSettings
class  Setting
 Provides a type-safe way to access a setting value. More...

Public Types

enum class  AnimationSpeed : int {
  VerySlow = 0 , Slow = 1 , Normal = 2 , Fast = 3 ,
  VeryFast = 4
}
enum class  OrientationMeshType : int { Cube = 0 , Head = 1 , Body = 2 }
enum class  DicomOrientationType : int { Biped = 0 , Quadruped = 1 }

Public Member Functions

 Settings ()
 Creates a new Settings object.
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 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

Static Public Member Functions

static double animationDurationScale (AnimationSpeed speed)
 Converts AnimationSpeed to a scale factor the animation duration should be multiplied with, e.g.
static void addCustomSettings (const Properties &p, bool ioSettings=false)
 Adds customs settings.

Protected Attributes

struct ImFusion::Settings::LegacyInterfaceSettings m_settings
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
Setting< bool > showToolbarText
 Settings of the ImFusionSuite.
Setting< bool > showLoadOptionsOnStart
Setting< bool > showAnnotationsOnStart
Setting< bool > ignorePatientTransform
Setting< bool > showWindowingMinMax
Setting< bool > alwaysShowController
Setting< bool > launchSetModalityWhenLoadingImages
Setting< bool > showConfirmationCloseAll
Setting< bool > removePropertyDefaultsOnSave
Setting< bool > removeEmptyPropertiesOnSave
Setting< bool > rememberControllerLocation
Setting< std::stringvolumeRendererDefault
Setting< int > volumeRendererInteractionLod
Setting< int > volumeRendererInteractionLodSizeThreshold
Setting< bool > orientViewsToNormalOnClick
 if true, orient slices to normal to surface on double click
Setting< int > volumeRendererMaxVolumes
Setting< int > volumeRendererMode
Setting< int > defaultPixelInterpolationMode
 0 for nearest neighbor, 1 for linear, 2 for cubic
Setting< bool > sliceThickness
Setting< bool > showOffscreenIndicators
Setting< bool > animationsEnabled
Setting< int > animationSpeed
 0: very slow, 1: slow, 2: normal, 3: fast, 4: very fast
Setting< bool > showPointsAsCrosses
Setting< int > customUiScaling
Setting< int > patientInfoVisibility
Setting< std::stringpatientInfoFormatString
Setting< int > scaleInfoVisibility
Setting< bool > sliceIntersectionLines
Setting< vec4 > bgColor
Setting< vec4 > primarySliceBlendingColor
Setting< vec4 > secondarySliceBlendingColor
Setting< bool > showOrientationMarkersInMpr
Setting< int > orientationMesh
Setting< bool > useWorkspaceForDefaultSavePath
Setting< std::stringdefaultFolderMLModels
Setting< int > logLevel
Setting< int > maxLogFileSizeMB
 Maximum log file size in MB for log rotation, 0 to disable.
Setting< bool > dataWidgetQuickSelection
 "Visibility follow Selection" setting of DataWidget
Setting< bool > dataWidgetAutoLinkWindowing
 "Auto Link Windowing per Modality" setting of DataWidget
Setting< bool > dataWidgetAutoLinkPose
 "Auto Link Pose per Group" setting of DataWidget
Setting< bool > dataWidgetShowThumbnails
 Show thumbnails in DataWidget.
Setting< bool > showPixelInfoOverlay
Setting< bool > showPixelInfoOverlayUnits
Setting< bool > showPixelInfoOverlayStorageValues
Setting< bool > showPixelInfoOverlayLabelNames
Setting< int > pixelInfoOverlayMode
Setting< int > pixelInfoOverlayStyle
Setting< std::stringlicenseKey
Setting< std::stringlicenseToken
Setting< std::stringlicenseExpirationDate
Setting< std::stringlicenseProxyAddress
Setting< int > defaultDicomOrientationType
Setting< int > trackingQualityOverlayMode
 0: all, 1: only main, 2: auto (all until 3), 3: none
Setting< bool > useNativeOpenDialog
 if true, uses the open dialog from the OS, else uses the custom one (default false)
Setting< int > dataGroupingOption
 Option for grouping data via the DataGroupingModel.
Setting< bool > showToolbarQuitButton
 Shows/Hides the Quit Button at the right end of the ToolBar in the MainWindow.
Setting< bool > showSliceIndexInMPR
 Shows/Hides the slice index in the MPR views.

Additional Inherited Members

Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.

Member Function Documentation

◆ animationDurationScale()

double ImFusion::Settings::animationDurationScale ( AnimationSpeed speed)
static

Converts AnimationSpeed to a scale factor the animation duration should be multiplied with, e.g.

a scale factor of 2.0 should make the animation take twice as long

◆ configure()

void ImFusion::Settings::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 ImFusion::Configurable.

◆ configuration()

void ImFusion::Settings::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 ImFusion::Configurable.

◆ addCustomSettings()

void ImFusion::Settings::addCustomSettings ( const Properties & p,
bool ioSettings = false )
static

Adds customs settings.

Custom settings can be used by Plugins to register their own settings so that they are known to the rest of the framework (e.g. displayed in the SettingsDialog).

Custom settings will only affect the behaviour of the configuration/configure, which will contain the properties for the custom settings.

Example:

Properties p("Example"); // name of the custom settings
p.setParam("foo", 10, 10); // add a setting 'foo' with a initial and a default value of 10
...
Settings s;
s.configuration(&p);
int foo;
if (s.param("Example/foo", foo))
...
Storage container for serialization of arbitrary types, internally backed by strings.
Definition Properties.h:50
static void addCustomSettings(const Properties &p, bool ioSettings=false)
Adds customs settings.

The recommended way to add settings to a plugin is derive from Settings:

class YourPluginSettings: public Settings
{
public:
Setting<int> yourSetting;
YourPluginSettings():
yourSetting(m_settings, "YourPlugin/yourSetting", 10)
{}
// this method should be called in the Plugin constructor
static void registerCustomSettings()
{
Properties config("YourPlugin");
config.setParam("yourSetting", 10, 10);
// optionally set some attributes for the GUI:
config.setParamAttributes("yourSetting", 'min: 0, max: 20'");
Settings::addCustomSettings(config);
}
}
Provides a type-safe way to access a setting value.
Definition Settings.h:80

The default value of a param will be used when a setting is reset through the SettingsDialog. In general you want to make sure that the default value in the Properties is the same as in the Setting instance.

Custom settings are only available after calling this method. Even if the backend contains values for the custom setting, they will not be part of the configuration and will not be configured until addCustomSettings is called. This method should therefore be called in the Plugin constructor. If there is already a custom setting with same name, it will be overwritten.

If ioSettings is true, the custom settings will be displayed under the Import/Export section of the GUI.

Deprecated
"Use SettingsDialog::addCustomSettings"

The documentation for this class was generated from the following file:
  • ImFusion/Base/Settings.h
Search Tab / S to search, Esc to close