Login  Register

Re: open next

Posted by lechristophe on Oct 15, 2009; 10:23am
URL: http://imagej.273.s1.nabble.com/open-next-tp3690744p3690747.html

Get the user to select both source and destination directories at the beginning
get the names of all files in the directory using getfilelist and
store them in an array
then loop on this array using indexes and names stored, using open()
and save() with full path names on the source and destination
directory respectively
it can be good to enclose the loop in a condition testing the image
file extension (.tif or what you use), to avoid trying to open
non-image files if there are any in the source directory.

Christophe

On Thu, Oct 15, 2009 at 12:08 PM, Andrew Bell <[hidden email]> wrote:

> Hello,
>
> I want a macro to open an image, perfrom an operation, save it to another
> location, and open the next image in the original folder. Is this possible
> without the user having to specify the source folder each time?
>
> This is where i am at so far:
>
>
> dir = getDirectory("Choose Destination Directory ");
> open();
> name = dir+getTitle();
> run("Rolling Ball Background", "rolling=50");
> save(name+".tif");
> run("Open Next");
>
> This macro only opens the next file in the destination folder. How can I
> specify to open the next file in the source folder?
>
> Any suggestions warmly welcomed!
>
> Regards,
>
> Andrew
>