Changeset 5153


Ignore:
Timestamp:
06/05/09 08:06:18 (11 years ago)
Author:
melissa
Message:

Better Objective population.

File:
1 edited

Legend:

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

    r5142 r5153  
    8080 
    8181  private float pixelSizeX, pixelSizeY, pixelSizeZ; 
    82   private String voltage, mag, na, objectiveModel, immersion; 
     82  private String voltage, mag, na, objectiveModel, immersion, correction; 
    8383 
    8484  private Vector channelNames; 
     
    179179 
    180180    pixelSizeX = pixelSizeY = pixelSizeZ = 0f; 
    181     voltage = mag = na = objectiveModel = immersion = null; 
     181    voltage = mag = na = objectiveModel = immersion = correction = null; 
    182182    channelNames = null; 
    183183    binning = null; 
     
    840840    if (immersion == null) immersion = "Unknown"; 
    841841    store.setObjectiveImmersion(immersion, 0, 0); 
    842     store.setObjectiveCorrection("Unknown", 0, 0); 
     842    if (correction == null || correction.length() == 0) correction = "Unknown"; 
     843    store.setObjectiveCorrection(correction, 0, 0); 
    843844 
    844845    // link Objective to Image 
     
    918919    else if (key.endsWith("Gain")) gain.add(new Float(value)); 
    919920    else if (key.endsWith("dLampVoltage")) voltage = value; 
    920     else if (key.endsWith("dObjectiveMag")) mag = value; 
     921    else if (key.endsWith("dObjectiveMag") && mag == null) mag = value; 
    921922    else if (key.endsWith("dObjectiveNA")) na = value; 
    922923    else if (key.equals("sObjective") || key.equals("wsObjectiveName")) { 
     
    924925      int magIndex = -1; 
    925926      for (int i=0; i<tokens.length; i++) { 
    926         if (tokens[i].endsWith("x")) { 
     927        if (tokens[i].indexOf("x") != -1) { 
    927928          magIndex = i; 
    928929          break; 
    929930        } 
    930931      } 
    931       StringBuffer model = new StringBuffer(); 
     932      StringBuffer s = new StringBuffer(); 
    932933      for (int i=0; i<magIndex; i++) { 
    933         model.append(tokens[i]); 
    934         if (i < magIndex - 1) model.append(" "); 
    935       } 
    936       objectiveModel = model.toString(); 
     934        s.append(tokens[i]); 
     935      } 
     936      correction = s.toString(); 
     937      if (magIndex >= 0) { 
     938        mag = tokens[magIndex].substring(0, tokens[magIndex].indexOf("x")); 
     939      } 
    937940      if (magIndex + 1 < tokens.length) immersion = tokens[magIndex + 1]; 
    938941    } 
Note: See TracChangeset for help on using the changeset viewer.