use of ij.measure.ResultsTable in project imagej1 by imagej.
the class Overlay method measure.
/**
* Measures the ROIs in this overlay on the specified image
* and returns the results as a ResultsTable.
*/
public ResultsTable measure(ImagePlus imp) {
ResultsTable rt = new ResultsTable();
for (int i = 0; i < size(); i++) {
Roi roi = get(i);
imp.setRoi(roi);
Analyzer analyzer = new Analyzer(imp, rt);
analyzer.measure();
}
imp.deleteRoi();
return rt;
}
use of ij.measure.ResultsTable in project imagej1 by imagej.
the class Opener method openTable.
/**
* Opens a tab or comma delimited text file.
*/
public static void openTable(String path) {
String name = "";
if (path == null || path.equals("")) {
OpenDialog od = new OpenDialog("Open Table...");
String dir = od.getDirectory();
name = od.getFileName();
if (name == null)
return;
else
path = dir + name;
}
try {
ResultsTable rt = ResultsTable.open(path);
if (rt != null) {
rt.showRowNumbers(false);
rt.show(name);
}
} catch (IOException e) {
IJ.error("Open Table", e.getMessage());
}
}
use of ij.measure.ResultsTable in project imagej1 by imagej.
the class Interpreter method finishUp.
void finishUp() {
if (batchMacro)
batchMacroImage = WindowManager.getCurrentImage();
func.updateDisplay();
instance = null;
if (!calledMacro || batchMacro) {
if (batchMode)
showingProgress = true;
batchMode = false;
imageTable = imageActivations = null;
WindowManager.setTempCurrentImage(null);
}
if (func.plot != null) {
func.plot.show();
func.plot = null;
}
if (showingProgress)
IJ.showProgress(0, 0);
if (keysSet) {
IJ.setKeyUp(KeyEvent.VK_ALT);
IJ.setKeyUp(KeyEvent.VK_SHIFT);
IJ.setKeyUp(KeyEvent.VK_SPACE);
}
if (rgbWeights != null)
ColorProcessor.setWeightingFactors(rgbWeights[0], rgbWeights[1], rgbWeights[2]);
if (func.writer != null)
func.writer.close();
func.roiManager = null;
if (func.resultsPending) {
ResultsTable rt = ResultsTable.getResultsTable();
if (rt != null && rt.size() > 0)
rt.show("Results");
}
if (IJ.isMacOSX() && selectCount > 0 && debugger == null) {
Frame frame = WindowManager.getFrontWindow();
if (frame != null && (frame instanceof ImageWindow))
ImageWindow.setImageJMenuBar((ImageWindow) frame);
}
}
use of ij.measure.ResultsTable in project imagej1 by imagej.
the class SimpleCommands method imageToResults.
private void imageToResults() {
ImagePlus imp = IJ.getImage();
ImageProcessor ip = imp.getProcessor();
ResultsTable rt = ResultsTable.createTableFromImage(ip);
rt.showRowNumbers(false);
rt.show("Results");
}
use of ij.measure.ResultsTable in project mcib3d-core by mcib3d.
the class Objects3DPopulationColocalisation method getResultsTable.
public ResultsTable getResultsTable(boolean useValueObject) {
if (needToComputeColoc)
computeColocalisation();
ResultsTable rt = new ResultsTable();
// first raw background 0
rt.incrementCounter();
rt.setLabel("BG1", 0);
rt.setValue("BG2", 0, colocs[0][0]);
for (int ib = 0; ib < population2.getNbObjects(); ib++) {
if (!useValueObject) {
rt.setValue("B" + (ib + 1), 0, colocs[0][indices2.get(population2.getObject(ib).getValue())]);
} else {
rt.setValue("B" + population2.getObject(ib).getValue(), 0, colocs[0][indices2.get(population2.getObject(ib).getValue())]);
}
}
for (int ia = 0; ia < population1.getNbObjects(); ia++) {
rt.incrementCounter();
if (!useValueObject) {
rt.setLabel("A" + (ia + 1), ia + 1);
} else {
rt.setLabel("A" + population1.getObject(ia).getValue(), ia + 1);
}
rt.setValue("BG2", ia + 1, colocs[indices1.get(population2.getObject(ia).getValue())][0]);
for (int ib = 0; ib < population2.getNbObjects(); ib++) {
if (!useValueObject) {
rt.setValue("B" + ib, (ia + 1), colocs[indices1.get(population1.getObject(ia).getValue())][indices2.get(population2.getObject(ib).getValue())]);
} else {
rt.setValue("B" + population2.getObject(ib).getValue(), ia + 1, colocs[indices1.get(population1.getObject(ia).getValue())][indices2.get(population2.getObject(ib).getValue())]);
}
}
}
return rt;
}
Aggregations