Changeset 6317


Ignore:
Timestamp:
05/14/10 11:21:34 (10 years ago)
Author:
melissa
Message:

Fix for plates that do not have well labels, courtesy of Rubén Muñoz.

File:
1 edited

Legend:

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

    r6313 r6317  
    7171  private int wellRows, wellColumns; 
    7272  private int fieldRows, fieldColumns; 
     73  private int wellCount = 0; 
    7374  private Vector<String> channelNames = new Vector<String>(); 
    7475  private Hashtable<String, Integer> wellLabels = 
     
    261262 
    262263    if (wellRows * wellColumns == 0) { 
    263       if (wellLabels.size() <= 96) { 
     264      if (wellCount <= 96) { 
    264265        wellColumns = 12; 
    265266      } 
    266       else if (wellLabels.size() <= 384) { 
     267      else if (wellCount <= 384) { 
    267268        wellColumns = 24; 
    268269      } 
    269       wellRows = wellLabels.size() / wellColumns; 
    270       if (wellRows * wellColumns < wellLabels.size()) wellRows++; 
     270      wellRows = wellCount / wellColumns; 
     271      if (wellRows * wellColumns < wellCount) wellRows++; 
    271272    } 
    272273 
     
    299300    int realPosCount = 0; 
    300301    for (int well=0; well<nWells; well++) { 
    301       Integer w = wellLabels.get(keys[well]); 
     302      Integer w = keys.length > 0 ? wellLabels.get(keys[well]) : null; 
    302303      int wellIndex = w == null ? well + 1 : w.intValue(); 
    303304 
     
    335336    } 
    336337 
    337     if (wellLabels.size() != nWells) { 
     338    if (wellLabels.size() > 0 && wellLabels.size() != nWells) { 
    338339      uniqueRows.clear(); 
    339340      uniqueColumns.clear(); 
     
    502503          if (Character.isDigit(value.charAt(0))) { 
    503504            wellIndex = value; 
     505            wellCount++; 
    504506          } 
    505507          else { 
Note: See TracChangeset for help on using the changeset viewer.