Changeset 7235 for branches/4.2


Ignore:
Timestamp:
11/23/10 10:53:54 (10 years ago)
Author:
melissa
Message:

Override get*BitLookupTable() methods so that files with a different LUT for each plane will be properly handled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r7143 r7235  
    5858  private String[] files; 
    5959  private MinimalTiffReader[] readers; 
     60 
     61  private int lastFile = 0; 
    6062 
    6163  // -- Constructor -- 
     
    9193      readers = null; 
    9294      files = null; 
     95      lastFile = 0; 
    9396    } 
    9497  } 
     
    98101    FormatTools.assertId(currentId, true, 1); 
    99102    return noPixels ? null : files; 
     103  } 
     104 
     105  /* @see loci.formats.IFormatReader#get8BitLookupTable() */ 
     106  public byte[][] get8BitLookupTable() throws FormatException, IOException { 
     107    FormatTools.assertId(currentId, true, 1); 
     108    if (readers == null || lastFile < 0 || lastFile >= readers.length || 
     109      readers[lastFile] == null) 
     110    { 
     111      return super.get8BitLookupTable(); 
     112    } 
     113    return readers[lastFile].get8BitLookupTable(); 
     114  } 
     115 
     116  /* @see loci.formats.IFormatReader#get16BitLookupTable() */ 
     117  public short[][] get16BitLookupTable() throws FormatException, IOException { 
     118    FormatTools.assertId(currentId, true, 1); 
     119    if (readers == null || lastFile < 0 || lastFile >= readers.length || 
     120      readers[lastFile] == null) 
     121    { 
     122      return super.get16BitLookupTable(); 
     123    } 
     124    return readers[lastFile].get16BitLookupTable(); 
    100125  } 
    101126 
     
    112137      getSizeT(), getImageCount(), zct[0], zct[1], zct[2]) % files.length; 
    113138    int plane = no / files.length; 
     139    lastFile = file; 
    114140 
    115141    return readers[file].openBytes(plane, buf, x, y, w, h); 
Note: See TracChangeset for help on using the changeset viewer.