ContrastMode

class glue.viewers.common.qt.toolbar_mode.ContrastMode(viewer, **kwargs)[source]

Bases: glue.viewers.common.qt.toolbar_mode.ToolbarModeBase

Uses right mouse button drags to set bias and contrast, DS9-style.

The horizontal position of the mouse sets the bias, the vertical position sets the contrast.

The move_callback defaults to calling _set_norm on the viewer with the instance of ConstrastMode as the sole argument.

Attributes Summary

action_text

enabled

A property that callback functions can be added to.

icon

shortcut

status_tip

tool_id

tool_tip

Methods Summary

activate(self)

Activates all MPL event handlers associated with this mouse mode.

choose_vmin_vmax(self)

close(self)

deactivate(self)

Deactivates all MPL event handlers associated with this mouse mode.

get_clip_percentile(self)

get_vmin_vmax(self)

key(self, event)

Handles key press events.

menu_actions(self)

List of QtWidgets.QActions to be attached to this tool as a context menu.

move(self, event)

MoveEvent.

press(self, event)

Handles mouse presses.

release(self, event)

Handles mouse release events.

set_clip_percentile(self, lo, hi)

Percentiles at which to clip the data at black/white

set_vmin_vmax(self, vmin, vmax)

Attributes Documentation

action_text = 'Contrast'
enabled

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

icon = 'glue_contrast'
shortcut = 'B'
status_tip = None
tool_id = 'image:contrast'
tool_tip = 'Adjust the bias/contrast'

Methods Documentation

activate(self)

Activates all MPL event handlers associated with this mouse mode.

choose_vmin_vmax(self)[source]
close(self)
deactivate(self)

Deactivates all MPL event handlers associated with this mouse mode.

get_clip_percentile(self)[source]
get_vmin_vmax(self)[source]
key(self, event)

Handles key press events.

Calls key_callback method.

Parameters
eventKeyEvent

The event that was triggered

menu_actions(self)[source]

List of QtWidgets.QActions to be attached to this tool as a context menu.

move(self, event)[source]

MoveEvent. Update bias and contrast on Right Mouse button drag

press(self, event)

Handles mouse presses.

Logs mouse position and calls press_callback method.

Parameters
eventMouseEvent

The event that was triggered

release(self, event)

Handles mouse release events.

Logs mouse position and calls release_callback method.

Parameters
eventMouseEvent

The event that was triggered

set_clip_percentile(self, lo, hi)[source]

Percentiles at which to clip the data at black/white

set_vmin_vmax(self, vmin, vmax)[source]