Wayne M Barnes
2004-12-27 18:41:14 UTC
Dear ImageJ,
I am writing a plugin to search all around an image, and I need
to be able to mark where I have been, already, one pixel at a time.
( I only want to sprinkle a few pixels, without disturbing the whole
picture too much.)
So far, I have been doing a slow, kludgy method summarizable as:
IJ.setForegroundColor(1, 255, 3);
img2.setRoi(x, y, 1, 1);
IJ.run("Fill", "slice");
I spend a lot of time watching "Fill: ... " with no picture
update until the program really comes to a long pause, after
which my pixels finally show up.
What I really need is a fast-acting method such as:
int [] colors = new int[4];
IJ.setForegroundColor(1, 255, 3);
img2.setPixel(x,y);
// or
img2.setPixel(x,y,colors);
But I don't see any .setPixel option. (Basically I want the opposite
of ImagePlus.getPixel(int,int). I have seen something like
putPixel, but I can't figure out how to use it, and it seems
to be only black & white, anyway.
Can someone tell me where and if my imagined method might be? Or
suggest some other way to change a single pixel to a specified RGB color?
I started with the plugin Cell_counter, and I want to change the
pixels on img2.
Thank you,
--
Wayne M Barnes
***@etaq.com fax: (314) 754-9556
I am writing a plugin to search all around an image, and I need
to be able to mark where I have been, already, one pixel at a time.
( I only want to sprinkle a few pixels, without disturbing the whole
picture too much.)
So far, I have been doing a slow, kludgy method summarizable as:
IJ.setForegroundColor(1, 255, 3);
img2.setRoi(x, y, 1, 1);
IJ.run("Fill", "slice");
I spend a lot of time watching "Fill: ... " with no picture
update until the program really comes to a long pause, after
which my pixels finally show up.
What I really need is a fast-acting method such as:
int [] colors = new int[4];
IJ.setForegroundColor(1, 255, 3);
img2.setPixel(x,y);
// or
img2.setPixel(x,y,colors);
But I don't see any .setPixel option. (Basically I want the opposite
of ImagePlus.getPixel(int,int). I have seen something like
putPixel, but I can't figure out how to use it, and it seems
to be only black & white, anyway.
Can someone tell me where and if my imagined method might be? Or
suggest some other way to change a single pixel to a specified RGB color?
I started with the plugin Cell_counter, and I want to change the
pixels on img2.
Thank you,
--
Wayne M Barnes
***@etaq.com fax: (314) 754-9556