use of mcib3d.utils.ArrayUtil in project mcib3d-core by mcib3d.
the class Objects3DPopulation method computeDistances.
/**
* @param evaluationPoints
* @return
*/
public ArrayUtil computeDistances(Point3D[] evaluationPoints) {
final int numPoints = evaluationPoints.length;
ArrayUtil array;
Point3D P;
Object3D cl;
array = new ArrayUtil(numPoints);
for (int i = 0; i < numPoints; i++) {
P = evaluationPoints[i];
cl = this.closestCenter(P);
array.putValue(i, cl.distPixelCenter(P.getX(), P.getY(), P.getZ()));
}
return array;
}
use of mcib3d.utils.ArrayUtil in project mcib3d-core by mcib3d.
the class Object3DLabel method listValues.
@Override
public ArrayUtil listValues(ImageHandler ima, float thresh) {
ArrayUtil list = new ArrayUtil(this.getVolumePixels());
float pixel;
int xmin0;
int ymin0;
int zmin0;
int xmax0;
int ymax0;
int zmax0;
xmin0 = getXmin();
ymin0 = getYmin();
zmin0 = getZmin();
xmax0 = getXmax();
ymax0 = getYmax();
zmax0 = getZmax();
int idx = 0;
for (int k = zmin0; k <= zmax0; k++) {
for (int j = ymin0; j <= ymax0; j++) {
for (int i = xmin0; i <= xmax0; i++) {
if (labelImage.getPixel(i, j, k) == value) {
pixel = ima.getPixel(i, j, k);
if (pixel > thresh) {
list.putValue(idx, pixel);
idx++;
}
}
}
}
}
return list;
}
use of mcib3d.utils.ArrayUtil in project mcib3d-core by mcib3d.
the class Object3DLabel method listValues.
@Override
public ArrayUtil listValues(ImageHandler ima) {
ArrayUtil list = new ArrayUtil(this.getVolumePixels());
Voxel3D pixel;
int xmin0;
int ymin0;
int zmin0;
int xmax0;
int ymax0;
int zmax0;
xmin0 = getXmin();
ymin0 = getYmin();
zmin0 = getZmin();
xmax0 = getXmax();
ymax0 = getYmax();
zmax0 = getZmax();
int idx = 0;
for (int k = zmin0; k <= zmax0; k++) {
for (int j = ymin0; j <= ymax0; j++) {
for (int i = xmin0; i <= xmax0; i++) {
if (labelImage.getPixel(i, j, k) == value) {
list.putValue(idx, ima.getPixel(i, j, k));
idx++;
}
}
}
}
return list;
}
use of mcib3d.utils.ArrayUtil in project mcib3d-core by mcib3d.
the class Object3DSurface method listValues.
@Override
public ArrayUtil listValues(ImageHandler ima) {
ArrayUtil vector = new ArrayUtil(this.getVolumePixels());
float pixvalue;
int idx = 0;
for (Voxel3D pixel : voxels) {
if (ima.contains(pixel)) {
pixvalue = ima.getPixel(pixel);
vector.addValue(idx, pixvalue);
idx++;
}
}
vector.setSize(idx);
return vector;
}
use of mcib3d.utils.ArrayUtil in project mcib3d-core by mcib3d.
the class Object3DVoxels method listVoxels.
// list voxels when object translated to new position for center
public ArrayUtil listVoxels(ImageHandler ima, int newCenterX, int newCenterY, int newCenterZ) {
ArrayUtil list = new ArrayUtil(this.getVolumePixels());
Voxel3D voxel;
Iterator<Voxel3D> it = voxels.iterator();
float pixvalue;
double tx = newCenterX - bx;
double ty = newCenterY - by;
double tz = newCenterZ - bz;
int idx = 0;
while (it.hasNext()) {
voxel = it.next();
int px = (int) Math.round(tx + voxel.getX());
int py = (int) Math.round(ty + voxel.getY());
int pz = (int) Math.round(tz + voxel.getZ());
if (ima.contains(px, py, pz)) {
pixvalue = ima.getPixel(px, py, pz);
list.putValue(idx, pixvalue);
idx++;
}
}
list.setSize(idx);
return list;
}
Aggregations