private void populateROI(List<String> columns, String[] data, int series, int roi, int time, int z, MetadataStore store) { String roiID = MetadataTools.createLSID("ROI", roi, 0); store.setROIID(roiID, roi); store.setImageROIRef(roiID, series, roi); store.setEllipseID(MetadataTools.createLSID("Shape", roi, 0), roi, 0); store.setEllipseTheT(new NonNegativeInteger(time), roi, 0); store.setEllipseTheZ(new NonNegativeInteger(z), roi, 0); store.setEllipseX(new Double(data[columns.indexOf("Col")]), roi, 0); store.setEllipseY(new Double(data[columns.indexOf("Row")]), roi, 0); store.setEllipseText(data[columns.indexOf("Label")], roi, 0); double diam = Double.parseDouble(data[columns.indexOf("Cell Diam.")]); double radius = diam / 2; store.setEllipseRadiusX(radius, roi, 0); store.setEllipseRadiusY(radius, roi, 0); // NB: other attributes are "Nucleus Area", "Cell Type", and // "Mean Nucleus Intens." }
private void populateROI(List<String> columns, String[] data, int series, int roi, int time, int z, MetadataStore store) { String roiID = MetadataTools.createLSID("ROI", roi, 0); store.setROIID(roiID, roi); store.setImageROIRef(roiID, series, roi); store.setEllipseID(MetadataTools.createLSID("Shape", roi, 0), roi, 0); store.setEllipseTheT(new NonNegativeInteger(time), roi, 0); store.setEllipseTheZ(new NonNegativeInteger(z), roi, 0); store.setEllipseX(new Double(data[columns.indexOf("Col")]), roi, 0); store.setEllipseY(new Double(data[columns.indexOf("Row")]), roi, 0); store.setEllipseText(data[columns.indexOf("Label")], roi, 0); double diam = Double.parseDouble(data[columns.indexOf("Cell Diam.")]); double radius = diam / 2; store.setEllipseRadiusX(radius, roi, 0); store.setEllipseRadiusY(radius, roi, 0); // NB: other attributes are "Nucleus Area", "Cell Type", and // "Mean Nucleus Intens." }
private int populateCircles(NodeList circles, int roi, int shape) { for (int s=0; s<circles.getLength(); s++, shape++) { Element circle = (Element) circles.item(s); Element geometry = getFirstNode(circle, "Geometry"); Element textElements = getFirstNode(circle, "TextElements"); Element attributes = getFirstNode(circle, "Attributes"); store.setEllipseID( MetadataTools.createLSID("Shape", roi, shape), roi, shape); String radius = getFirstNodeValue(geometry, "Radius"); String centerX = getFirstNodeValue(geometry, "CenterX"); String centerY = getFirstNodeValue(geometry, "CenterY"); if (radius != null) { store.setEllipseRadiusX(new Double(radius), roi, shape); store.setEllipseRadiusY(new Double(radius), roi, shape); } if (centerX != null) { store.setEllipseX(new Double(centerX), roi, shape); } if (centerY != null) { store.setEllipseY(new Double(centerY), roi, shape); } store.setEllipseText(getFirstNodeValue(textElements, "Text"), roi, shape); } return shape; }
private int populateCircles(NodeList circles, int roi, int shape) { for (int s=0; s<circles.getLength(); s++, shape++) { Element circle = (Element) circles.item(s); Element geometry = getFirstNode(circle, "Geometry"); Element textElements = getFirstNode(circle, "TextElements"); Element attributes = getFirstNode(circle, "Attributes"); store.setEllipseID( MetadataTools.createLSID("Shape", roi, shape), roi, shape); String radius = getFirstNodeValue(geometry, "Radius"); String centerX = getFirstNodeValue(geometry, "CenterX"); String centerY = getFirstNodeValue(geometry, "CenterY"); if (radius != null) { store.setEllipseRadiusX(new Double(radius), roi, shape); store.setEllipseRadiusY(new Double(radius), roi, shape); } if (centerX != null) { store.setEllipseX(new Double(centerX), roi, shape); } if (centerY != null) { store.setEllipseY(new Double(centerY), roi, shape); } store.setEllipseText(getFirstNodeValue(textElements, "Text"), roi, shape); } return shape; }
case ELLIPSE: shapeID = createROI(store, nextROI); store.setEllipseID(shapeID, nextROI, 0);
break; case ELLIPSE: store.setEllipseID(shapeID, i, 0);
Element attributes = getFirstNode(ellipse, "Attributes"); store.setEllipseID( MetadataTools.createLSID("Shape", roiCount, shape), roiCount, shape);
Element attributes = getFirstNode(ellipse, "Attributes"); store.setEllipseID( MetadataTools.createLSID("Shape", roiCount, shape), roiCount, shape);
store.setEllipseID(shapeID, i, 0); store.setEllipseID(shapeID, i, 0); store.setEllipseX(centerX, i, 0); store.setEllipseY(centerY, i, 0); store.setEllipseID(shapeID, i, 0); store.setEllipseX(cx, i, 0); store.setEllipseY(cy, i, 0);
double rx = width / 2; double ry = shapeType == CIRCLE ? rx : height / 2; store.setEllipseID(shapeID, nextROI, shape); store.setEllipseX(x + rx, nextROI, shape); store.setEllipseY(y + ry, nextROI, shape);
double rx = width / 2; double ry = shapeType == CIRCLE ? rx : height / 2; store.setEllipseID(shapeID, nextROI, shape); store.setEllipseX(x + rx, nextROI, shape); store.setEllipseY(y + ry, nextROI, shape);
store.setEllipseID(shapeID, i, 0); store.setEllipseID(shapeID, i, 0); store.setEllipseX(centerX, i, 0); store.setEllipseY(centerY, i, 0); store.setEllipseID(shapeID, i, 0); store.setEllipseX(cx, i, 0); store.setEllipseY(cy, i, 0);
store.setEllipseID(polylineID, cntr, 0); storeOval((OvalRoi) ijRoi, store, cntr, 0, c, z, t); } else if (ijRoi instanceof Line) { //Check if its a Line or Arrow ROI store.setEllipseID(polylineID, cntr, q); storeOval((OvalRoi) ijShape, store, cntr, q, c, z, t); } else if (ijShape instanceof PolygonRoi || ijShape instanceof EllipseRoi) {
store.setEllipseID(polylineID, cntr, 0); storeOval((OvalRoi) ijRoi, store, cntr, 0, c, z, t); } else if (ijRoi instanceof Line) { //Check if its a Line or Arrow ROI store.setEllipseID(polylineID, cntr, q); storeOval((OvalRoi) ijShape, store, cntr, q, c, z, t); } else if (ijShape instanceof PolygonRoi || ijShape instanceof EllipseRoi) {
double radius = Math.sqrt(Math.pow(xdiff, 2.0) + Math.pow(ydiff, 2.0)); shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setEllipseID(shapeID, roiIndex, shapeIndex); store.setEllipseX(shape.points[0], roiIndex, shapeIndex); store.setEllipseY(shape.points[1], roiIndex, shapeIndex); case MEAS_ELLIPSE: shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setEllipseID(shapeID, roiIndex, shapeIndex); store.setEllipseX((shape.points[0] + shape.points[4])/2, roiIndex, shapeIndex); store.setEllipseY((shape.points[1] + shape.points[5])/2, roiIndex, shapeIndex);
double radius = Math.sqrt(Math.pow(xdiff, 2.0) + Math.pow(ydiff, 2.0)); shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setEllipseID(shapeID, roiIndex, shapeIndex); store.setEllipseX(shape.points[0], roiIndex, shapeIndex); store.setEllipseY(shape.points[1], roiIndex, shapeIndex); case MEAS_ELLIPSE: shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setEllipseID(shapeID, roiIndex, shapeIndex); store.setEllipseX((shape.points[0] + shape.points[4])/2, roiIndex, shapeIndex); store.setEllipseY((shape.points[1] + shape.points[5])/2, roiIndex, shapeIndex);
roiID = ROI_PREFIX + roiCount; store.setROIID(roiID, roiCount); store.setEllipseID(SHAPE_PREFIX + roiCount, roiCount, 0); store.setEllipseX(getX(i) + ROI_SPACING / 2, roiCount, 0); store.setEllipseY(getY(i) + ROI_SPACING / 2, roiCount, 0);
roiID = ROI_PREFIX + roiCount; store.setROIID(roiID, roiCount); store.setEllipseID(SHAPE_PREFIX + roiCount, roiCount, 0); store.setEllipseX(getX(i) + ROI_SPACING / 2, roiCount, 0); store.setEllipseY(getY(i) + ROI_SPACING / 2, roiCount, 0);
store.setEllipseID(polylineID, roiNum, shapeNum); store.setEllipseX(x1, roiNum, shapeNum); store.setEllipseY(y1, roiNum, shapeNum);