ome / omero-metadata

OMERO plugin for metadata manipulation https://www.openmicroscopy.org/omero/
GNU General Public License v2.0
7 stars 13 forks source link

Support import of ROIs by Roi Name for dataset/project & screen/plate levels #81

Open JensWendt opened 1 year ago

JensWendt commented 1 year ago

Hello,

for images it is possible to add table data for ROIs by a s type column Roi Name, without knowledge of the Roi ID. I would very much like to be able to do this on a dataset/project and screen/plate level as well. Background:

Goal

populate Metadata of whole projects/datasets/screens/plates with the slightly adapted .csv output from CP, utilizing CP-object name = Roi Name

will-moore commented 1 year ago

Hi @JensWendt - Is the Roi Name guaranteed to be unique across the whole project/dataset or screen/plate?

You can see what was needed at https://github.com/ome/omero-metadata/pull/62 for supporting "ROI IDs per Dataset". For look-up by ROI Name, you'd need to create rois_by_name dicts and update the logic for when get_roi_id_by_name() is called to not be restricted to Image as target_class.

Happy to help with more pointers if you want to give it a try?

JensWendt commented 1 year ago

Hi @will-moore ,

Most likely the Roi Name will only be unique in the image generally speaking. For the purpose I have in mind the ROIs will be named 1,2,...,325,326,etc consecutively in each image in the overarching object (dataset, screen, ...). E.g. Img1 has ROIs 1-567, Img2 has ROIs 1-1034 and Img3 has ROIs 1-54.

I read through #62 but could not quite figure out what I was supposed to see :/ Can we not implement the same logic we use for images in Projects with multiple datasets:

    def get_image_id_by_name(self, iname, dname=None):
        return self.images_by_name[dname][iname].id.val

and adapt this to something like, e.g. for the DatasetWrapperclass?

    def get_roi_id_by_name(self, roiName, imageName=None):
        return self.rois_by_name[imageName][roiName].id.val

I would only give this a try, if you cannot fit this into your own schedule (for which I would have the fullest understanding), because it would take me significantly longer than you to understand your 2k+ lines of code.