Skip to content

Commit

Permalink
Remove check for return value of tifffile.imwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbb committed Jan 18, 2025
1 parent 56bcb79 commit 7926044
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions caiman/utils/sbx_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ def sbx_chain_to_tif(filenames: list[str], fileout: str, subindices: Optional[Ch

dtype = np.float32 if to32 else np.uint16
# Make the file first so we can pass in bigtiff and imagej options; otherwise could create using tifffile.memmap directly
res = tifffile.imwrite(fileout, data=None, shape=save_shape, bigtiff=bigtiff, imagej=imagej,
dtype=dtype, photometric='MINISBLACK', align=tifffile.TIFF.ALLOCATIONGRANULARITY)
if res is None:
raise RuntimeError('Tiff file is not memmappable')
tifffile.imwrite(fileout, data=None, shape=save_shape, bigtiff=bigtiff, imagej=imagej,
dtype=dtype, photometric='MINISBLACK', align=tifffile.TIFF.ALLOCATIONGRANULARITY)

# Now convert each file
tif_memmap = tifffile.memmap(fileout, series=0)
Expand Down

0 comments on commit 7926044

Please sign in to comment.