Changeset 6369


Ignore:
Timestamp:
05/24/10 20:38:36 (9 years ago)
Author:
melissa
Message:

Fixed a few SimplePCI dimension bugs.

Files:
2 edited

Legend:

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

    r6323 r6369  
    174174        } 
    175175      } 
    176       else if (relativePath.startsWith("Bitmap") || relativePath.equals("Data")) 
     176      else if (relativePath.startsWith("Bitmap") || 
     177        (relativePath.equals("Data") && parent.indexOf("Image") != -1)) 
    177178      { 
    178179        imageFiles.put(imageFiles.size(), name); 
     
    181182          int bpp = FormatTools.getBytesPerPixel(getPixelType()); 
    182183          int plane = getSizeX() * getSizeY() * bpp; 
    183           core[0].sizeC = poi.getFileSize(name) / plane; 
    184184          if (getSizeC() == 0) { 
    185             core[0].sizeX /= 16; 
    186             core[0].sizeY /= 16; 
    187185            core[0].sizeC = poi.getFileSize(name) / plane; 
    188186          } 
     
    190188      } 
    191189      else if (relativePath.indexOf("Image_Depth") != -1) { 
     190        boolean firstBits = core[0].bitsPerPixel == 0; 
    192191        int bits = (int) stream.readDouble(); 
    193192        core[0].bitsPerPixel = bits; 
     
    200199        bits /= 8; 
    201200        core[0].pixelType = FormatTools.pixelTypeFromBytes(bits, false, false); 
     201        if (getSizeC() > 1 && firstBits) { 
     202          core[0].sizeC /= bits; 
     203        } 
    202204      } 
    203205      else if (relativePath.indexOf("Image_Height") != -1 && getSizeY() == 0) { 
  • trunk/components/bio-formats/src/loci/formats/in/PCIReader.java

    r6323 r6369  
    174174        } 
    175175      } 
    176       else if (relativePath.startsWith("Bitmap") || relativePath.equals("Data")) 
     176      else if (relativePath.startsWith("Bitmap") || 
     177        (relativePath.equals("Data") && parent.indexOf("Image") != -1)) 
    177178      { 
    178179        imageFiles.put(imageFiles.size(), name); 
     
    181182          int bpp = FormatTools.getBytesPerPixel(getPixelType()); 
    182183          int plane = getSizeX() * getSizeY() * bpp; 
    183           core[0].sizeC = poi.getFileSize(name) / plane; 
    184184          if (getSizeC() == 0) { 
    185             core[0].sizeX /= 16; 
    186             core[0].sizeY /= 16; 
    187185            core[0].sizeC = poi.getFileSize(name) / plane; 
    188186          } 
     
    190188      } 
    191189      else if (relativePath.indexOf("Image_Depth") != -1) { 
     190        boolean firstBits = core[0].bitsPerPixel == 0; 
    192191        int bits = (int) stream.readDouble(); 
    193192        core[0].bitsPerPixel = bits; 
     
    200199        bits /= 8; 
    201200        core[0].pixelType = FormatTools.pixelTypeFromBytes(bits, false, false); 
     201        if (getSizeC() > 1 && firstBits) { 
     202          core[0].sizeC /= bits; 
     203        } 
    202204      } 
    203205      else if (relativePath.indexOf("Image_Height") != -1 && getSizeY() == 0) { 
Note: See TracChangeset for help on using the changeset viewer.