plenoptic.plot.pyrshow#

plenoptic.plot.pyrshow(pyr_coeffs, vrange='indep1', zoom=1, show_residuals=True, cmap=None, plot_complex='rectangular', batch_idx=0, channel_idx=0, **kwargs)[source]#

Display steerable pyramid coefficients in orderly fashion.

This function uses imshow to show the coefficients of the steeable pyramid (or any dictionary in the standard format), such that each scale shows up on a single row, with each scale in a given column.

Note that unlike imshow, we can only show one batch or channel at a time.

Parameters:
  • pyr_coeffs (dict) – Pyramid coefficients in the standard dictionary format as returned by the steerable pyramid’s forward method.

  • vrange (tuple[float, float] | str (default: 'indep1')) –

    If a 2-tuple, specifies the image values vmin/vmax that are mapped to the minimum and maximum value of the colormap, respectively. If a string:

    • "auto0": All images have same vmin/vmax, which have the same absolute value, and come from the minimum or maximum across all images, whichever has the larger absolute value.

    • "auto1": All images have same vmin/vmax, which are the minimum/maximum values across all images.

    • "auto2": All images have same vmin/vmax, which are the mean (across all images) minus/ plus 2 std dev (across all images).

    • "auto3": All images have same vmin/vmax, chosen so as to map the 10th/90th percentile values to the 10th/90th percentile of the display intensity range. For example: vmin is the 10th percentile image value minus 1/8 times the difference between the 90th and 10th percentile.

    • "indep0": Each image has an independent vmin/vmax, which have the same absolute value, which comes from either their minimum or maximum value, whichever has the larger absolute value.

    • "indep1": Each image has an independent vmin/vmax, which are their minimum/maximum values.

    • "indep2": Each image has an independent vmin/vmax, which is their mean minus/plus 2 std dev.

    • "indep3": Each image has an independent vmin/vmax, chosen so that the 10th/90th percentile values map to the 10th/90th percentile intensities.

  • zoom (float (default: 1)) – Ratio of display pixels to image pixels. if greater than 1, must be an integer. If less than 1, must be 1/d where d is a a divisor of the size of the largest image.

  • show_residuals (bool (default: True)) – Whether to display the residual bands.

  • cmap (Colormap | None (default: None)) – Colormap to use when showing these images.

  • plot_complex (Literal['rectangular', 'polar', 'logpolar'] (default: 'rectangular')) –

    Specifies handling of complex values.

    • "rectangular": plot real and imaginary components as separate images.

    • "polar": plot amplitude and phase as separate images.

    • "logpolar": plot log (base 2) amplitude and phase as separate images.

  • batch_idx (int (default: 0)) – Which element from the batch dimension to plot.

  • channel_idx (int (default: 0)) – Which element from the channel dimension to plot.

  • **kwargs (Any) – Passed on to pyrtools.tools.display.pyrshow.

Return type:

PyrFigure

Returns:

fig – The figure displaying the coefficients.

Raises:

TypeError – If batch_idx or channel_idx takes an illegal value.