Module: viewer.utils

skimage.viewer.utils.figimage(image[, ...]) Return figure and axes with figure tightly surrounding image.
skimage.viewer.utils.init_qtapp() Initialize QAppliction.
skimage.viewer.utils.new_plot([parent, ...]) Return new figure and axes.
skimage.viewer.utils.start_qtapp([app]) Start Qt mainloop
skimage.viewer.utils.update_axes_image(...) Update the image displayed by an image plot.
skimage.viewer.utils.ClearColormap(rgb[, ...]) Color map that varies linearly from alpha = 0 to 1
skimage.viewer.utils.FigureCanvas(figure, ...) Canvas for displaying images.
skimage.viewer.utils.LinearColormap(name, ...) LinearSegmentedColormap in which color varies smoothly.
skimage.viewer.utils.RequiredAttr([init_val]) A class attribute that must be set before use.

figimage

skimage.viewer.utils.figimage(image, scale=1, dpi=None, **kwargs)[source]

Return figure and axes with figure tightly surrounding image.

Unlike pyplot.figimage, this actually plots onto an axes object, which fills the figure. Plotting the image onto an axes allows for subsequent overlays of axes artists.

Parameters:

image : array

image to plot

scale : float

If scale is 1, the figure and axes have the same dimension as the image. Smaller values of scale will shrink the figure.

dpi : int

Dots per inch for figure. If None, use the default rcParam.

init_qtapp

skimage.viewer.utils.init_qtapp()[source]

Initialize QAppliction.

The QApplication needs to be initialized before creating any QWidgets

new_plot

skimage.viewer.utils.new_plot(parent=None, subplot_kw=None, **fig_kw)[source]

Return new figure and axes.

Parameters:

parent : QtWidget

Qt widget that displays the plot objects. If None, you must manually call canvas.setParent and pass the parent widget.

subplot_kw : dict

Keyword arguments passed matplotlib.figure.Figure.add_subplot.

fig_kw : dict

Keyword arguments passed matplotlib.figure.Figure.

start_qtapp

skimage.viewer.utils.start_qtapp(app=None)[source]

Start Qt mainloop

update_axes_image

skimage.viewer.utils.update_axes_image(image_axes, image)[source]

Update the image displayed by an image plot.

This sets the image plot’s array and updates its shape appropriately

Parameters:

image_axes : matplotlib.image.AxesImage

Image axes to update.

image : array

Image array.

ClearColormap

class skimage.viewer.utils.ClearColormap(rgb, max_alpha=1, name='clear_color')[source]

Bases: skimage.viewer.utils.core.LinearColormap

Color map that varies linearly from alpha = 0 to 1

__init__(rgb, max_alpha=1, name='clear_color')[source]

FigureCanvas

class skimage.viewer.utils.FigureCanvas(figure, **kwargs)[source]

Bases: object

Canvas for displaying images.

__init__(figure, **kwargs)[source]
resizeEvent(event)[source]

LinearColormap

class skimage.viewer.utils.LinearColormap(name, segmented_data, **kwargs)[source]

Bases: matplotlib.colors.LinearSegmentedColormap

LinearSegmentedColormap in which color varies smoothly.

This class is a simplification of LinearSegmentedColormap, which doesn’t support jumps in color intensities.

Parameters:

name : str

Name of colormap.

segmented_data : dict

Dictionary of ‘red’, ‘green’, ‘blue’, and (optionally) ‘alpha’ values. Each color key contains a list of x, y tuples. x must increase monotonically from 0 to 1 and corresponds to input values for a mappable object (e.g. an image). y corresponds to the color intensity.

__init__(name, segmented_data, **kwargs)[source]

RequiredAttr

class skimage.viewer.utils.RequiredAttr(init_val=None)[source]

Bases: object

A class attribute that must be set before use.

__init__(init_val=None)[source]
instances = {(<skimage.viewer.utils.core.RequiredAttr object at 0x2ba1aa803290>, None): 'Plugin is not attached to ImageViewer', (<skimage.viewer.utils.core.RequiredAttr object at 0x2ba1a8e93190>, None): 'Widget is not attached to a Plugin.'}