Re: need advice on batch macros
Posted by
Nathaniel Ryckman on
May 17, 2011; 7:53pm
URL: http://imagej.273.s1.nabble.com/need-advice-on-batch-macros-tp3684525p3684526.html
olao4 wrote
Hello,
I have a very basic question, but since I never wrote a macro before I feel
really lost.
I need a simple macro that opens every separate file and that for every file
in a folder calculates its difference with a one specified picture and then
inverts it. I know how to do the difference: process>image calculator>
and how to invert ctrl+shift+i, however I do not know how to make it repeat
the function for every separate file, i.e. I do not know how to refer to my
files while writing the macro.
I would really appreciate your advice!
Oh, you will definitely need this as well!
fileName = File.getName(curDir);
selectWindow(fileName + ".tif");
Once you select a window, you can just run commands like you normally would.