Module: viewer.utils

ClearColormap

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

Bases: skimage.viewer.utils.core.LinearColormap

Color map that varies linearly from alpha = 0 to 1

__init__(rgb, max_alpha=1, name='clear_color')

LinearColormap

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

Bases: object

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)

MatplotlibCanvas

class skimage.viewer.utils.MatplotlibCanvas(parent, figure, **kwargs)

Bases: object

Canvas for displaying images.

__init__(parent, figure, **kwargs)

RequiredAttr

class skimage.viewer.utils.RequiredAttr(msg)

Bases: object

A class attribute that must be set before use.

__init__(msg)
skimage.viewer.utils.figimage(image[, ...]) Return figure and axes with figure tightly surrounding image.
skimage.viewer.utils.init_qtapp() Initialize QAppliction.
skimage.viewer.utils.start_qtapp() Start Qt mainloop

figimage

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

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()

Initialize QAppliction.

The QApplication needs to be initialized before creating any QWidgets

start_qtapp

skimage.viewer.utils.start_qtapp()

Start Qt mainloop