Module: sarpyx.utils.viz

File: sarpyx/utils/viz.py

No module docstring available; module purpose is inferred from implementation.

Exported Symbols (__all__)

No explicit __all__ list. Public symbols inferred from implementation.

Public Functions (4)

show_image function

Display an image using matplotlib with optional color normalization and colorbar.

File location: sarpyx/utils/viz.py:7

Signature

show_image(image: np.ndarray, title: Optional[str]=None, cmap: Optional[str]=None, vmin: Optional[float]=None, vmax: Optional[float]=None, colorbar: bool=True, ax: Optional[plt.Axes]=None) -> plt.Axes

Parameters

ParameterTypeRequiredDefaultDescription
imagenp.ndarrayyes-Input image to display as numpy array
titleOptional[str]noNoneOptional title to display above the image
cmapOptional[str]noNoneOptional colormap to use for displaying the image
vminOptional[float]noNoneOptional minimum data value for colormap scaling
vmaxOptional[float]noNoneOptional maximum data value for colormap scaling
colorbarboolnoTrueWhether to add a colorbar (default True)
axOptional[plt.Axes]noNoneOptional matplotlib Axes to plot on, if None a new figure will be created

Return Type

plt.Axes

The matplotlib Axes containing the image

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.utils.viz import show_image

result = show_image(image=<image>)

Edge Cases

Includes optional parameters with implementation-defined fallback behavior. Documented return may be None for some execution paths.

image_histogram_equalization function

Perform histogram equalization on an input image.

File location: sarpyx/utils/viz.py:43

Signature

image_histogram_equalization(image: np.ndarray, number_bins: int=8) -> tuple

Parameters

ParameterTypeRequiredDefaultDescription
imagenp.ndarrayyes-Input image as a numpy array.
number_binsintno8Number of bins for the histogram. Defaults to 8.

Return Type

tuple

- Equalized image with the same shape as input. - Cumulative distribution function used for equalization. References: Adapted from http://www.janeriksolem.net/histogram-equalization-with-python-and.html

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.utils.viz import image_histogram_equalization

result = image_histogram_equalization(image=<image>)

Edge Cases

Includes optional parameters with implementation-defined fallback behavior.

show_histogram function

Display a histogram of the pixel values in an image.

File location: sarpyx/utils/viz.py:71

Signature

show_histogram(image: np.ndarray, title: Optional[str]=None, ax: Optional[plt.Axes]=None) -> plt.Axes

Parameters

ParameterTypeRequiredDefaultDescription
imagenp.ndarrayyes-Input image as a numpy array
titleOptional[str]noNoneOptional title for the histogram
axOptional[plt.Axes]noNoneOptional matplotlib Axes to plot on, if None a new figure will be created

Return Type

plt.Axes

The matplotlib Axes containing the histogram

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.utils.viz import show_histogram

result = show_histogram(image=<image>)

Edge Cases

Includes optional parameters with implementation-defined fallback behavior. Documented return may be None for some execution paths.

show_histogram_equalization function

Display the histogram equalization of an image.

File location: sarpyx/utils/viz.py:94

Signature

show_histogram_equalization(image: np.ndarray, number_bins: int=8, title: Optional[str]=None, ax: Optional[plt.Axes]=None) -> plt.Axes

Parameters

ParameterTypeRequiredDefaultDescription
imagenp.ndarrayyes-Input image as a numpy array
number_binsintno8Number of bins for the histogram
titleOptional[str]noNoneOptional title for the histogram
axOptional[plt.Axes]noNoneOptional matplotlib Axes to plot on, if None a new figure will be created

Return Type

plt.Axes

The matplotlib Axes containing the histogram

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.utils.viz import show_histogram_equalization

result = show_histogram_equalization(image=<image>)

Edge Cases

Includes optional parameters with implementation-defined fallback behavior. Documented return may be None for some execution paths.

Public Classes (0)

No public classes detected.