glasscut.data package

Submodules

glasscut.data.fetcher module

Data fetcher for downloading and managing histology slide samples.

class glasscut.data.fetcher.PoochProtocol(*args, **kwargs)[source]

Bases: Protocol

Protocol for pooch.Pooch interface.

Defines the minimal interface we use from pooch to allow proper typing despite pooch’s limited type annotations.

fetch(fname)[source]

Fetch a file from the registry.

Parameters:

fname (str) – Filename in the registry

Returns:

Path to the local file

Return type:

str

__init__(*args, **kwargs)
class glasscut.data.fetcher.DataFetcher[source]

Bases: object

Manages downloading, caching, and loading histology slide samples.

Uses pooch for robust file downloading, caching, and verification.

pup

Pooch instance for downloading, or None if initialization failed

Type:

PoochProtocol | None

__init__()[source]

Initialize the data fetcher.

Return type:

None

get_file(filename)[source]

Get or download a data file from the registry.

Attempts to load file from cache, then downloads if necessary using pooch.

Parameters:

filename (str) – Relative path in registry (e.g. ‘aperio/JP2K-33003-1.svs’)

Returns:

Path to the file

Return type:

Path

Raises:

KeyError – If filename is not in registry

load_slide(filename)[source]

Load an SVS file from the data registry.

Parameters:

filename (str) – Relative path in registry

Returns:

Tuple of (OpenSlide object, file path)

Return type:

Tuple[openslide.OpenSlide, Path]

Raises:
  • openslide.OpenSlideError – If the file cannot be opened

  • KeyError – If filename is not in registry

glasscut.data.registry module

Module contents

GlassCut data module for downloading and loading sample histology slides.

glasscut.data.aorta_tissue()[source]

Load aorta tissue sample.

Aorta tissue, brightfield, JPEG 2000, YCbCr format from OpenSlide test data.

Source: http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/

Returns:

H&E-stained WSI of aortic tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.breast_tissue()[source]

Load breast tissue sample from TCGA-BRCA.

Source: TCGA-A8-A082-01A-01-TS1.3cad4a77-47a6-4658-becf-d8cffa161d3a.svs Access: open

Returns:

H&E-stained WSI of breast tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.breast_tissue_diagnostic_green_pen()[source]

Load breast tissue diagnostic slide with green pen marks.

Source: TCGA-A1-A0SH-01Z-00-DX1.90E71B08-E1D9-4FC2-85AC-062E56DDF17C.svs Access: open

Returns:

H&E-stained WSI with green pen annotations and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.breast_tissue_diagnostic_red_pen()[source]

Load breast tissue diagnostic slide with red pen marks.

Source: TCGA-E9-A24A-01Z-00-DX1.F0342837-5750-4172-B60D-5F902E2A02FD.svs Access: open

Returns:

H&E-stained WSI with red pen annotations and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.breast_tissue_diagnostic_black_pen()[source]

Load breast tissue diagnostic slide with black pen marks.

Source: TCGA-BH-A201-01Z-00-DX1.6D6E3224-50A0-45A2-B231-EEF27CA7EFD2.svs Access: open

Returns:

H&E-stained WSI with black pen annotations and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.cmu_small_region()[source]

Load Carnegie Mellon University MRXS sample tissue.

Small region from CMU test data.

Source: http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/ Licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication

Returns:

H&E-stained WSI and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.heart_tissue()[source]

Load heart tissue sample.

Heart tissue, brightfield, JPEG 2000, YCbCr format from OpenSlide test data.

Source: http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/

Returns:

H&E-stained WSI of heart tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.ihc_breast()[source]

Load breast cancer resection with IHC staining.

Staining: CD3 (brown) and CD20 (red)

Source: https://idr.openmicroscopy.org/ (accession idr0073, ID breastCancer12)

Returns:

IHC-stained WSI of breast tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.ihc_kidney()[source]

Load kidney tissue with IHC staining.

Renal allograft staining: CD3 (brown) and CD20 (red)

Source: https://idr.openmicroscopy.org/ (accession idr0073, ID kidney_46_4)

Returns:

IHC-stained WSI of kidney tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.ovarian_tissue()[source]

Load ovarian tissue from TCGA-OV (Serous Cystadenocarcinoma).

Source: TCGA-13-1404-01A-01-TS1.cecf7044-1d29-4d14-b137-821f8d48881e.svs Access: open

Returns:

H&E-stained WSI of ovarian tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]

glasscut.data.prostate_tissue()[source]

Load prostate tissue from TCGA-PRAD (Adenocarcinoma).

Source: TCGA-CH-5753-01A-01-BS1.4311c533-f9c1-4c6f-8b10-922daa3c2e3e.svs Access: open

Returns:

H&E-stained WSI of prostate tissue and its file path

Return type:

Tuple[openslide.OpenSlide, Path]