RoiManager save command help

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

RoiManager save command help

F Javier Díez Guerra
Hello,

In a macro, I want to save multiple Roi's in a file ("RoiSet.zip") using
the roiManager(cmd, name) command. For that I use the following lines:

selectImage("Acquired-b.tif");
roiManager("reset");
roiManager("Add");
roiManager("Save", "RoiSet.zip");

However, this saves the file in the "c:\imagej\" (user.dir) directory
and I want to save it in the directory of the opened image.
Since I want to apply the macro to groups of images located in diferent
directories, how can I instruct the macro to save the Roi's in specific
directories? Is it possible to change the user.dir within the macro?

I have tried:

dir = getDirectory("image");
roiManager("Save", dir);

but does not work.

Please, excuse for my programming ignorance.

F Javier Díez Guerra, PhD
Profesor Titular
Centro de Biología Molecular Severo Ochoa
C/ Nicolás Cabrera, 1
Universidad Autónoma
Ctra Colmenar Viejo Km 15
Cantoblanco, 28049 Madrid
SPAIN

phone:  +34 91 196 4612
e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: RoiManager save command help

Schebique
hello Javier
Try:
dir = getDirectory("image");
roiManager("Save", dir+"RoiSet.zip");

Sincerley Ondrej Sebesta

F Javier Díez Guerra napsal(a):

> Hello,
>
> In a macro, I want to save multiple Roi's in a file ("RoiSet.zip")
> using the roiManager(cmd, name) command. For that I use the following
> lines:
>
> selectImage("Acquired-b.tif");
> roiManager("reset");
> roiManager("Add");
> roiManager("Save", "RoiSet.zip");
>
> However, this saves the file in the "c:\imagej\" (user.dir) directory
> and I want to save it in the directory of the opened image.
> Since I want to apply the macro to groups of images located in
> diferent directories, how can I instruct the macro to save the Roi's
> in specific directories? Is it possible to change the user.dir within
> the macro?
>
> I have tried:
>
> dir = getDirectory("image");
> roiManager("Save", dir);
>
> but does not work.
>
> Please, excuse for my programming ignorance.
>
> F Javier Díez Guerra, PhD
> Profesor Titular
> Centro de Biología Molecular Severo Ochoa
> C/ Nicolás Cabrera, 1
> Universidad Autónoma
> Ctra Colmenar Viejo Km 15
> Cantoblanco, 28049 Madrid
> SPAIN
>
> phone:  +34 91 196 4612
> e-mail: [hidden email]
>