Featured image of post Using ImageJ to automate egg-counting

Using ImageJ to automate egg-counting

A note for myself concerning batch processing egg-counting in ImageJ.

Open ImageJ and record your processing steps:

Plugins -> Macro -> Record:

  1. Image -> type -> 8-bit
  2. CMD+Shift+T (Image->Adjust->Threshold: 100/255; Dark background; B&W)
  3. Process -> Find Maxima (Noise tolerance: 100, Output type: Count; Preview point selection)
  4. Save as

This gives a macro script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
run("8-bit");
name=getTitle;
run("In [+]");
setAutoThreshold("Default dark");
//run("Threshold...");
//setThreshold(100, 255);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Close");
run("Find Maxima...", "noise=100 output=Count light");
saveAs("Results", "/Users/zl3/Documents/ImageJ_automate/" + name + ".counts.csv");

To batch process:

Process -> Batch -> Macro (copy the recorded macro script into the textfield and process)

comments powered by Disqus
CC-BY-NC 4.0
Built with Hugo Theme Stack