Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created November 18, 2020 09:42
Show Gist options
  • Save mutterer/5715ad5768e89c812ba32c5bb09d99ea to your computer and use it in GitHub Desktop.
Save mutterer/5715ad5768e89c812ba32c5bb09d99ea to your computer and use it in GitHub Desktop.
Measuring objects with or without holes
run("Fresh Start"); run("Blobs (25K)");
selectWindow('blobs.gif');setLocation(0, 100);
setThreshold(192, 255);
makeRectangle(56, 132, 68, 61);
run("To Selection");
doWand(80, 175);
run("Set Measurements...", "area redirect=None decimal=3");
run("Measure");
print(Table.get('Area',Table.size-1),'Measure, no options');
run("Set Measurements...", "area limit redirect=None decimal=3");
run("Measure");
print(Table.get('Area',Table.size-1),'Measure, limit to threshold');
run("Analyze Particles...", "display");
print(Table.get('Area',Table.size-1),'Analyze Particles, no options');
run("Analyze Particles...", "display include");
print(Table.get('Area',Table.size-1),'Analyze Particles, Include holes');
run("Analyze Particles...", "display add composite");
print(Table.get('Area',Table.size-1),'Analyze Particles, Composite ROIs');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment