public void parseFile(Plate plate, String attributeName, File envisionFile) { Sheet sheet = StringTable.openWorkSheet(envisionFile).getSheetAt(0); Point tableTopLeftPos = StringTable.findNextPlatePosition(sheet, new Point(1, 1)); int numSkipTables = propTableIndex.getIntValue() - 1; while (tableTopLeftPos != null && numSkipTables > 0) { tableTopLeftPos = StringTable.findNextPlatePosition( sheet, new Point((int) tableTopLeftPos.getX(), (int) (tableTopLeftPos.getY() + 1))); numSkipTables--; } if (tableTopLeftPos == null) { throw new RuntimeException("Could not find readout-table in file " + envisionFile); } Rectangle tableBounds = StringTable.guessPlateBounds(sheet, tableTopLeftPos); StringTable envisionTable = StringTable.readStringGridFromExcel(tableBounds, sheet); // either set the plate dimensions or validate them if (plate.getNumRows() < 0) { plate.setNumColumns(envisionTable.getWidth() - 1); plate.setNumRows(envisionTable.getHeight() - 1); } else { assert envisionTable.getWidth() - 1 == plate.getNumColumns(); assert envisionTable.getHeight() - 1 == plate.getNumRows(); } for (int colIndex = 0; colIndex < plate.getNumColumns(); colIndex++) { for (int rowIndex = 0; rowIndex < plate.getNumRows(); rowIndex++) { int plateRow = rowIndex + 1; // this inversion looks weired but it is correct int plateColumn = colIndex + 1; Well well = plate.getWell(plateColumn, plateRow); if (well == null) { well = new Well(); well.setPlateRow(plateRow); well.setPlateColumn(plateColumn); well.setPlate(plate); plate.addWell(well); } Double readout = ScreenImportUtils.parseDouble(envisionTable.get(plateRow, plateColumn)); if (readout != null) { well.getWellStatistics().put(attributeName, readout); } } } }
public AvgerageZStack(List<Plate> curPlateSelection) { this.curPlateSelection = curPlateSelection; Plate avgZStack = new Plate(); avgZStack.setBarcode("avgz-stack"); for (Well well : curPlateSelection.get(0).getWells()) { Well zStackWell = new Well(); zStackWell.setPlateColumn(well.getPlateColumn()); zStackWell.setPlateRow(well.getPlateRow()); populateWell(well.getPlateColumn(), well.getPlateRow(), zStackWell); avgZStack.getWells().add(zStackWell); } PlatePanel.createPanelDialog(avgZStack, null, null); }