Page 2 of 2

Re: Ordering and OMERO

PostPosted: Tue Dec 21, 2010 11:57 am
by jburel
Hi BK,
Apologies for not answering your post earlier, I was off last week.
bhcho wrote:Currently, I'm not sure if we can generate a temporary dataset with only image file IDs, instead of duplicating images themselves (Could you tell me if it's possible with current OMERO version 4.2.1?).

You can create a tmp dataset (e.g. result1) and link the images to it.
You can then browse the tmp dataset.
You may not want to the actual rating, but use a double annotation with a specific namespace.
If the user does not want to keep the image, he/she can right click and select cut.
The link between the dataset and the image will be deleted.
Then the user can easily renamed the tmp dataset e.g. result1 -> good images.
You won't need to create another dataset.

From what I understand the "rating" annotation will be linked to the images.
You will probably need to have an annotation directly linked to the dataset and filter that way
The renaming, deleting links will work the same way

Jmarie

Re: Ordering and OMERO

PostPosted: Tue Dec 21, 2010 12:33 pm
by bhcho
HI Jmarie,

Thanks for the reply.

But we are still not able to display those images by the order of the "rating" from the 4.2.1 version. Right?

Anyway, could you show me the snippet that creates another dataset with existing image IDs? (python is preferred) and I also need the code that makes a double annotation to each image.

Thanks,
BK

Re: Ordering and OMERO

PostPosted: Tue Dec 21, 2010 12:53 pm
by jburel
Hi BK
That's correct
in 4.2.x, we only order images by name or date.

Jmarie

Re: Ordering and OMERO

PostPosted: Fri Dec 24, 2010 8:15 am
by jburel
Hi BK
To link the existing image to the new dataset:
follow some pseudo code
Code: Select all
#new dataset
dataset = omero.model.DatasetI();
dataset.setName(omero.rtypes.rstring("results"));

#The image was retrieved using another call.
# use unloaded object to avoid update conflicts
image = image.__class__(image.id.val, False)     
l = omero.model.DatasetImageLinkI();
l.setParent(dataset);
l.setChild(image);
# update
updateService.saveAndReturnObject(l);


To link the annotation to the image
Code: Select all
annotation = omero.model.DoubleAnnotationI();
annotation.setDoubleValue(omero.rtypes.rdouble(0.5));
#link the annotation and the image
# use unloaded object to avoid update conflicts
image = image.__class__(image.id.val, False)     
l = omero.model.ImageAnnotationLinkI();
l.setParent(image);
l.setChild(annotation);
# update
updateService.saveAndReturnObject(l);