Saving .roi from ROI Manager in a Macro

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

Saving .roi from ROI Manager in a Macro

MikeChelen
Hello, I have a macro that I'm trying to use to save .roi files. Using the
roiManager("select",index) command to select an entry, then using the
roiManager(cmd,path) command to save the file, I must specify a path ending
in .zip or I get an error ("Path must end with .zip"). Why doesn't this
command let me output individual ROI's as .roi files?
 Alternatively, if I could select all of the ROI's at once, and then save
them together in a .zip file, this would be ok. However, using the select
command oddly deselects all other entries. Is there some other way to select
entries that does not do this? Or some select all command? I am using ImageJ
1.35a. Any suggestions would be appreciated.
Thanks,
Michael
Reply | Threaded
Open this post in threaded view
|

Re: Saving .roi from ROI Manager in a Macro

Wayne Rasband
> Hello, I have a macro that I'm trying to use to save .roi
> files. Using the roiManager("select",index) command to
> select an entry, then using the roiManager(cmd,path) command
> to save the file, I must specify a path ending in .zip or I
> get an error ("Path must end with .zip"). Why doesn't this
> command let me output individual ROI's as .roi files?
>  Alternatively, if I could select all of the ROI's at once,
> and then save them together in a .zip file, this would be
> ok. However, using the select command oddly deselects all
> other entries. Is there some other way to select entries
> that does not do this? Or some select all command? I am
> using ImageJ 1.35a. Any suggestions would be appreciated.

If no ROI's are selected, the "Save" command saves all the ROI's as a
ZIP archive. In a macro, use:

     roiManager("deselect");
     roiManager("save", path)

-wayne
Reply | Threaded
Open this post in threaded view
|

Calling plugin command from Macro

MikeChelen
Hello, I am trying to make a macro that will create ROI's based on a binary
mask, then measure those ROIs through a 500 frame stack, and save the data.
The macro that I've written does all of this fine, except for the
measurement step, when I use the MultiMeasure plugin that's part of the WCIF
plugin set. This works great, but the user mus manually press the buttons on
the MultiMeasure panel to run the measurement command. Is there any way for
me to automate this step? Either from within a macro or within a plugin? I
don't have much experience with java in ImageJ, so any help would be
appreciated.
Thanks
Michael Chelen