Changeset 2102


Ignore:
Timestamp:
01/16/07 09:33:20 (13 years ago)
Author:
curtis
Message:

Fix bug with getIndex and getZCTCoords for RGB=true with SizeC>4.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatReader.java

    r2081 r2102  
    813813    String order = reader.getDimensionOrder(id); 
    814814    int zSize = reader.getSizeZ(id); 
    815     int cSize = reader.getSizeC(id); 
     815    int cSize = reader.getEffectiveSizeC(id); 
    816816    int tSize = reader.getSizeT(id); 
    817817    int num = reader.getImageCount(id); 
    818     boolean rgb = reader.isRGB(id); 
    819     return getIndex(order, zSize, cSize, tSize, num, rgb, z, c, t); 
     818    return getIndex(order, zSize, cSize, tSize, num, z, c, t); 
    820819  } 
    821820 
     
    825824   */ 
    826825  public static int getIndex(String order, int zSize, int cSize, int tSize, 
    827     int num, boolean rgb, int z, int c, int t) 
     826    int num, int z, int c, int t) 
    828827    throws FormatException, IOException 
    829828  { 
     
    851850      throw new FormatException("Invalid C index: " + c + "/" + cSize); 
    852851    } 
    853     int origSizeC = cSize; 
    854     if (rgb) cSize = 1; 
    855852 
    856853    // check SizeT 
     
    866863      // either one of the ZCT sizes, or the total number of images -- 
    867864      // or else the input file is invalid 
    868       throw new FormatException("ZCT size vs image count mismatch (rgb=" + 
    869         rgb + "; sizeZ=" + zSize + ", sizeC=" + 
    870         origSizeC + ", sizeT=" + tSize + ", total=" + num + ")"); 
     865      throw new FormatException("ZCT size vs image count mismatch (sizeZ=" + 
     866        zSize + ", sizeC=" + cSize + ", sizeT=" + tSize + ", total=" + num + 
     867        ")"); 
    871868    } 
    872869 
     
    891888    String order = reader.getDimensionOrder(id); 
    892889    int zSize = reader.getSizeZ(id); 
    893     int cSize = reader.getSizeC(id); 
     890    int cSize = reader.getEffectiveSizeC(id); 
    894891    int tSize = reader.getSizeT(id); 
    895892    int num = reader.getImageCount(id); 
    896     boolean rgb = reader.isRGB(id); 
    897     return getZCTCoords(order, zSize, cSize, tSize, num, rgb, index); 
     893    return getZCTCoords(order, zSize, cSize, tSize, num, index); 
    898894  } 
    899895 
     
    902898   * index value. 
    903899   */ 
    904   public static int[] getZCTCoords(String order, int zSize, int cSize, 
    905     int tSize, int num, boolean rgb, int index) 
     900  public static int[] getZCTCoords(String order, 
     901    int zSize, int cSize, int tSize, int num, int index) 
    906902    throws FormatException, IOException 
    907903  { 
     
    923919    // check SizeC 
    924920    if (cSize <= 0) throw new FormatException("Invalid C size: " + cSize); 
    925     int origSizeC = cSize; 
    926     if (rgb) cSize = 1; 
    927921 
    928922    // check SizeT 
     
    935929      // either one of the ZCT sizes, or the total number of images -- 
    936930      // or else the input file is invalid 
    937       throw new FormatException("ZCT size vs image count mismatch (rgb=" + 
    938         rgb + "; sizeZ=" + zSize + ", sizeC=" + 
    939         origSizeC + ", sizeT=" + tSize + ", total=" + num + ")"); 
     931      throw new FormatException("ZCT size vs image count mismatch (sizeZ=" + 
     932        zSize + ", sizeC=" + cSize + ", sizeT=" + tSize + ", total=" + num + 
     933        ")"); 
    940934    } 
    941935    if (index < 0 || index >= num) { 
Note: See TracChangeset for help on using the changeset viewer.