@Override public Object getMetadataStoreRoot() { FormatTools.assertId(currentId, true, 1); return getMetadataStore().getRoot(); }
store.setImageDescription("", 0); store.setPixelsPhysicalSizeX(sizeX, 0); store.setPixelsPhysicalSizeY(sizeY, 0); store.setPixelsPhysicalSizeZ(sizeZ, 0); store.setInstrumentID(instrumentID, 0); store.setImageInstrumentRef(instrumentID, 0); store.setObjectiveID(objectiveID, 0, 0); store.setObjectiveSettingsID(objectiveID, 0); store.setObjectiveNominalMagnification(magnification, 0, 0); store.setObjectiveCorrection(MetadataTools.getCorrection(correction), 0, 0); store.setObjectiveLensNA(lensNA, 0, 0); store.setObjectiveWorkingDistance(new Length(workingDistance, UNITS.MICROMETER), 0, 0); if (immersion == null) immersion = "Other"; store.setObjectiveImmersion(MetadataTools.getImmersion(immersion), 0, 0); store.setLaserID(laser, 0, i); store.setLaserModel(laserIDs.get(i), 0, i); store.setLaserWavelength(wave, 0, i); store.setLaserType(MetadataTools.getLaserType("Other"), 0, i); store.setLaserLaserMedium(MetadataTools.getLaserMedium("Other"), 0, i);
store.setROIID(roiID, nextROI); store.setImageROIRef(roiID, 0, nextROI); store.setPointID(shapeID, nextROI, shape); store.setPointTheZ(new NonNegativeInteger(zIndex), nextROI, shape); store.setPointTheT(new NonNegativeInteger(tIndex), nextROI, shape); if (font != null) { store.setPointFontSize(font, nextROI, shape); store.setPointStrokeWidth(l, nextROI, shape); store.setPointX(new Double(xc[0]), nextROI, shape); store.setPointY(new Double(yc[0]), nextROI, shape); store.setRectangleID(shapeID, nextROI, shape); store.setRectangleX(realX, nextROI, shape); store.setRectangleY(realY, nextROI, shape); store.setRectangleWidth((double) width, nextROI, shape); store.setRectangleHeight((double) height, nextROI, shape); store.setRectangleTheZ( new NonNegativeInteger(zIndex), nextROI, shape); store.setRectangleTheT( new NonNegativeInteger(tIndex), nextROI, shape); if (font != null) { store.setRectangleFontSize(font, nextROI, shape); store.setRectangleStrokeWidth(l, nextROI, shape);
private void fillPhysicalSizes(MetadataStore store) { if (physicalSizeX == null && physicalSizeY == null && physicalSizeZ == null) return; for (int s=0; s<getSeriesCount(); s++) { store.setPixelsPhysicalSizeX(physicalSizeX, s); store.setPixelsPhysicalSizeY(physicalSizeY, s); store.setPixelsPhysicalSizeZ(physicalSizeZ, s); } }
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 populateCalibrations(final MetadataStore store, final int imageIndex, final double calX, final double calY, final double calZ, final double calC, final double calT) { store.setPixelsPhysicalSizeX(// new Length(calX, UNITS.MICROMETER), imageIndex); store.setPixelsPhysicalSizeY(// new Length(calY, UNITS.MICROMETER), imageIndex); store.setPixelsPhysicalSizeZ(// new Length(calZ, UNITS.MICROMETER), imageIndex); store.setPixelsTimeIncrement(new Time(calT, UNITS.SECOND), imageIndex); }
Length sizeY = FormatTools.getPhysicalSizeY(y, convertUnits(yUnits)); if (sizeX != null) { store.setPixelsPhysicalSizeX(sizeX, 0); store.setPixelsPhysicalSizeY(sizeY, 0); Length sizeZ = FormatTools.getPhysicalSizeZ(z, convertUnits(zUnits)); if (sizeZ != null) { store.setPixelsPhysicalSizeZ(sizeZ, 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); store.setObjectiveID(objective, 0, 0); store.setObjectiveCorrection(MetadataTools.getCorrection("Unknown"), 0, 0); store.setObjectiveImmersion(MetadataTools.getImmersion("Unknown"), 0, 0); store.setObjectiveNominalMagnification(mag, 0, 0); store.setObjectiveSettingsID(objective, 0); store.setDetectorID(detector, 0, 0); store.setDetectorSettingsID(detector, 0, 0); store.setDetectorSettingsVoltage(new ElectricPotential(voltage, UNITS.VOLT), 0, 0); String mode = token.substring(0, token.indexOf(' ')).trim(); if (mode.equals("TEM")) mode = "Other"; store.setChannelAcquisitionMode(MetadataTools.getAcquisitionMode(mode), 0, 0);
for (int i=0; i<ellipses; i++) { 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.setEllipseRadiusX(new Double(ROI_SPACING / 2), roiCount, 0); store.setEllipseRadiusY(new Double(ROI_SPACING / 2), roiCount, 0); store.setImageROIRef(roiID, imageIndex, roiRefCount); roiCount++; roiRefCount++; store.setROIID(roiID, roiCount); store.setLabelID(SHAPE_PREFIX + roiCount, roiCount, 0); store.setLabelX(getX(i), roiCount, 0); store.setLabelY(getY(i), roiCount, 0); store.setLabelText("Label " + i, roiCount, 0 ); store.setImageROIRef(roiID, imageIndex, roiRefCount); roiCount++; roiRefCount++; store.setROIID(roiID, roiCount); store.setLineID(SHAPE_PREFIX + roiCount, roiCount, 0); store.setLineX1(getX(i) + ROI_SPACING / 4, roiCount, 0); store.setLineY1(getY(i) + ROI_SPACING / 4, roiCount, 0); store.setLineX2(getX(i) + ROI_SPACING / 2, roiCount, 0); store.setLineY2(getY(i) + ROI_SPACING / 2, roiCount, 0); store.setImageROIRef(roiID, imageIndex, roiRefCount); roiCount++;
store.setROIID(roiID, roiIndex); if (shape.name != null) store.setROIName(shape.name, roiIndex); if (shape.text != null && shape.text.length() == 0) shape.text = null; for (int i = 0; i < (shape.points.length / 2); i++) { shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setPointID(shapeID, roiIndex, shapeIndex); store.setPointX(shape.points[(i*2)], roiIndex, shapeIndex); store.setPointY(shape.points[(i*2)+1], roiIndex, shapeIndex); if (shape.text != null && i == 0) store.setPointText(shape.text, roiIndex, shapeIndex); shapeIndex++; case MEAS_PROFILE: // Uses a line as the profile path, but we can't handle that yet. shapeID = MetadataTools.createLSID("Shape", roiIndex, shapeIndex); store.setLineID(shapeID, roiIndex, shapeIndex); store.setLineX1(shape.points[0], roiIndex, shapeIndex); store.setLineY1(shape.points[1], roiIndex, shapeIndex); store.setLineX2(shape.points[2], roiIndex, shapeIndex); store.setLineY2(shape.points[3], roiIndex, shapeIndex); if (shape.text != null) store.setLineText(shape.text, roiIndex, shapeIndex); shapeIndex++; break; store.setLineID(shapeID, roiIndex, shapeIndex); store.setLineX1(shape.points[(i*2)+0], roiIndex, shapeIndex);
store.setROIID(roiID, i); store.setLabelID(shapeID, i, 0); store.setLabelX(x, i, 0); store.setLabelY(y, i, 0); store.setLabelText(text, i, 0); if (fontSize != null) { store.setLabelFontSize(fontSize, i, 0); store.setLabelStrokeWidth(line, i, 0); store.setImageROIRef(roiID, series, i); store.setROIID(roiID, i); store.setLineID(shapeID, i, 0); store.setLineX1(startX, i, 0); store.setLineY1(startY, i, 0); store.setLineX2(endX, i, 0); store.setLineY2(endY, i, 0); if (fontSize != null) { store.setLineFontSize(fontSize, i, 0); store.setLineStrokeWidth(line, i, 0); store.setImageROIRef(roiID, series, i); store.setROIID(roiID, i); store.setRectangleID(shapeID, i, 0); store.setRectangleX(topX, i, 0); store.setRectangleY(topY, i, 0); store.setRectangleWidth(width, i, 0); store.setRectangleHeight(height, i, 0);
store.setInstrumentID(instrumentID, 0); String date = DateTools.formatDate(p.time, DATE_FORMAT); if (date != null) { store.setImageAcquisitionDate(new Timestamp(date), i); store.setImageName(p.name, i); } else { if (positions.size() > 1) { Location parent = new Location(p.metadataFile).getParentFile(); store.setImageName(parent.getName(), i); store.setImageDescription(p.comment, i); store.setImageInstrumentRef(instrumentID, i); store.setChannelName(p.channels[c], i, c); store.setChannelColor(Color.valueOf(p.channelColors[c]), i, c); Length sizeZ = FormatTools.getPhysicalSizeZ(p.sliceThickness); if (sizeX != null) { store.setPixelsPhysicalSizeX(sizeX, i); store.setPixelsPhysicalSizeY(sizeY, i); store.setPixelsPhysicalSizeZ(sizeZ, i); store.setPlaneExposureTime(p.exposureTime, i, q);
store.setLineID( MetadataTools.createLSID("Shape", roiCount, shape), roiCount, shape); store.setLineID( MetadataTools.createLSID("Shape", roiCount, shape + 1), roiCount, shape + 1); Double halfLen = new Double(length) / 2; if (centerX != null) { store.setLineX1(new Double(centerX) - halfLen, roiCount, shape); store.setLineX2(new Double(centerX) + halfLen, roiCount, shape); store.setLineX1(new Double(centerX), roiCount, shape + 1); store.setLineX2(new Double(centerX), roiCount, shape + 1); store.setLineY1(new Double(centerY), roiCount, shape); store.setLineY2(new Double(centerY), roiCount, shape); store.setLineY1(new Double(centerY) - halfLen, roiCount, shape + 1); store.setLineY2(new Double(centerY) + halfLen, roiCount, shape + 1); store.setLineText(getFirstNodeValue(textElements, "Text"), roiCount, shape); store.setLineText(getFirstNodeValue(textElements, "Text"), roiCount, shape + 1); store.setEllipseID( MetadataTools.createLSID("Shape", roiCount, shape), roiCount, shape); store.setEllipseRadiusX(new Double(radiusX), roiCount, shape); store.setEllipseRadiusY(new Double(radiusY), roiCount, shape);
date = DateTools.formatDate(date, DATE_FORMAT); if (date != null) { store.setImageAcquisitionDate(new Timestamp(date), 0); store.setImageName(imageName, 0); store.setImageDescription(imageDescription, 0); store.setExperimenterID(MetadataTools.createLSID("Experimenter", 0), 0); store.setExperimenterLastName(userName, 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); store.setMicroscopeModel(microscopeModel, 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); store.setDetectorID(detectorID, 0, i); store.setDetectorModel(detectors.get(i), 0, i); store.setDetectorType(MetadataTools.getDetectorType("Other"), 0, i); store.setObjectiveID(MetadataTools.createLSID("Objective", 0, 0), 0, 0); store.setObjectiveNominalMagnification(magnification, 0, 0); store.setObjectiveCorrection(MetadataTools.getCorrection("Other"), 0, 0); store.setObjectiveImmersion(MetadataTools.getImmersion("Other"), 0, 0); store.setStageLabelX(stageX, 0); store.setStageLabelY(stageY, 0);
double ry = vnRectBounds.getHeight(); store.setEllipseX(((double) x + rx/2), roiNum, shape); store.setEllipseY(((double) y + ry/2), roiNum, shape); store.setEllipseRadiusX((double) rx/2, roiNum, shape); store.setEllipseRadiusY((double) ry/2, roiNum, shape); store.setEllipseText(roi.getName(), roiNum, shape); if (c >= 0) { store.setEllipseTheC(unwrap(c), roiNum, shape); store.setEllipseTheZ(unwrap(z), roiNum, shape); store.setEllipseTheT(unwrap(t), roiNum, shape); store.setEllipseStrokeWidth(new Length((roi.getStrokeWidth()), UNITS.PIXEL), roiNum, shape); store.setEllipseStrokeColor(toOMExmlColor(roi.getStrokeColor()), roiNum, shape); store.setEllipseFillColor(toOMExmlColor(roi.getFillColor()) , roiNum, shape);
MetadataTools.populatePixels(store, this); store.setImageName(imageName, 0); if (acquisitionDate != null) { store.setImageAcquisitionDate(new Timestamp(acquisitionDate), 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); store.setObjectiveID(objective, 0, 0); store.setObjectiveNominalMagnification(magnification, 0, 0); store.setObjectiveCorrection(MetadataTools.getCorrection("Other"), 0, 0); store.setObjectiveImmersion(MetadataTools.getImmersion("Other"), 0, 0); store.setObjectiveSettingsID(objective, 0); store.setDetectorID(detector, 0, 0); store.setDetectorModel(cameraName, 0, 0); store.setDetectorType(MetadataTools.getDetectorType("Other"), 0, 0); store.setDetectorSettingsID(detector, 0, 0); store.setPixelsPhysicalSizeX(sizeX, 0); store.setPixelsPhysicalSizeY(sizeY, 0); store.setChannelName(channelName, 0, 0);
OME root = (OME) store.getRoot(); int roicount = root.sizeOfROIList(); int cntr = roicount; if (ijRoi.getTypeAsString().matches("Text")) { if (ijRoi instanceof TextRoi){ store.setLabelID(polylineID, cntr, 0); storeText((TextRoi) ijRoi, store, cntr, 0, c, z, t); store.setRectangleID(polylineID, cntr, 0); storeRectangle(ijRoi, store, cntr, 0, c, z, t); 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 boolean checkpoint = ijRoi.isDrawingTool(); if (!checkpoint) { store.setLineID(polylineID, cntr, 0); storeLine((Line) ijRoi, store, cntr, 0, c, z, t); } else { ijRoi.getTypeAsString().matches("Freeline") || ijRoi.getTypeAsString().matches("Angle")) { store.setPolylineID(polylineID, cntr, 0); storePolygon((PolygonRoi) ijRoi, store, cntr, 0, c, z, t); } else if (ijRoi.getTypeAsString().matches("Point")) { store.setPointID(polylineID, cntr, 0); storePoint((PointRoi) ijRoi, store, cntr, 0, c, z, t); } else if (ijRoi.getTypeAsString().matches("Polygon") ||
date = DateTools.formatDate(date, DATE_FORMAT); if (date != null) { store.setImageAcquisitionDate(new Timestamp(date), 0); store.setImageDescription(MAGIC_STRING, 0); store.setPixelsPhysicalSizeX(sizeX, 0); store.setPixelsPhysicalSizeY(sizeY, 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); store.setObjectiveID(MetadataTools.createLSID("Objective", 0, 0), 0, 0); store.setObjectiveNominalMagnification(magnification, 0, 0); store.setObjectiveImmersion(MetadataTools.getImmersion(immersion), 0, 0); store.setDetectorID(detector, 0, 0); store.setDetectorModel(cameraType + " " + cameraName, 0, 0); store.setDetectorType(MetadataTools.getDetectorType("CCD"), 0, 0); store.setDetectorSettingsID(detector, 0, i); store.setDetectorSettingsBinning(MetadataTools.getBinning(binning), 0, i); int[] zct = getZCTCoords(i); if (zct[1] < exposureTimes.size() && exposureTimes.get(zct[1]) != null) { store.setPlaneExposureTime(new Time(exposureTimes.get(zct[1]) / 1000000, UNITS.SECOND), 0, i);
store.setInstrumentID(instrumentID, 0); store.setObjectiveID(objectiveID, 0, 0); store.setMicroscopeModel(instrumentModel, 0); store.setObjectiveNominalMagnification(magnification, 0, 0); store.setImageName("Series " + (i + 1), i); store.setImageName("", i); break; case 1: store.setImageName("macro image", i); break; case 2: store.setImageName("macro mask image", i); break; store.setImageInstrumentRef(instrumentID, i); store.setObjectiveSettingsID(objectiveID, i); creationDate = DateTools.formatDate(creationDate, DATE_FORMATS, "."); if (creationDate != null) { store.setImageAcquisitionDate(new Timestamp(creationDate), i); store.setPixelsPhysicalSizeX(sizeX, i); store.setPixelsPhysicalSizeY(sizeY, i);
store.setImageAcquisitionDate(new Timestamp(creationDate), 0); store.setExperimenterFirstName(firstName, 0); store.setExperimenterLastName(lastName, 0); store.setExperimenterEmail(email, 0); store.setExperimenterID(MetadataTools.createLSID("Experimenter", 0), 0); store.setImageDescription(firstIFD.getComment(), 0); store.setPixelsPhysicalSizeX(sizeX, 0); store.setPixelsPhysicalSizeY(sizeY, 0); store.setPixelsPhysicalSizeZ(null, 0); Time exposure = new Time(((TiffRational) exp).doubleValue(), UNITS.SECOND); for (int i=0; i<getImageCount(); i++) { store.setPlaneExposureTime(exposure, 0, i);
store.setImageName(file.getParentFile().getName(), 0); store.setChannelName(name.trim(), 0, c); Double size = new Double(physicalSize); if (size > 0) { store.setPixelsPhysicalSizeX(FormatTools.getPhysicalSizeX(size), 0); store.setPixelsPhysicalSizeY(FormatTools.getPhysicalSizeY(size), 0); store.setInstrumentID(MetadataTools.createLSID("Instrument", 0), 0); store.setObjectiveID(MetadataTools.createLSID("Objective", 0, 0), 0, 0); store.setObjectiveCorrection(MetadataTools.getCorrection("Other"), 0, 0); store.setObjectiveImmersion(MetadataTools.getImmersion("Other"), 0, 0); store.setObjectiveNominalMagnification(new Double(mag), 0, 0); store.setPlanePositionX(xl, 0, i); store.setPlanePositionY(yl, 0, i); store.setPlanePositionZ(zl, 0, i);