Changeset 3994


Ignore:
Timestamp:
05/02/08 09:40:30 (12 years ago)
Author:
melissa
Message:

Fixed bug where sizeC was set to 0.

File:
1 edited

Legend:

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

    r3972 r3994  
    173173            (core.sizeX[0] * core.sizeY[0] * 
    174174            FormatTools.getBytesPerPixel(core.pixelType[0])); 
     175          if (core.sizeC[0] == 0) { 
     176            core.sizeX[0] /= 16; 
     177            core.sizeY[0] /= 16; 
     178            core.sizeC[0] = poi.getFileSize(name) / 
     179              (core.sizeX[0] * core.sizeY[0] * 
     180              FormatTools.getBytesPerPixel(core.pixelType[0])); 
     181          } 
    175182        } 
    176183      } 
     
    193200        } 
    194201      } 
    195       else if (relativePath.indexOf("Image_Height") != -1) { 
     202      else if (relativePath.indexOf("Image_Height") != -1 && core.sizeY[0] == 0) 
     203      { 
    196204        byte[] b = poi.getDocumentBytes(name, 8); 
    197         long val = DataTools.bytesToLong(b, 0, false); 
    198         int mul = (int) ((val & 0x1f00) >> 8); 
    199         if (mul == 0) mul = (int) ((val & 0xf000) >> 12); 
    200         core.sizeY[0] = mul * 64; 
    201       } 
    202       else if (relativePath.indexOf("Image_Width") != -1) { 
     205        byte val = b[6]; 
     206        byte mul = (byte) (val << 2); 
     207        if (mul == 0) mul = 32; 
     208        core.sizeY[0] = mul * 16; 
     209      } 
     210      else if (relativePath.indexOf("Image_Width") != -1 && core.sizeX[0] == 0) 
     211      { 
    203212        byte[] b = poi.getDocumentBytes(name, 8); 
    204         long val = DataTools.bytesToLong(b, 0, false); 
    205         int mul = (int) ((val & 0x1f00) >> 8); 
    206         if (mul == 0) mul = (int) ((val & 0xf000) >> 12); 
    207         core.sizeX[0] = mul * 64; 
     213        byte val = b[6]; 
     214        byte mul = (byte) (val << 2); 
     215        if (mul == 0) mul = 32; 
     216        core.sizeX[0] = mul * 16; 
    208217      } 
    209218    } 
     219 
     220    if (core.sizeC[0] == 0) core.sizeC[0] = 1; 
    210221 
    211222    core.sizeZ[0] = core.imageCount[0]; 
Note: See TracChangeset for help on using the changeset viewer.