Login  Register

Re: Saving single ROI as jpg

Posted by Michael Doube on Apr 10, 2010; 6:46pm
URL: http://imagej.273.s1.nabble.com/Saving-single-ROI-as-jpg-tp3688628p3688629.html

Douglas

You can duplicate the image data inside the ROI, then save as JPG and
close. Image>Duplicate, File>Save As>JPG, File>Close.

This is the macro code of this sequence of commands:

run("Duplicate...");
saveAs("Jpeg");
close();

For a set of ROIs from an ROI manager, you could do it like:

 n = roiManager("count");
 for (i=0; i<n; i++) {
        roiManager("select", i);
        run("Duplicate...");
        saveAs("Jpeg");
        close();
  }

This could be streamlined to set filenames automatically, and would be
faster in batch mode, if you have a lot of images / ROI's to save.

http://rsbweb.nih.gov/ij/developer/macro/functions.html

Michael


Benn, Douglas K. wrote:

> Once again some advice please. I am trying to select individual ROIs and save them as jpgs. My process is
>
> 1) input stack 16 bits images.
> 2) threshold with black background.
> 3) apply a mask.
> 4) extract outlines.
> 4) analyse with output as drawing of ROIs with object labels shown. The ROImanager is enabled.
>
> I have been able to save individual rois as .roi and retrieve them to display on an image. However, I cannot find a way to select a region and save this as a jpg. Any suggestions would be appreciated.
>
> Thanks.
>
> Douglas