Hi Mobitel,
BufferedImage is a subclass of java.awt.Image.
You can just use this constructor for ColorProcessor to get from a
java.awt.image.BufferedImage to a ColorProcessor:
/**Creates a ColorProcessor from an AWT Image. */
public ColorProcessor(Image img) {
width = img.getWidth(null);
height = img.getHeight(null);
pixels = new int[width * height];
PixelGrabber pg = new PixelGrabber(img, 0, 0, width, height,
pixels, 0, width);
try {
pg.grabPixels();
} catch (InterruptedException e){};
createColorModel();
fgColor = 0xff000000; //black
resetRoi();
}
ImagePlus contains a ImageProcessor (ByteProcessor, ShortProcessor,
ColorProcessor), but it is really the ImageProcessor that contains the
image that you work on.
-Sami Badawi
http://www.shapelogic.org