Java Code Examples for ij.measure.ResultsTable#getLastColumn()

The following examples show how to use ij.measure.ResultsTable#getLastColumn() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResultsBuilder.java    From MorphoLibJ with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Add a results table to the already existing table.
 * @param rt table to add
 * @return current results builder
 */
public ResultsBuilder addResult (ResultsTable rt) {
	// Keep the label and everything in the same order as before, but just append whatever columns do not exist yet
	if(allResults.size() == rt.size() ) {
		for(int c=0; c<=rt.getLastColumn(); c++) {
			String colName = rt.getColumnHeading(c);
			if( !allResults.columnExists(colName)) {
				for(int i=0; i<rt.getCounter(); i++) {
					allResults.setValue(colName, i, rt.getValue(colName, i)); // Currently only supports numbered results...
				}
			}
		}
	} else { // Overwrite
		this.allResults = rt;
	}
	
	return this;
}
 
Example 2
Source File: InteractivePlotter.java    From Scripts with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Retrieves a list of column choices for the specified ResultsTable. The
 * "Label" column (containing non-numeric data) is excluded).
 */
private String[] getColumnChoices(final ResultsTable table) {
	final int n = table.getLastColumn();
	final String[] cChoices = new String[n + 2];
	for (int i = 0; i <= n; i++)
		cChoices[i] = table.getColumnHeading(i);
	cChoices[n + 1] = "*None*";
	return cChoices;
}
 
Example 3
Source File: LabelToValuePlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static final boolean hasRowLabelColumn(ResultsTable table)
{
    return table.getLastColumn() == (table.getHeadings().length-2);
}
 
Example 4
Source File: DrawTableValuesPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static final boolean hasRowLabelColumn(ResultsTable table)
{
    return table.getLastColumn() == (table.getHeadings().length-2);
}