ziq commited on
Commit
4a1fec0
·
1 Parent(s): ad635c6

Update rsna-atd.py

Browse files
Files changed (1) hide show
  1. rsna-atd.py +31 -31
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
- "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,
@@ -86,16 +86,16 @@ class RSNAATD(datasets.GeneratorBasedBuilder):
86
  # "test": images
87
  # }
88
  # return
89
- # for i, image in enumerate(images):
90
- # # image_path = Path(image).name
91
- # # test = hkl.load(image_path)
92
- # yield i, {
93
- # "test": image
94
- # }
95
- # return
96
- for idx, (data) in enumerate(df.to_numpy()):
97
- image_path = Path(images) / data[0]
98
- mask_path = Path(masks) / data[0]
99
  image, mask = [hkl.load(image_path)], [hkl.load(mask_path)]
100
  (
101
  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,
 
86
  # "test": images
87
  # }
88
  # return
89
+ for i, image in enumerate(images):
90
+ # image_path = Path(image).name
91
+ # test = hkl.load(image_path)
92
+ yield i, {
93
+ "test": image
94
+ }
95
+ return
96
+ for idx, (data, image_path, mask_path) in enumerate(zip(df.to_numpy(), images, masks)):
97
+ image_path = Path(image_path) / data[0]
98
+ mask_path = Path(mask_path) / data[0]
99
  image, mask = [hkl.load(image_path)], [hkl.load(mask_path)]
100
  (
101
  patient_id,