Search in sources :

Example 1 with Correction

use of ome.xml.model.enums.Correction in project bioformats by openmicroscopy.

the class LeicaReader method parseInstrumentData.

private void parseInstrumentData(MetadataStore store, int blockNum) throws FormatException, IOException {
    int series = getSeries();
    // read 24 byte SAFEARRAY
    in.skipBytes(4);
    int cbElements = in.readInt();
    in.skipBytes(8);
    int nElements = in.readInt();
    in.skipBytes(4);
    long initialOffset = in.getFilePointer();
    long elementOffset = 0;
    LOGGER.trace("Element LOOP; series {} at offset {}", series, initialOffset);
    for (int j = 0; j < nElements; j++) {
        elementOffset = initialOffset + j * cbElements;
        LOGGER.trace("Seeking to: {}", elementOffset);
        in.seek(elementOffset);
        String contentID = getString(128);
        LOGGER.trace("contentID: {}", contentID);
        String description = getString(64);
        LOGGER.trace("description: {}", description);
        String data = getString(64);
        int dataType = in.readShort();
        LOGGER.trace("dataType: {}", dataType);
        in.skipBytes(6);
        // read data
        switch(dataType) {
            case 2:
                data = String.valueOf(in.readShort());
                break;
            case 3:
                data = String.valueOf(in.readInt());
                break;
            case 4:
                data = String.valueOf(in.readFloat());
                break;
            case 5:
                data = String.valueOf(in.readDouble());
                break;
            case 7:
            case 11:
                data = in.read() == 0 ? "false" : "true";
                break;
            case 17:
                data = in.readString(1);
                break;
        }
        LOGGER.trace("data: {}", data);
        if (data.trim().length() == 0) {
            LOGGER.trace("Zero length dat string, continuing...");
            continue;
        }
        String[] tokens = contentID.split("\\|");
        LOGGER.trace("Parsing tokens: {}", tokens);
        if (tokens[0].startsWith("CDetectionUnit")) {
            if (tokens[1].startsWith("PMT")) {
                // detector information
                Detector detector = new Detector();
                int lastDetector = detectors.size() - 1;
                if (detectors.size() > 0 && detectors.get(lastDetector).id == Integer.parseInt(tokens[3])) {
                    detector = detectors.get(lastDetector);
                } else {
                    detectors.add(detector);
                }
                detector.id = Integer.parseInt(tokens[3]);
                detector.name = tokens[1];
                try {
                    if (tokens[2].equals("VideoOffset")) {
                        detector.offset = new Double(data);
                    } else if (tokens[2].equals("HighVoltage")) {
                        detector.voltage = new Double(data);
                    } else if (tokens[2].equals("State")) {
                        detector.active = data.equals("Active");
                        String index = tokens[1].substring(tokens[1].indexOf(' ') + 1);
                        detector.index = -1;
                        try {
                            detector.index = Integer.parseInt(index) - 1;
                        } catch (NumberFormatException e) {
                        }
                        if (detector.active && detector.index >= 0) {
                            activeChannelIndices.add(detector.index);
                        }
                    }
                } catch (NumberFormatException e) {
                    LOGGER.debug("Failed to parse detector metadata", e);
                }
            }
        } else if (tokens[0].startsWith("CTurret")) {
            // objective information
            int objective = Integer.parseInt(tokens[3]);
            if (tokens[2].equals("NumericalAperture")) {
                store.setObjectiveLensNA(new Double(data), series, objective);
            } else if (tokens[2].equals("Objective")) {
                String[] objectiveData = data.split(" ");
                final StringBuilder model = new StringBuilder();
                String mag = null, na = null;
                String immersion = null, correction = null;
                for (int i = 0; i < objectiveData.length; i++) {
                    if (objectiveData[i].indexOf('x') != -1 && mag == null && na == null) {
                        int xIndex = objectiveData[i].indexOf('x');
                        mag = objectiveData[i].substring(0, xIndex).trim();
                        na = objectiveData[i].substring(xIndex + 1).trim();
                    } else if (mag == null && na == null) {
                        model.append(objectiveData[i]);
                        model.append(" ");
                    } else if (correction == null) {
                        correction = objectiveData[i];
                    } else if (immersion == null) {
                        immersion = objectiveData[i];
                    }
                }
                if (immersion != null)
                    immersion = immersion.trim();
                if (correction != null)
                    correction = correction.trim();
                Correction realCorrection = getCorrection(correction);
                Correction testCorrection = getCorrection(immersion);
                Immersion realImmersion = getImmersion(immersion);
                Immersion testImmersion = getImmersion(correction);
                // Correction and Immersion are reversed
                if ((testCorrection != Correction.OTHER && realCorrection == Correction.OTHER) || (testImmersion != Immersion.OTHER && realImmersion == Immersion.OTHER)) {
                    String tmp = correction;
                    correction = immersion;
                    immersion = tmp;
                }
                store.setObjectiveImmersion(getImmersion(immersion), series, objective);
                store.setObjectiveCorrection(getCorrection(correction), series, objective);
                store.setObjectiveModel(model.toString().trim(), series, objective);
                store.setObjectiveLensNA(new Double(na), series, objective);
                Double magnification = Double.parseDouble(mag);
                store.setObjectiveNominalMagnification(magnification, series, objective);
            } else if (tokens[2].equals("OrderNumber")) {
                store.setObjectiveSerialNumber(data, series, objective);
            } else if (tokens[2].equals("RefractionIndex")) {
                store.setObjectiveSettingsRefractiveIndex(new Double(data), series);
            }
            // link Objective to Image
            String objectiveID = MetadataTools.createLSID("Objective", series, objective);
            store.setObjectiveID(objectiveID, series, objective);
            if (objective == 0) {
                store.setObjectiveSettingsID(objectiveID, series);
            }
        } else if (tokens[0].startsWith("CSpectrophotometerUnit")) {
            int ndx = tokens[1].lastIndexOf(" ");
            int channel = Integer.parseInt(tokens[1].substring(ndx + 1)) - 1;
            if (tokens[2].equals("Wavelength")) {
                Double wavelength = Double.parseDouble(data);
                store.setFilterModel(tokens[1], series, channel);
                String filterID = MetadataTools.createLSID("Filter", series, channel);
                store.setFilterID(filterID, series, channel);
                int index = activeChannelIndices.indexOf(channel);
                if (index >= 0 && index < getEffectiveSizeC()) {
                    if (!filterRefPopulated[series][index]) {
                        store.setLightPathEmissionFilterRef(filterID, series, index, 0);
                        filterRefPopulated[series][index] = true;
                    }
                    if (tokens[3].equals("0") && !cutInPopulated[series][index]) {
                        Length cutIn = FormatTools.getCutIn(wavelength);
                        if (cutIn != null) {
                            store.setTransmittanceRangeCutIn(cutIn, series, channel);
                        }
                        cutInPopulated[series][index] = true;
                    } else if (tokens[3].equals("1") && !cutOutPopulated[series][index]) {
                        Length cutOut = FormatTools.getCutOut(wavelength);
                        if (cutOut != null) {
                            store.setTransmittanceRangeCutOut(cutOut, series, channel);
                        }
                        cutOutPopulated[series][index] = true;
                    }
                }
            } else if (tokens[2].equals("Stain")) {
                if (activeChannelIndices.contains(channel)) {
                    int nNames = channelNames[series].size();
                    String prevValue = nNames == 0 ? "" : (String) channelNames[series].get(nNames - 1);
                    if (!prevValue.equals(data)) {
                        channelNames[series].add(data);
                    }
                }
            }
        } else if (tokens[0].startsWith("CXYZStage")) {
            CoreMetadata ms = core.get(series);
            // NB: there is only one stage position specified for each series
            if (tokens[2].equals("XPos")) {
                for (int q = 0; q < ms.imageCount; q++) {
                    final Double number = Double.valueOf(data);
                    final Length length = new Length(number, UNITS.REFERENCEFRAME);
                    store.setPlanePositionX(length, series, q);
                    if (q == 0) {
                        addGlobalMetaList("X position for position", data);
                    }
                }
            } else if (tokens[2].equals("YPos")) {
                for (int q = 0; q < ms.imageCount; q++) {
                    final Double number = Double.valueOf(data);
                    final Length length = new Length(number, UNITS.REFERENCEFRAME);
                    store.setPlanePositionY(length, series, q);
                    if (q == 0) {
                        addGlobalMetaList("Y position for position", data);
                    }
                }
            } else if (tokens[2].equals("ZPos")) {
                final Double number = Double.valueOf(data);
                final Length length = new Length(number, UNITS.REFERENCEFRAME);
                store.setStageLabelName("Position", series);
                store.setStageLabelZ(length, series);
                addGlobalMetaList("Z position for position", data);
            }
        } else if (tokens[0].equals("CScanActuator") && tokens[1].equals("Z Scan Actuator") && tokens[2].equals("Position")) {
            final double pos = Double.parseDouble(data) * 1000000;
            store.setStageLabelName("Position", series);
            store.setStageLabelZ(new Length(pos, UNITS.REFERENCEFRAME), series);
            addGlobalMetaList("Z position for position", pos);
        }
        if (contentID.equals("dblVoxelX")) {
            physicalSizes[series][0] = Double.parseDouble(data);
        } else if (contentID.equals("dblVoxelY")) {
            physicalSizes[series][1] = Double.parseDouble(data);
        } else if (contentID.equals("dblStepSize")) {
            double size = Double.parseDouble(data);
            if (size > 0) {
                physicalSizes[series][2] = size;
            }
        } else if (contentID.equals("dblPinhole")) {
            // pinhole is stored in meters
            pinhole[series] = Double.parseDouble(data) * 1000000;
        } else if (contentID.startsWith("nDelayTime")) {
            exposureTime[series] = Double.parseDouble(data);
            if (contentID.endsWith("_ms")) {
                exposureTime[series] /= 1000;
            }
        }
        addSeriesMeta("Block " + blockNum + " " + contentID, data);
    }
    for (Detector detector : detectors) {
        // link Detector to Image, if the detector was actually used
        if (detector.active) {
            store.setDetectorOffset(detector.offset, series, nextDetector);
            store.setDetectorVoltage(new ElectricPotential(detector.voltage, UNITS.VOLT), series, nextDetector);
            store.setDetectorType(getDetectorType("PMT"), series, nextDetector);
            String detectorID = MetadataTools.createLSID("Detector", series, nextDetector);
            store.setDetectorID(detectorID, series, nextDetector);
            if (nextDetector == 0) {
                // overwritten
                for (int c = 0; c < getEffectiveSizeC(); c++) {
                    store.setDetectorSettingsID(detectorID, series, c);
                }
            }
            if (nextChannel < getEffectiveSizeC()) {
                store.setDetectorSettingsID(detectorID, series, nextChannel);
                if (nextChannel < channelNames[series].size()) {
                    String name = (String) channelNames[series].get(nextChannel);
                    if (name == null || name.trim().equals("") || name.equals("None")) {
                        channelNames[series].set(nextChannel, detector.name);
                    }
                } else {
                    while (channelNames[series].size() < nextChannel) {
                        channelNames[series].add("");
                    }
                    channelNames[series].add(detector.name);
                }
                nextChannel++;
            }
            nextDetector++;
        }
    }
    detectors.clear();
    for (int i = 0; i < getSeriesCount(); i++) {
        setSeries(i);
        for (int channel = 0; channel < getEffectiveSizeC(); channel++) {
            if (channel < channelNames[i].size()) {
                String name = (String) channelNames[i].get(channel);
                if (name != null && !name.trim().equals("") && !name.equals("None")) {
                    store.setChannelName(name, i, channel);
                }
            }
            if (channel < emWaves[i].size()) {
                Double wave = new Double(emWaves[i].get(channel).toString());
                Length emission = FormatTools.getEmissionWavelength(wave);
                if (emission != null) {
                    store.setChannelEmissionWavelength(emission, i, channel);
                }
            }
            if (channel < exWaves[i].size()) {
                Double wave = new Double(exWaves[i].get(channel).toString());
                Length ex = FormatTools.getExcitationWavelength(wave);
                if (ex != null) {
                    store.setChannelExcitationWavelength(ex, i, channel);
                }
            }
            if (i < pinhole.length) {
                store.setChannelPinholeSize(new Length(pinhole[i], UNITS.MICROMETER), i, channel);
            }
            if (channel < channelColor[i].length) {
                store.setChannelColor(channelColor[i][channel], i, channel);
            }
        }
    }
    setSeries(0);
}
Also used : Immersion(ome.xml.model.enums.Immersion) Correction(ome.xml.model.enums.Correction) CoreMetadata(loci.formats.CoreMetadata) ElectricPotential(ome.units.quantity.ElectricPotential) Length(ome.units.quantity.Length)

