Update prostate158.py
Browse files- prostate158.py +22 -14
prostate158.py
CHANGED
|
@@ -12,25 +12,33 @@ class Prostate158Dataset(datasets.GeneratorBasedBuilder):
|
|
| 12 |
|
| 13 |
BUILDER_CONFIGS = [
|
| 14 |
datasets.BuilderConfig(
|
| 15 |
-
name="
|
| 16 |
version=VERSION,
|
| 17 |
-
description="
|
| 18 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
]
|
| 20 |
|
| 21 |
DEFAULT_CONFIG_NAME = "first_domain"
|
| 22 |
|
| 23 |
def _info(self):
|
| 24 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
return datasets.DatasetInfo(
|
| 36 |
description=_DESCRIPTION,
|
|
@@ -72,7 +80,7 @@ class Prostate158Dataset(datasets.GeneratorBasedBuilder):
|
|
| 72 |
},
|
| 73 |
),
|
| 74 |
]
|
| 75 |
-
|
| 76 |
def _generate_examples(self, split, downloaded_files):
|
| 77 |
-
|
| 78 |
-
|
|
|
|
| 12 |
|
| 13 |
BUILDER_CONFIGS = [
|
| 14 |
datasets.BuilderConfig(
|
| 15 |
+
name="2d",
|
| 16 |
version=VERSION,
|
| 17 |
+
description="Return all the dataset in a 2d format",
|
| 18 |
),
|
| 19 |
+
datasets.BuilderConfig(
|
| 20 |
+
name="3d",
|
| 21 |
+
version=VERSION,
|
| 22 |
+
description="Return all the dataset in a 3d format",
|
| 23 |
+
),
|
| 24 |
+
|
| 25 |
]
|
| 26 |
|
| 27 |
DEFAULT_CONFIG_NAME = "first_domain"
|
| 28 |
|
| 29 |
def _info(self):
|
| 30 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
| 31 |
+
if self.config.name == "2d":
|
| 32 |
+
features = datasets.Features(
|
| 33 |
+
{
|
| 34 |
+
"t2": datasets.Image(),
|
| 35 |
+
"adc": datasets.Image(),
|
| 36 |
+
"dwi": datasets.Image(),
|
| 37 |
+
"mask": datasets.Image(),
|
| 38 |
+
}
|
| 39 |
+
)
|
| 40 |
+
elif self.config.name == "3d":
|
| 41 |
+
raise NotImplementedError
|
| 42 |
|
| 43 |
return datasets.DatasetInfo(
|
| 44 |
description=_DESCRIPTION,
|
|
|
|
| 80 |
},
|
| 81 |
),
|
| 82 |
]
|
| 83 |
+
|
| 84 |
def _generate_examples(self, split, downloaded_files):
|
| 85 |
+
if self.config.name == "2d":
|
| 86 |
+
print(os.listdir(downloaded_files))
|