Changeset 7040


Ignore:
Timestamp:
10/06/10 18:07:08 (9 years ago)
Author:
melissa
Message:

Progress on reading position data from LSM files. See #576, see #570.

File:
1 edited

Legend:

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

    r6881 r7040  
    166166  private Vector<String> imageNames; 
    167167  private String binning; 
    168   private Vector<Double> xCoordinates, yCoordinates; 
     168  private Vector<Double> xCoordinates, yCoordinates, zCoordinates; 
    169169  private int dimensionM, dimensionP; 
    170170  private Hashtable<String, Integer> seriesCounts; 
     171 
     172  private double originX, originY, originZ; 
    171173 
    172174  private int totalROIs = 0; 
     
    215217      xCoordinates = null; 
    216218      yCoordinates = null; 
     219      zCoordinates = null; 
    217220      dimensionM = 0; 
    218221      dimensionP = 0; 
    219222      seriesCounts = null; 
     223      originX = originY = originZ = 0d; 
    220224    } 
    221225  } 
     
    354358    xCoordinates = new Vector<Double>(); 
    355359    yCoordinates = new Vector<Double>(); 
     360    zCoordinates = new Vector<Double>(); 
    356361    seriesCounts = new Hashtable<String, Integer>(); 
    357362 
     
    647652      addSeriesMeta("VoxelSizeZ", new Double(pixelSizeZ)); 
    648653 
    649       addSeriesMeta("OriginX", ras.readDouble()); 
    650       addSeriesMeta("OriginY", ras.readDouble()); 
    651       addSeriesMeta("OriginZ", ras.readDouble()); 
     654      originX = ras.readDouble() * 1000000; 
     655      originY = ras.readDouble() * 1000000; 
     656      originZ = ras.readDouble() * 1000000; 
     657 
     658      addSeriesMeta("OriginX", originX); 
     659      addSeriesMeta("OriginY", originY); 
     660      addSeriesMeta("OriginZ", originZ); 
    652661    } 
    653662    else ras.seek(88); 
     
    834843      //     15 32-bit integers here; however, there are actually 16 32-bit 
    835844      //     integers before the tile position offset. 
    836       //     We have confirmed with Zeiss that this is correct. 
     845      //     We have confirmed with Zeiss that this is correct, and the 6.0 
     846      //     specification was updated to contain the correct information. 
    837847      ras.skipBytes(64); 
    838848 
    839849      int tilePositionOffset = ras.readInt(); 
     850 
     851      ras.skipBytes(36); 
     852 
     853      int positionOffset = ras.readInt(); 
    840854 
    841855      // read referenced structures 
     
    846860      addSeriesMeta("DimensionP", dimensionP); 
    847861 
     862      if (positionOffset != 0) { 
     863        in.seek(positionOffset); 
     864        int nPositions = in.readInt(); 
     865        for (int i=0; i<nPositions; i++) { 
     866          double xPos = originX + in.readDouble() * 1000000; 
     867          double yPos = originY + in.readDouble() * 1000000; 
     868          double zPos = originZ + in.readDouble() * 1000000; 
     869          xCoordinates.add(xPos); 
     870          yCoordinates.add(yPos); 
     871          zCoordinates.add(zPos); 
     872        } 
     873      } 
     874 
    848875      if (tilePositionOffset != 0) { 
    849876        in.seek(tilePositionOffset); 
    850877        int nTiles = in.readInt(); 
    851878        for (int i=0; i<nTiles; i++) { 
    852           xCoordinates.add(in.readDouble()); 
    853           yCoordinates.add(in.readDouble()); 
     879          xCoordinates.add(originX + in.readDouble() * 1000000); 
     880          yCoordinates.add(originY + in.readDouble() * 1000000); 
     881          zCoordinates.add(originZ + in.readDouble() * 1000000); 
    854882        } 
    855883      } 
     
    10491077          store.setPlanePositionX(xCoordinates.get(stage), series, i); 
    10501078          store.setPlanePositionY(yCoordinates.get(stage), series, i); 
     1079          store.setPlanePositionZ(zCoordinates.get(stage), series, i); 
    10511080        } 
    10521081      } 
Note: See TracChangeset for help on using the changeset viewer.