mednet.data.segment.drishtigs1

Drishti-GS1 for Optic Disc and Cup Segmentation.

Drishti-GS is a dataset meant for validation of segmenting OD, cup and detecting notching. The images in the Drishti-GS dataset have been collected and annotated by Aravind Eye hospital, Madurai, India. This dataset is of a single population as all subjects whose eye images are part of this dataset are Indians.

The dataset is divided into two: a training set and a testing set of images. Training images (50) are provided with groundtruths for OD and Cup segmentation and notching information.

  • Reference (including train/test split): [SKDJ+14]

  • Original resolution (height x width): varying (min: 1749x2045 pixels, max: 1845x2468 pixels)

  • Protocols optic-disc and optic-cup:

    • Training: 50

    • Test: 51

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_all)

Drishti-GS1 for Optic Disc and Cup Segmentation.

RawDataLoader(target_all)

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

mednet.data.segment.drishtigs1.DATABASE_SLUG = 'drishtigs1'

Pythonic name to refer to this database.

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

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

class mednet.data.segment.drishtigs1.RawDataLoader(target_all)[source]

Bases: RawDataLoader

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

Parameters:

target_all (bool) – Indicate whether to use the “all” or “any” 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.drishtigs1.DataModule(split_path, target_all)[source]

Bases: CachingDataModule

Drishti-GS1 for Optic Disc and Cup Segmentation.

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

  • target_all (bool) – Indicate whether to use the “all” or “any” target.