Installation#

We support two installation modes, through pip, or mamba (conda).

Stable, from PyPI:

pip install deepdraw

Latest beta, from GitLab package registry:

pip install --pre --index-url https://gitlab.idiap.ch/api/v4/groups/software/-/packages/pypi/simple --extra-index-url https://pypi.org/simple deepdraw

Tip

To avoid long command-lines you may configure pip to define the indexes and package search priorities as you like.

Stable:

mamba install -c https://www.idiap.ch/software/biosignal/conda -c conda-forge deepdraw

Latest beta:

mamba install -c https://www.idiap.ch/software/biosignal/conda/label/beta -c conda-forge deepdraw

Setup#

A configuration file may be useful to setup global options that should be often reused. The location of the configuration file depends on the value of the environment variable $XDG_CONFIG_HOME, but defaults to ~/.config/deepdraw.toml. You may edit this file using your preferred editor.

Here is an example configuration file that may be useful as a starting point:

[datadir]
indian = "/Users/myself/dbs/tbxpredict"
montgomery = "/Users/myself/dbs/montgomery-xrayset"
shenzhen = "/Users/myself/dbs/shenzhen"
nih_cxr14_re = "/Users/myself/dbs/nih-cxr14-re"

[nih_cxr14_re]
idiap_folder_structure = false  # set to `true` if at Idiap

Tip

To get a list of valid data directories that can be configured, execute:

binseg dataset list

You must procure and download datasets by yourself. The raw data is not included in this package as we are not authorised to redistribute it.

To check whether the downloaded version is consistent with the structure that is expected by this package, run:

binseg dataset check montgomery

Supported Datasets#

Here is a list of currently support datasets in this package, alongside notable properties. Each dataset name is linked to the current location where raw data can be downloaded. We include the reference of the data split protocols used to generate iterators for training and testing.

Retinography#

Table 1 Supported Retinography Datasets (*: provided within this package)#

Dataset

Reference

H x W

Samples

Mask

Vessel

OD

Cup

Split Reference

Train

Test

DRIVE

[DRIVE-2004]

584 x 565

40

x

x

[DRIVE-2004]

20

20

STARE

[STARE-2000]

605 x 700

20

*

x

[MANINIS-2016]

10

10

CHASE-DB1

[CHASEDB1-2012]

960 x 999

28

*

x

[CHASEDB1-2012]

8

20

HRF

[HRF-2013]

2336 x 3504

45

x

x

[ORLANDO-2017]

15

30

IOSTAR

[IOSTAR-2016]

1024 x 1024

30

x

x

x

[MEYER-2017]

20

10

DRIONS-DB

[DRIONSDB-2008]

400 x 600

110

x

[MANINIS-2016]

60

50

RIM-ONE r3

[RIMONER3-2015]

1424 x 1072

159

x

x

[MANINIS-2016]

99

60

Drishti-GS1

[DRISHTIGS1-2014]

varying

101

x

x

[DRISHTIGS1-2014]

50

51

REFUGE

[REFUGE-2018]

2056 x 2124 (1634 x 1634)

1200

x

x

[REFUGE-2018]

400 (+400)

400

DRHAGIS

[DRHAGIS-2017]

Varying

39

x

x

[DRHAGIS-2017]

19

20

Warning

REFUGE Dataset Support

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.

X-Ray#

Table 2 Supported X-Ray Datasets#

Dataset

Reference

H x W

Radiography Type

Samples

Mask

Split Reference

Train

Test

Montgomery County

[MC-2014]

4020 x 4892, or 4892 x 4020

Digital Radiography (DR)

138

*

[GAAL-2020]

96 (+14)

28

JSRT

[JSRT-2000]

2048 x 2048

Digitized Radiography (laser digitizer)

247

*

[GAAL-2020]

172 (+25)

50

Shenzhen

[SHENZHEN-2014]

Varying

Computed Radiography (CR)

662

*

[GAAL-2020]

396 (+56)

114

CXR8

[CXR8-2017]

1024 x 1024

Digital Radiography

112120

x

[GAAL-2020]

78484 (+11212)

22424

Warning

SHENZHEN/JSRT/CXR8 Dataset Support

For some datasets (in which the annotations/masks are downloaded separately from the dataset with the original images), both the original images and annotations must be downloaded and placed inside the same directory, to match the dataset reference dictionary’s path.

  • The Shenzhen root directory should then contain at least these two subdirectories:

    • CXR_png/ (directory containing the CXR images)

    • mask/ (contains masks downloaded from Shenzhen Annotations)

  • The CXR8 root directory:

    • images/ (directory containing the CXR images)

    • segmentations/ (contains masks downloaded from CXR8 Annotations)

  • The JSRT root directory:

    • All247images/ (directory containing the CXR images, in raw format)

    • scratch/ (contains masks downloaded from JSRT Annotations)