Changeset 4036 for trunk/utils


Ignore:
Timestamp:
05/12/08 12:54:39 (12 years ago)
Author:
curtis
Message:

Update to version-agnostic OME-XML metadata store logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/MakeLZW.java

    r3560 r4036  
    55import java.awt.image.BufferedImage; 
    66import java.util.Hashtable; 
    7 import org.openmicroscopy.xml.OMENode; 
    8 import loci.formats.*; 
     7import loci.formats.ImageReader; 
     8import loci.formats.MetadataTools; 
     9import loci.formats.TiffTools; 
     10import loci.formats.meta.MetadataRetrieve; 
    911import loci.formats.meta.MetadataStore; 
    1012import loci.formats.out.TiffWriter; 
     
    1921    TiffWriter writer = new TiffWriter(); 
    2022    for (int i=0; i<args.length; i++) { 
    21       String f = args[i]; 
    22       String nf = "lzw-" + f; 
    23       System.out.print("Converting " + f + " to " + nf); 
    24       reader.setId(f); 
    25       writer.setId(nf); 
     23      String inFile = args[i]; 
     24      String outFile = "lzw-" + inFile; 
     25      System.out.print("Converting " + inFile + " to " + outFile); 
     26      reader.setId(inFile); 
     27      writer.setId(outFile); 
    2628      int blocks = reader.getImageCount(); 
    27       // CTR: FIXME: update this to be version-agnostic 
    28       OMENode ome = (OMENode) omexmlMeta.getRoot(); 
     29      String xml = MetadataTools.getOMEXML((MetadataRetrieve) omexmlMeta); 
    2930      for (int b=0; b<blocks; b++) { 
    3031        System.out.print("."); 
     
    3435        if (b == 0) { 
    3536          // preserve OME-XML block 
    36           TiffTools.putIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION, 
    37             ome.writeOME(false)); 
     37          TiffTools.putIFDValue(ifd, TiffTools.IMAGE_DESCRIPTION, xml); 
    3838        } 
    3939 
Note: See TracChangeset for help on using the changeset viewer.