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:

run("In [+]");
setAutoThreshold("Default dark");
//setThreshold(100, 255);
setOption("BlackBackground", true);
run("Convert to Mask");
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)

Z. Lu avatar
Z. Lu
Data science, bioinfo, scripting, parasites, retro, plain text.
comments powered by Disqus