use of ome.xml.model.LongAnnotation in project bioformats by openmicroscopy.
the class ObjectBasedOMEModelMock method makePlate.
private Plate makePlate() {
Plate plate = new Plate();
plate.setID(InOutCurrentTest.PLATE_ID);
plate.setRows(InOutCurrentTest.WELL_ROWS);
plate.setColumns(InOutCurrentTest.WELL_COLS);
plate.setRowNamingConvention(InOutCurrentTest.WELL_ROW);
plate.setColumnNamingConvention(InOutCurrentTest.WELL_COL);
TimestampAnnotation plateAnnotation = new TimestampAnnotation();
plateAnnotation.setID(InOutCurrentTest.PLATE_ANNOTATION_ID);
plateAnnotation.setValue(new Timestamp(InOutCurrentTest.PLATE_ANNOTATION_VALUE));
plateAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
plate.linkAnnotation(plateAnnotation);
annotations.addTimestampAnnotation(plateAnnotation);
int wellSampleIndex = 0;
for (int row = 0; row < InOutCurrentTest.WELL_ROWS.getValue(); row++) {
for (int col = 0; col < InOutCurrentTest.WELL_COLS.getValue(); col++) {
Well well = new Well();
well.setID(String.format("Well:%d_%d", row, col));
well.setRow(new NonNegativeInteger(row));
well.setColumn(new NonNegativeInteger(col));
if (row == 0 && col == 0) {
LongAnnotation annotation = new LongAnnotation();
annotation.setID(InOutCurrentTest.WELL_ANNOTATION_ID);
annotation.setValue(InOutCurrentTest.WELL_ANNOTATION_VALUE);
annotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
well.linkAnnotation(annotation);
annotations.addLongAnnotation(annotation);
}
WellSample sample = new WellSample();
sample.setID(String.format("WellSample:%d_%d", row, col));
sample.setIndex(new NonNegativeInteger(wellSampleIndex));
sample.linkImage(ome.getImage(0));
well.addWellSample(sample);
plate.addWell(well);
wellSampleIndex++;
}
}
return plate;
}
use of ome.xml.model.LongAnnotation in project bioformats by openmicroscopy.
the class InOutCurrentTest method testValidWellAnnotation.
@Test(dependsOnMethods = { "testValidWellSamples" })
public void testValidWellAnnotation() {
Annotation n = ome.getPlate(0).getWell(0).getLinkedAnnotation(0);
assertNotNull(n);
assertEquals(WELL_ANNOTATION_ID, n.getID());
assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
assertTrue(n instanceof LongAnnotation);
LongAnnotation longAnnotation = (LongAnnotation) n;
assertEquals(longAnnotation.getValue(), WELL_ANNOTATION_VALUE);
}
Aggregations