ij.plugin.filter.Analyzer类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中ij.plugin.filter.Analyzer类的一些代码示例,展示了Analyzer类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer类的具体详情如下:
包路径:ij.plugin.filter.Analyzer
类名称:Analyzer

Analyzer介绍

[英]This plugin implements ImageJ's Analyze/Measure and Analyze/Set Measurements commands.
[中]该插件实现ImageJ的分析/测量和分析/设置测量命令。

代码示例

代码示例来源:origin: net.imagej/ij

public String getTitle() {
  if (title==null && this==Analyzer.getResultsTable())
    title = "Results";
  return title;
}

代码示例来源:origin: ca.mcgill/Sholl_Analysis

/**
 * Retrieves precision according to {@code Analyze>Set Measurements...}
 *
 * @return the number of decimal digits to be used in tables
 */
protected int getScientificNotationAwarePrecision() {
  final boolean sNotation = (Analyzer.getMeasurements() & Measurements.SCIENTIFIC_NOTATION) != 0;
  int precision = Analyzer.getPrecision();
  if (sNotation)
    precision = -precision;
  return precision;
}

代码示例来源:origin: net.imagej/ij

public int setup(String arg, ImagePlus imp) {
  this.arg = arg;
  this.imp = imp;
  IJ.register(Analyzer.class);
  if (arg.equals("set")) {
    doSetDialog();
    return DONE;
  } else if (arg.equals("sum")) {
    summarize();
    return DONE;
  } else if (arg.equals("clear")) {
    if (IJ.macroRunning())
      unsavedMeasurements = false;
    resetCounter();
    return DONE;
  } else
    return DOES_ALL+NO_CHANGES;
}

代码示例来源:origin: net.imagej/ij

public void run(ImageProcessor ip) {
  measure();
  Roi roi = imp.getRoi();
  if (roi==null || roi.getType()!=Roi.POINT)
    displayResults();
  if ((measurements&ADD_TO_OVERLAY)!=0)
    addRoiToOverlay();
}

代码示例来源:origin: sc.fiji/Stack_Manipulation

