package ij.plugin.filter;
import java.awt.Color;
import ij.*;
import ij.gui.*;
import ij.process.*;
import ij.plugin.filter.ParticleAnalyzer;
import ij.measure.*;
import ij.util.*;
/** Implements ImageJ's Analyze/Tools/Analyze Line Graph command. */
public class LineGraphAnalyzer implements PlugInFilter, Measurements {
ImagePlus imp;
public int setup(String arg, ImagePlus imp) {
this.imp = imp;
return DOES_8G+NO_CHANGES;
}
public void run(ImageProcessor ip) {
analyze(imp);
}
/** Uses ImageJ's particle analyzer to extract a set
of coordinate pairs from a digitized line graph. */
public void analyze(ImagePlus imp) {
ImageProcessor ip = imp.getProcessor();
ImageProcessor ip2 = ip.crop();
int width = ip2.getWidth();
int height = ip2.getHeight();
ip2.setColor(Color.white);
for (int i=1; i
Ads help maintain this website.