Instrument instrument = new Instrument(); instrument.setID("Instrument:"+index); instrument.setMicroscope(createMicroscope()); if (populate) { for (int i = 0; i < NUMBER_OF_OBJECTIVES; i++) { instrument.addObjective(createObjective(i)); instrument.addDetector(createDetector(i)); instrument.addFilterSet(createFilterSet(index)); for (int i = 0; i < NUMBER_OF_FILTERS; i++) { instrument.addFilter(createFilter(i, CUT_IN, CUT_OUT)); instrument.addDichroic(createDichroic(i)); instrument.addLightSource(createLightSource(LIGHT_SOURCES[i], i));
public void setDichroicManufacturer(String manufacturer, int instrumentIndex, int dichroicIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDichroicList() == dichroicIndex) { o1.addDichroic(new Dichroic()); } Dichroic o2 = o1.getDichroic(dichroicIndex); o2.setManufacturer(manufacturer); }
public void setFilterManufacturer(String manufacturer, int instrumentIndex, int filterIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfFilterList() == filterIndex) { o1.addFilter(new Filter()); } Filter o2 = o1.getFilter(filterIndex); o2.setManufacturer(manufacturer); }
final Instrument ocarina = new Instrument(); // Since our Instruments are strongly-typed, we can provide mutators that only take // specific types, such as Strings, ParseUsers, or enum types. ocarina.setType(InstrumentType.WOODWIND);
Instrument a = new Instrument(...); Instrument b = new Instrument(...); Instrument c = new Instrument(...); Instrument d = new Instrument(...); System.out.println(c.getNum()); // prints 3, num of "c" instrument System.out.println(Instrument.getID()); // prints 4 (total of instruments)
Instrument instrument = new Instrument(); instrument.setMyPropOne("val1"); // set other values ObjectMapper mapper = new ObjectMapper(); // configure mapper if needed mapper.writeValueAsString(instrument);
public void setDetectorManufacturer(String manufacturer, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setManufacturer(manufacturer); }
if (!element.hasAttribute("ID") && getID() == null) setID(String.valueOf( element.getAttribute("ID"))); model.addModelObject(getID(), this); getChildrenByTagName(element, "Microscope"); if (Microscope_nodeList.size() > 1) setMicroscope(new Microscope( (Element) Microscope_nodeList.get(0), model)); getChildrenByTagName(element, "Arc"); for (Element Arc_element : Arc_nodeList) addLightSource( new Arc(Arc_element, model)); getChildrenByTagName(element, "Filament"); for (Element Filament_element : Filament_nodeList) addLightSource( new Filament(Filament_element, model)); getChildrenByTagName(element, "GenericExcitationSource"); for (Element GenericExcitationSource_element : GenericExcitationSource_nodeList) addLightSource(
/** Sets the Map value associated with this generic light source */ public void setGenericExcitationSourceMap(List<MapPair> map, int instrumentIndex, int lightSourceIndex) { OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new GenericExcitationSource()); } LightSource o2 = o1.getLightSource(lightSourceIndex); ((GenericExcitationSource)o2).setMap(map); }
public void setObjectiveCalibratedMagnification(Double calibratedMagnification, int instrumentIndex, int objectiveIndex) { // Parents: {u'Instrument': {u'OME': None}} // CalibratedMagnification is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfObjectiveList() == objectiveIndex) { o1.addObjective(new Objective()); } Objective o2 = o1.getObjective(objectiveIndex); o2.setCalibratedMagnification(calibratedMagnification); }
public void setFilterSetManufacturer(String manufacturer, int instrumentIndex, int filterSetIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfFilterSetList() == filterSetIndex) { o1.addFilterSet(new FilterSet()); } FilterSet o2 = o1.getFilterSet(filterSetIndex); o2.setManufacturer(manufacturer); }
@BeforeClass public void setUp() throws Exception { Instrument instrument = new Instrument(); instrument.setID("Instrument:0"); geSource.setMap(dataMap); instrument.addLightSource(geSource); ome.addInstrument(instrument);
public String getDichroicLotNumber(int instrumentIndex, int dichroicIndex) { // Parents: {u'Instrument': {u'OME': None}} // LotNumber is not a reference return root.getInstrument(instrumentIndex).getDichroic(dichroicIndex).getLotNumber(); }
public String getFilterLotNumber(int instrumentIndex, int filterIndex) { // Parents: {u'Instrument': {u'OME': None}} // LotNumber is not a reference return root.getInstrument(instrumentIndex).getFilter(filterIndex).getLotNumber(); }
public void setInstrumentID(String id, int instrumentIndex) { // Parents: {u'OME': None} // ID is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); model.addModelObject(id, o1); o1.setID(id); }
@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); }
@Test(dependsOnMethods={"testValidFilterSetNode"}) public void testValidEmissionFilterNode() { Filter emFilter = ome.getInstrument(0).getFilter(0); assertNotNull(emFilter); assertEquals(EM_FILTER_ID, emFilter.getID()); assertEquals(EM_FILTER_TYPE, emFilter.getType()); FilterSet filterSet = ome.getInstrument(0).getDichroic(0).getLinkedFilterSet(0); assertEquals(EM_FILTER_ID, filterSet.getLinkedEmissionFilter(0).getID()); }
public void setDetectorManufacturer(String manufacturer, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setManufacturer(manufacturer); }
if (!element.hasAttribute("ID") && getID() == null) setID(String.valueOf( element.getAttribute("ID"))); model.addModelObject(getID(), this); getChildrenByTagName(element, "Microscope"); if (Microscope_nodeList.size() > 1) setMicroscope(new Microscope( (Element) Microscope_nodeList.get(0), model)); getChildrenByTagName(element, "Arc"); for (Element Arc_element : Arc_nodeList) addLightSource( new Arc(Arc_element, model)); getChildrenByTagName(element, "Filament"); for (Element Filament_element : Filament_nodeList) addLightSource( new Filament(Filament_element, model)); getChildrenByTagName(element, "GenericExcitationSource"); for (Element GenericExcitationSource_element : GenericExcitationSource_nodeList) addLightSource(
/** Sets the Map value associated with this generic light source */ public void setGenericExcitationSourceMap(List<MapPair> map, int instrumentIndex, int lightSourceIndex) { OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfLightSourceList() == lightSourceIndex) { o1.addLightSource(new GenericExcitationSource()); } LightSource o2 = o1.getLightSource(lightSourceIndex); ((GenericExcitationSource)o2).setMap(map); }