glencoesoftware / bioformats2raw

Bio-Formats image file format to raw format converter
GNU General Public License v2.0
77 stars 35 forks source link

Fix dataset paths when `--scale-format-string` is used #181

Closed melissalinkert closed 1 year ago

melissalinkert commented 1 year ago

Fixes #179.

This removes trailing slashes (as would be present with --scale-format-string '%2$d/') so that the relative dataset path is not empty.

The associated test should fail without the change to Converter, and pass with it. Independent of the test, something like the command in #179 can be used:

$ bioformats2raw -p input.fake output.zarr --scale-format-string '%2$d/'
$ bioformats2raw -p input.fake output-minimal.zarr --scale-format-string '%2$d/' --no-root-group --no-ome-meta-export

Without this PR, in both cases the *.zarr/.zattrs should have empty path attributes on each of the datasets. With this PR, both commands should result in path being populated with something that exists relative to the .zattrs location.