Login  Register

Re: How to get the path of an opened image?

Posted by Wayne Rasband on Apr 21, 2006; 3:22pm
URL: http://imagej.273.s1.nabble.com/How-to-get-the-path-of-an-opened-image-tp3702976p3702977.html

> As the title says, how to get the path of an opened image?
>
> What I wanna do is to divide a stack image into serval ones and save
> the substacks automatically.

In a macro use:

     dir = getDirectory('image');

In a plugin, call this macro using the IJ.runMacro() method:

     String dir = IJ.runMacro("return getDirectory('image');");

-wayne