hms-dbmi / viv

Library for multiscale visualization of high-resolution multiplexed bioimaging data on the web. Directly renders Zarr and OME-TIFF.
http://avivator.gehlenborglab.org
MIT License
274 stars 42 forks source link

Errors for previously working files #729

Closed xinaesthete closed 10 months ago

xinaesthete commented 10 months ago

Describe the bug

Trying to load OME-TIFFs into Avivator, or using the loadOmeTiff function, leads to errors.

This is console output from the current Avivator website when loading an image that was previously working:

ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "object",
    "path": [
      "Image",
      0,
      "Description"
    ],
    "message": "Expected string, received object"
  }
]
    at get error [as error] (index-5def9da2.js:2082:64484)
    at nr.parse (index-5def9da2.js:2082:66573)
    at PG (index-5def9da2.js:2082:110289)
    at ktA (index-5def9da2.js:2082:113234)
    at async G1 (index-5def9da2.js:2082:114545)
    at async hIA (index-5def9da2.js:3895:10405)
    at async g (index-5def9da2.js:3895:16720)
overrideMethod @ console.js:213
hIA @ index-5def9da2.js:3895
await in hIA (async)
g @ index-5def9da2.js:3895
(anonymous) @ index-5def9da2.js:3895
f3 @ index-5def9da2.js:41
e.unstable_runWithPriority @ index-5def9da2.js:26
Wo @ index-5def9da2.js:37
co @ index-5def9da2.js:41
(anonymous) @ index-5def9da2.js:41
O @ index-5def9da2.js:26
Q.port1.onmessage @ index-5def9da2.js:26

I tried loading the same into a local forked version (https://github.com/xinaesthete/viv/tree/context2, see my discussion thread), and it did work there. I switched that local version to main (commit a1a8007), updated dependencies, and now I get a different error for that image:

Uncaught (in promise) RangeError: Array buffer allocation failed (geotiffimage.js:52)
    at new ArrayBuffer (<anonymous>)
    at new Uint32Array (<anonymous>)
    at arrayForType (geotiffimage.js:52:16)
    at GeoTIFFImage.getArrayForSample (geotiffimage.js:351:12)
    at GeoTIFFImage.readRasters (geotiffimage.js:598:33)
    at TiffPixelSource._readRasters (pixel-source.ts:53:32)
    at TiffPixelSource.getRaster (pixel-source.ts:38:17)
    at async getSingleSelectionStats2D (utils.js?t=1700069072633:385:18)

To Reproduce I'm not sure what data I have that I could share, but can look into that if it will help.

Environment:

manzt commented 10 months ago

Do you have an example dataset to share? This seems to be an issue with the parsing of the OME-XML metadata <Description> tag. I have made a PR to allow for an unknown type for the description, but the latter error seems related to the pixel data, which is very hard to debug without a source image.

manzt commented 10 months ago

730 should hopefully have fixed this issue, but again, hard to know without an example image.