|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvisad.bio.BioUtil
public class BioUtil
BioUtil provides a collection of general utilities used by VisBio.
| Constructor Summary | |
|---|---|
BioUtil()
|
|
| Method Summary | |
|---|---|
static float[][] |
adjustColorTable(float[][] table,
float[] alpha,
boolean doAlpha)
Ensures the color table is of the proper type (RGB or RGBA). |
static boolean |
contains(double x1,
double y1,
double x2,
double y2,
double vx,
double vy)
Determines whether the specified endpoint lies within the given rectangle. |
static RealTuple[] |
copy(RealTuple[] tuples)
Makes a deep copy of the given RealTuple array. |
static RealTuple[] |
copy(RealTuple[] tuples,
int slice)
Makes a deep copy of the given RealTuple array, altering the last dimension to match the specified Z-slice value. |
static float[] |
corner(float[] c1,
float[] c2,
float[] c3)
Computes the fourth corner of a rectangle, given the first three. |
static double[] |
cursorToDomain(DisplayImpl d,
double[] cursor)
Converts the given cursor coordinates to domain coordinates. |
static void |
dump(RealTuple tuple)
Dumps information about the given RealTuple to the screen. |
static double |
getDistance(double[] p,
double[] q,
double[] m)
Gets the distance between the endpoints p and q, using the given conversion values between pixels and microns. |
static double |
getDistance(double[] a,
double[] b,
double[] v,
boolean segment)
Computes the minimum distance between the point v and the line a-b. |
static boolean |
intersects(double x1,
double y1,
double x2,
double y2,
double ax,
double ay,
double bx,
double by)
Determines whether the specified line segment intersects the given rectangle. |
static FieldImpl |
loadData(java.io.File file,
boolean makeStack)
Loads the data from the given file, and ensures that the resulting data object is of the proper form, converting image data into single-slice stack data if specified. |
static FieldImpl |
makeStack(FlatField[] f)
Converts an array of images to an image stack. |
static double[] |
pixelToCursor(DisplayImpl d,
int x,
int y)
Converts the given pixel coordinates to cursor coordinates. |
static double[] |
pixelToDomain(DisplayImpl d,
int x,
int y)
Converts the given pixel coordinates to domain coordinates. |
static void |
project(float[] x,
float[] y,
float[] z,
float p1x,
float p1y,
float p1z,
float p2x,
float p2y,
float p2z,
int p,
float[] min,
float[] max,
float[] proj)
Projects all the points in (x, y, z) onto the line defined by (p1, p2). |
static boolean |
tablesEqual(float[][] t1,
float[][] t2)
Tests whether two color tables are identical in content. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BioUtil()
| Method Detail |
|---|
public static double[] pixelToDomain(DisplayImpl d,
int x,
int y)
public static double[] pixelToCursor(DisplayImpl d,
int x,
int y)
public static double[] cursorToDomain(DisplayImpl d,
double[] cursor)
public static double getDistance(double[] a,
double[] b,
double[] v,
boolean segment)
a - Coordinates of the line's first endpointb - Coordinates of the line's second endpointv - Coordinates of the standalone endpointsegment - Whether distance computation should be
constrained to the given line segment
public static double getDistance(double[] p,
double[] q,
double[] m)
p - Coordinates of the first endpointq - Coordinates of the second endpointm - Conversion values between microns and pixels
public static boolean intersects(double x1,
double y1,
double x2,
double y2,
double ax,
double ay,
double bx,
double by)
x1 - X-coordinate of the top-left corner of the rectangley1 - Y-coordinate of the top-left corner of the rectanglex2 - X-coordinate of the bottom-right corner of the rectangley2 - Y-coordinate of the bottom-right corner of the rectangleax - X-coordinate of the line's first endpointay - Y-coordinate of the line's first endpointbx - X-coordinate of the line's second endpointby - Y-coordinate of the line's second endpoint
public static boolean contains(double x1,
double y1,
double x2,
double y2,
double vx,
double vy)
x1 - X-coordinate of the top-left corner of the rectangley1 - Y-coordinate of the top-left corner of the rectanglex2 - X-coordinate of the bottom-right corner of the rectangley2 - Y-coordinate of the bottom-right corner of the rectanglevx - X-coordinate of the standalone endpointvy - Y-coordinate of the standalone endpoint
public static FieldImpl loadData(java.io.File file,
boolean makeStack)
throws VisADException,
java.rmi.RemoteException
VisADException
java.rmi.RemoteException
public static FieldImpl makeStack(FlatField[] f)
throws VisADException,
java.rmi.RemoteException
VisADException
java.rmi.RemoteExceptionpublic static RealTuple[] copy(RealTuple[] tuples)
public static RealTuple[] copy(RealTuple[] tuples,
int slice)
public static void dump(RealTuple tuple)
public static float[][] adjustColorTable(float[][] table,
float[] alpha,
boolean doAlpha)
public static boolean tablesEqual(float[][] t1,
float[][] t2)
public static void project(float[] x,
float[] y,
float[] z,
float p1x,
float p1y,
float p1z,
float p2x,
float p2y,
float p2z,
int p,
float[] min,
float[] max,
float[] proj)
public static float[] corner(float[] c1,
float[] c2,
float[] c3)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||