Changeset 6491


Ignore:
Timestamp:
06/04/10 13:37:27 (9 years ago)
Author:
melissa
Message:

Updated MetadataTools.verifyMinimumPopulated and the MinimumWriter example to include required IDs.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/MetadataTools.java

    r6457 r6491  
    190190        "call IMetadata.createRoot() first"); 
    191191    } 
     192    if (src.getImageID(n) == null) { 
     193      throw new FormatException("Image ID #" + n + " is null"); 
     194    } 
     195    if (src.getPixelsID(n) == null) { 
     196      throw new FormatException("Pixels ID #" + n + " is null"); 
     197    } 
     198    for (int i=0; i<src.getChannelCount(n); i++) { 
     199      if (src.getChannelID(i, n) == null) { 
     200        throw new FormatException("Channel ID #" + i + " in Image #" + n + 
     201          " is null"); 
     202      } 
     203    } 
    192204    if (src.getPixelsBinDataBigEndian(n, 0) == null) { 
    193205      throw new FormatException("BigEndian #" + n + " is null"); 
  • branches/4.2/components/bio-formats/utils/MinimumWriter.java

    r6457 r6491  
    4747 
    4848    meta.createRoot(); 
     49    meta.setImageID("Image:0", 0); 
     50    meta.setPixelsID("Pixels:0", 0); 
    4951    meta.setPixelsBinDataBigEndian(Boolean.TRUE, 0, 0); 
    5052    meta.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0); 
     
    5658    meta.setPixelsSizeC(new PositiveInteger(1), 0); 
    5759    meta.setPixelsSizeT(new PositiveInteger(1), 0); 
     60    meta.setChannelID("Channel:0:0", 0, 0); 
    5861    meta.setChannelSamplesPerPixel(1, 0, 0); 
    5962 
  • trunk/components/bio-formats/src/loci/formats/MetadataTools.java

    r6458 r6491  
    190190        "call IMetadata.createRoot() first"); 
    191191    } 
     192    if (src.getImageID(n) == null) { 
     193      throw new FormatException("Image ID #" + n + " is null"); 
     194    } 
     195    if (src.getPixelsID(n) == null) { 
     196      throw new FormatException("Pixels ID #" + n + " is null"); 
     197    } 
     198    for (int i=0; i<src.getChannelCount(n); i++) { 
     199      if (src.getChannelID(i, n) == null) { 
     200        throw new FormatException("Channel ID #" + i + " in Image #" + n + 
     201          " is null"); 
     202      } 
     203    } 
    192204    if (src.getPixelsBinDataBigEndian(n, 0) == null) { 
    193205      throw new FormatException("BigEndian #" + n + " is null"); 
  • trunk/components/bio-formats/utils/MinimumWriter.java

    r6458 r6491  
    4646 
    4747    meta.createRoot(); 
     48    meta.setImageID("Image:0", 0); 
     49    meta.setPixelsID("Pixels:0", 0); 
    4850    meta.setPixelsBinDataBigEndian(Boolean.TRUE, 0, 0); 
    4951    meta.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0); 
     
    5557    meta.setPixelsSizeC(new PositiveInteger(1), 0); 
    5658    meta.setPixelsSizeT(new PositiveInteger(1), 0); 
     59    meta.setChannelID("Channel:0:0", 0, 0); 
    5760    meta.setChannelSamplesPerPixel(1, 0, 0); 
    5861 
Note: See TracChangeset for help on using the changeset viewer.