LUT 16bit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

LUT 16bit

Uborka
Hello,
I want to create a unique LUT table for my 16bit images, but I always get an error when the last line is executed…

red = new byte[65536];
green = new byte[65536];
blue = new byte[65536];
Color colorBuff;

for(int i = 0; i < red.length; i++) {
            colorBuff = ColorGenerator(maxValue,minValue,i);
            red[i] = (byte) colorBuff.getRed();
            green[i] = (byte) colorBuff.getGreen();
            blue[i] = (byte) colorBuff.getBlue();
}
LUT lt = new LUT(16,65536,red, green, blue);

ImageProcessor ip = imp.getProcessor();
ip.setLut(lt);
imp.updateAndDraw(); //this line causes the error

The error is:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Raster ByteInterleavedRaster: width = 40 height = 51 #numDataElements 1 dataOff[0] = 0 is incompatible with ColorModel rgb[0]=#646464, rgb[255]=#630000, min=0, max=0


Can somebody help me?