//
// ConvertToOmeTiff.java
//

import java.awt.image.BufferedImage;
import java.util.Hashtable;
import loci.formats.*;
import loci.formats.ome.OMEXMLMetadata;
import loci.formats.out.TiffWriter;

/** Converts the given files to OME-TIFF format. */
public class ConvertToOmeTiff {

  public static void main(String[] args) throws Exception {
    if (args.length == 0) {
      System.out.println("Usage: java ConvertToOmeTiff file1 file2 ...");
      return;
    }
    ImageReader reader = new ImageReader();
    TiffWriter writer = new TiffWriter();
    // record metadata to OME-XML format
    OMEXMLMetadata omexmlMeta = new OMEXMLMetadata();
    reader.setMetadataStore(omexmlMeta);
    for (int i=0; i<args.length; i++) {
      String id = args[i];
      String outId = id + ".tif";
      System.out.print("Converting " + id + " to " + outId + " ");
      reader.setId(id); 
      int imageCount = reader.getImageCount();
      // insert TiffData element into OME-XML
      // currently handles only single series (single Image, single Pixels)
      String xml = omexmlMeta.dumpXML();
      int pix = xml.indexOf("<Pixels ");
      int end = xml.indexOf("/>", pix);
      xml = xml.substring(0, end) +
        "><TiffData/></Pixels>" + xml.substring(end + 2);
      // write out image planes
      for (int j=0; j<imageCount; j++) {
        BufferedImage plane = reader.openImage(j);
        Hashtable ifd = null;
        if (j == 0) {
          // save OME-XML metadata to TIFF file's first IFD
          ifd = new Hashtable();
          TiffTools.putIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION, xml);
        }
        // write plane to output file
        writer.setId(outId);
        writer.saveImage(plane, ifd, j == imageCount - 1);
        System.out.print(".");
      }
      System.out.println(" [done]");
    }
  }

}

//
// ConvertToOmeTiff.java
//

import java.awt.image.BufferedImage;
import loci.formats.ImageReader;
import loci.formats.ome.OMEXMLMetadata;
import loci.formats.out.OMETiffWriter;

/** Converts the given files to OME-TIFF format. */
public class ConvertToOmeTiff {

  public static void main(String[] args) throws Exception {
    if (args.length == 0) {
      System.out.println("Usage: java ConvertToOmeTiff file1 file2 ...");
      return;
    }
    ImageReader reader = new ImageReader();
    OMETiffWriter writer = new OMETiffWriter();
    for (int i=0; i<args.length; i++) {
      String id = args[i];
      int dot = id.indexOf(".");
      String outId = (dot >= 0 ? id.substring(0, dot) : id) + ".ome.tif";
      System.out.print("Converting " + id + " to " + outId + " ");

      // record metadata to OME-XML format
      OMEXMLMetadata omexmlMeta = new OMEXMLMetadata();
      reader.setMetadataStore(omexmlMeta);
      reader.setId(id); 

      // configure OME-TIFF writer
      writer.setMetadataRetrieve(omexmlMeta);
      writer.setId(outId);

      // write out image planes
      int imageCount = reader.getImageCount();
      for (int j=0; j<imageCount; j++) {
        BufferedImage plane = reader.openImage(j);
        // write plane to output file
        writer.saveImage(plane, j == imageCount - 1);
        System.out.print(".");
      }
      writer.close();
      reader.close();
      System.out.println(" [done]");
    }
  }

}

Update OME-TIFF conversion program to use most current API.