health_multimodal.image.data.io

Functions

load_image(path)

Load an image from disk.

remap_to_uint8(array[, percentiles])

Remap values in input so the output range is \([0, 255]\).

health_multimodal.image.data.io.load_image(path)[source]

Load an image from disk.

The image values are remapped to \([0, 255]\) and cast to 8-bit unsigned integers.

Parameters

path (Path) – Path to image.

Return type

Image

Returns

Image as Pillow Image.

health_multimodal.image.data.io.remap_to_uint8(array, percentiles=None)[source]

Remap values in input so the output range is \([0, 255]\).

Percentiles can be used to specify the range of values to remap. This is useful to discard outliers in the input data.

Parameters
  • array (ndarray) – Input array.

  • percentiles (Optional[Tuple[float, float]]) – Percentiles of the input values that will be mapped to 0 and 255. Passing None is equivalent to using percentiles (0, 100) (but faster).

Return type

ndarray

Returns

Array with 0 and 255 as minimum and maximum values.