use of ome.xml.model.Plate in project bioformats by openmicroscopy.
the class FileWriteSPW method export.
/**
* Save a single byte plane of data.
* @param plane data
* @param series image no in plate
* @param index t plane within image
*/
private void export(byte[] plane, int series, int index, String imageDescription) {
Exception exception = null;
if (initializationSuccess) {
if (series != writer.getSeries()) {
try {
writer.setSeries(series);
} catch (FormatException e) {
exception = e;
}
}
try {
writer.saveBytes(index, plane);
if (index == 0) {
OMEXMLMetadataRoot root = (OMEXMLMetadataRoot) omexml.getRoot();
Plate plate = root.getPlate(0);
Image im = root.getImage(series);
im.setDescription(imageDescription);
}
expectedImages[series]++;
} catch (FormatException | IOException e) {
exception = e;
}
}
if (exception != null) {
System.err.println("Failed to write data!");
}
}
use of ome.xml.model.Plate in project bioformats by openmicroscopy.
the class BackReferenceTest method testPlateWellReferences.
@Test
public void testPlateWellReferences() {
metadata.setPlateID("Plate:0", 0);
metadata.setWellID("Well:0:0", 0, 0);
OME root = (OME) metadata.getRoot();
Plate plate = root.getPlate(0);
Well well = plate.getWell(0);
assertNotNull(plate);
assertNotNull(well);
assertEquals(plate, well.getPlate());
}
Aggregations