本文整理汇总了Java中ij.gui.Plot.getProcessor方法的典型用法代码示例。如果您正苦于以下问题:Java Plot.getProcessor方法的具体用法?Java Plot.getProcessor怎么用?Java Plot.getProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.Plot
的用法示例。
在下文中一共展示了Plot.getProcessor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawFlinnPlot
import ij.gui.Plot; //导入方法依赖的package包/类
/**
* Display each ellipsoid's axis ratios in a scatter plot
*
* @param title
* @param ellipsoids
* @return
*/
private ImagePlus drawFlinnPlot(final String title, final Ellipsoid[] ellipsoids) {
final int l = ellipsoids.length;
final double[] aOverB = new double[l];
final double[] bOverC = new double[l];
for (int i = 0; i < l; i++) {
final double[] radii = ellipsoids[i].getSortedRadii();
aOverB[i] = radii[0] / radii[1];
bOverC[i] = radii[1] / radii[2];
}
final Plot plot = new Plot("Flinn Diagram of " + title, "b/c", "a/b");
plot.setLimits(0, 1, 0, 1);
plot.setSize(1024, 1024);
plot.addPoints(bOverC, aOverB, Plot.CIRCLE);
final ImageProcessor plotIp = plot.getProcessor();
final ImagePlus plotImage = new ImagePlus("Flinn Diagram of " + title, plotIp);
return plotImage;
}
示例2: showPlot
import ij.gui.Plot; //导入方法依赖的package包/类
/**
* Display a graph showing connectivity vs. threshold
*
* @param testThreshold
* @param conns
*/
private void showPlot(final double[] testThreshold, final double[] conns) {
// convert arrays to floats
final int nPoints = testThreshold.length;
final float[] xData = new float[nPoints];
final float[] yData = new float[nPoints];
double xMin = Double.MAX_VALUE;
double xMax = Double.MIN_VALUE;
double yMax = Double.MIN_VALUE;
for (int i = 0; i < nPoints; i++) {
xData[i] = (float) testThreshold[i];
yData[i] = (float) conns[i];
xMin = Math.min(xMin, xData[i]);
xMax = Math.max(xMax, xData[i]);
yMax = Math.max(yMax, yData[i]);
}
final Plot plot = new Plot("Connectivity vs. Threshold", "Threshold", "Connectivity", xData, yData);
plot.addPoints(xData, yData, Plot.CIRCLE);
plot.setLimits(xMin, xMax, 0, yMax);
plot.draw();
final ImageProcessor plotIp = plot.getProcessor();
final ImagePlus plotImage = new ImagePlus();
plotImage.setProcessor("Connectivity vs. Threshold", plotIp);
plotImage.show();
}
示例3: createGraph
import ij.gui.Plot; //导入方法依赖的package包/类
/**
* Create a graph for plotting anisotropy results
*
* @param id
* Identification string for Anisotropy plot
* @return ImagePlus for drawing a plot on
*/
private ImagePlus createGraph(final String id) {
final double[] x = { 0 }, y = { 0 };
final Plot plot = new Plot("Anisotropy", "Repeats", "Anisotropy", x, y);
plot.setLimits(0, 1, 0, 1);
final ImageProcessor plotIp = plot.getProcessor();
final ImagePlus plotImage = new ImagePlus("Anisotropy of " + id, plotIp);
plotImage.setProcessor(null, plotIp);
return plotImage;
}
示例4: updateGraph
import ij.gui.Plot; //导入方法依赖的package包/类
/**
* Draw on plotImage the data in anisotropyHistory with error bars from
* errorHistory
*
* @param plotImage
* the graph image
* @param anisotropyHistory
* all anisotropy results, 1 for each iteration
* @param errorHistory
* all error results, 1 for each iteration
*/
private void updateGraph(final ImagePlus plotImage, final Vector<Double> anisotropyHistory,
final Vector<Double> errorHistory) {
final double[] yVariables = new double[anisotropyHistory.size()];
final double[] xVariables = new double[anisotropyHistory.size()];
final Enumeration<Double> e = anisotropyHistory.elements();
int i = 0;
while (e.hasMoreElements()) {
yVariables[i] = e.nextElement();
xVariables[i] = i;
i++;
}
final Enumeration<Double> f = errorHistory.elements();
i = 0;
final double[] errorBars = new double[errorHistory.size()];
while (f.hasMoreElements()) {
errorBars[i] = f.nextElement();
i++;
}
final Plot plot = new Plot("Anisotropy", "Number of repeats", "Anisotropy", xVariables, yVariables);
plot.addPoints(xVariables, yVariables, Plot.X);
plot.addErrorBars(errorBars);
plot.setLimits(0, anisotropyHistory.size(), 0, 1);
final ImageProcessor plotIp = plot.getProcessor();
plotImage.setProcessor(null, plotIp);
return;
}