Skip to content

Commit ed384d7

Browse files
committed
doc formatting
1 parent 761306a commit ed384d7

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

monai/data/decathlon_datalist.py

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,31 +95,34 @@ def load_decathlon_datalist(
9595
JSON file should follow the format of the Medical Segmentation Decathlon
9696
datalist.json files, see http://medicaldecathlon.com.
9797
The files are structured as follows:
98-
{
99-
"metadata_key_0": "metadata_value_0",
100-
"metadata_key_1": "metadata_value_1",
101-
...,
102-
"training": [
103-
{"image": "path/to/image_1.nii.gz", "label": "path/to/label_1.nii.gz"},
104-
{"image": "path/to/image_2.nii.gz", "label": "path/to/label_2.nii.gz"},
105-
...
106-
],
107-
"test": [
108-
"path/to/image_3.nii.gz",
109-
"path/to/image_4.nii.gz",
110-
...
111-
]
112-
}
113-
114-
The metadata keys are optional for loading the datalist, but include the following
115-
string items:
116-
"name", "description", "reference", "licence", "release", "tensorImageSize",
117-
two dict items, "modality" (keyed by channel index), and "labels" (keyed by label index),
118-
and two integer items, "numTraining" and "numTest", with the number of items.
11998
120-
The "training" key contains a list of dictionaries, each of which has at least
121-
the "image" and "label" keys, the latter of which is a path for segmentation data.
122-
Each item can also include a "fold" key for cross-validation purposes.
99+
.. code-block:: json
100+
101+
{
102+
"metadata_key_0": "metadata_value_0",
103+
"metadata_key_1": "metadata_value_1",
104+
...,
105+
"training": [
106+
{"image": "path/to/image_1.nii.gz", "label": "path/to/label_1.nii.gz"},
107+
{"image": "path/to/image_2.nii.gz", "label": "path/to/label_2.nii.gz"},
108+
...
109+
],
110+
"test": [
111+
"path/to/image_3.nii.gz",
112+
"path/to/image_4.nii.gz",
113+
...
114+
]
115+
}
116+
117+
118+
The metadata keys are optional for loading the datalist, but include:
119+
- some string items: ``name``, ``description``, ``reference``, ``licence``, ``release``, ``tensorImageSize``
120+
- two dict items: ``modality`` (keyed by channel index), and ``labels`` (keyed by label index)
121+
- and two integer items: ``numTraining`` and ``numTest``, with the number of items.
122+
123+
The ``training`` key contains a list of dictionaries, each of which has at least
124+
the ``image`` and ``label`` keys, the latter of which is a path (for segmentation data).
125+
Each item can also include a ``fold`` key for cross-validation purposes.
123126
The "test" key contains a list of image paths, without labels.
124127
125128
Args:
@@ -134,11 +137,11 @@ def load_decathlon_datalist(
134137
135138
Returns a list of data items, each of which is a dict keyed by element names, for example:
136139
137-
.. code-block::
140+
.. code-block:: python
138141
139142
[
140-
{'image': '/workspace/data/chest_19.nii.gz', 'label': 0},
141-
{'image': '/workspace/data/chest_31.nii.gz', 'label': 1}
143+
{'image': '/workspace/data/chest_19.nii.gz', 'label': '/workspace/labels/chest_19.nii.gz},
144+
{'image': '/workspace/data/chest_31.nii.gz', 'label': '/workspace/labels/chest_31.nii.gz'},
142145
]
143146
144147
"""

0 commit comments

Comments
 (0)