Skip to content

hgsc_cancer_he

hgsc_cancer_he

hgsc_cancer_he() -> np.ndarray

A 1500x1500 H&E image of HGSC containing a tumor nest.

Returns:

Type Description
ndarray

RGB uint8 image with shape (1500, 1500, 3) and values in [0, 255].

Note

Pairs with:

  • hgsc_cancer_nuclei()
  • hgsc_cancer_inst_mask()
  • hgsc_cancer_type_mask()

Examples:

>>> import matplotlib.pyplot as plt
>>> from histolytics.data import hgsc_cancer_he
>>> fig, ax = plt.subplots(figsize=(4, 4))
>>> im = hgsc_cancer_he()
>>> ax.imshow(im)
>>> ax.set_axis_off()

out

Source code in src/histolytics/data/fetch.py
def hgsc_cancer_he() -> np.ndarray:
    """A 1500x1500 H&E image of HGSC containing a tumor nest.

    Returns:
        RGB uint8 image with shape (1500, 1500, 3) and values in [0, 255].

    Note:
        Pairs with:

        - `hgsc_cancer_nuclei()`
        - `hgsc_cancer_inst_mask()`
        - `hgsc_cancer_type_mask()`

    Examples:
        >>> import matplotlib.pyplot as plt
        >>> from histolytics.data import hgsc_cancer_he
        >>> fig, ax = plt.subplots(figsize=(4, 4))
        >>> im = hgsc_cancer_he()
        >>> ax.imshow(im)
        >>> ax.set_axis_off()
    ![out](../../img/hgsc_cancer_he.png)
    """
    return cv2.cvtColor(
        cv2.imread((BASE_PATH / "hgsc_nest.jpg").as_posix()), cv2.COLOR_BGR2RGB
    )