Changeset 3524 for trunk/utils


Ignore:
Timestamp:
01/08/08 15:38:13 (12 years ago)
Author:
curtis
Message:

Initial version of LOCI codebase with multi-version OME-XML support.
This logic is incomplete and needs more work, but does compile and is
basically functional.

Location:
trunk/utils
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/ConvertToOmeTiff.java

    r3168 r3524  
    55import java.awt.image.BufferedImage; 
    66import loci.formats.ImageReader; 
    7 import loci.formats.ome.OMEXMLMetadata; 
     7import loci.formats.MetadataTools; 
     8import loci.formats.meta.MetadataRetrieve; 
     9import loci.formats.meta.MetadataStore; 
    810import loci.formats.out.OMETiffWriter; 
    911 
     
    2527 
    2628      // record metadata to OME-XML format 
    27       OMEXMLMetadata omexmlMeta = new OMEXMLMetadata(); 
     29      MetadataStore omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
    2830      reader.setMetadataStore(omexmlMeta); 
    2931      reader.setId(id);  
    3032 
    3133      // configure OME-TIFF writer 
    32       writer.setMetadataRetrieve(omexmlMeta); 
     34      writer.setMetadataRetrieve((MetadataRetrieve) omexmlMeta); 
    3335      writer.setId(outId); 
    3436 
  • trunk/utils/EditImageName.java

    r3169 r3524  
    55import loci.formats.ImageReader; 
    66import loci.formats.MetadataTools; 
    7 import loci.formats.ome.OMEXMLMetadata; 
     7import loci.formats.meta.MetadataRetrieve; 
     8import loci.formats.meta.MetadataStore; 
    89 
    910/** Edits the given file's image name (but does not save back to disk). */ 
     
    1718    ImageReader reader = new ImageReader(); 
    1819    // record metadata to OME-XML format 
    19     reader.setMetadataStore(new OMEXMLMetadata()); 
     20    reader.setMetadataStore(MetadataTools.createOMEXMLMetadata()); 
    2021    String id = args[0]; 
    2122    System.out.print("Reading metadata "); 
    2223    reader.setId(id);  
    23     OMEXMLMetadata omexmlMeta = (OMEXMLMetadata) reader.getMetadataStore(); 
     24    MetadataStore omexmlMeta = reader.getMetadataStore(); 
    2425    System.out.println(" [done]"); 
    2526 
    2627    // get image name 
    27     Integer zero = new Integer(0); 
    28     String name = omexmlMeta.getImageName(zero); 
     28    String name = ((MetadataRetrieve) omexmlMeta).getImageName(0); 
    2929    System.out.println("Initial Image name = " + name); 
    3030    // change image name (reverse it) 
     
    3939    name = new String(arr); 
    4040    // save altered name back to OME-XML structure 
    41     omexmlMeta.setImage(name, null, null, zero); 
     41    omexmlMeta.setImageName(name, 0); 
    4242    System.out.println("Updated Image name = " + name); 
    4343    // output full OME-XML block 
    4444    System.out.println("Full OME-XML dump:"); 
    45     System.out.println(MetadataTools.getOMEXML(omexmlMeta)); 
     45    String xml = MetadataTools.getOMEXML((MetadataRetrieve) omexmlMeta); 
     46    System.out.println(xml); 
    4647  } 
    4748 
  • trunk/utils/MakeLZW.java

    r3121 r3524  
    77import org.openmicroscopy.xml.OMENode; 
    88import loci.formats.*; 
    9 import loci.formats.ome.OMEXMLMetadata; 
     9import loci.formats.meta.MetadataStore; 
    1010import loci.formats.out.TiffWriter; 
    1111 
     
    1515  public static void main(String[] args) throws Exception { 
    1616    ImageReader reader = new ImageReader(); 
    17     OMEXMLMetadata omexmlMeta = new OMEXMLMetadata(); 
     17    MetadataStore omexmlMeta = MetadataTools.createOMEXMLMetadata(); 
    1818    reader.setMetadataStore(omexmlMeta); 
    1919    TiffWriter writer = new TiffWriter(); 
     
    2525      writer.setId(nf); 
    2626      int blocks = reader.getImageCount(); 
     27      // CTR: FIXME: update this to be version-agnostic 
    2728      OMENode ome = (OMENode) omexmlMeta.getRoot(); 
    2829      for (int b=0; b<blocks; b++) { 
Note: See TracChangeset for help on using the changeset viewer.