Changeset 5120


Ignore:
Timestamp:
05/25/09 17:58:06 (11 years ago)
Author:
melissa
Message:

Use unique keys in the metadata hashtable if there are multiple instances of the same tag.

File:
1 edited

Legend:

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

    r5093 r5120  
    792792 
    793793      if (((tag & 0xffff0000) >> 16) != 0x7fe0) { 
    794         addMeta(key, info); 
     794        if (metadata.containsKey(key)) { 
     795          // make sure that values are not overwritten 
     796          Object v = getMetadataValue(key); 
     797          metadata.remove(key); 
     798          addMeta(key + " #1", v); 
     799          addMeta(key + " #2", info); 
     800        } 
     801        else if (metadata.containsKey(key + " #1")) { 
     802          int index = 2; 
     803          while (metadata.containsKey(key + " #" + index)) index++; 
     804          addMeta(key + " #" + index, info); 
     805        } 
     806        else addMeta(key, info); 
    795807      } 
    796808    } 
Note: See TracChangeset for help on using the changeset viewer.