PartSeg.common_gui.channel_control

This module contains widgets used to control channel information like channel visibility, cololrmap selection, decision if use fixed range or image minimum/maximum brightness, using gauss blur.

Note

Future plans: add histogram.

class PartSeg.common_gui.channel_control.BlurInfoWidget(size=25, margin=1)[source]

Bases: QWidget

Widget used to present info about blur selection in class ColorComboBox.

paintEvent(a0)[source]
Return type

None

class PartSeg.common_gui.channel_control.ChannelProperty(settings, start_name)[source]

Bases: QWidget

For manipulate chanel properties.
  1. Apply gaussian blur to channel

  2. Fixed range for coloring

In future should be extended

Parameters
  • settings (ViewSettings) – for storing internal state. allow keep state between sessions

  • start_name (str) – name used to select proper information from settings object. Introduced for case with multiple image view.

change_current(name, channel)[source]

Change to show values connected with channel channel from viewer viewer

Parameters
  • name (str) – name of viewer

  • channel (int) – channel to which data should be presented

Return type

None

register_widget(widget)[source]

Register new viewer by its color combo box group

Parameters

widget (ColorComboBoxGroup) – viewer widget for color control

Return type

None

send_info()[source]

send info to

class PartSeg.common_gui.channel_control.ColorComboBox(id_num, colors, color_dict, colormap='', base_height=50, lock=False, blur=NoiseFilterType.No, gamma=1)[source]

Bases: QComboBox

Combobox showing colormap instead of text

Parameters
  • id_num (int) – id which be emmit in signals. Designed to inform which channel information is changed

  • colors (List[str]) – list of colors which should be able to choose. All needs to be keys in color_dict

  • color_dict (MutableMapping[str, Tuple[Colormap, bool]]) – dict from name to colormap definition

  • colormap (str) – initial colormap

  • base_height – initial height of widget

  • lock – show lock padlock to inform that fixed range is used

  • blur – show info about blur selected

change_colors(colors)[source]

change list of colormaps to choose

channel_colormap_changed(int, str)

Signal with information about colormap change. (ch_num, name_of_colormap)

channel_visible_changed(int, bool)

Signal with information about change of channel visibility (ch_num, visible)

clicked(int)

Information about mouse click event on widget

property colormap_changed

alias for signal, return color name

enterEvent(event)[source]
property is_blur

check if blur property is set

is_checked()[source]

check if checkbox on widget is checked

property is_lock

check if lock property is set

leaveEvent(event)[source]
minimumSizeHint(self) QSize[source]
mouseMoveEvent(self, a0: QMouseEvent)[source]
mousePressEvent(event)[source]
paintEvent(event)[source]
property set_blur: Callable[[bool], None]

set blur property

Return type

Callable[[bool], None]

set_color(val)[source]

set current colormap

property set_gamma: Callable[[bool], None]

set lock property

Return type

Callable[[bool], None]

property set_lock: Callable[[bool], None]

set lock property

Return type

Callable[[bool], None]

set_selection(val)[source]

set element selected (add frame)

showEvent(_event)[source]
class PartSeg.common_gui.channel_control.ColorComboBoxGroup(settings, viewer_name, channel_property=None, height=40)[source]

Bases: QWidget

Group of ColorComboBox for control visibility and chose colormap for channels.

change_channel(str, int)

information which channel change

coloring_update

information about global change of coloring

property current_colormaps: List[Optional[napari.utils.colormaps.colormap.Colormap]]

List of current colormaps. None if channel is not selected

Return type

List[Optional[Colormap]]

property current_colors: List[Optional[str]]

List of current colors. None if channel is not selected.

Return type

List[Optional[str]]

parameters_changed(channel)[source]

for ChannelProperty to inform about change of parameters

property selected_colormaps: List[napari.utils.colormaps.colormap.Colormap]

For each channel give information about selected colormap by name

Return type

List[Colormap]

set_channels(num)[source]

Set number of channels to display

update_channels()[source]

update number of channels base on settings

update_color_list(colors=None)[source]

Update list of available colormaps in each selector

update_colors()[source]

For each channel update colormap to reflect settings

class PartSeg.common_gui.channel_control.ColorStyledDelegate(base_height, color_dict, **kwargs)[source]

Bases: QStyledItemDelegate

Class for paint ColorComboBox elements when list trigger

Parameters
paint(painter, style, model)[source]
sizeHint(style, model)[source]
class PartSeg.common_gui.channel_control.GammaInfoWidget(size=25, margin=2)[source]

Bases: QWidget

paintEvent(a0)[source]
Return type

None

class PartSeg.common_gui.channel_control.LockedInfoWidget(size=25, margin=1)[source]

Bases: QWidget

Widget used to present info about lock selection in class ColorComboBox.

paintEvent(a0)[source]
Return type

None