Changeset 6719


Ignore:
Timestamp:
07/20/10 16:56:07 (9 years ago)
Author:
melissa
Message:

Set BinData.Length to "0" to prevent validation errors.

File:
1 edited

Legend:

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

    r6531 r6719  
    3838import loci.formats.services.OMEXMLService; 
    3939 
     40import ome.xml.model.BinData; 
     41import ome.xml.model.OME; 
    4042import ome.xml.model.enums.DimensionOrder; 
    4143import ome.xml.model.enums.EnumerationException; 
    4244import ome.xml.model.enums.PixelType; 
    4345import ome.xml.model.primitives.NonNegativeInteger; 
     46import ome.xml.model.primitives.NonNegativeLong; 
    4447import ome.xml.model.primitives.PositiveInteger; 
    4548 
     
    117120      store.setPixelsSizeT(new PositiveInteger(r.getSizeT()), i); 
    118121      store.setPixelsBinDataBigEndian(new Boolean(!r.isLittleEndian()), i, 0); 
     122 
     123      try { 
     124        OMEXMLService service = 
     125          new ServiceFactory().getInstance(OMEXMLService.class); 
     126        if (service.isOMEXMLRoot(store.getRoot())) { 
     127          OME root = (OME) store.getRoot(); 
     128          BinData bin = root.getImage(i).getPixels().getBinData(0); 
     129          bin.setLength(new NonNegativeLong(0L)); 
     130          store.setRoot(root); 
     131        } 
     132      } 
     133      catch (DependencyException exc) { 
     134        LOGGER.debug("Failed to set BinData.Length", exc); 
     135      } 
     136 
    119137      try { 
    120138        store.setPixelsType(PixelType.fromString( 
Note: See TracChangeset for help on using the changeset viewer.