Update nnunet/dataset_conversion/Task500_Glacier_reverse.py
Browse files
nnunet/dataset_conversion/Task500_Glacier_reverse.py
CHANGED
@@ -39,19 +39,19 @@ def main(input_folder):
|
|
39 |
color_zone[glacier_dil == 1] = 127
|
40 |
|
41 |
color_front = extract_front_from_zones(color_zone, 10)
|
42 |
-
color_front[color_front==255] =
|
43 |
|
44 |
output_path_zone = join(output_folder, file[:-len('.nii.gz')] + '_zone.png')
|
45 |
output_path_front = join(output_folder, file[:-len('.nii.gz')] + '_front.png')
|
46 |
|
47 |
-
imageio.imwrite(output_path_zone, color_zone)
|
48 |
-
imageio.imwrite(output_path_front, color_front)
|
49 |
-
|
50 |
-
img_zone = Image.fromarray(color_zone)
|
51 |
-
img_front = Image.fromarray(color_front)
|
52 |
img_zone.save(output_path_zone)
|
53 |
img_front.save(output_path_front)
|
54 |
-
|
55 |
|
56 |
if __name__ == '__main__':
|
57 |
parser = argparse.ArgumentParser()
|
|
|
39 |
color_zone[glacier_dil == 1] = 127
|
40 |
|
41 |
color_front = extract_front_from_zones(color_zone, 10)
|
42 |
+
color_front[color_front==255] = 255
|
43 |
|
44 |
output_path_zone = join(output_folder, file[:-len('.nii.gz')] + '_zone.png')
|
45 |
output_path_front = join(output_folder, file[:-len('.nii.gz')] + '_front.png')
|
46 |
|
47 |
+
#imageio.imwrite(output_path_zone, color_zone)
|
48 |
+
#imageio.imwrite(output_path_front, color_front)
|
49 |
+
|
50 |
+
img_zone = Image.fromarray(color_zone).convert('RGB')
|
51 |
+
img_front = Image.fromarray(color_front).convert('RGB')
|
52 |
img_zone.save(output_path_zone)
|
53 |
img_front.save(output_path_front)
|
54 |
+
|
55 |
|
56 |
if __name__ == '__main__':
|
57 |
parser = argparse.ArgumentParser()
|