OrsWindowLeveling

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

author:ORS Team
contact:http://theobjects.com
email:info@theobjects.com
organization:Object Research Systems (ORS), Inc.
address:460 Ste-Catherine Ouest, suite 600, Montréal, Québec, Canada, H3B 1A7
copyright:Object Research Systems (ORS), Inc. All rights reserved 2021.
date:Oct 20 2015 11:06
dragonflyVersion:
 3.1.0.286 (D)
UUID:a9e331dc761e11e7bb70448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsWindowLeveling.OrsWindowLeveling.OrsWindowLeveling(varName=None)
OrsStateLeveling = 'OrsStateLeveling'
OrsStateLevelingActivation()
OrsStateLevelingInfinite = 'OrsStateLevelingInfinite'
OrsStateLevelingInfiniteActivation()
OrsStateWLGamma = 'OrsStateWLGamma'
OrsStateWindowLevelingAreaSelection = 'OrsStateWindowLevelingAreaSelection'
OrsStateWindowLevelingAreaSelectionAction()
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
classmethod addControlPoint(anAnnotation, timeStep, position)
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.

computeOptimalLevelingWithRegion()
enterTemporaryLevelingAction()
enterTemporaryWLGammaAction()
enterWindowLevelingAreaSelectionGlobalStateAction()
classmethod getColorRangeModeInView(datasetPresenter, view)

Gets the color range mode for a DatasetPresenter

Parameters:
Returns:

colorRangeMode (IntEnum CxvColorRange_Mode) – color range mode

getCurrentChannel()
getCurrentLUT()
getCurrentViewAndDatasetPresenter()
classmethod getGammaInView(datasetPresenter, view)

Gets the gamma for a DatasetPresenter

Parameters:
Returns:

gamma (float) – gamma value. If

getKeepCurrentDatasetPresenter()
classmethod getMainFormClass()

Gets the class of the main form

Returns:output
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

getShowDatasetTitle()
getShowGroupBoxColorMapping()
getShowGroupBoxOpacityMapping()
getShowLUTController()
getShowPinButton()
getShowStartNewWLPlugin()
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
keepAlive = False
multiple = True
orsCurrentDisplayChange()
orsSelectedObjectChange()
pluginStateSeparator = '<separator_OrsWindowLeveling>'
refreshUIFromModel()

Calls the UI to be updated based on the implementation

interfacemethod reset2DWindowLevelFromLayoutGenealogicalName(aSceneLayoutName, dataset)

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, dataset)

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:
savable = True
classmethod setColorRangeModeInView(datasetPresenter, view, colorRangeMode)

Sets the color range mode 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:
setKeepCurrentDatasetPresenter(keepCurrentDatasetPresenter)
setLUTAsLUTOnCurrentViewAndDatasetPresenter(aLUT, logging=False)
setLUTOnCurrentViewAndDatasetPresenter(aLUT)
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:
setShowDatasetTitle(isVisible)
setShowGroupBoxColorMapping(isVisible)
setShowGroupBoxOpacityMapping(isVisible)
setShowLUTController(isVisible)
setShowPinButton(isVisible)
setShowStartNewWLPlugin(isVisible)
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:
startNewPluginInstance(openMainForm=True)
stateDescriptors = [<ORSServiceClass.OrsPlugin.statedescriptor.StateDescriptor object>, <ORSServiceClass.OrsPlugin.statedescriptor.StateDescriptor object>, <ORSServiceClass.OrsPlugin.statedescriptor.StateDescriptor object>, <ORSServiceClass.OrsPlugin.statedescriptor.StateDescriptor object>]
switchToOrsStateLevelingAction()
temporaryWindowLevelingAreaSelectionAction()