Changeset 4116


Ignore:
Timestamp:
06/16/08 12:56:39 (11 years ago)
Author:
melissa
Message:

Fixed a couple of bugs that prevented some OME-TIFF files from being imported into OME.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r4089 r4116  
    9393 
    9494    // parse and populate OME-XML metadata 
    95     RandomAccessStream ras = new RandomAccessStream(id); 
     95    RandomAccessStream ras = new RandomAccessStream(new Location(id).getAbsoluteFile().getAbsolutePath()); 
    9696    Hashtable firstIFD = TiffTools.getFirstIFD(ras); 
    9797    ras.close(); 
     
    326326 
    327327  private String normalizeFilename(String dir, String name) { 
    328      return new File(dir, name).getAbsolutePath(); 
     328     File file = new File(dir, name); 
     329     if (file.exists()) return file.getAbsolutePath(); 
     330     return new Location(name).getAbsolutePath(); 
    329331  } 
    330332 
  • trunk/loci/formats/ome/OmeisImporter.java

    r4048 r4116  
    3030import loci.formats.ome.OMEXML2003FCMetadata; 
    3131import ome.xml.DOMUtil; 
    32 import org.openmicroscopy.xml.OMENode; 
     32import ome.xml.r2003fc.ome.OMENode; 
    3333import org.w3c.dom.Document; 
    3434import org.w3c.dom.Element; 
     
    202202    // get DOM and Pixels elements for the file's OME-XML metadata 
    203203    OMENode ome = (OMENode) omexmlMeta.getRoot(); 
    204     Document omeDoc = null; 
    205     try { 
    206       omeDoc = ome.getOMEDocument(false); 
    207     } 
    208     catch (javax.xml.transform.TransformerException exc) { 
    209       throw new FormatException(exc); 
    210     } 
    211     catch (org.xml.sax.SAXException exc) { 
    212       throw new FormatException(exc); 
    213     } 
    214     catch (javax.xml.parsers.ParserConfigurationException exc) { 
    215       throw new FormatException(exc); 
    216     } 
     204    Document omeDoc = ome.getDOMElement().getOwnerDocument(); 
    217205    Vector pix = DOMUtil.findElementList("Pixels", omeDoc); 
    218206    if (pix.size() != seriesCount) { 
     
    343331      pixels.setAttribute("ImageServerID", "" + pixelsId); 
    344332      pixels.setAttribute("DimensionOrder", "XYZCT"); // ignored anyway 
     333      String pType = pixels.getAttribute("PixelType"); 
     334      if (pType.startsWith("u")) { 
     335        pixels.setAttribute("PixelType", pType.replace('u', 'U')); 
     336      } 
    345337      if (DEBUG) log("Pixel attributes injected."); 
    346338    } 
     
    417409  { 
    418410    // ./omeis Method=NewPixels Dims=sx,sy,sz,sc,st,Bpp IsSigned=0 IsFloat=0 
     411 
    419412    String[] s; 
    420413    try { 
Note: See TracChangeset for help on using the changeset viewer.