Changeset 4035


Ignore:
Timestamp:
05/12/08 12:15:09 (12 years ago)
Author:
melissa
Message:

Fix for Zeiss LSM files with incorrect bits per sample and strip byte counts.

Location:
trunk/loci/formats
Files:
2 edited

Legend:

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

    r3923 r4035  
    14991499    // determine which channel the strip belongs to 
    15001500 
     1501    if (numStrips < numChannels) numStrips = numChannels; 
    15011502    int channelNum = strip / (numStrips / numChannels); 
    15021503 
  • trunk/loci/formats/in/ZeissLSMReader.java

    r4034 r4035  
    728728 
    729729    Vector newIFDs = new Vector(); 
     730    int[] bitsPerSample = TiffTools.getBitsPerSample(ifds[0]); 
     731    long[] byteCounts = TiffTools.getStripByteCounts(ifds[0]); 
     732    boolean uncompressed = 
     733      TiffTools.getCompression(ifds[0]) == TiffTools.UNCOMPRESSED; 
    730734    for (int i=0; i<ifds.length; i++) { 
    731735      long subFileType = TiffTools.getIFDLongValue(ifds[i], 
     
    738742          ifds[i].put(new Integer(TiffTools.PREDICTOR), new Integer(1)); 
    739743        } 
     744        if (i > 0) { 
     745          ifds[i].put(new Integer(TiffTools.BITS_PER_SAMPLE), bitsPerSample); 
     746          if (uncompressed) { 
     747            ifds[i].put(new Integer(TiffTools.STRIP_BYTE_COUNTS), byteCounts); 
     748          } 
     749        } 
    740750        newIFDs.add(ifds[i]); 
    741751      } 
     
    747757 
    748758    initMetadata(); 
    749  
    750     core.littleEndian[0] = !core.littleEndian[0]; 
    751759  } 
    752760 
Note: See TracChangeset for help on using the changeset viewer.