Update prostate158.py
Browse files- prostate158.py +2 -3
prostate158.py
CHANGED
|
@@ -87,7 +87,6 @@ class Prostate158Dataset(datasets.GeneratorBasedBuilder):
|
|
| 87 |
if self.config.name == "2d":
|
| 88 |
print(os.listdir(downloaded_files))
|
| 89 |
df = pd.read_csv(downloaded_files / f"{split}.csv")
|
| 90 |
-
images_folder = downloaded_files / split
|
| 91 |
yield_index = 0
|
| 92 |
for idx, row in df.iterrows():
|
| 93 |
print(row)
|
|
@@ -95,7 +94,7 @@ class Prostate158Dataset(datasets.GeneratorBasedBuilder):
|
|
| 95 |
# we will return t2 adc dwi t2_anatomy_reader1 adc_tumor_reader1
|
| 96 |
images_list = ["t2", "adc", "dwi", "t2_anatomy_reader1", "adc_tumor_reader1"]
|
| 97 |
|
| 98 |
-
images_data = {image_name: nib.load(
|
| 99 |
print("example_shape", images_data["t2"].shape)
|
| 100 |
for i in range(images_data["t2"].shape[2]):
|
| 101 |
print(i)
|
|
@@ -103,7 +102,7 @@ class Prostate158Dataset(datasets.GeneratorBasedBuilder):
|
|
| 103 |
|
| 104 |
elif self.config.name == "3d":
|
| 105 |
df = pd.read_csv(downloaded_files / f"{split}.csv")
|
| 106 |
-
|
| 107 |
|
| 108 |
|
| 109 |
|
|
|
|
| 87 |
if self.config.name == "2d":
|
| 88 |
print(os.listdir(downloaded_files))
|
| 89 |
df = pd.read_csv(downloaded_files / f"{split}.csv")
|
|
|
|
| 90 |
yield_index = 0
|
| 91 |
for idx, row in df.iterrows():
|
| 92 |
print(row)
|
|
|
|
| 94 |
# we will return t2 adc dwi t2_anatomy_reader1 adc_tumor_reader1
|
| 95 |
images_list = ["t2", "adc", "dwi", "t2_anatomy_reader1", "adc_tumor_reader1"]
|
| 96 |
|
| 97 |
+
images_data = {image_name: nib.load(downloaded_files / row[image_name]) for image_name in images_list}
|
| 98 |
print("example_shape", images_data["t2"].shape)
|
| 99 |
for i in range(images_data["t2"].shape[2]):
|
| 100 |
print(i)
|
|
|
|
| 102 |
|
| 103 |
elif self.config.name == "3d":
|
| 104 |
df = pd.read_csv(downloaded_files / f"{split}.csv")
|
| 105 |
+
|
| 106 |
|
| 107 |
|
| 108 |
|