Fix image ROI reference population in Zeiss LSM and MIAS readers#4401
Fix image ROI reference population in Zeiss LSM and MIAS readers#4401sbesson wants to merge 4 commits into
Conversation
|
|
||
| int[] position = getPositionFromFile(file); | ||
| int well = position[0]; | ||
| int roiRefIndex = 0; |
There was a problem hiding this comment.
I think this should be initialized to the existing ROI ref count for the relevant Image (with index well). There can be multiple analysis files for the same well, e.g. one *detail.txt and one *AllModesOverlay.tif per channel.
|
|
||
| String roiID = MetadataTools.createLSID("ROI", i); | ||
| String shapeID = MetadataTools.createLSID("Shape", i, 0); | ||
| int roiRefIndex = i - totalROIs; |
There was a problem hiding this comment.
I'm not sure this is quite right. parseOverlays can be called multiple times per series, which would mean that roiRefIndex starts at 0 for every call, potentially overwriting previous references that were set on the same series. Using the existing ROI ref count for Image index i might be the easiest?
There was a problem hiding this comment.
0a8f829 is one way to address this by defining a transient roiRefIndex and resetting it to 0 for each series before the calls to parseOverlays. Is that what you were thinking of?
Initialise the index for each series before parsing the overlays Increment the roiRefIndex every time a ROI / ROI reference is added
If there are multiple analysis files for the same will, the ROI references should be appended
|
After re-reading carefully the MIASReader logic, I was reminded of the following logic bioformats/components/formats-gpl/src/loci/formats/in/MIASReader.java Lines 1160 to 1170 in eb8fd30 The MIAS ROI handling will require more careful attention including some validation win OMERO. To avoid creating a bottleneck, I am proposing the following progression:
|
See #4394 and the failures reported in #4394 (comment)
When populating the OME metadata via
setImageRoiRef, the Zeiss LSM and MIAS reader currently make use of the same index for the ROIRef as the ROI index. For multi-series, this means the setters are typically called as:The sequence above was working with the current
ome-xmlimplementation which was largely ignoring theroiRefIndexinsetImageROIRefand using the order of the calls. With the changes proposed in ome/ome-model#226 and released inorg.openmicroscopy:ome-xml:6.5.2the index is now taken into account.This change updates the readers to separate the
roiIndexfrom theroiRefIndexand ensure each series starts with index 0.Together with #4394, I expect this should address the failures in
miasandzeiss-lsmalthough we likely still want to fix the underlying OME-XML library to support the scenario above which has been functional for years - see ome/ome-model#229.