use of ij.gui.Plot in project GDSC-SMLM by aherbert.
the class BackgroundEstimator method plot.
private void plot(WindowOrganiser wo, double[] xvalues, double[] data1, double[] data2, double[] data3, String title, String title1, String title2, String title3) {
// Get limits
final double[] xlimits = MathUtils.limits(xvalues);
double[] ylimits = MathUtils.limits(data1);
ylimits = MathUtils.limits(ylimits, data2);
if (data3 != null) {
ylimits = MathUtils.limits(ylimits, data3);
}
title = imp.getTitle() + " " + title;
final Plot plot = new Plot(title, "Slice", title);
double range = ylimits[1] - ylimits[0];
if (range == 0) {
range = 1;
}
plot.setLimits(xlimits[0], xlimits[1], ylimits[0] - 0.05 * range, ylimits[1] + 0.05 * range);
plot.setColor(Color.blue);
plot.addPoints(xvalues, data1, Plot.LINE);
plot.draw();
Statistics stats = Statistics.create(data1);
@SuppressWarnings("resource") final Formatter label = new Formatter().format("%s (Blue) = %s +/- %s", title1, MathUtils.rounded(stats.getMean()), MathUtils.rounded(stats.getStandardDeviation()));
plot.setColor(Color.red);
plot.addPoints(xvalues, data2, Plot.LINE);
stats = Statistics.create(data2);
label.format(", %s (Red) = %s +/- %s", title2, MathUtils.rounded(stats.getMean()), MathUtils.rounded(stats.getStandardDeviation()));
if (data3 != null) {
plot.setColor(Color.green);
plot.addPoints(xvalues, data3, Plot.LINE);
stats = Statistics.create(data3);
label.format(", %s (Green) = %s +/- %s", title3, MathUtils.rounded(stats.getMean()), MathUtils.rounded(stats.getStandardDeviation()));
}
plot.setColor(Color.black);
plot.addLabel(0, 0, label.toString());
ImageJUtils.display(title, plot, wo);
}
use of ij.gui.Plot in project GDSC-SMLM by aherbert.
the class BlinkEstimator method plot.
private static void plot(String xAxisTitle, String yAxisTitle, double[] x, double[] y) {
final String title = TITLE + " " + yAxisTitle;
final Plot plot = new Plot(title, xAxisTitle, yAxisTitle);
plot.addPoints(x, y, Plot.LINE);
ImageJUtils.display(title, plot);
}
use of ij.gui.Plot in project vcell by virtualcell.
the class PlotImageStats method run.
@Override
public void run() {
Plot plot = new ColorPlot("Frame mean intensity", "Time", "Mean intensity");
StringBuilder legendLabels = new StringBuilder();
for (int i = 0; i < datasets.size(); i++) {
RandomAccessibleInterval<T> data = datasets.get(i);
if (data instanceof Dataset) {
legendLabels.append(((Dataset) data).getName());
legendLabels.append(": ");
}
Pair<double[], double[]> xyPair = (Pair<double[], double[]>) ops.run("imageStatsForPlotting", ImageStatsForPlotting.MEAN, data, mask);
plot.addPoints(xyPair.getA(), xyPair.getB(), Plot.LINE);
legendLabels.append("ROI ");
legendLabels.append(i + 1);
legendLabels.append("\n");
}
plot.addLegend(legendLabels.toString());
plot.show();
}
use of ij.gui.Plot in project vcell by virtualcell.
the class PlotROIStats method run.
@Override
public void run() {
Plot plot = new ColorPlot("ROI Mean Intensity", "Time", "Mean Intensity");
StringBuilder legendLabels = new StringBuilder();
for (RandomAccessibleInterval<T> data : datasetROIsMap.keySet()) {
if (data instanceof Dataset) {
legendLabels.append(((Dataset) data).getName());
legendLabels.append(": ");
}
List<Overlay> overlays = datasetROIsMap.get(data);
for (int i = 0; i < overlays.size(); i++) {
Overlay overlay = overlays.get(i);
RandomAccessibleInterval<T> cropped = crop(data, overlay);
Pair<double[], double[]> xyPair = (Pair<double[], double[]>) ops.run("imageStatsForPlotting", ImageStatsForPlotting.MEAN, cropped);
plot.addPoints(xyPair.getA(), xyPair.getB(), Plot.LINE);
legendLabels.append("ROI ");
legendLabels.append(i + 1);
legendLabels.append("\n");
}
}
plot.addLegend(legendLabels.toString());
plot.show();
}
use of ij.gui.Plot in project mcib3d-core by mcib3d.
the class ArrayUtil method getPlot.
public Plot getPlot(String title, String xLabel, String yLabel) {
double[] xVal = new double[size];
for (int i = 0; i < xVal.length; i++) {
xVal[i] = i;
}
Plot plot = new Plot(title, xLabel, yLabel, xVal, values);
plot.draw();
return plot;
}
Aggregations