Changeset 6337


Ignore:
Timestamp:
05/18/10 14:45:10 (9 years ago)
Author:
melissa
Message:

Fixed LightPath and Image population to prevent AIOOB exceptions. See  omero:2358.

Files:
2 edited

Legend:

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

    r6315 r6337  
    166166 
    167167  private int nextLaser = 0, nextDetector = 0; 
    168   private int nextFilter = 0, nextDichroicChannel = 0; 
     168  private int nextFilter = 0, nextDichroicChannel = 0, nextDichroic = 0; 
    169169  private int nextDataChannel = 0, nextIllumChannel = 0, nextDetectChannel = 0; 
    170170  private boolean splitPlanes = false; 
     
    207207      tiffParser = null; 
    208208      nextLaser = nextDetector = 0; 
    209       nextFilter = nextDichroicChannel = 0; 
     209      nextFilter = nextDichroicChannel = nextDichroic = 0; 
    210210      nextDataChannel = nextIllumChannel = nextDetectChannel = 0; 
    211211      splitPlanes = false; 
     
    467467 
    468468    // link Instrument and Image 
     469    store.setImageID(MetadataTools.createLSID("Image", series), series); 
    469470    String instrumentID = MetadataTools.createLSID("Instrument", series); 
    470471    store.setInstrumentID(instrumentID, series); 
     
    633634 
    634635    MetadataTools.setDefaultCreationDate(store, getCurrentFile(), series); 
     636    int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
     637    if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
     638      if (!splitPlanes) splitPlanes = isRGB(); 
     639      core[series].rgb = false; 
     640      if (splitPlanes) core[series].imageCount *= getSizeC(); 
     641    } 
     642 
     643    MetadataTools.populatePixels(store, this, true); 
    635644 
    636645    if (getMetadataOptions().getMetadataLevel() == MetadataLevel.ALL) { 
     
    762771 
    763772        nextLaser = nextDetector = 0; 
    764         nextFilter = nextDichroicChannel = 0; 
     773        nextFilter = nextDichroicChannel = nextDichroic = 0; 
    765774        nextDataChannel = nextDetectChannel = nextIllumChannel = 0; 
    766775 
     
    856865      } 
    857866    } 
    858     int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
    859     if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
    860       if (!splitPlanes) splitPlanes = isRGB(); 
    861       core[series].rgb = false; 
    862       if (splitPlanes) core[series].imageCount *= getSizeC(); 
    863     } 
    864  
    865     MetadataTools.populatePixels(store, this, true); 
    866867 
    867868    imageNames.add(imageName); 
     
    10441045      if (beamSplitter.filterSet != null) { 
    10451046        if (beamSplitter.filter != null) { 
    1046           String id = MetadataTools.createLSID("Dichroic", series, nextFilter); 
    1047           store.setDichroicID(id, series, nextFilter); 
    1048           store.setDichroicModel(beamSplitter.filter, series, nextFilter); 
    1049           store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
    1050           nextFilter++; 
     1047          String id = 
     1048            MetadataTools.createLSID("Dichroic", series, nextDichroic); 
     1049          store.setDichroicID(id, series, nextDichroic); 
     1050          store.setDichroicModel(beamSplitter.filter, series, nextDichroic); 
     1051          if (nextDichroicChannel < getSizeC()) { 
     1052            store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
     1053          } 
     1054          nextDichroic++; 
    10511055        } 
    10521056        nextDichroicChannel++; 
  • trunk/components/bio-formats/src/loci/formats/in/ZeissLSMReader.java

    r6315 r6337  
    166166 
    167167  private int nextLaser = 0, nextDetector = 0; 
    168   private int nextFilter = 0, nextDichroicChannel = 0; 
     168  private int nextFilter = 0, nextDichroicChannel, nextDichroic = 0; 
    169169  private int nextDataChannel = 0, nextIllumChannel = 0, nextDetectChannel = 0; 
    170170  private boolean splitPlanes = false; 
     
    207207      tiffParser = null; 
    208208      nextLaser = nextDetector = 0; 
    209       nextFilter = nextDichroicChannel = 0; 
     209      nextFilter = nextDichroicChannel = nextDichroic = 0; 
    210210      nextDataChannel = nextIllumChannel = nextDetectChannel = 0; 
    211211      splitPlanes = false; 
     
    467467 
    468468    // link Instrument and Image 
     469    store.setImageID(MetadataTools.createLSID("Image", series), series); 
    469470    String instrumentID = MetadataTools.createLSID("Instrument", series); 
    470471    store.setInstrumentID(instrumentID, series); 
     
    633634 
    634635    MetadataTools.setDefaultCreationDate(store, getCurrentFile(), series); 
     636    int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
     637    if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
     638      if (!splitPlanes) splitPlanes = isRGB(); 
     639      core[series].rgb = false; 
     640      if (splitPlanes) core[series].imageCount *= getSizeC(); 
     641    } 
     642 
     643    MetadataTools.populatePixels(store, this, true); 
    635644 
    636645    if (getMetadataOptions().getMetadataLevel() == MetadataLevel.ALL) { 
     
    762771 
    763772        nextLaser = nextDetector = 0; 
    764         nextFilter = nextDichroicChannel = 0; 
     773        nextFilter = nextDichroicChannel = nextDichroic = 0; 
    765774        nextDataChannel = nextDetectChannel = nextIllumChannel = 0; 
    766775 
     
    856865      } 
    857866    } 
    858     int nLogicalChannels = nextDataChannel == 0 ? 1 : nextDataChannel; 
    859     if (nLogicalChannels == getSizeC() || nextDataChannel == 0) { 
    860       if (!splitPlanes) splitPlanes = isRGB(); 
    861       core[series].rgb = false; 
    862       if (splitPlanes) core[series].imageCount *= getSizeC(); 
    863     } 
    864  
    865     MetadataTools.populatePixels(store, this, true); 
    866867 
    867868    imageNames.add(imageName); 
     
    10441045      if (beamSplitter.filterSet != null) { 
    10451046        if (beamSplitter.filter != null) { 
    1046           String id = MetadataTools.createLSID("Dichroic", series, nextFilter); 
    1047           store.setDichroicID(id, series, nextFilter); 
    1048           store.setDichroicModel(beamSplitter.filter, series, nextFilter); 
    1049           store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
    1050           nextFilter++; 
     1047          String id = 
     1048            MetadataTools.createLSID("Dichroic", series, nextDichroic); 
     1049          store.setDichroicID(id, series, nextDichroic); 
     1050          store.setDichroicModel(beamSplitter.filter, series, nextDichroic); 
     1051          if (nextDichroicChannel < getSizeC()) { 
     1052            store.setLightPathDichroicRef(id, series, nextDichroicChannel); 
     1053          } 
     1054          nextDichroic++; 
    10511055        } 
    10521056        nextDichroicChannel++; 
Note: See TracChangeset for help on using the changeset viewer.