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;
}
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;
}
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;
}
Aggregations