mednet.data.segment.refuge

REFUGE for optic disc and cup segmentation.

The dataset consists of 1200 color fundus photographs, created for a MICCAI challenge. The goal of the challenge is to evaluate and compare automated algorithms for glaucoma detection and optic disc/cup segmentation on a common dataset of retinal fundus images.

  • Database reference (including train/dev/test split): [noa]

Warning

The original directory Training400/AMD in REFUGE is considered to be replaced by an updated version provided by the AMD Grand-Challenge (with matching names).

The changes concerns images A0012.jpg, which was corrupted in REFUGE, and A0013.jpg, which only exists in the AMD Grand-Challenge version.

Data specifications:

  • Raw data input (on disk):

    • RGB images encoded in JPG format with varying resolution. Training images are (HxW) 2056 x 2124 pixels; Validation (and test) images are 1634 x 1634 pixels.

    • Vessel annotations are encoded as BMP images with the same resolution as input samples.

    • Masks for the eye fundus are provided by this package.

    • Total samples: 1200 distributed as 400 (training), 400 (validation) and 400 (test).

  • Output sample:

    • Image: Load raw TIFF images with PIL, with auto-conversion to RGB.

    • Vessel annotations: Load annotations with PIL, with auto-conversion to mode 1 with no dithering.

    • Eye fundus mask: Load mask with PIL, with auto-conversion to mode 1 with no dithering.

Splits optic-disc and cup contain annotations for optic-disc or cup segmentation.

This module contains the base declaration of common data modules and raw-data loaders for this database. All configured splits inherit from this definition.

Module Attributes

DATABASE_SLUG

Pythonic name to refer to this database.

CONFIGURATION_KEY_DATADIR

Key to search for in the configuration file for the root directory of this database.

Classes

DataModule(split_path, target_type)

REFUGE for optic disc and cup segmentation.

RawDataLoader(target_type)

A specialized raw-data-loader for the drishtigs1 dataset.

mednet.data.segment.refuge.DATABASE_SLUG = 'refuge'

Pythonic name to refer to this database.

mednet.data.segment.refuge.CONFIGURATION_KEY_DATADIR = 'datadir.refuge'

Key to search for in the configuration file for the root directory of this database.

class mednet.data.segment.refuge.RawDataLoader(target_type)[source]

Bases: RawDataLoader

A specialized raw-data-loader for the drishtigs1 dataset.

Parameters:

target_type (str) – Indicate whether to use the “cup” or “disc” target.

datadir: Path

This variable contains the base directory where the database raw data is stored.

sample(sample)[source]

Load a single image sample from the disk.

Parameters:

sample (Any) – A tuple containing path suffixes to the sample image, target, and mask to be loaded, within the dataset root folder.

Return type:

Mapping[str, Any]

Returns:

The sample representation.

target(sample)[source]

Load only sample target from its raw representation.

Parameters:

sample (Any) – A tuple containing the path suffix, within the dataset root folder, where to find the image to be loaded, and an integer, representing the sample target.

Return type:

Tensor

Returns:

The label corresponding to the specified sample, encapsulated as a torch float tensor.

class mednet.data.segment.refuge.DataModule(split_path, target_type)[source]

Bases: CachingDataModule

REFUGE for optic disc and cup segmentation.

Parameters:
  • split_path (Path | Traversable) – Path or traversable (resource) with the JSON split description to load.

  • target_type (str) – Indicate whether to use the “cup” or “disc” target.