Changeset 6356


Ignore:
Timestamp:
05/21/10 06:14:44 (10 years ago)
Author:
callan
Message:

Fixed broken instrument parsing for Leica LEI. (See  omero:#2410)

File:
1 edited

Legend:

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

    r6315 r6356  
    3030import java.util.StringTokenizer; 
    3131import java.util.Vector; 
     32 
     33import org.slf4j.Logger; 
     34import org.slf4j.LoggerFactory; 
    3235 
    3336import loci.common.DataTools; 
     
    6669 
    6770  // -- Constants - 
     71 
     72  private static final Logger LOGGER = 
     73    LoggerFactory.getLogger(LeicaReader.class); 
    6874 
    6975  public static final String[] LEI_SUFFIX = {"lei"}; 
     
    10321038    int nElements = in.readInt(); 
    10331039    in.skipBytes(4); 
    1034  
     1040    long initialOffset = in.getFilePointer(); 
     1041    long elementOffset = 0; 
     1042 
     1043    LOGGER.trace("Element LOOP; series {} at offset", series, initialOffset); 
    10351044    for (int j=0; j<nElements; j++) { 
    1036       in.seek(24 + j * cbElements); 
     1045      elementOffset = initialOffset + j * cbElements; 
     1046      LOGGER.trace("Seeking to: {}", elementOffset); 
     1047      in.seek(elementOffset); 
    10371048      String contentID = getString(128); 
     1049      LOGGER.trace("contentID: {}", contentID); 
    10381050      String description = getString(64); 
     1051      LOGGER.trace("description: {}", description); 
    10391052      String data = getString(64); 
    10401053      int dataType = in.readShort(); 
     1054      LOGGER.trace("dataType: {}", dataType); 
    10411055      in.skipBytes(6); 
    10421056 
     
    10641078      } 
    10651079 
    1066       if (data.trim().length() == 0) continue; 
     1080      LOGGER.trace("data: {}", data); 
     1081      if (data.trim().length() == 0) { 
     1082        LOGGER.trace("Zero length data string, continuing..."); 
     1083        continue; 
     1084      } 
    10671085 
    10681086      String[] tokens = contentID.split("\\|"); 
    10691087 
     1088      LOGGER.trace("Parsing tokens: {}", tokens); 
    10701089      if (tokens[0].startsWith("CDetectionUnit")) { 
    10711090        // detector information 
Note: See TracChangeset for help on using the changeset viewer.