Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created June 13, 2019 08:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mutterer/95cc6f027080674af68ca65fae8d1051 to your computer and use it in GitHub Desktop.
Save mutterer/95cc6f027080674af68ca65fae8d1051 to your computer and use it in GitHub Desktop.
// 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