Task #12539 (closed)
Modulo annotation using duplicate ID
Reported by: | ajpatterson | Owned by: | mlinkert |
---|---|---|---|
Priority: | major | Milestone: | 5.1.0-m2 |
Component: | Bio-Formats | Version: | 5.0.3 |
Keywords: | n.a. | Cc: | imunro-x, spli, y.alexandrov@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
When the modulo annotation is saved it is using an id of "Annotation:0" even if this ID is already in use by another annotation.
If from matlab you add another annotation before you setup the modulo you produce a file with two "Annotation:0"s, but if you setup the modulo then add another annotation it does work.
Do we need another parameter for the modulo function that takes the number to use for the annotation ID?
Change History (9)
comment:1 Changed 10 years ago by mlinkert
- Milestone changed from Unscheduled to 5.1.0
comment:2 Changed 10 years ago by jamoore
- Milestone changed from 5.1.0 to 5.1.0-m2
- Priority changed from minor to major
comment:3 Changed 10 years ago by imunro-x
N.B. Although we have only demonstrated this issue from Matlab I would be surprised if it was specific to Matlab.
comment:4 Changed 10 years ago by mlinkert
Could you please link or paste the Matlab code that demonstrates the problem?
comment:5 Changed 10 years ago by imunro-x
See https://github.com/imunro/ic-converterM/blob/master/save_as_OMEtiff_Synthetic_Desc.m. For example.
No errors are generated but see XML
If all the zeroes in lines 72 & 73 are replaced by ones (or if these 2 lines are placed before the call to addModuloAlong I think) then this routine behaves as intended & generates 2 annotations.
Modulo & text.
comment:6 Changed 10 years ago by mlinkert
OK, looking at the code I think this is something that needs to be fixed in your Matlab code, not in the Modulo creation. The addModuloAlong method actively avoids using Annotation IDs that are already in use (https://github.com/openmicroscopy/bioformats/blob/develop/components/formats-api/src/loci/formats/services/OMEXMLServiceImpl.java#L936), but it cannot predict that an ID will be re-used later. It is the responsibility of subsequent calls to setXMLAnnotationID to not use re-use IDs.
Re-ordering the calls so that line 70 goes after lines 72-73 should work, as should checking values of getXMLAnnotationID before line 72 (similar to what addModuloAlong does).
comment:7 Changed 10 years ago by imunro-x
This seems a little counter-intuitive to me. AddModuloAlong? is smart enough to avoid pre-existing Annotations but setXMLAnnotationID isn't. Also no error messages are generated.
We have a workable approach though so this is very minor.
comment:8 Changed 10 years ago by mlinkert
- Resolution set to wontfix
- Status changed from new to closed
That's all expected behavior, though. MetadataStore? in general is fairly liberal in what it accepts; it's up to the caller to make calls in such a way that IDs don't conflict. Reworking MetadataStore? to perform thorough validity checks is by no means trivial, and is likely to result in substantial performance penalties (since the entire graph must be checked on every call into MetadataStore?). As long as addModuloAlong (which is not part of MetadataStore?) does what it should, I think this is outside the scope of what we can reasonably fix.
comment:9 Changed 10 years ago by imunro-x
I think Andrew & I were thinking more in terms of changing addModuloAlong to behave more like setXMLAnnotationID. If he's happy though ...
Bumping this up for the m2 schema release.