Search in sources :

Example 6 with Channel

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);
}
Also used : LightSourceSettings(ome.xml.model.LightSourceSettings) Arc(ome.xml.model.Arc) Laser(ome.xml.model.Laser) Channel(ome.xml.model.Channel) Instrument(ome.xml.model.Instrument) Image(ome.xml.model.Image) Pixels(ome.xml.model.Pixels) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with Channel

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);
}
Also used : MapPair(ome.xml.model.MapPair) LightSourceSettings(ome.xml.model.LightSourceSettings) GenericExcitationSource(ome.xml.model.GenericExcitationSource) Channel(ome.xml.model.Channel) Instrument(ome.xml.model.Instrument) ArrayList(java.util.ArrayList) Image(ome.xml.model.Image) Pixels(ome.xml.model.Pixels) BeforeClass(org.testng.annotations.BeforeClass)

Example 8 with Channel

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());
}
Also used : Channel(ome.xml.model.Channel) XMLAnnotation(ome.xml.model.XMLAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Example 9 with Channel

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());
    }
}
Also used : Channel(ome.xml.model.Channel) Pixels(ome.xml.model.Pixels) Test(org.testng.annotations.Test)

Example 10 with Channel

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());
}
Also used : Channel(ome.xml.model.Channel) Image(ome.xml.model.Image) Pixels(ome.xml.model.Pixels) Test(org.testng.annotations.Test)

Aggregations

Channel (ome.xml.model.Channel)11 Pixels (ome.xml.model.Pixels)10 Image (ome.xml.model.Image)8 PositiveInteger (ome.xml.model.primitives.PositiveInteger)4 Test (org.testng.annotations.Test)4 Instrument (ome.xml.model.Instrument)3 LightSourceSettings (ome.xml.model.LightSourceSettings)3 XMLAnnotation (ome.xml.model.XMLAnnotation)3 ArrayList (java.util.ArrayList)2 OMEXMLMetadataRoot (ome.xml.meta.OMEXMLMetadataRoot)2 Annotation (ome.xml.model.Annotation)2 BinData (ome.xml.model.BinData)2 BooleanAnnotation (ome.xml.model.BooleanAnnotation)2 CommentAnnotation (ome.xml.model.CommentAnnotation)2 ListAnnotation (ome.xml.model.ListAnnotation)2 NonNegativeLong (ome.xml.model.primitives.NonNegativeLong)2 BeforeClass (org.testng.annotations.BeforeClass)2 File (java.io.File)1 Enumeration (java.util.Enumeration)1 HashSet (java.util.HashSet)1