harpy.pl.pixel_clusters

Contents

harpy.pl.pixel_clusters#

harpy.pl.pixel_clusters(sdata, labels_name, crd=None, to_coordinate_system='global', ax=None, output=None, render_labels_kwargs=mappingproxy({}), **kwargs)#

Visualize spatial distribution of pixel clusters based on labels in a SpatialData object, obtained using harpy.im.flowsom().

Parameters:
  • sdata (SpatialData) – The input SpatialData object.

  • labels_name (str) – The labels element in sdata used to identify clusters.

  • crd (tuple[int, int, int, int] | None (default: None)) – The coordinates for the region of interest in the format (xmin, xmax, ymin, ymax). If None, the entire image is considered, by default None.

  • to_coordinate_system (str (default: 'global')) – Coordinate system to plot.

  • ax (Axes | None (default: None)) – Matplotlib axes object to plot on. If None, a new figure is created.

  • output (str | Path | None (default: None)) – The path to save the generated plot.

  • render_labels_kwargs (Mapping[str, Any] (default: mappingproxy({}))) – Additional keyword arguments passed to sdata.pl.render_labels, such as cmap or alpha.

  • **kwargs – Additional keyword arguments passed to sdata.pl.render_labels.pl.show, such as dpi or title.

Return type:

Axes

Returns:

: The axes object containing the pixel clusters.

Raises:

ValueError – If the cropped spatial element derived from crd is None.

See also

harpy.im.flowsom