phenotypic.data.load_synthetic_colony#

phenotypic.data.load_synthetic_colony(mode: Literal['array', 'Image'] = 'array') np.ndarray | Image[source]#

Loads synthetic colony data from a pre-saved file and returns it in the specified mode.

This function provides two modes for handling the synthetic colony data: ‘array’ and ‘Image’. Depending on the mode specified, it either returns the array directly or converts it into an Image object. When ‘Image’ mode is selected, the object mask is also applied to the Image object.

Parameters:

mode (Literal['array', 'Image']) – Specifies the format in which the synthetic colony data should be returned. Use ‘array’ to return the raw data as an array or ‘Image’ to return an Image object with the corresponding objmask.

Returns:

The synthetic colony data, either as a numpy array or an Image object, depending on the specified mode.

Return type:

Union[np.ndarray, Image]

Raises:

ValueError – If the mode is neither ‘array’ nor ‘Image’.

Example

Load synthetic colony data as a NumPy array or Image object
>>> from phenotypic.data import load_synthetic_colony
>>> img = load_synthetic_colony(mode='array')