Changeset 3329


Ignore:
Timestamp:
10/30/07 10:49:32 (12 years ago)
Author:
melissa
Message:

Calculate pixel sizes if they aren't stored explicitly.

File:
1 edited

Legend:

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

    r3328 r3329  
    7272  private Vector channelParameters; 
    7373  private float pixelSizeX, pixelSizeY, pixelSizeZ; 
     74  private float minX, minY, minZ, maxX, maxY, maxZ; 
    7475 
    7576  // -- Constructor -- 
     
    192193    core.indexed[0] = false; 
    193194 
     195    if (pixelSizeX == 1) pixelSizeX = (maxX - minX) / core.sizeX[0]; 
     196    if (pixelSizeY == 1) pixelSizeY = (maxY - minY) / core.sizeY[0]; 
     197    if (pixelSizeZ == 1) pixelSizeZ = (maxZ - minZ) / core.sizeZ[0]; 
     198 
    194199    FormatTools.populatePixels(store, this); 
    195200    store.setDimensions(new Float(pixelSizeX), new Float(pixelSizeY), 
     
    282287        pixelSizeZ = Float.parseFloat(st.trim()); 
    283288      } 
     289      else if (name.equals("ExtMax0")) maxX = Float.parseFloat(st.trim()); 
     290      else if (name.equals("ExtMax1")) maxY = Float.parseFloat(st.trim()); 
     291      else if (name.equals("ExtMax2")) maxZ = Float.parseFloat(st.trim()); 
     292      else if (name.equals("ExtMin0")) minX = Float.parseFloat(st.trim()); 
     293      else if (name.equals("ExtMin1")) minY = Float.parseFloat(st.trim()); 
     294      else if (name.equals("ExtMin2")) minZ = Float.parseFloat(st.trim()); 
    284295 
    285296      if (st != null) addMeta(name, st); 
Note: See TracChangeset for help on using the changeset viewer.