Changeset 2597


Ignore:
Timestamp:
04/11/07 08:32:43 (13 years ago)
Author:
melissa
Message:

Fixed how core.littleEndian is populated.

File:
1 edited

Legend:

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

    r2584 r2597  
    165165      RandomAccessStream stream = new RandomAccessStream(b); 
    166166      Hashtable[] ifds = TiffTools.getIFDs(stream); 
    167       core.littleEndian[series] = TiffTools.isLittleEndian(ifds[0]); 
    168167      TiffTools.getSamples(ifds[0], stream, buf); 
    169168      stream.close(); 
     
    186185 
    187186    return ImageTools.makeImage(b, core.sizeX[series], core.sizeY[series],  
    188       getRGBChannelCount(), false, bytes, !core.littleEndian[series],  
     187      getRGBChannelCount(), false, bytes, core.littleEndian[series],  
    189188      validBits[series]); 
    190189  } 
     
    415414        core.interleaved[i] = false; 
    416415      } 
     416     
     417      Integer ii = new Integer(0); 
     418      String directory = (String) ((Hashtable) pixels.get(series)).get(ii); 
     419      String name = (String) ((Hashtable) names.get(series)).get(ii); 
     420 
     421      r.setVar("dirName", directory); 
     422      r.exec("root = fs.getRoot()"); 
     423      r.exec("dir = root.getEntry(dirName)"); 
     424      r.setVar("entryName", name); 
     425      r.exec("document = dir.getEntry(entryName)"); 
     426      r.exec("dis = new DocumentInputStream(document)"); 
     427      r.exec("numBytes = dis.available()"); 
     428      int numBytes = ((Integer) r.getVar("numBytes")).intValue(); 
     429      byte[] b = new byte[numBytes + 4]; // append 0 for final offset 
     430      r.setVar("data", b); 
     431      r.exec("dis.read(data)"); 
     432 
     433      RandomAccessStream stream = new RandomAccessStream(b); 
     434      Hashtable[] ifds = TiffTools.getIFDs(stream); 
     435     
     436      Arrays.fill(core.littleEndian, !TiffTools.isLittleEndian(ifds[0]));  
    417437    } 
    418438    catch (ReflectException e) { 
     
    481501        null); 
    482502 
    483       Float pixX = new Float(getMeta( 
    484         "[Reference Image Parameter] - WidthConvertValue").toString()); 
    485       Float pixY = new Float(getMeta( 
    486         "[Reference Image Parameter] - HeightConvertValue").toString()); 
    487       store.setDimensions(pixX, pixY, null, null, null, new Integer(i)); 
     503      String pre = "[Reference Image Parameter] - "; 
     504      String x = (String) getMeta(pre + "WidthConvertValue"); 
     505      String y = (String) getMeta(pre + "HeightConvertValue"); 
     506       
     507      store.setDimensions(x == null ? null : new Float(x),  
     508        y == null ? null : new Float(y), null, null, null, new Integer(i)); 
    488509      for (int j=0; j<core.sizeC[0]; j++) { 
    489510        store.setLogicalChannel(j, null, null, null, null, null, 
Note: See TracChangeset for help on using the changeset viewer.