Changeset 2523


Ignore:
Timestamp:
03/29/07 16:47:46 (13 years ago)
Author:
curtis
Message:

More work on support for multiple dimensions rasterized into C.

  • FileStitcher and SDTReader now implement this functionality properly.
  • Added sub-dimension output to FormatTools.testRead.
  • Added IFormatReader.isInterleaved(String, int) to test whether each sub-dimension is interleaved or not.
  • SDTReader now treats lifetime sub-dimension as interleaved/"RGB"

I am closing ticket #18, since most of what it talks about is now in place
(other than VisBio using it, which is covered in ticket #35).

Location:
trunk/loci/formats
Files:
44 edited

Legend:

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

    r2519 r2523  
    283283    throws FormatException, IOException 
    284284  { 
    285     throw new FormatException("Unimplemented");//TODO 
     285    if (!id.equals(currentId)) initFile(id); 
     286    int sno = getSeries(id); 
     287    int len = lenC[sno].length; 
     288    int[] cLengths = new int[len]; 
     289    System.arraycopy(lenC[sno], 0, cLengths, 0, len); 
     290    return cLengths; 
    286291  } 
    287292 
     
    290295    throws FormatException, IOException 
    291296  { 
    292     throw new FormatException("Unimplemented");//TODO 
     297    int sno = getSeries(id); 
     298    int len = lenC[sno].length; 
     299    String[] cTypes = new String[len]; 
     300    Arrays.fill(cTypes, FormatTools.CHANNEL); 
     301    return cTypes; 
    293302  } 
    294303 
     
    435444    if (!id.equals(currentId)) initFile(id); 
    436445    return reader.isInterleaved(files[0]); 
     446  } 
     447 
     448  /* @see IFormatReader#isInterleaved(String, int) */ 
     449  public boolean isInterleaved(String id, int subC) 
     450    throws FormatException, IOException 
     451  { 
     452    if (!id.equals(currentId)) initFile(id); 
     453    return reader.isInterleaved(files[0], subC); 
    437454  } 
    438455 
  • trunk/loci/formats/FormatReader.java

    r2519 r2523  
    5959  /** Dimension fields. */ 
    6060  protected int[] sizeX, sizeY, sizeZ, sizeC, sizeT; 
    61   protected int[][] dimLengths; 
    62   protected String[][] dimTypes; 
     61  protected int[][] cLengths; 
     62  protected String[][] cTypes; 
    6363  protected int[] pixelType; 
    6464  protected String[] currentOrder; 
     
    132132    sizeC = new int[1]; 
    133133    sizeT = new int[1]; 
    134     dimLengths = new int[1][]; 
    135     dimTypes = new String[1][]; 
     134    cLengths = new int[1][]; 
     135    cTypes = new String[1][]; 
    136136    pixelType = new int[1]; 
    137137    currentOrder = new String[1]; 
     
    371371  { 
    372372    if (!id.equals(currentId)) initFile(id); 
    373     if (dimLengths[series] == null) { 
    374       dimLengths[series] = new int[] {sizeC[series]}; 
    375     } 
    376     return dimLengths[series]; 
     373    if (cLengths[series] == null) { 
     374      cLengths[series] = new int[] {sizeC[series]}; 
     375    } 
     376    return cLengths[series]; 
    377377  } 
    378378 
     
    382382  { 
    383383    if (!id.equals(currentId)) initFile(id); 
    384     if (dimTypes[series] == null) { 
    385       dimTypes[series] = new String[] {FormatTools.CHANNEL}; 
    386     } 
    387     return dimTypes[series]; 
     384    if (cTypes[series] == null) { 
     385      cTypes[series] = new String[] {FormatTools.CHANNEL}; 
     386    } 
     387    return cTypes[series]; 
    388388  } 
    389389 
     
    522522 
    523523  /* @see IFormatReader#isInterleaved(String) */ 
    524   public abstract boolean isInterleaved(String id) 
     524  public boolean isInterleaved(String id) 
     525    throws FormatException, IOException 
     526  { 
     527    return isInterleaved(id, 0); 
     528  } 
     529 
     530  /* @see IFormatReader#isInterleaved(String, int) */ 
     531  public abstract boolean isInterleaved(String id, int subC) 
    525532    throws FormatException, IOException; 
    526533 
  • trunk/loci/formats/FormatTools.java

    r2519 r2523  
    296296      int imageCount = reader.getImageCount(id); 
    297297      boolean rgb = reader.isRGB(id); 
    298       int rgbChanCount = reader.getRGBChannelCount(id); 
    299       boolean interleaved = reader.isInterleaved(id); 
    300298      int sizeX = reader.getSizeX(id); 
    301299      int sizeY = reader.getSizeY(id); 
    302300      int sizeZ = reader.getSizeZ(id); 
    303301      int sizeC = reader.getSizeC(id); 
     302      int sizeT = reader.getSizeT(id); 
     303      int pixelType = reader.getPixelType(id); 
    304304      int effSizeC = reader.getEffectiveSizeC(id); 
    305       int sizeT = reader.getSizeT(id); 
     305      int rgbChanCount = reader.getRGBChannelCount(id); 
     306      int[] cLengths = reader.getChannelDimLengths(id); 
     307      String[] cTypes = reader.getChannelDimTypes(id); 
    306308      int thumbSizeX = reader.getThumbSizeX(id); 
    307309      int thumbSizeY = reader.getThumbSizeY(id); 
     
    309311      String dimOrder = reader.getDimensionOrder(id); 
    310312      boolean orderCertain = reader.isOrderCertain(id); 
    311       int pixelType = reader.getPixelType(id); 
     313      boolean interleaved = reader.isInterleaved(id); 
    312314 
    313315      // output basic metadata for series #i 
     
    330332      } 
    331333      System.out.println(); 
     334      for (int i=0; i<cLengths.length; i++) { 
     335        System.out.println("\t\t#" + (i + 1) + " = " + 
     336          cTypes[i] + " (" + cLengths[i] + ")"); 
     337      } 
    332338      System.out.println("\tSizeT = " + sizeT); 
    333339      if (imageCount != sizeZ * effSizeC * sizeT) { 
  • trunk/loci/formats/IFormatReader.java

    r2519 r2523  
    174174  /** 
    175175   * Gets a five-character string representing the 
    176    * dimension order within the file. 
     176   * dimension order within the file. Valid orders are:<ul> 
     177   *   <li>XYCTZ</li> 
     178   *   <li>XYCZT</li> 
     179   *   <li>XYTCZ</li> 
     180   *   <li>XYTZC</li> 
     181   *   <li>XYZCT</li> 
     182   *   <li>XYZTC</li> 
     183   * </ul> 
     184   * In cases where the channels are interleaved (e.g., CXYTZ), C will be 
     185   * the first dimension after X and Y (e.g., XYCTZ) and the 
     186   * {@link #isInterleaved(String)} method will return true. 
    177187   */ 
    178188  String getDimensionOrder(String id) throws FormatException, IOException; 
     
    199209  boolean getChannelStatCalculationStatus(); 
    200210 
    201   /** Gets whether or not the channels are interleaved. */ 
     211  /** 
     212   * Gets whether or not the channels are interleaved. This method exists 
     213   * because X and Y must appear first in the dimension order. For 
     214   * interleaved data, XYCTZ or XYCZT is used, and this method returns true. 
     215   */ 
    202216  boolean isInterleaved(String id) throws FormatException, IOException; 
     217 
     218  /** 
     219   * Gets whether or not the given sub-channel is interleaved. This method 
     220   * exists because some data with multiple rasterized sub-dimensions within 
     221   * C have one sub-dimension interleaved, and the other not&mdash;e.g., 
     222   * {@link loci.formats.in.SDTReader} handles spectral-lifetime data with 
     223   * the interleaved lifetime bins and non-interleaved spectral channels. 
     224   */ 
     225  boolean isInterleaved(String id, int subC) 
     226    throws FormatException, IOException; 
    203227 
    204228  /** Obtains the specified image from the given file. */ 
  • trunk/loci/formats/ImageReader.java

    r2519 r2523  
    355355  } 
    356356 
     357  /* @see IFormatReader#isInterleaved(String, int) */ 
     358  public boolean isInterleaved(String id, int subC) 
     359    throws FormatException, IOException 
     360  { 
     361    return getReader(id).isInterleaved(id, subC); 
     362  } 
     363 
    357364  /* @see IFormatReader#openImage(String, int) */ 
    358365  public BufferedImage openImage(String id, int no) 
  • trunk/loci/formats/ReaderWrapper.java

    r2519 r2523  
    194194  } 
    195195 
     196  public boolean isInterleaved(String id, int subC) 
     197    throws FormatException, IOException 
     198  { 
     199    return reader.isInterleaved(id, subC); 
     200  } 
     201 
    196202  public BufferedImage openImage(String id, int no) 
    197203    throws FormatException, IOException 
  • trunk/loci/formats/in/AVIReader.java

    r2483 r2523  
    115115 
    116116  /** Returns whether or not the channels are interleaved. */ 
    117   public boolean isInterleaved(String id) throws FormatException, IOException { 
     117  public boolean isInterleaved(String id, int subC) 
     118    throws FormatException, IOException 
     119  { 
    118120    return false; 
    119121  } 
  • trunk/loci/formats/in/AliconaReader.java

    r2462 r2523  
    8585 
    8686  /** Returns whether or not the channels are interleaved. */ 
    87   public boolean isInterleaved(String id) throws FormatException, IOException { 
     87  public boolean isInterleaved(String id, int subC) 
     88    throws FormatException, IOException 
     89  { 
    8890    return false; 
    8991  } 
  • trunk/loci/formats/in/BMPReader.java

    r2478 r2523  
    111111 
    112112  /** Returns whether or not the channels are interleaved. */ 
    113   public boolean isInterleaved(String id) throws FormatException, IOException { 
     113  public boolean isInterleaved(String id, int subC) 
     114    throws FormatException, IOException 
     115  { 
    114116    return true; 
    115117  } 
  • trunk/loci/formats/in/BaseTiffReader.java

    r2519 r2523  
    700700 
    701701  /** Returns whether or not the channels are interleaved. */ 
    702   public boolean isInterleaved(String id) throws FormatException, IOException { 
     702  public boolean isInterleaved(String id, int subC) 
     703    throws FormatException, IOException 
     704  { 
    703705    if (!id.equals(currentId)) initFile(id); 
    704706    return TiffTools.getSamplesPerPixel(ifds[0]) > 1;  
  • trunk/loci/formats/in/BioRadReader.java

    r2478 r2523  
    107107 
    108108  /** Returns whether or not the channels are interleaved. */ 
    109   public boolean isInterleaved(String id) throws FormatException, IOException { 
     109  public boolean isInterleaved(String id, int subC) 
     110    throws FormatException, IOException 
     111  { 
    110112    return false; 
    111113  } 
  • trunk/loci/formats/in/DeltavisionReader.java

    r2478 r2523  
    182182 
    183183  /** Returns whether or not the channels are interleaved. */ 
    184   public boolean isInterleaved(String id) throws FormatException, IOException { 
     184  public boolean isInterleaved(String id, int subC) 
     185    throws FormatException, IOException 
     186  { 
    185187    return false; 
    186188  } 
  • trunk/loci/formats/in/DicomReader.java

    r2519 r2523  
    136136 
    137137  /** Returns whether or not the channels are interleaved. */ 
    138   public boolean isInterleaved(String id) throws FormatException, IOException { 
     138  public boolean isInterleaved(String id, int subC) 
     139    throws FormatException, IOException 
     140  { 
    139141    return false; 
    140142  } 
  • trunk/loci/formats/in/EPSReader.java

    r2519 r2523  
    9393 
    9494  /** Returns whether or not the channels are interleaved. */ 
    95   public boolean isInterleaved(String id) throws FormatException, IOException { 
     95  public boolean isInterleaved(String id, int subC) 
     96    throws FormatException, IOException 
     97  { 
    9698    return true; 
    9799  } 
  • trunk/loci/formats/in/GIFReader.java

    r2478 r2523  
    164164 
    165165  /** Returns whether or not the channels are interleaved. */ 
    166   public boolean isInterleaved(String id) throws FormatException, IOException { 
     166  public boolean isInterleaved(String id, int subC) 
     167    throws FormatException, IOException 
     168  { 
    167169    return true; 
    168170  } 
  • trunk/loci/formats/in/GatanReader.java

    r2478 r2523  
    9696 
    9797  /** Returns whether or not the channels are interleaved. */ 
    98   public boolean isInterleaved(String id) throws FormatException, IOException { 
     98  public boolean isInterleaved(String id, int subC) 
     99    throws FormatException, IOException 
     100  { 
    99101    return false; 
    100102  } 
  • trunk/loci/formats/in/ICSReader.java

    r2478 r2523  
    136136 
    137137  /** Returns whether or not the channels are interleaved. */ 
    138   public boolean isInterleaved(String id) throws FormatException, IOException { 
     138  public boolean isInterleaved(String id, int subC) 
     139    throws FormatException, IOException 
     140  { 
    139141    if (!id.equals(currentIdsId) && !id.equals(currentIcsId)) initFile(id); 
    140142    return !rgb; 
  • trunk/loci/formats/in/IPLabReader.java

    r2478 r2523  
    106106 
    107107  /** Returns whether or not the channels are interleaved. */ 
    108   public boolean isInterleaved(String id) throws FormatException, IOException { 
     108  public boolean isInterleaved(String id, int subC) 
     109    throws FormatException, IOException 
     110  { 
    109111    return true; 
    110112  } 
  • trunk/loci/formats/in/ImageIOReader.java

    r2478 r2523  
    7777 
    7878  /** Returns whether or not the channels are interleaved. */ 
    79   public boolean isInterleaved(String id) throws FormatException, IOException { 
     79  public boolean isInterleaved(String id, int subC) 
     80    throws FormatException, IOException 
     81  { 
    8082    return true; 
    8183  } 
  • trunk/loci/formats/in/ImageJReader.java

    r2478 r2523  
    102102 
    103103  /** Returns whether or not the channels are interleaved. */ 
    104   public boolean isInterleaved(String id) throws FormatException, IOException { 
     104  public boolean isInterleaved(String id, int subC) 
     105    throws FormatException, IOException 
     106  { 
    105107    return false; 
    106108  } 
  • trunk/loci/formats/in/ImarisReader.java

    r2478 r2523  
    201201 
    202202  /** Returns whether or not the channels are interleaved. */ 
    203   public boolean isInterleaved(String id) throws FormatException, IOException { 
     203  public boolean isInterleaved(String id, int subC) 
     204    throws FormatException, IOException 
     205  { 
    204206    return false; 
    205207  } 
  • trunk/loci/formats/in/ImarisTiffReader.java

    r2519 r2523  
    101101 
    102102  /* @see BaseTiffReader#isInterleaved(String) */ 
    103   public boolean isInterleaved(String id) throws FormatException, IOException { 
     103  public boolean isInterleaved(String id, int subC) 
     104    throws FormatException, IOException 
     105  { 
    104106    if (!id.equals(currentId)) initFile(id); 
    105107    return false; 
  • trunk/loci/formats/in/LIFReader.java

    r2519 r2523  
    112112 
    113113  /** Returns whether or not the channels are interleaved. */ 
    114   public boolean isInterleaved(String id) throws FormatException, IOException { 
     114  public boolean isInterleaved(String id, int subC) 
     115    throws FormatException, IOException 
     116  { 
    115117    return true; 
    116118  } 
  • trunk/loci/formats/in/LegacyPictReader.java

    r2478 r2523  
    6969 
    7070  /** Returns whether or not the channels are interleaved. */ 
    71   public boolean isInterleaved(String id) throws FormatException, IOException { 
     71  public boolean isInterleaved(String id, int subC) 
     72    throws FormatException, IOException 
     73  { 
    7274    return false; 
    7375  } 
  • trunk/loci/formats/in/LegacyQTReader.java

    r2478 r2523  
    9191 
    9292  /** Returns whether or not the channels are interleaved. */ 
    93   public boolean isInterleaved(String id) throws FormatException, IOException { 
     93  public boolean isInterleaved(String id, int subC) 
     94    throws FormatException, IOException 
     95  { 
    9496    return false; 
    9597  } 
  • trunk/loci/formats/in/LegacyZVIReader.java

    r2478 r2523  
    111111 
    112112  /** Returns whether or not the channels are interleaved. */ 
    113   public boolean isInterleaved(String id) throws FormatException, IOException { 
     113  public boolean isInterleaved(String id, int subC) 
     114    throws FormatException, IOException 
     115  { 
    114116    return false; 
    115117  } 
  • trunk/loci/formats/in/LeicaReader.java

    r2519 r2523  
    178178 
    179179  /** Returns whether or not the channels are interleaved. */ 
    180   public boolean isInterleaved(String id) throws FormatException, IOException { 
     180  public boolean isInterleaved(String id, int subC) 
     181    throws FormatException, IOException 
     182  { 
    181183    return true; 
    182184  } 
  • trunk/loci/formats/in/MNGReader.java

    r2478 r2523  
    8787 
    8888  /** Returns whether or not the channels are interleaved. */ 
    89   public boolean isInterleaved(String id) throws FormatException, IOException { 
     89  public boolean isInterleaved(String id, int subC) 
     90    throws FormatException, IOException 
     91  { 
    9092    return false; 
    9193  } 
  • trunk/loci/formats/in/MRCReader.java

    r2478 r2523  
    110110 
    111111  /** Returns whether or not the channels are interleaved. */ 
    112   public boolean isInterleaved(String id) throws FormatException, IOException { 
     112  public boolean isInterleaved(String id, int subC) 
     113    throws FormatException, IOException 
     114  { 
    113115    return true; 
    114116  } 
  • trunk/loci/formats/in/MicromanagerReader.java

    r2478 r2523  
    6868 
    6969  /* @see loci.formats.IFormatReader#isInterleaved(String) */ 
    70   public boolean isInterleaved(String id) throws FormatException, IOException { 
     70  public boolean isInterleaved(String id, int subC) 
     71    throws FormatException, IOException 
     72  { 
    7173    return false; 
    7274  } 
  • trunk/loci/formats/in/ND2Reader.java

    r2478 r2523  
    158158 
    159159  /** Returns whether or not the channels are interleaved. */ 
    160   public boolean isInterleaved(String id) throws FormatException, IOException { 
     160  public boolean isInterleaved(String id, int subC) 
     161    throws FormatException, IOException 
     162  { 
    161163    return true; 
    162164  } 
  • trunk/loci/formats/in/OIBReader.java

    r2519 r2523  
    153153 
    154154  /** Returns whether or not the channels are interleaved. */ 
    155   public boolean isInterleaved(String id) throws FormatException, IOException { 
     155  public boolean isInterleaved(String id, int subC) 
     156    throws FormatException, IOException 
     157  { 
    156158    return false; 
    157159  } 
  • trunk/loci/formats/in/OIFReader.java

    r2478 r2523  
    113113 
    114114  /** Returns whether or not the channels are interleaved. */ 
    115   public boolean isInterleaved(String id) throws FormatException, IOException { 
     115  public boolean isInterleaved(String id, int subC) 
     116    throws FormatException, IOException 
     117  { 
    116118    return false; 
    117119  } 
  • trunk/loci/formats/in/OMEXMLReader.java

    r2519 r2523  
    137137 
    138138  /** Returns whether or not the channels are interleaved. */ 
    139   public boolean isInterleaved(String id) throws FormatException, IOException { 
     139  public boolean isInterleaved(String id, int subC) 
     140    throws FormatException, IOException 
     141  { 
    140142    return false; 
    141143  } 
  • trunk/loci/formats/in/OpenlabRawReader.java

    r2478 r2523  
    9595 
    9696  /** Returns whether or not the channels are interleaved. */ 
    97   public boolean isInterleaved(String id) throws FormatException, IOException { 
     97  public boolean isInterleaved(String id, int subC) 
     98    throws FormatException, IOException 
     99  { 
    98100    return false; 
    99101  } 
  • trunk/loci/formats/in/OpenlabReader.java

    r2519 r2523  
    148148 
    149149  /** Returns whether or not the channels are interleaved. */ 
    150   public boolean isInterleaved(String id) throws FormatException, IOException { 
     150  public boolean isInterleaved(String id, int subC) 
     151    throws FormatException, IOException 
     152  { 
    151153    return true; 
    152154  } 
  • trunk/loci/formats/in/PerkinElmerReader.java

    r2512 r2523  
    101101 
    102102  /** Returns whether or not the channels are interleaved. */ 
    103   public boolean isInterleaved(String id) throws FormatException, IOException { 
     103  public boolean isInterleaved(String id, int subC) 
     104    throws FormatException, IOException 
     105  { 
    104106    return false; 
    105107  } 
  • trunk/loci/formats/in/PictReader.java

    r2478 r2523  
    149149 
    150150  /** Returns whether or not the channels are interleaved. */ 
    151   public boolean isInterleaved(String id) throws FormatException, IOException { 
     151  public boolean isInterleaved(String id, int subC) 
     152    throws FormatException, IOException 
     153  { 
    152154    return true; 
    153155  } 
  • trunk/loci/formats/in/PrairieReader.java

    r2512 r2523  
    161161 
    162162  /* @see loci.formats.IFormatReader#isInterleaved(String) */ 
    163   public boolean isInterleaved(String id) throws FormatException, IOException { 
     163  public boolean isInterleaved(String id, int subC) 
     164    throws FormatException, IOException 
     165  { 
    164166    if (!id.equals(currentId)) initFile(id); 
    165167    return false; 
  • trunk/loci/formats/in/QTReader.java

    r2484 r2523  
    284284 
    285285  /** Returns whether or not the channels are interleaved. */ 
    286   public boolean isInterleaved(String id) throws FormatException, IOException { 
     286  public boolean isInterleaved(String id, int subC) 
     287    throws FormatException, IOException 
     288  { 
    287289    return true; 
    288290  } 
  • trunk/loci/formats/in/SDTReader.java

    r2478 r2523  
    9494  } 
    9595 
    96   public short[][][][] openData(String id) { 
    97     // CTR TODO 
    98     return null; 
    99   } 
    100  
    10196  // -- IFormatReader API methods -- 
    10297 
     
    107102  public int getImageCount(String id) throws FormatException, IOException { 
    108103    if (!id.equals(currentId)) initFile(id); 
    109     return intensity ? channels : (timeBins * channels); 
    110   } 
    111  
    112   /** Checks if the images in the file are RGB. */ 
    113   public boolean isRGB(String id) throws FormatException, IOException { 
    114     return false; 
     104    return channels; 
    115105  } 
    116106 
    117107  /** Get the size of the C dimension. */ 
    118108  public int getSizeC(String id) throws FormatException, IOException { 
    119     int sc = super.getSizeC(id); 
    120     return intensity ? sc : (timeBins * sc); 
     109    return intensity ? channels : (timeBins * channels); 
     110  } 
     111 
     112  /* @see loci.formats.IFormatReader#getRGBChannelCount(String) */ 
     113  public int getRGBChannelCount(String id) throws FormatException, IOException { 
     114    return intensity ? 1 : timeBins; 
     115  } 
     116 
     117  /* @see loci.formats.IFormatReader#getChannelDimLengths(String) */ 
     118  public int[] getChannelDimLengths(String id) 
     119    throws FormatException, IOException 
     120  { 
     121    return intensity ? new int[] {channels} : new int[] {timeBins, channels}; 
     122  } 
     123 
     124  /* @see loci.formats.IFormatReader#getChannelDimTypes(String) */ 
     125  public String[] getChannelDimTypes(String id) 
     126    throws FormatException, IOException 
     127  { 
     128    return intensity ? new String[] {FormatTools.SPECTRA} : 
     129      new String[] {FormatTools.LIFETIME, FormatTools.SPECTRA}; 
    121130  } 
    122131 
     
    127136 
    128137  /** Returns whether or not the channels are interleaved. */ 
    129   public boolean isInterleaved(String id) throws FormatException, IOException { 
    130     return false; 
     138  public boolean isInterleaved(String id, int subC) 
     139    throws FormatException, IOException 
     140  { 
     141    return !intensity && subC == 0; 
    131142  } 
    132143 
     
    136147  { 
    137148    if (!id.equals(currentId)) initFile(id); 
    138     byte[] buf = new byte[2 * sizeX[series] * sizeY[series]]; 
     149    int c = getRGBChannelCount(id); 
     150    byte[] buf = new byte[2 * c * sizeX[series] * sizeY[series]]; 
    139151    return openBytes(id, no, buf); 
    140152  } 
     
    147159      throw new FormatException("Invalid image number: " + no); 
    148160    } 
    149     if (buf.length < 2 * sizeX[series] * sizeY[series]) { 
    150       throw new FormatException("Buffer too small."); 
     161    int c = getRGBChannelCount(id); 
     162    if (buf.length < 2 * c * sizeX[series] * sizeY[series]) { 
     163      throw new FormatException("Buffer too small"); 
    151164    } 
    152165 
     
    169182    } 
    170183    else { 
    171       int t = no % timeBins; 
    172       int c = no / timeBins; 
    173       in.seek(off + 2 * (sizeX[series] * sizeY[series] * timeBins * c + t)); 
     184      in.seek(off + 2 * sizeX[series] * sizeY[series] * timeBins * no); 
    174185      for (int y=0; y<sizeY[series]; y++) { 
    175186        for (int x=0; x<sizeX[series]; x++) { 
    176           // read data only for the given lifetime bin 
    177           int ndx = 2 * (sizeX[series] * y + x); 
    178           in.readFully(buf, ndx, 2); 
    179           in.skipBytes(timeBins); 
     187          for (int t=0; t<timeBins; t++) { 
     188            int ndx = 2 * (timeBins * sizeX[0] * y + timeBins * x + t); 
     189            in.readFully(buf, ndx, 2); 
     190          } 
    180191        } 
    181192      } 
     
    190201  { 
    191202    BufferedImage b = ImageTools.makeImage(openBytes(id, no), 
    192       sizeX[series], sizeY[series], 1, false, 2, true); 
     203      sizeX[series], sizeY[series], getRGBChannelCount(id), false, 2, true); 
    193204    updateMinMax(b, no); 
    194205    return b; 
  • trunk/loci/formats/in/SlidebookReader.java

    r2478 r2523  
    9191 
    9292  /** Returns whether or not the channels are interleaved. */ 
    93   public boolean isInterleaved(String id) throws FormatException, IOException { 
     93  public boolean isInterleaved(String id, int subC) 
     94    throws FormatException, IOException 
     95  { 
    9496    return false; 
    9597  } 
  • trunk/loci/formats/in/ZeissZVIReader.java

    r2519 r2523  
    211211 
    212212  /** Returns whether or not the channels are interleaved. */ 
    213   public boolean isInterleaved(String id) throws FormatException, IOException { 
     213  public boolean isInterleaved(String id, int subC) 
     214    throws FormatException, IOException 
     215  { 
    214216    return false; 
    215217  } 
  • trunk/loci/formats/ome/OMEReader.java

    r2455 r2523  
    221221  } 
    222222 
    223   /* @see loci.formats.IFormatReader#isInterleaved(String) */ 
    224   public boolean isInterleaved(String id) throws FormatException, IOException { 
     223  /* @see loci.formats.IFormatReader#isInterleaved(String, int) */ 
     224  public boolean isInterleaved(String id, int subC) 
     225    throws FormatException, IOException 
     226  { 
    225227    return false; 
    226228  } 
Note: See TracChangeset for help on using the changeset viewer.