Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// example C. elegans image from:
// https://www.age.mpg.de/science/research-laboratories/antebi/
interval = 50;
open("https://www.age.mpg.de/fileadmin/_processed_/d/1/csm_Bild_Website_Antebi_8220cc62b1.jpg");
makeLine(350, 92, 370, 131);
run("Set Scale...", "known=30 unit=microns");
makeLine(49,138,108,125,165,67,293,138,409,92,558,114,654,61,737,42);
run("Fit Spline");
run("Interpolate", "interval=1 smooth");
getSelectionCoordinates(xp, yp);
run("Add Selection...","stroke=green width=3");
List.setMeasurements();
total = List.getValue("Length");
steps = (total/interval);
xm=newArray(steps+1);
ym=newArray(steps+1);
for (i=0;i<xm.length;i++) {
xm[i]=xp[i*xp.length/steps];
ym[i]=yp[i*xp.length/steps];
}
makeSelection("Point", xm, ym);
run("Point Tool...", "type=Dot color=Red size=[Extra Large] counter=0");
run("Add Selection...","");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.