Binning in Jython script and ij module docs

Hello everyone,

I am trying to write a jython script that goes through my files in a directory hierarchy and does 4 things: 1.Load the image. 2. Max intensity Z project the image. 3. Bin the Image. 4. Save as .tif
I am generally on a good way. I can os.walk through the directory tree without problem and I can load images through from ij.plugin import ZProjector. I found the ij module and I also found out that I can get at the ZProjector with

from ij.plugin import ZProjector

Now I need to do binning and I just cannot find the command. I am fine with what is under Image>>>Transform>>>Bin…
I just cannot find it. Actually I cannot find any documentation whatsoever on the ij python module (I’m just assuming it’s somewhere in there). I found several tutorials but zero documentation. Any help would be greatly appreciated.

Best,
Daniel

Use the macro recorder to record your process in BeanShell or JavaScript (Jython is not available but the commands are similar) to find the required commands:

https://imagej.nih.gov/ij/docs/guide/146-31.html#sub:Record

Thanks for the quick help. The macro recorder gave me:

IJ.run(img, “Bin…”, “x=2 y=2 bin=Average”);

It actually works unchanged in jython and seems to be doing what I expected.

Best,
Daniel