public abstract class General
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static SimpleVector |
E_X |
static SimpleVector |
E_Y |
static SimpleVector |
E_Z |
Constructor and Description |
---|
General() |
Modifier and Type | Method and Description |
---|---|
static double |
angle(SimpleVector a,
SimpleVector b)
Computes the angle between two vectors;
|
static boolean |
areColinear(SimpleVector v1,
SimpleVector v2,
double delta) |
static SimpleVector |
augmentToHomgeneous(SimpleVector v) |
static SimpleMatrix |
createHomAffineMotionMatrix(SimpleMatrix A) |
static SimpleMatrix |
createHomAffineMotionMatrix(SimpleMatrix A,
SimpleVector t) |
static SimpleMatrix |
createHomAffineMotionMatrix(SimpleVector t) |
static java.util.ArrayList<Triangle> |
createTrianglesFromPlanarPointSet(java.util.ArrayList<PointND> points)
Creates a triangle mesh for a planar set of points.
|
static java.util.ArrayList<Triangle> |
createTrianglesFromPlanarPointSet(java.util.ArrayList<PointND> points,
java.lang.String nameTag,
java.io.BufferedWriter bwpoint)
Creates a triangle mesh for a planar set of points.
|
static SimpleVector |
crossProduct(SimpleVector v1,
SimpleVector v2) |
static double |
euclideanDistance(SimpleVector v1,
SimpleVector v2) |
static java.util.ArrayList<PointND> |
extractCandidatePoints(ij.process.ImageProcessor houghSpace,
double offset)
Extract points from an ImageProcessor which exceed a certain value
|
static java.util.ArrayList<PointND> |
extractClusterCenter(java.util.ArrayList<PointND> pointList,
double distance)
Extracts cluster centers from an ordered List of points.
|
static java.util.ArrayList<PointND> |
extractClusterCenter(java.util.ArrayList<PointND> pointList,
double distance,
boolean breakOption)
Extracts cluster centers from an ordered List of points.
|
static PointND |
getGeometricCenter(java.util.ArrayList<PointND> list)
Compute the geometric center of a set of points
|
static PointND |
getGeometricCenter(java.util.Iterator<PointND> list)
Compute the geometric center of an iterator of points
|
static PointND |
getGeometricCenter(PointND[] pts) |
static boolean |
intersectRayWithCuboid(SimpleVector origin,
SimpleVector dir,
SimpleVector cubmin,
SimpleVector cubmax,
double[] distanceNearAndFar)
Computes the two intersections of a ray with a cuboid, called entry and
exit point where the ray is specified by the given line origin and ray direction.
|
static java.util.ArrayList<PointND> |
intersectRayWithCuboid(StraightLine line,
PointND min,
PointND max) |
static boolean |
isNormalizeMode() |
static boolean |
isWithinCuboid(PointND point,
PointND min,
PointND max)
Method to check whether a point is within a given cubiod defined by min and max.
|
static SimpleVector |
normalizeFromHomogeneous(SimpleVector v) |
static int[] |
projectVolumeToProjection(PointND min,
PointND max,
Projection proj)
Computes the convex hull of the projection of the eight corners of the volume to the projection.
|
static void |
setNormalizeMode(boolean mode) |
static void |
splitHomAffineMotionMatrix(SimpleMatrix At,
SimpleMatrix A,
SimpleVector t) |
static ij.process.ImageProcessor |
thresholdImage(ij.process.ImageProcessor img,
double offset)
Threshold image and create binary mask
|
static double |
toDegrees(double radians) |
static double |
toRadians(double degrees) |
static double |
voxelToWorld(double voxel,
double spacing,
double origin)
Computes the origin in world coordinates from pixel coordinates.
|
static double[] |
voxelToWorld(int[] voxel,
double[] spacing,
double[] origin)
Convert voxel indexes to world coordinates (in mm), given the spacing and
origin of a volume.
|
static double[] |
worldToVoxel(double[] world,
double[] spacing,
double[] origin)
Convert world coordinates (in mm) to voxel indexes, given the spacing and
origin of a volume.
|
static double |
worldToVoxel(double world,
double spacing,
double origin)
Helper function to convert world coordinates (in mm) to voxel indexes.
|
public static final SimpleVector E_X
public static final SimpleVector E_Y
public static final SimpleVector E_Z
public static boolean isNormalizeMode()
public static void setNormalizeMode(boolean mode)
public static int[] projectVolumeToProjection(PointND min, PointND max, Projection proj)
min
- the minimal 3D coordinate of the volumemax
- the maximal 3D coordinate of the volumeproj
- the projection matrixpublic static SimpleVector crossProduct(SimpleVector v1, SimpleVector v2)
public static boolean areColinear(SimpleVector v1, SimpleVector v2, double delta)
public static double angle(SimpleVector a, SimpleVector b)
a
- b
- public static double euclideanDistance(SimpleVector v1, SimpleVector v2)
public static SimpleVector augmentToHomgeneous(SimpleVector v)
public static SimpleVector normalizeFromHomogeneous(SimpleVector v)
public static SimpleMatrix createHomAffineMotionMatrix(SimpleMatrix A, SimpleVector t)
public static SimpleMatrix createHomAffineMotionMatrix(SimpleMatrix A)
public static SimpleMatrix createHomAffineMotionMatrix(SimpleVector t)
public static double toRadians(double degrees)
public static double toDegrees(double radians)
public static double[] voxelToWorld(int[] voxel, double[] spacing, double[] origin)
public static double voxelToWorld(double voxel, double spacing, double origin)
voxel
- the negative voxel coordinatespacing
- the spacingorigin
- 0public static double[] worldToVoxel(double[] world, double[] spacing, double[] origin)
public static double worldToVoxel(double world, double spacing, double origin)
public static void splitHomAffineMotionMatrix(SimpleMatrix At, SimpleMatrix A, SimpleVector t)
public static java.util.ArrayList<PointND> intersectRayWithCuboid(StraightLine line, PointND min, PointND max)
public static boolean isWithinCuboid(PointND point, PointND min, PointND max)
point
- the pointmin
- the minimum coordinate of the cuboidmax
- the maximum coordinate of the cuboid.public static boolean intersectRayWithCuboid(SimpleVector origin, SimpleVector dir, SimpleVector cubmin, SimpleVector cubmax, double[] distanceNearAndFar)
origin
- The ray origin in world coordinates.dir
- The normalized(!) ray direction (corresponding to a specific pixel) in world coordinates [rd_x rd_y rd_z].cubmin
- The cuboid's minimal planes given as [min_x, min_y, min_z] in world
coordinates.cubmax
- The cuboid's maximal planes given as [max_x, max_y, max_z] in world
coordinates.distanceNearAndFar
- Return values. In case of a hit: Positive distances (in world
coordinate units) of nearest and farthest plane intersection.public static PointND getGeometricCenter(java.util.ArrayList<PointND> list)
list
- the set of pointspublic static PointND getGeometricCenter(java.util.Iterator<PointND> list)
list
- the set of pointspublic static java.util.ArrayList<PointND> extractCandidatePoints(ij.process.ImageProcessor houghSpace, double offset)
houghSpace
- the ImageProcessoroffset
- the threshold for extractionpublic static ij.process.ImageProcessor thresholdImage(ij.process.ImageProcessor img, double offset)
img
- the ImageProcessoroffset
- the thresholdpublic static java.util.ArrayList<PointND> extractClusterCenter(java.util.ArrayList<PointND> pointList, double distance)
pointList
- the list of candidate pointsdistance
- the minimal distance between clusterspublic static java.util.ArrayList<PointND> extractClusterCenter(java.util.ArrayList<PointND> pointList, double distance, boolean breakOption)
pointList
- the list of candidate pointsdistance
- the minimal distance between clustersbreakOption
- option to break after distance exceeded once. Only applicable if points are ordered in the correct manner.public static java.util.ArrayList<Triangle> createTrianglesFromPlanarPointSet(java.util.ArrayList<PointND> points)
points
- the pointsConvexHull
,
SurfaceBSpline
public static java.util.ArrayList<Triangle> createTrianglesFromPlanarPointSet(java.util.ArrayList<PointND> points, java.lang.String nameTag, java.io.BufferedWriter bwpoint)
points
- the pointsConvexHull
,
SurfaceBSpline