Tagging ScreenPlateWell
Posted: Fri Jan 14, 2011 2:24 pm
Hi all,
I recently begun to code against omero in matlab and python script for high throughput data and the learning curve is quite steep (but there certainly is a lot of doc around). In particular I have some problems/comments about wells tagging:
-are 'fields' in Insight 'WellSample' in the model? When tagging a field (which have a different id than the actual image behind it) in insight, it seems to actually tag the image (and you cannot really tag a well?); when tagging in a script, tagging well or wellsample does not seem to have any effect (the tag appears in the tag list in insight but seems to be linked to 0 objects), when tagging the image of a wellsample, the tag appear when clicking the field in insight and the image appear in the image list for that tag. So in the end (as far as Insight is concerned anyway), it seems that tags are to be at the level of screens, plates, or images?...
-in insight when an image is looked up outside of the plate interface (like searched for or through the tag interface), its very hard to know where it is from: the name would tend to be generic ('001001000.flex [Well G-11; Field #1]'), the 'contained in Dataset' is empty (as it should be) and there is not 'contained in Plate'. A minor point but that may come in handy... (actually it may be a larger problem: a file attached to a plate come up as 'attached to:''wild and free (...)' if you look it up in the attachment interface)
-about tags and users/group: can tags and tag sets be used across users in the same group completely transparently? Between groups? Can you nest tag sets, can a tag belong to several tag sets?
-I am on a script to automatically tag wells (or images in wells, as it happens). Given a text to tag with, I search for a tag with it; if it does not yet exist I create it else I re-use the existing one. I run into a problem trying to update the database: it works with a newly created tag but fail if I re-use an old one: ('ws' is a wellsample from a query service, 'tag' a tag from a search service)
link=ImageAnnotationLinkI()
img = ws.getImage()
link.setParent(img)
link.setChild(tag)
updateService.saveObject(link)
gives me (the same happens if I use img.linkAnnotation(tag)):
* serverExceptionClass = ome.conditions.ValidationException
* message = could not insert: [ome.model.annotations.ImageAnnotationLink]; SQL [insert into imageannotationlink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [imageannotationlink_parent_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.annotations.ImageAnnotationLink]
* }
whereas ('totag' being a string)
tag = TagAnnotationI()
tag.setTextValue(rstring(totag))
img = ws.getImage()
link=img.linkAnnotation(tag)
updateService.saveObject(link)
works... What am I doing wrong?
Many thanks
A.
I recently begun to code against omero in matlab and python script for high throughput data and the learning curve is quite steep (but there certainly is a lot of doc around). In particular I have some problems/comments about wells tagging:
-are 'fields' in Insight 'WellSample' in the model? When tagging a field (which have a different id than the actual image behind it) in insight, it seems to actually tag the image (and you cannot really tag a well?); when tagging in a script, tagging well or wellsample does not seem to have any effect (the tag appears in the tag list in insight but seems to be linked to 0 objects), when tagging the image of a wellsample, the tag appear when clicking the field in insight and the image appear in the image list for that tag. So in the end (as far as Insight is concerned anyway), it seems that tags are to be at the level of screens, plates, or images?...
-in insight when an image is looked up outside of the plate interface (like searched for or through the tag interface), its very hard to know where it is from: the name would tend to be generic ('001001000.flex [Well G-11; Field #1]'), the 'contained in Dataset' is empty (as it should be) and there is not 'contained in Plate'. A minor point but that may come in handy... (actually it may be a larger problem: a file attached to a plate come up as 'attached to:''wild and free (...)' if you look it up in the attachment interface)
-about tags and users/group: can tags and tag sets be used across users in the same group completely transparently? Between groups? Can you nest tag sets, can a tag belong to several tag sets?
-I am on a script to automatically tag wells (or images in wells, as it happens). Given a text to tag with, I search for a tag with it; if it does not yet exist I create it else I re-use the existing one. I run into a problem trying to update the database: it works with a newly created tag but fail if I re-use an old one: ('ws' is a wellsample from a query service, 'tag' a tag from a search service)
link=ImageAnnotationLinkI()
img = ws.getImage()
link.setParent(img)
link.setChild(tag)
updateService.saveObject(link)
gives me (the same happens if I use img.linkAnnotation(tag)):
* serverExceptionClass = ome.conditions.ValidationException
* message = could not insert: [ome.model.annotations.ImageAnnotationLink]; SQL [insert into imageannotationlink (child, creation_id, external_id, group_id, owner_id, permissions, update_id, parent, version, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [imageannotationlink_parent_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [ome.model.annotations.ImageAnnotationLink]
* }
whereas ('totag' being a string)
tag = TagAnnotationI()
tag.setTextValue(rstring(totag))
img = ws.getImage()
link=img.linkAnnotation(tag)
updateService.saveObject(link)
works... What am I doing wrong?
Many thanks
A.