Changeset 6834


Ignore:
Timestamp:
08/20/10 12:02:07 (9 years ago)
Author:
melissa
Message:

Moved MetadataStore calls that depend on MetadataTools.populatePixels(...) out of ZeissZVIReader.parseTags(...).

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r6663 r6834  
    109109  private Hashtable<Integer, Integer> tiles = new Hashtable<Integer, Integer>(); 
    110110  private boolean isMeanderScan; 
     111 
     112  private Hashtable<Integer, Double> detectorGain = 
     113    new Hashtable<Integer, Double>(); 
     114  private Hashtable<Integer, Double> detectorOffset = 
     115    new Hashtable<Integer, Double>(); 
     116  private Hashtable<Integer, PositiveInteger> emWavelength = 
     117    new Hashtable<Integer, PositiveInteger>(); 
     118  private Hashtable<Integer, PositiveInteger> exWavelength = 
     119    new Hashtable<Integer, PositiveInteger>(); 
     120  private Hashtable<Integer, String> channelName = 
     121    new Hashtable<Integer, String>(); 
     122  private double physicalSizeX, physicalSizeY, physicalSizeZ; 
     123  private String imageDescription; 
    111124 
    112125  // -- Constructor -- 
     
    419432      tiles.clear(); 
    420433      isMeanderScan = false; 
     434      detectorGain.clear(); 
     435      detectorOffset.clear(); 
     436      emWavelength.clear(); 
     437      exWavelength.clear(); 
     438      channelName.clear(); 
     439      physicalSizeX = physicalSizeY = physicalSizeZ = 0d; 
     440      imageDescription = null; 
    421441    } 
    422442  } 
     
    693713      store.setInstrumentID(instrumentID, 0); 
    694714      store.setImageInstrumentRef(instrumentID, 0); 
     715      if (imageDescription != null) { 
     716        store.setImageDescription(imageDescription, 0); 
     717      } 
     718 
     719      store.setPixelsPhysicalSizeX(physicalSizeX, 0); 
     720      store.setPixelsPhysicalSizeY(physicalSizeY, 0); 
     721      store.setPixelsPhysicalSizeZ(physicalSizeZ, 0); 
    695722 
    696723      for (int plane=0; plane<getImageCount(); plane++) { 
     
    720747        store.setDetectorSettingsID(detectorID, 0, i); 
    721748        store.setDetectorType(getDetectorType("Other"), 0, i); 
     749        store.setDetectorSettingsGain(detectorGain.get(i), 0, i); 
     750        store.setDetectorSettingsOffset(detectorOffset.get(i), 0, i); 
     751 
     752        store.setChannelName(channelName.get(i), 0, i); 
     753        store.setChannelEmissionWavelength(emWavelength.get(i), 0, i); 
     754        store.setChannelExcitationWavelength(exWavelength.get(i), 0, i); 
    722755      } 
    723756 
     
    867900        } 
    868901        else if (key.startsWith("Scale Factor for X")) { 
    869           store.setPixelsPhysicalSizeX(new Double(value), 0); 
     902          physicalSizeX = Double.parseDouble(value); 
    870903        } 
    871904        else if (key.startsWith("Scale Factor for Y")) { 
    872           store.setPixelsPhysicalSizeY(new Double(value), 0); 
     905          physicalSizeY = Double.parseDouble(value); 
    873906        } 
    874907        else if (key.startsWith("Scale Factor for Z")) { 
    875           store.setPixelsPhysicalSizeZ(new Double(value), 0); 
     908          physicalSizeZ = Double.parseDouble(value); 
    876909        } 
    877910        else if (key.startsWith("Emission Wavelength")) { 
     
    879912            Integer wave = new Integer(value); 
    880913            if (wave.intValue() > 0) { 
    881               store.setChannelEmissionWavelength( 
    882                 new PositiveInteger(wave), 0, nextEmWave); 
    883               nextEmWave++; 
     914              emWavelength.put(nextEmWave++, new PositiveInteger(wave)); 
    884915            } 
    885916          } 
     
    889920            Integer wave = new Integer(value); 
    890921            if (wave.intValue() > 0) { 
    891               store.setChannelExcitationWavelength( 
    892                 new PositiveInteger(wave), 0, nextExWave); 
    893               nextExWave++; 
     922              exWavelength.put(nextExWave++, new PositiveInteger(wave)); 
    894923            } 
    895924          } 
     
    897926        else if (key.startsWith("Channel Name")) { 
    898927          if (cIndex != -1 && nextChName < effectiveSizeC) { 
    899             store.setChannelName(value, 0, nextChName); 
    900             nextChName++; 
     928            channelName.put(nextChName++, value); 
    901929          } 
    902930        } 
     
    968996        } 
    969997        else if (key.startsWith("Orca Analog Gain")) { 
    970           store.setDetectorSettingsGain(new Double(value), 0, cIndex); 
     998          detectorGain.put(cIndex, new Double(value)); 
    971999        } 
    9721000        else if (key.startsWith("Orca Analog Offset")) { 
    973           store.setDetectorSettingsOffset(new Double(value), 0, cIndex); 
     1001          detectorOffset.put(cIndex, new Double(value)); 
    9741002        } 
    9751003        else if (key.startsWith("Comments")) { 
    976           store.setImageDescription(value, 0); 
     1004          imageDescription = value; 
    9771005        } 
    9781006        else if (key.startsWith("Acquisition Date")) { 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissZVIReader.java

    r6784 r6834  
    109109  private Hashtable<Integer, Integer> tiles = new Hashtable<Integer, Integer>(); 
    110110  private boolean isMeanderScan; 
     111 
     112  private Hashtable<Integer, Double> detectorGain = 
     113    new Hashtable<Integer, Double>(); 
     114  private Hashtable<Integer, Double> detectorOffset = 
     115    new Hashtable<Integer, Double>(); 
     116  private Hashtable<Integer, PositiveInteger> emWavelength = 
     117    new Hashtable<Integer, PositiveInteger>(); 
     118  private Hashtable<Integer, PositiveInteger> exWavelength = 
     119    new Hashtable<Integer, PositiveInteger>(); 
     120  private Hashtable<Integer, String> channelName = 
     121    new Hashtable<Integer, String>(); 
     122  private double physicalSizeX, physicalSizeY, physicalSizeZ; 
     123  private String imageDescription; 
    111124 
    112125  // -- Constructor -- 
     
    419432      tiles.clear(); 
    420433      isMeanderScan = false; 
     434      detectorGain.clear(); 
     435      detectorOffset.clear(); 
     436      emWavelength.clear(); 
     437      exWavelength.clear(); 
     438      channelName.clear(); 
     439      physicalSizeX = physicalSizeY = physicalSizeZ = 0d; 
     440      imageDescription = null; 
    421441    } 
    422442  } 
     
    693713      store.setInstrumentID(instrumentID, 0); 
    694714      store.setImageInstrumentRef(instrumentID, 0); 
     715      if (imageDescription != null) { 
     716        store.setImageDescription(imageDescription, 0); 
     717      } 
     718 
     719      store.setPixelsPhysicalSizeX(physicalSizeX, 0); 
     720      store.setPixelsPhysicalSizeY(physicalSizeY, 0); 
     721      store.setPixelsPhysicalSizeZ(physicalSizeZ, 0); 
    695722 
    696723      for (int plane=0; plane<getImageCount(); plane++) { 
     
    720747        store.setDetectorSettingsID(detectorID, 0, i); 
    721748        store.setDetectorType(getDetectorType("Other"), 0, i); 
     749        store.setDetectorSettingsGain(detectorGain.get(i), 0, i); 
     750        store.setDetectorSettingsOffset(detectorOffset.get(i), 0, i); 
     751 
     752        store.setChannelName(channelName.get(i), 0, i); 
     753        store.setChannelEmissionWavelength(emWavelength.get(i), 0, i); 
     754        store.setChannelExcitationWavelength(exWavelength.get(i), 0, i); 
    722755      } 
    723756 
     
    867900        } 
    868901        else if (key.startsWith("Scale Factor for X")) { 
    869           store.setPixelsPhysicalSizeX(new Double(value), 0); 
     902          physicalSizeX = Double.parseDouble(value); 
    870903        } 
    871904        else if (key.startsWith("Scale Factor for Y")) { 
    872           store.setPixelsPhysicalSizeY(new Double(value), 0); 
     905          physicalSizeY = Double.parseDouble(value); 
    873906        } 
    874907        else if (key.startsWith("Scale Factor for Z")) { 
    875           store.setPixelsPhysicalSizeZ(new Double(value), 0); 
     908          physicalSizeZ = Double.parseDouble(value); 
    876909        } 
    877910        else if (key.startsWith("Emission Wavelength")) { 
     
    879912            Integer wave = new Integer(value); 
    880913            if (wave.intValue() > 0) { 
    881               store.setChannelEmissionWavelength( 
    882                 new PositiveInteger(wave), 0, nextEmWave); 
    883               nextEmWave++; 
     914              emWavelength.put(nextEmWave++, new PositiveInteger(wave)); 
    884915            } 
    885916          } 
     
    889920            Integer wave = new Integer(value); 
    890921            if (wave.intValue() > 0) { 
    891               store.setChannelExcitationWavelength( 
    892                 new PositiveInteger(wave), 0, nextExWave); 
    893               nextExWave++; 
     922              exWavelength.put(nextExWave++, new PositiveInteger(wave)); 
    894923            } 
    895924          } 
     
    897926        else if (key.startsWith("Channel Name")) { 
    898927          if (cIndex != -1 && nextChName < effectiveSizeC) { 
    899             store.setChannelName(value, 0, nextChName); 
    900             nextChName++; 
     928            channelName.put(nextChName++, value); 
    901929          } 
    902930        } 
     
    968996        } 
    969997        else if (key.startsWith("Orca Analog Gain")) { 
    970           store.setDetectorSettingsGain(new Double(value), 0, cIndex); 
     998          detectorGain.put(cIndex, new Double(value)); 
    971999        } 
    9721000        else if (key.startsWith("Orca Analog Offset")) { 
    973           store.setDetectorSettingsOffset(new Double(value), 0, cIndex); 
     1001          detectorOffset.put(cIndex, new Double(value)); 
    9741002        } 
    9751003        else if (key.startsWith("Comments")) { 
    976           store.setImageDescription(value, 0); 
     1004          imageDescription = value; 
    9771005        } 
    9781006        else if (key.startsWith("Acquisition Date")) { 
Note: See TracChangeset for help on using the changeset viewer.