[ome-devel] CLI import, exception when trying to add annotation link

Josh Moore josh at glencoesoftware.com
Tue Jun 9 13:55:42 BST 2015


On Mon, Jun 8, 2015 at 2:59 PM, Niko Ehrenfeuchter
<nikolaus.ehrenfeuchter at unibas.ch> wrote:
> Hi Sebastien,

Hi Niko,


> I had a chance to look at the suggested code now, but parsing out the image
> ID from the logfile seems to be a pretty large overhead to me, especially as
> all the infrastructure needs to be in place (writing temporary logfiles at a
> proper location, parsing them in a robust way, etc.).

Right. This is what the-software-formerly-known-as-dropbox does internally.


> This is certainly reasonable from within a shell script, but my use case is
> from within a Python script - I basically only gave the CLI commands as a
> simple way to reproduce my problem (for importing images via Python I have
> to use the CLI class anyway).
>
> Personally, I'd love to see the ID of an imported image being returned by
> the cli.invoke() call for example. Does that sound reasonable to you?

And agreed, that this should be default behavior, but unfortunately it amounts
to a breaking change. Perhaps we could add an option like `--future`
or `--parse`
(or whatever) for getting the behavior you're looking for now, and
then in the next
breaking release, we switch to passing Image IDs (and PlateIDs?) rather than
PixelIDs.


> Until then, I'll still have a closer look if I can use your
> parsing-suggestion in our scenario.

+1 Let us know if we can help.
~Josh.


> Thanks a lot!
> ~Niko
>
>
> On 04.06.2015 23:02, Sebastien Besson (Staff) wrote:
>>
>> Hi Niko,
>>
>> looking at the source code, are you linking the image to a comment
>> annotation or a different
>> type of annotation?
>> At the moment, the `—annotation_link` option in the importer code can
>> only handle comment
>> annotations (and we may have suggested the opposite during the meeting,
>> apologies if that
>> was the case) - see
>>
>> https://github.com/openmicroscopy/openmicroscopy/blob/v5.1.2/components/blitz/src/ome/formats/importer/cli/CommandLineImporter.java#L843
>>
>> If you want to create a link to a different type of annotation, your
>> best current solution using the
>> current state might be to do the following post-import:
>> 1- parse the output of bin/omero import to retrieve the image id - see
>> for instance
>>
>> https://github.com/sbesson/openmicroscopy/blob/v5.1.2/examples/Training/training_setup.sh#L52
>> 2- call bin/omero obj in a separate command to link the image to the
>> know annotation e.g.
>> $ bin/omero obj new ImageAnnotationLink parent=Image:iid
>> child=FileAnnotation:fid
>>
>> Best,
>> Sebastien
>>
>>> On 4 Jun 2015, at 21:40, Niko Ehrenfeuchter
>>> <nikolaus.ehrenfeuchter at unibas.ch
>>> <mailto:nikolaus.ehrenfeuchter at unibas.ch>> wrote:
>>>

>>>>> Am I doing something wrong?
>>>>
>>>>
>>>> A quick guess from the road: is the annotation in another group?
>>>
>>>
>>> I don't think so, as another image in this  dataset has the very same
>>> annotation - set via the webclient. At least if I remember correctly.
>>>
>>> I'll double check tomorrow, iirc the webclient shows all those
>>> properties when hovering with the mouse over an annotation, right?
>>>
>>> Cheers
>>> Niko


More information about the ome-devel mailing list