/* Next step is to save all 1st and 2nd shortest pairs with their distances. If distance greater than certain criteria, such as 15% longer than avg dist, then sever it. Then sort into clusters and do convex hull. Michael Cammer 20150707 for ImageJ 1.50a */ var shortestColor1 = "yellow"; var shortestColor2 = "ff8000"; var shortestColor3 = "0080ff"; macro "shortest and 2nd shortest [q]" { run("Select None"); // This part of the macro gets the XY locations of the points. It could // be replaced with some other method such as opening a text file or measuring // centroids of objects by some other method. run("Clear Results"); run("Set Measurements...", "centroid redirect=None decimal=3"); run("Find Maxima...", "noise=10 output=List"); x = newArray(nResults()); y = newArray(nResults()); for(row=0; row