public byte[] getBytes() { int size = getMapSize(); if (size!=256) return null; byte[] bytes = new byte[256*3]; for (int i=0; i<256; i++) bytes[i] = (byte)getRed(i); for (int i=0; i<256; i++) bytes[256+i] = (byte)getGreen(i); for (int i=0; i<256; i++) bytes[512+i] = (byte)getBlue(i); return bytes; }
public byte[] getBytes() { int size = getMapSize(); if (size!=256) return null; byte[] bytes = new byte[256*3]; for (int i=0; i<256; i++) bytes[i] = (byte)getRed(i); for (int i=0; i<256; i++) bytes[256+i] = (byte)getGreen(i); for (int i=0; i<256; i++) bytes[512+i] = (byte)getBlue(i); return bytes; }
/** get the actual pixel value (lookup when data is indexed) of the index of a fake image at a given z,c,t */ private int getPixelValue(int x,int y, ImagePlus imp, int z, int c, int t, boolean indexed, boolean falseColor) { //TODO - restore - changed for compositeTest debugging setZctPosition(imp,z,c,t); setCztPosition(imp,z,c,t); int rawValue = (int) (imp.getProcessor().getPixelValue(x, y)); if ((!indexed) || (falseColor)) // TODO - disabling falseColor test here improves 3/1/indexed/falseColor return rawValue; // otherwise indexed - lookup pixel value in LUT LUT lut = getColorTable(imp,c); int value = lut.getRed(rawValue); // since r g and b vals should be the same choose one arbitrarily. // OR Use red in case lut len < 3 and zero fills other channels return value; }