<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Simon,<br>
<br>
Just tried that out and it works perfectly on my build.<br>
<br>
For me, this makes selling OMERO to my users much easier. Thanks for sharing!<br>
<br>
Best,<br>
<br>
Dave<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF312206"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Simon Li [s.p.li@dundee.ac.uk]<br>
<b>Sent:</b> 10 June 2014 19:15<br>
<b>To:</b> Mason, David [dnmason]<br>
<b>Cc:</b> Josh Moore; Jean-Marie Burel; ome-users@lists.openmicroscopy.org.uk<br>
<b>Subject:</b> Bulk downloading data (was: Follow up from OME meeting)<br>
</font><br>
</div>
<div></div>
<div>
<div>Hi David</div>
<div><br>
</div>
<div>I’ve just checked and it’s easier than I expected, there’s a method <span class="n">im</span><span class="o">.</span><span class="n">getImportedImageFiles</span><span class="p">() which returns all the original files relating to an image. I thought I’d
 update my script <a href="https://gist.github.com/manics/5720713" target="_blank">https://gist.github.com/manics/5720713</a> so now it takes an additional -o flag.</span></div>
<div><br>
</div>
<div><span class="p">Hopefully this is enough to get you started!</span></div>
<div><span class="p"><br>
</span></div>
<div><span class="p">Simon</span></div>
<br>
<div>
<div>On 9 Jun 2014, at 12:38, Mason, David [dnmason] <<a href="mailto:D.N.Mason@liverpool.ac.uk" target="_blank">D.N.Mason@liverpool.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; word-wrap:break-word">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">Hi Simon,<br>
<br>
Thanks for the quick reply, I don't need this functionality immediately but it's a (surprisingly) huge deal when reassuring people about committing their data fully to OMERO.<br>
<br>
No problem about posting on the mailing list, I was going to put something on the forum once I had a workable solution.<br>
<br>
I had a look at the python script and I can cope with having to pass a list of Project IDs, but could you recommend a quick change to download in the original format instead of OME.tiff? From my read, it's something around line 147:<br>
<pre class="line-pre">        <span class="n">size</span><span class="p">,</span> <span class="n">data</span> <span class="o">=</span> <span class="n">im</span><span class="o">.</span><font color="FF0000">exportOmeTiff</font><span class="p">(</span><span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">)</span></pre>
What would be the correct term here to use the original format/dimensions?<br>
<br>
Thanks for all your help,<br>
<br>
Dave<br>
<br>
<div style="font-family:'Times New Roman'; font-size:16px">
<hr tabindex="-1">
<div id="divRpF416364" style="direction:ltr"><font face="Tahoma" size="2"><b>From:</b><span class="Apple-converted-space"> </span>Simon Li [<a href="mailto:s.p.li@dundee.ac.uk" target="_blank">s.p.li@dundee.ac.uk</a>]<br>
<b>Sent:</b><span class="Apple-converted-space"> </span>09 June 2014 12:12<br>
<b>To:</b><span class="Apple-converted-space"> </span>Mason, David [dnmason]<br>
<b>Cc:</b><span class="Apple-converted-space"> </span>Josh Moore; Jean-Marie Burel<br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: Follow up from OME meeting<br>
</font><br>
</div>
<div></div>
<div>
<div>Hi David</div>
<div><br>
</div>
<div>It was great to talk with you too. I've got a Python script that can recursively download a list of projects/datasets/images as ome-tiffs specified on the command line:</div>
<div><a href="https://gist.github.com/manics/5720713" target="_blank">https://gist.github.com/manics/5720713</a></div>
<div><br>
</div>
<div>It was originally written for OMERO 4.4, hence the reason for exporting the images as OME-TIFFs, but it should be possible to change this to download the original image files in 5.0. It requires a list of project IDs to be passed on the command line rather
 than listing them automatically, but this would also be fairly easy to change.</div>
<div><br>
</div>
<div>It's not exactly user-friendly at the moment since it was for my own use, and there are several limitations, such as limited error handling and limits on the maximum size of image that can be retrieved. With that in mind if you still want to try running
 it you'll need to create a plain text file (e.g. 'login.config') containing the login details:</div>
<div>
<pre class="line-pre"><div class="line" id="file-batch_download_ometiff-py-LC13"><span class="sd">omero.user=username</span></div><div class="line" id="file-batch_download_ometiff-py-LC14"><span class="sd">omero.pass=password</span></div><div class="line" id="file-batch_download_ometiff-py-LC15"><span class="sd">omero.host=hostname</span></div></pre>
<div><br>
</div>
</div>
<div>Then in your shell</div>
<div>export ICE_CONFIG=path/to/login.config</div>
<div>export PYTHONPATH=/path/to/OMERO.server/lib/python:$PYTHONPATH</div>
<div><br>
</div>
<div>Help: python batch_download_ometiff.py -h</div>
<div>Download project-ids 1 and 2: python batch_download_ometiff.py -p 1 -p 2</div>
<div>Dry-run, show what would be downloaded: python batch_download_ometiff.py -p 1 -p 2 -n</div>
<div><br>
</div>
<div>How soon do you require the ability to bulk export a user's data- is it something you're looking at in the longer-term or something you require now?</div>
<div><br>
</div>
<div>Finally, would you mind if I forward this to the ome-users mailing list for the benefit of anyone else who might be interested?</div>
<div><br>
</div>
<div>Best wishes</div>
<div><br>
</div>
<div>Simon</div>
<div><br>
</div>
<br>
<div>
<div>On 9 Jun 2014, at 11:01, "Mason, David [dnmason]" <<a href="mailto:D.N.Mason@liverpool.ac.uk" target="_blank">D.N.Mason@liverpool.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">Hi Simon,<br>
<br>
Nice to talk to you at the OME meeting. I just wanted to follow up with what we were discussing regarding bulk export of files from OMERO, whilst retaining Project/Dataset structure. I would like to specify a user, then have every project, dataset, and file
 downloaded into the same [Project>Dataset>File] structure. I don't care about preserving annotations. Having attachments would be useful but not necessary.<br>
<br>
To give you some context for a reply, I'm running my server on ubuntu (12.04LTS), and am well versed in bash, with (presently) little knowledge of python or Java (although I'm happy to run scripts in these languages).<br>
<br>
Please let me know if you need any more details, thanks for your help so far,<br>
<br>
Dave Mason<br>
</div>
</div>
</blockquote>
</div>
<br>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span></div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br>
<span style="font-size:10pt">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</div>
</div>
</div>
</body>
</html>