Open Microscopy Environment
Laboratory for Optical and Computational Instrumentation
OME at LOCI – Software – Java OME-XML library

This page is partially out of date, and in need of update.

The Java OME-XML library is a collection of Java packages (org.openmicroscopy.xml and org.openmicroscopy.xml.st) designed to allow reading, editing and writing of OME-XML metadata (but not pixels) by Java software. Currently, we use it within our VisBio application, as well as our OME plugins for ImageJ.

The library implements the OME Java interfaces in the org.openmicroscopy.ds.dto and org.openmicroscopy.ds.st packages. It operates by wrapping an XML DOM document in memory, and provides additional OME-XML-specific functionality, such as transformation between OME-XML and OMECA-XML using XSLT stylesheets.

The code from the org.openmicroscopy.xml.st package is autogenerated with the included Xmlgen utility based on the org.openmicroscopy.ds.st package and the OME SemanticType definitions. If desired, it should be possible to regenerate the org.openmicroscopy.xml.st package from an OME installation, assuming you have both the OME and OME-JAVA branches available within your home directory. For more details on the implementation of the library or Xmlgen, feel free to contact Curtis Rueden.


Obtaining the library

The Java OME-XML library is part of the ome-java.jar package.

You can find the latest source code in the OME-JAVA branch of the main OME CVS repository.


Installation

To use, add ome-java.jar to your CLASSPATH. For library documentation, generate Javadocs from the source code linked above. For an example of usage, see the Bio-Formats metadata architecture.


Usage

The OMENode is the root ("OME") node of the OME-XML. In fact, each XML element has its own node type (e.g., "Image" has ImageNode) with its own accessor and mutator methods, to make navigation of the OME-XML structure easier than it would be with a raw DOM object. You can find a thorough test exercising the Java OME-XML library API in the SampleTest.java class.

However, there are some limitations to what can be done with the API. If your application does want access to the backing DOM object to work with it directly, you can obtain it with a call to OMENode.getOMEDocument(false).



Last update: Tuesday, September 18, 2007