mednet.data.segment.stare

STARE dataset for vessel segmentation.

A subset of the original STARE dataset contains 20 annotated eye fundus images with a resolution of 700 x 605 (width x height). Two sets of ground-truth vessel annotations are available. The first set by Adam Hoover (“ah”) is commonly used for training and testing. The second set by Valentina Kouznetsova (“vk”) is typically used as a “human” baseline.

  • Database references:

Data specifications:

  • Raw data input (on disk):

    • RGB images encoded in PPM format with resolution (HxW) = 605 x 700

    • Total samples: 397 (out of which only 20 are annotated for vessel segmentation)

  • Output sample:

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

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

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

Protocol ah (default baseline, with first, more detailed annotator) includes 10 training samples and 10 test samples. Protocol vk (second annotator) includes the same samples but annotated by a second expert.

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)

STARE database for Vessel Segmentation.

RawDataLoader()

A specialized raw-data-loader for the Stare database.

mednet.data.segment.stare.DATABASE_SLUG = 'stare'

Pythonic name to refer to this database.

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

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

class mednet.data.segment.stare.RawDataLoader[source]

Bases: RawDataLoader

A specialized raw-data-loader for the Stare database.

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 the path suffix, within the database root folder, where to find the image to be loaded, and an integer, representing the sample label.

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.stare.DataModule(split_path)[source]

Bases: CachingDataModule

STARE database for Vessel Segmentation.

Parameters:

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