<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 9:44 AM, Tjelvar Olsson (JIC) <span dir="ltr"><<a href="mailto:Tjelvar.Olsson@jic.ac.uk" target="_blank">Tjelvar.Olsson@jic.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Lee,<br>
<br>
Thank you for the information about your project.<br>
<br>
I was looking at your bioformats/omexml.py module and it does not appear<br>
to have any dependencies on Java. Do you think that I could use it by it<br>
by itself to work with OME XML extracted from an OME Tiff file using PIL<br>
or libtiff?<br></blockquote><div><br></div><div>That might work. I suppose you can import bioformats.omexml without starting Java. Also, if just hijacking the .py file works for you, that's fine, but always, there are extra points if you can use it as-is and if you contribute any (well-tested) changes back. There's enough code to construct a basic OME-XML document, but feel free to add any elements of the schema which I haven't implemented. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Kind regards,<br>
<br>
Tjelvar<br>
<br>
<br>
On Mon, 2014-10-27 at 07:47 -0400, Lee Kamentsky wrote:<br>
> Hi Tjelvar,<br>
><br>
><br>
><br>
> On Mon, Oct 27, 2014 at 5:13 AM, Tjelvar Olsson (JIC)<br>
> <<a href="mailto:Tjelvar.Olsson@jic.ac.uk">Tjelvar.Olsson@jic.ac.uk</a>> wrote:<br>
>         Dear all,<br>
><br>
>         Is anyone aware of a Python library for working with OME Tiff<br>
>         files?<br>
><br>
>         I noticed that there is a Python BioFormats project, which<br>
>         provides a<br>
>         wrapper around the BioFormats Java libraries.<br>
>         <a href="https://github.com/CellProfiler/python-bioformats" target="_blank">https://github.com/CellProfiler/python-bioformats</a><br>
><br>
><br>
> That's my group's project. It's very stable, not so hard to work with<br>
> and gives you full access to Java as well as a set of straightforward<br>
> functions to read and write images. It does require the JDK to build<br>
> it and the JRE to run it and the JRE does add a bit to your memory<br>
> footprint. Also, there is a little overhead transferring the in-memory<br>
> image from the Java array to Numpy.<br>
><br>
><br>
>         However, I have not managed to find a Python library that can<br>
>         read and<br>
>         manipulate OME Tiff files without the need for Java.<br>
><br>
><br>
> We've used both libtiff (<a href="https://pypi.python.org/pypi/libtiff/0.4.0" target="_blank">https://pypi.python.org/pypi/libtiff/0.4.0</a>)<br>
> and PIL/Pillow (<a href="http://www.pythonware.com/products/pil/" target="_blank">http://www.pythonware.com/products/pil/</a>). Both are a<br>
> little tricky loading 16-bit TIFF images. You could use them to read<br>
> and write the OME-TIFF tag, but you'd have to write the code to parse<br>
> out what you wanted.<br>
><br>
>         Does anyone know if there is a "Java free" Python library for<br>
>         working<br>
>         with OME Tiff files?<br>
><br>
>         Thanks,<br>
><br>
>         Tjelvar<br>
>         _______________________________________________<br>
>         ome-users mailing list<br>
>         <a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a><br>
>         <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
><br>
><br>
<br>
</blockquote></div><br></div></div>