slitflow.fig.figure module
- class Figure(info_path=None)[source]
Bases:
PickleFigure Data saved as matplotlib pickle object.
- EXT = '.fig'
- save_data(data, path)[source]
matplotlib.axes.Axescannot be copied. All figures should be saved as a file after executing each process. You have to use run mode 2.
- class ToTiff(info_path=None)[source]
Bases:
RGBConvert matplotlib figure object to RGB tiff class.
- Parameters:
reqs[0] (Figure) – Figure class containing
matplotlib.figure.Figureobjects.param["dpi"] (int, optional) – Dot per inch of image. Defaults to 400.
param["scalebar"] (list, optional) – [length, left position, bottom position, line width, line color] of the scale bar. Positions should be the relative positions of figure size (0-1). Line color should be [R(0-255), G(0-255), B(0-255)]. This parameter requires “limit”, “size” and “length_unit” to reqs[0].
param["split_depth"] (int) – File split depth number.
- Returns:
Image of figure
- Return type:
- static process(reqs, param)[source]
Convert matplotlib figure object to RGB tiff class.
- Parameters:
reqs[0] (matplotlib.figure.Figure) – Figure object.
param["dpi"] (int, optional) – Dot per inch of image. Defaults to 400.
param["scalebar"] (list, optional) – [length, left position, bottom position, line width, line color] of the scale bar. Positions should be the relative positions of figure size (0-1). Line color should be [R(0-255), G(0-255), B(0-255)]. This parameter requires “limit”, “size” and “length_unit” to reqs[0].
param["limit"] (list of float, optional) – [left, right, bottom, top] limits of figure axes. Required if
scalein param.
- Returns:
Image of figure
- Return type:
- get_stack(fig, dpi)[source]
Convert matplotlib.figure.Figure to numpy.ndarray of RGB image.
- Parameters:
fig (matplotlib.figure.Figure) – Figure object.
dpi (int) – Dot per inch.
- Returns:
RGB image with the shape of (color, height, width)
- Return type: