Changeset 6377


Ignore:
Timestamp:
05/25/10 09:28:44 (9 years ago)
Author:
melissa
Message:

Merged r6376 back to trunk.

Location:
trunk/components/bio-formats/src/loci/formats/in
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/AliconaReader.java

    r6230 r6377  
    3232import loci.formats.MetadataTools; 
    3333import loci.formats.meta.MetadataStore; 
    34  
    35 import ome.xml.r201004.enums.Correction; 
    36 import ome.xml.r201004.enums.DetectorType; 
    37 import ome.xml.r201004.enums.Immersion; 
    3834 
    3935/** 
     
    220216 
    221217        // set required Detector type 
    222         store.setDetectorType(DetectorType.OTHER, 0, 0); 
     218        store.setDetectorType(getDetectorType("Other"), 0, 0); 
    223219      } 
    224220 
     
    234230      } 
    235231 
    236       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    237       store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     232      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     233      store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    238234 
    239235      // link Objective to an Image using ObjectiveSettings 
  • trunk/components/bio-formats/src/loci/formats/in/BDReader.java

    r6358 r6377  
    4747import loci.formats.tiff.TiffParser; 
    4848 
    49 import ome.xml.r201004.enums.Binning; 
    50 import ome.xml.r201004.enums.EnumerationException; 
    51 import ome.xml.r201004.enums.NamingConvention; 
    5249import ome.xml.r201004.primitives.NonNegativeInteger; 
    5350import ome.xml.r201004.primitives.PositiveInteger; 
     
    161158  } 
    162159 
    163   /* @see loci.formats.IFormatReader#isSingleFile(String) */ 
     160  /* see loci.formats.IFormatReader#isSingleFile(String) */ 
    164161  public boolean isSingleFile(String id) throws FormatException, IOException { 
    165162    return false; 
     
    335332          store.setDetectorSettingsGain(gain[c], i, c); 
    336333          store.setDetectorSettingsOffset(offset[c], i, c); 
    337           try { 
    338             store.setDetectorSettingsBinning(Binning.fromString(binning), i, c); 
    339           } 
    340           catch (EnumerationException e) { } 
     334          store.setDetectorSettingsBinning(getBinning(binning), i, c); 
    341335        } 
    342336 
     
    347341      } 
    348342 
    349       store.setPlateRowNamingConvention(NamingConvention.LETTER, 0); 
    350       store.setPlateColumnNamingConvention(NamingConvention.NUMBER, 0); 
     343      store.setPlateRowNamingConvention(getNamingConvention("Letter"), 0); 
     344      store.setPlateColumnNamingConvention(getNamingConvention("Number"), 0); 
    351345      store.setPlateName(plateName, 0); 
    352346      store.setPlateDescription(plateDescription, 0); 
  • trunk/components/bio-formats/src/loci/formats/in/BioRadReader.java

    r6301 r6377  
    4040import loci.formats.meta.IMinMaxStore; 
    4141import loci.formats.meta.MetadataStore; 
    42  
    43 import ome.xml.r201004.enums.Correction; 
    44 import ome.xml.r201004.enums.DetectorType; 
    45 import ome.xml.r201004.enums.EnumerationException; 
    46 import ome.xml.r201004.enums.ExperimentType; 
    47 import ome.xml.r201004.enums.Immersion; 
    4842 
    4943import org.xml.sax.Attributes; 
     
    493487      store.setObjectiveLensNA(new Double(lens), 0, 0); 
    494488      store.setObjectiveNominalMagnification((int) magFactor, 0, 0); 
    495       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    496       store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     489      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     490      store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    497491 
    498492      // link Detector to Image 
     
    505499          store.setDetectorSettingsID(detectorID, 0, i); 
    506500          store.setDetectorID(detectorID, 0, i); 
    507           store.setDetectorType(DetectorType.OTHER, 0, i); 
     501          store.setDetectorType(getDetectorType("Other"), 0, i); 
    508502        } 
    509503        if (detectorOffset != null) { 
     
    599593  } 
    600594 
    601   private boolean parseNotes(MetadataStore store) { 
     595  private boolean parseNotes(MetadataStore store) throws FormatException { 
    602596    boolean multipleFiles = false; 
    603597    int nextDetector = 0, nLasers = 0; 
     
    651645                      MetadataTools.createLSID("Detector", 0, nextDetector); 
    652646                    store.setDetectorID(detectorID, 0, nextDetector); 
    653                     store.setDetectorType(DetectorType.OTHER, 0, nextDetector); 
     647                    store.setDetectorType( 
     648                      getDetectorType("Other"), 0, nextDetector); 
    654649 
    655650                    if (key.endsWith("OFFSET")) { 
     
    816811                    store.setDetectorOffset(new Double(values[i * 3]), 0, i); 
    817812                    store.setDetectorGain(new Double(values[i * 3 + 1]), 0, i); 
    818                     store.setDetectorType(DetectorType.OTHER, 0, i); 
     813                    store.setDetectorType(getDetectorType("Other"), 0, i); 
    819814                  } 
    820815                  break; 
     
    893888                  addGlobalMeta("Time Course - experiment type", values[2]); 
    894889                  addGlobalMeta("Time Course - kd factor", values[3]); 
    895                   try { 
    896                     store.setExperimentType( 
    897                       ExperimentType.fromString(values[2]), 0); 
    898                   } 
    899                   catch (EnumerationException e) { } 
     890                  store.setExperimentType(getExperimentType(values[2]), 0); 
    900891                  break; 
    901892                case 21: 
  • trunk/components/bio-formats/src/loci/formats/in/FV1000Reader.java

    r6360 r6377  
    5353import loci.formats.tiff.TiffParser; 
    5454 
    55 import ome.xml.r201004.enums.Correction; 
    56 import ome.xml.r201004.enums.DetectorType; 
    57 import ome.xml.r201004.enums.EnumerationException; 
    58 import ome.xml.r201004.enums.IlluminationType; 
    59 import ome.xml.r201004.enums.Immersion; 
    60 import ome.xml.r201004.enums.LaserMedium; 
    61 import ome.xml.r201004.enums.LaserType; 
    6255import ome.xml.r201004.primitives.PositiveInteger; 
    6356 
     
    857850      for (int c=0; c<core[i].sizeC; c++) { 
    858851        if (c < illuminations.size()) { 
    859           try { 
    860             store.setChannelIlluminationType( 
    861               IlluminationType.fromString(illuminations.get(c)), i, c); 
    862           } 
    863           catch (EnumerationException e) { } 
     852          store.setChannelIlluminationType( 
     853            getIlluminationType(illuminations.get(c)), i, c); 
    864854        } 
    865855      } 
     
    878868      store.setDetectorGain(channel.gain, 0, channelIndex); 
    879869      store.setDetectorVoltage(channel.voltage, 0, channelIndex); 
    880       store.setDetectorType(DetectorType.PMT, 0, channelIndex); 
     870      store.setDetectorType(getDetectorType("PMT"), 0, channelIndex); 
    881871 
    882872      // populate LogicalChannel data 
     
    937927      // populate Laser data 
    938928      store.setLaserID(lightSourceID, 0, channelIndex); 
    939       try { 
    940         store.setLaserLaserMedium(LaserMedium.fromString(channel.dyeName), 
    941           0, channelIndex); 
    942       } 
    943       catch (EnumerationException e) { } 
     929      store.setLaserLaserMedium(getLaserMedium(channel.dyeName), 
     930        0, channelIndex); 
    944931      if (channelIndex < wavelengths.size()) { 
    945932        store.setLaserWavelength( 
    946933          new PositiveInteger(wavelengths.get(channelIndex)), 0, channelIndex); 
    947934      } 
    948       store.setLaserType(LaserType.OTHER, 0, channelIndex); 
     935      store.setLaserType(getLaserType("Other"), 0, channelIndex); 
    949936 
    950937      channelIndex++; 
     
    962949      store.setObjectiveWorkingDistance(new Double(workingDistance), 0, 0); 
    963950    } 
    964     store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    965     store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     951    store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     952    store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    966953 
    967954    // link Objective to Image using ObjectiveSettings 
  • trunk/components/bio-formats/src/loci/formats/in/FakeReader.java

    r6319 r6377  
    3434import loci.formats.MetadataTools; 
    3535import loci.formats.meta.MetadataStore; 
    36  
    37 import ome.xml.r201004.enums.DimensionOrder; 
    38 import ome.xml.r201004.enums.EnumerationException; 
    3936 
    4037/** 
     
    258255        sizeC + "/" + rgb); 
    259256    } 
    260     try { 
    261       DimensionOrder.fromString(dimOrder); 
    262     } 
    263     catch (EnumerationException exc) { 
    264       throw new FormatException("Invalid dimOrder: " + dimOrder, exc); 
    265     } 
     257    getDimensionOrder(dimOrder); 
    266258    if (falseColor && !indexed) { 
    267259      throw new FormatException("False color images must be indexed"); 
  • trunk/components/bio-formats/src/loci/formats/in/FluoviewReader.java

    r6316 r6377  
    3535import loci.formats.tiff.IFD; 
    3636import loci.formats.tiff.TiffParser; 
    37  
    38 import ome.xml.r201004.enums.Correction; 
    39 import ome.xml.r201004.enums.DetectorType; 
    40 import ome.xml.r201004.enums.EnumerationException; 
    41 import ome.xml.r201004.enums.Immersion; 
    4237 
    4338/** 
     
    388383        store.setDetectorSettingsOffset(new Double(offsets[i]), 0, i); 
    389384      } 
    390       store.setDetectorType(DetectorType.OTHER, 0, i); 
     385      store.setDetectorType(getDetectorType("Other"), 0, i); 
    391386 
    392387      // link DetectorSettings to an actual Detector 
     
    403398    else if (mag == null) mag = "1"; 
    404399 
    405     store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    406     store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     400    store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     401    store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    407402 
    408403    if (objectiveManufacturer != null) { 
     
    410405      store.setObjectiveModel(objectiveData[0], 0, 0); 
    411406      if (objectiveData.length > 2) { 
    412         try { 
    413           store.setObjectiveImmersion( 
    414             Immersion.fromString(objectiveData[2]), 0, 0); 
    415         } 
    416         catch (EnumerationException e) { } 
     407        store.setObjectiveImmersion(getImmersion(objectiveData[2]), 0, 0); 
    417408      } 
    418409    } 
  • trunk/components/bio-formats/src/loci/formats/in/GatanDM2Reader.java

    r6230 r6377  
    3535import loci.formats.meta.MetadataStore; 
    3636 
    37 import ome.xml.r201004.enums.Binning; 
    38 import ome.xml.r201004.enums.EnumerationException; 
    39  
    4037/** 
    4138 * GatanDM2Reader is the file format reader for Gatan .dm2 files. 
     
    197194      } 
    198195      else if (label.equals("Binning")) { 
    199         try { 
    200           store.setDetectorSettingsBinning( 
    201             Binning.fromString(value + "x" + value), 0, 0); 
    202         } 
    203         catch (EnumerationException e) { } 
     196        store.setDetectorSettingsBinning(getBinning(value + "x" + value), 0, 0); 
    204197        String detectorID = MetadataTools.createLSID("Detector", 0); 
    205198        store.setDetectorID(detectorID, 0, 0); 
  • trunk/components/bio-formats/src/loci/formats/in/GatanReader.java

    r6230 r6377  
    3434import loci.formats.MetadataTools; 
    3535import loci.formats.meta.MetadataStore; 
    36  
    37 import ome.xml.r201004.enums.AcquisitionMode; 
    38 import ome.xml.r201004.enums.EnumerationException; 
    3936 
    4037/** 
     
    218215          String mode = token.substring(0, token.indexOf(" ")).trim(); 
    219216          if (mode.equals("TEM")) mode = "Other"; 
    220           try { 
    221             store.setChannelAcquisitionMode( 
    222               AcquisitionMode.fromString(mode), 0, 0); 
    223           } 
    224           catch (EnumerationException e) { } 
     217          store.setChannelAcquisitionMode(getAcquisitionMode(mode), 0, 0); 
    225218        } 
    226219      } 
  • trunk/components/bio-formats/src/loci/formats/in/HISReader.java

    r6230 r6377  
    3636import loci.formats.codec.BitBuffer; 
    3737import loci.formats.meta.MetadataStore; 
    38  
    39 import ome.xml.r201004.enums.Binning; 
    40 import ome.xml.r201004.enums.DetectorType; 
    41 import ome.xml.r201004.enums.EnumerationException; 
    4238 
    4339/** 
     
    249245        store.setDetectorID(detectorID, 0, i); 
    250246        store.setDetectorOffset(offset[i], 0, i); 
    251         store.setDetectorType(DetectorType.OTHER, 0, i); 
     247        store.setDetectorType(getDetectorType("Other"), 0, i); 
    252248        store.setDetectorSettingsID(detectorID, i, 0); 
    253         try { 
    254           store.setDetectorSettingsBinning( 
    255             Binning.fromString(binning[i]), i, 0); 
    256         } 
    257         catch (EnumerationException e) { } 
     249        store.setDetectorSettingsBinning(getBinning(binning[i]), i, 0); 
    258250      } 
    259251    } 
  • trunk/components/bio-formats/src/loci/formats/in/ICSReader.java

    r6301 r6377  
    4141import loci.formats.meta.MetadataStore; 
    4242 
    43 import ome.xml.r201004.enums.Correction; 
    44 import ome.xml.r201004.enums.DetectorType; 
    45 import ome.xml.r201004.enums.EnumerationException; 
    46 import ome.xml.r201004.enums.Immersion; 
    47 import ome.xml.r201004.enums.LaserMedium; 
    48 import ome.xml.r201004.enums.LaserType; 
    4943import ome.xml.r201004.primitives.PositiveInteger; 
    5044 
     
    830824        store.setLaserWavelength( 
    831825          new PositiveInteger(wavelengths.get(laser)), 0, laser.intValue()); 
    832         store.setLaserType(LaserType.OTHER, 0, laser.intValue()); 
    833         store.setLaserLaserMedium(LaserMedium.OTHER, 0, laser.intValue()); 
     826        store.setLaserType(getLaserType("Other"), 0, laser.intValue()); 
     827        store.setLaserLaserMedium(getLaserMedium("Other"), 0, laser.intValue()); 
    834828      } 
    835829 
     
    838832      if (objectiveModel != null) store.setObjectiveModel(objectiveModel, 0, 0); 
    839833      if (immersion == null) immersion = "Other"; 
    840       try { 
    841         store.setObjectiveImmersion(Immersion.fromString(immersion), 0, 0); 
    842       } 
    843       catch (EnumerationException e) { } 
     834      store.setObjectiveImmersion(getImmersion(immersion), 0, 0); 
    844835      if (lensNA != null) store.setObjectiveLensNA(lensNA, 0, 0); 
    845836      if (workingDistance != null) { 
     
    849840        store.setObjectiveCalibratedMagnification(magnification, 0, 0); 
    850841      } 
    851       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
     842      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
    852843 
    853844      // link Objective to Image 
     
    860851        if (index < getEffectiveSizeC()) { 
    861852          store.setDetectorSettingsGain(gains.get(key), 0, index); 
    862           store.setDetectorType(DetectorType.OTHER, 0, index); 
     853          store.setDetectorType(getDetectorType("Other"), 0, index); 
    863854          String detectorID = MetadataTools.createLSID("Detector", 0, index); 
    864855          store.setDetectorID(detectorID, 0, index); 
  • trunk/components/bio-formats/src/loci/formats/in/ImarisReader.java

    r6230 r6377  
    3232import loci.formats.MetadataTools; 
    3333import loci.formats.meta.MetadataStore; 
    34  
    35 import ome.xml.r201004.enums.DetectorType; 
    3634 
    3735/** 
     
    235233        String detectorID = MetadataTools.createLSID("Detector", 0, i); 
    236234        store.setDetectorID(detectorID, 0, i); 
    237         store.setDetectorType(DetectorType.OTHER, 0, i); 
     235        store.setDetectorType(getDetectorType("Other"), 0, i); 
    238236        store.setDetectorSettingsID(detectorID, 0, i); 
    239237      } 
  • trunk/components/bio-formats/src/loci/formats/in/InCellReader.java

    r6301 r6377  
    3838import loci.formats.meta.MetadataStore; 
    3939 
    40 import ome.xml.r201004.enums.Binning; 
    41 import ome.xml.r201004.enums.Correction; 
    42 import ome.xml.r201004.enums.DetectorType; 
    43 import ome.xml.r201004.enums.EnumerationException; 
    44 import ome.xml.r201004.enums.ExperimentType; 
    45 import ome.xml.r201004.enums.Immersion; 
    46 import ome.xml.r201004.enums.NamingConvention; 
    4740import ome.xml.r201004.primitives.NonNegativeInteger; 
    4841import ome.xml.r201004.primitives.PositiveInteger; 
     
    470463      // populate Plate data 
    471464 
    472       NamingConvention rowNaming = Character.isDigit(rowName.charAt(0)) ? 
    473         NamingConvention.NUMBER : NamingConvention.LETTER; 
    474       NamingConvention colNaming = Character.isDigit(colName.charAt(0)) ? 
    475         NamingConvention.NUMBER : NamingConvention.LETTER; 
    476  
    477       store.setPlateRowNamingConvention(rowNaming, 0); 
    478       store.setPlateColumnNamingConvention(colNaming, 0); 
     465      String rowNaming = 
     466        Character.isDigit(rowName.charAt(0)) ? "Number" : "Letter"; 
     467      String colNaming = 
     468        Character.isDigit(colName.charAt(0)) ? "Number" : "Letter"; 
     469 
     470      store.setPlateRowNamingConvention(getNamingConvention(rowNaming), 0); 
     471      store.setPlateColumnNamingConvention(getNamingConvention(colNaming), 0); 
    479472      store.setPlateWellOriginX(0.5, 0); 
    480473      store.setPlateWellOriginY(0.5, 0); 
     
    712705        try { 
    713706          store.setExperimentType( 
    714             ExperimentType.fromString(attributes.getValue("type")), 0); 
    715         } 
    716         catch (EnumerationException e) { } 
     707            getExperimentType(attributes.getValue("type")), 0); 
     708        } 
     709        catch (FormatException e) { 
     710          LOGGER.warn("", e); 
     711        } 
    717712      } 
    718713      else if (qName.equals("Image")) { 
     
    746741        store.setObjectiveLensNA(new Double( 
    747742          attributes.getValue("numerical_aperture")), 0, 0); 
    748         store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     743        try { 
     744         store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
     745        } 
     746        catch (FormatException e) { 
     747          LOGGER.warn("", e); 
     748        } 
    749749 
    750750        String objective = attributes.getValue("objective_name"); 
     
    752752 
    753753        store.setObjectiveManufacturer(tokens[0], 0, 0); 
    754         if (tokens.length > 2) { 
    755           try { 
    756             store.setObjectiveCorrection( 
    757               Correction.fromString(tokens[2]), 0, 0); 
    758           } 
    759           catch (EnumerationException e) { } 
    760         } 
    761         else store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
     754        String correction = tokens.length > 2 ? tokens[2] : "Other"; 
     755        try { 
     756          store.setObjectiveCorrection(getCorrection(correction), 0, 0); 
     757        } 
     758        catch (FormatException e) { 
     759          LOGGER.warn("", e); 
     760        } 
    762761 
    763762        Double pixelSizeX = new Double(attributes.getValue("pixel_width")); 
     
    787786      else if (qName.equals("Camera")) { 
    788787        store.setDetectorModel(attributes.getValue("name"), 0, 0); 
    789         store.setDetectorType(DetectorType.OTHER, 0, 0); 
     788        try { 
     789          store.setDetectorType(getDetectorType("Other"), 0, 0); 
     790        } 
     791        catch (FormatException e) { 
     792          LOGGER.warn("", e); 
     793        } 
    790794        String detectorID = MetadataTools.createLSID("Detector", 0, 0); 
    791795        store.setDetectorID(detectorID, 0, 0); 
     
    800804      else if (qName.equals("Binning")) { 
    801805        String binning = attributes.getValue("value"); 
    802         try { 
    803           Binning b = Binning.fromString(binning); 
    804           for (int i=0; i<getSeriesCount(); i++) { 
    805             setSeries(i); 
    806             for (int q=0; q<getSizeC(); q++) { 
    807               store.setDetectorSettingsBinning(b, i, q); 
     806        for (int i=0; i<getSeriesCount(); i++) { 
     807          setSeries(i); 
     808          for (int q=0; q<getSizeC(); q++) { 
     809            try { 
     810              store.setDetectorSettingsBinning(getBinning(binning), i, q); 
    808811            } 
    809           } 
    810         } 
    811         catch (EnumerationException e) { } 
     812            catch (FormatException e) { } 
     813          } 
     814        } 
    812815        setSeries(0); 
    813816      } 
  • trunk/components/bio-formats/src/loci/formats/in/IvisionReader.java

    r6329 r6377  
    3434import loci.formats.MetadataTools; 
    3535import loci.formats.meta.MetadataStore; 
    36  
    37 import ome.xml.r201004.enums.Binning; 
    38 import ome.xml.r201004.enums.Correction; 
    39 import ome.xml.r201004.enums.DetectorType; 
    40 import ome.xml.r201004.enums.EnumerationException; 
    41 import ome.xml.r201004.enums.Immersion; 
    4236 
    4337import org.xml.sax.Attributes; 
     
    262256      store.setImageObjectiveSettingsID(objectiveID, 0); 
    263257 
    264       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    265       store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     258      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     259      store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    266260 
    267261      if (lensNA != null) store.setObjectiveLensNA(lensNA, 0, 0); 
     
    277271      store.setDetectorSettingsID(detectorID, 0, 0); 
    278272 
    279       store.setDetectorType(DetectorType.OTHER, 0, 0); 
    280  
    281       try { 
    282         store.setDetectorSettingsBinning( 
    283           Binning.fromString(binX + "x" + binY), 0, 0); 
    284       } 
    285       catch (EnumerationException e) { } 
     273      store.setDetectorType(getDetectorType("Other"), 0, 0); 
     274 
     275      store.setDetectorSettingsBinning(getBinning(binX + "x" + binY), 0, 0); 
    286276      if (gain != null) { 
    287277        store.setDetectorSettingsGain(new Double(gain), 0, 0); 
  • trunk/components/bio-formats/src/loci/formats/in/L2DReader.java

    r6301 r6377  
    3838import loci.formats.meta.MetadataStore; 
    3939 
    40 import ome.xml.r201004.enums.LaserMedium; 
    41 import ome.xml.r201004.enums.LaserType; 
    42 import ome.xml.r201004.enums.MicroscopeType; 
    4340import ome.xml.r201004.primitives.PositiveInteger; 
    4441 
     
    296293            Integer wave = new Integer(waves[q].trim()); 
    297294            store.setLaserWavelength(new PositiveInteger(wave), 0, q); 
    298             store.setLaserType(LaserType.OTHER, 0, q); 
    299             store.setLaserLaserMedium(LaserMedium.OTHER, 0, q); 
     295            store.setLaserType(getLaserType("Other"), 0, q); 
     296            store.setLaserLaserMedium(getLaserMedium("Other"), 0, q); 
    300297            store.setChannelLightSourceSettingsID(laser, i, q); 
    301298          } 
     
    304301 
    305302      store.setMicroscopeModel(model, 0); 
    306       store.setMicroscopeType(MicroscopeType.OTHER, 0); 
     303      store.setMicroscopeType(getMicroscopeType("Other"), 0); 
    307304    } 
    308305  } 
  • trunk/components/bio-formats/src/loci/formats/in/LeicaHandler.java

    r6315 r6377  
    4343import ome.xml.r201004.enums.LaserType; 
    4444import ome.xml.r201004.enums.MicroscopeType; 
     45import ome.xml.r201004.enums.handlers.CorrectionEnumHandler; 
     46import ome.xml.r201004.enums.handlers.DetectorTypeEnumHandler; 
     47import ome.xml.r201004.enums.handlers.ImmersionEnumHandler; 
     48import ome.xml.r201004.enums.handlers.LaserMediumEnumHandler; 
     49import ome.xml.r201004.enums.handlers.LaserTypeEnumHandler; 
     50import ome.xml.r201004.enums.handlers.MicroscopeTypeEnumHandler; 
    4551import ome.xml.r201004.primitives.PercentFraction; 
    4652import ome.xml.r201004.primitives.PositiveInteger; 
     
    297303          store.setDetectorID(id, numDatasets, detectorChannel); 
    298304          try { 
    299             store.setDetectorType(DetectorType.fromString(d.type), 
     305            DetectorTypeEnumHandler handler = new DetectorTypeEnumHandler(); 
     306            store.setDetectorType((DetectorType) handler.getEnumeration(d.type), 
    300307              numDatasets, detectorChannel); 
    301308          } 
     
    572579        } 
    573580        try { 
     581          ImmersionEnumHandler handler = new ImmersionEnumHandler(); 
    574582          store.setObjectiveImmersion( 
    575             Immersion.fromString(immersion), numDatasets, 0); 
     583            (Immersion) handler.getEnumeration(immersion), numDatasets, 0); 
    576584        } 
    577585        catch (EnumerationException e) { } 
     
    585593        } 
    586594        try { 
     595          CorrectionEnumHandler handler = new CorrectionEnumHandler(); 
    587596          store.setObjectiveCorrection( 
    588             Correction.fromString(correction), numDatasets, 0); 
     597            (Correction) handler.getEnumeration(correction), numDatasets, 0); 
    589598        } 
    590599        catch (EnumerationException e) { } 
     
    715724          store.setDetectorSettingsID(id, numDatasets, nextChannel); 
    716725          try { 
     726            DetectorTypeEnumHandler handler = new DetectorTypeEnumHandler(); 
    717727            store.setDetectorType( 
    718               DetectorType.fromString(detector.type), numDatasets, nextChannel); 
     728              (DetectorType) handler.getEnumeration(detector.type), 
     729              numDatasets, nextChannel); 
    719730          } 
    720731          catch (EnumerationException e) { } 
  • trunk/components/bio-formats/src/loci/formats/in/LeicaReader.java

    r6359 r6377  
    3030import java.util.StringTokenizer; 
    3131import java.util.Vector; 
    32  
    33 import org.slf4j.Logger; 
    34 import org.slf4j.LoggerFactory; 
    3532 
    3633import loci.common.DataTools; 
     
    5148import loci.formats.tiff.TiffParser; 
    5249 
    53 import ome.xml.r201004.enums.Correction; 
    54 import ome.xml.r201004.enums.DetectorType; 
    55 import ome.xml.r201004.enums.EnumerationException; 
    56 import ome.xml.r201004.enums.Immersion; 
    5750import ome.xml.r201004.primitives.PositiveInteger; 
     51 
     52import org.slf4j.Logger; 
     53import org.slf4j.LoggerFactory; 
    5854 
    5955/** 
     
    10311027 
    10321028  private void parseInstrumentData(MetadataStore store, int blockNum) 
    1033     throws IOException 
     1029    throws FormatException, IOException 
    10341030  { 
    10351031    int series = getSeries(); 
     
    10411037    int nElements = in.readInt(); 
    10421038    in.skipBytes(4); 
     1039 
    10431040    long initialOffset = in.getFilePointer(); 
    10441041    long elementOffset = 0; 
     
    10831080      LOGGER.trace("data: {}", data); 
    10841081      if (data.trim().length() == 0) { 
    1085         LOGGER.trace("Zero length data string, continuing..."); 
     1082        LOGGER.trace("Zero length dat string, continuing..."); 
    10861083        continue; 
    10871084      } 
     
    11031100            } 
    11041101            else if (tokens[2].equals("State")) { 
    1105               store.setDetectorType(DetectorType.PMT, series, nextDetector); 
     1102              store.setDetectorType( 
     1103                getDetectorType("PMT"), series, nextDetector); 
    11061104              // link Detector to Image, if the detector was actually used 
    11071105              if (data.equals("Active")) { 
     
    11771175          if (correction == null) correction = "Unknown"; 
    11781176 
    1179           try { 
    1180             store.setObjectiveImmersion( 
    1181               Immersion.fromString(immersion), series, objective); 
    1182           } 
    1183           catch (EnumerationException e) { } 
    1184           try { 
    1185             store.setObjectiveCorrection( 
    1186               Correction.fromString(correction.trim()), series, objective); 
    1187           } 
    1188           catch (EnumerationException e) { } 
     1177          store.setObjectiveImmersion( 
     1178            getImmersion(immersion), series, objective); 
     1179          store.setObjectiveCorrection( 
     1180            getCorrection(correction.trim()), series, objective); 
    11891181          store.setObjectiveModel(model.toString().trim(), series, objective); 
    11901182          store.setObjectiveLensNA(new Double(na), series, objective); 
  • trunk/components/bio-formats/src/loci/formats/in/MIASReader.java

    r6301 r6377  
    4949import loci.formats.tiff.TiffParser; 
    5050 
    51 import ome.xml.r201004.enums.ExperimentType; 
    52 import ome.xml.r201004.enums.NamingConvention; 
    5351import ome.xml.r201004.primitives.NonNegativeInteger; 
    5452 
     
    694692    if (getMetadataOptions().getMetadataLevel() == MetadataLevel.ALL) { 
    695693      store.setExperimentID("Experiment:" + experiment.getName(), 0); 
    696       store.setExperimentType(ExperimentType.OTHER, 0); 
     694      store.setExperimentType(getExperimentType("Other"), 0); 
    697695 
    698696      // populate SPW metadata 
    699       store.setPlateColumnNamingConvention(NamingConvention.NUMBER, 0); 
    700       store.setPlateRowNamingConvention(NamingConvention.LETTER, 0); 
     697      store.setPlateColumnNamingConvention(getNamingConvention("Number"), 0); 
     698      store.setPlateRowNamingConvention(getNamingConvention("Letter"), 0); 
    701699 
    702700      parseTemplateFile(store); 
  • trunk/components/bio-formats/src/loci/formats/in/MetamorphReader.java

    r6367 r6377  
    4848import loci.formats.tiff.TiffRational; 
    4949 
    50 import ome.xml.r201004.enums.Binning; 
    51 import ome.xml.r201004.enums.DetectorType; 
    52 import ome.xml.r201004.enums.EnumerationException; 
    53 import ome.xml.r201004.enums.LaserMedium; 
    54 import ome.xml.r201004.enums.LaserType; 
    5550import ome.xml.r201004.primitives.PositiveInteger; 
    5651 
     
    544539        } 
    545540        if (handler.getBinning() != null) binning = handler.getBinning(); 
    546         try { 
    547           Binning b = Binning.fromString(binning); 
    548           store.setDetectorSettingsBinning(b, i, c); 
    549         } 
    550         catch (EnumerationException e) { } 
     541        store.setDetectorSettingsBinning(getBinning(binning), i, c); 
    551542        if (handler.getReadOutRate() != 0) { 
    552543          store.setDetectorSettingsReadOutRate(handler.getReadOutRate(), i, c); 
     
    564555          store.setLaserID(lightSourceID, i, c); 
    565556          store.setChannelLightSourceSettingsID(lightSourceID, i, c); 
    566           store.setLaserType(LaserType.OTHER, i, c); 
    567           store.setLaserLaserMedium(LaserMedium.OTHER, i, c); 
     557          store.setLaserType(getLaserType("Other"), i, c); 
     558          store.setLaserLaserMedium(getLaserMedium("Other"), i, c); 
    568559        } 
    569560        waveIndex++; 
     
    664655        store.setDetectorZoom(handler.getZoom(), 0, 0); 
    665656      } 
    666       store.setDetectorType(DetectorType.OTHER, 0, 0); 
     657      store.setDetectorType(getDetectorType("Other"), 0, 0); 
    667658    } 
    668659  } 
  • trunk/components/bio-formats/src/loci/formats/in/MicromanagerReader.java

    r6301 r6377  
    3939import loci.formats.MetadataTools; 
    4040import loci.formats.meta.MetadataStore; 
    41  
    42 import ome.xml.r201004.enums.Binning; 
    43 import ome.xml.r201004.enums.DetectorType; 
    44 import ome.xml.r201004.enums.EnumerationException; 
    4541 
    4642/** 
     
    447443 
    448444      for (int i=0; i<channels.length; i++) { 
    449         try { 
    450           Binning realBinning = Binning.fromString(binning); 
    451           store.setDetectorSettingsBinning(realBinning, 0, i); 
    452         } 
    453         catch (EnumerationException e) { } 
     445        store.setDetectorSettingsBinning(getBinning(binning), 0, i); 
    454446        store.setDetectorSettingsGain(new Double(gain), 0, i); 
    455447        if (i < voltage.size()) { 
     
    469461 
    470462      if (cameraMode == null) cameraMode = "Other"; 
    471       try { 
    472         store.setDetectorType(DetectorType.fromString(cameraMode), 0, 0); 
    473       } 
    474       catch (EnumerationException e) { } 
    475  
     463      store.setDetectorType(getDetectorType(cameraMode), 0, 0); 
    476464      store.setImagingEnvironmentTemperature(temperature, 0); 
    477465    } 
  • trunk/components/bio-formats/src/loci/formats/in/NativeND2Reader.java

    r6349 r6377  
    4545import loci.formats.meta.MetadataStore; 
    4646 
    47 import ome.xml.r201004.enums.AcquisitionMode; 
    48 import ome.xml.r201004.enums.Binning; 
    49 import ome.xml.r201004.enums.Correction; 
    50 import ome.xml.r201004.enums.DetectorType; 
    51 import ome.xml.r201004.enums.EnumerationException; 
    52 import ome.xml.r201004.enums.Immersion; 
    5347import ome.xml.r201004.primitives.PositiveInteger; 
    5448 
     
    901895  // -- Helper methods -- 
    902896 
    903   private void populateMetadataStore() { 
     897  private void populateMetadataStore() throws FormatException { 
    904898    MetadataStore store = makeFilterMetadata(); 
    905899    MetadataTools.populatePixels(store, this, true); 
     
    974968    store.setDetectorID(detectorID, 0, 0); 
    975969    store.setDetectorModel(cameraModel, 0, 0); 
    976     store.setDetectorType(DetectorType.OTHER, 0, 0); 
     970    store.setDetectorType(getDetectorType("Other"), 0, 0); 
    977971 
    978972    for (int i=0; i<getSeriesCount(); i++) { 
     
    986980        } 
    987981        if (index < modality.size()) { 
    988           try { 
    989             store.setChannelAcquisitionMode( 
    990               AcquisitionMode.fromString(modality.get(index)), i, c); 
    991           } 
    992           catch (EnumerationException e) { } 
     982          store.setChannelAcquisitionMode( 
     983            getAcquisitionMode(modality.get(index)), i, c); 
    993984        } 
    994985        if (index < emWave.size()) { 
     
    1001992        } 
    1002993        if (index < binning.size()) { 
    1003           try { 
    1004             store.setDetectorSettingsBinning( 
    1005               Binning.fromString(binning.get(index)), i, c); 
    1006           } 
    1007           catch (EnumerationException e) { } 
     994          store.setDetectorSettingsBinning( 
     995            getBinning(binning.get(index)), i, c); 
    1008996        } 
    1009997        if (index < gain.size()) { 
     
    10431031    } 
    10441032    if (immersion == null) immersion = "Other"; 
    1045     try { 
    1046       store.setObjectiveImmersion(Immersion.fromString(immersion), 0, 0); 
    1047     } 
    1048     catch (EnumerationException e) { } 
     1033    store.setObjectiveImmersion(getImmersion(immersion), 0, 0); 
    10491034    if (correction == null || correction.length() == 0) correction = "Other"; 
    1050     try { 
    1051       store.setObjectiveCorrection(Correction.fromString(correction), 0, 0); 
    1052     } 
    1053     catch (EnumerationException e) { } 
     1035    store.setObjectiveCorrection(getCorrection(correction), 0, 0); 
    10541036 
    10551037    // link Objective to Image 
  • trunk/components/bio-formats/src/loci/formats/in/NikonTiffReader.java

    r6230 r6377  
    3535import loci.formats.tiff.TiffParser; 
    3636 
    37 import ome.xml.r201004.enums.Correction; 
    38 import ome.xml.r201004.enums.DetectorType; 
    39 import ome.xml.r201004.enums.EnumerationException; 
    40 import ome.xml.r201004.enums.Immersion; 
    41 import ome.xml.r201004.enums.LaserMedium; 
    42 import ome.xml.r201004.enums.LaserType; 
    4337import ome.xml.r201004.primitives.PositiveInteger; 
    4438 
     
    234228 
    235229      if (correction == null) correction = "Other"; 
    236       try { 
    237         store.setObjectiveCorrection(Correction.fromString(correction), 0, 0); 
    238       } 
    239       catch (EnumerationException e) { } 
     230      store.setObjectiveCorrection(getCorrection(correction), 0, 0); 
    240231      store.setObjectiveLensNA(lensNA, 0, 0); 
    241232      store.setObjectiveWorkingDistance(workingDistance, 0, 0); 
    242233      if (immersion == null) immersion = "Other"; 
    243       try { 
    244         store.setObjectiveImmersion(Immersion.fromString(immersion), 0, 0); 
    245       } 
    246       catch (EnumerationException e) { } 
     234      store.setObjectiveImmersion(getImmersion(immersion), 0, 0); 
    247235 
    248236      for (int i=0; i<wavelength.size(); i++) { 
     
    251239        store.setLaserModel(laserIDs.get(i), 0, i); 
    252240        store.setLaserWavelength(new PositiveInteger(wavelength.get(i)), 0, i); 
    253         store.setLaserType(LaserType.OTHER, 0, i); 
    254         store.setLaserLaserMedium(LaserMedium.OTHER, 0, i); 
     241        store.setLaserType(getLaserType("Other"), 0, i); 
     242        store.setLaserLaserMedium(getLaserMedium("Other"), 0, i); 
    255243      } 
    256244 
    257245      for (int i=0; i<gain.size(); i++) { 
    258246        store.setDetectorGain(gain.get(i), 0, i); 
    259         store.setDetectorType(DetectorType.OTHER, 0, i); 
     247        store.setDetectorType(getDetectorType("Other"), 0, i); 
    260248      } 
    261249 
  • trunk/components/bio-formats/src/loci/formats/in/OpenlabReader.java

    r6349 r6377  
    4040import loci.formats.codec.LZOCodec; 
    4141import loci.formats.meta.MetadataStore; 
    42  
    43 import ome.xml.r201004.enums.DetectorType; 
    4442 
    4543/** 
     
    591589      store.setDetectorSettingsID(detectorID, 0, 0); 
    592590 
    593       store.setDetectorType(DetectorType.OTHER, 0, 0); 
     591      store.setDetectorType(getDetectorType("Other"), 0, 0); 
    594592 
    595593      Double stageX = xPos == null ? null : new Double(xPos); 
  • trunk/components/bio-formats/src/loci/formats/in/PCIReader.java

    r6369 r6377  
    4444import loci.formats.tiff.TiffParser; 
    4545 
    46 import ome.xml.r201004.enums.Binning; 
    47 import ome.xml.r201004.enums.DetectorType; 
    48 import ome.xml.r201004.enums.EnumerationException; 
    49  
    5046/** 
    5147 * PCIReader is the file format reader for SimplePCI (Compix) .cxd files. 
     
    308304        store.setInstrumentID(instrumentID, 0); 
    309305        store.setDetectorID(detectorID, 0, 0); 
    310         store.setDetectorType(DetectorType.OTHER, 0, 0); 
     306        store.setDetectorType(getDetectorType("Other"), 0, 0); 
    311307        store.setImageInstrumentRef(instrumentID, 0); 
    312308 
    313309        for (int c=0; c<getEffectiveSizeC(); c++) { 
    314310          store.setDetectorSettingsID(detectorID, 0, c); 
    315           try { 
    316             store.setDetectorSettingsBinning( 
    317               Binning.fromString(binning + "x" + binning), 0, c); 
    318           } 
    319           catch (EnumerationException e) { } 
     311          store.setDetectorSettingsBinning( 
     312            getBinning(binning + "x" + binning), 0, c); 
    320313        } 
    321314      } 
  • trunk/components/bio-formats/src/loci/formats/in/PrairieReader.java

    r6373 r6377  
    4242import loci.formats.tiff.IFD; 
    4343import loci.formats.tiff.TiffParser; 
    44  
    45 import ome.xml.r201004.enums.DetectorType; 
    4644 
    4745import org.xml.sax.Attributes; 
     
    306304            store.setDetectorID(detectorID, 0, i); 
    307305            store.setDetectorSettingsID(detectorID, 0, i); 
    308             store.setDetectorType(DetectorType.OTHER, 0, i); 
     306            store.setDetectorType(getDetectorType("Other"), 0, i); 
    309307          } 
    310308 
  • trunk/components/bio-formats/src/loci/formats/in/ScanrReader.java

    r6358 r6377  
    4141import loci.formats.tiff.TiffParser; 
    4242 
    43 import ome.xml.r201004.enums.Correction; 
    44 import ome.xml.r201004.enums.Immersion; 
    45 import ome.xml.r201004.enums.NamingConvention; 
    4643import ome.xml.r201004.primitives.NonNegativeInteger; 
    4744 
     
    462459      } 
    463460 
    464       if (wellRows > 26) { 
    465         store.setPlateRowNamingConvention(NamingConvention.NUMBER, 0); 
    466         store.setPlateColumnNamingConvention(NamingConvention.LETTER, 0); 
    467       } 
    468       else { 
    469         store.setPlateRowNamingConvention(NamingConvention.LETTER, 0); 
    470         store.setPlateColumnNamingConvention(NamingConvention.NUMBER, 0); 
    471       } 
     461      String row = wellRows > 26 ? "Number" : "Letter"; 
     462      String col = wellRows > 26 ? "Letter" : "Number"; 
     463 
     464      store.setPlateRowNamingConvention(getNamingConvention(row), 0); 
     465      store.setPlateColumnNamingConvention(getNamingConvention(col), 0); 
    472466      store.setPlateName(plateName, 0); 
    473467    } 
  • trunk/components/bio-formats/src/loci/formats/in/SlidebookReader.java

    r6230 r6377  
    3737import loci.formats.MetadataTools; 
    3838import loci.formats.meta.MetadataStore; 
    39  
    40 import ome.xml.r201004.enums.Correction; 
    41 import ome.xml.r201004.enums.Immersion; 
    4239 
    4340/** 
     
    532529      // populate Objective data 
    533530      store.setObjectiveModel(objective, 0, 0); 
    534       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    535       store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     531      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     532      store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    536533 
    537534      // link Objective to Image 
  • trunk/components/bio-formats/src/loci/formats/in/TillVisionReader.java

    r6358 r6377  
    4848import loci.formats.services.POIService; 
    4949 
    50 import ome.xml.r201004.enums.EnumerationException; 
    51 import ome.xml.r201004.enums.ExperimentType; 
    52  
    5350/** 
    5451 * TillVisionReader is the file format reader for TillVision files. 
     
    121118        } 
    122119      } 
     120      pixelsStream = null; 
    123121      pixelsFiles = null; 
    124       pixelsStream = null; 
    125122      embeddedOffset = 0; 
    126123      embeddedImages = false; 
     
    413410  // -- Helper methods -- 
    414411 
    415   private void populateMetadataStore() { 
     412  private void populateMetadataStore() throws FormatException { 
    416413    MetadataStore store = makeFilterMetadata(); 
    417414    MetadataTools.populatePixels(store, this, true); 
     
    440437 
    441438        if (i < types.size()) { 
    442           try { 
    443             store.setExperimentType(ExperimentType.fromString(types.get(i)), i); 
    444           } 
    445           catch (EnumerationException e) { } 
     439          store.setExperimentType(getExperimentType(types.get(i)), i); 
    446440        } 
    447441      } 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6368 r6377  
    5050import loci.formats.tiff.TiffParser; 
    5151 
    52 import ome.xml.r201004.enums.Binning; 
    53 import ome.xml.r201004.enums.Correction; 
    54 import ome.xml.r201004.enums.DetectorType; 
    55 import ome.xml.r201004.enums.EnumerationException; 
    56 import ome.xml.r201004.enums.FilterType; 
    57 import ome.xml.r201004.enums.Immersion; 
    58 import ome.xml.r201004.enums.LaserMedium; 
    59 import ome.xml.r201004.enums.LaserType; 
    60  
    6152/** 
    6253 * ZeissLSMReader is the file format reader for Zeiss LSM files. 
     
    166157 
    167158  private int nextLaser = 0, nextDetector = 0; 
    168   private int nextFilter = 0, nextDichroicChannel, nextDichroic = 0; 
     159  private int nextFilter = 0, nextDichroicChannel = 0, nextDichroic = 0; 
    169160  private int nextDataChannel = 0, nextIllumChannel = 0, nextDetectChannel = 0; 
    170161  private boolean splitPlanes = false; 
     
    917908  protected void populateMetadataStore(SubBlock block, MetadataStore store, 
    918909    int series) 
     910    throws FormatException 
    919911  { 
    920912    if (getMetadataOptions().getMetadataLevel() != MetadataLevel.ALL) { 
     
    933925        binning = recording.binning; 
    934926      } 
    935       try { 
    936         store.setObjectiveCorrection( 
    937           Correction.fromString(recording.correction), series, 0); 
    938       } 
    939       catch (EnumerationException e) { } 
    940       try { 
    941         store.setObjectiveImmersion( 
    942           Immersion.fromString(recording.immersion), series, 0); 
    943       } 
    944       catch (EnumerationException e) { } 
     927      store.setObjectiveCorrection( 
     928        getCorrection(recording.correction), series, 0); 
     929      store.setObjectiveImmersion(getImmersion(recording.immersion), series, 0); 
    945930      store.setObjectiveNominalMagnification(recording.magnification, 
    946931        series, 0); 
     
    952937      Laser laser = (Laser) block; 
    953938      if (laser.medium != null) { 
    954         try { 
    955           store.setLaserLaserMedium(LaserMedium.fromString(laser.medium), 
    956             series, nextLaser); 
    957         } 
    958         catch (EnumerationException e) { } 
     939        store.setLaserLaserMedium(getLaserMedium(laser.medium), 
     940          series, nextLaser); 
    959941      } 
    960942      if (laser.type != null) { 
    961         try { 
    962           store.setLaserType( 
    963             LaserType.fromString(laser.type), series, nextLaser); 
    964         } 
    965         catch (EnumerationException e) { } 
     943        store.setLaserType(getLaserType(laser.type), series, nextLaser); 
    966944      } 
    967945      String lightSourceID = 
     
    1005983          else if (type.equals("LP")) type = "LongPass"; 
    1006984 
    1007           try { 
    1008             store.setFilterType( 
    1009               FilterType.fromString(type), series, nextFilter); 
    1010           } 
    1011           catch (EnumerationException e) { } 
     985          store.setFilterType(getFilterType(type), series, nextFilter); 
    1012986 
    1013987          String transmittance = channel.filter.substring(space + 1).trim(); 
     
    10351009        if (channel.acquire && nextDetector < getSizeC()) { 
    10361010          store.setDetectorSettingsID(detectorID, series, nextDetector); 
    1037           try { 
    1038             store.setDetectorSettingsBinning( 
    1039               Binning.fromString(binning), series, nextDetector); 
    1040           } 
    1041           catch (EnumerationException e) { } 
     1011          store.setDetectorSettingsBinning( 
     1012            getBinning(binning), series, nextDetector); 
    10421013        } 
    10431014      } 
     
    10491020        store.setDetectorGain(channel.gain, series, nextDetector); 
    10501021      } 
    1051       store.setDetectorType(DetectorType.PMT, series, nextDetector); 
     1022      store.setDetectorType(getDetectorType("PMT"), series, nextDetector); 
    10521023      store.setDetectorZoom(zoom, series, nextDetector); 
    10531024      nextDetectChannel++; 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r6361 r6377  
    5151import loci.formats.services.POIService; 
    5252 
    53 import ome.xml.r201004.enums.Correction; 
    54 import ome.xml.r201004.enums.DetectorType; 
    55 import ome.xml.r201004.enums.EnumerationException; 
    56 import ome.xml.r201004.enums.Immersion; 
    5753import ome.xml.r201004.primitives.PositiveInteger; 
    5854 
     
    723719        store.setDetectorID(detectorID, 0, i); 
    724720        store.setDetectorSettingsID(detectorID, 0, i); 
    725         store.setDetectorType(DetectorType.OTHER, 0, i); 
     721        store.setDetectorType(getDetectorType("Other"), 0, i); 
    726722      } 
    727723 
     
    730726      store.setObjectiveID(objectiveID, 0, 0); 
    731727      store.setImageObjectiveSettingsID(objectiveID, 0); 
    732       store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    733       store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     728      store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     729      store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    734730    } 
    735731  } 
     
    793789  /** Parse all of the tags in a stream. */ 
    794790  private void parseTags(int image, String file, MetadataStore store) 
    795     throws IOException 
     791    throws FormatException, IOException 
    796792  { 
    797793    RandomAccessInputStream s = poi.getDocumentStream(file); 
     
    927923        else if (key.startsWith("Objective ID")) { 
    928924          store.setObjectiveID("Objective:" + value, 0, 0); 
    929           store.setObjectiveCorrection(Correction.OTHER, 0, 0); 
    930           store.setObjectiveImmersion(Immersion.OTHER, 0, 0); 
     925          store.setObjectiveCorrection(getCorrection("Other"), 0, 0); 
     926          store.setObjectiveImmersion(getImmersion("Other"), 0, 0); 
    931927        } 
    932928        else if (key.startsWith("Objective N.A.")) { 
     
    943939              store.setObjectiveNominalMagnification(mag, 0, 0); 
    944940              store.setObjectiveLensNA(new Double(na), 0, 0); 
    945               try { 
    946                 store.setObjectiveCorrection( 
    947                   Correction.fromString(tokens[q - 1]), 0, 0); 
    948               } 
    949               catch (EnumerationException e) { } 
     941              store.setObjectiveCorrection(getCorrection(tokens[q - 1]), 0, 0); 
    950942              break; 
    951943            } 
     
    956948        } 
    957949        else if (key.startsWith("Objective Immersion Type")) { 
    958           Immersion immersion = null; 
     950          String immersion = "Other"; 
    959951          switch (Integer.parseInt(value)) { 
    960952            // case 1: no immersion 
    961953            case 2: 
    962               immersion = Immersion.OIL; 
     954              immersion = "Oil"; 
    963955              break; 
    964956            case 3: 
    965               immersion = Immersion.WATER; 
     957              immersion = "Water"; 
    966958              break; 
    967             default: 
    968               immersion = Immersion.OTHER; 
    969959          } 
    970           store.setObjectiveImmersion(immersion, 0, 0); 
     960          store.setObjectiveImmersion(getImmersion(immersion), 0, 0); 
    971961        } 
    972962        else if (key.indexOf("Stage Position X") != -1) { 
     
    10851075        store.setEllipseRadiusX(new Double(w / 2), imageNum, shapeIndex); 
    10861076        store.setEllipseRadiusY(new Double(h / 2), imageNum, shapeIndex); 
     1077        shapeIndex++; 
    10871078      } 
    10881079      else if (roiType == CURVE || roiType == OUTLINE || 
     
    11011092        store.setPolylinePoints(points.toString(), imageNum, shapeIndex); 
    11021093        store.setPolylineClosed(roiType != CURVE, imageNum, shapeIndex); 
     1094        shapeIndex++; 
    11031095      } 
    11041096      else if (roiType == RECTANGLE || roiType == TEXT) { 
     
    11071099        store.setRectangleWidth(new Double(w), imageNum, shapeIndex); 
    11081100        store.setRectangleHeight(new Double(h), imageNum, shapeIndex); 
     1101        shapeIndex++; 
    11091102      } 
    11101103      else if (roiType == LINE || roiType == SCALE_BAR) { 
     
    11171110        store.setLineX2(x2, imageNum, shapeIndex); 
    11181111        store.setLineY2(y2, imageNum, shapeIndex); 
     1112        shapeIndex++; 
    11191113      } 
    11201114    } 
Note: See TracChangeset for help on using the changeset viewer.