Closed sbesson closed 4 years ago
Setting to 0 makes sense here and None is certainly not valid.
Verified that without the PR the generated OME-XML has <TiffData FirstC="None" FirstT="None" FirstZ="None">
and with the PR it now contains <TiffData FirstC="0" FirstT="0" FirstZ="0">
as expected.
Looks good to merge from my side.
Discovered while creating a minimal example of usage of this experimental library in https://forum.image.sc/t/spw-and-patterns/38625/5
If
z,c,t
are not passed or parsed from the TIFF files, the default value in theadd_tiff()
is currentlyNOne
and gets serialized as"None"
in the resulting OME-XML which is obviously invalid.Using a variation of the sample snippet copied in the image.sc issue, the following example can be used to test this PR
Without this PR, the generated OME-XML shoudl contain multiple occurences
<TiffData FirstC="None" FirstT="None" FirstZ="None">
while with this PR included, it should be<TiffData FirstC="0" FirstT="0" FirstZ="0">
as expected.NB: the alternate implementation would be to skip the addition of the
FirstZ/FirstC/FirstT
attribute ifz/c/t
isNone
as these attributes are optional and default to0
in the schema.