Changeset 6697


Ignore:
Timestamp:
07/13/10 15:39:16 (9 years ago)
Author:
melissa
Message:

First attempt at parsing stage coordinates from LSM files.

File:
1 edited

Legend:

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

    r6655 r6697  
    166166  private Vector<String> imageNames; 
    167167  private String binning; 
     168  private Vector<Double> xCoordinates, yCoordinates; 
    168169 
    169170  private int totalROIs = 0; 
     
    210211      prevPlane = -1; 
    211212      prevBuf = null; 
     213      xCoordinates = null; 
     214      yCoordinates = null; 
    212215    } 
    213216  } 
     
    340343    timestamps = new Vector<Double>(); 
    341344    imageNames = new Vector<String>(); 
     345    xCoordinates = new Vector<Double>(); 
     346    yCoordinates = new Vector<Double>(); 
    342347 
    343348    core = new CoreMetadata[lsmFilenames.length]; 
     
    712717 
    713718      int wavelengthOffset = ras.readInt(); 
     719      ras.skipBytes(56); 
     720      int dimensionP = ras.readInt(); 
     721      int dimensionM = ras.readInt(); 
     722 
     723      // NB: the Zeiss LSM 5.5 specification indicates that there should be 
     724      //     15 32-bit integers here; however, there are actually 16 32-bit 
     725      //     integers before the tile position offset. 
     726      ras.skipBytes(64); 
     727 
     728      int tilePositionOffset = ras.readInt(); 
    714729 
    715730      // read referenced structures 
     
    717732      addSeriesMeta("DimensionZ", getSizeZ()); 
    718733      addSeriesMeta("DimensionChannels", getSizeC()); 
     734      addSeriesMeta("DimensionM", dimensionM); 
     735      addSeriesMeta("DimensionP", dimensionP); 
     736 
     737      if (tilePositionOffset != 0) { 
     738        in.seek(tilePositionOffset); 
     739        int nTiles = in.readInt(); 
     740        for (int i=0; i<nTiles; i++) { 
     741          xCoordinates.add(in.readDouble()); 
     742          yCoordinates.add(in.readDouble()); 
     743        } 
     744      } 
    719745 
    720746      if (channelColorsOffset != 0) { 
     
    906932          store.setPlaneExposureTime(nextStamp - thisStamp, series, i); 
    907933        } 
     934        int stage = i / (getImageCount() / xCoordinates.size()); 
     935        store.setPlanePositionX(xCoordinates.get(stage), series, i); 
     936        store.setPlanePositionY(yCoordinates.get(stage), series, i); 
    908937      } 
    909938    } 
Note: See TracChangeset for help on using the changeset viewer.