gingerbread.analytics package#

Submodules#

gingerbread.analytics.analytics_module module#

class gingerbread.analytics.analytics_module.Analytics#

Bases: object

concat_results(results: List[Dict[str, float]]) Dict[str, float] | None#

Concatenates the results of the analytics :param results: List of results :type results: List[Dict[str, float]]

Returns:

Concatenated results

Return type:

Dict[str, float]

convert_class_to_binary(postproc: ndarray, convert_class: int = 1) ndarray | None#

Converts a multiclass postprocessed image to a binary postprocessed image :param postproc: Multiclass postprocessed image :type postproc: np.ndarray

Returns:

Binary postprocessed image

Return type:

np.ndarray

get_units(resolution: ndarray)#

Returns the units of the resolution :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Units of the resolution

Return type:

str

lesion_count(postproc: ndarray) Dict[str, int] | None#

Returns the number of lesions in the postprocessed image :param postproc: Postprocessed image :type postproc: np.ndarray

Returns:

Number of lesions

Return type:

Dict[str, float]

lesion_volume_ml(postproc: ndarray, resolution: ndarray) Dict[str, List[float]] | None#

Returns the volume of each lesion in the postprocessed image :param postproc: Postprocessed image :type postproc: np.ndarray :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Volume of each lesion

Return type:

Dict[str, float]

multiclass_tester(postproc: ndarray)#

Tests if the postprocessed image is multiclass :param postproc: Postprocessed image :type postproc: np.ndarray

Returns:

True if multiclass, False if not

Return type:

Tuple[bool, List[int]] | Tuple[None, None]

run_classification_analytics(postproc: ndarray, resolution: ndarray) Dict[str, str | int | List[float]] | Dict[str, str | Dict[int, List[float]]] | None#

Runs all the classification analytics :param postproc: Postprocessed image :type postproc: np.ndarray :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Dictionary of all the results

Return type:

Dict[str, Union[str, int, List[float]]] | Dict[str, Union[str, Dict[int, List[float]]]]

run_general_analytics(postproc: ndarray, resolution: ndarray) Dict[str, str | int | List[float]] | Dict[str, str | Dict[int, List[float]]] | None#

Runs all the general analytics :param postproc: Postprocessed image :type postproc: np.ndarray :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Dictionary of all the results

Return type:

Dict[str, Union[str, int, List[float]]] | Dict[str, Union[str, Dict[int, List[float]]]]

segmentation_analysis(postproc: ndarray, resolution: ndarray | None) Dict[str, str | int | List[float]] | Dict[str, str | Dict[int, List[float]]] | None#

Runs the segmentation analytics :param postproc: Postprocessed image :type postproc: np.ndarray :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Segmentation analytics

Return type:

Dict[str, Union[str, int, List[float]]] | Dict[str, Union[str, Dict[int, List[float]]]] | None

total_lesion_ml(postproc: ndarray, resolution: ndarray) Dict[str, float] | None#

Returns the total volume of lesions in the postprocessed image :param postproc: Postprocessed image :type postproc: np.ndarray :param resolution: Resolution of the postprocessed image :type resolution: np.ndarray

Returns:

Total volume of lesions

Return type:

Dict[str, float]

Module contents#