paidiverpy.utils.formating_html#
HTML output utilities for paidiverpy.
Functions#
|
Represents metadata as an HTML string. |
|
Generate HTML representation of the pipeline. |
|
Generate HTML representation of the config. |
|
Generate the HTML representation of the object. |
|
Generate HTML for a single image. |
|
Convert a numpy array to a base64 image. |
|
Style the value based on its type. |
Module Contents#
- paidiverpy.utils.formating_html.metadata_repr(metadata: paidiverpy.metadata_parser.MetadataParser) str[source]#
Represents metadata as an HTML string.
- Parameters:
metadata (MetadataParser) – The metadata object to represent.
- Returns:
String representation of the metadata.
- Return type:
- paidiverpy.utils.formating_html.pipeline_repr(pipeline: paidiverpy.Paidiverpy) str[source]#
Generate HTML representation of the pipeline.
- Parameters:
pipeline (Paidiverpy) – The pipeline instance to represent.
- Returns:
The HTML representation of the pipeline.
- Return type:
- paidiverpy.utils.formating_html.config_repr(config: paidiverpy.config.configuration.Configuration) str[source]#
Generate HTML representation of the config.
- Parameters:
config (Configuration) – The configuration instance to represent.
- Returns:
The HTML representation of the config.
- Return type:
- paidiverpy.utils.formating_html.images_repr(images: paidiverpy.images_layer.ImagesLayer, max_images: int = 12, image_number: int | None = None, html: bool = False) str | IPython.display.HTML[source]#
Generate the HTML representation of the object.
- Parameters:
images (ImagesLayer) – The ImagesLayer object to represent.
max_images (int) – The maximum number of images to show. Defaults to 12.
image_number (int, optional) – The image number to show. Defaults to None.
html (bool) – If True, the output will be in HTML format. Defaults to False.
- Returns:
The HTML representation of the object.
- Return type:
str | HTML
- paidiverpy.utils.formating_html.generate_single_image_html(image_array: numpy.ndarray[Any, Any] | dask.array.core.Array, height: int, width: int, filename: str, step_index: int, image_index: int, size: tuple[int, int] | None, random_id: str) str[source]#
Generate HTML for a single image.
- Parameters:
image_array (np.ndarray | da.core.Array) – The image array
height (int) – The height of the image
width (int) – The width of the image
filename (str) – The filename of the image
step_index (int) – The index of the step
image_index (int) – The index of the image
size (tuple) – The size of the image
random_id (str) – The random id for the image
- Returns:
The HTML for the image
- Return type: