scverse / spatialdata

An open and interoperable data framework for spatial omics data
https://spatialdata.scverse.org/
BSD 3-Clause "New" or "Revised" License
235 stars 43 forks source link

Invalid TIFF header #536

Closed minhtien-trinh closed 7 months ago

minhtien-trinh commented 7 months ago

I've tried reading in MCMicro example data provided here and unfortunately I run into the following error:

full traceback ``` INFO no axes information specified in the object, setting `dims` to: ('c', 'y', 'x') C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\pims\api.py:204: UserWarning: errored: not a TIFF file b'\x00\x05\x16\x07' warn(message) Invalid TIFF header Could not find codec parameters for stream 0 (Video: tiff, none): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Invalid TIFF header C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\pims\api.py:204: UserWarning: errored: [Errno 1094995529] Invalid data found when processing input; last error log: [tiff] Invalid TIFF header warn(message) C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\pims\api.py:204: UserWarning: errored: 'NoneType' object has no attribute 'isJVMStarted' warn(message) Traceback (most recent call last): File "c:\Users\mtrinh\Downloads\Exemplar001\spatialdata_tests.py", line 7, in spatialdata_io.mcmicro(path) File "C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\spatialdata_io\readers\mcmicro.py", line 133, in mcmicro data = imread(raw_image, **imread_kwargs) File "C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\dask_image\imread\__init__.py", line 48, in imread with pims.open(sfname) as imgs: File "C:\Users\mtrinh\AppData\Local\anaconda3\envs\spatial_m\lib\site-packages\pims\api.py", line 206, in open raise UnknownFormatError("All handlers returned exceptions:\n" + exceptions) pims.api.UnknownFormatError: All handlers returned exceptions: errored: not a TIFF file b'\x00\x05\x16\x07' errored: [Errno 1094995529] Invalid data found when processing input; last error log: [tiff] Invalid TIFF header errored: 'NoneType' object has no attribute 'isJVMStarted' ```
files in the directory ``` C:. │ markers.csv │ params.yml │ spatialdata_tests.py │ ├───illumination │ exemplar-001-cycle-06-dfp.tif │ exemplar-001-cycle-06-ffp.tif │ exemplar-001-cycle-07-dfp.tif │ exemplar-001-cycle-07-ffp.tif │ exemplar-001-cycle-08-dfp.tif │ exemplar-001-cycle-08-ffp.tif │ ├───qc │ │ metadata.yml │ │ params.yml │ │ │ ├───mesmer │ └───provenance │ ashlar.log │ ashlar.sh │ mcquant-1.log │ mcquant-1.sh │ mesmer-1.log │ mesmer-1.sh │ ├───quantification │ Exemplar001--mesmer_cell.csv │ ├───raw │ exemplar-001-cycle-06.ome.tiff │ exemplar-001-cycle-07.ome.tiff │ exemplar-001-cycle-08.ome.tiff │ ├───registration │ Exemplar001.ome.tif │ └───segmentation └───mesmer-Exemplar001 cell.tif ```
current environment setup ``` # Name Version Build Channel aiobotocore 2.5.4 pypi_0 pypi aiohttp 3.9.3 pypi_0 pypi aioitertools 0.11.0 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi alabaster 0.7.16 pypi_0 pypi anndata 0.10.6 pypi_0 pypi annotated-types 0.6.0 pypi_0 pypi app-model 0.2.6 pypi_0 pypi appdirs 1.4.4 pypi_0 pypi array-api-compat 1.6 pypi_0 pypi asciitree 0.3.3 pypi_0 pypi asttokens 2.4.1 pypi_0 pypi async-timeout 4.0.3 pypi_0 pypi attrs 23.2.0 pypi_0 pypi av 12.0.0 pypi_0 pypi babel 2.14.0 pypi_0 pypi botocore 1.31.17 pypi_0 pypi build 1.2.1 pypi_0 pypi bzip2 1.0.8 h2bbff1b_5 ca-certificates 2024.3.11 haa95532_0 cachey 0.2.1 pypi_0 pypi certifi 2024.2.2 pypi_0 pypi charset-normalizer 3.3.2 pypi_0 pypi click 8.1.7 pypi_0 pypi click-plugins 1.1.1 pypi_0 pypi cligj 0.7.2 pypi_0 pypi cloudpickle 3.0.0 pypi_0 pypi colorama 0.4.6 pypi_0 pypi colorcet 3.1.0 pypi_0 pypi comm 0.2.2 pypi_0 pypi contourpy 1.2.1 pypi_0 pypi cycler 0.12.1 pypi_0 pypi dask 2024.2.1 pypi_0 pypi dask-image 2023.8.1 pypi_0 pypi datashader 0.16.0 pypi_0 pypi debugpy 1.8.1 pypi_0 pypi decorator 5.1.1 pypi_0 pypi distributed 2024.2.1 pypi_0 pypi docstring-parser 0.16 pypi_0 pypi docutils 0.20.1 pypi_0 pypi exceptiongroup 1.2.0 pypi_0 pypi executing 2.0.1 pypi_0 pypi fasteners 0.19 pypi_0 pypi fcsparser 0.2.8 pypi_0 pypi fiona 1.9.6 pypi_0 pypi fonttools 4.50.0 pypi_0 pypi freetype-py 2.4.0 pypi_0 pypi frozenlist 1.4.1 pypi_0 pypi fsspec 2023.6.0 pypi_0 pypi geopandas 0.14.3 pypi_0 pypi h5py 3.10.0 pypi_0 pypi heapdict 1.0.1 pypi_0 pypi hsluv 5.0.4 pypi_0 pypi idna 3.6 pypi_0 pypi imagecodecs 2024.1.1 pypi_0 pypi imageio 2.34.0 pypi_0 pypi imagesize 1.4.1 pypi_0 pypi importlib-metadata 7.1.0 pypi_0 pypi in-n-out 0.2.0 pypi_0 pypi ipykernel 6.29.4 pypi_0 pypi ipython 8.23.0 pypi_0 pypi jedi 0.19.1 pypi_0 pypi jinja2 3.1.3 pypi_0 pypi jmespath 1.0.1 pypi_0 pypi joblib 1.3.2 pypi_0 pypi jsonschema 4.21.1 pypi_0 pypi jsonschema-specifications 2023.12.1 pypi_0 pypi jupyter-client 8.6.1 pypi_0 pypi jupyter-core 5.7.2 pypi_0 pypi kiwisolver 1.4.5 pypi_0 pypi lamin-utils 0.13.1 pypi_0 pypi lazy-loader 0.3 pypi_0 pypi legacy-api-wrap 1.4 pypi_0 pypi libffi 3.4.4 hd77b12b_0 llvmlite 0.42.0 pypi_0 pypi locket 1.0.0 pypi_0 pypi loguru 0.7.2 pypi_0 pypi magicgui 0.8.2 pypi_0 pypi markdown-it-py 3.0.0 pypi_0 pypi markupsafe 2.1.5 pypi_0 pypi matplotlib 3.8.4 pypi_0 pypi matplotlib-inline 0.1.6 pypi_0 pypi matplotlib-scalebar 0.8.1 pypi_0 pypi mdurl 0.1.2 pypi_0 pypi msgpack 1.0.8 pypi_0 pypi multidict 6.0.5 pypi_0 pypi multipledispatch 1.0.0 pypi_0 pypi multiscale-spatial-image 0.11.2 pypi_0 pypi napari 0.4.19.post1 pypi_0 pypi napari-console 0.0.9 pypi_0 pypi napari-matplotlib 2.0.1 pypi_0 pypi napari-plugin-engine 0.2.0 pypi_0 pypi napari-spatialdata 0.4.1 pypi_0 pypi napari-svg 0.1.10 pypi_0 pypi natsort 8.4.0 pypi_0 pypi nest-asyncio 1.6.0 pypi_0 pypi networkx 3.2.1 pypi_0 pypi npe2 0.7.5 pypi_0 pypi numba 0.59.1 pypi_0 pypi numcodecs 0.12.1 pypi_0 pypi numpy 1.23.4 pypi_0 pypi numpydoc 1.7.0 pypi_0 pypi ome-zarr 0.8.3 pypi_0 pypi openssl 3.0.13 h2bbff1b_0 packaging 24.0 pypi_0 pypi pandas 2.2.1 pypi_0 pypi param 2.1.0 pypi_0 pypi parso 0.8.3 pypi_0 pypi partd 1.4.1 pypi_0 pypi patsy 0.5.6 pypi_0 pypi pillow 10.3.0 pypi_0 pypi pims 0.6.1 pypi_0 pypi pint 0.23 pypi_0 pypi pip 23.3.1 py310haa95532_0 platformdirs 4.2.0 pypi_0 pypi pooch 1.8.1 pypi_0 pypi prompt-toolkit 3.0.43 pypi_0 pypi psutil 5.9.8 pypi_0 pypi psygnal 0.11.0 pypi_0 pypi pure-eval 0.2.2 pypi_0 pypi pyarrow 15.0.2 pypi_0 pypi pyconify 0.1.6 pypi_0 pypi pyct 0.5.0 pypi_0 pypi pydantic 2.6.4 pypi_0 pypi pydantic-compat 0.1.2 pypi_0 pypi pydantic-core 2.16.3 pypi_0 pypi pygeos 0.14 pypi_0 pypi pygments 2.17.2 pypi_0 pypi pynndescent 0.5.12 pypi_0 pypi pyopengl 3.1.7 pypi_0 pypi pyparsing 3.1.2 pypi_0 pypi pyproj 3.6.1 pypi_0 pypi pyproject-hooks 1.0.0 pypi_0 pypi python 3.10.14 he1021f5_0 python-dateutil 2.9.0.post0 pypi_0 pypi pytz 2024.1 pypi_0 pypi pywin32 306 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi pyzmq 25.1.2 pypi_0 pypi qtconsole 5.5.1 pypi_0 pypi qtpy 2.4.1 pypi_0 pypi readfcs 1.1.7 pypi_0 pypi referencing 0.34.0 pypi_0 pypi requests 2.31.0 pypi_0 pypi rich 13.7.1 pypi_0 pypi rpds-py 0.18.0 pypi_0 pypi s3fs 2023.6.0 pypi_0 pypi scanpy 1.10.0 pypi_0 pypi scikit-image 0.22.0 pypi_0 pypi scikit-learn 1.4.1.post1 pypi_0 pypi scipy 1.13.0 pypi_0 pypi seaborn 0.13.2 pypi_0 pypi session-info 1.0.0 pypi_0 pypi setuptools 68.2.2 py310haa95532_0 shapely 2.0.3 pypi_0 pypi shellingham 1.5.4 pypi_0 pypi six 1.16.0 pypi_0 pypi slicerator 1.1.0 pypi_0 pypi snowballstemmer 2.2.0 pypi_0 pypi sortedcontainers 2.4.0 pypi_0 pypi spatial-image 0.3.0 pypi_0 pypi spatialdata 0.1.2 pypi_0 pypi spatialdata-io 0.1.2 pypi_0 pypi spatialdata-plot 0.2.1 pypi_0 pypi sphinx 7.2.6 pypi_0 pypi sphinxcontrib-applehelp 1.0.8 pypi_0 pypi sphinxcontrib-devhelp 1.0.6 pypi_0 pypi sphinxcontrib-htmlhelp 2.0.5 pypi_0 pypi sphinxcontrib-jsmath 1.0.1 pypi_0 pypi sphinxcontrib-qthelp 1.0.7 pypi_0 pypi sphinxcontrib-serializinghtml 1.1.10 pypi_0 pypi sqlite 3.41.2 h2bbff1b_0 stack-data 0.6.3 pypi_0 pypi statsmodels 0.14.1 pypi_0 pypi stdlib-list 0.10.0 pypi_0 pypi superqt 0.6.3 pypi_0 pypi tabulate 0.9.0 pypi_0 pypi tblib 3.0.0 pypi_0 pypi threadpoolctl 3.4.0 pypi_0 pypi tifffile 2024.2.12 pypi_0 pypi tinycss2 1.2.1 pypi_0 pypi tk 8.6.12 h2bbff1b_0 tomli 2.0.1 pypi_0 pypi tomli-w 1.0.0 pypi_0 pypi toolz 0.12.1 pypi_0 pypi tornado 6.4 pypi_0 pypi tqdm 4.66.2 pypi_0 pypi traitlets 5.14.2 pypi_0 pypi typer 0.12.0 pypi_0 pypi typer-cli 0.12.0 pypi_0 pypi typer-slim 0.12.0 pypi_0 pypi typing-extensions 4.10.0 pypi_0 pypi tzdata 2024.1 pypi_0 pypi umap-learn 0.5.6 pypi_0 pypi urllib3 1.26.18 pypi_0 pypi vc 14.2 h21ff451_1 vispy 0.14.2 pypi_0 pypi vs2015_runtime 14.27.29016 h5e58377_2 wcwidth 0.2.13 pypi_0 pypi webencodings 0.5.1 pypi_0 pypi wheel 0.41.2 py310haa95532_0 win32-setctime 1.1.0 pypi_0 pypi wrapt 1.16.0 pypi_0 pypi xarray 2023.12.0 pypi_0 pypi xarray-dataclasses 1.7.0 pypi_0 pypi xarray-datatree 0.0.14 pypi_0 pypi xarray-schema 0.0.3 pypi_0 pypi xarray-spatial 0.3.7 pypi_0 pypi xz 5.4.6 h8cc25b3_0 yarl 1.9.4 pypi_0 pypi zarr 2.17.1 pypi_0 pypi zict 3.0.0 pypi_0 pypi zipp 3.18.1 pypi_0 pypi zlib 1.2.13 h8cc25b3_0 ```

I am working on Windows 10, strangely enough the same setup works on Mac without any issues. Any help/tips are greatly appreciated :)

melonora commented 7 months ago

Give me 1 day, flying in a bit but I can check tomorrow morning on my windows laptop.

minhtien-trinh commented 7 months ago

While going through the issue with @josenimo, we realized that macOS creates hidden Mac system files (_.filename.tiff) related to the original tiff files which cause the tiff read in to fail. Deleting these files resolved the issue.

kevinyamauchi commented 7 months ago

Thanks for the update!

melonora commented 7 months ago

Thanks!