/** Displays this profile plot in a window. */ public void createWindow() { Plot plot = getPlot(); if (plot!=null) plot.show(); }
/** Displays this profile plot in a window. */ public void createWindow() { Plot plot = getPlot(); if (plot!=null) plot.show(); }
/** * Plot the precision-recall curve * @param stats classification statistics */ public static void plotPrecisionRecall( ArrayList< ClassificationStatistics > stats) { // Extract precision and recall values float[] precision = new float[ stats.size() ]; float[] recall = new float[ stats.size() ]; for(int i = 0; i < precision.length; i++) { precision[i] = (float) stats.get(i).precision; recall[i] = (float) stats.get(i).recall; } Plot pl = new Plot("Precision-Recall curve", "Recall [tp / (tp + fn)]", "Precision [tp / (tp+fp)]", recall, precision); pl.setLimits(0, 1, 0, 1); pl.setSize(540, 512); pl.setColor(Color.GREEN); pl.show(); }
/** * Plot the Receiver operating characteristic curve * @param stats classification statistics */ public static void plotROC( ArrayList< ClassificationStatistics > stats) { // Extract true positive and true negative rates float[] tpr = new float[ stats.size() ]; float[] fpr = new float[ stats.size() ]; for(int i = 0; i < tpr.length; i++) { tpr[i] = (float) stats.get(i).recall; fpr[i] = (float) (1f - stats.get(i).specificity); } Plot pl = new Plot("Receiver Operating Characteristic curve", "False Positive Rate (1 - specificity)", "True Positive Rate or sensitivity", fpr, tpr ); pl.setLimits(0, 1, 0, 1); pl.setSize(540, 512); pl.setColor(Color.RED); pl.show(); }
/** * Plot the precision-recall curve * @param stats classification statistics */ public static void plotPrecisionRecall( ArrayList< ClassificationStatistics > stats) { // Extract precision and recall values float[] precision = new float[ stats.size() ]; float[] recall = new float[ stats.size() ]; for(int i = 0; i < precision.length; i++) { precision[i] = (float) stats.get(i).precision; recall[i] = (float) stats.get(i).recall; } Plot pl = new Plot("Precision-Recall curve", "Recall [tp / (tp + fn)]", "Precision [tp / (tp+fp)]", recall, precision); pl.setLimits(0, 1, 0, 1); pl.setSize(540, 512); pl.setColor(Color.GREEN); pl.show(); }
double showPlot() { if (plot!=null) { PlotWindow plotWindow = plot.show(); if (plotWindow!=null) plotID = plotWindow.getImagePlus().getID(); } plot = null; interp.getParens(); return Double.NaN; }
/** * Plot the Receiver operating characteristic curve * @param stats classification statistics */ public static void plotROC( ArrayList< ClassificationStatistics > stats) { // Extract true positive and true negative rates float[] tpr = new float[ stats.size() ]; float[] fpr = new float[ stats.size() ]; for(int i = 0; i < tpr.length; i++) { tpr[i] = (float) stats.get(i).recall; fpr[i] = (float) (1f - stats.get(i).specificity); } Plot pl = new Plot("Receiver Operating Characteristic curve", "False Positive Rate (1 - specificity)", "True Positive Rate or sensitivity", fpr, tpr ); pl.setLimits(0, 1, 0, 1); pl.setSize(540, 512); pl.setColor(Color.RED); pl.show(); }
double showPlot() { if (plot!=null) { PlotWindow plotWindow = plot.show(); if (plotWindow!=null) plotID = plotWindow.getImagePlus().getID(); } plot = null; interp.getParens(); return Double.NaN; }
public void run(String arg) { if (arg.equals("set")) {doOptions(); return;} imp = IJ.getImage(); if (firstTime) plotVertically = Prefs.verticalProfile || IJ.altKeyDown(); Plot plot = getPlot(); firstTime = false; if (plot==null) return; plot.setPlotMaker(this); plot.show(); }
public void run(String arg) { if (arg.equals("set")) {doOptions(); return;} imp = IJ.getImage(); if (firstTime) plotVertically = Prefs.verticalProfile || IJ.altKeyDown(); Plot plot = getPlot(); firstTime = false; if (plot==null) return; plot.setPlotMaker(this); plot.show(); }
plot.show();
/** Saves plot according to imgPath */ private void savePlot(final Plot plot, final int shollChoice) { if (!validPath || (validPath && !hideSaved)) plot.show(); if (validPath && save) { Recorder.disablePathRecording(); final String path = imgPath + getDescription() + "_ShollPlot" + SHOLL_TYPES[shollChoice] + ".tif"; IJ.saveAs(plot.getImagePlus(), "tiff", path); } }
public void run(String arg) { imp = IJ.getImage(); if (imp.getStackSize()<2) { IJ.error("ZAxisProfiler", "This command requires a stack."); return; } isPlotMaker = true; Plot plot = getPlot(); if (plot!=null) { if (isPlotMaker) plot.setPlotMaker(this); plot.show(); } }
public void run(String arg) { imp = IJ.getImage(); if (imp.getStackSize()<2) { IJ.error("ZAxisProfiler", "This command requires a stack."); return; } isPlotMaker = true; Plot plot = getPlot(); if (plot!=null) { if (isPlotMaker) plot.setPlotMaker(this); plot.show(); } }
double updatePlot() { if (plot!=null) { ImagePlus plotImage = WindowManager.getImage(plotID); ImageWindow win = plotImage!=null?plotImage.getWindow():null; if (win!=null) ((PlotWindow)win).drawPlot(plot); else { PlotWindow plotWindow = plot.show(); if (plotWindow!=null) plotID = plotWindow.getImagePlus().getID(); } } plot = null; interp.getParens(); return Double.NaN; }
double updatePlot() { if (plot!=null) { ImagePlus plotImage = WindowManager.getImage(plotID); ImageWindow win = plotImage!=null?plotImage.getWindow():null; if (win!=null) ((PlotWindow)win).drawPlot(plot); else { PlotWindow plotWindow = plot.show(); if (plotWindow!=null) plotID = plotWindow.getImagePlus().getID(); } } plot = null; interp.getParens(); return Double.NaN; }
/** Plots a histogram of this image using the specified number of bins and returns the PlotWindow. */ public PlotWindow plotHistogram(int bins) { ImageStatistics stats = getStatistics(AREA+MEAN+MODE+MIN_MAX, bins); Plot plot = new Plot("Hist_"+getTitle(), "Value", "Frequency"); plot.setColor("black", "#999999"); plot.setFont(new Font("SansSerif",Font.PLAIN,14)); double[] y = stats.histogram(); int n = y.length; double[] x = new double[n]; int bits = getBitDepth(); boolean eightBit = bits==8 || bits==24; double min = !eightBit?stats.min:0; for (int i=0; i<n; i++) x[i] = min+i*stats.binSize; plot.add("bar", x, y); if (bins!=256) plot.addLegend(bins+" bins", "auto"); if (eightBit) plot.setLimits(0,256,0,Double.NaN); return plot.show(); }
/** Plots a histogram of this image using the specified number of bins and returns the PlotWindow. */ public PlotWindow plotHistogram(int bins) { ImageStatistics stats = getStatistics(AREA+MEAN+MODE+MIN_MAX, bins); Plot plot = new Plot("Hist_"+getTitle(), "Value", "Frequency"); plot.setColor("black", "#999999"); plot.setFont(new Font("SansSerif",Font.PLAIN,14)); double[] y = stats.histogram(); int n = y.length; double[] x = new double[n]; int bits = getBitDepth(); boolean eightBit = bits==8 || bits==24; double min = !eightBit?stats.min:0; for (int i=0; i<n; i++) x[i] = min+i*stats.binSize; plot.add("bar", x, y); if (bins!=256) plot.addLegend(bins+" bins", "auto"); if (eightBit) plot.setLimits(0,256,0,Double.NaN); return plot.show(); }
plot.addPoints(sizes, boxCountSums, PlotWindow.CIRCLE); plot.addLabel(0.8, 0.2, label); plot.show(); return D;
plot.addPoints(grid, driftY, Plot.LINE); plot.addLabel(0.05, 0.9, "y drift"); plot.show();