Changeset 7571


Ignore:
Timestamp:
01/21/11 14:39:46 (9 years ago)
Author:
melissa
Message:

Populate all of the wells, even if no image data is associated with them.

File:
1 edited

Legend:

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

    r7453 r7571  
    8080  private String binning, objective; 
    8181 
     82  private int wellRows, wellCols; 
     83 
    8284  // -- Constructor -- 
    8385 
     
    152154      metadataFiles.clear(); 
    153155      wellLabels.clear(); 
     156      wellRows = 0; 
     157      wellCols = 0; 
    154158    } 
    155159  } 
     
    296300    MetadataTools.populatePixels(store, this, populatePlanes); 
    297301 
     302    for (int row=0; row<wellRows; row++) { 
     303      for (int col=0; col<wellCols; col++) { 
     304        int index = row * wellCols + col; 
     305 
     306        store.setWellID(MetadataTools.createLSID("Well", 0, index), 0, index); 
     307        store.setWellRow(new NonNegativeInteger(row), 0, index); 
     308        store.setWellColumn(new NonNegativeInteger(col), 0, index); 
     309      } 
     310    } 
     311 
    298312    for (int i=0; i<getSeriesCount(); i++) { 
    299313      MetadataTools.setDefaultCreationDate(store, id, i); 
     
    303317      Integer col = Integer.parseInt(name.substring(1)); 
    304318 
    305       store.setWellID(MetadataTools.createLSID("Well", 0, i), 0, i); 
    306       store.setWellColumn(new NonNegativeInteger(col - 1), 0, i); 
    307       store.setWellRow(new NonNegativeInteger(row.charAt(0) - 'A'), 0, i); 
    308  
    309       String wellSampleID = MetadataTools.createLSID("WellSample", 0, i, 0); 
    310       store.setWellSampleID(wellSampleID, 0, i, 0); 
    311       store.setWellSampleIndex(new NonNegativeInteger(i), 0, i, 0); 
     319      int index = (row.charAt(0) - 'A') * wellCols + col - 1; 
     320 
     321      String wellSampleID = MetadataTools.createLSID("WellSample", 0, index, 0); 
     322      store.setWellSampleID(wellSampleID, 0, index, 0); 
     323      store.setWellSampleIndex(new NonNegativeInteger(i), 0, index, 0); 
    312324 
    313325      String imageID = MetadataTools.createLSID("Image", i); 
    314       store.setWellSampleImageRef(imageID, 0, i, 0); 
     326      store.setWellSampleImageRef(imageID, 0, index, 0); 
    315327      store.setImageID(imageID, i); 
    316328      store.setImageName(name, i); 
     
    337349        } 
    338350 
    339         store.setObjectiveNominalMagnification(PositiveInteger.valueOf(mag), 0, 0); 
     351        store.setObjectiveNominalMagnification( 
     352          PositiveInteger.valueOf(mag), 0, 0); 
    340353        if (na != null) { 
    341354          na = na.substring(0, 1) + "." + na.substring(1); 
     
    446459      plateType.get("Brand") + " " + plateType.get("Description"); 
    447460 
     461    int nWells = Integer.parseInt(plateType.get("Wells")); 
     462    if (nWells == 96) { 
     463      wellRows = 8; 
     464      wellCols = 12; 
     465    } 
     466    else if (nWells == 384) { 
     467      wellRows = 16; 
     468      wellCols = 24; 
     469    } 
     470 
    448471    Location dir = new Location(id).getAbsoluteFile().getParentFile(); 
    449472    String[] wellList = dir.list(); 
     
    559582 
    560583    int firstRow = 0; 
    561     while (!lines[firstRow].startsWith("ROI")) firstRow++; 
     584    while (firstRow < lines.length && !lines[firstRow].startsWith("ROI")) { 
     585      firstRow++; 
     586    } 
    562587    firstRow += 2; 
     588    if (firstRow >= lines.length) return; 
    563589 
    564590    for (int i=firstRow; i<lines.length; i++) { 
Note: See TracChangeset for help on using the changeset viewer.