slitflow.fig.image module

class Gray(info_path=None)[source]

Bases: Figure

Create a pseudo color map from a grayscale image.

Caution

The image should be split into a single-frame image. In other words, the shape of reqs[0] in process() should be (1, height, width).

Parameters:
  • reqs[0] (Image) – Image to create image Figure. Required params; img_size, pitch.

  • param["lut_limits"] (list of float, optional) – Lower and upper limit of LUT. Defaults to [0, 1].

  • param["cmap"] (str or list of int, optional) – Color map name for matplotlib.colormaps. , or list of RGB values where each integer value is between 0 and 255. e.g. [255, 0, 0 ] for red. Defaults to “gray”.

  • param["split_depth"] (int) – The file split depth number.

Returns:

matplotlib Figure containing pseudo color image.

Return type:

Figure

set_info(param={})[source]

Copy info from reqs[0] and add parameters.

static process(reqs, param)[source]

Create pseudo color map from a gray scale image array.

Parameters:
  • reqs[0] (numpy.ndarray) – Image to create image figure.

  • param["lut_limits"] (list of float) – Lower and upper limit of LUT.

  • param["cmap"] (str or list of int, optional) –

    Color map name for matplotlib.colormaps. , or list of RGB values where each integer value is between 0 and 255. e.g. [255, 0, 0 ] for red. Defaults to “gray”.

  • param["pitch"] (float) – The pixel size in length_unit/pix.

  • param["img_size"] (list of int) – The width and height of each image (pixels).

Returns:

matplotlib Figure containing pseudo color image.

Return type:

matplotlib.figure.Figure