if (descriptions.length == 0) return imageFile;
OME ome = new OME();
List<Plate> plates = new ArrayList<Plate>();
for (MockImageDescription d:descriptions) {
Plate plate = null;
for (Plate qPlate:plates) {
if (qPlate.getName().equals(d.plate)) {
plate = qPlate;
break;
}
}
if (plate == null) {
plate = new Plate();
plate.setName(d.plate);
ome.addPlate(plate);
}
Well well = null;
int row = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(d.well.substring(0, 1).toUpperCase());
int col = Integer.valueOf(d.well.substring(1));
for (int i=0; i<plate.sizeOfWellList(); i++) {
final Well qWell = plate.getWell(i);
if ((qWell.getRow().equals(row)) && (qWell.getColumn().equals(col))) {
well = qWell;
break;
}
}
if (well == null) {
well = new Well();
well.setRow(new NonNegativeInteger(row));
well.setColumn(new NonNegativeInteger(col));
well.setExternalDescription(d.well);
plate.addWell(well);
}
while (well.sizeOfWellSampleList() <= d.site) {
final WellSample qSample = new WellSample();
qSample.setIndex(new NonNegativeInteger(well.sizeOfWellSampleList()));
well.addWellSample(qSample);