Search in sources :

Example 16 with Object3D

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

the class SpatialShuffle method getSampleImage.

@Override
public ImageHandler getSampleImage() {
    Object3D mask = population.getMask();
    ImageHandler tmp = new ImageShort(getName(), mask.getXmax() + 1, mask.getYmax() + 1, mask.getZmax() + 1);
    getSample().draw(tmp);
    return tmp;
}
Also used : ImageHandler(mcib3d.image3d.ImageHandler) ImageShort(mcib3d.image3d.ImageShort) Object3D(mcib3d.geom.Object3D)

Example 17 with Object3D

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

the class Segment3DSpots method getLabelImage.

public ImageHandler getLabelImage() {
    IJ.log("Create label image with " + segmentedObjects.size() + " objects");
    if (indexImage == null) {
        if (!bigLabel) {
            indexImage = new ImageShort("Index", rawImage.sizeX, rawImage.sizeY, rawImage.sizeZ);
            indexImage.setScale(rawImage);
        } else {
            indexImage = new ImageFloat("Index", rawImage.sizeX, rawImage.sizeY, rawImage.sizeZ);
            indexImage.setScale(rawImage);
        }
    }
    for (Object3D obj : segmentedObjects) {
        obj.draw(indexImage, obj.getValue());
    }
    return indexImage;
}
Also used : Object3D(mcib3d.geom.Object3D)

Example 18 with Object3D

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

the class InteractionsComputeDilate method compute.

@Override
public InteractionsList compute(ImageHandler image) {
    // get population from image
    Objects3DPopulation population = new Objects3DPopulation(image);
    InteractionsList interactions = new InteractionsList();
    for (Object3D object3D : population.getObjectsList()) {
        int value = object3D.getValue();
        Object3D dilated = object3D.getDilatedObject(rx, ry, rz);
        LinkedList<Voxel3D> contours = dilated.getContours();
        ArrayUtil arrayUtil = new ArrayUtil(contours.size());
        int c = 0;
        for (Voxel3D voxel3D : contours) {
            if (image.contains(voxel3D)) {
                arrayUtil.putValue(c, image.getPixel(voxel3D));
                c++;
            }
        }
        arrayUtil.setSize(c);
        ArrayUtil distinctValues = arrayUtil.distinctValues();
        for (int i = 0; i < distinctValues.size(); i++) {
            int other = distinctValues.getValueInt(i);
            if ((other == 0) || (other == value))
                continue;
            if (!interactions.contains(value, other)) {
                interactions.addInteraction(object3D, population.getObjectByValue(other), arrayUtil.countValue(other));
            }
        }
    }
    return interactions;
}
Also used : Voxel3D(mcib3d.geom.Voxel3D) Objects3DPopulation(mcib3d.geom.Objects3DPopulation) Object3D(mcib3d.geom.Object3D) ArrayUtil(mcib3d.utils.ArrayUtil)

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