Changeset 2382


Ignore:
Timestamp:
03/05/07 10:15:46 (13 years ago)
Author:
melissa
Message:

Miscellaneous bugfixes.

Location:
trunk/loci/formats
Files:
6 edited

Legend:

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

    r2326 r2382  
    274274  /* @see IFormatReader#getEffectiveSizeC(String) */ 
    275275  public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    276     return getSizeC(id) / getRGBChannelCount(id); 
     276    return getImageCount(id) / (getSizeZ(id) * getSizeT(id));  
    277277  } 
    278278 
    279279  /* @see IFormatReader#getRGBChannelCount(String) */ 
    280280  public int getRGBChannelCount(String id) throws FormatException, IOException { 
    281     return getSizeC(id) / (getImageCount(id) / (getSizeZ(id) * getSizeT(id))); 
     281    return getSizeC(id) / getEffectiveSizeC(id);  
    282282  } 
    283283 
  • trunk/loci/formats/FormatReader.java

    r2370 r2382  
    482482    byte[][] bytes = ImageTools.getBytes(img); 
    483483    if (bytes.length == 1) return bytes[0]; 
    484     byte[] rtn = new byte[bytes.length * bytes[0].length]; 
    485     for (int i=0; i<bytes.length; i++) { 
     484    byte[] rtn = new byte[getRGBChannelCount(id) * bytes[0].length]; 
     485    for (int i=0; i<getRGBChannelCount(id); i++) { 
    486486      System.arraycopy(bytes[i], 0, rtn, bytes[0].length * i, bytes[i].length); 
    487487    } 
  • trunk/loci/formats/ReaderWrapper.java

    r2320 r2382  
    9999 
    100100  public int getEffectiveSizeC(String id) throws FormatException, IOException { 
    101     return getSizeC(id) / getRGBChannelCount(id); 
     101    return getImageCount(id) / (getSizeZ(id) * getSizeT(id)); 
    102102  } 
    103103 
    104104  public int getRGBChannelCount(String id) throws FormatException, IOException { 
    105     return getSizeC(id) / (getImageCount(id) / (getSizeZ(id) * getSizeT(id))); 
     105    return getSizeC(id) / getEffectiveSizeC(id); 
    106106  } 
    107107 
  • trunk/loci/formats/in/BaseTiffReader.java

    r2379 r2382  
    719719    TiffTools.getSamples(ifds[no], in, ignoreColorTable, buf);   
    720720    updateMinMax(buf, no); 
    721     return buf; 
     721    return swapIfRequired(buf); 
    722722  } 
    723723 
     
    733733 
    734734    int bytesPerPixel = FormatReader.getBytesPerPixel(getPixelType(id)); 
    735     byte[] buf =  
    736       new byte[getSizeX(id) * getSizeY(id) * bytesPerPixel * getSizeC(id)]; 
     735    byte[] buf = new byte[getSizeX(id) * getSizeY(id) * bytesPerPixel *  
     736      getRGBChannelCount(id)]; 
    737737    return openBytes(id, no, buf); 
    738738  } 
  • trunk/loci/formats/in/FluoviewReader.java

    r2375 r2382  
    257257      if (name == null || size == null || size.intValue() == 0) continue; 
    258258      name = name.toLowerCase().trim(); 
    259        
     259      if (name.length() == 0) continue;  
     260 
    260261      if (name.equals("x")) { 
    261262        sizeX[0] = size.intValue(); 
     
    316317      if (start != -1 && end != -1 && end > start) { 
    317318        comment = comment.substring(start + 14, end).trim(); 
    318         comment = comment.substring(comment.indexOf("=") + 1, 
    319           comment.indexOf("\n")).trim();  
     319        start = comment.indexOf("=") + 1; 
     320        end = comment.indexOf("\n"); 
     321        if (end > start) comment = comment.substring(start, end).trim(); 
     322        else comment = comment.substring(start).trim(); 
    320323      } 
    321324      else comment = ""; 
  • trunk/loci/formats/in/ICSReader.java

    r2376 r2382  
    2727import java.awt.image.BufferedImage; 
    2828import java.io.*; 
    29 import java.util.NoSuchElementException; 
    3029import java.util.StringTokenizer; 
    3130import java.util.zip.*; 
Note: See TracChangeset for help on using the changeset viewer.