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

Automatically export boolean masks as 0-255 black/white

parent ccbfd4f8
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,7 @@ def write_accessor_data_to_file(fpath: Path, accessor: GenericImageDataAccessor, ...@@ -190,7 +190,7 @@ def write_accessor_data_to_file(fpath: Path, accessor: GenericImageDataAccessor,
) )
if accessor.is_mask(): if accessor.is_mask():
if accessor.dtype == 'bool': if accessor.dtype == 'bool':
data = zcyx * 255 data = (zcyx * 255).astype('uint8')
else: else:
data = zcyx.astype('uint8') data = zcyx.astype('uint8')
tifffile.imwrite(fpath, data, imagej=True) tifffile.imwrite(fpath, data, imagej=True)
......
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