Re: saving an ROI to a file
Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Feb 02, 2014; 12:17am
URL: http://imagej.273.s1.nabble.com/saving-an-ROI-to-a-file-tp5006367p5006368.html
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