I'd like to write a macro with SE MTF Nyquist plugin in fiji for a stack or many images in a directory. But I have to set some parameter for every image in a setting window. Any ideas?
macro "TD2"{
inputFolder = getDirectory('');
outputFolder = gerDirectory('');
setBatchMode(true);
images = getFileList(inputFolder);
for ( i=0; i <images.length;i++){
inputPath = inputFolder + images[i];
open(inputPath);
makeRectangle(1632, 568, 684, 296);
run("SE MTF Nyquist");
outputPath = outputFolder + images[i];
save(outputPath);
close();
}
}
setBatchMode(false);
exit();
It depends if you want to use the same parameters, or different ones, for every image.
But before you tackle that question, you need to know if the macro can pass the parameters to the plugin. Some plugins are macro-recordable and some are not.
Try recording the command in the Macro Recorder and see if the parameters show up in the recorder window. If so, then you can replace them in your macro with the desired numbers or variables as needed.
If the plugin is not macro-friendly (that is, you just get the "run" command with no arguments as shown in your code), you could try to modify it following the guidelines in section 11 "Designing macro-aware plugins" in the macro programming guide.