// This tool draws a line and overlays its profile macro "Line and Profile Tool -C037L0ff0G0e2b157581c1f000" { getCursorLoc(x, y, z, flags); xstart = x; ystart = y; x2=x; y2=y; while (true) { getCursorLoc(x, y, z, flags); if (flags&16==0) { Overlay.addSelection; exit; } if (x!=x2 || y!=y2) { makeLine(xstart, ystart, x, y); overlayProfile(xstart, ystart, x, y); } x2=x; y2=y; wait(30); }; } function overlayProfile(x1,y1,x2,y2) { Overlay.clear; p = getProfile(); Array.getStatistics(p, min, max, mean, stdDev); List.setMeasurements; text = 'length='+d2s(List.getValue('Length'),2)+', min='+d2s(min,2)+', max='+d2s(max,2); showStatus(text); setFont('SanSerif', 16, 'bold antialiased'); Overlay.moveTo(x1, y1); setColor(Roi.getDefaultColor); setLineWidth(2); for (i=0;i