Changeset 6661


Ignore:
Timestamp:
07/07/10 12:38:20 (9 years ago)
Author:
melissa
Message:

Better physical X/Y size parsing.

File:
1 edited

Legend:

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

    r6655 r6661  
    101101  private double[] zDistances, stageX, stageY; 
    102102  private double zStart; 
     103  private Double sizeX = null, sizeY = null; 
    103104 
    104105  private int mmPlanes; //number of metamorph planes 
     
    226227      canLookForND = true; 
    227228      firstSeriesChannels = null; 
     229      sizeX = sizeY = null; 
    228230    } 
    229231  } 
     
    519521 
    520522      store.setImagingEnvironmentTemperature(handler.getTemperature(), i); 
    521       store.setPixelsPhysicalSizeX(handler.getPixelSizeX(), i); 
    522       store.setPixelsPhysicalSizeY(handler.getPixelSizeY(), i); 
     523 
     524      if (sizeX == null) sizeX = handler.getPixelSizeX(); 
     525      if (sizeY == null) sizeY = handler.getPixelSizeY(); 
     526 
     527      store.setPixelsPhysicalSizeX(sizeX, i); 
     528      store.setPixelsPhysicalSizeY(sizeY, i); 
    523529      if (zDistances != null) { 
    524530        stepSize = zDistances[0]; 
     
    12331239      if ("Zoom".equals(key) && value != null) { 
    12341240        zoom = Double.parseDouble(value.toString()); 
     1241      } 
     1242      if ("XCalibration".equals(key) && value != null) { 
     1243        if (value instanceof TiffRational) { 
     1244          sizeX = ((TiffRational) value).doubleValue(); 
     1245        } 
     1246        else sizeX = new Double(value.toString()); 
     1247      } 
     1248      if ("YCalibration".equals(key) && value != null) { 
     1249        if (value instanceof TiffRational) { 
     1250          sizeY = ((TiffRational) value).doubleValue(); 
     1251        } 
     1252        else sizeY = new Double(value.toString()); 
    12351253      } 
    12361254    } 
Note: See TracChangeset for help on using the changeset viewer.