<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Hi Yanling</div>
<div><br>
</div>
<div>> Dropbox documentation says NAS is not supported, is a NFS mount considered a network attached share (NAS) to OMERO?</div>
<div><br>
</div>
<div>Dropbox can monitor only local hard drive. But you can set up samba dir locally to drop files and set configuration parameters like: "--transfer=ln_rm" or "--transfer=upload_rm" to delete when they are imported. If you prefer to use NFS you can use In-place
 import <a href="https://www.openmicroscopy.org/site/support/omero5/sysadmins/in-place-import.html">https://www.openmicroscopy.org/site/support/omero5/sysadmins/in-place-import.html</a>. That should simplify your workflow.</div>
</div>
<div><br>
</div>
<div>> Dropbox import new images under "Orphaned Images", then user has to login to organise new images into projects and datasets, is that correct?</div>
<div><br>
</div>
<div>That is correct. Extended path /OMERO/DropBox/user/group/project/dataset/ is on our list to do <a href="http://trac.openmicroscopy.org.uk/ome/ticket/4032">http://trac.openmicroscopy.org.uk/ome/ticket/4032</a> as well as templates <a href="http://trac.openmicroscopy.org.uk/ome/ticket/12039">http://trac.openmicroscopy.org.uk/ome/ticket/12039</a></div>
<div><br>
</div>
<div>You can customise name of <span style="font-family: Calibri; font-size: medium; "> </span><span style="font-family: Calibri; font-size: medium; ">"Orphaned Images" if is not suitable.</span></div>
<div>
<div><br>
</div>
<div>
<div>Kind regards</div>
<div>Ola</div>
</div>
</div>
</div>
<div><br>
</div>
<div>On Fri, Sep 26, 2014 at 8:38 AM, Aleksandra Tarkowska <span dir="ltr"><<a href="mailto:A.Tarkowska@dundee.ac.uk" target="_blank">A.Tarkowska@dundee.ac.uk</a>></span> wrote:</div>
<span id="OLK_SRC_BODY_SECTION">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Yanling<br>
<br>
As Carne mentioned you can invoke import process via python script.<br>
Similar test is available on<br>
<a href="https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/to
ols/OmeroPy/test/integration/library.py#L187" target="_blank">https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/to<br>
ols/OmeroPy/test/integration/library.py#L187</a><br>
<br>
args.extend(["-s", server, "-k", key, "-p", port, "import", "--"])<br>
<br>
Allows you to pass all parameters you normally pass via bin/omero import Š<br>
For more details refer to --help.<br>
<br>
Can I ask why you just simply cannot use dropbox to do that work<br>
automatically for you?<br>
Did you see<br>
<a href="http://www.openmicroscopy.org/site/support/omero5/sysadmins/dropbox.html" target="_blank">http://www.openmicroscopy.org/site/support/omero5/sysadmins/dropbox.html</a><br>
<br>
Kind regards<br>
Ola<br>
<div>
<div class="h5"><br>
<br>
<br>
<br>
<br>
On 26/09/2014 12:48, "Carnë Draug" <<a href="mailto:carandraug%2Bdev@gmail.com">carandraug+dev@gmail.com</a>> wrote:<br>
<br>
>On Thu, 25 Sep 2014 13:31:53 -0400, Yanling Liu <<a href="mailto:vrnova@gmail.com">vrnova@gmail.com</a>> wrote:<br>
>> Hi,<br>
>><br>
>> I was able to use the CLI import (bin/omero import) to import<br>
>> images into OMERO. My question is that if OMERO python binding has<br>
>> similar capability? Can I write a little python script and call OMERO<br>
>> import function to upload some images to OMERO?<br>
>><br>
>> What I mean is if there's python binding to the import function,<br>
>> rather than doing system call in python script to call bin/omero.<br>
><br>
>You can do something like the following:<br>
><br>
>    import omero<br>
>    import omero.cli<br>
><br>
>    client = omero.client (host = server_ip_or_hostname)<br>
>    client.createSession (username = "username", password = "password")<br>
><br>
>    cli = omero.cli.CLI()<br>
>    cli.loadplugins()<br>
>    cli._client = client.createClient(secure = True)<br>
>    cli.invoke(["import", path_to_image_file])<br>
><br>
>Note that you need to create a copy of the client when setting `_client`<br>
>because that session will be closed after the image import.<br>
><br>
>To find out the ID of the image you imported, you will need to get<br>
>this call STDOUT.  I have routinely [1] been doing the following (note<br>
>that this imports a single file but should be easy to adjust for<br>
>multiple files):<br>
><br>
><br>
>    cli = omero.cli.CLI()<br>
>    cli.loadplugins()<br>
>    cli._client = self.client.createClient(secure = True)<br>
>      cmd = [<br>
>      "import",<br>
>      "--debug", "ERROR",<br>
>    ]<br>
>    if self.datasetID:<br>
>      cmd.extend(["-d", str(self.datasetID)])<br>
>    if self.child_name:<br>
>      cmd.extend(["-n", self.child_name])<br>
><br>
>    cid = None<br>
>    with tempfile.NamedTemporaryFile(suffix=".stdout") as stdout:<br>
>      cmd.extend([<br>
>        "---errs", os.devnull,<br>
>        "---file", <a href="http://stdout.name" target="_blank">stdout.name</a>,<br>
>      ])<br>
>      cmd.append(<a href="http://self.fout.name" target="_blank">self.fout.name</a>)<br>
><br>
>      STDERR = sys.stderr<br>
>      try:<br>
>        with open(os.devnull, 'w') as DEVNULL:<br>
>          sys.stderr = DEVNULL<br>
>          cli.invoke(cmd)<br>
>      finally:<br>
>        sys.stderr = STDERR<br>
>        ret_code = cli.rv<br>
>        if ret_code == 0:<br>
>          ## we only need to read one line or something is very wrong<br>
>          cid = int(stdout.readline())<br>
>          if not cid:<br>
>            raise Exception("unable to get exported image ID")<br>
>        else:<br>
>          raise Exception("failed to import processed image")<br>
><br>
>    self.child = self.conn.getObject("Image", cid)<br>
><br>
><br>
>[1]<br>
><a href="https://github.com/MicronOxford/omero_scripts_processing/blob/40e29af8/ome" target="_blank">https://github.com/MicronOxford/omero_scripts_processing/blob/40e29af8/ome</a><br>
>ro_scripts_processing.py#L293<br>
</div>
</div>
>_______________________________________________<br>
>ome-devel mailing list<br>
><a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a><br>
><a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br>
<br>
<br>
The University of Dundee is a registered Scottish Charity, No: SC015096<br>
</blockquote>
</div>
<br>
</div>
_______________________________________________ ome-devel mailing list <a href="mailto:ome-devel@lists.openmicroscopy.org.uk">
ome-devel@lists.openmicroscopy.org.uk</a> <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a> </span><br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>