Changeset 7235 for branches/4.1


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.1/components/bio-formats/src/loci/formats/in/ImprovisionTiffReader.java

    r6983 r7235  
    6060  private String[] files; 
    6161  private MinimalTiffReader[] readers; 
     62 
     63  private int lastFile = 0; 
    6264 
    6365  // -- Constructor -- 
     
    9395      readers = null; 
    9496      files = null; 
     97      lastFile = 0; 
    9598    } 
    9699  } 
     
    100103    FormatTools.assertId(currentId, true, 1); 
    101104    return noPixels ? null : files; 
     105  } 
     106 
     107  /* @see loci.formats.IFormatReader#get8BitLookupTable() */ 
     108  public byte[][] get8BitLookupTable() throws FormatException, IOException { 
     109    FormatTools.assertId(currentId, true, 1); 
     110    if (readers == null || lastFile < 0 || lastFile >= readers.length || 
     111      readers[lastFile] == null) 
     112    { 
     113      return super.get8BitLookupTable(); 
     114    } 
     115    return readers[lastFile].get8BitLookupTable(); 
     116  } 
     117 
     118  /* @see loci.formats.IFormatReader#get16BitLookupTable() */ 
     119  public short[][] get16BitLookupTable() throws FormatException, IOException { 
     120    FormatTools.assertId(currentId, true, 1); 
     121    if (readers == null || lastFile < 0 || lastFile >= readers.length || 
     122      readers[lastFile] == null) 
     123    { 
     124      return super.get16BitLookupTable(); 
     125    } 
     126    return readers[lastFile].get16BitLookupTable(); 
    102127  } 
    103128 
     
    114139      getSizeT(), getImageCount(), zct[0], zct[1], zct[2]) % files.length; 
    115140    int plane = no / files.length; 
     141    lastFile = file; 
    116142 
    117143    return readers[file].openBytes(plane, buf, x, y, w, h); 
Note: See TracChangeset for help on using the changeset viewer.