Modules.ContourBoxplot package

Submodules

Modules.ContourBoxplot.contour_boxplot module

Modules.ContourBoxplot.contour_boxplot.contour_boxplot(binary_images, method='contour_bd', binary_images_depths=None, percentil=95, ax=None, show_median=True, show_outliers=True)[source]

Plot the contour boxplot including the band depth area between the top and bottom contours along with the median contour.

Parameters:

binary_imagesnp.ndarray

3D array of shape (N, H, W) where N is the number of binary images and H, W are the height and width of each image.

methodstr, optional

The method to use for plotting. Options are ‘contour_bd’. Default is ‘contour_bd’.

binary_images_depthsnp.ndarray, optional

1D array of band depths of shape (N,). If None, it will be computed.

percentilfloat, optional

Percentile for the band depth calculation. Default is 100.

axmatplotlib.axes.Axes, optional

Matplotlib Axes object to plot on. If None, a new figure and axes will be created.

show_medianbool, optional

Whether to plot the median contour. Default is True.

show_outliersbool, optional

Whether to plot the outlier contours. Default is True.

Returns:

axmatplotlib.axes.Axes

The Axes object with the plot.

Usage Example:

Modules.ContourBoxplot.contour_boxplot_mesh module

Modules.ContourBoxplot.contour_boxplot_mesh.countour_binary_image(binary_images, depths, outlier_percentile=95, show_non_outliers=True, show_iqr=True, show_firstquartile=True)[source]

Create a contour boxplot mesh from binary images and their depths.

Parameters:

binary_imagesnp.ndarray

3D array of shape (n_images, height, width) containing binary images (0s and 1s)

depthsnp.ndarray

1D array of precomputed depth scores for each image. If None, depths will be computed.

outlier_percentilefloat, optional

Percentile threshold to define outliers. Default is 95.

show_non_outliersbool, optional

If True, highlights non-outlier regions in light gray. Default is True.

show_iqrbool, optional

If True, highlights the interquartile range (IQR) in gray. Default is True.

show_firstquartilebool, optional

If True, highlights the first quartile region in a different shade of gray. Default is True.

Returns:

result_imagenp.ndarray

2D array representing the contour boxplot mesh.

top_contournp.ndarray

2D array representing the top contour of the mesh.

outliersnp.ndarray

3D array containing the outlier images.

Modules.ContourBoxplot.contour_boxplot_stats module

Modules.ContourBoxplot.contour_boxplot_stats.find_percentile(sorted_images, percentile)[source]

Modules.ContourBoxplot.contour_boxplot_vis module

Modules.ContourBoxplot.contour_boxplot_vis.matplotlib_contour_vis(result_image, median=None, outliers=None, ax=None)[source]

Plot the contour boxplot with median and outliers.

Parameters:

result_imagenp.ndarray

2D array representing the contour boxplot image.

mediannp.ndarray, optional

2D binary array representing the median contour. Default is None.

outlierslist of np.ndarray, optional

List of 2D binary arrays representing outlier contours. Default is None.

axmatplotlib.axes.Axes, optional

Matplotlib Axes object to plot on. If None, a new figure and axes will be created.

Returns:

axmatplotlib.axes.Axes

Matplotlib Axes object with the plotted contour boxplot.

Module contents

ContourBoxplot Module

This module provides contour-based boxplot functionality for uncertainty visualization.