本文整理汇总了Java中ij.measure.ResultsTable.columnExists方法的典型用法代码示例。如果您正苦于以下问题:Java ResultsTable.columnExists方法的具体用法?Java ResultsTable.columnExists怎么用?Java ResultsTable.columnExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.measure.ResultsTable
的用法示例。
在下文中一共展示了ResultsTable.columnExists方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResultsTable
import ij.measure.ResultsTable; //导入方法依赖的package包/类
/**
* Returns the instance of the ResultsTable.
*
* @return Instance of the ResultsTable
*/
public static Object getResultsTable(){
ResultsTable rt=Analyzer.getResultsTable();
int col=0;
int[] index=new int[ResultsTable.MAX_COLUMNS];
for (int cnt=0;cnt<ResultsTable.MAX_COLUMNS; cnt++) {
if (rt.columnExists(cnt)){
index[col]=cnt;
col++;
}
}
int counter=rt.getCounter();
double [][] results=new double[counter][col];
for( int i=0;i<col;i++) {
for( int j=0;j<counter;j++) {
results[j][i]=rt.getValueAsDouble(index[i],j);
}
}
return results;
}
示例2: getValue
import ij.measure.ResultsTable; //导入方法依赖的package包/类
protected Double getValue(ResultsTable rt, COLUMNS_PARTICLE column, int row) {
if (rt.columnExists(column.col)) {
return rt.getValueAsDouble(column.col, row);
} else {
return null;
}
}
示例3: getValue
import ij.measure.ResultsTable; //导入方法依赖的package包/类
/**
* @param rt
* @param circ
* @param i
* @param column
* @return
*/
protected double getValue(ResultsTable rt, int i, COLUMNS_PARTICLE column) {
double circ=0;
if (rt.columnExists(column.col)) {
circ = rt.getValueAsDouble(column.col, i);
}
return circ;
}
示例4: getValue
import ij.measure.ResultsTable; //导入方法依赖的package包/类
/**
* Checa se coluna existe nos resultados. Se sim, retorna valor.
*
* Evita erros
*
* @param rt
* @param column
* @param row
* @return
*/
protected Double getValue(ResultsTable rt, COLUMNS_PARTICLE column, int row) {
if (rt.columnExists(column.col)) {
return rt.getValueAsDouble(column.col, row);
} else {
return null;
}
}
示例5: getValue
import ij.measure.ResultsTable; //导入方法依赖的package包/类
/**
* recupera valor da tabela a partir de linha e columa
* @param rt
* @param circ
* @param i
* @param column
* @return
*/
protected double getValue(ResultsTable rt, int i, COLUMNS_PARTICLE column) {
double value=0;
if (rt.columnExists(column.col)) {
value = rt.getValueAsDouble(column.col, i);
}
return value;
}
示例6: getValue
import ij.measure.ResultsTable; //导入方法依赖的package包/类
/**
* Checa se coluna existe nos resultados. Se sim, retorna valor.
*
* Evita erros
*
* @param rt
* @param column
* @param row
* @return
*/
private Double getValue(ResultsTable rt, COLUMNS_PARTICLE column, int row) {
if (rt.columnExists(column.col)) {
return rt.getValueAsDouble(column.col, row);
} else {
return null;
}
}
示例7: sort
import ij.measure.ResultsTable; //导入方法依赖的package包/类
public static void sort(final ResultsTable table, final boolean ascending, final String... columns) {
Integer[] rowNumbers = new Integer[table.getCounter()];
for (int i = 0; i < rowNumbers.length; i++)
rowNumbers[i] = i;
Arrays.sort(rowNumbers, new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
for (String column: columns) {
if (table.getColumnIndex(column) != ResultsTable.COLUMN_NOT_FOUND) {
double value1 = table.getValue(column, o1);
double value2 = table.getValue(column, o2);
int difference = Double.compare(value1, value2);
if (difference != 0)
return ascending ? difference : -difference;
}
}
return 0;
}
});
// put all rows in the correct order (in-place)
for (int i = 0; i < rowNumbers.length; i++) {
int j = rowNumbers[i];
if (i != j) {
while (j < i) // element at position j was already swapped with another element; find out which element that was
j = rowNumbers[j];
// swap rows
for (int k = 0; k <= table.getLastColumn(); k++) {
if (table.columnExists(k)) {
double d = table.getValueAsDouble(k, i);
table.setValue(k, i, table.getValueAsDouble(k, j));
table.setValue(k, j, d);
}
}
}
}
table.updateResults();
}