@Override public String createLSID(final String type, final int... indices) { return MetadataTools.createLSID(type, indices); }
/** * Populates the Pixels element of the given metadata store, using core * metadata from the given reader. * * Delegate to * {@link #populatePixels(MetadataStore, IFormatReader, boolean, boolean)} * with {@code doPlane} set to {@code false} and {@code doImageName} set to * {@code true}. * * @param store The metadata store whose Pixels should be populated * @param r The format reader whose core metadata should be used */ public static void populatePixels(MetadataStore store, IFormatReader r) { populatePixels(store, r, false, true); }
/** * Populates the given {@link MetadataStore}, for the specified series, using * the provided values. * <p> * After calling this method, the metadata store will be sufficiently * populated for use with an {@link IFormatWriter} (assuming it is also a * {@link MetadataRetrieve}). * </p> */ public static void populateMetadata(MetadataStore store, int series, String imageName, boolean littleEndian, String dimensionOrder, String pixelType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel) { populateMetadata(store, null, series, imageName, littleEndian, dimensionOrder, pixelType, sizeX, sizeY, sizeZ, sizeC, sizeT, samplesPerPixel); }
/** * Populates the given {@link MetadataStore}, for the specified series, using * the provided values. * <p> * After calling this method, the metadata store will be sufficiently * populated for use with an {@link IFormatWriter} (assuming it is also a * {@link MetadataRetrieve}). * </p> */ public static void populateMetadata(MetadataStore store, String file, int series, String imageName, boolean littleEndian, String dimensionOrder, String pixelType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel) { store.setImageID(createLSID("Image", series), series); setDefaultCreationDate(store, file, series); if (imageName != null) store.setImageName(imageName, series); populatePixelsOnly(store, series, littleEndian, dimensionOrder, pixelType, sizeX, sizeY, sizeZ, sizeC, sizeT, samplesPerPixel); }
super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); MetadataTools.populatePixels(store, this); String instrument = MetadataTools.createLSID("Instrument", 0); store.setInstrumentID(instrument, 0); store.setImageInstrumentRef(instrument, 0); String objective = MetadataTools.createLSID("Objective", 0, 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); String detector = MetadataTools.createLSID("Detector", 0, 0); store.setDetectorID(detector, 0, 0); store.setDetectorModel(cameraName, 0, 0); store.setDetectorType(MetadataTools.getDetectorType("Other"), 0, 0); store.setDetectorSettingsID(detector, 0, 0);
MetadataTools.populatePixels(store, this); String instrumentID = MetadataTools.createLSID("Instrument", 0); store.setInstrumentID(instrumentID, 0); store.setImageInstrumentRef(instrumentID, 0); String objectiveID = MetadataTools.createLSID("Objective", 0, 0); store.setObjectiveID(objectiveID, 0, 0); store.setObjectiveSettingsID(objectiveID, 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); String laser = MetadataTools.createLSID("LightSource", 0, i); store.setLaserID(laser, 0, i); store.setLaserModel(laserIDs.get(i), 0, i); store.setLaserType(MetadataTools.getLaserType("Other"), 0, i); store.setLaserLaserMedium(MetadataTools.getLaserMedium("Other"), 0, i); store.setDetectorID(MetadataTools.createLSID("Detector", 0, i), 0, i); store.setDetectorGain(gain.get(i), 0, i); store.setDetectorType(MetadataTools.getDetectorType("Other"), 0, i); String filter = MetadataTools.createLSID("Filter", 0, i); store.setFilterID(filter, 0, i);
String objectiveID = MetadataTools.createLSID("Objective", instrument, 0); if (recording.acquire) { store.setImageDescription(recording.description, series); MetadataTools.getCorrection(recording.correction), instrument, 0); store.setObjectiveImmersion( MetadataTools.getImmersion(recording.immersion), instrument, 0); if (recording.magnification != null) { store.setObjectiveNominalMagnification( Laser laser = (Laser) block; if (laser.medium != null) { store.setLaserLaserMedium(MetadataTools.getLaserMedium(laser.medium), instrument, nextLaser); store.setLaserType(MetadataTools.getLaserType(laser.type), instrument, nextLaser); MetadataTools.createLSID("LightSource", instrument, nextLaser); store.setLaserID(lightSourceID, instrument, nextLaser); nextLaser++; String id = MetadataTools.createLSID("Filter", instrument, nextFilter); if (channel.acquire && nextDetectChannel < getSizeC()) { store.setLightPathEmissionFilterRef( store.setFilterType(MetadataTools.getFilterType(type), instrument, nextFilter); MetadataTools.createLSID("Detector", instrument, nextDetector); store.setDetectorID(detectorID, instrument, nextDetector);
String instrumentID = MetadataTools.createLSID("Instrument", 0); store.setInstrumentID(instrumentID, 0); if (c < illuminations.size()) { store.setChannelIlluminationType( MetadataTools.getIlluminationType(illuminations.get(c)), i, c); String detectorID = MetadataTools.createLSID("Detector", 0, channelIndex); store.setDetectorID(detectorID, 0, channelIndex); store.setDetectorSettingsID(detectorID, 0, channelIndex); store.setDetectorType(MetadataTools.getDetectorType("PMT"), 0, channelIndex); MetadataTools.createLSID("LightSource", 0, channelIndex); store.setChannelLightSourceSettingsID(lightSourceID, 0, channelIndex); String filterID = MetadataTools.createLSID("Filter", 0, channelIndex); store.setFilterID(filterID, 0, channelIndex); store.setFilterModel(channel.barrierFilter, 0, channelIndex); String emFilter = MetadataTools.createLSID("Dichroic", 0, emIndex); String exFilter = MetadataTools.createLSID("Dichroic", 0, exIndex); store.setLaserLaserMedium(MetadataTools.getLaserMedium(channel.dyeName), 0, channelIndex); if (channelIndex < wavelengths.size()) { store.setLaserType(MetadataTools.getLaserType("Other"), 0, channelIndex);
String experimentID = MetadataTools.createLSID("Experiment", 0); store.setExperimentID(experimentID, 0); try { store.setExperimentType( MetadataTools.getExperimentType(attributes.getValue("type")), 0); attributes.getValue("numerical_aperture")), 0, 0); try { store.setObjectiveImmersion(MetadataTools.getImmersion("Other"), 0, 0); String correction = tokens.length > 2 ? tokens[2] : "Other"; try { store.setObjectiveCorrection(MetadataTools.getCorrection(correction), 0, 0); store.setDetectorModel(attributes.getValue("name"), 0, 0); try { store.setDetectorType(MetadataTools.getDetectorType("Other"), 0, 0); String binning = attributes.getValue("value"); try { bin = MetadataTools.getBinning(binning);
MetadataTools.populatePixels(store, this, exposureTime != null); store.setInstrumentID(MetadataTools.createLSID("Instrument", 0), 0); String detector = MetadataTools.createLSID("Detector", 0, 0); store.setDetectorID(detector, 0, 0); store.setDetectorSettingsID(detector, 0, 0); store.setDetectorSettingsBinning(MetadataTools.getBinning(binning), 0, 0);
MetadataTools.populatePixels(store, this); String instrumentID = MetadataTools.createLSID("Instrument", 0); store.setInstrumentID(instrumentID, 0); String laser = MetadataTools.createLSID("LightSource", 0, q); store.setLaserID(laser, 0, q); Double wave = new Double(waves[q].trim()); store.setLaserWavelength(wavelength, 0, q); store.setLaserType(MetadataTools.getLaserType("Other"), 0, q); store.setLaserLaserMedium(MetadataTools.getLaserMedium("Other"), 0, q); store.setChannelLightSourceSettingsID(laser, i, q); store.setMicroscopeType(MetadataTools.getMicroscopeType("Other"), 0);
String lsid = MetadataTools.createLSID("LightSource", 0, nextLaser); store.setLaserID(lsid, 0, nextLaser); Double wavelength = new Double(value); store.setLaserType(MetadataTools.getLaserType("Other"), 0, nextLaser); store.setLaserLaserMedium(MetadataTools.getLaserMedium("Other"), 0, nextLaser); try { store.setObjectiveImmersion( MetadataTools.getImmersion(immersion), 0, nextObjective); if (index >= 0) { String objectiveID = MetadataTools.createLSID("Objective", 0, index); objectiveRefs.add(objectiveID); if (cameraIndex >= 0) { String detectorID = MetadataTools.createLSID("Detector", 0, cameraIndex); cameraRefs.add(detectorID);
store.setInstrumentID(MetadataTools.createLSID("Instrument", 0), 0); Element objective = (Element) objectives.item(i); String objectiveID = MetadataTools.createLSID("Objective", 0, i); if (i == positionIndex || (objectives.getLength() == 1 && objectiveSettingsID != null)) store.setObjectiveImmersion(MetadataTools.getImmersion(immersion), 0, i); store.setObjectiveCorrection(MetadataTools.getCorrection("Other"), 0, i);
private void populateMetadataStore() throws FormatException { MetadataStore store = makeFilterMetadata(); MetadataTools.populatePixels(store, this, true); for (int i=0; i<getSeriesCount(); i++) { // populate Image data if (i < imageNames.size()) { store.setImageName(imageNames.get(i), i); } String date = i < dates.size() ? dates.get(i) : ""; if (date != null && !date.equals("")) { store.setImageAcquisitionDate(new Timestamp(date), i); } } if (getMetadataOptions().getMetadataLevel() != MetadataLevel.MINIMUM) { for (int i=0; i<getSeriesCount(); i++) { // populate PlaneTiming data for (int q=0; q<core.get(i).imageCount; q++) { if (exposureTimes.get(i) != null) { store.setPlaneExposureTime(new Time(exposureTimes.get(i), UNITS.SECOND), i, q); } } // populate Experiment data if (i < types.size()) { store.setExperimentID(MetadataTools.createLSID("Experiment", i), i); store.setExperimentType(MetadataTools.getExperimentType(types.get(i)), i); } } } }
/** * Checks whether the given metadata object has the minimum metadata * populated to successfully describe an Image. * * @throws FormatException if there is a missing metadata field, * or the metadata object is uninitialized */ public static void verifyMinimumPopulated(MetadataRetrieve src) throws FormatException { verifyMinimumPopulated(src, 0); }
store.setObjectiveCorrection(MetadataTools.getCorrection(correction), 0, i); MetadataTools.getImmersion(getFirstNodeValue(objective, "Immersion")), 0, i);
/** * Retrieves an {@link ome.xml.model.enums.DetectorType} enumeration * value for the given String. * * @throws ome.xml.model.enums.EnumerationException if an appropriate * enumeration value is not found. * @deprecated Use {@link MetadataTools#getDetectorType(String)}. */ @Deprecated protected DetectorType getDetectorType(String value) throws FormatException { return MetadataTools.getDetectorType(value); } /**
/** * Retrieves an {@link ome.xml.model.enums.Correction} enumeration * value for the given String. * * @throws ome.xml.model.enums.EnumerationException if an appropriate * enumeration value is not found. * @deprecated Use {@link MetadataTools#getCorrection(String)}. */ @Deprecated protected Correction getCorrection(String value) throws FormatException { return MetadataTools.getCorrection(value); } /**
/** * Retrieves an {@link ome.xml.model.enums.Immersion} enumeration * value for the given String. * * @throws ome.xml.model.enums.EnumerationException if an appropriate * enumeration value is not found. * @deprecated Use {@link MetadataTools#getImmersion(String)}. */ @Deprecated protected Immersion getImmersion(String value) throws FormatException { return MetadataTools.getImmersion(value); } /**
/** * Retrieves an {@link ome.xml.model.enums.Binning} enumeration * value for the given String. * * @throws ome.xml.model.enums.EnumerationException if an appropriate * enumeration value is not found. * @deprecated Use {@link MetadataTools#getBinning(String)}. */ @Deprecated protected Binning getBinning(String value) throws FormatException { return MetadataTools.getBinning(value); } /**