Changeset 7338


Ignore:
Timestamp:
12/06/10 14:33:46 (9 years ago)
Author:
melissa
Message:

Updated FEI reader to properly support sub-image reading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/FEIReader.java

    r6881 r7338  
    8080 
    8181    byte[] segment = new byte[getSizeX() / 2]; 
     82    byte[] plane = new byte[FormatTools.getPlaneSize(this)]; 
    8283    // interlace frames - there are four rows of two columns 
    8384    int halfRow = getSizeX() / 2; 
    8485    for (int q=0; q<4; q++) { 
    85       for (int row=q; row<h; row+=4) { 
     86      for (int row=q; row<getSizeY(); row+=4) { 
    8687        for (int s=0; s<2; s++) { 
    8788          in.read(segment); 
    8889          in.skipBytes(INVALID_PIXELS / 2); 
    89           for (int col=s; col<w; col+=2) { 
    90             buf[row*w + col] = segment[col / 2]; 
     90          for (int col=s; col<getSizeX(); col+=2) { 
     91            plane[row*getSizeX() + col] = segment[col / 2]; 
    9192          } 
    9293        } 
    9394      } 
    9495    } 
     96 
     97    RandomAccessInputStream pixels = new RandomAccessInputStream(plane); 
     98    readPlane(pixels, x, y, w, h, buf); 
     99    pixels.close(); 
    95100 
    96101    return buf; 
Note: See TracChangeset for help on using the changeset viewer.