On 6/13/14, 5:13 AM, ben.s.carlson wrote:
> Hello,
>
> I'd like to save an ROI as a .roi file from a macro. I see the
> functionality to save as a zip, however I only have one roi in the roi
> manager at a time, so it would be much better to save as a .roi file.
>
> I'm using imageJ version 1.49b.
>
> Here is a snippet of my code.
>
> roiManager("Select", 0); //Only one roi in ROI manager, select it
> roiManager("Save Selected", dir + "\\myfile.roi"); //dir is the working
> directory
>
> I've also tried the "Save" command, but both require that I save the file as
> .zip. Is it possible to save just the roi?
>
The following saves the roi as a .roi file.
if (isOpen("ROI Manager")) {
selectWindow("ROI Manager");
run("Close");
}
makeRectangle(360, 151, 135, 95);
roiManager("Add");
roiManager("Select", 0);
saveAs("Selection", "/Users/amw1/Desktop/test.roi");
It saves the lone ROI as test.roi
--aryeh
--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel
Ph: 972-3-5317638
FAX: 972-3-7384051
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html