Example 2 with Correction

use of ome.xml.model.enums.Correction in project bioformats by openmicroscopy.

the class DeltavisionReader method populateObjective.

/**
 * Populate an Objective based upon the lens ID.
 * This is based upon information received from Applied Precision.
 */
private void populateObjective(MetadataStore store, int lensID) throws FormatException {
    Double lensNA = null;
    Double workingDistance = null;
    Immersion immersion = getImmersion("Other");
    Correction correction = getCorrection("Other");
    String manufacturer = null;
    String model = null;
    double magnification = 0;
    Double calibratedMagnification = null;
    if (lensID >= 10000 && lensID <= 32000) {
        if (lensID < 12000) {
            manufacturer = "Olympus";
        } else if (lensID < 14000) {
            manufacturer = "Nikon";
        } else if (lensID < 16000) {
            manufacturer = "Zeiss";
        } else if (lensID < 18000) {
            manufacturer = "Leica";
        } else if (lensID < 20000) {
            manufacturer = "APLLC";
        }
        magnification = ((lensID % 1000) - (lensID % 100)) / 10.0;
        if (magnification == 0) {
            magnification = 100;
        }
    }
    switch(lensID) {
        case 2001:
            lensNA = 1.15;
            immersion = getImmersion("Water");
            break;
        case 10100:
            lensNA = 0.30;
            immersion = getImmersion("Air");
            model = "1-LP134";
            correction = getCorrection("Achromat");
            break;
        case 10101:
            lensNA = 0.40;
            immersion = getImmersion("Air");
            model = "1-LB331";
            correction = getCorrection("Apo");
            break;
        case 10102:
            lensNA = 0.30;
            immersion = getImmersion("Air");
            model = "1-LP134";
            break;
        case 10103:
            lensNA = 0.13;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            model = "1-LP124";
            break;
        case 10104:
            lensNA = 0.40;
            immersion = getImmersion("Air");
            model = "1-LB331";
            break;
        case 10105:
            lensNA = 0.40;
            workingDistance = 3.10;
            immersion = getImmersion("Air");
            model = "1-LP331";
            break;
        case 10106:
            lensNA = 0.16;
            calibratedMagnification = 4.0;
            workingDistance = 13.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "1-UB822";
            break;
        case 10107:
            lensNA = 0.40;
            immersion = getImmersion("Air");
            workingDistance = 3.10;
            model = "1-UB823";
            correction = getCorrection("PlanApo");
            break;
        case 10108:
            lensNA = 0.25;
            workingDistance = 9.8;
            immersion = getImmersion("Air");
            model = "1-UC243";
            break;
        case 10109:
            lensNA = 0.30;
            immersion = getImmersion("Air");
            model = "1-UB532";
            correction = getCorrection("PlanFluor");
            break;
        case 10110:
            lensNA = 0.13;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            break;
        case 10111:
            lensNA = 0.08;
            calibratedMagnification = 2.0;
            immersion = getImmersion("Air");
            break;
        case 10112:
            lensNA = 0.13;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            model = "1-UB522";
            break;
        case 10113:
            lensNA = 0.04;
            calibratedMagnification = 1.25;
            workingDistance = 5.1;
            immersion = getImmersion("Air");
            model = "1-UB920";
            correction = getCorrection("PlanApo");
            break;
        case 10114:
            lensNA = 0.08;
            calibratedMagnification = 2.0;
            workingDistance = 6.0;
            immersion = getImmersion("Air");
            model = "1-UB921";
            correction = getCorrection("PlanApo");
            break;
        case 10200:
            lensNA = 0.40;
            workingDistance = 3.0;
            immersion = getImmersion("Air");
            break;
        case 10201:
            lensNA = 0.65;
            workingDistance = 1.03;
            immersion = getImmersion("Air");
            model = "1-LB343";
            correction = getCorrection("Apo");
            break;
        case 10202:
            lensNA = 0.40;
            immersion = getImmersion("Air");
            model = "1-LP146";
            break;
        case 10203:
            lensNA = 0.80;
            immersion = getImmersion("Oil");
            model = "1-LB342";
            correction = getCorrection("PlanApo");
            break;
        case 10204:
            lensNA = 0.70;
            immersion = getImmersion("Air");
            model = "1-LB341";
            break;
        case 10205:
            lensNA = 0.75;
            workingDistance = 0.55;
            immersion = getImmersion("Air");
            model = "1-UB765";
            correction = getCorrection("Apo");
            break;
        case 10206:
            lensNA = 0.50;
            workingDistance = 0.55;
            immersion = getImmersion("Air");
            model = "1-UC525";
            break;
        case 10207:
            lensNA = 0.40;
            workingDistance = 3.0;
            immersion = getImmersion("Air");
            model = "1-UC145";
            correction = getCorrection("Achromat");
            break;
        case 10208:
            lensNA = 0.50;
            workingDistance = 0.55;
            immersion = getImmersion("Air");
            model = "1-UB525";
            break;
        case 10209:
            lensNA = 0.40;
            workingDistance = 6.9;
            immersion = getImmersion("Air");
            model = "1-UC345";
            break;
        case 10210:
            lensNA = 0.40;
            workingDistance = 6.9;
            immersion = getImmersion("Air");
            model = "1-UB345";
            break;
        case 10400:
            lensNA = 0.55;
            workingDistance = 2.04;
            immersion = getImmersion("Air");
            break;
        case 10401:
            lensNA = 0.85;
            workingDistance = 0.25;
            immersion = getImmersion("Air");
            break;
        case 10402:
            lensNA = 1.30;
            workingDistance = 0.12;
            immersion = getImmersion("Oil");
            model = "1-LB356";
            break;
        case 10403:
            lensNA = 1.35;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            model = "1-UB768";
            break;
        case 10404:
            lensNA = 0.85;
            workingDistance = 0.20;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "1-UB827";
            break;
        case 10405:
            lensNA = 0.95;
            workingDistance = 0.14;
            immersion = getImmersion("Air");
            model = "1-UB927";
            correction = getCorrection("PlanApo");
            break;
        case 10406:
            lensNA = 1.0;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "1-UB828";
            break;
        case 10407:
            lensNA = 0.75;
            correction = getCorrection("PlanFluor");
            immersion = getImmersion("Air");
            model = "1-UB527";
            break;
        case 10408:
            lensNA = 0.60;
            workingDistance = 2.15;
            immersion = getImmersion("Air");
            model = "1-UB347";
            break;
        case 10409:
            lensNA = 0.60;
            workingDistance = 2.15;
            immersion = getImmersion("Air");
            model = "1-UC347";
            break;
        case 10410:
            lensNA = 1.15;
            immersion = getImmersion("Water");
            model = "1-UB769";
            break;
        case 10411:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            model = "1-UC527";
            correction = getCorrection("PlanFluor");
            break;
        case 10412:
            lensNA = 1.34;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            correction = getCorrection("Apo");
            break;
        case 10000:
            lensNA = 1.30;
            correction = getCorrection("Apo");
            immersion = getImmersion("Oil");
            model = "1-LB393";
            break;
        case 10001:
            lensNA = 1.30;
            immersion = getImmersion("Oil");
            model = "1-LB392";
            break;
        case 10002:
            lensNA = 1.40;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            model = "1-UB935";
            correction = getCorrection("PlanApo");
            break;
        case 10003:
            lensNA = 1.35;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            model = "1-UB836";
            correction = getCorrection("PlanApo");
            break;
        case 10004:
            lensNA = 1.30;
            immersion = getImmersion("Oil");
            model = "1-UB535";
            break;
        case 10005:
            lensNA = 1.35;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            break;
        case 10006:
            lensNA = 1.40;
            workingDistance = 0.10;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            break;
        case 10007:
            lensNA = 1.40;
            workingDistance = 0.13;
            immersion = getImmersion("Oil");
            ;
            model = "1-U2B836";
            break;
        case 10600:
            lensNA = 1.40;
            workingDistance = 0.30;
            immersion = getImmersion("Oil");
            break;
        case 10601:
            lensNA = 1.40;
            immersion = getImmersion("Oil");
            model = "1-LB751";
            break;
        case 10602:
            lensNA = 1.40;
            workingDistance = 0.1;
            immersion = getImmersion("Oil");
            model = "1-UB932";
            correction = getCorrection("PlanApo");
            break;
        case 10603:
            lensNA = 1.20;
            workingDistance = 0.25;
            immersion = getImmersion("Water");
            model = "1-UB891";
            break;
        case 10604:
            lensNA = 1.20;
            workingDistance = 0.25;
            immersion = getImmersion("Water");
            break;
        case 10605:
            lensNA = 0.70;
            workingDistance = 1.10;
            immersion = getImmersion("Air");
            model = "1-UB351";
            break;
        case 10606:
            lensNA = 0.70;
            workingDistance = 1.10;
            immersion = getImmersion("Air");
            model = "1-UC351";
            break;
        case 10607:
            lensNA = 1.40;
            immersion = getImmersion("Oil");
            model = "1-UC932";
            correction = getCorrection("PlanApo");
            break;
        case 10608:
            lensNA = 1.25;
            immersion = getImmersion("Oil");
            model = "1-UB532";
            break;
        case 10609:
            lensNA = 1.40;
            workingDistance = 0.15;
            immersion = getImmersion("Oil");
            model = "1-UB933";
            correction = getCorrection("PlanApo");
            break;
        case 10610:
            lensNA = 1.40;
            workingDistance = 0.15;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            break;
        case 10611:
            lensNA = 1.20;
            workingDistance = 0.25;
            immersion = getImmersion("Water");
            correction = getCorrection("PlanApo");
            break;
        case 10612:
            lensNA = 1.42;
            workingDistance = 0.15;
            immersion = getImmersion("Oil");
            model = "1-U2B933";
            correction = getCorrection("PlanApo");
            break;
        case 12201:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanFluor");
            model = "93146";
            break;
        case 12203:
            lensNA = 0.45;
            workingDistance = 8.1;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanFluor");
            model = "93150";
            break;
        case 12204:
            lensNA = 0.45;
            workingDistance = 4.50;
            immersion = getImmersion("Air");
            model = "MUE01200/92777";
            break;
        case 12205:
            lensNA = 0.50;
            workingDistance = 2.10;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanFluor");
            model = "MRH00200/93135";
            break;
        case 12401:
            lensNA = 1.30;
            workingDistance = 0.16;
            immersion = getImmersion("Oil");
            model = "85028";
            break;
        case 12402:
            lensNA = 1.30;
            workingDistance = 0.22;
            immersion = getImmersion("Oil");
            model = "85004";
            break;
        case 12403:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            model = "140508";
            break;
        case 12404:
            lensNA = 1.30;
            workingDistance = 0.22;
            immersion = getImmersion("Oil");
            break;
        case 12405:
            lensNA = 0.95;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "93105";
            break;
        case 12406:
            lensNA = 1.00;
            workingDistance = 0.16;
            immersion = getImmersion("Oil");
            model = "93106";
            break;
        case 12600:
            lensNA = 1.40;
            workingDistance = 0.17;
            immersion = getImmersion("Oil");
            model = "85020";
            break;
        case 12601:
            lensNA = 1.40;
            workingDistance = 0.21;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "93108";
            break;
        case 12602:
            lensNA = 1.20;
            workingDistance = 0.22;
            immersion = getImmersion("Water");
            correction = getCorrection("PlanApo");
            model = "93109";
            break;
        case 12000:
            lensNA = 1.40;
            workingDistance = 0.1;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "85025";
            break;
        case 12001:
            lensNA = 1.30;
            workingDistance = 0.14;
            immersion = getImmersion("Oil");
            model = "85005";
            break;
        case 12002:
            lensNA = 1.30;
            workingDistance = 0.14;
            immersion = getImmersion("Oil");
            correction = getCorrection("UV");
            model = "85005";
            break;
        case 12003:
            lensNA = 1.40;
            workingDistance = 0.13;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "93110";
            break;
        case 12004:
            lensNA = 1.30;
            workingDistance = 0.20;
            immersion = getImmersion("Oil");
            model = "93129";
            break;
        case 12101:
            lensNA = 0.10;
            calibratedMagnification = 2.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "202294";
            break;
        case 12102:
            lensNA = 0.20;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "108388";
            break;
        case 12103:
            lensNA = 0.2;
            calibratedMagnification = 4.0;
            workingDistance = 15.7;
            correction = getCorrection("PlanApo");
            immersion = getImmersion("Air");
            model = "93102";
            break;
        case 12104:
            lensNA = 0.45;
            workingDistance = 4.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "93103";
            break;
        case 12105:
            lensNA = 0.30;
            workingDistance = 16.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanFluor");
            model = "93134";
            break;
        case 12106:
            lensNA = 0.50;
            workingDistance = 1.20;
            immersion = getImmersion("Air");
            correction = getCorrection("SuperFluor");
            model = "93126";
            break;
        case 12107:
            lensNA = 0.25;
            workingDistance = 10.5;
            immersion = getImmersion("Air");
            model = "93183";
            break;
        case 12108:
            lensNA = 0.25;
            workingDistance = 6.10;
            immersion = getImmersion("Air");
            correction = getCorrection("Achromat");
            model = "93161";
            break;
        case 14001:
            lensNA = 1.40;
            workingDistance = 0.1;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "44 07 08 (02)";
            break;
        case 14002:
            lensNA = 1.30;
            workingDistance = 0.1;
            immersion = getImmersion("Oil");
            model = "44 07 86";
            break;
        case 14003:
            lensNA = 1.40;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "44 07 80 (02)";
            break;
        case 14004:
            lensNA = 1.30;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "46 19 46 - 9903";
            break;
        case 14005:
            lensNA = 1.40;
            immersion = getImmersion("Oil");
            model = "44 07 86 (02)";
            break;
        case 14006:
            lensNA = 1.30;
            immersion = getImmersion("Oil");
            break;
        case 14601:
            lensNA = 1.40;
            calibratedMagnification = 63.0;
            workingDistance = 0.09;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "44 07 60 (03)";
            break;
        case 14602:
            lensNA = 1.40;
            calibratedMagnification = 63.0;
            workingDistance = 0.09;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "44 07 62 (02)";
            break;
        case 14603:
            lensNA = 0.90;
            calibratedMagnification = 63.0;
            immersion = getImmersion("Water");
            model = "44 00 69";
            break;
        case 14604:
            lensNA = 1.20;
            workingDistance = 0.09;
            calibratedMagnification = 63.0;
            immersion = getImmersion("Water");
            model = "44 06 68";
            break;
        case 14401:
            lensNA = 1.30;
            workingDistance = 0.14;
            immersion = getImmersion("Oil");
            correction = getCorrection("Fluar");
            model = "44 02 55 (01)";
            break;
        case 14402:
            lensNA = 1.00;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            model = "44 07 51";
            break;
        case 14403:
            lensNA = 1.20;
            immersion = getImmersion("Water");
            correction = getCorrection("Apo");
            model = "44 00 52";
            break;
        case 14404:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanNeofluar");
            model = "44 03 51";
            break;
        case 14405:
            lensNA = 1.30;
            workingDistance = 0.15;
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanNeofluar");
            model = "44 04 50";
            break;
        case 14406:
            lensNA = 0.60;
            immersion = getImmersion("Air");
            model = "44 08 65";
            break;
        case 14407:
            lensNA = 1.30;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanNeofluar");
            break;
        case 14301:
            lensNA = 0.80;
            calibratedMagnification = 25.0;
            workingDistance = 0.80;
            correction = getCorrection("PlanNeofluar");
            model = "44 05 44";
            break;
        case 14302:
            lensNA = 0.80;
            workingDistance = 0.80;
            calibratedMagnification = 25.0;
            correction = getCorrection("PlanNeofluar");
            model = "44 05 42";
            break;
        case 14303:
            lensNA = 0.80;
            calibratedMagnification = 25.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanNeofluar");
            model = "44 05 45";
            break;
        case 14201:
            lensNA = 0.50;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanNeofluar");
            model = "44 03 41 (01)";
            break;
        case 14202:
            lensNA = 0.60;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "44 06 40";
            break;
        case 14203:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "44 06 49";
            break;
        case 14204:
            lensNA = 0.75;
            immersion = getImmersion("Air");
            correction = getCorrection("Fluar");
            model = "44 01 45";
            break;
        case 14101:
            lensNA = 0.30;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanNeofluar");
            model = "44 03 30";
            break;
        case 14102:
            lensNA = 0.25;
            immersion = getImmersion("Air");
            model = "44 01 31";
            break;
        case 14103:
            lensNA = 0.25;
            immersion = getImmersion("Air");
            model = "44 00 31";
            break;
        case 14104:
            lensNA = 0.45;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "44 06 39";
            break;
        case 14105:
            lensNA = 0.16;
            calibratedMagnification = 5.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            model = "44 06 20";
            break;
        case 18101:
            lensNA = 0.20;
            workingDistance = 3.33;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            break;
        case 18102:
            lensNA = 0.20;
            workingDistance = 2.883;
            calibratedMagnification = 2.46;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            break;
        case 18103:
            lensNA = 0.20;
            workingDistance = 2.883;
            calibratedMagnification = 4.0;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            break;
        case 18104:
            lensNA = 0.45;
            calibratedMagnification = 6.15;
            workingDistance = 2.883;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            break;
        case 18105:
            lensNA = 0.45;
            workingDistance = 2.883;
            immersion = getImmersion("Air");
            correction = getCorrection("PlanApo");
            break;
        case 18106:
            lensNA = 0.1;
            workingDistance = 24.00;
            calibratedMagnification = 1.0;
            immersion = getImmersion("Air");
            break;
        case 18201:
            lensNA = 0.55;
            workingDistance = 13.00;
            immersion = getImmersion("Air");
            break;
        case 18202:
            lensNA = 0.50;
            workingDistance = 13.00;
            immersion = getImmersion("Air");
            break;
        case 18204:
            lensNA = 0.45;
            workingDistance = 4.50;
            immersion = getImmersion("Air");
            model = "MUE01200/92777";
            break;
        case 18205:
            lensNA = 0.50;
            workingDistance = 2.10;
            immersion = getImmersion("Air");
            model = "MRH00200/93135";
            break;
        case 1:
            lensNA = 0.25;
            manufacturer = "Zeiss";
            calibratedMagnification = 10.0;
            immersion = getImmersion("Air");
            break;
        case 2:
            lensNA = 0.50;
            manufacturer = "Zeiss";
            calibratedMagnification = 25.0;
            immersion = getImmersion("Air");
            break;
        case 3:
            lensNA = 1.00;
            manufacturer = "Zeiss";
            calibratedMagnification = 50.0;
            immersion = getImmersion("Oil");
            break;
        case 4:
            lensNA = 1.25;
            manufacturer = "Zeiss";
            calibratedMagnification = 63.0;
            immersion = getImmersion("Oil");
            break;
        case 5:
            lensNA = 1.30;
            manufacturer = "Zeiss";
            calibratedMagnification = 100.0;
            immersion = getImmersion("Oil");
            break;
        case 6:
            lensNA = 1.30;
            calibratedMagnification = 100.0;
            correction = getCorrection("Neofluor");
            immersion = getImmersion("Oil");
            break;
        case 7:
            lensNA = 1.40;
            calibratedMagnification = 63.0;
            manufacturer = "Leitz";
            immersion = getImmersion("Oil");
            correction = getCorrection("PlanApo");
            break;
        case 8:
            lensNA = 1.20;
            calibratedMagnification = 63.0;
            immersion = getImmersion("Water");
            break;
        case 9:
            lensNA = 0.40;
            workingDistance = 0.30;
            calibratedMagnification = 10.0;
            manufacturer = "Olympus";
            immersion = getImmersion("Air");
            break;
        case 10:
            lensNA = 0.80;
            workingDistance = 0.30;
            manufacturer = "Olympus";
            calibratedMagnification = 20.0;
            immersion = getImmersion("Oil");
            break;
        case 11:
            lensNA = 1.30;
            calibratedMagnification = 40.0;
            manufacturer = "Olympus";
            workingDistance = 0.30;
            immersion = getImmersion("Oil");
            break;
        case 12:
            lensNA = 1.40;
            workingDistance = 0.30;
            manufacturer = "Olympus";
            calibratedMagnification = 60.0;
            immersion = getImmersion("Oil");
            break;
        case 13:
            lensNA = 1.40;
            workingDistance = 0.30;
            manufacturer = "Nikon";
            calibratedMagnification = 100.0;
            immersion = getImmersion("Oil");
            break;
    }
    String objectiveID = "Objective:" + lensID;
    store.setObjectiveID(objectiveID, 0, 0);
    for (int series = 0; series < getSeriesCount(); series++) {
        store.setObjectiveSettingsID(objectiveID, series);
    }
    store.setObjectiveLensNA(lensNA, 0, 0);
    store.setObjectiveImmersion(immersion, 0, 0);
    store.setObjectiveCorrection(correction, 0, 0);
    store.setObjectiveManufacturer(manufacturer, 0, 0);
    store.setObjectiveModel(model, 0, 0);
    store.setObjectiveNominalMagnification(magnification, 0, 0);
    if (calibratedMagnification != null) {
        store.setObjectiveCalibratedMagnification(calibratedMagnification, 0, 0);
    }
    if (workingDistance != null) {
        store.setObjectiveWorkingDistance(new Length(workingDistance, UNITS.MILLIMETER), 0, 0);
    }
}
Also used : Length(ome.units.quantity.Length) Immersion(ome.xml.model.enums.Immersion) Correction(ome.xml.model.enums.Correction)

Aggregations

Length (ome.units.quantity.Length)2 Correction (ome.xml.model.enums.Correction)2 Immersion (ome.xml.model.enums.Immersion)2 CoreMetadata (loci.formats.CoreMetadata)1 ElectricPotential (ome.units.quantity.ElectricPotential)1