public byte[] getPlane(Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException { checkBounds(null, null, z, c, t); try { if (buffer.length != getPlaneSize()) throw new RuntimeException("Buffer size incorrect."); getWholePlane(z,c,t,buffer); } catch (FormatException e) { throw new RuntimeException(e); } return buffer; }
getWholePlane(z,c,t,plane); int rowOffset = offset.get(1)*getRowSize(); if(step.get(0)==1)
public byte[] getStack(Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException { checkBounds(null, null, null, c, t); try { if (buffer.length != getStackSize()) throw new RuntimeException("Buffer size incorrect."); int size = RomioPixelBuffer.safeLongToInteger(getPlaneSize()); byte[] plane = new byte[size]; int sizeZ = getSizeZ(); for(int z = 0; z < sizeZ; z++) { getWholePlane(z,c,t,plane); System.arraycopy(plane, 0, buffer, z*size, size); } } catch (FormatException e) { throw new RuntimeException(e); } return buffer; }
public byte[] getRow(Integer y, Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException { checkBounds(null, y, z, c, t); try { if (buffer.length != getRowSize()) throw new RuntimeException("Buffer size incorrect."); int size = RomioPixelBuffer.safeLongToInteger(getPlaneSize()); byte[] plane = new byte[size]; getWholePlane(z,c,t,plane); System.arraycopy(plane, y*getRowSize(), buffer, 0, getRowSize()); } catch (FormatException e) { throw new RuntimeException(e); } return buffer; }
public byte[] getCol(Integer x, Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException { checkBounds(x, null, z, c, t); try { if (buffer.length != getColSize()) throw new RuntimeException("Buffer size incorrect."); int size = RomioPixelBuffer.safeLongToInteger(getPlaneSize()); byte[] plane = new byte[size]; getWholePlane(z,c,t,plane); for(int y = 0; y < reader.getSizeY(); y++) { System.arraycopy(plane, (y*getRowSize())+(x*getByteWidth()), buffer, y*getByteWidth(), getByteWidth()); } } catch (FormatException e) { throw new RuntimeException(e); } return buffer; }