Skip to content

Commit

Permalink
Short Macro to test all possible Autothreshold Methods of Imagej
Browse files Browse the repository at this point in the history
  • Loading branch information
amarcog authored Feb 24, 2023
1 parent 7ced96e commit 226980c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Test_all_Auto-Threshold-Methods.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This macro allows the display of all possible segmentations using the
// different threshold algorithms that are implemented in Fiji-Imagej

filename = getTitle();
subStringArray = split(filename, ".");
extension = subStringArray[lengthOf(subStringArray)-1]
titlewoext = replace(filename, "."+extension, "");
Auto_methods = newArray("Default", "Huang", "Intermodes", "IsoData", "IJ_IsoData", "Li", "MaxEntropy", "Mean", "MinError", "Minimum","Moments", "Otsu", "Percentile", "RenyiEntropy", "Shanbhag", "Triangle", "Yen");

function apply_Auto() {
run("Duplicate...", titlewoext+"-1."+extension);setAutoThreshold(Auto_methods[i]+" dark");rename(Auto_methods[i]);
}

for (i = 0; i < lengthOf(Auto_methods); i++) {
apply_Auto();
}

run("Tile");



0 comments on commit 226980c

Please sign in to comment.