sparrow.pl.tiling_correction

sparrow.pl.tiling_correction#

sparrow.pl.tiling_correction(sdata, img_layer=['raw_image', 'tiling_correction'], channel=None, crd=None, figsize=None, img_title=True, channel_title=True, output=None)#

Visualizes the effect of tiling correction.

This function plots the uncorrected image layer of a SpatialData object alongside the tiling corrected version, allowing for a visual comparison between the two. This can be useful for assessing the effectiveness of tiling correction methods applied to an image layer of a SpatialData object.

Parameters:
  • sdata (SpatialData) – Data containing spatial information for plotting.

  • img_layer (tuple[str, str] (default: ['raw_image', 'tiling_correction'])) – Tuple where the first string represents the layer name for the uncorrected image and the second string represents the layer name for the tiling corrected image. Default is [“raw_image”, “tiling_correction”]. Images will be plotted next to each other.

  • channel (Union[int, Iterable[int], None] (default: None)) – Specifies the channel or channels to visualize. If not provided, all channels are used.

  • crd (Optional[tuple[int, int, int, int]] (default: None)) – The coordinates for a region of interest in the format (xmin, xmax, ymin, ymax). If provided, only this region is visualized, by default None.

  • figsize (Optional[tuple[int, int]] (default: None)) – Size of the generated figure for visualization.

  • img_title (default: True) – Whether to display the image title on the visualization, by default True.

  • channel_title (default: True) – Whether to display the channel title on the visualization, by default True.

  • output (Union[str, Path, None] (default: None)) – Path where the generated visualization will be saved. If not provided, the visualization is only displayed and not saved.

Return type:

None

Returns:

: None

Examples

>>> sdata = SpatialData(...)
>>> tiling_correction(sdata, img_layer=["original", "corrected"], crd=(2000, 4000, 2000, 4000))