public class RoiUtils extends Object
Constructor and Description |
---|
RoiUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
distance(double[] A,
double[] B)
Compute the linear distance between two points.
|
static double |
distanceFromLine(double[] P,
double[] A,
double[] B)
Compute the distance of point
P from
the line defined by points A and B . |
static double |
distanceFromSegment(double[] P,
double[] A,
double[] B)
Compute the distance of point
P from the
line segment bounded by points A and B . |
static double |
distanceSquared(double[] A,
double[] B)
Compute the squared linear distance between two points.
|
static boolean |
isAbreastSegment(double[] P,
double[] A,
double[] B)
Is a point next to a line segment?
I.e.
|
static boolean |
isNearBorder(double[] P,
net.imagej.overlay.AbstractOverlay overlay,
double radius)
Determine if a point is near a border defined by an set of vertices.
|
static boolean |
isNearBorder(double[] P,
double[][] vertices,
double radius,
boolean closed)
Determine if a point is near a border defined by an set of vertices.
|
static boolean |
isNearBorder(double[] P,
net.imagej.overlay.GeneralPathOverlay overlay,
double radius)
Handler for
GeneralPathOverlay s |
static boolean |
isNearBorder(double[] P,
net.imagej.overlay.LineOverlay overlay,
double radius)
Handler for
LineOverlay s |
static boolean |
isNearBorder(double[] P,
net.imagej.overlay.PolygonOverlay overlay,
double radius)
Handler for
PolygonOverlay s |
static double |
triangleAltitude(double a,
double b)
Compute the altitude of a triangle.
|
public static boolean isNearBorder(double[] P, net.imagej.overlay.AbstractOverlay overlay, double radius) throws SlideSetException
P
- The point to check, (x,y)
overlay
- Overlay to use as the border definition. If the
overlay has more than two dimensions, it is flattened
to X
and Y
dimensions only.radius
- Distance considered to be near the borderSlideSetException
- The overlay type is not supportedpublic static boolean isNearBorder(double[] P, net.imagej.overlay.PolygonOverlay overlay, double radius)
PolygonOverlay
spublic static boolean isNearBorder(double[] P, net.imagej.overlay.LineOverlay overlay, double radius)
LineOverlay
spublic static boolean isNearBorder(double[] P, net.imagej.overlay.GeneralPathOverlay overlay, double radius)
GeneralPathOverlay
spublic static boolean isNearBorder(double[] P, double[][] vertices, double radius, boolean closed)
P
- The point to check, (x,y)
vertices
- Ordered set of vertices defining the border,
[index][(x,y)]
radius
- Distance considered to be near the borderclosed
- Is the border closed, i.e. is the segment connecting
the last and first points in the border set considered
part of the border?public static double distanceFromSegment(double[] P, double[] A, double[] B)
P
from the
line segment bounded by points A
and B
.public static double distanceFromLine(double[] P, double[] A, double[] B)
P
from
the line defined by points A
and B
.public static boolean isAbreastSegment(double[] P, double[] A, double[] B)
P
to the line defined by points A
and B
intersect with line A-B
between A
and B
?public static double distance(double[] A, double[] B)
public static double distanceSquared(double[] A, double[] B)
public static double triangleAltitude(double a, double b)
0
if one of the sides has length 0
.Copyright © 2023. All rights reserved.