We prefer to use the Fiji version of
ImageJ. This version is a distribution that comes pre-packaged with the
most popular ImageJ plugins. It also has a useful automatic update feature so that you are always using the most up-to-date versions of
these plugins. Additional plugins can be installed as in vanilla ImageJ
and also through the use of update sites.

Fiji also supports scripting using multiple programming languages (Java, Python, Ruby, Javascript) and ImageJ’s macro language.
The following is an example of how to write an ImageJ macro, which shows
how to make a “widefield” image from raw data captured on an NSIM
microscope.It illustrates a number of features of the macro language including dealing with stacks and hyperstacks, dealing with strings, looping, using ROIs and saving files.

getDimensions(w,h,channels,slices,frames);Stack.getPosition(channel,slice,frame);print(" Chanels: "+channels);print(" Slices: "+slices);print(" Frames: "+frames);// get total number of planesimageCount=channels*slices*frames;print(imageCount);// do the rest without the images visisble - batch modesetBatchMode(true);// get image titleraw=getTitle();rawid=getImageID();print(raw);// extract name and file extension for renaming latername=substring(raw,0,lengthOf(raw)-4);ext=substring(raw,lengthOf(name),lengthOf(raw));print(name);print(ext);phase_dir="C:\\Users\\Daniel\\Desktop\\phase_temp\\";projection_dir="C:\\Users\\Daniel\\Desktop\\proj_temp\\";// start of loopingindex=0;for(c=1;c<=channels;c++){for(z=1;z<=slices;z++){for(t=1;t<=frames;t++){print("processing image: ",index);// initialise xx=-512;// if we have multidimensional data we need to select the planeif(imageCount>1){selectImage(rawid);print("c,z,t: ",c,z,t);Stack.setPosition(c,z,t);}// loop over columns - phasesp=0;for(i=0;i<5;i++){x=x+512;y=-512;// loop over rows - rotationsfor(j=0;j<3;j++){y=y+512;//print(x,y);// grab the main windowselectWindow(raw);// make a rectangle ROImakeRectangle(x,y,512,512);// duplicate the regionrun("Duplicate..."," ");run("32-bit");rename("image-"+p);saveAs("tif",phase_dir+getTitle());close();p+=1;}}run("Image Sequence...","open=["+phase_dir+"image-0.tif] use");// sum all the slicesrun("Z Project...","projection=[Sum Slices]");// save the projectionczt=toString(c)+toString(z)+toString(t);print("c,z,t: ",c,z,t);saveAs("tif",projection_dir+czt+"_projection");close();selectWindow("phase_temp");close();index+=1;}}}// select the main window againselectWindow(raw);// close itclose();// if we have multi-dimensional data concantentate itif(imageCount>1){run("Image Sequence...","open=["+projection_dir+"000_projection.tif]");// set the correct dimensionsStack.setDimensions(channels,slices,frames);}else{open(projection_dir+"000_projection.tif");}rename(name+"_widefield");setBatchMode(false);