Posted by
Aryeh Weiss on
Feb 02, 2014; 3:51am
URL: http://imagej.273.s1.nabble.com/saving-an-ROI-to-a-file-tp5006367p5006369.html
On 2/2/14, 2:17 AM, Rasband, Wayne (NIH/NIMH) [E] wrote:
> On Feb 1, 2014, at 3:46 PM, Aryeh Weiss wrote:
>
>> I am writing a Python script in which I want to save an ROI.
>> I thought that RoiWriter ought to do this, with the following method:
>>
>> |*saveRoi <
http://imagej.nih.gov/ij/developer/api/ij/plugin/filter/RoiWriter.html#saveRoi%28ij.ImagePlus%29>*(ImagePlus <
http://imagej.nih.gov/ij/developer/api/ij/ImagePlus.html> imp)|
>>
>> However, I do not see how to specify the path. RoiReader takes the path as an argument, but not RoiWriter.
>> So, tried saving with the Roi manager, while recording the command. However, the save command did nto record anything. Open form a file recorded, as did everything else I tried, but not Save...
>>
>> So I am apparently missing something really obvious, but I must ask -- how does one save an Roi to a file, similar to what the Roi manager does?
> Try using the command recorder (Plugins>Macros>Record). This is what I get when I record the File>Save As>Selection command:
>
> IJ.saveAs(imp, "Selection", path);
>
> -wayne
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
Thank you for your quick reply.
I tried using the command recorder while saving the ROI with the ROI
Manager, using
More>Save... , but this did nto record anything.
1. Why did that not work?
2. Why does the saveRoi method not accept a path to save and ROI the way
that readRoi does?
Is this just the way ti developed, or is the something sbout ROIsl that
makes it unreasonable to do that?
Best regards,
--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