IDR/omero-mkngff

Handle NGFF without OME/METADATA.ome.xml

Closed this issue · 2 comments

I see from

if info[i][2] = 'METADATA.ome.xml' then
that mkngff expects to find a METADATA.xml with which to update the pixels table, but in the case of omero-cli-zarr-exported NGFF data, we don't have METADATA.xml, so the pixels table won't get updated, leading to the errors seen at IDR/idr-metadata#650 (comment).

We'll need to pick another file to update the pixels table with.

@josh - I can have a go at fixing this, but given my lack of sql skills, I would move the logic for finding a path/name from the setup.sql mkngff_fileset() function into the main def sql() function, to add an extra:

self.ctx.out(f"UPDATE pixels SET name = '{name}', path = '{path}' where image in (select id from Image where fileset ={args.fileset_id});

Logic would be: choose METADATA.ome.xml if it's found, otherwise use top-level .zattrs.

Let me know if you'd prefer to update mkngff_fileset() yourself and keep the logic there? - I can hold off on this (and run sql manually for now as at IDR/idr-metadata#650 (comment) for testing)?

That doesn't sound too bad. I wasn't a huge fan of the if block in the SQL to begin with.