clearex.plot.images

Functions

draw_bbox(ax, bbox, axis)

Draw a bounding-box rectangle on the MIP image, given the axis (0, 1, or 2).

draw_points(ax, point, axis)

Draw points on the MIP image.

mips(*channels[, bounding_boxes, filepath, ...])

Display Maximum Intensity Projections (MIPs) for multiple channels.

clearex.plot.images.mips(*channels, bounding_boxes=None, filepath=None, filename=None, block_info=None, points=None, scale_intensity=False, lut='gray', titles=None)

Display Maximum Intensity Projections (MIPs) for multiple channels.

Optionally draws bounding box(es) on the MIPs: one bounding box per channel.

Parameters:
  • *channels (np.ndarray or bool) – Multiple channels to display

  • bounding_boxes (list or tuple of 6-tuples, optional) – Each bounding box should be (zmin, ymin, xmin, zmax, ymax, xmax). The i-th bounding box corresponds to channels[i]. If None, no bounding boxes are drawn.

  • filepath (str, optional) – If provided, save the plot to this directory.

  • filename (str, optional) – If provided, save the plot with this filename.

  • block_info (sequence of dict, optional) – Dask block metadata used to prefix saved filenames.

  • points (sequence of np.ndarray, optional) – Each element is an array of shape (N,3) containing (z, y, x) coordinates for detected blobs corresponding to each channel.

  • scale_intensity (bool or float, optional) – If False, do not scale the intensity of the images. If a float, scale the intensity of the images to this value (e.g., 0.0 - 1.0)

  • lut (str, optional) – The lookup table to use for the image. Default is ‘gray’. Other options include ‘nipy_spectral’, ‘viridis’, ‘plasma’, ‘inferno’, ‘magma’, ‘cividis’…

  • titles (sequence of str, optional) – Titles for each channel. If provided, should have the same length as channels.

Return type:

None

clearex.plot.images.draw_points(ax, point, axis)

Draw points on the MIP image.

Parameters:
  • ax (plt.subplot) – The axis to draw the points on.

  • point (np.ndarray) – The points to draw.

  • axis (int) – The axis along which the MIP was taken (0, 1, or 2)

Return type:

None

clearex.plot.images.draw_bbox(ax, bbox, axis)

Draw a bounding-box rectangle on the MIP image, given the axis (0, 1, or 2).

Parameters:
  • ax (matplotlib.axes.Axes) – The axis to draw the bounding box on.

  • bbox (tuple of 6 ints) – The bounding box to draw. (zmin, ymin, xmin, zmax, ymax, xmax)

  • axis (int) – The axis along which the MIP was taken (0, 1, or 2)

Return type:

None