Changeset 5098


Ignore:
Timestamp:
05/10/09 10:12:07 (11 years ago)
Author:
melissa
Message:

Don't populate more than getSeriesCount() Image elements.

File:
1 edited

Legend:

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

    r5093 r5098  
    7878  private Vector<String> lightSourceIDs; 
    7979 
     80  private Vector<Float> xResolutions; 
     81  private Vector<Float> yResolutions; 
     82 
    8083  // -- Constructor -- 
    8184 
     
    155158    yPositions = new Vector<Float>(); 
    156159    lightSourceIDs = new Vector<String>(); 
     160    xResolutions = new Vector<Float>(); 
     161    yResolutions = new Vector<Float>(); 
    157162 
    158163    // parse factors from XML 
     
    187192 
    188193    if (getImageCount() * seriesCount < ifds.length) { 
    189       if(fieldCount==1){ 
    190         fieldCount=ifds.length / getSizeC(); 
     194      if (fieldCount == 1) { 
     195        fieldCount = ifds.length / getSizeC(); 
    191196        seriesCount = plateCount * wellCount * fieldCount; 
    192197      } 
    193198      core[0].imageCount = ifds.length / seriesCount; 
    194199      //Z-stacks are more likely than t-series (especially in Flex version 1.0) 
    195       core[0].sizeC = getSizeC();  
    196       core[0].sizeZ = getSizeZ()<=1?getImageCount() / getSizeC():getSizeZ(); 
    197       core[0].sizeT = getImageCount() / (getSizeC()*getSizeZ()); 
     200      if (getSizeZ() <= 1) core[0].sizeZ = getImageCount() / getSizeC(); 
     201      core[0].sizeT = getImageCount() / (getSizeC() * getSizeZ()); 
    198202    } 
    199203    else if (getImageCount() == ifds.length) { 
     
    266270    for (int i=0; i<getSeriesCount(); i++) { 
    267271      int[] pos = FormatTools.rasterToPosition(lengths, i); 
     272 
     273      if (i < xResolutions.size()) { 
     274        store.setDimensionsPhysicalSizeX(xResolutions.get(i), i, 0); 
     275      } 
     276      if (i < yResolutions.size()) { 
     277        store.setDimensionsPhysicalSizeY(yResolutions.get(i), i, 0); 
     278      } 
    268279 
    269280      store.setImageID("Image:" + i, i); 
     
    389400      else if (parentQName.equals("ImageResolutionX")) { 
    390401        try { 
    391           store.setDimensionsPhysicalSizeX(new Float(value), nextImage - 1, 0); 
     402          xResolutions.add(new Float(value)); 
    392403        } 
    393404        catch (NumberFormatException e) { } 
     
    395406      else if (parentQName.equals("ImageResolutionY")) { 
    396407        try { 
    397           store.setDimensionsPhysicalSizeY(new Float(value), nextImage - 1, 0); 
     408          yResolutions.add(new Float(value)); 
    398409        } 
    399410        catch (NumberFormatException e) { } 
Note: See TracChangeset for help on using the changeset viewer.