Changeset 7477


Ignore:
Timestamp:
12/29/10 17:40:58 (9 years ago)
Author:
melissa
Message:

Allow sparse plates.

File:
1 edited

Legend:

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

    r7475 r7477  
    269269    for (int plate=0; plate<plates.length; plate++) { 
    270270      String[] plateList = new Location(plates[plate]).list(true); 
    271       Vector<String> uniqueRows = new Vector<String>(); 
    272       Vector<String> uniqueCols = new Vector<String>(); 
     271      int maxRow = 0, maxCol = 0; 
    273272      for (String well : plateList) { 
    274273        Location wellFile = new Location(plates[plate], well); 
     
    290289          tmpWells.add(wellFile.getAbsolutePath()); 
    291290 
    292           if (!uniqueRows.contains(row)) { 
    293             uniqueRows.add(row); 
     291          if ((row.charAt(0) - 'A') > maxRow) { 
     292            maxRow = row.charAt(0) - 'A'; 
    294293          } 
    295           if (!uniqueCols.contains(col)) { 
    296             uniqueCols.add(col); 
     294          if (Integer.parseInt(col) - 1 > maxCol) { 
     295            maxCol = Integer.parseInt(col) - 1; 
    297296          } 
    298297        } 
     
    307306      coreLength += files[plate].length; 
    308307 
    309       plateMaps[plate] = new boolean[uniqueRows.size()][uniqueCols.size()]; 
     308      plateMaps[plate] = new boolean[maxRow + 1][maxCol + 1]; 
    310309      plateMetadataFiles[plate] = 
    311310        metadataFiles.toArray(new String[metadataFiles.size()]); 
Note: See TracChangeset for help on using the changeset viewer.