Re: saving stacks to newly created folders

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/saving-stacks-to-newly-created-folders-tp3689270p3689271.html

Hi Crhis,

for some reason your mail was posted half a dozen times to the list,  
partly with slight variations of the subject and context. Please try  
to avoid this, it will be considered annoying. You get a confirmation  
mail for each post to the list, so it is hard to blame this mistake  
on your mailer...

Anyhow, you are missing the slash (or backslash on Windows) at the  
end of the folder name. So ImageJ takes it as the name of a normal  
file in the parent directory, and the files are getting stored in the  
parent directory.

Try:
   bee = "bee_"+i + File.separator;

Michael
________________________________________________________________

On 22 Feb 2010, at 15:46, Ninja Chris wrote:

> Hi, I'm trying to throw together some javascript to duplicate ROIs  
> in a stack
> in ImageJ and save each produced stack to its own folder created in  
> the
> parent. My code is:
>
> sdir = getDirectory("choose source directory ");
> n = roiManager("count");
> for (i=0; i<n; i++) {
>      roiManager("select", i);
>      bee = "bee_"+i;
>      ddir = sdir+bee;
>      File.makeDirectory(ddir);
>      run("Duplicate...", "title = bee duplicate range=1-3000");
>      run("Image Sequence... ", "format=TIFF name=bee start=0 digits=4
> save=ddir);
>      );
> close();
>   }
>
> My problem is that the ROIs are duplicated, the folders created but  
> the
> stack isn't saved to the new subfolders. A previous version created  
> the
> folders but then requested confirmation of the folder to save the  
> images
> too. This had the advantage of actually saving the files but lacked  
> the
> automation I seek. I am working with 3K image stacks and processing  
> them is
> something I want to initiate and let run in the background.
>
> Can anyone point me to the flaw in my code as I am at something of  
> a loss?
> Any help most gratefully recieved!
>
> Chris
> --
> View this message in context: http://n2.nabble.com/saving-stacks-to- 
> newly-created-folders-tp4612497p4612497.html
> Sent from the ImageJ mailing list archive at Nabble.com.