//-- Set up examplerun("Close All");roiManager("reset");run("Blobs (25K)");makeLine(74,59,161,89);roiManager("Add");makeLine(72,157,179,124);roiManager("Add");makeLine(141,215,208,213);roiManager("Add");//-- get the numbernROI=roiManager("count");for(i=0;i<nROI;i++){roiManager("select",i);//-- Your code goes here as if you've selected the ROI//run("Measure");Roi.getCoordinates(xpoints,ypoints);x0=xpoints[0];setResult("Xi",i,x0);y0=ypoints[0];setResult("Yi",i,y0);x1=xpoints[xpoints.length-1];setResult("Xf",i,x1);y1=ypoints[ypoints.length-1];setResult("Yf",i,y1);d=sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));setResult("Displacement",i,d);updateResults;}
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.