[ome-users] Using Bio-formats through Python

Curtis Rueden ctrueden at wisc.edu
Thu Nov 1 18:52:08 GMT 2012


Hi Steve,

> Obviously, Bio-formats is Java, and MyTardis is Python. Judging from
> http://loci.wisc.edu/bio-formats/interfacing-non-java-code, the most
> sensible approach is perhaps Ice?

The CellProfiler project (written in Python) uses Bio-Formats. They wrote
their own interprocess solution called Subimager [1], which could
potentially work for you as well.

Another solution that works very well for cross-language integration is
pipes. Write a small Java program that accepts some input over stdin, and
provides output over stdout (and/or writes to files if that is ultimately
what you want). Then call that program from Python and process the results.
It is a tried and true interoperability approach that works cross-platform.
We used it with the original OME Server written in Perl, and it worked
great. We also use it to integrate Bio-Formats with ITK [2].

Regarding Ice, you may notice mention of "Bio-Formats Ice Bindings" on our
non-Java code page. Unfortunately, they don't actually exist right now.
Others have expressed interest in such bindings (e.g., the XuvTools
project), but realistically I simply do not have time to develop or
maintain them.

On the other hand, as Josh says, OMERO could be a good solution if you want
to use Ice, because it has very well developed Ice bindings. Of course, you
are then depending on the OMERO infrastructure on the server side, rather
than only Bio-Formats, but perhaps that would be a good thing. There is a
ton of great functionality you could leverage, which might ultimately
simplify your life in the long run.

Regards,
Curtis

[1] https://github.com/CellProfiler/subimager
[2] http://loci.wisc.edu/bio-formats/itk


On Wed, Oct 31, 2012 at 11:59 PM, Steve Bennett <stevage at gmail.com> wrote:

> Hi all,
>   I work on a project called MyTardis [1] that is a Django-based
> research data repository used particularly for protein
> crystallography, electron microscopy, and synchrotron science at
> research institutions around Australia. New deployments typically
> spend time writing filters to read file formats, mostly in order to
> extract metadata (occasionally data visualisation too). It's occurred
> to us[2] that it might make more sense to use (and contribute to) an
> existing library like Bio-formats. The data files include standard
> image files (.tif), instrument-specific image files (eg, FEI,
> Philips...), numeric spectrum data, and I think some 3D formats. We
> may be starting work on some neuroimaging data (NIFTI etc) soon.
>
> Obviously, Bio-formats is Java, and MyTardis is Python. Judging from
> http://loci.wisc.edu/bio-formats/interfacing-non-java-code, the most
> sensible approach is perhaps Ice?
>
> So, I was wondering if anyone has experience with this kind of Python
> usage, and perhaps has some sample code to share?
>
> Our major use cases would be:
> 1) At the time of (asynchronous) import, MyTardis would call
> Bio-formats to request specific information about the file: instrument
> parameters, user name, image dimensions - whatever is appropriate.
> 2) (less important) Calling Bio-formats to extract pixel-level data,
> or even do wholesale image conversions (eg, to .jpeg)
>
> Performance is not a major consideration for most deployments  -
> imports take place in the background, usually after the researcher has
> left the instrument.
>
> Thanks,
> Steve
>
> Victorian e-Research Strategic Initiative (Melbourne)
>
> [1] http://mytardis.github.com/ - new web page in development
> [2] Prompted by meeting Jason Swedlow at an e-Research conference in
> Sydney this week.
> _______________________________________________
> 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/20121101/fcdcbf80/attachment.html>


More information about the ome-users mailing list