Changeset 3976


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

Remove unnecessary reflection logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/OMEXMLReader.java

    r3814 r3976  
    5757  static { 
    5858    try { 
    59       Class.forName("org.openmicroscopy.xml.OMENode"); 
     59      Class.forName("ome.xml.OMEXMLNode"); 
    6060    } 
    6161    catch (Throwable t) { 
     
    181181 
    182182    in = new RandomAccessStream(id); 
    183     ReflectedUniverse r = new ReflectedUniverse(); 
    184     try { 
    185       r.exec("import loci.formats.MetadataTools"); 
    186     } 
    187     catch (ReflectException exc) { 
    188       throw new FormatException(exc); 
    189     } 
    190183 
    191184    in.seek(0); 
    192185    String s = in.readString((int) in.length()); 
    193186    in.seek(0); 
    194     try { 
    195       r.setVar("s", s); 
    196       r.exec("omexmlMeta = MetadataTools.createOMEXMLMetadata(s)"); 
    197     } 
    198     catch (ReflectException exc) { 
    199       throw new FormatException(exc); 
    200     } 
     187 
     188    MetadataRetrieve omexmlMeta = (MetadataRetrieve) 
     189      MetadataTools.createOMEXMLMetadata(s); 
    201190 
    202191    status("Determining endianness"); 
     
    338327      core.littleEndian[i] = ((Boolean) endianness.get(i)).booleanValue(); 
    339328 
    340       Integer w = null, h = null, t = null, z = null, c = null; 
    341       String pixType = null; 
    342       try { 
    343         r.setVar("img", i); 
    344         r.setVar("pix", 0); 
    345         w = (Integer) r.exec("omexmlMeta.getPixelsSizeX(img, pix)"); 
    346         h = (Integer) r.exec("omexmlMeta.getPixelsSizeY(img, pix)"); 
    347         t = (Integer) r.exec("omexmlMeta.getPixelsSizeT(img, pix)"); 
    348         z = (Integer) r.exec("omexmlMeta.getPixelsSizeZ(img, pix)"); 
    349         c = (Integer) r.exec("omexmlMeta.getPixelsSizeC(img, pix)"); 
    350         pixType = (String) r.exec("omexmlMeta.getPixelsPixelType(img, pix)"); 
    351         core.currentOrder[i] = 
    352           (String) r.exec("omexmlMeta.getPixelsDimensionOrder(img, pix)"); 
    353       } 
    354       catch (ReflectException exc) { 
    355         throw new FormatException(exc); 
    356       } 
     329      Integer w = omexmlMeta.getPixelsSizeX(i, 0); 
     330      Integer h = omexmlMeta.getPixelsSizeY(i, 0); 
     331      Integer t = omexmlMeta.getPixelsSizeT(i, 0); 
     332      Integer z = omexmlMeta.getPixelsSizeZ(i, 0); 
     333      Integer c = omexmlMeta.getPixelsSizeC(i, 0); 
     334      String pixType = omexmlMeta.getPixelsPixelType(i, 0); 
     335      core.currentOrder[i] = omexmlMeta.getPixelsDimensionOrder(i, 0); 
    357336      core.sizeX[i] = w.intValue(); 
    358337      core.sizeY[i] = h.intValue(); 
     
    421400    MetadataStore store = getMetadataStore(); 
    422401 
    423     MetadataRetrieve omexmlMeta = null; 
    424     try { 
    425       omexmlMeta = (MetadataRetrieve) r.getVar("omexmlMeta"); 
    426       MetadataTools.convertMetadata(omexmlMeta, store); 
    427     } 
    428     catch (ReflectException e) { 
    429       if (debug) LogTools.trace(e); 
    430     } 
     402    MetadataTools.convertMetadata(omexmlMeta, store); 
    431403  } 
    432404 
Note: See TracChangeset for help on using the changeset viewer.