TypeError using imagej_metadata
See original GitHub issueWhen opening a file made with Fiji, I get the following error although the data are correctly loaded:
TiffPage 0: TypeError: read_bytes() missing 3 required positional arguments: ‘dtype’, ‘count’, and ‘offsetsize’
The traceback yields this:
File “/opt/homebrew/lib/python3.9/site-packages/tifffile/tifffile.py”, line 3099, in init self.pages = TiffPages(self) File “/opt/homebrew/lib/python3.9/site-packages/tifffile/tifffile.py”, line 5269, in init page = TiffPage(self.parent, index=pageindex) File “/opt/homebrew/lib/python3.9/site-packages/tifffile/tifffile.py”, line 5893, in init tags[50839].value = imagej_metadata( File “/opt/homebrew/lib/python3.9/site-packages/tifffile/tifffile.py”, line 14845, in imagej_metadata values.append(func(data[pos:pos1], byteorder)) File “/opt/homebrew/lib/python3.9/site-packages/tifffile/tifffile.py”, line 13960, in read_bytes
The method read_bytes is called in imagej_metadata without the last three arguments.
Minimum working example (use enclosed file: triple-sphere.zip):
import tifffile
with tifffile.TiffFile("/foo/bar/data.tif") as tf:
data = tf.asarray()
Expected output:
I have not notice anything wrong except the error being displayed. The data are correctly loaded in memory and returned by tf.asarray.
Versions:
tifffile: 2021.10.12python: 3.9.7
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)

Top Related StackOverflow Question
Fixed in v2021.11.2
I had previously tried a conda update conda command.
Check out this conda update tifffile result: (base) C:\Users*****>conda update tifffile Collecting package metadata (current_repodata.json): done Solving environment: | Updating tifffile is constricted by anaconda -> requires tifffile==2021.4.8=pyhd3eb1b0_2 If you are sure you want an update of your package either try
conda update --allor install a specific version of the package you want usingconda install <pkg>=<version>All requested packages already installed.
Here’s a guy with a similar problem, and it suggests perhaps I need square images. https://github.com/HenriquesLab/ZeroCostDL4Mic/issues/86