Problems with defining options for enhance contrast /filter

Hello guys,

I am writting some macros to batch process a couple of Tb of 16bit .tiff 4 channel stacks.
I already created a post on problems when generating new folders. In doing so, I found out another issue.
The lines I am calling are not exactly doing the same as in manually selecting the options.
I’d like some help with the correct semantic for this, which keeps eluding me.
I need to run a 3d median filter of 1x1x1 pixel, then stretch the stack’s histogram to finally make the image 8 bits and save each channel separately.
Going over my lines I realized that I am not getting fiji to use the stack’s histogram but that of each individual slice. Does anyone know how to write that in?
That line looks like:

run("Enhance Contrast...", "saturated=0.03 Normalize Use Stack Histogram add stack");

Also, I wanted to make sure that if I run the median filter on the 4 channel image it will run on all channels and wondering if the same is true for enhance contrast. That line looks like that and runs:

run(“Median 3D…”, “xradius=1 yradius=1 zradius=1 add stack”)

Better safe than sorry, I don’t know if that’s the appropiate semantic to define each radius and I couldn’t find an example to be sure.
Right now, the complete analysis bit of the macro looks like this, it runs but won’t use stack histogram:

  run("Median 3D...", "xradius=1 yradius=1 zradius=1 add stack");
  run("Split Channels");
  selectWindow("C1-"+list[i]);
  run("Enhance Contrast...", "saturated=0.03 Normalize Use Stack Histogram add stack");
  saveAs(".tiff", dir4+"CtBP2");
  run("Close");
  selectWindow("C2-"+list[i]);
  run("Enhance Contrast...", "saturated=0.03 Normalize Use Stack Histogram add stack");
  run("8-bit", "add stack");
  saveAs(".tiff", dir4+"PSD95");
  run("Close");
  selectWindow("C3-"+list[i]);
  run("Enhance Contrast...", "saturated=0.03 Normalize Use Stack Histogram add stack");
  run("8-bit", "add stack");
  saveAs(".tiff", dir4+"Brn3a");
  run("Close");
  selectWindow("C4-"+list[i]);
  run("Enhance Contrast...", "saturated=0.03 Normalize Use Stack Histogram add stack");
  run("8-bit", "add stack");
  saveAs(".tiff", dir4+"Topro");
  run("Close");

All help apreciated,
Manuel

So, first problem solved. The line for enhance contrast to work should read:

run(“Enhance Contrast…”, “saturated=0.03 Normalize process_all use”);

If anyone has any input on the 3d median filter, let me know.

Thanks

If that is how you solved the first question, this is probably how you solve the second one:
run("Median 3D...", "x=1 y=1 z=1");

Did you use Plugin>Macro>Record to see what code is generated when manually performing the step?