/** * Transforms a Java type into the corresponding OMERO RType. * * @param value Java concrete type value. * @return RType or <code>null</code> if <code>value</code> is * <code>null</code>. */ public RInt toRType(NonNegativeInteger value) { return value == null? null : rint(value.getValue()); }
/** Finds the Plane index corresponding to the given image plane number. */ private static int getPlaneIndex(IFormatReader r, int no) { MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); int imageIndex = r.getSeries(); int planeCount = retrieve.getPlaneCount(imageIndex); int[] zct = r.getZCTCoords(no); for (int i=0; i<planeCount; i++) { Integer theC = retrieve.getPlaneTheC(imageIndex, i).getValue(); Integer theT = retrieve.getPlaneTheT(imageIndex, i).getValue(); Integer theZ = retrieve.getPlaneTheZ(imageIndex, i).getValue(); if (zct[0] == theZ.intValue() && zct[1] == theC.intValue() && zct[2] == theT.intValue()) { return i; } } return -1; }
/** Finds the Plane index corresponding to the given image plane number. */ private static int getPlaneIndex(IFormatReader r, int no) { MetadataRetrieve retrieve = (MetadataRetrieve) r.getMetadataStore(); int imageIndex = r.getSeries(); int planeCount = retrieve.getPlaneCount(imageIndex); int[] zct = r.getZCTCoords(no); for (int i=0; i<planeCount; i++) { Integer theC = retrieve.getPlaneTheC(imageIndex, i).getValue(); Integer theT = retrieve.getPlaneTheT(imageIndex, i).getValue(); Integer theZ = retrieve.getPlaneTheZ(imageIndex, i).getValue(); if (zct[0] == theZ.intValue() && zct[1] == theC.intValue() && zct[2] == theT.intValue()) { return i; } } return -1; }
@Override public void setPolygonTheZ(NonNegativeInteger theZ, int ROIIndex, int shapeIndex) { Polygon o = getPolygon(ROIIndex, shapeIndex); o.setTheZ(toRType(theZ.getValue())); }
@Override public void setPolygonTheT(NonNegativeInteger theT, int ROIIndex, int shapeIndex) { Polygon o = getPolygon(ROIIndex, shapeIndex); o.setTheT(toRType(theT.getValue())); }
return new ome.units.quantity.Length(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Length(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Power(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Pressure(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Frequency(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Time(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Power(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Temperature(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Time(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.Frequency(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit));
@Test(dependsOnMethods={"testValidPlateNode"}) public void testValidWellSamples() { Plate plate = ome.getPlate(0); Integer wellSampleIndex = 0; for (int row=0; row<plate.getRows().getValue(); row++) { for (int col=0; col<plate.getColumns().getValue(); col++) { Well well = plate.getWell(row * plate.getColumns().getValue() + col); assertEquals(1, well.sizeOfWellSampleList()); WellSample sample = well.getWellSample(0); assertNotNull(sample); assertEquals(String.format("WellSample:%d_%d", row, col), sample.getID()); assertEquals(wellSampleIndex, sample.getIndex().getValue()); Image image = sample.getLinkedImage(); assertNotNull(image); assertEquals(IMAGE_ID, image.getID()); wellSampleIndex++; } } }