Changeset 6648


Ignore:
Timestamp:
07/05/10 11:04:02 (9 years ago)
Author:
melissa
Message:

Remove any BinData elements from the OME-XML before it is written to the TIFF comment.

File:
1 edited

Legend:

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

    r6531 r6648  
    2727import java.util.ArrayList; 
    2828import java.util.HashMap; 
     29import java.util.List; 
    2930import java.util.UUID; 
    3031 
     32import ome.xml.model.BinData; 
     33import ome.xml.model.Image; 
     34import ome.xml.model.OME; 
     35import ome.xml.model.Pixels; 
    3136import ome.xml.model.primitives.NonNegativeInteger; 
    3237import ome.xml.model.primitives.PositiveInteger; 
     
    110115        throw new RuntimeException(se); 
    111116      } 
     117 
     118      // remove any BinData elements from the OME-XML 
     119 
     120      OME root = (OME) omeMeta.getRoot(); 
     121      List<Image> images = root.copyImageList(); 
     122      for (Image img : images) { 
     123        Pixels pix = img.getPixels(); 
     124        List<BinData> binData = pix.copyBinDataList(); 
     125        for (BinData bin : binData) { 
     126          pix.removeBinData(bin); 
     127        } 
     128      } 
     129      omeMeta.setRoot(root); 
    112130 
    113131      for (int series=0; series<omeMeta.getImageCount(); series++) { 
Note: See TracChangeset for help on using the changeset viewer.