Posted by
Crowell Elizabeth on
Apr 06, 2011; 2:22pm
URL: http://imagej.273.s1.nabble.com/Apply-to-all-files-tp3685140p3685141.html
Hello,
You are right, you want a recursive loop that uses getFileList, and this
macro is already available from the ImageJ website :
http://rsbweb.nih.gov/ij/macros/BatchProcessFolders.txtIn this macro, the "processFiles" function is the recursive loop that
goes through all folders and subfolders. Every time an image file is
encountered, the function "processFile" is run. Use of the countFiles
function is optional.
Normally you simply need to add a few lines in the "processFiles"
function for the commands you want to run on each image, and this macro
should work for you. Just let me know if you encounter any problem.
Kind Regards,
Elizabeth Crowell
Wilson R S (AT) a écrit :
> I am thinking someone would probably have already wrote this code/macro, but can't find it...
>
> I want to apply a macro to all files within a certain folder and all its subfolders. I can see how this works in theory with getFileList(Directory), but just can't seem to get the code quite rite.
>
> Any help would be much appreciated.
>
> Rhod
>
--
Elizabeth CROWELL
----------------------------------------------------------------------
Membrane Traffic and Cell Division Research Group
Institut Pasteur
28 rue du Dr Roux
75015 PARIS, France
Tel : 01.44.38.94.07
Fax : 01.45.68.89.54
----------------------------------------------------------------------