本文整理汇总了Java中ij.measure.ResultsTable.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java ResultsTable.getValue方法的具体用法?Java ResultsTable.getValue怎么用?Java ResultsTable.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.measure.ResultsTable
的用法示例。
在下文中一共展示了ResultsTable.getValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import ij.measure.ResultsTable; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == correctResultsButton) {
ResultsTable table = Analyzer.getResultsTable();
if (table == null) {
IJ.showMessage("No results table!");
return;
}
for (int i = 0; i < table.getCounter(); i++) {
double slice = table.getValue("slice", i);
double x = table.getValue("x", i) - polynomial(slice - 1, xParameters);
double y = table.getValue("y", i) - polynomial(slice - 1, yParameters);
table.setValue("x", i, x);
table.setValue("y", i, y);
}
table.show("Results");
}
else if (e.getSource() == correctImageButton) {
ImagePlus imp = IJ.getImage();
ImageStack stack = imp.getStack();
for (int i = 0; i < stack.getSize(); i++) {
ImageProcessor ip = stack.getProcessor(i + 1);
ip.setInterpolationMethod(ImageProcessor.BILINEAR);
double dx = -polynomial(i, xParameters);
double dy = -polynomial(i, yParameters);
ip.translate(dx, dy);
}
imp.show();
}
}
示例2: main
import ij.measure.ResultsTable; //导入方法依赖的package包/类
public static void main(String[] args) {
System.out.println("creating results table...");
ResultsTable rt = new ResultsTable();
for (int i = 0; i < 1e6; i++) {
rt.incrementCounter();
rt.setValue("x", i, (int)(Math.random() * 1000));
rt.setValue("y", i, (int)(Math.random() * 1000));
}
ResultsTableSorter.sort(rt, true, "x", "y");
// test table
System.out.println("testing results table...");
System.out.println("number of rows : " + rt.getCounter());
//System.out.println("x\ty");
//System.out.println(rt.getValue("x", 0) + "\t" + rt.getValue("y", 0));
for (int i = 1; i < rt.getCounter(); i++) {
//System.out.println(rt.getValue("x", i) + "\t" + rt.getValue("y", i));
int x1 = (int)rt.getValue("x", i - 1);
int x2 = (int)rt.getValue("x", i);
int y1 = (int)rt.getValue("y", i - 1);
int y2 = (int)rt.getValue("y", i);
if (x1 > x2) {
System.out.println("not sorted");
break;
}
if (x1 == x2 && y1 > y2) {
System.out.println("group not sorted");
break;
}
}
System.out.println("done");
}