Changeset 2297


Ignore:
Timestamp:
02/19/07 11:35:12 (13 years ago)
Author:
melissa
Message:

Use stored sizeC value, rather than assuming sizeC is 1 or 3.

File:
1 edited

Legend:

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

    r2291 r2297  
    9898    if (!id.equals(currentIdsId) && !id.equals(currentIcsId)) initFile(id); 
    9999    if (numImages == 1) return 1; 
    100     return numImages / (isRGB(id) ? 3 : 1); 
     100    return numImages / (rgb ? dimensions[4] : 1); 
    101101  } 
    102102 
     
    128128    int height = dimensions[2]; 
    129129 
    130     int offset = width * height * (dimensions[0] / 8) * no * (rgb ? 3 : 1); 
    131     byte[] plane = new byte[width*height * (dimensions[0] / 8) * (rgb ? 3 : 1)]; 
     130    int offset = width * height * (dimensions[0] / 8) * no *  
     131      (rgb ? dimensions[4] : 1); 
     132    byte[] plane =  
     133      new byte[width*height * (dimensions[0] / 8) * (rgb ? dimensions[4] : 1)]; 
    132134    System.arraycopy(data, offset, plane, 0, plane.length); 
    133135 
     
    135137    if (versionTwo) { 
    136138      byte[] t = new byte[plane.length]; 
    137       int len = width * (dimensions[0] / 8) * (rgb ? 3 : 1); 
     139      int len = width * (dimensions[0] / 8) * (rgb ? dimensions[4] : 1); 
    138140      int off = (height - 1) * len; 
    139141      int newOff = 0; 
     
    159161    int width = dimensions[1]; 
    160162    int height = dimensions[2]; 
    161     int channels = isRGB(id) ? 3 : 1; 
     163    int channels = rgb ? dimensions[4] : 1; 
    162164 
    163165    int bytes = dimensions[0] / 8; 
     
    175177      BufferedImage b = ImageTools.makeImage(f, width, height, channels, true); 
    176178      updateMinMax(b, no); 
     179      return b; 
    177180    } 
    178181 
Note: See TracChangeset for help on using the changeset viewer.