"burning" ROI boundary onto an image

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

"burning" ROI boundary onto an image

Ben.BigHair
Hello,

I would like to "burn" an ROI onto an image, and then save the image,
using ImageJ's (amazing) macro language. The macro below can get pretty
close... but not quite what I am looking for. I would like to have just
the boundary drawn in the final image.  Wayne discussed something like
this in January of this year (see discussion pasted waay below).
Despite his perfectly good advice, I blithely decided to tackle this
differently by changing the pixel values in the RGB image.  The only
trouble is that the interior of the polygon is filled rather than just
the boundary.

Is there a solution short of the "capture-and-crop" approach suggested
by Wayne.

Thanks!
Ben

//BEGIN
run("Blobs (25K)");
run("Duplicate...", "title=blobs-1.gif");
selectWindow("blobs.gif");
setAutoThreshold();
//run("Threshold...");
doWand(86, 76);
selectWindow("blobs-1.gif");
run("RGB Color");
run("Restore Selection");

//the following appears to have no effect
//getSelectionCoordinates(xc,yc);
//for (i=0;i<xc.length;i++){setPixel(xc[i],yc[i],0x00ffff);}

//the following fills the polygon interior
changeValues(0x000000, 0xffffff, 0xffff00);

saveAs("Jpeg", "RGB.jpg");
//END


>> Is there a way to save a .tif file with the ROIs highlighted and
>> numbered with the "Show All" command under the ROI Manager?  Thanks,
>
> One way would be to use the ROI Manager's More>>Label command. To highlight in color, you must first convert the image to RGB (Image>Type>RGB Color) and select a color by double clicking on the eye dropper tool. Another way would be to capture the screen by pressing shift-g (Plugins>Utilities>Capture Screen), select the image, and crop. In ImageJ 1.38h or later, you will be able to crop by pressing shift-x, the keyboard shortcut for the Image>Crop command.
Reply | Threaded
Open this post in threaded view
|

Re: "burning" ROI boundary onto an image

Michael Schmid
Hi Ben,

what about
  setForegroundColor(255, 0, 0); //or whatever color you like
  run("Draw");                   //draws the outline

Michael
________________________________________________________________________
On Wed, 30 May 2007 14:52:24 -0400 Ben Tupper wrote:
>Hello,
>
>I would like to "burn" an ROI onto an image, and then save the image,
>using ImageJ's (amazing) macro language. The macro below can get pretty
>close... but not quite what I am looking for. I would like to have just
>the boundary drawn in the final image.
Reply | Threaded
Open this post in threaded view
|

Re: "burning" ROI boundary onto an image

Ben.BigHair
Michael Schmid wrote:
> Hi Ben,
>
> what about
>   setForegroundColor(255, 0, 0); //or whatever color you like
>   run("Draw");                   //draws the outline

Yeee Haaaa!   That is so easy!

Thanks!

Ben



>
> Michael
> ________________________________________________________________________
> On Wed, 30 May 2007 14:52:24 -0400 Ben Tupper wrote:
>> Hello,
>>
>> I would like to "burn" an ROI onto an image, and then save the image,
>> using ImageJ's (amazing) macro language. The macro below can get pretty
>> close... but not quite what I am looking for. I would like to have just
>> the boundary drawn in the final image.
>