import ij.*; import ij.plugin.*; import ij.plugin.filter.*; import ij.process.*; import ij.gui.*; import ij.measure.*; /** Calculates the mean, min, max and standard deviation of the pixel values along a straight line selection. */ public class Line_Analyzer implements PlugIn { static final String headings = " \tL-Mean\tL-Min\tL-Max\tL-StdDev\tL-Length\tL-Angle"; static int count; public void run(String arg) { if (IJ.versionLessThan("1.18o")) return; ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) {IJ.noImage(); return;} Roi roi = imp.getRoi(); if (!(roi!=null && roi.getType()==roi.LINE) ) {IJ.error("Straight line selection required."); return;} double angle = 0.0; if (roi.getType()==Roi.LINE) { Line line = (Line)roi; angle = roi.getAngle(line.x1, line.y1, line.x2, line.y2); } else if (roi.getType()==Roi.POLYLINE) angle = ((PolygonRoi)roi).getAngle(); double[] ddata = ((Line)roi).getPixels(); float[] fdata = new float[ddata.length]; for (int i=0; i