Skip to content

Commit 6561986

Browse files
Fix issues with images with double dtype
1 parent 5253056 commit 6561986

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bioimageio/core/build_spec/build_model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ def write_im(path, im, axes, pixel_size=None):
393393
else:
394394
spatial_axes = list(set(axes_ij) - set(["c"]))
395395
resolution = tuple(1.0 / pixel_size[ax] for ax in spatial_axes)
396+
# does not work for double
397+
if np.dtype(im.dtype) == np.dtype("float64"):
398+
im = im.astype("float32")
396399
tifffile.imsave(path, im, imagej=True, resolution=resolution)
397400

398401
sample_in_paths = []

0 commit comments

Comments
 (0)