Changeset 5155


Ignore:
Timestamp:
06/08/09 12:20:51 (11 years ago)
Author:
melissa
Message:
  • Added getter/setter for Filter.ID to MetadataStore/MetadataRetrieve.
  • Lots of work on Flex metadata support. Closes #394.
Location:
trunk/components
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats-auto/src/entities.txt

    r5013 r5155  
    24662466description = TODO 
    24672467 
     2468[Filter ID] 
     2469type = String 
     2470getter = getNodeID 
     2471setter = setNodeID 
     2472description = unique label identifying the filter 
     2473 
    24682474[Filter Type] 
    24692475type = String 
  • trunk/components/bio-formats/src/loci/formats/in/FlexReader.java

    r5107 r5155  
    6363  protected double[] factors; 
    6464 
    65   /** Camera binning values. */ 
    66   //TODO: return the binX and binY 
    67   private int binX, binY; 
     65  private Vector<ImageInfo> images; 
    6866 
    6967  private int plateCount; 
     
    7371  private Vector<String> channelNames; 
    7472 
    75   private Vector<Float> xPositions; 
    76   private Vector<Float> yPositions; 
     73  private Hashtable<String, Vector<Float>> xPositions; 
     74  private Hashtable<String, Vector<Float>> yPositions; 
    7775 
    7876  private Vector<String> lightSourceIDs; 
    79  
    80   private Vector<Float> xResolutions; 
    81   private Vector<Float> yResolutions; 
     77  private Vector<String> subLayoutIDs; 
     78  private Hashtable<String[], Float> power; 
    8279 
    8380  // -- Constructor -- 
     
    138135    super.close(); 
    139136    factors = null; 
    140     binX = binY = 0; 
    141137    plateCount = wellCount = fieldCount = 0; 
    142138    channelNames = null; 
     
    154150    core[0].sizeZ = 0; 
    155151 
     152    images = new Vector<ImageInfo>(); 
    156153    channelNames = new Vector<String>(); 
    157     xPositions = new Vector<Float>(); 
    158     yPositions = new Vector<Float>(); 
     154    xPositions = new Hashtable<String, Vector<Float>>(); 
     155    yPositions = new Hashtable<String, Vector<Float>>(); 
    159156    lightSourceIDs = new Vector<String>(); 
    160     xResolutions = new Vector<Float>(); 
    161     yResolutions = new Vector<Float>(); 
     157    subLayoutIDs = new Vector<String>(); 
     158    power = new Hashtable<String[], Float>(); 
    162159 
    163160    // parse factors from XML 
     
    197194      } 
    198195      core[0].imageCount = ifds.length / seriesCount; 
    199       //Z-stacks are more likely than t-series (especially in Flex version 1.0) 
     196      // Z-stacks are more likely than t-series (especially in Flex version 1.0) 
    200197      if (getSizeZ() <= 1) core[0].sizeZ = getImageCount() / getSizeC(); 
    201198      core[0].sizeT = getImageCount() / (getSizeC() * getSizeZ()); 
     
    263260    } 
    264261 
    265     MetadataTools.populatePixels(store, this); 
     262    MetadataTools.populatePixels(store, this, true); 
    266263    store.setInstrumentID("Instrument:0", 0); 
    267264 
     
    271268      int[] pos = FormatTools.rasterToPosition(lengths, i); 
    272269 
    273       if (i < xResolutions.size()) { 
    274         store.setDimensionsPhysicalSizeX(xResolutions.get(i), i, 0); 
    275       } 
    276       if (i < yResolutions.size()) { 
    277         store.setDimensionsPhysicalSizeY(yResolutions.get(i), i, 0); 
     270      for (int q=0; q<getImageCount(); q++) { 
     271        if (i * getImageCount() + q >= images.size()) break; 
     272        ImageInfo image = images.get(i * getImageCount() + q); 
     273        store.setStagePositionPositionX(new Float(image.positionX), i, 0, q); 
     274        store.setStagePositionPositionY(new Float(image.positionY), i, 0, q); 
     275        store.setStagePositionPositionZ(new Float(image.positionZ), i, 0, q); 
     276        store.setPlaneTimingDeltaT( 
     277          new Float(image.measurementTimeOffset), i, 0, q); 
     278        store.setPlaneTimingExposureTime( 
     279          new Float(image.exposureTime), i, 0, q); 
     280      } 
     281 
     282      if (i * getImageCount() < images.size()) { 
     283        ImageInfo image = images.get(i * getImageCount()); 
     284 
     285        store.setImageCreationDate(image.date, i); 
     286 
     287        store.setDimensionsPhysicalSizeX(new Float(image.resolutionX), i, 0); 
     288        store.setDimensionsPhysicalSizeY(new Float(image.resolutionY), i, 0); 
     289        store.setObjectiveSettingsObjective("Objective:" + image.objective, i); 
     290      } 
     291 
     292      for (int ch=0; ch<getEffectiveSizeC(); ch++) { 
     293        if (i * getImageCount() + ch >= images.size()) break; 
     294        ImageInfo image = images.get(i * getImageCount() + ch); 
     295        store.setDetectorSettingsDetector("Detector:" + image.camera, i, ch); 
     296        store.setDetectorSettingsBinning(image.binX + "x" + image.binY, i, ch); 
    278297      } 
    279298 
     
    282301      store.setWellSampleIndex(new Integer(i), pos[0], pos[1], pos[2]); 
    283302      store.setWellSampleImageRef("Image:" + i, pos[0], pos[1], pos[2]); 
    284       if (pos[2] < xPositions.size()) { 
    285         store.setWellSamplePosX(xPositions.get(pos[2]), pos[0], 
    286           pos[1], pos[2]); 
    287       } 
    288       if (pos[2] < yPositions.size()) { 
    289         store.setWellSamplePosY(yPositions.get(pos[2]), pos[0], 
    290           pos[1], pos[2]); 
    291       } 
    292     } 
    293  
     303 
     304      if (pos[1] < subLayoutIDs.size()) { 
     305        String sublayout = subLayoutIDs.get(pos[1]); 
     306        Float xpos = xPositions.get(sublayout).get(pos[2]); 
     307        Float ypos = yPositions.get(sublayout).get(pos[2]); 
     308        store.setWellSamplePosX(xpos, pos[0], pos[1], pos[2]); 
     309        store.setWellSamplePosY(ypos, pos[0], pos[1], pos[2]); 
     310      } 
     311    } 
     312  } 
     313 
     314  /* @see loci.formats.in.BaseTiffReader#initMetadata() */ 
     315  protected void initMetadata() throws FormatException, IOException { 
     316    initStandardMetadata(); 
    294317  } 
    295318 
     
    322345    private int nextFilterCombination = 0; 
    323346 
     347    private ImageInfo currentImage; 
     348 
    324349    private Hashtable<String, Integer> fieldCounts; 
    325350    private String currentSublayout; 
    326351 
    327     private String parentQName; 
    328     private String currentQName; 
     352    private String parentQName, currentQName; 
     353    private String sliderName; 
     354 
     355    private String lightSourceComboID, lightSourceID; 
    329356 
    330357    public FlexHandler(Vector<String> names, Vector<String> factors, 
     
    342369      if (currentQName.equals("SublayoutRef")) { 
    343370        fieldCount = fieldCounts.get(value).intValue(); 
     371        subLayoutIDs.add(value); 
    344372      } 
    345373 
     
    355383          value); 
    356384      } 
    357       else if (currentQName.equals("Wavelength")) { 
    358         store.setLaserWavelength(new Integer(value), 0, nextLaser); 
    359         addMeta("Laser " + nextLaser + " Wavelength", value); 
    360       } 
    361385      else if (currentQName.equals("Magnification")) { 
    362         store.setObjectiveCalibratedMagnification(new Float(value), 0, 
    363           nextObjective); 
     386        try { 
     387          store.setObjectiveNominalMagnification( 
     388            new Integer((int) Float.parseFloat(value)), 0, nextObjective); 
     389        } 
     390        catch (NumberFormatException e) { } 
    364391      } 
    365392      else if (currentQName.equals("NumAperture")) { 
     
    373400        addMeta("Sublayout " + (nextSublayout - 1) + " Field " + 
    374401          (nextField - 1) + " " + currentQName, value); 
    375         Float offset = new Float(value); 
    376         if (currentQName.equals("OffsetX")) xPositions.add(offset); 
    377         else yPositions.add(offset); 
     402        Float offset = new Float(Float.parseFloat(value) * 10000); 
     403        if (currentQName.equals("OffsetX")) { 
     404          Vector<Float> v = xPositions.get(currentSublayout); 
     405          if (v == null) v = new Vector<Float>(); 
     406          v.add(offset); 
     407          xPositions.put(currentSublayout, v); 
     408        } 
     409        else { 
     410          Vector<Float> v = yPositions.get(currentSublayout); 
     411          if (v == null) v = new Vector<Float>(); 
     412          v.add(offset); 
     413          yPositions.put(currentSublayout, v); 
     414        } 
    378415      } 
    379416      else if (currentQName.equals("OffsetZ")) { 
     
    384421        addMeta("LightSourceCombination " + (nextLightSourceCombination - 1) + 
    385422          " LightSourceRef " + (nextLightSourceRef - 1) + " Power", value); 
     423        power.put(new String[] {lightSourceComboID, lightSourceID}, 
     424          new Float(value)); 
     425      } 
     426      else if (currentQName.equals("CameraBinningX")) { 
     427        try { 
     428          currentImage.binX = Integer.parseInt(value); 
     429        } 
     430        catch (NumberFormatException e) { } 
     431      } 
     432      else if (currentQName.equals("CameraBinningY")) { 
     433        try { 
     434          currentImage.binY = Integer.parseInt(value); 
     435        } 
     436        catch (NumberFormatException e) { } 
     437      } 
     438      else if (currentQName.equals("ImageResolutionX")) { 
     439        try { 
     440          currentImage.resolutionX = Float.parseFloat(value); 
     441        } 
     442        catch (NumberFormatException e) { } 
     443      } 
     444      else if (currentQName.equals("ImageResolutionY")) { 
     445        try { 
     446          currentImage.resolutionY = Float.parseFloat(value); 
     447        } 
     448        catch (NumberFormatException e) { } 
     449      } 
     450      else if (currentQName.equals("ObjectiveRef")) { 
     451        currentImage.objective = value; 
     452      } 
     453      else if (currentQName.equals("CameraExposureTime")) { 
     454        try { 
     455          currentImage.exposureTime = Float.parseFloat(value); 
     456        } 
     457        catch (NumberFormatException e) { } 
     458      } 
     459      else if (currentQName.equals("PositionX")) { 
     460        try { 
     461          currentImage.positionX = Float.parseFloat(value); 
     462        } 
     463        catch (NumberFormatException e) { } 
     464      } 
     465      else if (currentQName.equals("PositionY")) { 
     466        try { 
     467          currentImage.positionY = Float.parseFloat(value); 
     468        } 
     469        catch (NumberFormatException e) { } 
     470      } 
     471      else if (currentQName.equals("PositionZ")) { 
     472        try { 
     473          currentImage.positionZ = Float.parseFloat(value); 
     474        } 
     475        catch (NumberFormatException e) { } 
     476      } 
     477      else if (currentQName.equals("MeasurementTimeOffset")) { 
     478        try { 
     479          currentImage.measurementTimeOffset = Float.parseFloat(value); 
     480        } 
     481        catch (NumberFormatException e) { } 
     482      } 
     483      else if (currentQName.equals("DateTime")) { 
     484        currentImage.date = value; 
     485      } 
     486      else if (currentQName.equals("CameraRef")) { 
     487        currentImage.camera = value; 
     488      } 
     489      else if (currentQName.equals("LightSourceCombinationRef")) { 
     490        currentImage.lightSource = value; 
    386491      } 
    387492      else if (parentQName.equals("Image")) { 
     
    391496          store.setImageCreationDate(value, 0); 
    392497        } 
    393         else if (currentQName.equals("CameraBinningX")) { 
    394           binX = Integer.parseInt(value); 
    395         } 
    396         else if (currentQName.equals("CameraBinningY")) { 
    397           binY = Integer.parseInt(value); 
    398         } 
    399       } 
    400       else if (parentQName.equals("ImageResolutionX")) { 
    401         try { 
    402           xResolutions.add(new Float(value)); 
    403         } 
    404         catch (NumberFormatException e) { } 
    405       } 
    406       else if (parentQName.equals("ImageResolutionY")) { 
    407         try { 
    408           yResolutions.add(new Float(value)); 
    409         } 
    410         catch (NumberFormatException e) { } 
    411498      } 
    412499      else if (parentQName.equals("Well")) { 
     
    415502      else if (parentQName.equals("FLIM")) { 
    416503        addMeta("FLIM " + nextImage + " " + currentQName, value); 
     504      } 
     505      else if (currentQName.equals("Wavelength") && 
     506        parentQName.equals("LightSource")) 
     507      { 
     508        store.setLaserWavelength(new Integer(value), 0, nextLaser); 
     509        store.setLaserType("Unknown", 0, nextLaser); 
     510        store.setLaserLaserMedium("Unknown", 0, nextLaser); 
     511        addMeta("Laser " + nextLaser + " Wavelength", value); 
    417512      } 
    418513    } 
     
    429524            String imageName = attributes.getValue(i); 
    430525            names.add(imageName); 
    431             store.setImageName(imageName, 0); 
    432526            // some datasets have image names of the form "1_Exp1Cam1" 
    433527            // we're assuming that "Exp1Cam1" is the channel name, and 
    434528            // "1" is the T index 
    435              
    436             //Actually tis would be from the old flex format. the 1_, 2_... represnet any series (wether, they are time  point, Z-section or 
    437             //number of fields=number of series. I would be more enclined to associate that index to a number of series or Z-stacks. 
     529 
     530            // Actually this would be from the old flex format. 
     531            // The 1_, 2_... represent any series,  whether they are time 
     532            // points, Z-sections or number of fields == number of series. 
     533            // I would be more innclined to associate that index with the 
     534            // number of series or Z-stacks. 
    438535            imageName = imageName.substring(imageName.indexOf("_") + 1); 
    439536            if (!channelNames.contains(imageName)) { 
     
    454551        addMeta("LightSource " + nextLightSource + " Type", type); 
    455552 
    456         if (type.equals("Laser")) nextLaser++; 
     553        store.setLightSourceID("LightSource:" + id, 0, nextLightSource); 
     554 
     555        nextLaser++; 
    457556        nextLightSource++; 
    458557      } 
    459558      else if (qName.equals("Slider")) { 
    460559        parentQName = qName; 
    461         for (int i=0; i<attributes.getLength(); i++) { 
    462           addMeta("Slider " + nextSlider + " " + attributes.getQName(i), 
    463             attributes.getValue(i)); 
    464         } 
     560        addAllAttributes("Slider " + nextSlider, attributes); 
     561        sliderName = attributes.getValue("Name"); 
    465562        nextSlider++; 
    466563      } 
    467564      else if (qName.equals("Filter")) { 
    468         for (int i=0; i<attributes.getLength(); i++) { 
    469           addMeta("Filter " + nextFilter + " " + attributes.getQName(i), 
    470             attributes.getValue(i)); 
    471         } 
     565        addAllAttributes("Filter " + nextFilter, attributes); 
     566        store.setFilterID("Filter:" + attributes.getValue("ID"), 0, nextFilter); 
     567        store.setFilterFilterWheel(sliderName, 0, nextFilter); 
    472568        nextFilter++; 
    473569      } 
    474570      else if (qName.equals("Camera")) { 
    475571        parentQName = qName; 
    476         for (int i=0; i<attributes.getLength(); i++) { 
    477           addMeta("Camera " + nextCamera + " " + attributes.getQName(i), 
    478             attributes.getValue(i)); 
    479         } 
     572        addAllAttributes("Camera " + nextCamera, attributes); 
     573        store.setDetectorID("Detector:" + attributes.getValue("ID"), 
     574          0, nextCamera); 
     575        store.setDetectorType(attributes.getValue("CameraType"), 0, nextCamera); 
    480576        nextCamera++; 
    481577      } 
    482578      else if (qName.startsWith("PixelSize") && parentQName.equals("Camera")) { 
    483         for (int i=0; i<attributes.getLength(); i++) { 
    484           addMeta("Camera " + (nextCamera - 1) + " " + qName + " " + 
    485             attributes.getQName(i), attributes.getValue(i)); 
    486         } 
     579        addAllAttributes("Camera " + (nextCamera - 1) + " " + qName, 
     580          attributes); 
    487581      } 
    488582      else if (qName.equals("Objective")) { 
     
    490584        nextObjective++; 
    491585 
    492         // link Objective to Image using ObjectiveSettings 
    493         store.setObjectiveID("Objective:" + nextObjective, 0, 0); 
    494         store.setObjectiveSettingsObjective("Objective:" + nextObjective, 0); 
    495         store.setObjectiveCorrection("Unknown", 0, 0); 
     586        store.setObjectiveID("Objective:" + attributes.getValue("ID"), 
     587          0, nextObjective); 
     588        store.setObjectiveCorrection("Unknown", 0, nextObjective); 
    496589      } 
    497590      else if (qName.equals("Sublayout")) { 
    498591        parentQName = qName; 
    499592        nextField = 0; 
    500         for (int i=0; i<attributes.getLength(); i++) { 
    501           addMeta("Sublayout " + nextSublayout + " " + attributes.getQName(i), 
    502             attributes.getValue(i)); 
    503         } 
     593        addAllAttributes("Sublayout " + nextSublayout, attributes); 
    504594        nextSublayout++; 
    505595 
     
    514604      else if (qName.equals("Field")) { 
    515605        parentQName = qName; 
    516         for (int i=0; i<attributes.getLength(); i++) { 
    517           addMeta("Sublayout " + (nextSublayout - 1) + " Field " + nextField + 
    518             " " + attributes.getQName(i), attributes.getValue(i)); 
    519         } 
     606        addAllAttributes("Sublayout " + (nextSublayout - 1) + " Field " + 
     607          nextField, attributes); 
    520608        nextField++; 
    521         int fieldNo = Integer.parseInt(attributes.getValue("No")); 
     609        int fieldNo = 0; 
     610        try { fieldNo = Integer.parseInt(attributes.getValue("No")); } 
     611        catch (NumberFormatException e) { } 
    522612        int count = fieldCounts.get(currentSublayout).intValue(); 
    523613        if (fieldNo > count) count++; 
     
    526616      else if (qName.equals("Stack")) { 
    527617        nextPlane = 0; 
    528         for (int i=0; i<attributes.getLength(); i++) { 
    529           addMeta("Stack " + nextStack + " " + attributes.getQName(i), 
    530             attributes.getValue(i)); 
    531         } 
     618        addAllAttributes("Stack " + nextStack, attributes); 
    532619        nextStack++; 
    533620      } 
    534621      else if (qName.equals("Plane")) { 
    535622        parentQName = qName; 
    536         for (int i=0; i<attributes.getLength(); i++) { 
    537           addMeta("Stack " + (nextStack - 1) + " Plane " + nextPlane + 
    538             " " + attributes.getQName(i), attributes.getValue(i)); 
    539         } 
     623        addAllAttributes("Stack " + (nextStack - 1) + " Plane " + nextPlane, 
     624          attributes); 
    540625        nextPlane++; 
    541         int planeNo = Integer.parseInt(attributes.getValue("No")); 
     626        int planeNo = 0; 
     627        try { planeNo = Integer.parseInt(attributes.getValue("No")); } 
     628        catch (NumberFormatException e) { } 
    542629        if (planeNo > getSizeZ()) core[0].sizeZ++; 
    543630      } 
    544631      else if (qName.equals("Kinetic")) { 
    545         for (int i=0; i<attributes.getLength(); i++) { 
    546           addMeta("Kinetic " + nextKinetic + " " + attributes.getQName(i), 
    547             attributes.getValue(i)); 
    548         } 
     632        addAllAttributes("Kinetic " + nextKinetic, attributes); 
    549633        nextKinetic++; 
    550634      } 
    551635      else if (qName.equals("Dispensing")) { 
    552         for (int i=0; i<attributes.getLength(); i++) { 
    553           addMeta("Dispensing " + nextDispensing + " " + attributes.getQName(i), 
    554             attributes.getValue(i)); 
    555         } 
     636        addAllAttributes("Dispensin " + nextDispensing, attributes); 
    556637        nextDispensing++; 
    557638      } 
    558639      else if (qName.equals("LightSourceCombination")) { 
    559640        nextLightSourceRef = 0; 
    560         for (int i=0; i<attributes.getLength(); i++) { 
    561           addMeta("LightSourceCombination " + nextLightSourceCombination + 
    562             " " + attributes.getQName(i), attributes.getValue(i)); 
    563         } 
     641        addAllAttributes("LightSourceCombination " + nextLightSourceCombination, 
     642          attributes); 
    564643        nextLightSourceCombination++; 
    565         lightSourceIDs.add(attributes.getValue("ID")); 
     644        lightSourceComboID = attributes.getValue("ID"); 
     645        lightSourceIDs.add(lightSourceComboID); 
    566646      } 
    567647      else if (qName.equals("LightSourceRef")) { 
    568648        parentQName = qName; 
    569         for (int i=0; i<attributes.getLength(); i++) { 
    570           addMeta("LightSourceCombination " + (nextLightSourceCombination - 1) + 
    571             " LightSourceRef " + nextLightSourceRef + " " + 
    572             attributes.getQName(i), attributes.getValue(i)); 
    573         } 
    574         nextLightSourceRef++; 
     649        lightSourceID = attributes.getValue("ID"); 
    575650      } 
    576651      else if (qName.equals("FilterCombination")) { 
    577652        parentQName = qName; 
    578653        nextSliderRef = 0; 
    579         for (int i=0; i<attributes.getLength(); i++) { 
    580           addMeta("FilterCombination " + nextFilterCombination + " " + 
    581             attributes.getQName(i), attributes.getValue(i)); 
    582         } 
     654        addAllAttributes("FilterCombination " + nextFilterCombination, 
     655          attributes); 
    583656        nextFilterCombination++; 
    584657      } 
    585658      else if (qName.equals("SliderRef")) { 
    586         for (int i=0; i<attributes.getLength(); i++) { 
    587           addMeta("FilterCombination " + (nextFilterCombination - 1) + 
    588             " SliderRef " + nextSliderRef + " " + attributes.getQName(i), 
    589             attributes.getValue(i)); 
    590         } 
    591         nextSliderRef++; 
     659        parentQName = qName; 
    592660      } 
    593661      else if (qName.equals("Image")) { 
    594662        parentQName = qName; 
    595         for (int i=0; i<attributes.getLength(); i++) { 
    596           addMeta("Image " + nextImage + " " + attributes.getQName(i), 
    597             attributes.getValue(i)); 
    598         } 
     663        addAllAttributes("Image " + nextImage, attributes); 
    599664 
    600665        nextImage++; 
     666 
     667        currentImage = new ImageInfo(); 
    601668 
    602669        //Implemented for FLEX v1.7 and below 
    603670        String x = attributes.getValue("CameraBinningX"); 
    604671        String y = attributes.getValue("CameraBinningY"); 
    605         if (x != null) binX = Integer.parseInt(x); 
    606         if (y != null) binY = Integer.parseInt(y); 
     672        if (x != null) { 
     673          try { 
     674            currentImage.binX = Integer.parseInt(x); 
     675          } 
     676          catch (NumberFormatException e) { } 
     677        } 
     678        if (y != null) { 
     679          try { 
     680            currentImage.binY = Integer.parseInt(y); 
     681          } 
     682          catch (NumberFormatException e) { } 
     683        } 
    607684      } 
    608685      else if (qName.equals("Plate") || qName.equals("WellShape") || 
     
    621698      else if (qName.equals("WellCoordinate")) { 
    622699        int ndx = nextWell - 1; 
    623         addMeta("Well" + ndx + " Row", attributes.getValue("Row")); 
    624         addMeta("Well" + ndx + " Col", attributes.getValue("Col")); 
    625         store.setWellRow(new Integer(attributes.getValue("Row")), 0, ndx); 
    626         store.setWellColumn(new Integer(attributes.getValue("Col")), 0, ndx); 
     700        int row = 0, col = 0; 
     701        try { 
     702          row = Integer.parseInt(attributes.getValue("Row")) - 1; 
     703        } 
     704        catch (NumberFormatException e) { } 
     705        try { 
     706          col = Integer.parseInt(attributes.getValue("Col")) - 1; 
     707        } 
     708        catch (NumberFormatException e) { } 
     709        addMeta("Well " + ndx + " Row", row); 
     710        addMeta("Well " + ndx + " Col", col); 
     711        store.setWellRow(new Integer(row), 0, ndx); 
     712        store.setWellColumn(new Integer(col), 0, ndx); 
    627713      } 
    628714      else if (qName.equals("Status")) { 
    629715        addMeta("Status", attributes.getValue("StatusString")); 
    630716      } 
    631       else if(qName.equals("ImageResolutionX")) { 
    632         parentQName = qName; 
    633       //TODO: definition of the dimension type and unit Where to store? 
    634         for (int i=0; i<attributes.getLength(); i++) { 
    635           //addMeta("Image " + nextImage + " " + attributes.getQName(i), 
    636           //  attributes.getValue(i)); 
    637         } 
    638       } 
    639       else if(qName.equals("ImageResolutionY")) { 
    640         parentQName = qName; 
    641         //TODO: definition of the dimension type and unit Where to store? 
    642         for (int i=0; i<attributes.getLength(); i++) { 
    643           //addMeta("Image " + nextImage + " " + attributes.getQName(i), 
    644           //  attributes.getValue(i)); 
    645         } 
     717      else if (qName.equals("ImageResolutionX")) { 
     718        parentQName = qName; 
     719        currentImage.resolutionXUnit = attributes.getValue("Unit"); 
     720      } 
     721      else if (qName.equals("ImageResolutionY")) { 
     722        parentQName = qName; 
     723        currentImage.resolutionYUnit = attributes.getValue("Unit"); 
     724      } 
     725      else if (qName.equals("PositionX")) { 
     726        parentQName = qName; 
     727        currentImage.positionXUnit = attributes.getValue("Unit"); 
     728      } 
     729      else if (qName.equals("PositionY")) { 
     730        parentQName = qName; 
     731        currentImage.positionYUnit = attributes.getValue("Unit"); 
     732      } 
     733      else if (qName.equals("PositionZ")) { 
     734        parentQName = qName; 
     735        currentImage.positionZUnit = attributes.getValue("Unit"); 
    646736      } 
    647737      else if (qName.equals("FLIM")) { 
    648738        parentQName = qName; 
    649         for (int i=0; i<attributes.getLength(); i++) { 
    650           addMeta("FLIM " + nextImage + " " + attributes.getQName(i), 
    651             attributes.getValue(i)); 
    652         } 
     739        addAllAttributes("FLIM " + nextImage, attributes); 
    653740      } 
    654741    } 
     
    656743    public void endElement(String uri, String localName, String qName) { 
    657744      if (qName.equals(parentQName)) parentQName = ""; 
    658     } 
    659  
     745      if (qName.equals("Image")) { 
     746        currentImage.adjustForUnits(); 
     747        images.add(currentImage); 
     748      } 
     749    } 
     750 
     751    // -- Helper methods -- 
     752 
     753    private void addAllAttributes(String keyPrefix, Attributes attributes) { 
     754      for (int i=0; i<attributes.getLength(); i++) { 
     755        String name = attributes.getQName(i); 
     756        addMeta(keyPrefix + " " + name, attributes.getValue(name)); 
     757      } 
     758    } 
    660759  } 
    661760 
     761  /** Stores metadata for a single image. */ 
     762  class ImageInfo { 
     763    public String objective; 
     764    public String camera; 
     765    public float exposureTime; 
     766    public int binX, binY; 
     767    public float positionX, positionY, positionZ; 
     768    public String positionXUnit, positionYUnit, positionZUnit; 
     769    public float measurementTimeOffset; 
     770    public String date; 
     771    public float resolutionX, resolutionY; 
     772    public String resolutionXUnit, resolutionYUnit; 
     773    public String lightSource; 
     774 
     775    public void adjustForUnits() { 
     776      positionX = changeToMicrons(positionX, positionXUnit); 
     777      positionY = changeToMicrons(positionY, positionYUnit); 
     778      positionZ = changeToMicrons(positionZ, positionZUnit); 
     779      resolutionX = changeToMicrons(resolutionX, resolutionXUnit); 
     780      resolutionY = changeToMicrons(resolutionY, resolutionYUnit); 
     781    } 
     782 
     783    private float changeToMicrons(float value, String oldUnit) { 
     784      if (oldUnit == null || oldUnit.equals("um")) return value; 
     785      float mul = 1f; 
     786 
     787      if (oldUnit.equals("m")) mul = 10000f; 
     788      else if (oldUnit.equals("mm")) mul = 100f; 
     789      else if (oldUnit.equals("cm")) mul = 1000f; 
     790 
     791      return value * mul; 
     792    } 
     793 
     794  } 
     795 
    662796} 
  • trunk/components/bio-formats/src/loci/formats/meta/AggregateMetadata.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    16461646  } 
    16471647 
     1648  /* @see MetadataRetrieve#getFilterID(int, int) */ 
     1649  public String getFilterID(int instrumentIndex, int filterIndex) { 
     1650    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     1651      Object o = iter.next(); 
     1652      if (o instanceof MetadataRetrieve) { 
     1653        MetadataRetrieve retrieve = (MetadataRetrieve) o; 
     1654        String result = retrieve.getFilterID(instrumentIndex, filterIndex); 
     1655        if (result != null) return result; 
     1656      } 
     1657    } 
     1658    return null; 
     1659  } 
     1660 
    16481661  /* @see MetadataRetrieve#getFilterLotNumber(int, int) */ 
    16491662  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    62156228  } 
    62166229 
     6230  /* @see MetadataStore#setFilterID(String, int, int) */ 
     6231  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     6232    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     6233      Object o = iter.next(); 
     6234      if (o instanceof MetadataStore) { 
     6235        MetadataStore store = (MetadataStore) o; 
     6236        store.setFilterID(id, instrumentIndex, filterIndex); 
     6237      } 
     6238    } 
     6239  } 
     6240 
    62176241  /* @see MetadataStore#setFilterLotNumber(String, int, int) */ 
    62186242  public void setFilterLotNumber(String lotNumber, int instrumentIndex, int filterIndex) { 
  • trunk/components/bio-formats/src/loci/formats/meta/DummyMetadata.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    618618    return null; 
    619619  } 
     620  /* @see MetadataRetrieve#getFilterID(int, int) */ 
     621  public String getFilterID(int instrumentIndex, int filterIndex) { 
     622    return null; 
     623  } 
    620624  /* @see MetadataRetrieve#getFilterLotNumber(int, int) */ 
    621625  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    22292233  } 
    22302234 
     2235  /* @see MetadataStore#setFilterID(String, int, int) */ 
     2236  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     2237  } 
     2238 
    22312239  /* @see MetadataStore#setFilterLotNumber(String, int, int) */ 
    22322240  public void setFilterLotNumber(String lotNumber, int instrumentIndex, int filterIndex) { 
  • trunk/components/bio-formats/src/loci/formats/meta/FilterMetadata.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    558558  } 
    559559 
     560  /* @see MetadataStore#setFilterID(String, int, int) */ 
     561  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     562    String value = filter ? DataTools.sanitize(id) : id; 
     563    store.setFilterID(value, instrumentIndex, filterIndex); 
     564  } 
     565 
    560566  /* @see MetadataStore#setFilterLotNumber(String, int, int) */ 
    561567  public void setFilterLotNumber(String lotNumber, int instrumentIndex, int filterIndex) { 
  • trunk/components/bio-formats/src/loci/formats/meta/MetadataConverter.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    609609        String filterFilterWheelValue = src.getFilterFilterWheel(instrumentIndex, filterIndex); 
    610610        if (filterFilterWheelValue != null) dest.setFilterFilterWheel(filterFilterWheelValue, instrumentIndex, filterIndex); 
     611        String filterIDValue = src.getFilterID(instrumentIndex, filterIndex); 
     612        if (filterIDValue != null) dest.setFilterID(filterIDValue, instrumentIndex, filterIndex); 
    611613        String filterLotNumberValue = src.getFilterLotNumber(instrumentIndex, filterIndex); 
    612614        if (filterLotNumberValue != null) dest.setFilterLotNumber(filterLotNumberValue, instrumentIndex, filterIndex); 
  • trunk/components/bio-formats/src/loci/formats/meta/MetadataRetrieve.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    712712 
    713713  /** 
     714   * For a particular Filter, gets unique label identifying the filter. 
     715   * @param instrumentIndex index of the Instrument 
     716   * @param filterIndex index of the Filter 
     717   */ 
     718  String getFilterID(int instrumentIndex, int filterIndex); 
     719 
     720  /** 
    714721   * For a particular Filter, gets TODO. 
    715722   * @param instrumentIndex index of the Instrument 
  • trunk/components/bio-formats/src/loci/formats/meta/MetadataStore.java

    r5013 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    726726 
    727727  /** 
     728   * For a particular Filter, sets unique label identifying the filter. 
     729   * @param id unique label identifying the filter 
     730   * @param instrumentIndex index of the Instrument 
     731   * @param filterIndex index of the Filter 
     732   */ 
     733  void setFilterID(String id, int instrumentIndex, int filterIndex); 
     734 
     735  /** 
    728736   * For a particular Filter, sets TODO. 
    729737   * @param lotNumber TODO 
  • trunk/components/bio-formats/src/loci/formats/ome/OMEXML2003FCMetadata.java

    r5093 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    3232package loci.formats.ome; 
    3333 
     34import ome.xml.OMEXMLNode; 
     35import ome.xml.r2003fc.ome.*; 
    3436import java.util.List; 
    35  
    3637import loci.common.LogTools; 
    37 import ome.xml.OMEXMLNode; 
    38 import ome.xml.r2003fc.ome.ArcNode; 
    39 import ome.xml.r2003fc.ome.ChannelComponentNode; 
    40 import ome.xml.r2003fc.ome.ChannelInfoNode; 
    41 import ome.xml.r2003fc.ome.ContactNode; 
    42 import ome.xml.r2003fc.ome.DatasetNode; 
    43 import ome.xml.r2003fc.ome.DetectorNode; 
    44 import ome.xml.r2003fc.ome.DetectorRefNode; 
    45 import ome.xml.r2003fc.ome.DichroicNode; 
    46 import ome.xml.r2003fc.ome.DisplayOptionsNode; 
    47 import ome.xml.r2003fc.ome.EmFilterNode; 
    48 import ome.xml.r2003fc.ome.ExFilterNode; 
    49 import ome.xml.r2003fc.ome.ExperimentNode; 
    50 import ome.xml.r2003fc.ome.ExperimentRefNode; 
    51 import ome.xml.r2003fc.ome.ExperimenterNode; 
    52 import ome.xml.r2003fc.ome.ExperimenterRefNode; 
    53 import ome.xml.r2003fc.ome.FilamentNode; 
    54 import ome.xml.r2003fc.ome.FilterNode; 
    55 import ome.xml.r2003fc.ome.FilterSetNode; 
    56 import ome.xml.r2003fc.ome.GroupNode; 
    57 import ome.xml.r2003fc.ome.GroupRefNode; 
    58 import ome.xml.r2003fc.ome.ImageNode; 
    59 import ome.xml.r2003fc.ome.ImagingEnvironmentNode; 
    60 import ome.xml.r2003fc.ome.InstrumentNode; 
    61 import ome.xml.r2003fc.ome.InstrumentRefNode; 
    62 import ome.xml.r2003fc.ome.LaserNode; 
    63 import ome.xml.r2003fc.ome.LightSourceNode; 
    64 import ome.xml.r2003fc.ome.LightSourceRefNode; 
    65 import ome.xml.r2003fc.ome.MicroscopeNode; 
    66 import ome.xml.r2003fc.ome.OMENode; 
    67 import ome.xml.r2003fc.ome.OTFNode; 
    68 import ome.xml.r2003fc.ome.OTFRefNode; 
    69 import ome.xml.r2003fc.ome.ObjectiveNode; 
    70 import ome.xml.r2003fc.ome.ObjectiveRefNode; 
    71 import ome.xml.r2003fc.ome.PixelsNode; 
    72 import ome.xml.r2003fc.ome.PlateNode; 
    73 import ome.xml.r2003fc.ome.PlateRefNode; 
    74 import ome.xml.r2003fc.ome.ProjectNode; 
    75 import ome.xml.r2003fc.ome.ProjectRefNode; 
    76 import ome.xml.r2003fc.ome.ProjectionNode; 
    77 import ome.xml.r2003fc.ome.PumpNode; 
    78 import ome.xml.r2003fc.ome.ROINode; 
    79 import ome.xml.r2003fc.ome.ScreenNode; 
    80 import ome.xml.r2003fc.ome.ScreenRefNode; 
    81 import ome.xml.r2003fc.ome.StageLabelNode; 
    82 import ome.xml.r2003fc.ome.ThumbnailNode; 
    83 import ome.xml.r2003fc.ome.TiffDataNode; 
    84 import ome.xml.r2003fc.ome.TimeNode; 
    8538 
    8639/** 
     
    894847  } 
    895848 
     849  /* @see loci.formats.meta.MetadataRetrieve#getFilterID(int, int) */ 
     850  public String getFilterID(int instrumentIndex, int filterIndex) { 
     851    FilterNode filter = getFilterNode(instrumentIndex, filterIndex, false); 
     852    return filter == null ? null : filter.getNodeID(); 
     853  } 
     854 
    896855  /* @see loci.formats.meta.MetadataRetrieve#getFilterLotNumber(int, int) */ 
    897856  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    32343193  public void setFilterFilterWheel(String filterWheel, int instrumentIndex, int filterIndex) { 
    32353194    // NB: FilterWheel unsupported for schema version 2003-FC 
     3195  } 
     3196 
     3197  /* @see loci.formats.meta.MetadataStore#setFilterID(String, int, int) */ 
     3198  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     3199    if (id == null) return; 
     3200    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
     3201    filterNode.setNodeID(id); 
    32363202  } 
    32373203 
  • trunk/components/bio-formats/src/loci/formats/ome/OMEXML200706Metadata.java

    r5093 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    3232package loci.formats.ome; 
    3333 
     34import ome.xml.OMEXMLNode; 
     35import ome.xml.r200706.ome.*; 
     36import ome.xml.r200706.spw.*; 
    3437import java.util.List; 
    35  
    3638import loci.common.LogTools; 
    37 import ome.xml.OMEXMLNode; 
    38 import ome.xml.r200706.ome.ArcNode; 
    39 import ome.xml.r200706.ome.ChannelComponentNode; 
    40 import ome.xml.r200706.ome.ContactNode; 
    41 import ome.xml.r200706.ome.DatasetNode; 
    42 import ome.xml.r200706.ome.DatasetRefNode; 
    43 import ome.xml.r200706.ome.DetectorNode; 
    44 import ome.xml.r200706.ome.DetectorRefNode; 
    45 import ome.xml.r200706.ome.DichroicNode; 
    46 import ome.xml.r200706.ome.DisplayOptionsNode; 
    47 import ome.xml.r200706.ome.ExperimentNode; 
    48 import ome.xml.r200706.ome.ExperimentRefNode; 
    49 import ome.xml.r200706.ome.ExperimenterNode; 
    50 import ome.xml.r200706.ome.ExperimenterRefNode; 
    51 import ome.xml.r200706.ome.FilamentNode; 
    52 import ome.xml.r200706.ome.FilterNode; 
    53 import ome.xml.r200706.ome.FilterSetNode; 
    54 import ome.xml.r200706.ome.FilterSetRefNode; 
    55 import ome.xml.r200706.ome.GreyChannelNode; 
    56 import ome.xml.r200706.ome.GroupNode; 
    57 import ome.xml.r200706.ome.GroupRefNode; 
    58 import ome.xml.r200706.ome.ImageNode; 
    59 import ome.xml.r200706.ome.ImagingEnvironmentNode; 
    60 import ome.xml.r200706.ome.InstrumentNode; 
    61 import ome.xml.r200706.ome.InstrumentRefNode; 
    62 import ome.xml.r200706.ome.LaserNode; 
    63 import ome.xml.r200706.ome.LightSourceNode; 
    64 import ome.xml.r200706.ome.LightSourceRefNode; 
    65 import ome.xml.r200706.ome.LogicalChannelNode; 
    66 import ome.xml.r200706.ome.MicrobeamManipulationNode; 
    67 import ome.xml.r200706.ome.MicrobeamManipulationRefNode; 
    68 import ome.xml.r200706.ome.MicroscopeNode; 
    69 import ome.xml.r200706.ome.OMENode; 
    70 import ome.xml.r200706.ome.OTFNode; 
    71 import ome.xml.r200706.ome.OTFRefNode; 
    72 import ome.xml.r200706.ome.ObjectiveNode; 
    73 import ome.xml.r200706.ome.ObjectiveRefNode; 
    74 import ome.xml.r200706.ome.ObjectiveSettingsNode; 
    75 import ome.xml.r200706.ome.PixelsNode; 
    76 import ome.xml.r200706.ome.PlaneNode; 
    77 import ome.xml.r200706.ome.PlaneTimingNode; 
    78 import ome.xml.r200706.ome.ProjectNode; 
    79 import ome.xml.r200706.ome.ProjectRefNode; 
    80 import ome.xml.r200706.ome.ProjectionNode; 
    81 import ome.xml.r200706.ome.PumpNode; 
    82 import ome.xml.r200706.ome.ROINode; 
    83 import ome.xml.r200706.ome.ROIRefNode; 
    84 import ome.xml.r200706.ome.RegionNode; 
    85 import ome.xml.r200706.ome.StageLabelNode; 
    86 import ome.xml.r200706.ome.StagePositionNode; 
    87 import ome.xml.r200706.ome.ThumbnailNode; 
    88 import ome.xml.r200706.ome.TiffDataNode; 
    89 import ome.xml.r200706.ome.TimeNode; 
    90 import ome.xml.r200706.ome.TransmittanceRangeNode; 
    91 import ome.xml.r200706.spw.ImageRefNode; 
    92 import ome.xml.r200706.spw.PlateNode; 
    93 import ome.xml.r200706.spw.PlateRefNode; 
    94 import ome.xml.r200706.spw.ReagentNode; 
    95 import ome.xml.r200706.spw.ReagentRefNode; 
    96 import ome.xml.r200706.spw.ScreenAcquisitionNode; 
    97 import ome.xml.r200706.spw.ScreenNode; 
    98 import ome.xml.r200706.spw.ScreenRefNode; 
    99 import ome.xml.r200706.spw.WellNode; 
    100 import ome.xml.r200706.spw.WellSampleNode; 
    101 import ome.xml.r200706.spw.WellSampleRefNode; 
    10239 
    10340/** 
     
    935872  } 
    936873 
     874  /* @see loci.formats.meta.MetadataRetrieve#getFilterID(int, int) */ 
     875  public String getFilterID(int instrumentIndex, int filterIndex) { 
     876    FilterNode filter = getFilterNode(instrumentIndex, filterIndex, false); 
     877    return filter == null ? null : filter.getNodeID(); 
     878  } 
     879 
    937880  /* @see loci.formats.meta.MetadataRetrieve#getFilterLotNumber(int, int) */ 
    938881  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    32873230    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
    32883231    filterNode.setFilterWheel(filterWheel); 
     3232  } 
     3233 
     3234  /* @see loci.formats.meta.MetadataStore#setFilterID(String, int, int) */ 
     3235  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     3236    if (id == null) return; 
     3237    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
     3238    filterNode.setNodeID(id); 
    32893239  } 
    32903240 
  • trunk/components/bio-formats/src/loci/formats/ome/OMEXML200802Metadata.java

    r5093 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    3232package loci.formats.ome; 
    3333 
     34import ome.xml.OMEXMLNode; 
     35import ome.xml.r200802.ome.*; 
     36import ome.xml.r200802.spw.*; 
    3437import java.util.List; 
    35  
    3638import loci.common.LogTools; 
    37 import ome.xml.OMEXMLNode; 
    38 import ome.xml.r200802.ome.ArcNode; 
    39 import ome.xml.r200802.ome.ChannelComponentNode; 
    40 import ome.xml.r200802.ome.ContactNode; 
    41 import ome.xml.r200802.ome.DatasetNode; 
    42 import ome.xml.r200802.ome.DatasetRefNode; 
    43 import ome.xml.r200802.ome.DetectorNode; 
    44 import ome.xml.r200802.ome.DetectorRefNode; 
    45 import ome.xml.r200802.ome.DichroicNode; 
    46 import ome.xml.r200802.ome.DisplayOptionsNode; 
    47 import ome.xml.r200802.ome.ExperimentNode; 
    48 import ome.xml.r200802.ome.ExperimentRefNode; 
    49 import ome.xml.r200802.ome.ExperimenterNode; 
    50 import ome.xml.r200802.ome.ExperimenterRefNode; 
    51 import ome.xml.r200802.ome.FilamentNode; 
    52 import ome.xml.r200802.ome.FilterNode; 
    53 import ome.xml.r200802.ome.FilterSetNode; 
    54 import ome.xml.r200802.ome.FilterSetRefNode; 
    55 import ome.xml.r200802.ome.GreyChannelNode; 
    56 import ome.xml.r200802.ome.GroupNode; 
    57 import ome.xml.r200802.ome.GroupRefNode; 
    58 import ome.xml.r200802.ome.ImageNode; 
    59 import ome.xml.r200802.ome.ImagingEnvironmentNode; 
    60 import ome.xml.r200802.ome.InstrumentNode; 
    61 import ome.xml.r200802.ome.InstrumentRefNode; 
    62 import ome.xml.r200802.ome.LaserNode; 
    63 import ome.xml.r200802.ome.LightSourceNode; 
    64 import ome.xml.r200802.ome.LightSourceRefNode; 
    65 import ome.xml.r200802.ome.LogicalChannelNode; 
    66 import ome.xml.r200802.ome.MicrobeamManipulationNode; 
    67 import ome.xml.r200802.ome.MicrobeamManipulationRefNode; 
    68 import ome.xml.r200802.ome.MicroscopeNode; 
    69 import ome.xml.r200802.ome.OMENode; 
    70 import ome.xml.r200802.ome.OTFNode; 
    71 import ome.xml.r200802.ome.OTFRefNode; 
    72 import ome.xml.r200802.ome.ObjectiveNode; 
    73 import ome.xml.r200802.ome.ObjectiveRefNode; 
    74 import ome.xml.r200802.ome.PixelsNode; 
    75 import ome.xml.r200802.ome.PlaneNode; 
    76 import ome.xml.r200802.ome.PlaneTimingNode; 
    77 import ome.xml.r200802.ome.ProjectNode; 
    78 import ome.xml.r200802.ome.ProjectRefNode; 
    79 import ome.xml.r200802.ome.ProjectionNode; 
    80 import ome.xml.r200802.ome.PumpNode; 
    81 import ome.xml.r200802.ome.ROINode; 
    82 import ome.xml.r200802.ome.ROIRefNode; 
    83 import ome.xml.r200802.ome.RegionNode; 
    84 import ome.xml.r200802.ome.StageLabelNode; 
    85 import ome.xml.r200802.ome.StagePositionNode; 
    86 import ome.xml.r200802.ome.ThumbnailNode; 
    87 import ome.xml.r200802.ome.TiffDataNode; 
    88 import ome.xml.r200802.ome.TimeNode; 
    89 import ome.xml.r200802.ome.TransmittanceRangeNode; 
    90 import ome.xml.r200802.ome.UUIDNode; 
    91 import ome.xml.r200802.spw.ImageRefNode; 
    92 import ome.xml.r200802.spw.PlateNode; 
    93 import ome.xml.r200802.spw.PlateRefNode; 
    94 import ome.xml.r200802.spw.ReagentNode; 
    95 import ome.xml.r200802.spw.ReagentRefNode; 
    96 import ome.xml.r200802.spw.ScreenAcquisitionNode; 
    97 import ome.xml.r200802.spw.ScreenNode; 
    98 import ome.xml.r200802.spw.ScreenRefNode; 
    99 import ome.xml.r200802.spw.WellNode; 
    100 import ome.xml.r200802.spw.WellSampleNode; 
    101 import ome.xml.r200802.spw.WellSampleRefNode; 
    10239 
    10340/** 
     
    935872  } 
    936873 
     874  /* @see loci.formats.meta.MetadataRetrieve#getFilterID(int, int) */ 
     875  public String getFilterID(int instrumentIndex, int filterIndex) { 
     876    FilterNode filter = getFilterNode(instrumentIndex, filterIndex, false); 
     877    return filter == null ? null : filter.getNodeID(); 
     878  } 
     879 
    937880  /* @see loci.formats.meta.MetadataRetrieve#getFilterLotNumber(int, int) */ 
    938881  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    32873230    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
    32883231    filterNode.setFilterWheel(filterWheel); 
     3232  } 
     3233 
     3234  /* @see loci.formats.meta.MetadataStore#setFilterID(String, int, int) */ 
     3235  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     3236    if (id == null) return; 
     3237    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
     3238    filterNode.setNodeID(id); 
    32893239  } 
    32903240 
  • trunk/components/bio-formats/src/loci/formats/ome/OMEXML200809Metadata.java

    r5093 r5155  
    2525 * 
    2626 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    27  * Created by melissa via MetadataAutogen on Apr 14, 2009 3:39:48 PM CDT 
     27 * Created by melissa via MetadataAutogen on Jun 8, 2009 8:47:09 AM CDT 
    2828 * 
    2929 *----------------------------------------------------------------------------- 
     
    3232package loci.formats.ome; 
    3333 
     34import ome.xml.OMEXMLNode; 
     35import ome.xml.r200809.ome.*; 
     36import ome.xml.r200809.spw.*; 
    3437import java.util.List; 
    35  
    3638import loci.common.LogTools; 
    37 import ome.xml.OMEXMLNode; 
    38 import ome.xml.r200809.ome.ArcNode; 
    39 import ome.xml.r200809.ome.ChannelComponentNode; 
    40 import ome.xml.r200809.ome.CircleNode; 
    41 import ome.xml.r200809.ome.ContactNode; 
    42 import ome.xml.r200809.ome.DatasetNode; 
    43 import ome.xml.r200809.ome.DatasetRefNode; 
    44 import ome.xml.r200809.ome.DetectorNode; 
    45 import ome.xml.r200809.ome.DetectorRefNode; 
    46 import ome.xml.r200809.ome.DichroicNode; 
    47 import ome.xml.r200809.ome.DisplayOptionsNode; 
    48 import ome.xml.r200809.ome.EllipseNode; 
    49 import ome.xml.r200809.ome.ExperimentNode; 
    50 import ome.xml.r200809.ome.ExperimentRefNode; 
    51 import ome.xml.r200809.ome.ExperimenterNode; 
    52 import ome.xml.r200809.ome.ExperimenterRefNode; 
    53 import ome.xml.r200809.ome.FilamentNode; 
    54 import ome.xml.r200809.ome.FilterNode; 
    55 import ome.xml.r200809.ome.FilterSetNode; 
    56 import ome.xml.r200809.ome.FilterSetRefNode; 
    57 import ome.xml.r200809.ome.GreyChannelNode; 
    58 import ome.xml.r200809.ome.GroupNode; 
    59 import ome.xml.r200809.ome.GroupRefNode; 
    60 import ome.xml.r200809.ome.ImageNode; 
    61 import ome.xml.r200809.ome.ImagingEnvironmentNode; 
    62 import ome.xml.r200809.ome.InstrumentNode; 
    63 import ome.xml.r200809.ome.InstrumentRefNode; 
    64 import ome.xml.r200809.ome.LaserNode; 
    65 import ome.xml.r200809.ome.LightSourceNode; 
    66 import ome.xml.r200809.ome.LightSourceRefNode; 
    67 import ome.xml.r200809.ome.LineNode; 
    68 import ome.xml.r200809.ome.LogicalChannelNode; 
    69 import ome.xml.r200809.ome.MaskNode; 
    70 import ome.xml.r200809.ome.MaskPixelsNode; 
    71 import ome.xml.r200809.ome.MicrobeamManipulationNode; 
    72 import ome.xml.r200809.ome.MicrobeamManipulationRefNode; 
    73 import ome.xml.r200809.ome.MicroscopeNode; 
    74 import ome.xml.r200809.ome.OMENode; 
    75 import ome.xml.r200809.ome.OTFNode; 
    76 import ome.xml.r200809.ome.OTFRefNode; 
    77 import ome.xml.r200809.ome.ObjectiveNode; 
    78 import ome.xml.r200809.ome.ObjectiveRefNode; 
    79 import ome.xml.r200809.ome.PixelsNode; 
    80 import ome.xml.r200809.ome.PlaneNode; 
    81 import ome.xml.r200809.ome.PlaneTimingNode; 
    82 import ome.xml.r200809.ome.PointNode; 
    83 import ome.xml.r200809.ome.PolygonNode; 
    84 import ome.xml.r200809.ome.PolylineNode; 
    85 import ome.xml.r200809.ome.ProjectNode; 
    86 import ome.xml.r200809.ome.ProjectRefNode; 
    87 import ome.xml.r200809.ome.ProjectionNode; 
    88 import ome.xml.r200809.ome.PumpNode; 
    89 import ome.xml.r200809.ome.ROINode; 
    90 import ome.xml.r200809.ome.ROIRefNode; 
    91 import ome.xml.r200809.ome.RectNode; 
    92 import ome.xml.r200809.ome.RegionNode; 
    93 import ome.xml.r200809.ome.ShapeNode; 
    94 import ome.xml.r200809.ome.StageLabelNode; 
    95 import ome.xml.r200809.ome.StagePositionNode; 
    96 import ome.xml.r200809.ome.ThumbnailNode; 
    97 import ome.xml.r200809.ome.TiffDataNode; 
    98 import ome.xml.r200809.ome.TimeNode; 
    99 import ome.xml.r200809.ome.TransmittanceRangeNode; 
    100 import ome.xml.r200809.ome.UUIDNode; 
    101 import ome.xml.r200809.ome.UnionNode; 
    102 import ome.xml.r200809.spw.ImageRefNode; 
    103 import ome.xml.r200809.spw.PlateNode; 
    104 import ome.xml.r200809.spw.PlateRefNode; 
    105 import ome.xml.r200809.spw.ReagentNode; 
    106 import ome.xml.r200809.spw.ReagentRefNode; 
    107 import ome.xml.r200809.spw.ScreenAcquisitionNode; 
    108 import ome.xml.r200809.spw.ScreenNode; 
    109 import ome.xml.r200809.spw.ScreenRefNode; 
    110 import ome.xml.r200809.spw.WellNode; 
    111 import ome.xml.r200809.spw.WellSampleNode; 
    112 import ome.xml.r200809.spw.WellSampleRefNode; 
    11339 
    11440/** 
     
    948874  } 
    949875 
     876  /* @see loci.formats.meta.MetadataRetrieve#getFilterID(int, int) */ 
     877  public String getFilterID(int instrumentIndex, int filterIndex) { 
     878    FilterNode filter = getFilterNode(instrumentIndex, filterIndex, false); 
     879    return filter == null ? null : filter.getNodeID(); 
     880  } 
     881 
    950882  /* @see loci.formats.meta.MetadataRetrieve#getFilterLotNumber(int, int) */ 
    951883  public String getFilterLotNumber(int instrumentIndex, int filterIndex) { 
     
    33223254    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
    33233255    filterNode.setFilterWheel(filterWheel); 
     3256  } 
     3257 
     3258  /* @see loci.formats.meta.MetadataStore#setFilterID(String, int, int) */ 
     3259  public void setFilterID(String id, int instrumentIndex, int filterIndex) { 
     3260    if (id == null) return; 
     3261    FilterNode filterNode = getFilterNode(instrumentIndex, filterIndex, true); 
     3262    filterNode.setNodeID(id); 
    33243263  } 
    33253264 
Note: See TracChangeset for help on using the changeset viewer.