Search in sources :

Example 1 with LightEmittingDiode

use of ome.xml.model.LightEmittingDiode in project bioformats by openmicroscopy.

the class InOutCurrentTest method testValidLightEmittingDiodeAnnotation.

@Test(dependsOnMethods = { "testValidLightEmittingDiodeNode" }, enabled = false)
public void testValidLightEmittingDiodeAnnotation() {
    LightEmittingDiode led = (LightEmittingDiode) ome.getInstrument(0).getLightSource(4);
    Annotation n = led.getLinkedAnnotation(0);
    assertNotNull(n);
    assertEquals(LIGHTSOURCE_LED_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertTrue(n instanceof CommentAnnotation);
    CommentAnnotation string = (CommentAnnotation) n;
    assertEquals(LIGHTSOURCE_LED_ANNOTATION_VALUE, string.getValue());
}
Also used : LightEmittingDiode(ome.xml.model.LightEmittingDiode) CommentAnnotation(ome.xml.model.CommentAnnotation) 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 2 with LightEmittingDiode

use of ome.xml.model.LightEmittingDiode in project bioformats by openmicroscopy.

the class SPWModelMock method makeInstrument.

private Instrument makeInstrument(boolean makeLightSources) {
    // Create <Instrument/>
    Instrument instrument = new Instrument();
    instrument.setID(INSTRUMENT_ID);
    // Create <Detector/> under <Instrument/>
    Detector detector = new Detector();
    detector.setID(DETECTOR_ID);
    detector.setModel(DETECTOR_MODEL);
    instrument.addDetector(detector);
    if (makeLightSources) {
        // Create <Laser/> under <Instrument/>
        Laser laser = new Laser();
        laser.setID(LIGHTSOURCE_LASER_ID);
        laser.setModel(LIGHTSOURCE_LASER_MODEL);
        laser.setType(LASER_TYPE);
        laser.setPower(new Power(LIGHTSOURCE_LASER_POWER, UNITS.MILLIWATT));
        // with a <Pump/>
        Laser laserPump = new Laser();
        laserPump.setID(LIGHTSOURCE_PUMP_ID);
        laserPump.setModel(LIGHTSOURCE_PUMP_MODEL);
        laserPump.setType(LASER_TYPE);
        laserPump.setPower(new Power(LIGHTSOURCE_PUMP_POWER, UNITS.MILLIWATT));
        laser.linkPump(laserPump);
        instrument.addLightSource(laser);
        instrument.addLightSource(laserPump);
        // Create <Arc/> under <Instrument/>
        Arc arc = new Arc();
        arc.setID(LIGHTSOURCE_ARC_ID);
        arc.setModel(LIGHTSOURCE_ARC_MODEL);
        arc.setType(ARC_TYPE);
        arc.setPower(new Power(LIGHTSOURCE_ARC_POWER, UNITS.MILLIWATT));
        instrument.addLightSource(arc);
        // Create <Filament/> under <Instrument/>
        Filament filament = new Filament();
        filament.setID(LIGHTSOURCE_FILAMENT_ID);
        filament.setModel(LIGHTSOURCE_FILAMENT_MODEL);
        filament.setType(FILAMENT_TYPE);
        filament.setPower(new Power(LIGHTSOURCE_FILAMENT_POWER, UNITS.MILLIWATT));
        instrument.addLightSource(filament);
        // Create <LightEmittingDiode/> under <Instrument/>
        LightEmittingDiode led = new LightEmittingDiode();
        led.setID(LIGHTSOURCE_LED_ID);
        led.setModel(LIGHTSOURCE_LED_MODEL);
        led.setPower(new Power(LIGHTSOURCE_LED_POWER, UNITS.MILLIWATT));
        instrument.addLightSource(led);
    }
    // Create <Dichroic/> under <Instrument/>
    Dichroic dichroic = new Dichroic();
    dichroic.setID(DICHROIC_ID);
    dichroic.setSerialNumber(DICHROIC_SN);
    // Create <FilterSet/> under <Dichroic/>
    FilterSet filterSet = new FilterSet();
    filterSet.setID(FILTERSET_ID);
    filterSet.setLotNumber(FILTERSET_LOT);
    filterSet.linkDichroic(dichroic);
    Filter emFilter = new Filter();
    Filter exFilter = new Filter();
    // Create <Objective/> under <Instrument/>
    Objective objective = new Objective();
    objective.setID(OBJECTIVE_ID);
    objective.setModel(OBJECTIVE_MODEL);
    emFilter.setID(EM_FILTER_ID);
    emFilter.setType(EM_FILTER_TYPE);
    exFilter.setID(EX_FILTER_ID);
    exFilter.setType(EX_FILTER_TYPE);
    instrument.addFilter(emFilter);
    instrument.addFilter(exFilter);
    instrument.addObjective(objective);
    filterSet.linkEmissionFilter(emFilter);
    filterSet.linkExcitationFilter(exFilter);
    filterSet.linkDichroic(dichroic);
    instrument.addFilterSet(filterSet);
    instrument.addDichroic(dichroic);
    return instrument;
}
Also used : LightEmittingDiode(ome.xml.model.LightEmittingDiode) Objective(ome.xml.model.Objective) Detector(ome.xml.model.Detector) Arc(ome.xml.model.Arc) Filament(ome.xml.model.Filament) FilterSet(ome.xml.model.FilterSet) Filter(ome.xml.model.Filter) Laser(ome.xml.model.Laser) Instrument(ome.xml.model.Instrument) Dichroic(ome.xml.model.Dichroic) Power(ome.units.quantity.Power)

Example 3 with LightEmittingDiode

use of ome.xml.model.LightEmittingDiode in project bioformats by openmicroscopy.

the class GetLightSourceTypeTest method setUp.

@BeforeClass
public void setUp() throws Exception {
    metadata = new OMEXMLMetadataImpl();
    OMEXMLMetadataRoot ome = new OMEXMLMetadataRoot();
    Instrument instrument = new Instrument();
    instrument.addLightSource(new Arc());
    instrument.addLightSource(new Filament());
    instrument.addLightSource(new Laser());
    instrument.addLightSource(new LightEmittingDiode());
    ome.addInstrument(instrument);
    metadata.setRoot(ome);
}
Also used : LightEmittingDiode(ome.xml.model.LightEmittingDiode) Arc(ome.xml.model.Arc) Filament(ome.xml.model.Filament) OMEXMLMetadataRoot(ome.xml.meta.OMEXMLMetadataRoot) Laser(ome.xml.model.Laser) Instrument(ome.xml.model.Instrument) OMEXMLMetadataImpl(loci.formats.ome.OMEXMLMetadataImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with LightEmittingDiode

use of ome.xml.model.LightEmittingDiode in project bioformats by openmicroscopy.

the class InOutCurrentTest method testValidLightEmittingDiodeNode.

// Create <LightEmittingDiode/> under <Instrument/>
@Test(dependsOnMethods = { "testValidInstrumentNode" }, enabled = false)
public void testValidLightEmittingDiodeNode() {
    LightEmittingDiode led = (LightEmittingDiode) ome.getInstrument(0).getLightSource(4);
    assertNotNull(led);
    assertEquals(LIGHTSOURCE_LED_ID, led.getID());
    assertEquals(LIGHTSOURCE_LED_MODEL, led.getModel());
    assertEquals(LIGHTSOURCE_LED_POWER, led.getPower().value(UNITS.MILLIWATT).doubleValue());
}
Also used : LightEmittingDiode(ome.xml.model.LightEmittingDiode) Test(org.testng.annotations.Test)

Example 5 with LightEmittingDiode

use of ome.xml.model.LightEmittingDiode in project bioformats by openmicroscopy.

the class ObjectBasedOMEModelMock method makeInstrument.

private Instrument makeInstrument() {
    // Create <Instrument/>
    Instrument instrument = new Instrument();
    instrument.setID(InOutCurrentTest.INSTRUMENT_ID);
    // Create <Detector/> under <Instrument/>
    Detector detector = new Detector();
    detector.setID(InOutCurrentTest.DETECTOR_ID);
    detector.setModel(InOutCurrentTest.DETECTOR_MODEL);
    CommentAnnotation detectorAnnotation = new CommentAnnotation();
    detectorAnnotation.setID(InOutCurrentTest.DETECTOR_ANNOTATION_ID);
    detectorAnnotation.setValue(InOutCurrentTest.DETECTOR_ANNOTATION_VALUE);
    detectorAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    detector.linkAnnotation(detectorAnnotation);
    annotations.addCommentAnnotation(detectorAnnotation);
    instrument.addDetector(detector);
    // Create <Laser/> under <Instrument/>
    Laser laser = new Laser();
    laser.setID(InOutCurrentTest.LIGHTSOURCE_LASER_ID);
    laser.setModel(InOutCurrentTest.LIGHTSOURCE_LASER_MODEL);
    laser.setType(InOutCurrentTest.LASER_TYPE);
    laser.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_LASER_POWER, UNITS.MILLIWATT));
    CommentAnnotation laserAnnotation = new CommentAnnotation();
    laserAnnotation.setID(InOutCurrentTest.LIGHTSOURCE_LASER_ANNOTATION_ID);
    laserAnnotation.setValue(InOutCurrentTest.LIGHTSOURCE_LASER_ANNOTATION_VALUE);
    laserAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    laser.linkAnnotation(laserAnnotation);
    annotations.addCommentAnnotation(laserAnnotation);
    // with a <Pump/>
    Laser laserPump = new Laser();
    laserPump.setID(InOutCurrentTest.LIGHTSOURCE_PUMP_ID);
    laserPump.setModel(InOutCurrentTest.LIGHTSOURCE_PUMP_MODEL);
    laserPump.setType(InOutCurrentTest.LASER_TYPE);
    laserPump.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_PUMP_POWER, UNITS.MILLIWATT));
    laser.linkPump(laserPump);
    instrument.addLightSource(laser);
    instrument.addLightSource(laserPump);
    // Create <Arc/> under <Instrument/>
    Arc arc = new Arc();
    arc.setID(InOutCurrentTest.LIGHTSOURCE_ARC_ID);
    arc.setModel(InOutCurrentTest.LIGHTSOURCE_ARC_MODEL);
    arc.setType(InOutCurrentTest.ARC_TYPE);
    arc.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_ARC_POWER, UNITS.MILLIWATT));
    CommentAnnotation arcAnnotation = new CommentAnnotation();
    arcAnnotation.setID(InOutCurrentTest.LIGHTSOURCE_ARC_ANNOTATION_ID);
    arcAnnotation.setValue(InOutCurrentTest.LIGHTSOURCE_ARC_ANNOTATION_VALUE);
    arcAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    arc.linkAnnotation(arcAnnotation);
    annotations.addCommentAnnotation(arcAnnotation);
    instrument.addLightSource(arc);
    // Create <Filament/> under <Instrument/>
    Filament filament = new Filament();
    filament.setID(InOutCurrentTest.LIGHTSOURCE_FILAMENT_ID);
    filament.setModel(InOutCurrentTest.LIGHTSOURCE_FILAMENT_MODEL);
    filament.setType(InOutCurrentTest.FILAMENT_TYPE);
    filament.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_FILAMENT_POWER, UNITS.MILLIWATT));
    CommentAnnotation filamentAnnotation = new CommentAnnotation();
    filamentAnnotation.setID(InOutCurrentTest.LIGHTSOURCE_FILAMENT_ANNOTATION_ID);
    filamentAnnotation.setValue(InOutCurrentTest.LIGHTSOURCE_FILAMENT_ANNOTATION_VALUE);
    filamentAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    filament.linkAnnotation(filamentAnnotation);
    annotations.addCommentAnnotation(filamentAnnotation);
    instrument.addLightSource(filament);
    // Create <LightEmittingDiode/> under <Instrument/>
    LightEmittingDiode led = new LightEmittingDiode();
    led.setID(InOutCurrentTest.LIGHTSOURCE_LED_ID);
    led.setModel(InOutCurrentTest.LIGHTSOURCE_LED_MODEL);
    led.setPower(new Power(InOutCurrentTest.LIGHTSOURCE_LED_POWER, UNITS.MILLIWATT));
    CommentAnnotation ledAnnotation = new CommentAnnotation();
    ledAnnotation.setID(InOutCurrentTest.LIGHTSOURCE_LED_ANNOTATION_ID);
    ledAnnotation.setValue(InOutCurrentTest.LIGHTSOURCE_LED_ANNOTATION_VALUE);
    ledAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    led.linkAnnotation(ledAnnotation);
    annotations.addCommentAnnotation(ledAnnotation);
    instrument.addLightSource(led);
    // Create <Dichroic/> under <Instrument/>
    Dichroic dichroic = new Dichroic();
    dichroic.setID(InOutCurrentTest.DICHROIC_ID);
    dichroic.setSerialNumber(InOutCurrentTest.DICHROIC_SN);
    CommentAnnotation dichroicAnnotation = new CommentAnnotation();
    dichroicAnnotation.setID(InOutCurrentTest.DICHROIC_ANNOTATION_ID);
    dichroicAnnotation.setValue(InOutCurrentTest.DICHROIC_ANNOTATION_VALUE);
    dichroicAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    dichroic.linkAnnotation(dichroicAnnotation);
    annotations.addCommentAnnotation(dichroicAnnotation);
    // Create <FilterSet/> under <Dichroic/>
    FilterSet filterSet = new FilterSet();
    filterSet.setID(InOutCurrentTest.FILTERSET_ID);
    filterSet.setLotNumber(InOutCurrentTest.FILTERSET_LOT);
    filterSet.linkDichroic(dichroic);
    Filter emFilter = new Filter();
    Filter exFilter = new Filter();
    // Create <Objective/> under <Instrument/>
    Objective objective = new Objective();
    objective.setID(InOutCurrentTest.OBJECTIVE_ID);
    objective.setModel(InOutCurrentTest.OBJECTIVE_MODEL);
    CommentAnnotation objectiveAnnotation = new CommentAnnotation();
    objectiveAnnotation.setID(InOutCurrentTest.OBJECTIVE_ANNOTATION_ID);
    objectiveAnnotation.setValue(InOutCurrentTest.OBJECTIVE_ANNOTATION_VALUE);
    objectiveAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    objective.linkAnnotation(objectiveAnnotation);
    annotations.addCommentAnnotation(objectiveAnnotation);
    emFilter.setID(InOutCurrentTest.EM_FILTER_ID);
    emFilter.setType(InOutCurrentTest.EM_FILTER_TYPE);
    exFilter.setID(InOutCurrentTest.EX_FILTER_ID);
    exFilter.setType(InOutCurrentTest.EX_FILTER_TYPE);
    CommentAnnotation emFilterAnnotation = new CommentAnnotation();
    emFilterAnnotation.setID(InOutCurrentTest.EM_FILTER_ANNOTATION_ID);
    emFilterAnnotation.setValue(InOutCurrentTest.EM_FILTER_ANNOTATION_VALUE);
    emFilterAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    emFilter.linkAnnotation(emFilterAnnotation);
    annotations.addCommentAnnotation(emFilterAnnotation);
    instrument.addFilter(emFilter);
    instrument.addFilter(exFilter);
    instrument.addObjective(objective);
    filterSet.linkEmissionFilter(emFilter);
    filterSet.linkExcitationFilter(exFilter);
    filterSet.linkDichroic(dichroic);
    instrument.addFilterSet(filterSet);
    instrument.addDichroic(dichroic);
    CommentAnnotation instrumentAnnotation = new CommentAnnotation();
    instrumentAnnotation.setID(InOutCurrentTest.INSTRUMENT_ANNOTATION_ID);
    instrumentAnnotation.setValue(InOutCurrentTest.INSTRUMENT_ANNOTATION_VALUE);
    instrumentAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    instrument.linkAnnotation(instrumentAnnotation);
    annotations.addCommentAnnotation(instrumentAnnotation);
    // link Instrument to the first Image
    Image image = ome.getImage(0);
    image.linkInstrument(instrument);
    return instrument;
}
Also used : LightEmittingDiode(ome.xml.model.LightEmittingDiode) Filament(ome.xml.model.Filament) FilterSet(ome.xml.model.FilterSet) Image(ome.xml.model.Image) Objective(ome.xml.model.Objective) Detector(ome.xml.model.Detector) Arc(ome.xml.model.Arc) Filter(ome.xml.model.Filter) CommentAnnotation(ome.xml.model.CommentAnnotation) Laser(ome.xml.model.Laser) Instrument(ome.xml.model.Instrument) Dichroic(ome.xml.model.Dichroic) Power(ome.units.quantity.Power)

Aggregations

LightEmittingDiode (ome.xml.model.LightEmittingDiode)5 Arc (ome.xml.model.Arc)3 Filament (ome.xml.model.Filament)3 Instrument (ome.xml.model.Instrument)3 Laser (ome.xml.model.Laser)3 Power (ome.units.quantity.Power)2 CommentAnnotation (ome.xml.model.CommentAnnotation)2 Detector (ome.xml.model.Detector)2 Dichroic (ome.xml.model.Dichroic)2 Filter (ome.xml.model.Filter)2 FilterSet (ome.xml.model.FilterSet)2 Objective (ome.xml.model.Objective)2 Test (org.testng.annotations.Test)2 OMEXMLMetadataImpl (loci.formats.ome.OMEXMLMetadataImpl)1 OMEXMLMetadataRoot (ome.xml.meta.OMEXMLMetadataRoot)1 Annotation (ome.xml.model.Annotation)1 BooleanAnnotation (ome.xml.model.BooleanAnnotation)1 Image (ome.xml.model.Image)1 ListAnnotation (ome.xml.model.ListAnnotation)1 LongAnnotation (ome.xml.model.LongAnnotation)1