use of ome.xml.model.Channel in project bioformats by openmicroscopy.
the class PumpWithLightSourceSettingsTest method setUp.
@BeforeClass
public void setUp() throws Exception {
Instrument instrument = new Instrument();
instrument.setID("Instrument:0");
// Add a Laser with an Arc pump
Laser laser = new Laser();
laser.setID("Laser:0");
Arc pump = new Arc();
pump.setID("Arc:0");
laser.linkPump(pump);
instrument.addLightSource(laser);
instrument.addLightSource(pump);
ome.addInstrument(instrument);
// Add an Image/Pixels with a LightSourceSettings reference to the Pump
// on one of its channels.
Image image = new Image();
image.setID("Image:0");
Pixels pixels = new Pixels();
pixels.setID("Pixels:0");
Channel channel = new Channel();
channel.setID("Channel:0");
LightSourceSettings settings = new LightSourceSettings();
settings.setID("Arc:0");
channel.setLightSourceSettings(settings);
pixels.addChannel(channel);
image.setPixels(pixels);
ome.addImage(image);
}
use of ome.xml.model.Channel in project bioformats by openmicroscopy.
the class GenericExcitationMapTest method setUp.
@BeforeClass
public void setUp() throws Exception {
Instrument instrument = new Instrument();
instrument.setID("Instrument:0");
// Add a GenericExcitationSource with an Map
GenericExcitationSource geSource = new GenericExcitationSource();
geSource.setID("LightSource:0");
List<MapPair> dataMap = new ArrayList<MapPair>();
dataMap.add(new MapPair("a", "1"));
dataMap.add(new MapPair("d", "2"));
dataMap.add(new MapPair("c", "3"));
dataMap.add(new MapPair("b", "4"));
dataMap.add(new MapPair("e", "5"));
dataMap.add(new MapPair("c", "6"));
assertEquals(6, dataMap.size());
geSource.setMap(dataMap);
instrument.addLightSource(geSource);
ome.addInstrument(instrument);
// Add an Image/Pixels with a LightSourceSettings reference to the
// GenericExcitationSource on one of its channels.
Image image = new Image();
image.setID("Image:0");
Pixels pixels = new Pixels();
pixels.setID("Pixels:0");
Channel channel = new Channel();
channel.setID("Channel:0");
LightSourceSettings settings = new LightSourceSettings();
settings.setID("LightSource:0");
channel.setLightSourceSettings(settings);
pixels.addChannel(channel);
image.setPixels(pixels);
ome.addImage(image);
}
use of ome.xml.model.Channel in project bioformats by openmicroscopy.
the class InOutCurrentTest method testValidChannelAnnotation.
@Test(dependsOnMethods = { "testValidChannelNode" })
public void testValidChannelAnnotation() {
Channel c = ome.getImage(0).getPixels().getChannel(0);
Annotation n = c.getLinkedAnnotation(0);
assertNotNull(n);
assertTrue(n instanceof XMLAnnotation);
assertEquals(CHANNEL_ANNOTATION_ID, n.getID());
assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
assertEquals(CHANNEL_ANNOTATION_VALUE, ((XMLAnnotation) n).getValue());
}
use of ome.xml.model.Channel in project bioformats by openmicroscopy.
the class InOutCurrentTest method testValidChannelNode.
@Test(dependsOnMethods = { "testValidPixelsNode" })
public void testValidChannelNode() {
Pixels pixels = ome.getImage(0).getPixels();
assertEquals(3, pixels.sizeOfChannelList());
for (Channel channel : pixels.copyChannelList()) {
assertNotNull(channel.getID());
}
}
use of ome.xml.model.Channel in project bioformats by openmicroscopy.
the class Upgrade200909Test method validateUpgrade.
@Test
public void validateUpgrade() throws ServiceException {
assertEquals(1, ome.sizeOfImageList());
Image image = ome.getImage(0);
Pixels pixels = image.getPixels();
assertNotNull(pixels);
assertEquals(1, pixels.sizeOfChannelList());
Channel channel = pixels.getChannel(0);
// XSLT transform of Channel.AcquisitionMode
// <map from="LaserScanningMicroscopy" to="LaserScanningConfocalMicroscopy"/>
assertEquals(AcquisitionMode.LASERSCANNINGCONFOCALMICROSCOPY, channel.getAcquisitionMode());
}
Aggregations