<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi team,<br>
    <br>
    At the OME meeting, I spoke with Simon about the CLI render function
    that he had written primarily for IDR but it's a great capability
    that I was hoping to use as well. Below is Simon's message telling
    me where to find the code. After a few weeks of vacation after the
    OME meeting and now trying to get back into the groove, I had a
    quick look at it. My server is still at 5.2.8 so I had hope to get
    it going quickly. Alas, I ran into a few snags and was hoping you
    had some wise words.<br>
    <br>
    First one was relatively easy: the render plugin wants to import
    pydict_text_io and that wasn't there in the vanilla 5.2.8. I found a
    pydict_text_io.py in 5.3.3 so copied that into the util directory of
    my 5.2.8 server since it didn't look like that was specific to the
    5.3.x line. <br>
    <br>
    Next I tried a few of the basic commands of the render plugin:<br>
    1 ---<br>
    <tt>sudard@lincs:~$ omero render info Image:2323633</tt><tt><br>
    </tt><tt>Previously logged in to localhost:4064 as lincs</tt><tt><br>
    </tt><tt>Server: [localhost:4064]</tt><tt><br>
    </tt><tt>Username: [lincs]sudar</tt><tt><br>
    </tt><tt>Password:</tt><tt><br>
    </tt><tt>Created session 29f0add7-ccf3-41d0-b958-73aaee5efe52
      (sudar@localhost:4064). Idle timeout: 10 min. Current group:
      MEP-LINCS</tt><tt><br>
    </tt><tt>Traceback (most recent call last):</tt><tt><br>
    </tt><tt>  File "/usr/local/bin/omero", line 125, in <module></tt><tt><br>
    </tt><tt>    rv = omero.cli.argv()</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1438, in argv</tt><tt><br>
    </tt><tt>    cli.invoke(args[1:])</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line 952,
      in invoke</tt><tt><br>
    </tt><tt>    stop = self.onecmd(line, previous_args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1029, in onecmd</tt><tt><br>
    </tt><tt>    self.execute(line, previous_args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1111, in execute</tt><tt><br>
    </tt><tt>    args.func(args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 343, in info</tt><tt><br>
    </tt><tt>    ro = RenderObject(img)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 207, in __init__</tt><tt><br>
    </tt><tt>    image.getChannels(noRE=True))</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 206, in <lambda></tt><tt><br>
    </tt><tt>    self.channels = map(lambda x: ChannelObject(x),</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 109, in __init__</tt><tt><br>
    </tt><tt>    self.init_from_channel(channel)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 117, in init_from_channel</tt><tt><br>
    </tt><tt>    self.min = channel.getWindowMin()</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/gateway/__init__.py",
      line 6753, in getWindowMin</tt><tt><br>
    </tt><tt>    return si.getGlobalMin().val</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero_model_StatsInfoI.py",
      line 138, in getGlobalMin</tt><tt><br>
    </tt><tt>    self.errorIfUnloaded()</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero_model_StatsInfoI.py",
      line 39, in errorIfUnloaded</tt><tt><br>
    </tt><tt>    raise _omero.UnloadedEntityException("Object
      unloaded:"+str(self))</tt><tt><br>
    </tt><tt>omero.UnloadedEntityException: Object unloaded:object #0
      (::omero::model::StatsInfo)</tt><tt><br>
    </tt><tt>{</tt><tt><br>
    </tt><tt>    _id = object #1 (::omero::RLong)</tt><tt><br>
    </tt><tt>    {</tt><tt><br>
    </tt><tt>        _val = 8730161</tt><tt><br>
    </tt><tt>    }</tt><tt><br>
    </tt><tt>    _details = <nil></tt><tt><br>
    </tt><tt>    _loaded = False</tt><tt><br>
    </tt><tt>    _version = <nil></tt><tt><br>
    </tt><tt>    _globalMin = <nil></tt><tt><br>
    </tt><tt>    _globalMax = <nil></tt><tt><br>
    </tt><tt>}</tt><tt><br>
    </tt><tt>!! 07/06/17 11:12:01.473 error: 2 communicators not
      destroyed during global destruction.sudard@lincs:~$</tt><br>
    ---<br>
    <br>
    2---<br>
    <tt>sudard@lincs:~$ omero render copy Image:1041 Image:1112</tt><tt><br>
    </tt><tt>Using session 648f8a79-d3e0-43ee-95e1-62197af2d679
      (sudar@localhost:4064). Idle timeout: 10 min. Current group:
      MEP-LINCS</tt><tt><br>
    </tt><tt>Traceback (most recent call last):</tt><tt><br>
    </tt><tt>  File "/usr/local/bin/omero", line 125, in <module></tt><tt><br>
    </tt><tt>    rv = omero.cli.argv()</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1438, in argv</tt><tt><br>
    </tt><tt>    cli.invoke(args[1:])</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line 952,
      in invoke</tt><tt><br>
    </tt><tt>    stop = self.onecmd(line, previous_args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1029, in onecmd</tt><tt><br>
    </tt><tt>    self.execute(line, previous_args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/cli.py", line
      1111, in execute</tt><tt><br>
    </tt><tt>    args.func(args)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 361, in copy</tt><tt><br>
    </tt><tt>    self._copy(gateway, args.object, args.target,
      args.skipthumbs)</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/plugins/render.py",
      line 373, in _copy</tt><tt><br>
    </tt><tt>    src_img._closeRE()</tt><tt><br>
    </tt><tt>  File
      "/home/omero_user/OMERO.server/lib/python/omero/gateway/__init__.py",
      line 1237, in __getattr__</tt><tt><br>
    </tt><tt>    % (self._obj.__class__.__name__, attr))</tt><tt><br>
    </tt><tt>AttributeError: 'ImageI' object has no attribute '_closeRE'</tt><br>
    ---<br>
    <br>
    Rather than trying more of this, I thought to check with you first
    whether I'm missing something fundamental.<br>
    Thanks,<br>
    - Damir<br>
    <br>
    <div class="moz-cite-prefix">On 6/2/2017 2:35, Simon Li wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMvbRBED4AfUEvi_yQ=kEcV-bk9X9zYj5OyKpHNTTJ6BUfZbfg@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div>The render plugin (not tested on 5.3):<br>
          <a
href="https://github.com/openmicroscopy/openmicroscopy/blob/metadata53/components/tools/OmeroPy/src/omero/plugins/render.py"
            moz-do-not-send="true">https://github.com/openmicroscopy/openmicroscopy/blob/metadata53/components/tools/OmeroPy/src/omero/plugins/render.py</a><br>
        </div>
        <div>Try dropping this into
          OMERO.server/lib/python/omero/plugins/<br>
        </div>
        <div><br>
        </div>
        Example YAML render settings file:<br>
        <a
href="https://github.com/IDR/idr-metadata/blob/master/idr0015-UNKNOWN-taraoceans/screenA/idr0015-screenA-renderdef.yml"
          moz-do-not-send="true">https://github.com/IDR/idr-metadata/blob/master/idr0015-UNKNOWN-taraoceans/screenA/idr0015-screenA-renderdef.yml</a><br>
        <br>
        omero render edit --help<br>
        omero render edit --copy Plate:1 renderdef.yml<br>
        omero render copy Image:SrcID Plate:TargetID<br>
        <br>
        <br>
      </div>
      <br>
      <span style="font-size:10pt;">The University of Dundee is a
        registered Scottish Charity, No: SC015096</span> </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Damir Sudar - Affiliate Scientist
Lawrence Berkeley Natl Laboratory / MBIB
One Cyclotron Road, MS 977, Berkeley, CA 94720, USA
T: 510/486-5346 - F: 510/486-5586 - E: <a class="moz-txt-link-abbreviated" href="mailto:DSudar@lbl.gov">DSudar@lbl.gov</a>
<a class="moz-txt-link-freetext" href="http://biosciences.lbl.gov/profiles/damir-sudar-2/">http://biosciences.lbl.gov/profiles/damir-sudar-2/</a>

Visiting Scientist, Oregon Health & Science University</pre>
  </body>
</html>