mednet.data.classify.visceral

VISCERAL dataset for 3D organ classification (only lungs and bladders).

Data specifications:

  • Raw data input (on disk):

    • NIfTI volumes

    • resolution: 16x16x16 pixels - Loaded samples are not full scans but 16x16x16 volumes of organs.

  • Output image:

    • Transforms:

      • Load raw NIfTI with torchio

      • Clamp and Rescale intensity

      • Convert to torch tensor

    • Final specifications

      • 32-bit floats, cubes 16x16x16 pixels

      • targets: 0 (bladder), 1 (lung)

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.

Classes

DataModule(split_path)

VISCERAL DataModule for 3D organ binary classification.

RawDataLoader()

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

mednet.data.classify.visceral.DATABASE_SLUG = 'visceral'

Pythonic name of this database.

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

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

class mednet.data.classify.visceral.RawDataLoader[source]

Bases: RawDataLoader

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

datadir: Path

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

sample(sample)[source]

Load a single volume sample from the disk.

Parameters:

sample (Any) – A tuple containing the path suffix, within the database root folder, where to find the volume 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 tensor.

class mednet.data.classify.visceral.DataModule(split_path)[source]

Bases: CachingDataModule

VISCERAL DataModule for 3D organ binary classification.

Parameters:

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