Changeset 1208


Ignore:
Timestamp:
08/02/06 14:04:12 (14 years ago)
Author:
curtis
Message:

Use new MetadataStore API for Bio-Formats.

Location:
trunk/loci/visbio/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/data/Dataset.java

    r980 r1208  
    487487    // initialize data readers 
    488488    readers = new ImageReader[ids.length]; 
    489     for (int i=0; i<ids.length; i++) readers[i] = new ImageReader(); 
     489    for (int i=0; i<ids.length; i++) { 
     490      readers[i] = new ImageReader(); 
     491      try { readers[i].setMetadataStore(new OMEXMLMetadataStore()); } 
     492      catch (UnsupportedMetadataStoreException exc) { exc.printStackTrace(); } 
     493    } 
    490494 
    491495    // determine number of images per source file 
     
    583587        return; 
    584588      } 
    585       try { ome[i] = (OMENode) readers[i].getOMENode(ids[i]); } 
     589      try { 
     590        MetadataStore ms = readers[i].getMetadataStore(ids[i]); 
     591        if (ms instanceof OMEXMLMetadataStore) { 
     592          ome[i] = (OMENode) ((OMEXMLMetadataStore) ms).getRoot(); 
     593        } 
     594      } 
    586595      catch (IOException exc) { ome[i] = null; } 
    587596      catch (FormatException exc) { ome[i] = null; } 
  • trunk/loci/visbio/data/DatasetPane.java

    r1018 r1208  
    4242import loci.visbio.util.*; 
    4343import org.openmicroscopy.xml.OMENode; 
    44 import org.openmicroscopy.xml.DOMUtil; 
    45 import org.w3c.dom.Element; 
    4644import visad.util.Util; 
    4745 
     
    401399    try { 
    402400      numImages = reader.getImageCount(ids[0]); 
    403       ome = (OMENode) reader.getOMENode(ids[0]); 
    404401    } 
    405402    catch (IOException exc) { 
     
    421418    String dimOrder = null; 
    422419    int sizeZ = 1, sizeT = 1, sizeC = 1; 
    423     if (ome != null) { 
    424       try { 
    425         Element pix = DOMUtil.findElement("Pixels", ome.getOMEDocument(true)); 
    426         String z = DOMUtil.getAttribute("SizeZ", pix); 
    427         if (z != null && !z.equals("")) sizeZ = Integer.parseInt(z); 
    428         String t = DOMUtil.getAttribute("SizeT", pix); 
    429         if (t != null && !t.equals("")) sizeT = Integer.parseInt(t); 
    430         String c = DOMUtil.getAttribute("SizeC", pix); 
    431         if (c != null && !c.equals("")) sizeC = Integer.parseInt(c); 
    432         dimOrder = DOMUtil.getAttribute("DimensionOrder", pix); 
    433       } 
    434       catch (Exception exc) { 
    435         if (VisBioFrame.DEBUG) exc.printStackTrace(); 
    436       } 
    437     } 
     420    try { 
     421      dimOrder = reader.getDimensionOrder(ids[0]); 
     422      sizeZ = reader.getSizeZ(ids[0]); 
     423      sizeT = reader.getSizeT(ids[0]); 
     424      sizeC = reader.getSizeC(ids[0]); 
     425    } 
     426    catch (FormatException exc) { exc.printStackTrace(); } 
     427    catch (IOException exc) { exc.printStackTrace(); } 
    438428 
    439429    // autodetect dimensional types 
Note: See TracChangeset for help on using the changeset viewer.