use of ome.xml.model.LightPath in project bioformats by openmicroscopy.
the class Schema2011_06_Instrument_Upgrade_Test method testChannel0LightpathLinkage.
@Test(groups = { "11-06-i-links" }, dependsOnGroups = { "11-06-i-image", "11-06-i-filter" })
public void testChannel0LightpathLinkage() {
Assert.assertNotNull(channel0);
LightPath lightpath = channel0.getLightPath();
Assert.assertNotNull(lightpath);
Assert.assertEquals(1, lightpath.sizeOfLinkedExcitationFilterList());
Assert.assertEquals(filter3, lightpath.getLinkedExcitationFilter(0));
Assert.assertNull(lightpath.getLinkedDichroic());
Assert.assertEquals(1, lightpath.sizeOfLinkedEmissionFilterList());
Assert.assertEquals(filter2, lightpath.getLinkedEmissionFilter(0));
}
use of ome.xml.model.LightPath in project bioformats by openmicroscopy.
the class SPWModelMock method makeImage.
private Image makeImage(int index) {
// <Instrument/> for later linking, etc.
Instrument instrument = ome.getInstrument(0);
// Create <Image/>
Image image = new Image();
image.setID("Image:" + index);
CommentAnnotation commentAnnotation = new CommentAnnotation();
commentAnnotation.setID("Annotation:" + index);
commentAnnotation.setNamespace(GENERAL_ANNOTATION_NAMESPACE);
commentAnnotation.setValue("Image:" + index + " annotation.");
annotations.addCommentAnnotation(commentAnnotation);
image.linkAnnotation(commentAnnotation);
// Create <Pixels/>
Pixels pixels = new Pixels();
pixels.setID("Pixels:" + index);
pixels.setSizeX(new PositiveInteger(SIZE_X));
pixels.setSizeY(new PositiveInteger(SIZE_Y));
pixels.setSizeZ(new PositiveInteger(SIZE_Z));
pixels.setSizeC(new PositiveInteger(SIZE_C));
pixels.setSizeT(new PositiveInteger(SIZE_T));
pixels.setDimensionOrder(DIMENSION_ORDER);
pixels.setType(PIXEL_TYPE);
// Create <BinData/>
for (int i = 0; i < SIZE_Z * SIZE_C * SIZE_T; i++) {
BinData binData = new BinData();
binData.setBigEndian(false);
binData.setCompression(Compression.NONE);
binData.setLength(new NonNegativeLong((long) (SIZE_X * SIZE_Y * BYTES_PER_PIXEL)));
pixels.addBinData(binData);
}
// Create <Channel/> under <Pixels/>
for (int i = 0; i < SIZE_C; i++) {
Channel channel = new Channel();
channel.setID("Channel:" + i);
// Create <LightSourceSettings/> and link to <Channel/>
LightSourceSettings settings = new LightSourceSettings();
settings.setID(LIGHTSOURCE_LASER_ID);
channel.setLightSourceSettings(settings);
// Create <LightPath/> and link to <Channel/>
LightPath lightPath = new LightPath();
lightPath.linkEmissionFilter(instrument.getFilter(0));
lightPath.linkExcitationFilter(instrument.getFilter(1));
channel.setLightPath(lightPath);
pixels.addChannel(channel);
}
// Put <Pixels/> under <Image/>
image.setPixels(pixels);
// Link <Instrument/> to <Image/>
image.linkInstrument(instrument);
// Create <ObjectiveSettings/> and link to <Image/>
ObjectiveSettings settings = new ObjectiveSettings();
settings.setID(OBJECTIVE_ID);
image.setObjectiveSettings(settings);
return image;
}
Aggregations