qubalab.display package
qubalab.display.plot module
- qubalab.display.plot.plotImage(ax: Axes, image: ndarray, channel: int = 0, offset: tuple | None = None) Axes
A utility function to display a NumPy array returned by an ImageServer.
- Parameters:
ax – the Axes to plot to
image – a numpy array with dimensions (c, y, x). If it represents a RGB image, all channels will be displayed. Otherwise, only the specified channel will be displayed
channel – the channel to display if the image is not RGB
offset – an offset [x_min, y_min, x_max, y_max] to apply to the image. Useful if the image should match some features. None to not define any offset
- Returns:
the Axes where the image was plotted
- qubalab.display.plot.plotImageFeatures(ax: Axes, image_features: list[ImageFeature], region: GeoJSON | None = None, default_color: tuple = (0.2, 0.8, 0.2), fill_opacity: float = 0.25) Axes
A utility function to display a image features. This will plot the object’s geometries and nucleus geometries.
- Parameters:
ax – the Axes to plot to
image_features – the image features to plot
region – the region to plot. Features outside this region won’t be plotted. All features are plotted if this parameter is undefined.
default_color – the color to use for unclassified features
fill_opacity – the opacity of the fill color. Set to 0 to not fill objects
- Returns:
the Axes where the image was plotted