Changeset 2307


Ignore:
Timestamp:
02/21/07 12:56:22 (13 years ago)
Author:
melissa
Message:
  • Added several new methods to the MetadataStore API.
  • Populated LogicalChannel ST in non-microscopy formats.
  • Fixed various bugs in OMEXMLReader and ChannelMerger.
Location:
trunk/loci/formats
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/AggregateMetadataStore.java

    r2265 r2307  
    237237  } 
    238238 
     239  /* @see MetadataStore#setImagingEnvironment(Float, Float, Float,  
     240   * Float, Integer)  
     241   */ 
     242  public void setImagingEnvironment(Float temperature, Float airPressure, 
     243    Float humidity, Float co2Percent, Integer i) 
     244  { 
     245    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     246      MetadataStore s = (MetadataStore) iter.next(); 
     247      s.setImagingEnvironment(temperature, airPressure, humidity,  
     248        co2Percent, i); 
     249    } 
     250  } 
     251 
     252  /* @see MetadataStore#setDisplayChannel(Integer, Double, Double, Float 
     253   * Integer) 
     254   */ 
     255  public void setDisplayChannel(Integer channelNumber, Double blackLevel, 
     256    Double whiteLevel, Float gamma, Integer i) 
     257  { 
     258    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     259      MetadataStore s = (MetadataStore) iter.next(); 
     260      s.setDisplayChannel(channelNumber, blackLevel, whiteLevel, gamma, i); 
     261    } 
     262  } 
     263 
     264  /* @see MetadataStore#setDisplayOptions(Float, Boolean, Boolean, Boolean, 
     265   * Boolean, String, Integer, Integer, Integer, Integer, Integer, Integer, 
     266   * Integer, Integer, Integer, Integer) 
     267   */ 
     268  public void setDisplayOptions(Float zoom, Boolean redChannelOn, 
     269    Boolean greenChannelOn, Boolean blueChannelOn, Boolean displayRGB, 
     270    String colorMap, Integer zstart, Integer zstop, Integer tstart, 
     271    Integer tstop, Integer imageNdx, Integer pixelNdx, Integer redChannel, 
     272    Integer greenChannel, Integer blueChannel, Integer grayChannel) 
     273  { 
     274    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     275      MetadataStore s = (MetadataStore) iter.next(); 
     276      s.setDisplayOptions(zoom, redChannelOn, greenChannelOn, blueChannelOn, 
     277        displayRGB, colorMap, zstart, zstop, tstart, tstop, imageNdx, pixelNdx, 
     278        redChannel, greenChannel, blueChannel, grayChannel); 
     279    } 
     280  } 
     281 
     282  /* @see MetadataStore#setLightSource(String, String, String,  
     283   * Integer, Integer)  
     284   */ 
     285  public void setLightSource(String manufacturer, String model, 
     286    String serialNumber, Integer instrumentNdx, Integer lightNdx) 
     287  { 
     288    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     289      MetadataStore s = (MetadataStore) iter.next(); 
     290      s.setLightSource(manufacturer, model, serialNumber, instrumentNdx,  
     291        lightNdx); 
     292    } 
     293  } 
     294 
     295  /* @see MetadataStore#setLaser(String, String, Integer, Boolean, Boolean, 
     296   * String, Float, Integer, Integer, Integer, Integer) 
     297   */ 
     298  public void setLaser(String type, String medium, Integer wavelength, 
     299    Boolean frequencyDoubled, Boolean tunable, String pulse, Float power, 
     300    Integer instrumentNdx, Integer lightNdx, Integer pumpNdx, Integer laserNdx) 
     301  { 
     302    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     303      MetadataStore s = (MetadataStore) iter.next(); 
     304      s.setLaser(type, medium, wavelength, frequencyDoubled, tunable, pulse, 
     305        power, instrumentNdx, lightNdx, pumpNdx, laserNdx); 
     306    } 
     307  } 
     308 
     309  /* @see MetadataStore#setFilament(String, Float, Integer, Integer) */ 
     310  public void setFilament(String type, Float power, Integer lightNdx,  
     311    Integer filamentNdx)  
     312  {  
     313    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     314      MetadataStore s = (MetadataStore) iter.next(); 
     315      s.setFilament(type, power, lightNdx, filamentNdx); 
     316    } 
     317  } 
     318 
     319  /* @see MetadataStore#setArc(String, Float, Integer, Integer) */ 
     320  public void setArc(String type, Float power, Integer lightNdx, Integer arcNdx) 
     321  { 
     322    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     323      MetadataStore s = (MetadataStore) iter.next(); 
     324      s.setArc(type, power, lightNdx, arcNdx); 
     325    } 
     326  } 
     327 
     328  /* @see MetadataStore#setDetector(String, String, String, String, Float, 
     329   * Float, Float, Integer, Integer) 
     330   */ 
     331  public void setDetector(String manufacturer, String model, 
     332    String serialNumber, String type, Float gain, Float voltage, Float offset, 
     333    Integer instrumentNdx, Integer detectorNdx) 
     334  { 
     335    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     336      MetadataStore s = (MetadataStore) iter.next(); 
     337      s.setDetector(manufacturer, model, serialNumber, type, gain, voltage, 
     338        offset, instrumentNdx, detectorNdx); 
     339    } 
     340  } 
     341 
     342  /* @see MetadataStore#setObjective(String, String, String, Float, Float,  
     343   * Integer, Integer)  
     344   */ 
     345  public void setObjective(String manufacturer, String model,  
     346    String serialNumber, Float lensNA, Float magnification,  
     347    Integer instrumentNdx, Integer objectiveNdx) 
     348  { 
     349    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     350      MetadataStore s = (MetadataStore) iter.next(); 
     351      s.setObjective(manufacturer, model, serialNumber, lensNA, magnification,  
     352        instrumentNdx, objectiveNdx); 
     353    } 
     354  } 
     355 
     356  /* @see MetadataStore#setExcitationFilter(String, String, String, String, 
     357   * Integer) 
     358   */ 
     359  public void setExcitationFilter(String manufacturer, String model, 
     360    String lotNumber, String type, Integer filterNdx) 
     361  { 
     362    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     363      MetadataStore s = (MetadataStore) iter.next(); 
     364      s.setExcitationFilter(manufacturer, model, lotNumber, type, filterNdx); 
     365    } 
     366  } 
     367 
     368  /* @see MetadataStore#setDichroic(String, String, String, Integer) */ 
     369  public void setDichroic(String manufacturer, String model, String lotNumber, 
     370    Integer dichroicNdx) 
     371  { 
     372    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     373      MetadataStore s = (MetadataStore) iter.next(); 
     374      s.setDichroic(manufacturer, model, lotNumber, dichroicNdx); 
     375    } 
     376  } 
     377 
     378  /* @see MetadataStore#setEmissionFilter(String, String, String,  
     379   * String, Integer) 
     380   */ 
     381  public void setEmissionFilter(String manufacturer, String model, 
     382    String lotNumber, String type, Integer filterNdx) 
     383  { 
     384    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     385      MetadataStore s = (MetadataStore) iter.next(); 
     386      s.setEmissionFilter(manufacturer, model, lotNumber, type, filterNdx); 
     387    } 
     388  } 
     389 
     390  /* @see MetadataStore#setFilterSet(String, String, String, Integer,  
     391   * Integer)  
     392   */ 
     393  public void setFilterSet(String manufacturer, String model, String lotNumber, 
     394    Integer filterSetNdx, Integer filterNdx) 
     395  { 
     396    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     397      MetadataStore s = (MetadataStore) iter.next(); 
     398      s.setFilterSet(manufacturer, model, lotNumber, filterSetNdx, filterNdx); 
     399    } 
     400  } 
     401 
     402  /* @see MetadataStore#setOTF(Integer, Integer, String, String,  
     403   * Boolean, Integer, Integer, Integer, Integer) 
     404   */ 
     405  public void setOTF(Integer sizeX, Integer sizeY, String pixelType, 
     406    String path, Boolean opticalAxisAverage, Integer instrumentNdx, 
     407    Integer otfNdx, Integer filterNdx, Integer objectiveNdx) 
     408  { 
     409    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
     410      MetadataStore s = (MetadataStore) iter.next(); 
     411      s.setOTF(sizeX, sizeY, pixelType, path, opticalAxisAverage, instrumentNdx, 
     412      otfNdx, filterNdx, objectiveNdx); 
     413    } 
     414  } 
     415 
    239416} 
  • trunk/loci/formats/ChannelMerger.java

    r2178 r2307  
    5656  } 
    5757 
     58  /* @see IFormatReader#getDimensionOrder(String) */ 
     59  public String getDimensionOrder(String id)  
     60    throws FormatException, IOException 
     61  { 
     62    String order = reader.getDimensionOrder(id); 
     63    if (canMerge(id)) { 
     64      StringBuffer sb = new StringBuffer(order); 
     65      while (order.indexOf("C") != 2) { 
     66        char pre = order.charAt(order.indexOf("C") - 1); 
     67        sb.setCharAt(order.indexOf("C"), pre); 
     68        sb.setCharAt(order.indexOf(pre), 'C'); 
     69        order = sb.toString(); 
     70      } 
     71    } 
     72    return order; 
     73  } 
     74 
    5875  /** Checks if the images in the file are RGB. */ 
    5976  public boolean isRGB(String id) throws FormatException, IOException { 
     
    7087 
    7188    int z = nos[0], t = nos[2]; 
    72     String order = getDimensionOrder(id); 
     89    String order = reader.getDimensionOrder(id); 
    7390    int ic = order.indexOf("C") - 2; 
    7491    if (ic < 0 || ic > 2) { 
     
    93110    int[] nos = getZCTCoords(id, no); 
    94111    int z = nos[0], t = nos[2]; 
    95     String dimOrder = getDimensionOrder(id); 
     112    String dimOrder = reader.getDimensionOrder(id); 
    96113    int ic = dimOrder.indexOf("C") - 2; 
    97114    byte[] bytes = null; 
  • trunk/loci/formats/DummyMetadataStore.java

    r2265 r2307  
    9595  } 
    9696 
     97  public void setImagingEnvironment(Float temperature, Float airPressure, 
     98    Float humidity, Float co2Percent, Integer i) 
     99  { 
     100  } 
     101 
     102  public void setDisplayChannel(Integer channelNumber, Double blackLevel, 
     103    Double whiteLevel, Float gamma, Integer i) 
     104  { 
     105  } 
     106 
     107  public void setDisplayOptions(Float zoom, Boolean redChannelOn, 
     108    Boolean greenChannelOn, Boolean blueChannelOn, Boolean displayRGB, 
     109    String colorMap, Integer zstart, Integer zstop, Integer tstart, 
     110    Integer tstop, Integer imageNdx, Integer pixelNdx, Integer redChannel, 
     111    Integer greenChannel, Integer blueChannel, Integer grayChannel) 
     112  { 
     113  } 
     114 
     115  public void setLightSource(String manufacturer, String model, 
     116    String serialNumber, Integer instrumentNdx, Integer lightNdx) 
     117  { 
     118  } 
     119 
     120  public void setLaser(String type, String medium, Integer wavelength, 
     121    Boolean frequencyDoubled, Boolean tunable, String pulse, Float power, 
     122    Integer instrumentNdx, Integer lightNdx, Integer pumpNdx, Integer laserNdx) 
     123  { 
     124  } 
     125 
     126  public void setFilament(String type, Float power, Integer lightNdx,  
     127    Integer filamentNdx)  
     128  {  
     129  } 
     130 
     131  public void setArc(String type, Float power, Integer lightNdx, Integer arcNdx) 
     132  {  
     133  } 
     134 
     135  public void setDetector(String manufacturer, String model, 
     136    String serialNumber, String type, Float gain, Float voltage, Float offset, 
     137    Integer instrumentNdx, Integer detectorNdx) 
     138  { 
     139  } 
     140 
     141  public void setObjective(String manufacturer, String model,  
     142    String serialNumber, Float lensNA, Float magnification,  
     143    Integer instrumentNdx, Integer objectiveNdx) 
     144  { 
     145  } 
     146 
     147  public void setExcitationFilter(String manufacturer, String model, 
     148    String lotNumber, String type, Integer filterNdx) 
     149  { 
     150  } 
     151 
     152  public void setDichroic(String manufacturer, String model, String lotNumber, 
     153    Integer dichroicNdx) 
     154  { 
     155  } 
     156 
     157  public void setEmissionFilter(String manufacturer, String model, 
     158    String lotNumber, String type, Integer filterNdx) 
     159  { 
     160  } 
     161 
     162  public void setFilterSet(String manufacturer, String model, String lotNumber, 
     163    Integer filterSetNdx, Integer filterNdx) 
     164  { 
     165  } 
     166 
     167  public void setOTF(Integer sizeX, Integer sizeY, String pixelType, 
     168    String path, Boolean opticalAxisAverage, Integer instrumentNdx, 
     169    Integer otfNdx, Integer filterNdx, Integer objectiveNdx) 
     170  { 
     171  } 
     172 
    97173} 
  • trunk/loci/formats/MetadataStore.java

    r2265 r2307  
    241241  void setDefaultDisplaySettings(Integer i); 
    242242 
     243  /** Sets the imaging environment for a particular image. */ 
     244  void setImagingEnvironment(Float temperature, Float airPressure, 
     245    Float humidity, Float co2Percent, Integer i); 
     246 
     247  /** Sets information about the specified channel for a particular image. */ 
     248  void setDisplayChannel(Integer channelNumber, Double blackLevel, 
     249    Double whiteLevel, Float gamma, Integer i); 
     250 
     251  /** Sets various display options for a particular pixels set. */ 
     252  void setDisplayOptions(Float zoom, Boolean redChannelOn,  
     253    Boolean greenChannelOn, Boolean blueChannelOn, Boolean displayRGB, 
     254    String colorMap, Integer zstart, Integer zstop, Integer tstart,  
     255    Integer tstop, Integer imageNdx, Integer pixelsNdx, Integer redChannel, 
     256    Integer greenChannel, Integer blueChannel, Integer grayChannel); 
     257 
     258  /** Sets a light source for a particular instrument. */ 
     259  void setLightSource(String manufacturer, String model, String serialNumber,  
     260    Integer instrumentIndex, Integer lightIndex); 
     261 
     262  /** Sets a laser for a particular instrument. */ 
     263  void setLaser(String type, String medium, Integer wavelength, 
     264    Boolean frequencyDoubled, Boolean tunable, String pulse, Float power, 
     265    Integer instrumentNdx, Integer lightNdx, Integer pumpNdx, Integer laserNdx); 
     266 
     267  /** Sets a filament for a particular instrument. */ 
     268  void setFilament(String type, Float power, Integer lightNdx,  
     269    Integer filamentNdx); 
     270 
     271  /** Sets an arc for a particular instrument. */ 
     272  void setArc(String type, Float power, Integer lightNdx, Integer arcNdx); 
     273  
     274  /** Sets a detector for a particular instrument. */ 
     275  void setDetector(String manufacturer, String model, String serialNumber, 
     276    String type, Float gain, Float voltage, Float offset, Integer instrumentNdx, 
     277    Integer detectorNdx); 
     278 
     279  /** Sets an objective for a particular instrument. */ 
     280  void setObjective(String manufacturer, String model, String serialNumber, 
     281    Float lensNA, Float magnification, Integer instrumentNdx,  
     282    Integer objectiveNdx); 
     283 
     284  /** Sets an excitation filter for a particular instrument. */ 
     285  void setExcitationFilter(String manufacturer, String model, String lotNumber, 
     286    String type, Integer filterNdx); 
     287 
     288  /** Sets a dichroic for a particular instrument. */ 
     289  void setDichroic(String manufacturer, String model, String lotNumber,  
     290    Integer dichroicNdx); 
     291 
     292  /** Sets an emission filter for a particular instrument. */ 
     293  void setEmissionFilter(String manufacturer, String model, String lotNumber, 
     294    String type, Integer filterNdx); 
     295 
     296  /** Sets a filter set for a particular instrument. */ 
     297  void setFilterSet(String manufacturer, String model, String lotNumber,  
     298    Integer filterSetNdx, Integer filterNdx); 
     299 
     300  /** Sets an OTF for a particular instrument. */ 
     301  void setOTF(Integer sizeX, Integer sizeY, String pixelType, String path, 
     302    Boolean opticalAxisAverage, Integer instrumentNdx, Integer otfNdx, 
     303    Integer filterNdx, Integer objectiveNdx); 
     304 
    243305} 
  • trunk/loci/formats/OMEXMLMetadataStore.java

    r2268 r2307  
    614614    // Populate the greyscale channel 
    615615    displayOptions.setGreyChannel(greyscaleChannel); 
     616  } 
     617 
     618 
     619  /* @see MetadataStore#setImagingEnvironment(Float, Float, Float, 
     620   * Float, Integer) 
     621   */ 
     622  public void setImagingEnvironment(Float temperature, Float airPressure, 
     623    Float humidity, Float co2Percent, Integer i) 
     624  { 
     625    int ndx = i == null ? 0 : i.intValue(); 
     626    ImageNode image = (ImageNode) getChild(root, "Image", ndx); 
     627    CustomAttributesNode ca = (CustomAttributesNode) 
     628      getChild(image, "CustomAttributes", 0); 
     629    ImagingEnvironmentNode env =  
     630      (ImagingEnvironmentNode) getChild(ca, "ImagingEnvironment", 0); 
     631    env.setTemperature(temperature); 
     632    env.setAirPressure(airPressure); 
     633    env.setHumidity(humidity); 
     634    env.setCO2Percent(co2Percent); 
     635  } 
     636 
     637  /* @see MetadataStore#setDisplayChannel(Integer, Double, Double, Float, 
     638   * Integer) 
     639   */ 
     640  public void setDisplayChannel(Integer channelNumber, Double blackLevel, 
     641    Double whiteLevel, Float gamma, Integer i) 
     642  { 
     643    int ndx = i == null ? 0 : i.intValue(); 
     644    ImageNode image = (ImageNode) getChild(root, "Image", ndx); 
     645    CustomAttributesNode ca = (CustomAttributesNode) 
     646      getChild(image, "CustomAttributes", 0); 
     647    DisplayChannelNode display = (DisplayChannelNode)  
     648      getChild(ca, "DisplayChannel", channelNumber.intValue());     
     649    display.setChannelNumber(channelNumber); 
     650    display.setBlackLevel(blackLevel); 
     651    display.setWhiteLevel(whiteLevel); 
     652    display.setGamma(gamma); 
     653  } 
     654 
     655  /* @see MetadataStore#setDisplayOptions(Float, Boolean, Boolean, Boolean, 
     656   * Boolean, String, Integer, Integer, Integer, Integer, Integer, Integer, 
     657   * Integer, Integer, Integer, Integer) 
     658   */ 
     659  public void setDisplayOptions(Float zoom, Boolean redChannelOn, 
     660    Boolean greenChannelOn, Boolean blueChannelOn, Boolean displayRGB, 
     661    String colorMap, Integer zstart, Integer zstop, Integer tstart, 
     662    Integer tstop, Integer imageNdx, Integer pixelsNdx, Integer redChannel,  
     663    Integer greenChannel, Integer blueChannel, Integer grayChannel) 
     664  { 
     665    int ndx = imageNdx == null ? 0 : imageNdx.intValue(); 
     666    int pixNdx = pixelsNdx == null ? 0 : pixelsNdx.intValue(); 
     667     
     668    ImageNode image = (ImageNode) getChild(root, "Image", ndx); 
     669    CustomAttributesNode ca = (CustomAttributesNode) 
     670      getChild(image, "CustomAttributes", 0); 
     671    PixelsNode pix = (PixelsNode) getChild(ca, "Pixels", pixNdx); 
     672    DisplayChannelNode red = redChannel == null ? null : (DisplayChannelNode) 
     673      getChild(ca, "DisplayChannel", redChannel.intValue()); 
     674    DisplayChannelNode green = greenChannel == null ? null :  
     675      (DisplayChannelNode) getChild(ca, "DisplayChannel",  
     676      greenChannel.intValue()); 
     677    DisplayChannelNode blue = blueChannel == null ? null : (DisplayChannelNode) 
     678      getChild(ca, "DisplayChannel", blueChannel.intValue()); 
     679    DisplayChannelNode gray = grayChannel == null ? null : (DisplayChannelNode) 
     680      getChild(ca, "DisplayChannel", grayChannel.intValue()); 
     681 
     682    DisplayOptionsNode display = (DisplayOptionsNode) 
     683      getChild(ca, "DisplayOptions", 0); 
     684    display.setPixels(pix); 
     685    display.setZoom(zoom); 
     686    if (red != null) display.setRedChannel(red); 
     687    display.setRedChannelOn(new Boolean(red != null)); 
     688    if (green != null) display.setGreenChannel(green); 
     689    display.setGreenChannelOn(new Boolean(green != null)); 
     690    if (blue != null) display.setBlueChannel(blue); 
     691    display.setBlueChannelOn(new Boolean(blue != null)); 
     692    display.setDisplayRGB(displayRGB); 
     693    if (gray != null) display.setGreyChannel(gray); 
     694    display.setColorMap(colorMap); 
     695    display.setZStart(zstart); 
     696    display.setZStop(zstop); 
     697    display.setTStart(tstart); 
     698    display.setTStop(tstop); 
     699  } 
     700 
     701  /* @see MetadataStore#setLightSource(String, String, String,  
     702   * Integer, Integer)  
     703   */ 
     704  public void setLightSource(String manufacturer, String model, 
     705    String serialNumber, Integer instrumentIndex, Integer lightIndex) 
     706  { 
     707    int ndx = instrumentIndex == null ? 0 : instrumentIndex.intValue(); 
     708    int lightNdx = lightIndex == null ? 0 : lightIndex.intValue(); 
     709    CustomAttributesNode ca = (CustomAttributesNode) 
     710      getChild(root, "CustomAttributes", 0); 
     711    InstrumentNode inst = (InstrumentNode) getChild(ca, "Instrument", ndx); 
     712    LightSourceNode light =  
     713      (LightSourceNode) getChild(ca, "LightSource", lightNdx); 
     714    light.setManufacturer(manufacturer); 
     715    light.setModel(model); 
     716    light.setSerialNumber(serialNumber); 
     717    light.setInstrument(inst); 
     718  } 
     719 
     720  /* @see MetadataStore#setLaser(String, String, Integer, Boolean, Boolean, 
     721   * String, Float, Integer, Integer, Integer, Integer) 
     722   */ 
     723  public void setLaser(String type, String medium, Integer wavelength, 
     724    Boolean frequencyDoubled, Boolean tunable, String pulse, Float power, 
     725    Integer instrumentNdx, Integer lightNdx, Integer pumpNdx, Integer num) 
     726  { 
     727    int ndx = instrumentNdx == null ? 0 : instrumentNdx.intValue(); 
     728    int light = lightNdx == null ? 0 : lightNdx.intValue(); 
     729    int pump = pumpNdx == null ? 0 : pumpNdx.intValue(); 
     730    int laserNdx = num == null ? 0 : num.intValue(); 
     731 
     732    CustomAttributesNode ca = (CustomAttributesNode) 
     733      getChild(root, "CustomAttributes", 0); 
     734    LightSourceNode lightNode =  
     735      (LightSourceNode) getChild(ca, "LightSource", light); 
     736    LightSourceNode pumpNode = 
     737      (LightSourceNode) getChild(ca, "LightSource", pump); 
     738    LaserNode laser = (LaserNode) getChild(ca, "Laser", laserNdx); 
     739     
     740    laser.setType(type); 
     741    laser.setMedium(medium); 
     742    laser.setWavelength(wavelength); 
     743    laser.setFrequencyDoubled(frequencyDoubled); 
     744    laser.setTunable(tunable); 
     745    laser.setPulse(pulse); 
     746    laser.setPower(power); 
     747    laser.setLightSource(lightNode); 
     748    laser.setPump(pumpNode); 
     749  } 
     750 
     751  /* @see MetadataStore#setFilament(String, Float, Integer, Integer) */ 
     752  public void setFilament(String type, Float power, Integer lightSource,  
     753    Integer num)  
     754  {  
     755    int lightNdx = lightSource == null ? 0 : lightSource.intValue(); 
     756    int n = num == null ? 0 : num.intValue(); 
     757 
     758    CustomAttributesNode ca = (CustomAttributesNode) 
     759      getChild(root, "CustomAttributes", 0); 
     760    LightSourceNode light =  
     761      (LightSourceNode) getChild(ca, "LightSource", lightNdx); 
     762 
     763    FilamentNode filament = (FilamentNode) getChild(ca, "Filament", n); 
     764    filament.setType(type); 
     765    filament.setPower(power); 
     766    filament.setLightSource(light); 
     767  } 
     768 
     769  /* @see MetadataStore#setArc(String, Float, Integer, Integer) */ 
     770  public void setArc(String type, Float power, Integer lightSource,  
     771    Integer num)  
     772  {  
     773    int lightNdx = lightSource == null ? 0 : lightSource.intValue(); 
     774    int n = num == null ? 0 : num.intValue(); 
     775 
     776    CustomAttributesNode ca = (CustomAttributesNode) 
     777      getChild(root, "CustomAttributes", 0); 
     778    LightSourceNode light =  
     779      (LightSourceNode) getChild(ca, "LightSource", lightNdx); 
     780    ArcNode arc = (ArcNode) getChild(ca, "Arc", n); 
     781    arc.setType(type); 
     782    arc.setPower(power); 
     783    arc.setLightSource(light); 
     784  } 
     785 
     786  /* @see MetadataStore#setDetector(String, String, String, String, Float, 
     787   * Float, Float, Integer, Integer) 
     788   */ 
     789  public void setDetector(String manufacturer, String model, 
     790    String serialNumber, String type, Float gain, Float voltage, Float offset, 
     791    Integer instrumentNdx, Integer detectorNdx) 
     792  { 
     793    int ndx = instrumentNdx == null ? 0 : instrumentNdx.intValue(); 
     794    int dNdx = detectorNdx == null ? 0 : detectorNdx.intValue(); 
     795  
     796    CustomAttributesNode ca = (CustomAttributesNode) 
     797      getChild(root, "CustomAttributes", 0); 
     798    InstrumentNode inst = (InstrumentNode) getChild(ca, "Instrument", ndx); 
     799    DetectorNode detector = (DetectorNode) getChild(ca, "Detector", dNdx); 
     800    detector.setManufacturer(manufacturer); 
     801    detector.setModel(model); 
     802    detector.setSerialNumber(serialNumber); 
     803    detector.setType(type); 
     804    detector.setGain(gain); 
     805    detector.setVoltage(voltage); 
     806    detector.setOffset(offset); 
     807    detector.setInstrument(inst); 
     808  } 
     809 
     810  /* @see MetadataStore#setObjective(String, String, String, Float, Float,  
     811   * Integer, Integer)  
     812   */ 
     813  public void setObjective(String manufacturer, String model,  
     814    String serialNumber, Float lensNA, 
     815    Float magnification, Integer instrument, Integer objective) 
     816  { 
     817    int iNdx = instrument == null ? 0 : instrument.intValue(); 
     818    int oNdx = objective == null ? 0 : objective.intValue(); 
     819 
     820    CustomAttributesNode ca = (CustomAttributesNode) 
     821      getChild(root, "CustomAttributes", 0); 
     822    InstrumentNode inst = (InstrumentNode) getChild(ca, "Instrument", iNdx); 
     823    ObjectiveNode obj = (ObjectiveNode) getChild(ca, "Objective", oNdx); 
     824    obj.setManufacturer(manufacturer); 
     825    obj.setModel(model); 
     826    obj.setSerialNumber(serialNumber); 
     827    obj.setLensNA(lensNA); 
     828    obj.setMagnification(magnification); 
     829    obj.setInstrument(inst); 
     830  } 
     831 
     832  /* @see MetadataStore#setExcitationFilter(String, String, String,  
     833   * String, Integer) 
     834   */ 
     835  public void setExcitationFilter(String manufacturer, String model, 
     836    String lotNumber, String type, Integer filter) 
     837  { 
     838    int fNdx = filter == null ? 0 : filter.intValue(); 
     839 
     840    CustomAttributesNode ca = (CustomAttributesNode) 
     841      getChild(root, "CustomAttributes", 0); 
     842    ExcitationFilterNode f =  
     843      (ExcitationFilterNode) getChild(ca, "ExcitationFilter", fNdx); 
     844    f.setManufacturer(manufacturer); 
     845    f.setModel(model); 
     846    f.setLotNumber(lotNumber); 
     847    f.setType(type); 
     848  } 
     849 
     850  /* @see MetadataStore#setDichroic(String, String, String, Integer) */ 
     851  public void setDichroic(String manufacturer, String model, String lotNumber, 
     852    Integer dichroic) 
     853  { 
     854    int dNdx = dichroic == null ? 0 : dichroic.intValue(); 
     855 
     856    CustomAttributesNode ca = (CustomAttributesNode) 
     857      getChild(root, "CustomAttributes", 0); 
     858    DichroicNode d = (DichroicNode) getChild(ca, "Dichroic", dNdx); 
     859    d.setManufacturer(manufacturer); 
     860    d.setModel(model); 
     861    d.setLotNumber(lotNumber); 
     862  } 
     863 
     864  /* @see MetadataStore#setEmissionFilter(String, String, String,  
     865   * String, Integer) 
     866   */ 
     867  public void setEmissionFilter(String manufacturer, String model, 
     868    String lotNumber, String type, Integer filter) 
     869  { 
     870    int fNdx = filter == null ? 0 : filter.intValue(); 
     871 
     872    CustomAttributesNode ca = (CustomAttributesNode) 
     873      getChild(root, "CustomAttributes", 0); 
     874    EmissionFilterNode f = (EmissionFilterNode)  
     875      getChild(ca, "EmissionFilter", fNdx); 
     876    f.setManufacturer(manufacturer); 
     877    f.setModel(model); 
     878    f.setLotNumber(lotNumber); 
     879    f.setType(type); 
     880  } 
     881 
     882  /* @see MetadataStore#setFilterSet(String, String, String, Integer,  
     883   * Integer)  
     884   */ 
     885  public void setFilterSet(String manufacturer, String model, String lotNumber, 
     886    Integer filterSet, Integer filter) 
     887  { 
     888    int fsNdx = filterSet == null ? 0 : filterSet.intValue(); 
     889    int fNdx = filter == null ? 0 : filter.intValue(); 
     890 
     891    CustomAttributesNode ca = (CustomAttributesNode) 
     892      getChild(root, "CustomAttributes", 0); 
     893    FilterNode filterNode = (FilterNode) getChild(ca, "Filter", fNdx); 
     894    FilterSetNode fsNode = (FilterSetNode) getChild(ca, "FilterSet", fsNdx); 
     895    fsNode.setManufacturer(manufacturer); 
     896    fsNode.setModel(model); 
     897    fsNode.setLotNumber(lotNumber); 
     898    fsNode.setFilter(filterNode); 
     899  } 
     900 
     901  /* @see MetadataStore#setOTF(Integer, Integer, String, String,  
     902   * Boolean, Integer, Integer, Integer, Integer) 
     903   */ 
     904  public void setOTF(Integer sizeX, Integer sizeY, String pixelType, 
     905    String path, Boolean opticalAxisAverage, Integer instrument, Integer otf, 
     906    Integer filter, Integer objective) 
     907  { 
     908    int iNdx = instrument == null ? 0 : instrument.intValue(); 
     909    int fNdx = filter == null ? 0 : filter.intValue(); 
     910    int otfNdx = otf == null ? 0 : otf.intValue(); 
     911    int oNdx = objective == null ? 0 : objective.intValue(); 
     912 
     913    CustomAttributesNode ca = (CustomAttributesNode) 
     914      getChild(root, "CustomAttributes", 0); 
     915    InstrumentNode inst = (InstrumentNode) getChild(ca, "Instrument", iNdx); 
     916    ObjectiveNode obj = (ObjectiveNode) getChild(ca, "Objective", oNdx); 
     917    FilterNode f = (FilterNode) getChild(ca, "Filter", fNdx); 
     918 
     919    OTFNode otfNode = (OTFNode) getChild(ca, "OTF", otfNdx); 
     920    otfNode.setObjective(obj); 
     921    otfNode.setFilter(f); 
     922    otfNode.setSizeX(sizeX); 
     923    otfNode.setSizeY(sizeY); 
     924    otfNode.setPixelType(pixelType); 
     925    otfNode.setPath(path); 
     926    otfNode.setOpticalAxisAverage(opticalAxisAverage); 
     927    otfNode.setInstrument(inst); 
    616928  } 
    617929 
  • trunk/loci/formats/in/BioRadReader.java

    r2291 r2307  
    675675    currentOrder[0] = dimOrder; 
    676676 
    677     store.setImage(name, null /* creation date */, null /* description */, null); 
    678  
    679     store.setInstrument(null /* manufacturer */, null /* model */, 
    680       null /* serial number */, null /* type */, null); 
    681  
    682     store.setLogicalChannel(0 /* channel index */, null /* name */, 
    683      null /* ND filter */, null /* EM wave */, null /* excitation wavelength */, 
    684      null /* photometric interpretation */, null /* mode */, null); 
    685  
    686     store.setChannelGlobalMinMax(0 /* channel */, null /* double min */, 
    687       null /* double max */, null); 
    688  
    689     // TODO do this for each plane 
    690     //store.setPlaneInfo(theZ, theC, theT, Float timestamp, Float exposureTime, 
    691     //  null); 
    692  
    693677    store.setPixels( 
    694678      new Integer(nx), // SizeX 
     
    712696   
    713697    store.setDefaultDisplaySettings(null); 
     698   
     699    for (int i=0; i<sizeC[0]; i++) { 
     700      //setLogicalChannel 
     701      String black = (String) getMeta("PMT " + i + " Black level"); 
     702      store.setDisplayChannel(new Integer(i), black == null ? null :  
     703        new Double(black), new Double(Math.pow(2, type == 1 ? 8 : 16)), 
     704        null, null); 
     705    } 
     706    String zoom = (String) getMeta("Zoom factor (user selected)"); 
     707    String zstart = (String) getMeta("Z start"); 
     708    String zstop = (String) getMeta("Z stop"); 
     709    store.setDisplayOptions(zoom == null ? null : new Float(zoom), 
     710      new Boolean(sizeC[0] > 1), new Boolean(sizeC[0] >= 2), 
     711      new Boolean(sizeC[0] >= 3), Boolean.FALSE, null, zstart == null ? null : 
     712      new Integer((int) (new Double(zstart).doubleValue())), zstop == null ?  
     713      null : new Integer((int) (new Double(zstop).doubleValue())), null, null,  
     714      null, null, sizeC[0] > 1 ? new Integer(0) : null,  
     715      sizeC[0] > 1 ? new Integer(1) : null, 
     716      sizeC[0] > 1 ? new Integer(2) : null, new Integer(0)); 
     717    for (int i=0; i<3; i++) { 
     718      String prefix = "Transmission detector " + (i+1) + " - "; 
     719      String gain = (String) getMeta(prefix + "gain"); 
     720      String offset = (String) getMeta(prefix + "offset"); 
     721      store.setDetector(null, null, null, null, gain == null ? null :  
     722        new Float(gain), null, offset == null ? null : new Float(offset),  
     723        null, new Integer(i)); 
     724 
     725      String exc = (String) getMeta("Part number of excitation filter for " + 
     726        "laser " + (i+1)); 
     727      String ems = (String) getMeta("Part number of emission filter for " + 
     728        "laser " + (i+1)); 
     729      String excName = (String) getMeta("Excitation filter name - laser " + i); 
     730      String emsName = (String) getMeta("Emission filter name - laser " + i); 
     731      store.setExcitationFilter(null, null, exc, null, null); 
     732      store.setEmissionFilter(null, null, ems, null, null); 
     733    } 
     734    String mag = (String) getMeta("Objective lens magnification"); 
     735    store.setObjective(null, null, null, null,  
     736      mag == null ? null : new Float(mag), null, null); 
     737   
    714738  } 
    715739 
  • trunk/loci/formats/in/EPSReader.java

    r2291 r2307  
    285285      null, 
    286286      null); 
     287    for (int i=0; i<sizeC[0]; i++) { 
     288      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     289    } 
    287290  } 
    288291 
  • trunk/loci/formats/in/GIFReader.java

    r2291 r2307  
    407407      null, 
    408408      null); 
     409    for (int i=0; i<sizeC[0]; i++) { 
     410      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     411    } 
    409412  } 
    410413 
  • trunk/loci/formats/in/ImageIOReader.java

    r2291 r2307  
    156156      null, 
    157157      null); 
     158    for (int i=0; i<sizeC[0]; i++) { 
     159      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     160    } 
    158161    setMetadataStore(store); 
    159162  } 
  • trunk/loci/formats/in/ImageJReader.java

    r2291 r2307  
    179179      new Integer(1), new Integer(sizeC[0]), new Integer(1), 
    180180      new Integer(pixelType[0]), Boolean.TRUE, currentOrder[0], null, null); 
     181    for (int i=0; i<sizeC[0]; i++) { 
     182      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     183    } 
    181184  } 
    182185 
  • trunk/loci/formats/in/MNGReader.java

    r2291 r2307  
    225225      new Integer(sizeC[0]), new Integer(numImages), new Integer(pixelType[0]), 
    226226      Boolean.TRUE, currentOrder[0], null, null); 
     227    for (int i=0; i<sizeC[0]; i++) { 
     228      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     229    } 
    227230  } 
    228231 
  • trunk/loci/formats/in/OMEXMLReader.java

    r2292 r2307  
    263263      while (!found) { 
    264264        if (in.getFilePointer() < in.length()) { 
    265           in.read(buf, 9, 8183); 
     265          int read = in.read(buf, 9, 8183); 
    266266          String test = new String(buf); 
    267267 
     
    271271            String endian = test.substring(ndx + 11); 
    272272            endianness.add(new Boolean(!endian.toLowerCase().startsWith("t"))); 
    273             bigEndianPos.add(new Integer(in.getFilePointer() - (8192 - ndx))); 
     273            bigEndianPos.add(new Integer(in.getFilePointer() - read - 9 + ndx)); 
    274274            numDatasets++; 
    275275          } 
  • trunk/loci/formats/in/PictReader.java

    r2291 r2307  
    223223      new Integer(1), new Integer(sizeC[0]), new Integer(1), 
    224224      new Integer(pixelType[0]), new Boolean(!little), "XYCZT", null, null); 
     225    for (int i=0; i<sizeC[0]; i++) { 
     226      store.setLogicalChannel(i, null, null, null, null, null, null, null); 
     227    } 
    225228  } 
    226229 
Note: See TracChangeset for help on using the changeset viewer.