Search in sources :

Example 36 with Point3f

use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.

the class Object3DSurface method translate.

@Override
public void translate(double x, double y, double z) {
    Point3f T = new Point3f((float) x, (float) y, (float) z);
    for (Point3f P : faces) {
        P.add(T);
    }
    init();
// this.computeUniqueVertices();
}
Also used : Point3f(org.scijava.vecmath.Point3f)

Example 37 with Point3f

use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.

the class Object3DSurface method computeContours.

@Override
public void computeContours() {
    // Contours pixels are same as surface vertices
    kdtreeContours = new KDTreeC(3);
    kdtreeContours.setScale3(this.resXY, this.resXY, this.resZ);
    contours = new ArrayList();
    Point3f P;
    // Value ?
    double val = 1;
    for (Point3f vertice : vertices) {
        P = vertice;
        Voxel3D vox = new Voxel3D(P, val);
        contours.add(vox);
        kdtreeContours.add(vox.getArray(), vox);
    }
    // needs to compute area since contours are used to compute areas in other classes
    this.computeSurfaceAreas();
}
Also used : Point3f(org.scijava.vecmath.Point3f) KDTreeC(mcib3d.utils.KDTreeC)

Example 38 with Point3f

use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.

the class Object3DSurface method translateTool.

public static List translateTool(List l, float tx, float ty, float tz) {
    List lt = new ArrayList(l.size());
    for (Point3f P : (Iterable<Point3f>) l) {
        Point3f Pt = new Point3f(P.x + tx, P.y + ty, P.z + tz);
        lt.add(Pt);
    }
    return lt;
}
Also used : Point3f(org.scijava.vecmath.Point3f) List(java.util.List)

Example 39 with Point3f

use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.

the class DeformableMesh method roughDisplacement.

public void roughDisplacement(double maxDispl) {
    this.computeAllForces(false);
    for (Vector3D force : forces) {
        if ((force != null) && (force.getLength() > maxDispl)) {
            Vector3D dirForce = force.getNormalizedVector();
            force = dirForce.multiply(maxDispl);
        }
        // loop on vertices
        if (force != null) {
            for (Point3f vertice : vertices) {
                vertice.add(force.getPoint3f());
            }
        }
    }
    this.computeVerticesNormals();
}
Also used : Point3f(org.scijava.vecmath.Point3f) Vector3D(mcib3d.geom.Vector3D)

Example 40 with Point3f

use of org.scijava.vecmath.Point3f in project mcib3d-core by mcib3d.

the class Deriche method newPositionF.

// Calcul d'un point (position) à partir d'un point initial, un vecteur
// de direction et un entier n
public Point3f newPositionF(Point3f position, Point3f direction, float n) {
    float posX, posY, posZ;
    posX = (position.x + (direction.x * n));
    posY = (position.y + (direction.y * n));
    posZ = (position.z + (direction.z * n));
    Point3f vec = new Point3f(posX, posY, posZ);
    return vec;
}
Also used : Point3f(org.scijava.vecmath.Point3f)

Aggregations

Point3f (org.scijava.vecmath.Point3f)58 ArrayList (java.util.ArrayList)20 Calibration (ij.measure.Calibration)6 HashMap (java.util.HashMap)5 Color3f (org.scijava.vecmath.Color3f)5 Point (java.awt.Point)4 Color (java.awt.Color)3 Area (java.awt.geom.Area)3 Map (java.util.Map)3 TreeMap (java.util.TreeMap)3 Point3d (com.github.quickhull3d.Point3d)2 QuickHull3D (com.github.quickhull3d.QuickHull3D)2 PolygonRoi (ij.gui.PolygonRoi)2 Rectangle (java.awt.Rectangle)2 AffineTransform (java.awt.geom.AffineTransform)2 HashSet (java.util.HashSet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Vector3f (org.scijava.vecmath.Vector3f)2 CustomLineMesh (customnode.CustomLineMesh)1 CustomMesh (customnode.CustomMesh)1