Changeset 2613


Ignore:
Timestamp:
04/12/07 14:23:09 (13 years ago)
Author:
melissa
Message:

Fixed white level/black level; only adds detectors if the appropriate metadata
is non-null.

File:
1 edited

Legend:

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

    r2611 r2613  
    635635    for (int i=0; i<core.sizeC[0]; i++) { 
    636636      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
    637       String black = (String) getMeta("PMT " + i + " Black level"); 
    638       int bits = core.pixelType[0] == FormatTools.UINT8 ? 8 : 16; 
    639       store.setDisplayChannel(new Integer(i), black == null ? null : 
    640         new Double(black), new Double(Math.pow(2, bits)), null, null); 
     637       
     638      double white = Double.parseDouble(getMeta("ramp1_max").toString());  
     639      double black = Double.parseDouble(getMeta("ramp1_min").toString());  
     640       
     641      store.setDisplayChannel(new Integer(i),  new Double(black), 
     642        new Double(white), null, null); 
    641643    } 
    642644    String zoom = (String) getMeta("Zoom factor (user selected)"); 
     
    657659      String gain = (String) getMeta(prefix + "gain"); 
    658660      String offset = (String) getMeta(prefix + "offset"); 
    659       store.setDetector(null, null, null, null, gain == null ? null : 
    660         new Float(gain), null, offset == null ? null : new Float(offset), 
    661         null, new Integer(i)); 
     661      if (gain != null || offset != null) {  
     662        store.setDetector(null, null, null, null, gain == null ? null : 
     663          new Float(gain), null, offset == null ? null : new Float(offset), 
     664          null, new Integer(i)); 
     665      } 
    662666 
    663667      String exc = (String) getMeta("Part number of excitation filter for " + 
     
    667671      String excName = (String) getMeta("Excitation filter name - laser " + i); 
    668672      String emsName = (String) getMeta("Emission filter name - laser " + i); 
    669       store.setExcitationFilter(null, null, exc, null, null); 
    670       store.setEmissionFilter(null, null, ems, null, null); 
     673      if (exc != null) store.setExcitationFilter(null, null, exc, null, null); 
     674      if (ems != null) store.setEmissionFilter(null, null, ems, null, null); 
    671675    } 
    672676    String mag = (String) getMeta("Objective lens magnification"); 
    673     store.setObjective(null, null, null, null, 
    674       mag == null ? null : new Float(mag), null, null); 
    675  
     677    if (mag != null) { 
     678      store.setObjective(null, null, null, null, new Float(mag), null, null); 
     679    } 
    676680  } 
    677681 
Note: See TracChangeset for help on using the changeset viewer.