Update rsna-atd.py
Browse files- rsna-atd.py +22 -26
rsna-atd.py
CHANGED
@@ -33,27 +33,27 @@ class RSNAATD(datasets.GeneratorBasedBuilder):
|
|
33 |
description=_DESCRIPTION,
|
34 |
features=datasets.Features(
|
35 |
{
|
36 |
-
"test": datasets.Value("string"),
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
}
|
58 |
),
|
59 |
supervised_keys=None,
|
@@ -94,11 +94,7 @@ class RSNAATD(datasets.GeneratorBasedBuilder):
|
|
94 |
# }
|
95 |
# return
|
96 |
for idx, (image_path, mask_path) in enumerate(zip(sorted(images), sorted(masks))):
|
97 |
-
data = df.loc[df["path"] == Path(image_path).name].to_numpy()
|
98 |
-
yield 0, {
|
99 |
-
"test": f"{data}"
|
100 |
-
}
|
101 |
-
return
|
102 |
image, mask = [hkl.load(image_path)], [hkl.load(mask_path)]
|
103 |
(
|
104 |
patient_id,
|
|
|
33 |
description=_DESCRIPTION,
|
34 |
features=datasets.Features(
|
35 |
{
|
36 |
+
# "test": datasets.Value("string"),
|
37 |
+
"patient_id": datasets.Value("int64"),
|
38 |
+
"series_id": datasets.Value("int64"),
|
39 |
+
"image": datasets.Array3D(shape=(None, 512, 512), dtype="uint8"),
|
40 |
+
"mask": datasets.Array3D(shape=(None, 512, 512), dtype="uint8"),
|
41 |
+
"aortic_hu": datasets.Value("float64"),
|
42 |
+
"incomplete_organ": datasets.Value("int64"),
|
43 |
+
"bowel_healthy": datasets.Value("int64"),
|
44 |
+
"bowel_injury": datasets.Value("int64"),
|
45 |
+
"extravasation_healthy": datasets.Value("int64"),
|
46 |
+
"extravasation_injury": datasets.Value("int64"),
|
47 |
+
"kidney_healthy": datasets.Value("int64"),
|
48 |
+
"kidney_low": datasets.Value("int64"),
|
49 |
+
"kidney_high": datasets.Value("int64"),
|
50 |
+
"liver_healthy": datasets.Value("int64"),
|
51 |
+
"liver_low": datasets.Value("int64"),
|
52 |
+
"liver_high": datasets.Value("int64"),
|
53 |
+
"spleen_healthy": datasets.Value("int64"),
|
54 |
+
"spleen_low": datasets.Value("int64"),
|
55 |
+
"spleen_high": datasets.Value("int64"),
|
56 |
+
"any_injury": datasets.Value("int64"),
|
57 |
}
|
58 |
),
|
59 |
supervised_keys=None,
|
|
|
94 |
# }
|
95 |
# return
|
96 |
for idx, (image_path, mask_path) in enumerate(zip(sorted(images), sorted(masks))):
|
97 |
+
data = df.loc[df["path"] == Path(image_path).name].to_numpy()[0]
|
|
|
|
|
|
|
|
|
98 |
image, mask = [hkl.load(image_path)], [hkl.load(mask_path)]
|
99 |
(
|
100 |
patient_id,
|