Chris Oswald
commited on
Commit
•
2c8bc60
1
Parent(s):
35aea2f
testing uint16
Browse files
SPIDER.py
CHANGED
@@ -76,8 +76,9 @@ def standardize_3D_image(
|
|
76 |
image = np.transpose(image, axes=[1, 2, 0])
|
77 |
# Resize image
|
78 |
image = skimage.transform.resize(image, resize_shape)
|
79 |
-
# Rescale to
|
80 |
-
image = skimage.img_as_ubyte(image)
|
|
|
81 |
return image
|
82 |
|
83 |
def standardize_3D_mask(
|
@@ -99,8 +100,9 @@ def standardize_3D_mask(
|
|
99 |
mode='constant',
|
100 |
cval=0,
|
101 |
)
|
102 |
-
# Rescale to
|
103 |
-
mask = skimage.img_as_ubyte(mask)
|
|
|
104 |
return mask
|
105 |
|
106 |
# Define constants
|
|
|
76 |
image = np.transpose(image, axes=[1, 2, 0])
|
77 |
# Resize image
|
78 |
image = skimage.transform.resize(image, resize_shape)
|
79 |
+
# Rescale to uint16 type (required for PyArrow and PIL)
|
80 |
+
# image = skimage.img_as_ubyte(image)
|
81 |
+
image = skimage.img_as_uint(image)
|
82 |
return image
|
83 |
|
84 |
def standardize_3D_mask(
|
|
|
100 |
mode='constant',
|
101 |
cval=0,
|
102 |
)
|
103 |
+
# Rescale to uint16 type (required for PyArrow and PIL)
|
104 |
+
# mask = skimage.img_as_ubyte(mask)
|
105 |
+
mask = skimage.img_as_uint(mask)
|
106 |
return mask
|
107 |
|
108 |
# Define constants
|