Re: How to save all opened images

Posted by Juanjo Vega on
URL: http://imagej.273.s1.nabble.com/How-to-save-all-opened-images-tp3686986p3686987.html

Dear Simone,

I'm not sure if this is exactly what you need, but if you add a line to
your macro:

// get image IDs of all open images
ids=newArray(nImages);
for (i=0;i<nImages;i++) {
        selectImage(i+1);
        ids[i]=getImageID;

        saveAs("Jpeg", "/home/juanjo/Desktop/img00000"+ids[i]+".jpg");
}

You can save all the currently opened images to a folder.

Hope this help.

Have a nice weekend :)

Juanjo.


On Fri, 2010-09-10 at 08:36 -0700, sdegan wrote:

> Hi All,
>
> I am trying to save all the opened images I have on the stage after running
> a macro. I know that I have to assign IDs to the opened images but then I do
> not know how to get them saved in a directory. Ideally I would like to add
> the saveall command at the end of the macro:
>
> // get image IDs of all open images
> ids=newArray(nImages);
> for (i=0;i<nImages;i++) {
> selectImage(i+1);
> ids[i]=getImageID;
> }
>
> Can someone help?
>
> Thanks
>