Changeset 1887


Ignore:
Timestamp:
12/02/06 14:59:44 (13 years ago)
Author:
melissa
Message:

Don't return a 3-channel byte array when calling openBytes on single-channel ND2 files.

File:
1 edited

Legend:

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

    r1843 r1887  
    133133    byte[][] pixels = ImageTools.getPixelBytes(openImage(id, no), false); 
    134134 
    135     if (pixels.length == 1) { 
     135    if (pixels.length == 1 || sizeC[0] == 1) { 
    136136      return pixels[0]; 
    137137    } 
    138138 
    139     byte[] b = new byte[pixels.length * pixels[0].length]; 
    140     for (int i=0; i<pixels.length; i++) { 
     139    byte[] b = new byte[sizeC[0] * pixels[0].length]; 
     140    for (int i=0; i<sizeC[0]; i++) { 
    141141      System.arraycopy(pixels[i], 0, b, i*pixels[0].length, pixels[i].length); 
    142142    } 
     
    454454    store.setDimensions(new Float(pixSizeX), new Float(pixSizeX), 
    455455      new Float(pixSizeZ), null, null, null); 
    456  
    457456  } 
    458457 
Note: See TracChangeset for help on using the changeset viewer.