Search in sources :

Example 11 with Object3D

use of mcib3d.geom.Object3D in project mcib3d-core by mcib3d.

the class TrackingAssociation method getResultsTableAssociation.

public ResultsTable getResultsTableAssociation() {
    if (finalAssociations == null)
        computeTracking();
    // create results table
    ResultsTable table = new ResultsTable();
    // list associations
    int row = table.getCounter();
    for (AssociationPair pair : finalAssociations) {
        int val1 = pair.getObject3D1().getValue();
        int val2 = pair.getObject3D2().getValue();
        double cost = pair.getAsso();
        // table
        table.setValue("Label1", row, val1);
        table.setValue("Label2", row, val2);
        table.setValue("Cost", row, cost);
        row++;
    }
    // orphan1
    row = table.getCounter();
    for (Object3D object3D : finalOrphan1) {
        table.setValue("Label1", row, object3D.getValue());
        table.setValue("Label2", row, 0);
        table.setValue("CostAsso", row, 0);
        row++;
    }
    // orphan2
    row = table.getCounter();
    for (Object3D object3D : finalOrphan2) {
        table.setValue("Label1", row, 0);
        table.setValue("Label2", row, object3D.getValue());
        table.setValue("CostAsso", row, 0);
        row++;
    }
    return table;
}
Also used : ResultsTable(ij.measure.ResultsTable) Object3D(mcib3d.geom.Object3D)

Example 12 with Object3D

use of mcib3d.geom.Object3D in project mcib3d-core by mcib3d.

the class Association method getOrphan1Population.

public Objects3DPopulation getOrphan1Population() {
    Objects3DPopulation pop = new Objects3DPopulation();
    for (String orphanS : getOrphan1()) {
        int val = Integer.parseInt(orphanS);
        Object3D object3D1 = population1.getObjectByValue(val);
        pop.addObject(object3D1);
    }
    return pop;
}
Also used : Objects3DPopulation(mcib3d.geom.Objects3DPopulation) Object3D(mcib3d.geom.Object3D)

Example 13 with Object3D

use of mcib3d.geom.Object3D in project mcib3d-core by mcib3d.

the class Association method getAssociationTable.

@Deprecated
public ResultsTable getAssociationTable() {
    ResultsTable rt = ResultsTable.getResultsTable();
    if (rt == null)
        rt = new ResultsTable();
    // normal asso
    int row = rt.getCounter();
    for (String s : CostsOK.keySet()) {
        Object3D object3D1 = getObject3D1fromAsso(s);
        Object3D object3D2 = getObject3D2fromAsso(s);
        rt.setValue("Label1", row, object3D1.getValue());
        rt.setValue("Label2", row, object3D2.getValue());
        rt.setValue("CostAsso", row, CostsOK.get(s));
        row++;
    }
    // orphan1
    row = rt.getCounter();
    for (String s : getOrphan1()) {
        rt.setValue("Label1", row, s);
        rt.setValue("Label2", row, 0);
        rt.setValue("CostAsso", row, 0);
        row++;
    }
    // orphan2
    row = rt.getCounter();
    for (String s : getOrphan2()) {
        rt.setValue("Label1", row, 0);
        rt.setValue("Label2", row, s);
        rt.setValue("CostAsso", row, 0);
        row++;
    }
    return rt;
}
Also used : ResultsTable(ij.measure.ResultsTable) Object3D(mcib3d.geom.Object3D)

Example 14 with Object3D

use of mcib3d.geom.Object3D in project mcib3d-core by mcib3d.

the class Association method drawOrphan2.

@Deprecated
public void drawOrphan2(ImageHandler draw) {
    if (CostsAll == null)
        computeAssociation();
    // orphan2
    for (String orphan : Orphan2) {
        int val = Integer.parseInt(orphan);
        Object3D object3D2 = population2.getObjectByValue(val);
        object3D2.draw(draw);
    }
}
Also used : Object3D(mcib3d.geom.Object3D)

Example 15 with Object3D

use of mcib3d.geom.Object3D in project mcib3d-core by mcib3d.

the class Association method drawAssociationPath.

@Deprecated
public void drawAssociationPath(ImageHandler draw, ImageHandler path, ImageHandler track) {
    if (CostsAll == null)
        computeAssociation();
    // normal association
    for (String a : CostsOK.keySet()) {
        int[] vals = Association.getValues(a);
        int val1 = vals[0];
        int val2 = vals[1];
        Object3D object3D2 = population2.getObjectByValue(val2);
        // get object in pop1 and value in path
        Object3D object3D1 = population1.getObjectByValue(val1);
        int pathValue = (int) path.getPixel(((Object3DVoxels) object3D1).getFirstVoxel());
        object3D2.draw(draw, pathValue);
    }
    // orphan2
    for (String orphan : Orphan2) {
        int val = Integer.parseInt(orphan);
        Object3D object3D2 = population2.getObjectByValue(val);
        int pathValue = (int) track.getPixel(((Object3DVoxels) object3D2).getFirstVoxel());
        object3D2.draw(draw, pathValue);
    }
}
Also used : Object3DVoxels(mcib3d.geom.Object3DVoxels) Object3D(mcib3d.geom.Object3D)

Aggregations

Object3D (mcib3d.geom.Object3D)18 Objects3DPopulation (mcib3d.geom.Objects3DPopulation)6 ArrayUtil (mcib3d.utils.ArrayUtil)4 Voxel3D (mcib3d.geom.Voxel3D)3 ResultsTable (ij.measure.ResultsTable)2 Object3DVoxels (mcib3d.geom.Object3DVoxels)2 LinkedList (java.util.LinkedList)1 Vector3D (mcib3d.geom.Vector3D)1 ImageHandler (mcib3d.image3d.ImageHandler)1 ImageShort (mcib3d.image3d.ImageShort)1