mednet.data.classify.angioreport

AngioReport dataset for automatic report generation on angiography images.

The AngioReport Dataset is the first publicly available angiographic dataset, comprising images of both fluorescein angiography and indocyanine green angiography (ICGA), all labeled by retinal specialists. Collected at the Department of Ophthalmology, Rajavithi Hospital, Bangkok, Thailand, the final dataset consists of 55,361 images from 1,691 patients (3,179 eyes). Among the 3,179 eyes, 81.8% were examined in both FA and ICGA modes, 10.3% underwent FA only, and the remaining 7.9% had ICGA only. Since angiographic imaging methods are non-standardized and vary based on the specialist and patient, the number of images per eye in this dataset ranges from a few to several hundred. The only labeled images are those present in the original training split (33,559 images from 1,921 eyes).

The dataset covers 24 medical conditions and provides detailed descriptions of the type, location, shape, size, and pattern of abnormal fluorescence. Specifically: - Impression [multilabel] - HyperF_Type [multiclass] - HyperF_Area(DA) [multiclass] - HyperF_Fovea [binary] - HyperF_ExtraFovea [multilabel] - HyperF_Y [multilabel] - HypoF_Type [multiclass] - HypoF_Area(DA) [multiclass] - HypoF_Fovea [binary] - HypoF_ExtraFovea [multilabel] - HypoF_Y [multilabel] - CNV [binary] - Vascular abnormality (DR) [multilabel] - Pattern [multilabel]

In the current setup, we include only those samples that were examined in both FA and ICGA modes, identifiable by their aspect ratio, specifically, images whose width is twice their height, as these represent concatenated pairs of both modalities. For each eye, we select only the last frame image, which is typically the most informative for diagnosis. This selection results in a total of 1,887 samples/eyes.

Data specifications:

  • Raw data input (on disk):

    • JPEG grayscale images encoded as 8-bit sRGB, with varying resolution (most images being 384 x 364 pixels or 256 x 256 pixels, after being cropped to obtain images of one of the two modalities).

    • Total samples: 30,768 (FA/ICGA images) (Only last frame 1887)

  • Output image:

    • Transforms:

      • Load raw JPEG with PIL, with auto-conversion to grayscale

      • Crop images to obtain the specified modality (FA or ICGA)

      • Convert to torch tensor

  • Final specifications

    • Grayscale, encoded as a single plane tensor, 32-bit floats, with varying resolution depending on input.

    • Labels: they depend on the task selected.

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 of this database.

CONFIGURATION_KEY_DATADIR

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

IMPRESSION_TYPE_ICGA

List of impression type detectable from icga.

Functions

binarize_findings(lst)

Binarize the input list of radiological findings.

Classes

DataModule(split_path, num_classes, problem_type)

AngioReport dataset.

RawDataLoader(problem_type[, modality])

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

mednet.data.classify.angioreport.DATABASE_SLUG = 'angioreport'

Pythonic name of this database.

mednet.data.classify.angioreport.CONFIGURATION_KEY_DATADIR = 'datadir.angioreport'

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

mednet.data.classify.angioreport.IMPRESSION_TYPE_ICGA = ['unremarkable changes', 'macular neovascularization', 'central serous chorioretinopathy', 'uveitis', 'polypoidal choroidal vasculopathy', 'pachychoroid pigment epitheliopathy', 'choroidal mass', 'Other']

List of impression type detectable from icga.

mednet.data.classify.angioreport.binarize_findings(lst)[source]

Binarize the input list of radiological findings.

The output list contains zeros and ones, respecting the findings order in IMPRESSION_TYPE_ICGA.

Parameters:

lst (list[str]) – A list of impression type that will be converted.

Return type:

Tensor

Returns:

A list containing a binarized version of the input list.

class mednet.data.classify.angioreport.RawDataLoader(problem_type, modality='FA')[source]

Bases: RawDataLoader

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

Parameters:
  • problem_type (Literal['binary', 'multiclass', 'multilabel']) – Specifies the problem type for the current split. Can be binary or multiclass. This parameter controls how the target labels are processed and retrieved from the dataset.

  • modality (Literal['FA', 'ICGA']) – Specifies the modality to be used. Can be FA (Fluorescein Angiography) or ICGA (Indocyanine Green Angiography). Default is FA. Depending on the modality a different crop operation is performed on the input image.

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) – Expects 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:

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 1D torch float or 0D long tensor (depending on the problem_type).

class mednet.data.classify.angioreport.DataModule(split_path, num_classes, problem_type, modality='FA')[source]

Bases: CachingDataModule

AngioReport dataset.

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

  • num_classes (int) – Number of output classes for the task at hand.

  • problem_type (Literal['binary', 'multiclass', 'multilabel']) – Specifies the problem type for the current split. Can be binary, multilabel or multiclass. This parameter controls how the target labels are processed and retrieved from the dataset.

  • modality (Literal['FA', 'ICGA']) – Specifies the modality to be used. Can be FA (Fluorescein Angiography) or ICGA (Indocyanine Green Angiography). Default is FA. Depending on the modality a different crop operation is performed on the input image.