OrsWindowLeveling

Manages the interaction for controlling the window leveling (brightness and contrast)

author:

Dragonfly Team

contact:

https://dragonfly.comet.tech

email:

support.dragonfly@comet.tech

organization:

Comet Technologies Canada Inc.

address:

460 Ste-Catherine Ouest, suite 600, Montréal, Québec, Canada, H3B 1A7

copyright:

Comet Technologies Canada Inc. All rights reserved 2023.

date:

Oct 20 2015 11:06

dragonflyVersion:

3.1.0.286 (D)

UUID:

a9e331dc761e11e7bb70448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsWindowLeveling.OrsWindowLeveling.OrsWindowLeveling(*args, **kwargs)
cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

classmethod getColorRangeModeInView(datasetPresenter, view)

Gets the color range mode for a DatasetPresenter

Parameters:
Returns:

colorRangeMode (IntEnum CxvColorRange_Mode) – color range mode

classmethod getGammaInView(datasetPresenter, view)

Gets the gamma for a DatasetPresenter

Parameters:
Returns:

gamma (float) – gamma value. If

classmethod getMainFormClass()

Gets the class of the main form

Returns:

output

classmethod getOpacityGainInView(datasetPresenter, view)

Gets the opacity gain for a DatasetPresenter

Parameters:
Returns:

gain (float) – gains value

classmethod getOpacityInView(datasetPresenter, view)

Gets the opacity for a DatasetPresenter

Parameters:
Returns:

opacity (float) – opacity value

classmethod getOpacityModeInView(datasetPresenter, view)

Gets the opacity mode for a DatasetPresenter

Parameters:
Returns:

opacityMode (IntEnum CxvOpacity_Mode) – opacity mode

getState()

This method is called when saving a plugin instance in a session to obtain the information required to set up the plugin at the loading of the session.

The plugin needs to be savable (see ORSServiceClass.OrsPlugin.abstractPlugin.AbstractPlugin.savable).

Return:

a string of information that will be sent back to the setState method

Rtype:

str

Note

The usage of the character " is not permitted, unless escaped.

classmethod getWLInView(datasetPresenter, view)

Gets the window leveling of a DatasetPresenter

Parameters:
Returns:
  • width (float) – level width

  • center (float) – level center

handleChanged(oldState, newState)

This method is called when the state of the application is changed.

Parameters:
  • oldState (str) – name of the old (previous) state

  • newState (str) – name of the new (current) state

handleTriggered(event)

This method is called on every user input (mouse move, mouse click, key press, …) when the current state of the application is one of those declared by the plugin. This method can be used to perform specific tasks even if no action is currently in progress.

Parameters:

eventData (OrsEvent.eventdata.InputEventData) – the event data

refreshUIFromModel()

Calls the UI to be updated based on the implementation

interfacemethod reset2DWindowLevelFromLayoutGenealogicalName(aSceneLayoutName: str, dataset: Channel) None

Resets the dataset 2D window/level and gamma 2D in layout.

Parameters:
  • aSceneLayoutName (str) – a genealogical name of a scene layout

  • dataset (ORSModel.ors.Channel) – a dataset

interfacemethod reset3DWindowLevelFromLayoutGenealogicalName(aSceneLayoutName: str, dataset: Channel) None

Resets the dataset 3D window/level and gamma 3D in layout.

Parameters:
  • aSceneLayoutName (str) – a genealogical name of a scene layout

  • dataset (ORSModel.ors.Channel) – a dataset

classmethod resetWLAndGamma(datasetPresenter, view)

Resets the Window Leveling and the gamma for a DatasetPresenter

Parameters:
classmethod setColorRangeModeInView(datasetPresenter, view, colorRangeMode)

Sets the color range mode for a DatasetPresenter

Parameters:
classmethod setGainInView(datasetPresenter, view, gain, logging=False)

Sets the opacity gain for a DatasetPresenter

Parameters:
classmethod setGammaInView(datasetPresenter, view, gamma, logging=False)

Sets the gamma for a DatasetPresenter

Parameters:
classmethod setIntensityRangeInView(datasetPresenter, view, minValue, maxValue, logging=False)

Sets the window leveling for a DatasetPresenter

Parameters:
classmethod setOpacityInView(datasetPresenter, view, opacity, logging=False)

Sets the opacity for a DatasetPresenter

Parameters:
classmethod setOpacityModeInView(datasetPresenter, view, opacityMode)

Sets the opacity mode for a DatasetPresenter

Parameters:
setState(state)

This method is called to set up the plugin when loading a session.

Note

This method is called only if the string returned by ORSServiceClass.OrsPlugin.orsPlugin.OrsPlugin.getState() at the saving of the session was not empty.

Parameters:

state (str) – string of information as provided by the getState during the saving of the session

classmethod setWLInView(datasetPresenter, view, width, center, logging=False)

Sets the window leveling for a DatasetPresenter

Parameters: