ij.plugin.filter.Analyzer.setMeasurement()方法的使用及代码示例

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

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

Analyzer.setMeasurement介绍

[英]Sets the specified system-wide measurement option.
[中]设置指定的系统范围测量选项。

代码示例

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

public void run(String arg) {
  String dir = IJ.getDirectory("Choose a Folder");
  if (dir==null) return;
  String[] list = (new File(dir)).list();
  if (list==null) return;
  Analyzer.setMeasurement(Measurements.LABELS, true);
  for (int i=0; i<list.length; i++) {
    if (list[i].startsWith(".")) continue;
    String path = dir + list[i];
    IJ.showProgress(i+1, list.length);
    IJ.redirectErrorMessages(true);
    ImagePlus imp = !path.endsWith("/")?IJ.openImage(path):null;
    IJ.redirectErrorMessages(false);
    if (imp!=null) {
      IJ.run(imp, "Measure", "");
      imp.close();
    } else if (!path.endsWith("/"))
      IJ.log("IJ.openImage() returned null: "+path);
  }
}

代码示例来源:origin: imagej/ImageJA

public void run(String arg) {
  String dir = IJ.getDirectory("Choose a Folder");
  if (dir==null) return;
  String[] list = (new File(dir)).list();
  if (list==null) return;
  Analyzer.setMeasurement(Measurements.LABELS, true);
  for (int i=0; i<list.length; i++) {
    if (list[i].startsWith(".")) continue;
    String path = dir + list[i];
    IJ.showProgress(i+1, list.length);
    IJ.redirectErrorMessages(true);
    ImagePlus imp = !path.endsWith("/")?IJ.openImage(path):null;
    IJ.redirectErrorMessages(false);
    if (imp!=null) {
      IJ.run(imp, "Measure", "");
      imp.close();
    } else if (!path.endsWith("/"))
      IJ.log("IJ.openImage() returned null: "+path);
  }
}

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

Prefs.blackBackground = state;
else if (arg1.startsWith("display lab"))
  Analyzer.setMeasurement(LABELS, state);
else if (arg1.startsWith("limit to"))
  Analyzer.setMeasurement(LIMIT, state);
else if (arg1.startsWith("add to"))
  Analyzer.setMeasurement(ADD_TO_OVERLAY, state);
else if (arg1.equals("area"))
  Analyzer.setMeasurement(AREA, state);
else if (arg1.equals("mean"))
  Analyzer.setMeasurement(MEAN, state);
else if (arg1.startsWith("perim"))
  Analyzer.setMeasurement(PERIMETER, state);
else if (arg1.equals("stack position"))
  Analyzer.setMeasurement(STACK_POSITION, state);
else if (arg1.startsWith("std"))
  Analyzer.setMeasurement(STD_DEV, state);
else if (arg1.equals("showrownumbers"))
  ResultsTable.getResultsTable().showRowNumbers(state);

代码示例来源:origin: imagej/ImageJA

Prefs.blackBackground = state;
else if (arg1.startsWith("display lab"))
  Analyzer.setMeasurement(LABELS, state);
else if (arg1.startsWith("limit to"))
  Analyzer.setMeasurement(LIMIT, state);
else if (arg1.startsWith("add to"))
  Analyzer.setMeasurement(ADD_TO_OVERLAY, state);
else if (arg1.equals("area"))
  Analyzer.setMeasurement(AREA, state);
else if (arg1.equals("mean"))
  Analyzer.setMeasurement(MEAN, state);
else if (arg1.startsWith("perim"))
  Analyzer.setMeasurement(PERIMETER, state);
else if (arg1.equals("stack position"))
  Analyzer.setMeasurement(STACK_POSITION, state);
else if (arg1.startsWith("std"))
  Analyzer.setMeasurement(STD_DEV, state);
else if (arg1.equals("showrownumbers"))
  ResultsTable.getResultsTable().showRowNumbers(state);

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

private void resetOptions() {
  // Reset plugin parameters
  Prefs.set(PREFS_KEY, null);
  currentBooleanPrefs = UNSET_PREFS;
  Prefs.set(HASHMAP_KEY, null);
  hashMapString = "";
  // Reset Sholl metrics and output options
  Prefs.set(METRICS_KEY, null);
  Prefs.set(METRICS_KEY + ".comment", null);
  Prefs.set(MASK_KEY, null);
  Prefs.set(MASK_KEY + ".type", null);
  setPlotOutput(DEFAULT_PLOT_OUTPUT);
  currentMetrics = UNSET_PREFS;
  commentString = null;
  maskBackground = UNSET_PREFS;
  maskType = UNSET_PREFS;
  // Reset Analyzer prefs
  Analyzer.setPrecision(3);
  Analyzer.setMeasurement(Measurements.SCIENTIFIC_NOTATION, false);
  // Reset other global IJ prefs
  Prefs.setThreads(Runtime.getRuntime().availableProcessors());
  Prefs.set("options.ext", null);
}

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

Prefs.set("options.ext", extension);
Analyzer.setPrecision(Math.min(Math.max((int) gd.getNextNumber(), 0), 9));
Analyzer.setMeasurement(Measurements.SCIENTIFIC_NOTATION, gd.getNextBoolean());

相关文章