[ome-users] Python support for OME Tiff files

Lee Kamentsky leek at broadinstitute.org
Mon Oct 27 15:19:26 GMT 2014


On Mon, Oct 27, 2014 at 9:44 AM, Tjelvar Olsson (JIC) <
Tjelvar.Olsson at jic.ac.uk> wrote:

> Hi Lee,
>
> Thank you for the information about your project.
>
> I was looking at your bioformats/omexml.py module and it does not appear
> to have any dependencies on Java. Do you think that I could use it by it
> by itself to work with OME XML extracted from an OME Tiff file using PIL
> or libtiff?
>

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.

>
> Kind regards,
>
> Tjelvar
>
>
> On Mon, 2014-10-27 at 07:47 -0400, Lee Kamentsky wrote:
> > Hi Tjelvar,
> >
> >
> >
> > On Mon, Oct 27, 2014 at 5:13 AM, Tjelvar Olsson (JIC)
> > <Tjelvar.Olsson at jic.ac.uk> wrote:
> >         Dear all,
> >
> >         Is anyone aware of a Python library for working with OME Tiff
> >         files?
> >
> >         I noticed that there is a Python BioFormats project, which
> >         provides a
> >         wrapper around the BioFormats Java libraries.
> >         https://github.com/CellProfiler/python-bioformats
> >
> >
> > That's my group's project. It's very stable, not so hard to work with
> > and gives you full access to Java as well as a set of straightforward
> > functions to read and write images. It does require the JDK to build
> > it and the JRE to run it and the JRE does add a bit to your memory
> > footprint. Also, there is a little overhead transferring the in-memory
> > image from the Java array to Numpy.
> >
> >
> >         However, I have not managed to find a Python library that can
> >         read and
> >         manipulate OME Tiff files without the need for Java.
> >
> >
> > We've used both libtiff (https://pypi.python.org/pypi/libtiff/0.4.0)
> > and PIL/Pillow (http://www.pythonware.com/products/pil/). Both are a
> > little tricky loading 16-bit TIFF images. You could use them to read
> > and write the OME-TIFF tag, but you'd have to write the code to parse
> > out what you wanted.
> >
> >         Does anyone know if there is a "Java free" Python library for
> >         working
> >         with OME Tiff files?
> >
> >         Thanks,
> >
> >         Tjelvar
> >         _______________________________________________
> >         ome-users mailing list
> >         ome-users at lists.openmicroscopy.org.uk
> >         http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20141027/6832a83c/attachment.html>


More information about the ome-users mailing list