/** * Creates a channel. * * @param index The index in the file. * @return See above. */ public Channel createChannel(int index) { Channel channel = new Channel(); channel.setID("Channel:"+index); channel.setAcquisitionMode(AcquisitionMode.FLUORESCENCELIFETIME); int argb = DEFAULT_COLOR.getRGB(); int rgba = (argb << 8) | (argb >>> (32-8)); channel.setColor(new ome.xml.model.primitives.Color(rgba)); channel.setName("Name"); channel.setIlluminationType(IlluminationType.OBLIQUE); channel.setPinholeSize(new Length(0.5, UNITS.MICROMETER)); channel.setContrastMethod(ContrastMethod.BRIGHTFIELD); PositiveFloat emWave = new PositiveFloat(300.3); channel.setEmissionWavelength(new Length(emWave.getValue(), UNITS.NANOMETER)); PositiveFloat exWave = new PositiveFloat(400.3); channel.setExcitationWavelength(new Length(exWave.getValue(), UNITS.NANOMETER)); channel.setFluor("Fluor"); channel.setNDFilter(1.0); channel.setPockelCellSetting(0); return channel; }
@Test (groups = {"11-06-u-image"}, dependsOnMethods = {"testPixels0"}) public void testChannel2() { Assert.assertNotNull(pixels0); channel2 = pixels0.getChannel(2); Assert.assertEquals(ref.Image0Pixels0_0Channel2AcquisitionMode, channel2.getAcquisitionMode()); Assert.assertEquals(ref.Image0Pixels0_0Channel2Color, channel2.getColor()); Assert.assertNull(channel2.getContrastMethod()); Assert.assertNull(channel2.getDetectorSettings()); Assert.assertNull(channel2.getEmissionWavelength()); Assert.assertNull(channel2.getExcitationWavelength()); Assert.assertNull(channel2.getFluor()); Assert.assertNull(channel2.getIlluminationType()); Assert.assertNull(channel2.getLightPath()); Assert.assertNull(channel2.getLightSourceSettings()); Assert.assertNull(channel2.getName()); Assert.assertNull(channel2.getNDFilter()); Assert.assertNull(channel2.getPinholeSize()); Assert.assertNull(channel2.getPockelCellSetting()); Assert.assertNull(channel2.getSamplesPerPixel()); }
unitSymbol = getPinholeSizeUnitXsdDefault(); setPinholeSize(UnitsLengthEnumHandler.getQuantity(baseValue, modelUnit)); setName(String.valueOf( element.getAttribute("Name"))); setAcquisitionMode(AcquisitionMode.fromString( element.getAttribute("AcquisitionMode"))); setColor(Color.valueOf( element.getAttribute("Color"))); setContrastMethod(ContrastMethod.fromString( element.getAttribute("ContrastMethod"))); unitSymbol = getExcitationWavelengthUnitXsdDefault(); setExcitationWavelength(UnitsLengthEnumHandler.getQuantity(baseValue, modelUnit)); setIlluminationType(IlluminationType.fromString( element.getAttribute("IlluminationType"))); setFluor(String.valueOf( element.getAttribute("Fluor"))); setPockelCellSetting(Integer.valueOf( element.getAttribute("PockelCellSetting")));
public void setDetectorSettingsIntegration(PositiveInteger integration, int imageIndex, int channelIndex) { // Parents: {u'Channel': {u'Pixels': {u'Image': {u'OME': None}}}} // Integration is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); if (o3.getDetectorSettings() == null) { o3.setDetectorSettings(new DetectorSettings()); } DetectorSettings o4 = o3.getDetectorSettings(); o4.setIntegration(integration); }
public void setChannelLightSourceSettingsWavelength(Length wavelength, int imageIndex, int channelIndex) { // Parents: {u'Channel': {u'Pixels': {u'Image': {u'OME': None}}}, u'MicrobeamManipulation': {u'Experiment': {u'OME': None}}} // Wavelength is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); if (o3.getLightSourceSettings() == null) { o3.setLightSourceSettings(new LightSourceSettings()); } LightSourceSettings o4 = o3.getLightSourceSettings(); o4.setWavelength(wavelength); }
public void setChannelID(String id, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // ID is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); model.addModelObject(id, o3); o3.setID(id); if (o3.getLightPath() == null) { o3.setLightPath(new LightPath()); } }
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);
Channel channel = new Channel(); channel.setID("Channel:" + i); channel.setLightSourceSettings(settings); channel.setLightPath(lightPath); pixels.addChannel(channel);
for (int i = 0; i < SIZE_C; i++) { channel = createChannel(i); channel.setID("Channel:" + index + ":" + i); if (metadata) { if (j == n) j = 0; channel.setLightSourceSettings(createLightSourceSettings(j)); channel.setLightPath(createLightPath()); channel.setDetectorSettings(ds); j++;
@Test (enabled=false, groups = {"11-06-i-links"}, dependsOnGroups = {"11-06-i-image", "11-06-i-detector"}) public void testChannel0ToDetectorLinkage() { Assert.assertNotNull(channel0); DetectorSettings detectorSettings = channel0.getDetectorSettings(); Assert.assertNotNull(detectorSettings); Assert.assertNotNull(detectorSettings.getDetector()); Assert.assertEquals(detector0, detectorSettings.getDetector()); }
public void setChannelColor(Color color, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // Color is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setColor(color); }
public void setChannelEmissionWavelength(Length emissionWavelength, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // EmissionWavelength is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setEmissionWavelength(emissionWavelength); }
public void setChannelExcitationWavelength(Length excitationWavelength, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // ExcitationWavelength is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setExcitationWavelength(excitationWavelength); }
public void setChannelPinholeSize(Length pinholeSize, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // PinholeSize is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setPinholeSize(pinholeSize); }
public void setChannelPockelCellSetting(Integer pockelCellSetting, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // PockelCellSetting is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setPockelCellSetting(pockelCellSetting); }
public void setChannelContrastMethod(ContrastMethod contrastMethod, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // ContrastMethod is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setContrastMethod(contrastMethod); }
public void setChannelFluor(String fluor, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // Fluor is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setFluor(fluor); }
public void setChannelAcquisitionMode(AcquisitionMode acquisitionMode, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // AcquisitionMode is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setAcquisitionMode(acquisitionMode); }
public void setChannelNDFilter(Double ndFilter, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // NDFilter is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setNDFilter(ndFilter); }
public void setChannelIlluminationType(IlluminationType illuminationType, int imageIndex, int channelIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // IlluminationType is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); if (o2.sizeOfChannelList() == channelIndex) { o2.addChannel(new Channel()); } Channel o3 = o2.getChannel(channelIndex); o3.setIlluminationType(illuminationType); }