Changeset 6986


Ignore:
Timestamp:
09/27/10 13:07:30 (9 years ago)
Author:
melissa
Message:

Minor fixes to (hopefully) prevent AIOOB.

File:
1 edited

Legend:

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

    r6981 r6986  
    153153 
    154154      if (coreMeta.sizeX == 0 && coreMeta.sizeY == 0) { 
    155         numDatasets--; 
     155        if (numDatasets > 0) numDatasets--; 
    156156      } 
    157157      else { 
     
    232232      nextROI = 0; 
    233233 
    234       int nChannels = core.get(numDatasets).rgb ? 1 : numChannels; 
    235  
    236       for (int c=0; c<detectorIndices.size(); c++) { 
    237         int index = detectorIndices.get(c).intValue(); 
    238         if (c >= nChannels || index >= nChannels || index >= 0) break; 
    239         String id = MetadataTools.createLSID("Detector", numDatasets, index); 
    240         store.setDetectorSettingsID(id, numDatasets, index); 
    241       } 
    242       for (int c=0; c<nChannels; c++) { 
    243         store.setChannelPinholeSize(pinhole, numDatasets, c); 
     234      if (numDatasets >= 0) { 
     235        int nChannels = core.get(numDatasets).rgb ? 1 : numChannels; 
     236 
     237        for (int c=0; c<detectorIndices.size(); c++) { 
     238          int index = detectorIndices.get(c).intValue(); 
     239          if (c >= nChannels || index >= nChannels || index >= 0) break; 
     240          String id = MetadataTools.createLSID("Detector", numDatasets, index); 
     241          store.setDetectorSettingsID(id, numDatasets, index); 
     242        } 
     243        for (int c=0; c<nChannels; c++) { 
     244          store.setChannelPinholeSize(pinhole, numDatasets, c); 
     245        } 
    244246      } 
    245247    } 
Note: See TracChangeset for help on using the changeset viewer.