Search in sources :

Example 11 with ResultsTable

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;
}
Also used : ResultsTable(ij.measure.ResultsTable) Analyzer(ij.plugin.filter.Analyzer)

Example 12 with ResultsTable

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());
    }
}
Also used : ResultsTable(ij.measure.ResultsTable)

Example 13 with ResultsTable

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);
    }
}
Also used : ResultsTable(ij.measure.ResultsTable)

Example 14 with ResultsTable

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");
}
Also used : ResultsTable(ij.measure.ResultsTable)

Example 15 with ResultsTable

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;
}
Also used : ResultsTable(ij.measure.ResultsTable)

Aggregations

ResultsTable (ij.measure.ResultsTable)22 HashMap (java.util.HashMap)3 Calibration (ij.measure.Calibration)2 Object3D (mcib3d.geom.Object3D)2 ImagePlus (ij.ImagePlus)1 GenericDialog (ij.gui.GenericDialog)1 Roi (ij.gui.Roi)1 Analyzer (ij.plugin.filter.Analyzer)1 TextWindow (ij.text.TextWindow)1 Project (ini.trakem2.Project)1 AreaContainer (ini.trakem2.display.AreaContainer)1 Displayable (ini.trakem2.display.Displayable)1 Profile (ini.trakem2.display.Profile)1 ZDisplayable (ini.trakem2.display.ZDisplayable)1 ProjectThing (ini.trakem2.tree.ProjectThing)1 ProjectTree (ini.trakem2.tree.ProjectTree)1 Menu (java.awt.Menu)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 ActionEvent (java.awt.event.ActionEvent)1