Changeset 6692


Ignore:
Timestamp:
07/12/10 14:28:21 (9 years ago)
Author:
melissa
Message:
  • Updated CellWorXReader to delegate to DeltavisionReader when reading pixels and core metadata.
  • Updated DeltavisionReader to ignore .pnl files.
Location:
trunk/components/bio-formats/src/loci/formats/in
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/CellWorxReader.java

    r6690 r6692  
    102102 
    103103    String file = getPNLFile(getSeries()); 
    104     RandomAccessInputStream pnl = new RandomAccessInputStream(file); 
    105  
    106     long headerLength = pnl.length() - (fieldCount * fieldSize); 
    107     pnl.seek(headerLength + fieldIndex * fieldSize + no * planeSize); 
    108     readPlane(pnl, x, y, w, h, buf); 
     104    DeltavisionReader pnl = new DeltavisionReader(); 
     105    pnl.setId(file); 
     106    pnl.openBytes(fieldIndex * fieldCount + no, buf, x, y, w, h); 
    109107    pnl.close(); 
    110108    return buf; 
     
    115113    super.close(fileOnly); 
    116114    if (!fileOnly) { 
     115      fieldMap = null; 
     116      wellFiles = null; 
     117      logFiles = null; 
     118      fieldCount = 0; 
     119      plateLogFile = null; 
     120      zMapFile = null; 
    117121    } 
    118122  } 
     
    225229 
    226230    String file = getPNLFile(0); 
    227     RandomAccessInputStream pnl = new RandomAccessInputStream(file); 
    228     pnl.order(true); 
    229     int x = pnl.readInt(); 
    230     int y = pnl.readInt(); 
    231     pnl.skipBytes(4); 
    232     int pixelType = pnl.readInt(); 
    233     pnl.close(); 
     231    DeltavisionReader pnl = new DeltavisionReader(); 
     232    pnl.setId(file); 
    234233 
    235234    for (int i=0; i<core.length; i++) { 
    236235      setSeries(i); 
    237236      core[i] = new CoreMetadata(); 
    238       core[i].littleEndian = true; 
    239       core[i].sizeX = x; 
    240       core[i].sizeY = y; 
    241  
    242       switch (pixelType) { 
    243         case 2: 
    244           core[i].pixelType = FormatTools.UINT32; 
    245           break; 
    246         case 6: 
    247           core[i].pixelType = FormatTools.UINT16; 
    248           break; 
    249         default: 
    250           throw new FormatException("Unsupported pixel type: " + pixelType); 
    251       } 
    252  
     237      core[i].littleEndian = pnl.isLittleEndian(); 
     238      core[i].sizeX = pnl.getSizeX(); 
     239      core[i].sizeY = pnl.getSizeY(); 
     240      core[i].pixelType = pnl.getPixelType(); 
    253241      core[i].sizeZ = 1; 
    254242      core[i].sizeT = 1; 
     
    257245      core[i].dimensionOrder = "XYCZT"; 
    258246      core[i].rgb = false; 
    259       core[i].interleaved = false; 
     247      core[i].interleaved = pnl.isInterleaved(); 
    260248    } 
    261249 
  • trunk/components/bio-formats/src/loci/formats/in/DeltavisionReader.java

    r6689 r6692  
    116116  public boolean isThisType(String name, boolean open) { 
    117117    if (checkSuffix(name, "dv.log") || name.endsWith("_log.txt")) return true; 
     118    if (checkSuffix(name, "pnl")) return false; 
    118119    return super.isThisType(name, open); 
    119120  } 
Note: See TracChangeset for help on using the changeset viewer.