Normalize Local Contrast - not working in macro?

Hi everyone,

I’m trying to remove some noise from an infrared video. I’m using the Normalize Local Contrast plugin in Fiji/ImageJ (in Plugins / Integral Image Filters). It is working well in the interface mode: the resulting video is clearly less noisy.
So i tried to apply it in a macro (inspired by what I see in the macro recorder), in order to make it a batch processing. The macro runs without error or warning, writes a video file, but the resulting video file is identical to the original. Can someone tell me where I’m wrong?
Thanks in advance !

The Macro (“path” is generated by a previous part of the macro that scans the folder for a given string - that part works):

function NLC(path) {
if (endsWith(path, “END.avi”)) {
print(“ouverture du fichier avi”);
run(“AVI…”, “open=[path] use”);
print(“application de l’agorithme _NLC “);
run(“Normalize Local Contrast”, “block_radius_x=[1] block_radius_y=[1] standard_deviations=[1] stretch stack”);
print(“enregistrement en avi”);
run(“AVI… “, “compression=JPEG frame=15 save=[”+dir+list[i]+”_NLC.avi”+”]”);
print(“fermeture de la video”);

Good day!

Are you sure the condition

if (endsWith(path, “END.avi”)) { ... }

is literally fullfilled?



1 Like

Hi Herbie,
Thanks for your answer.
Yes, I’m sure that condition is fulfilled, because the macro does open a file and save a version of it at the end.
It wasn’t really clear in my first post, but the macro runs from some time and, in the end, saves a new file (with a different name) but that file is identical to the original one. I need to understand why it isnt’ transformed by the NLC plugin.

Voilà Thomas,

your code opens the AVI-file as a virtual stack and “Normalize Local Contrast” can’t process it with “stretch stack” option.






Hi Herbie,

Thanks a lot, that did the trick!
I wasn’t aware of the differences between open(path) and run(“AVI…”, “open=[path] use”)
It works now, and I learned something useful.

Thanks !