Chris Oswald
commited on
Commit
·
7458736
1
Parent(s):
067a44d
debugging
Browse files
SPIDER.py
CHANGED
|
@@ -75,11 +75,8 @@ def standardize_3D_image(
|
|
| 75 |
image = np.transpose(image, axes=[1, 2, 0])
|
| 76 |
# Resize image
|
| 77 |
image = skimage.transform.resize(image, resize_shape)
|
| 78 |
-
# Rescale to UInt8 type (required for PyArrow and PIL)
|
| 79 |
-
image = skimage.img_as_ubyte(image)
|
| 80 |
return image
|
| 81 |
|
| 82 |
-
|
| 83 |
# Define constants
|
| 84 |
MIN_IVD = 0
|
| 85 |
MAX_IVD = 9
|
|
@@ -495,6 +492,9 @@ class SPIDER(datasets.GeneratorBasedBuilder):
|
|
| 495 |
resize_shape,
|
| 496 |
)
|
| 497 |
|
|
|
|
|
|
|
|
|
|
| 498 |
# Load .mha mask file
|
| 499 |
mask_path = os.path.join(paths_dict['masks'], 'masks', example)
|
| 500 |
mask = sitk.ReadImage(mask_path)
|
|
|
|
| 75 |
image = np.transpose(image, axes=[1, 2, 0])
|
| 76 |
# Resize image
|
| 77 |
image = skimage.transform.resize(image, resize_shape)
|
|
|
|
|
|
|
| 78 |
return image
|
| 79 |
|
|
|
|
| 80 |
# Define constants
|
| 81 |
MIN_IVD = 0
|
| 82 |
MAX_IVD = 9
|
|
|
|
| 492 |
resize_shape,
|
| 493 |
)
|
| 494 |
|
| 495 |
+
# Rescale image to UInt8 type (required for PyArrow and PIL)
|
| 496 |
+
image_array_standardized = skimage.img_as_ubyte(image_array_standardized)
|
| 497 |
+
|
| 498 |
# Load .mha mask file
|
| 499 |
mask_path = os.path.join(paths_dict['masks'], 'masks', example)
|
| 500 |
mask = sitk.ReadImage(mask_path)
|