Skip to content
Snippets Groups Projects
Commit ccbfd4f8 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Automatically export boolean masks as 0-255 black/white

parent 668292cc
No related branches found
No related tags found
No related merge requests found
......@@ -189,7 +189,11 @@ def write_accessor_data_to_file(fpath: Path, accessor: GenericImageDataAccessor,
[0, 1, 2, 3]
)
if accessor.is_mask():
tifffile.imwrite(fpath, zcyx.astype('uint8'), imagej=True)
if accessor.dtype == 'bool':
data = zcyx * 255
else:
data = zcyx.astype('uint8')
tifffile.imwrite(fpath, data, imagej=True)
else:
tifffile.imwrite(fpath, zcyx, imagej=True)
except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment