Changeset 2504


Ignore:
Timestamp:
03/23/07 09:37:44 (13 years ago)
Author:
melissa
Message:

Added hack to deal with incorrect OME-TIFF files produced by WiscScan.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/in/TiffReader.java

    r2503 r2504  
    114114        } 
    115115      } 
     116 
     117      // MAJOR HACK : check for OME-XML in the comment of the second IFD 
     118      // There is a version of WiscScan which writes OME-XML to every IFD, 
     119      // but with SizeZ and SizeT equal to 1. 
     120 
     121      String s =  
     122        (String) TiffTools.getIFDValue(ifds[1], TiffTools.IMAGE_DESCRIPTION); 
     123      boolean isWiscScan = s != null && s.indexOf("ome.xsd") != -1; 
    116124 
    117125      // extract SizeZ, SizeC and SizeT from XML block 
     
    159167          } 
    160168 
     169          // MAJOR HACK : adjust SizeT to match the number of IFDs, if this 
     170          // file was written by a buggy version of WiscScan 
     171          if (isWiscScan) sizeT[i] = numImages; 
     172 
    161173          currentOrder[i] = pixels[i].getAttribute("DimensionOrder"); 
    162174          orderCertain[i] = true; 
    163175 
    164           /* debug */ System.out.println("Z=" + sizeZ[i] + ", C=" + sc + 
    165             ", T=" + sizeT[i]); 
    166176          boolean[][][] zct = new boolean[sizeZ[i]][sc][sizeT[i]]; 
    167177 
     
    184194              (nullIfd ? numImages : 1) : Integer.parseInt(aNumPlanes); 
    185195 
    186             /* debug */ System.out.println("first (" + firstZ + "," + firstC + 
    187               "," + firstT + ")"); 
    188  
    189196            // populate ZCT matrix 
    190197            char d1st = currentOrder[i].charAt(2); 
     
    192199            int z = firstZ, t = firstT, c = firstC; 
    193200             
    194             /* debug */ System.out.println("number of planes : " + numPlanes);  
    195              
    196201            for (int k=0; k<numPlanes; k++) { 
    197               /* debug */ System.out.println("z=" + z + ", c=" + c + ", t=" + t); 
    198202              zct[z][c][t] = true; 
    199203              switch (d1st) { 
Note: See TracChangeset for help on using the changeset viewer.