Changeset 6568


Ignore:
Timestamp:
06/24/10 14:39:17 (9 years ago)
Author:
melissa
Message:

Various fixes to OME-XML/OME-TIFF handling, including support for qualified namespaces in OME-TIFF files. Closes #492.

Location:
trunk/components/bio-formats/src/loci/formats
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/OMETiffReader.java

    r6531 r6568  
    142142    String comment = ifd.getComment(); 
    143143    if (comment == null) return false; 
    144     return comment.trim().endsWith("</OME>"); 
     144    return comment.trim().endsWith("OME>"); 
    145145  } 
    146146 
     
    191191    IFDList ifdList = r.getIFDs(); 
    192192    if (i >= ifdList.size()) { 
    193       throw new FormatException( 
    194         "Error untangling IFDs; the OME-TIFF file may be malformed."); 
     193      LOGGER.warn("Error untangling IFDs; the OME-TIFF file may be malformed."); 
     194      return buf; 
    195195    } 
    196196    IFD ifd = ifdList.get(i); 
     
    275275 
    276276    String currentUUID = meta.getUUID(); 
    277     if (service.isOMEXMLMetadata(metadataStore)) { 
    278       metadataStore = meta; 
    279     } 
    280     else service.convertMetadata(meta, metadataStore); 
     277    service.convertMetadata(meta, metadataStore); 
    281278 
    282279    // determine series count from Image and Pixels elements 
     
    294291      int tiffDataCount = meta.getTiffDataCount(i); 
    295292      for (int td=0; td<tiffDataCount; td++) { 
    296         // TODO 
    297         // String uuid = ? 
    298293        String uuid = null; 
     294        try { 
     295          uuid = meta.getUUIDValue(i, td); 
     296        } 
     297        catch (NullPointerException e) { } 
    299298        String filename = null; 
    300299        if (uuid == null) { 
  • trunk/components/bio-formats/src/loci/formats/in/OMEXMLReader.java

    r6507 r6568  
    3939import loci.formats.FormatReader; 
    4040import loci.formats.FormatTools; 
     41import loci.formats.MetadataTools; 
    4142import loci.formats.MissingLibraryException; 
    4243import loci.formats.codec.Base64Codec; 
     
    343344    // contents of the internal OME-XML metadata object 
    344345    MetadataStore store = getMetadataStore(); 
    345  
    346     if (service.isOMEXMLMetadata(store)) { 
    347       store = omexmlMeta; 
    348     } 
    349     else service.convertMetadata(omexmlMeta, store); 
     346    service.convertMetadata(omexmlMeta, store); 
     347    MetadataTools.populatePixels(store, this); 
    350348  } 
    351349 
  • trunk/components/bio-formats/src/loci/formats/meta/MetadataConverter.java

    r6531 r6568  
    291291    for (int groupIndex=0; groupIndex<groupCount; groupIndex++) { 
    292292    try { 
     293      String groupIDValue = src.getGroupID(groupIndex); 
     294      if (groupIDValue != null) dest.setGroupID(groupIDValue, groupIndex); 
     295    } catch (NullPointerException e) { } 
     296    try { 
    293297      String groupContactValue = src.getGroupContact(groupIndex); 
    294298      if (groupContactValue != null) dest.setGroupContact(groupContactValue, groupIndex); 
     
    297301      String groupDescriptionValue = src.getGroupDescription(groupIndex); 
    298302      if (groupDescriptionValue != null) dest.setGroupDescription(groupDescriptionValue, groupIndex); 
    299     } catch (NullPointerException e) { } 
    300     try { 
    301       String groupIDValue = src.getGroupID(groupIndex); 
    302       if (groupIDValue != null) dest.setGroupID(groupIDValue, groupIndex); 
    303303    } catch (NullPointerException e) { } 
    304304    try { 
Note: See TracChangeset for help on using the changeset viewer.