Closed sbesson closed 2 years ago
Thanks @sbesson. I think the second option plus README updates makes most sense long-term.
:+1: regarding the warning in the readme, do you roughly remember under which conditions the absence of trailing slash in the scale format string would cause an error ?
Also one related question regarding the semantics of bioformats2raw.layout
. My assumption is that it should match the default hierarchy created by bioformats2raw
. So in case --scale-format-string '%2$d/'
is passed, this key/value can safely be omitted from the top-level group metadata? The alternative would be to also store it alongside the multiscales
metadata.
Kind of wishing I'd been more descriptive in https://github.com/glencoesoftware/bioformats2raw/pull/112/commits/ef95be9fca32835853acffc2d1e12c06c1592499. I think the context was running the commands in #108 and #109?
bioformats2raw.layout
is just a version number; raw2ometiff will complain if it is missing, but it should complain no matter what if --scale-format-string
is used. I don't think it's a problem to just omit it.
Pushed two commits adding coverage for both forms of the scale format string in the tests and handling the case of trailing slash.
Likely outwit this PR, I wonder if a short-cut for the flattening would be in scope.
Last 2 commits are fine with me. Extra option captured as https://github.com/glencoesoftware/bioformats2raw/issues/132. Think this just needs final review and merge from @chris-allan.
See https://forum.image.sc/t/dropping-the-top-layer-in-ome-zarr-data-without-losing-multiscales-metadata/63286
As originally suggested in https://github.com/glencoesoftware/bioformats2raw/issues/108#issuecomment-887579778 and captured in the README, setting the
--scale-format-string
to%2$d/
allows to flatten the hierarchy createdbioformats2raw
to match the layout of OME-NGFF multiscale images. Usingbioformat2raw 0.4.0
, this command results in the absence of themultiscales
metadata from the top-level group:After investigation, this is due to the logic in https://github.com/glencoesoftware/bioformats2raw/blob/master/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java#L1483 which fails to handle this particular
resolutionString
and lead to the following resolution:instead of
As noted on the forum post, using the current release of the tool, dropping the trailing slash produces a different output which preservesx the top-level Zarr/OME-NGFF metadata.
However, this value conflicts with the recommendation at the bottom of https://github.com/glencoesoftware/bioformats2raw/tree/v0.4.0#--scale-format-string.
At minimum 8fb26372b1fc2772123b098ec52acd3fcf741022 expands the existing unit test (without the trailing slash) to capture the current expectation for the second command and check the presence of a Zarr group with
multiscales
metadata.This PR will need at least one extra commit but there are two options:
%2$d
becomes the recommended format for this layout, update the README and review the warning about trailing slashes in the READMEConverter
will need updates to match the data generated by%2$d/
and%2$d
@melissalinkert @chris-allan let me know what you are happy to support moving forward and I can push updates accordingly