float[] values = new float[size];
Calibration cal = imp.getCalibration();
Analyzer analyzer = new Analyzer(imp);
int measurements = analyzer.getMeasurements();
boolean showResults = measurements!=0 && measurements!=LIMIT;
boolean showingLabels = (measurements&LABELS)!=0;
measurements |= MEAN;
if (showResults) {
  if (!analyzer.resetCounter())
    return null;
  ip.setRoi(roi);
  ImageStatistics stats = ImageStatistics.getStatistics(ip, measurements, cal);
  analyzer.saveResults(stats, roi);
  if (showResults)
    analyzer.displayResults();
  values[i-1] = (float)stats.mean;

代码示例来源:origin: net.imagej/ij

ip.snapshot();
ip.setProgressBar(null);
if (Analyzer.isRedirectImage()) {
  redirectImp = Analyzer.getRedirectImage(imp);
  if (redirectImp==null) return false;
  int depth = redirectImp.getStackSize();
  measurements = Analyzer.getMeasurements();
      IJ.run("Clear Results");
      ((TextWindow)table).close();
      rt = Analyzer.getResultsTable();
    rt = Analyzer.getResultsTable();
analyzer = new Analyzer(imp, measurements, rt);
if (resetCounter && slice==1 && rt.size()>0) {
  if (!Analyzer.resetCounter())
    return false;
beginningCount = Analyzer.getCounter();

代码示例来源:origin: sc.fiji/Color_Histogram

public void printResults(){
   ResultsTable rt = Analyzer.getResultsTable();
   if (rt == null) {
     rt = new ResultsTable();
     Analyzer.setResultsTable(rt);
   }
   IJ.run("Clear Results", "");
   String[] channels = {"red", "green", "blue"};
   for (int i = 0; i < 3; i++) {
     rt.incrementCounter();
     rt.addValue("channel", channels[i]);
     rt.addValue("mean", histMean[i]);
     rt.addValue("mode", histModeCnt[i]);
     rt.addValue("std.dev.", histStdev[i]);
   }
   rt.show("Results");
}

代码示例来源:origin: net.imagej/ij

private static ResultsTable multiMeasure(ImagePlus imp, Roi[] rois, boolean appendResults) {
  int nSlices = imp.getStackSize();
  Analyzer aSys = new Analyzer(imp); // System Analyzer
  ResultsTable rtSys = Analyzer.getResultsTable();
  ResultsTable rtMulti = new ResultsTable();
  rtMulti.showRowNumbers(true);
    imp.setSliceWithoutUpdate(sliceUse);
    rtMulti.incrementCounter();
    if ((Analyzer.getMeasurements()&Measurements.LABELS)!=0)
      rtMulti.addLabel("Label", imp.getTitle());
    int roiIndex = 0;
      imp.setRoi(rois[i]);
      roiIndex++;
      aSys.measure();
      for (int j=0; j<=rtSys.getLastColumn(); j++){
        float[] col = rtSys.getColumn(j);

代码示例来源:origin: net.imagej/ij

windowTitle = "Results";
title = windowTitle;
if (!windowTitle.equals("Results") && this==Analyzer.getResultsTable())
  IJ.log("ResultsTable.show(): the system ResultTable should only be displayed in the \"Results\" window.");
String tableHeadings = getColumnHeadings();        
  if (this!=Analyzer.getResultsTable())
    Analyzer.setResultsTable(this);
  if (size()>0)
    Analyzer.setUnsavedMeasurements(true);
} else {
  Frame frame = WindowManager.getFrame(windowTitle);

代码示例来源:origin: net.imagej/ij

private void init() {
  int p = Analyzer.getPrecision();
  if (p>precision)
    precision = (short)p;
  for (int i=0; i<decimalPlaces.length; i++)
    decimalPlaces[i] = AUTO_FORMAT;
}

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

public void addToResultsTable() {
  final ResultsTable rt = Analyzer.getResultsTable();
  if (!Analyzer.resetCounter())
    return;
  rt.incrementCounter();
  rt.addValue("Filename", getOriginalFilename());
  rt.addValue("All paths used", String.valueOf(useAllPaths));
  rt.addValue("Paths used", numberOfPathsUsed);
  rt.addValue("Sphere separation", sphereSeparation);
  rt.addValue("Normalization", normalization);
  rt.addValue("Axes", axes);
  rt.addValue("Max inters. radius", getCriticalValue());
  rt.addValue("Max inters.", getDendriteMaximum());
  rt.addValue("Regression coefficient", getShollRegressionCoefficient());
  rt.addValue("Regression gradient", getRegressionGradient());
  rt.addValue("Regression intercept", getRegressionIntercept());
  rt.show("Results");
}

代码示例来源:origin: net.imagej/ij

/** Converts a y-coordinate in pixels to physical units (e.g. mm),
   taking into account the invertY and global "Invert Y Coordinates" flags. */
 public double getY(double y, int imageHeight) {
   if (invertY || (Analyzer.getMeasurements()&Measurements.INVERT_Y)!=0) {
    if (yOrigin!=0.0)
      return (yOrigin-y)*pixelHeight;
    else
      return (imageHeight-y-1)*pixelHeight;
  } else
      return (y-yOrigin)*pixelHeight;
}

代码示例来源:origin: net.imagej/ij

if (title!=null && title.equals("Results")) {
  IJ.setTextPanel(null);
  Analyzer.setUnsavedMeasurements(false);
  Analyzer.setResultsTable(null);
  Analyzer.resetCounter();

代码示例来源:origin: net.imagej/ij

String lastHdr = rt.getColumnHeading(ResultsTable.LAST_HEADING);
if (lastHdr==null || lastHdr.charAt(0)!='M') {
  if (!reset()) return;
  measurePoint(roi);
  return;
  measureLength(roi);
  return;
  measureAngle(roi);
  return;
if (isRedirectImage()) {
  stats = getRedirectStats(measurements, roi);
  if (stats==null) return;
} else
  stats = imp.getStatistics(measurements);
if (!IJ.isResultsWindow() && IJ.getInstance()!=null)
  reset();
saveResults(stats, roi);

代码示例来源:origin: net.imagej/ij

void measurePoint(Roi roi) {
  if (rt.size()>0) {
    if (!IJ.isResultsWindow())
      reset();
    int index = rt.getColumnIndex("X");
    if (index<0 || !rt.columnExists(index)) {
      clearSummary();
      rt.update(measurements, imp, roi);
  ImagePlus imp2 = isRedirectImage()?getRedirectImageOrStack(imp):null;
  if (imp2==null) imp2 = imp;
  ImageStack stack = null;
    saveResults(stats, point);
    displayResults();

代码示例来源:origin: net.imagej/ij

if (indexes.length==0)
  return false;
int measurements = Analyzer.getMeasurements();
  if (appendResults && mmResults2!=null)
    rt = mmResults2;
  Analyzer analyzer = new Analyzer(imp, measurements2, rt);
  analyzer.disableReset(true);
  for (int slice=1; slice<=nSlices; slice++) {
    if (nSlices>1) imp.setSliceWithoutUpdate(slice);
    for (int i=0; i<indexes.length; i++) {
      if (restoreWithoutUpdate(imp, indexes[i]))
        analyzer.measure();
      else
        break;

代码示例来源:origin: net.imagej/ij

Analyzer.resetCounter();
ResultsTable rt = ResultsTable.getResultsTable();
for (int i=0; i<npoints; i++) {
rt.incrementCounter();
rt.setValue("Count", rt.size()-1, npoints);
int measurements = Analyzer.getMeasurements();
if ((measurements&Measurements.LABELS)!=0) {
  String s = imp.getTitle();

代码示例来源:origin: net.imagej/ij

int getColumnCount(ImagePlus imp, int measurements) {
  ImageStatistics stats = imp.getStatistics(measurements);
  ResultsTable rt = new ResultsTable();
  rt.showRowNumbers(true);
  Analyzer analyzer = new Analyzer(imp, measurements, rt);
  analyzer.saveResults(stats, null);
  int count = 0;
  for (int i=0; i<=rt.getLastColumn(); i++) {
    float[] col = rt.getColumn(i);
    String head = rt.getColumnHeading(i);
    if (head!=null && col!=null)
      count++;
  }
  return count;
}

代码示例来源:origin: net.imagej/ij

if (Analyzer.addToOverlay())
  ResultsTable.selectRow(roi);
return Double.NaN;
ResultsTable rt = overlay.measure(imp);
if (IJ.getInstance()==null)
  Analyzer.setResultsTable(rt);
else
  rt.show("Results");

代码示例来源:origin: net.imagej/ij

boolean reset() {
  boolean ok = true;
  if (rt.size()>0 && !disableReset)
    ok = resetCounter();
  if (ok && rt.getColumnHeading(ResultsTable.LAST_HEADING)==null)
    rt.setDefaultHeadings();
  return ok;
}

相关文章