ome / omero-web

Django-based OMERO.web client
https://www.openmicroscopy.org/omero
16 stars 29 forks source link

Fix getAnnotationCounts Acquisition #299 #518

Closed Tom-TBT closed 6 months ago

Tom-TBT commented 7 months ago

Fix of https://github.com/ome/omero-web/issues/299

Replace acquisition by plateacquisition expected by manager.getBatchAnnotationCounts

Also reuse the existing objs loaded at the beginning of omeroweb.webclient.views.batch_annotate, as it should stay the same. Avoid loading the objects twice.

Tom-TBT commented 7 months ago

Just to comment on my change, I ended up adding the fix to omeroweb.webclient.views.batch_annotate. The switch between acquisition / plateacquisition seemed to me that it is only part of omero-web, not of omero-py. Hence I fixed the code calling the function with wrong parameters, rather than fixing the possible plate-acquisition alias in omero-py.

For test on merge-ci, is it possible to upload that plate from the IDR? https://idr.openmicroscopy.org/webclient/?show=plate-2551

I want to look more into the plate-acquisition object to make use of it. I could have some more changes coming in the future, so the test plate could be useful for me later 😇

pwalczysko commented 7 months ago

For test on merge-ci, is it possible to upload that plate from the IDR? https://idr.openmicroscopy.org/webclient/?show=plate-2551

Yes, but it does not end as expected. Instead, I have something more simple for you. If you ever need samples, you can search through https://downloads.openmicroscopy.org/images/OME-XML/2016-06/ - you can create your own ome-xml according to the samples there and using our Schema.

I spared the effort though by finding a similar ome-xml plate as in https://downloads.openmicroscopy.org/images/OME-XML/2016-06/ and importing it to merge-ci. See https://merge-ci.openmicroscopy.org/web/webclient/?show=plate-12161 - user-3. Let me know if it fits.

For reference and to give you the possibility to adjust @Tom-TBT or produce your own samples, the PlateAcquisitions are defined in the abovementioned ome-xml as

       <PlateAcquisition EndTime="2006-05-04T18:13:51.0Z" ID="PlateAcquisition:0" Name="PlateAcquisition Name 0" StartTime="2006-05-04T18:13:51.0Z">
            <Description>PlateAcquisition Description 0</Description>
            <WellSampleRef ID="WellSample:0_0_0_0_0"/>
            <WellSampleRef ID="WellSample:0_0_0_1_0"/>
            <WellSampleRef ID="WellSample:0_0_0_2_0"/>
        </PlateAcquisition>
        <PlateAcquisition EndTime="2006-05-04T18:13:51.0Z" ID="PlateAcquisition:1" Name="PlateAcquisition Name 1" StartTime="2006-05-04T18:13:51.0Z">
            <Description>PlateAcquisition Description 1</Description>
            <WellSampleRef ID="WellSample:0_0_0_0_1"/>
            <WellSampleRef ID="WellSample:0_0_0_1_1"/>
            <WellSampleRef ID="WellSample:0_0_0_2_1"/>
        </PlateAcquisition>
        <PlateAcquisition EndTime="2006-05-04T18:13:51.0Z" ID="PlateAcquisition:2" Name="PlateAcquisition Name 2" StartTime="2006-05-04T18:13:51.0Z">
            <Description>PlateAcquisition Description 2</Description>
            <WellSampleRef ID="WellSample:0_0_0_0_2"/>
            <WellSampleRef ID="WellSample:0_0_0_1_2"/>
            <WellSampleRef ID="WellSample:0_0_0_2_2"/>
        </PlateAcquisition>
will-moore commented 7 months ago

Thanks @pwalczysko for that. I was also looking for a solution and found that you can use fake files (https://bio-formats.readthedocs.io/en/stable/developers/generating-test-images.html)

$ touch "testPlate&plateAcqs=3&plateRows=3&plateCols=4&fields=2.fake"
$ omero import "testPlate&plateAcqs=3&plateRows=3&plateCols=4&fields=2.fake"
Screenshot 2023-12-07 at 21 08 21
will-moore commented 7 months ago

I imported a 96-well, 3-PlateAcquisitions plate into merge-ci https://merge-ci.openmicroscopy.org/web/webclient/?show=plate-12205

will-moore commented 6 months ago

Looks good and is working fine:

Screenshot 2023-12-15 at 16 20 46

pwalczysko commented 6 months ago

Was able to repeat both the bug (withoiut this PR, on merge-ci) and the fix (with this PR, on merge-ci). Works as expected.