Changeset 4074


Ignore:
Timestamp:
05/29/08 15:19:15 (12 years ago)
Author:
melissa
Message:

Fixed C size calculation bug - closes #300.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/ZeissZVIReader.java

    r4068 r4074  
    417417    core.sizeT[0] = tIndices.size(); 
    418418 
    419     core.sizeC[0] *= cIndices.size(); 
     419    int min = Integer.MAX_VALUE; 
     420    int max = Integer.MIN_VALUE; 
     421    for (int i=0; i<cIndices.size(); i++) { 
     422      int v = ((Integer) cIndices.get(i)).intValue(); 
     423      if (v < min) min = v; 
     424      if (v > max) max = v; 
     425    } 
     426 
     427    int cSize = max - min + 1; 
     428    if (cSize > cIndices.size()) cSize = cIndices.size() - 1; 
     429 
     430    core.sizeC[0] *= cSize; 
    420431 
    421432    core.imageCount[0] = core.sizeZ[0] * core.sizeT[0] * 
     
    438449 
    439450      while (tileRows * tileColumns > totalTiles) { 
    440         core.sizeC[0]--; 
     451        //if (core.sizeC[0] > 1) core.sizeC[0]--; 
    441452        totalTiles = 
    442453          offsets.size() / (core.sizeZ[0] * core.sizeC[0] * core.sizeT[0]); 
Note: See TracChangeset for help on using the changeset viewer.