We're Hiring!

Add key-value pair for selected images failed

General user discussion about using the OMERO platform to its fullest. Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

Add key-value pair for selected images failed

Postby sukunis » Wed Jul 11, 2018 12:44 pm

Dear all,

when I select more than one image in OMERO.web (at your demo server) and add a key-value pair then only the first image of selection holds that key-value. Is that a bug or a feature?

Best Regards
Susanne
sukunis
 
Posts: 16
Joined: Fri Sep 18, 2015 8:12 am

Re: Add key-value pair for selected images failed

Postby rgozim » Thu Jul 12, 2018 2:11 pm

Hi Susanne,

Hope your day's going well!

Applying a key-value pair to one image at a time is an intended behaviour. You can also add a key-value pair to a project, dataset or screen, if that is of any help to you.

Best regards,
Riad
User avatar
rgozim
Team Member
 
Posts: 25
Joined: Thu Jul 20, 2017 9:09 am

Re: Add key-value pair for selected images failed

Postby wmoore » Fri Jul 13, 2018 4:47 am

Hi Susanne,

We decided not to allow editing of Key-Value pairs for multiple objects at once since the update of existing Key-Value pairs would get too tricky / confusing for the user.

E.g.
- Add key1: value1 to an image
- Select this image and another image
- Add key2: value2 - do we add these to the key1: value1 of the first image and create a new key2: value2 only for image2? Or just create a new key2: value2 annotation for both images? (but then we don't allow you to merge this with key1: value1.

- If you can think of work-arounds that would avoid this confusion (e.g. only allow batch adding of key:value pairs if no images already have them) then it would be good to hear.

You can copy multiple rows from one annotation and paste them to other images - this allows you to duplicate them quite quickly if your number of images is not too high.

So, the webclient should currently disable adding/editing of all map annotations when multiple images are selected. If it's enabled and just adds key:value pairs to the first image (as you reported?) that would be a bug.

Regards,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Add key-value pair for selected images failed

Postby sukunis » Fri Jul 13, 2018 6:59 am

Hi Will,

after testing again add Key-Value pairs to multiple images I found out, that the webclient doesn't disabled adding/editing if no key-value entry exists for all images.

I'm not sure that I understand the problem...
In your example
- Add key1: value1 to an image
- Select this image and another image
- Add key2: value2 - do we add these to the key1: value1 of the first image and create a new key2: value2 only for image2? Or just create a new key2: value2 annotation for both images? (but then we don't allow you to merge this with key1: value1.

do you mean the "container" ( I mean: Added by: XY) which is the problem?

One work-around could be to allow the paste option for multiple image selection, so that the user could paste annotations for a lot of images in one window.
For example:
select more than one image shows following structure in Key-Value Pairs overview:
Code: Select all
Added by: Susanne Kunis
To: 90351.ome.tif
Key    Value
Test    1
Test    2
Added by: Susanne Kunis
To: 90352.ome.tif
Key    Value
TestB    3

Now i can select the key-values of 90351 - press copy- go to 90352 - press paste.
At this point I must confess that I did not look into the code and I do not know how complex the functionality is to implement...

So maybe a batch script is a good solution to pipe the Key-Value pairs to specific containers (selection by user name or create containers with special namespaces... I have to think over :-) )

Regards,
Susanne
sukunis
 
Posts: 16
Joined: Fri Sep 18, 2015 8:12 am

Re: Add key-value pair for selected images failed

Postby wmoore » Mon Aug 06, 2018 10:52 am

Hi Susanne,

Apologies for the delay - I've been away.

sukunis wrote:Now i can select the key-values of 90351 - press copy- go to 90352 - press paste.

You can already do this without the batch editing of Key-Value pairs.

In your example, if I selected 3 images (with annotations on 2 of them) and it gives me this:

Code: Select all
Added by: Susanne Kunis
To: 90351.ome.tif
Key    Value
Test    1
Test    2

Added by: Susanne Kunis
To: 90352.ome.tif
Key    Value
TestB    3


Now I want to Add Key: Value
Code: Select all
TestC:    1C
to all 3 images, how do I do that? What does the UI look like?
Assuming you manage to do it so that this gets added to all 3 images, now I have this

Code: Select all
Added by: Susanne Kunis
To: 90351.ome.tif
Key    Value
Test    1
Test    2
TestC  1C

Added by: Susanne Kunis
To: 90352.ome.tif
Key    Value
TestB    3
TestC    1C

Added by: Susanne Kunis
To: thirdimage.ome.tif
Key    Value
TestC    1C


Now, how do I undo that change to delete the
Code: Select all
TestC:    1C
row from each annotation?

An alternative would be to create new annotations when you batch edit (instead of updating existing ones). In that case you'd end up with this (multiple annotations on each image):

Code: Select all
Added by: Susanne Kunis
To: 90351.ome.tif
Key    Value
Test    1
Test    2

Added by: Susanne Kunis
To: 90351.ome.tif
Key    Value
TestC  1C

Added by: Susanne Kunis
To: 90352.ome.tif
Key    Value
TestB    3

Added by: Susanne Kunis
To: 90352.ome.tif
Key    Value
TestC    1C

Added by: Susanne Kunis
To: thirdimage.ome.tif
Key    Value
TestC    1C


However, as above, this could get very confusing when you subsequently want to edit each of these new annotations. How do we support that? We (almost certainly?) don't want to allow batch-creation but not batch-editing.

Hopefully this makes the problem a little clearer.
Let us know if you can see some way to simplify this for the user.

Regards,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Add key-value pair for selected images failed

Postby bjtho08 » Fri Sep 28, 2018 9:55 am

It should not be that difficult to implement, in my opinion (though I am not an experienced programmer).

I imagine the key-val pairs are stored in a dictionary-like structure. Assuming one would never want to have keys that are literally identical but semantically different, there should be no problem with batch adding, editing and deletion of keys and their associated values. For adding, you would want to just append the key-val pair to the dictionary, of course checking in the process that the key does not already exist. If it does, have a dialog choose whether to modify the existing value for that particular key or to keep the current value and reject the attempt to add a new value.

For editing it should be similar. Edit all the existing values. If the key being edited does not exist in one or more of the selected images, then it could be resolved by either just ignoring those instances or having a dialog ask whether the user would like to add the key to those particular instances, maybe going through them one by one, like when overwriting files on a disk.

Batch deleting is just an extension of batch editing, except there is no need to confirm deletion if by accident the user has selected one or more instance that does not already have that particular key.

I believe this would be an appropriate and transparent behavior for batch editing of key-val pairs that most users would intuitively understand.
bjtho08
 
Posts: 5
Joined: Wed Aug 30, 2017 12:18 pm

Re: Add key-value pair for selected images failed

Postby evenhuis » Fri Sep 28, 2018 12:46 pm

Hi bjtho08,

we wrote some scripts for OMERO to handle metadata along the lines that you described. You can check them out here:
https://github.com/evenhuis/omero-user-scripts

The scripts let you:
• add a set of key-vals to all images in a dataset
• parse key-vals out of the filenames
• export key-vals to a csv
• import key-vals from a csv
• batch delete

Internally the kv values are stored in an OrderedDictionary. We have allowed for keys to be literally identical, or rather, each key holds a set of values. An example of when this get used is if multiple stains are present in sample.

OMERO will let you have two annotations with exactly the same key and value, the scripts filter these out when processing the annotations.

Cheers,

Chris
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: Add key-value pair for selected images failed

Postby bjtho08 » Fri Oct 05, 2018 10:35 am

Hi Chris,

Thanks, I will have a look at those scripts. It seems they can do exactly what I would like for handling my rather large datasets, so that's perfect. Hopefully the OMERO team can find a way to incorporate the features we have been discussing in this thread, but until then, this should be fine :)
bjtho08
 
Posts: 5
Joined: Wed Aug 30, 2017 12:18 pm

Re: Add key-value pair for selected images failed

Postby jmoore » Tue Oct 16, 2018 2:58 pm

Guess I would additionally ask if Chris is willing to submit these features. :)

Thanks, all.
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest