public class MathII
extends java.lang.Object
ArraysI
Modifier and Type | Field and Description |
---|---|
static double |
PI |
static int |
X |
static int |
Y |
static int |
Z |
Constructor and Description |
---|
MathII() |
Modifier and Type | Method and Description |
---|---|
static float |
areaIntegral(float x,
float R)
WO 5/9/02 area under an arc: arc eqn: y^2 = sqrt(R^2 - x^2)
area = integral{ sqrt(R^2 - x^2) dx}
|
static double |
assocLegendre(int l,
int absm,
double cosmu)
from http://www.shodor.org/refdesk/Resources/Libraries/AssocLegendre/AssocLegendre.java
their on-line code had errors, but his below gives the correct results. |
static float |
BartlettWindow(int j,
float a,
float b)
Bartlett window
|
static float[][] |
beadKernel(int n)
WO 10/30/00 generic-sized bead gradient profile kernel
|
static float[][][] |
beadKernel3D(int radius)
WO 4/23/02 spherically symmetric bead
|
static float |
beadProfile(int size,
float rad_at)
WO 10/30/00 created generic-sized bead profile kernel
|
static float[][] |
calcCircKernel(int krad)
WO 5/9/02 new arc integral calc versions ..
|
static float[][][] |
calcSphericalKernel(int krad)
create spherical kernal assuming isotropic voxels of size matching gaussian kernel of same radius.
|
static double[] |
cart2prosph(double[] xyz,
double F) |
static double[] |
cart2prosph(double x,
double y,
double z,
double F) |
static float[] |
cart2prosph(float[] xyz,
float F) |
static float[] |
cart2prosph(float x,
float y,
float z,
float F) |
static double[] |
cart2sph(double x,
double y,
double z) |
static float[] |
cart2sph(float x,
float y,
float z) |
static float |
computeAreaUnderArc(float X1,
float X2,
float R) |
static float |
computeCylPartialVol(float ptAxis_pxW,
float ptAxis_pxH,
float voxel_pxW,
float voxel_pxH,
float[] tangent_mm,
float scaleW,
float scaleH,
float R,
float axialSearchLimit)
WO 03/18/2013 2D version of the above.
|
static float |
computeCylPartialVol(float ptAxis_pxW,
float ptAxis_pxH,
float ptAxis_pxD,
float voxel_pxW,
float voxel_pxH,
float voxel_pxD,
float[] tangent_mm,
float scaleW,
float scaleH,
float scaleD,
float R,
float axialSearchLimit)
WO 03/18/2013 using the approach above to merely break up the test voxel (3D) into little voxels to
compute the partial volume for a cylinder passing near the voxel.
|
static float |
computeOnePixel3dArcVol(float Xp1,
float Xp2,
float Yp1,
float Yp2,
float Zp1,
float Zp2,
float R)
WO 1/31/11 this seems to give wrong answers sometimes.
|
static float |
computePixel3dArcVol(float Xp1,
float Xp2,
float Yp1,
float Yp2,
float Zp1,
float Zp2,
float R)
WO 01/31/11 tetrahedron calc seems to fail for some arrangements of the pixel alignment
trying simply breaking the cube up into many cubes and doing cube-sum.
|
static float |
computePixelArcArea(float Xp1,
float Xp2,
float Yp1,
float Yp2,
float R) |
static float |
computeSpherePartialVol(float cen_pxW,
float cen_pxH,
float voxel_pxW,
float voxel_pxH,
float scaleW,
float scaleH,
float R)
WO 8/11/2015 2D version of the above.
|
static float |
computeSpherePartialVol(float cen_pxW,
float cen_pxH,
float cen_pxD,
float voxel_pxW,
float voxel_pxH,
float voxel_pxD,
float scaleW,
float scaleH,
float scaleD,
float R)
WO 08/11/2015 using the approach above to merely break up the test voxel (3D) into little voxels to
compute the partial volume for a cylinder passing near the voxel.
|
static java.lang.String |
decimalString(double x) |
static java.lang.String |
decimalString(double x,
int n) |
static java.lang.String |
decimalString(float x) |
static java.lang.String |
decimalString(float x,
int n) |
static float[][] |
diskTemplate(float rad) |
static float[][] |
diskTemplate(float rad,
float padding) |
static float[][] |
diskTemplate(float rad,
float padding,
float wscale,
float hscale) |
static float[][] |
diskTemplate(float rad,
float padding,
float wscale,
float hscale,
float shiftw,
float shifth)
WO 4/30/2013 for radius[mm] disk kernel (2D version of sphere).
|
static double |
dot(double[] a,
double[] b) |
static float |
dot(float[] a,
float[] b)
vector dot-product.
|
static float |
dot(Point2D a,
Point2D b) |
static double |
dot(Point3D a,
Point3D b) |
static double |
eval_Hermite(double x,
double p1,
double s1,
double p2,
double s2) |
static float |
eval_Hermite(float x,
float p1,
float s1,
float p2,
float s2) |
static void |
four1(float[] data,
int N,
int isign)
(C) Copr.
|
static double |
fourier_eval(int m,
double theta)
note that Num.
|
static void |
FTshift(float[][] A) |
static void |
FTshift(float[][][] A) |
static void |
FTshift(short[][] A)
WO 1/5/11 after performing an FT-InvFT calculation the image is out of order and needs
the equivalent of Matlab's fftshift function
|
static void |
FTshift(short[][][] A) |
static float |
gasdev(java.util.Random ranMe) |
static float[][] |
gaussianGradKernel(int n) |
static float[][][] |
gaussianKernel(double sigmad,
double sigmaw,
double sigmah) |
static float[][] |
gaussianKernel(float sigma) |
static float[][] |
gaussianKernel(float sigmax,
float sigmay) |
static float[][][] |
gaussianKernel(float sigmad,
float sigmaw,
float sigmah) |
static float[][] |
gaussianKernel(int n)
generic-sized gaussian kernel, symmetric
note: if passing an integer value, code assumes that n represents the pixel dimension of the resulting kernel; n should be odd so that the kernel is centered around the origin; and sigma = (n-1)/6 if passing a float value sigma, the pixel dimension is set to match 6 sigma |
static float[][] |
gaussianKernel(int nx,
int ny) |
static float[][][] |
gaussianKernel(int nd,
int nw,
int nh)
elliptical 3D gaussian kernel
uses ArrayDisplay indexing conventions A[depth][width][height] |
static double[] |
get_prosph_surf_terms(double mu,
double theta,
int order) |
static double[] |
get_prosph_terms(double x,
double y,
double z,
int tfr,
double F,
int[] order,
double[] tagNormal) |
static int |
get_surfaceFitting_Nterms(int order) |
static Point3D |
getDicomPoint3D(ij.ImagePlus imp,
java.lang.String key) |
static Point3D |
getDicomPoint3D(ij.ImagePlus imp,
java.lang.String key,
int skip) |
static double |
getDicomValue(ij.ImagePlus imp,
java.lang.String key) |
static double |
getDicomValue(ij.ImagePlus imp,
java.lang.String key,
int skip) |
static double |
getDicomValue(java.util.Properties props,
java.lang.String key) |
static double |
getDicomValue(java.util.Properties props,
java.lang.String key,
int skip) |
static double |
getDicomValue(java.lang.String dicomheader,
java.lang.String key) |
static double |
getDicomValue(java.lang.String dicomheader,
java.lang.String key,
int skip) |
static double |
getDicomValue(java.lang.String dicomheader,
java.lang.String key,
int skip,
java.lang.String strsep)
WO 6/25/09 creating this intermediate before getStringString to check for dicom headers where
we have found an extra ">Pixel Header" tag present, right before the real tag and with the
'>' in front.
|
static double |
getDicomValue(java.lang.String dicomheader,
java.lang.String key,
java.lang.String strsep) |
static float[] |
getDistToCylAxis(float ptAxis_pxW,
float ptAxis_pxH,
float testPt_pxW,
float testPt_pxH,
float[] tangent_mm,
float scaleW,
float scaleH)
WO 3/18/2013 2D version of above.
|
static float[] |
getDistToCylAxis(float ptAxis_pxW,
float ptAxis_pxH,
float ptAxis_pxD,
float testPt_pxW,
float testPt_pxH,
float testPt_pxD,
float[] tangent_mm,
float scaleW,
float scaleH,
float scaleD)
WO 3/18/2013 intent is for computing partial volume for pixels near a cylinder, want distance
from the center of a voxel in space to the central axis of the cylinder along the shortest perpendicular.
|
static int |
getFFT_N(int n)
WO 5/22/01 want nearest integer N=2^m that is greater than n
|
static float[][] |
getSmoothedPolygon(float[][] poly) |
static float[][] |
getSmoothedPolygon(Polygon2D poly) |
static Point3D |
getStringPoint3D(java.lang.String target,
java.lang.String key) |
static Point3D |
getStringPoint3D(java.lang.String target,
java.lang.String key,
int skip) |
static Point3D |
getStringPoint3D(java.lang.String target,
java.lang.String key,
int skip,
java.lang.String strsep) |
static Point3D |
getStringPoint3D(java.lang.String target,
java.lang.String key,
java.lang.String strsep) |
static Point3Dint |
getStringPoint3Dint(java.lang.String target,
java.lang.String key,
int skip,
java.lang.String strsep) |
static java.lang.String |
getStringString(java.lang.String target,
java.lang.String key)
parses string 'target' for String value following the tag 'key'
|
static java.lang.String |
getStringString(java.lang.String target,
java.lang.String key,
int skip) |
static java.lang.String |
getStringString(java.lang.String target,
java.lang.String key,
int skip,
java.lang.String strSep) |
static java.lang.String |
getStringString(java.lang.String target,
java.lang.String key,
java.lang.String strSep) |
static double |
getStringValue(java.lang.String target) |
static double |
getStringValue(java.lang.String target,
java.lang.String key) |
static double |
getStringValue(java.lang.String target,
java.lang.String key,
int skip) |
static double |
getStringValue(java.lang.String target,
java.lang.String key,
int skip,
java.lang.String strSep)
parses the string for key (String) tag, and grabs first number following it.
|
static double |
getStringValue(java.lang.String target,
java.lang.String key,
java.lang.String strSep) |
static float[] |
getStringValues(java.lang.String target,
int nvals,
java.lang.String key) |
static float[] |
getStringValues(java.lang.String target,
int nvals,
java.lang.String key,
int skip) |
static float[] |
getStringValues(java.lang.String target,
int nvals,
java.lang.String key,
int skip,
java.lang.String strsep) |
static float[] |
getStringValues(java.lang.String target,
int nvals,
java.lang.String key,
java.lang.String strsep) |
static float[] |
getStringValues(java.lang.String target,
java.lang.String key) |
static float[][] |
gradKernel(float[][] orig,
int n)
WO 11/13/00 generic-sized profile gradient kernel
define via 2D image gradient operator on original kernel designed as (n+2)x(n+2) for an n sized primary template want value of background intensity of original template to use for grad calc at edges. |
static float |
HannWindow(float j,
float a,
float cutoff) |
static float |
HannWindow(int j,
float a)
Hann window, default: only filtering 10% edges
j== current index (==depth-at) a== total depth edge== is effective depth of windowing filter cutoff |
static float |
HannWindow(int j,
float a,
float cutoff) |
static double |
Hermite_00(double x) |
static float |
Hermite_00(float x)
Cubic Hermite interpolation functions
The derivative needs to be in units of distance, thus multiply the
dimension-less slope value by elem_len prior to sending to here.
|
static double |
Hermite_01(double x) |
static float |
Hermite_01(float x) |
static double |
Hermite_10(double x) |
static float |
Hermite_10(float x) |
static double |
Hermite_11(double x) |
static float |
Hermite_11(float x) |
static void |
invertKernel(float[][] A)
assumes original kernel min==0
|
static float |
inwardBendAngle(Point2D a,
Point2D b,
Point2D c)
6/16/11 for my LIDC snake work
|
static float |
line_sep(float[] testPt,
float[] linePt1,
float[] linePt2) |
static float |
line_sep2D(float[] testPt,
float[] linePt1,
float[] linePt2) |
static float |
line_sep2D(float testPtx,
float testPty,
float[] linePt1,
float[] linePt2)
sep between the infinitely long line passing through the 2 points and the 2D test point (positive number)
|
static boolean |
lineSegment_sep2DlessThanThresh(float testPtx,
float testPty,
float[] linePt1,
float[] linePt2,
float thresh)
sep between the line segment passing through the 2 points and the 2D test point (positive number).
|
static float[][] |
motionBlurKernel(int blurx,
int blury) |
static float[][][] |
multFt(float[][][] ftA,
float[][][] ftB) |
static float[][][] |
multFt(float[][][] ftA,
short[][][] ftB) |
static float[][] |
multFt(float[][] ftA,
float[][] ftB)
multiplication of complex fourier transforms using WO-NR conventions
|
static float[][][] |
multFt(short[][][] ftA,
float[][][] ftB) |
static float |
NormalizedBeadProfile(int size,
float rad_at)
returns values 0..1, 1.0 at center of bead
|
static void |
NRfour1(float[] data,
int nn,
int isign) |
static void |
NRrealft(float[] data,
int n,
int isign)
Num.
|
static float[] |
paddedFT(float[] A) |
static float[][] |
paddedFT(float[][] A) |
static float[][][] |
paddedFT(float[][][] A) |
static float[][][] |
paddedFT(float[][][] A,
int padD,
int padW,
int padH) |
static float[][] |
paddedFT(float[][] A,
int padW,
int padH) |
static float[] |
paddedFT(short[] A)
WO 1/4/11 code to take any sized array, pad it the minimal amount 2^n and run realFT()
|
static float[][] |
paddedFT(short[][] A) |
static float[][][] |
paddedFT(short[][][] A) |
static float[][][] |
paddedFT(short[][][] A,
int padD,
int padW,
int padH) |
static float[][] |
paddedFT(short[][] A,
int padW,
int padH)
versions that permit specifying the padding size (i.e.
|
static double |
parabolic_interpol(double x_at,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
parabolic approximation functions are very useful when trying to
zone in on local min/max values
note: some of these use Matrix manipulations obtained from Jama |
static float |
parabolic_interpol(float x_at,
float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
static double |
parabolic_interpol(Point2D p_at,
Point2D p1,
double v1,
Point2D p2,
double v2,
Point2D p3,
double v3)
ones that utilize Point2D values.
|
static void |
parabolic_interpol2D(Jama.Matrix coeffs,
Point2D pt) |
static double |
parabolic_minMaxLoc(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
min/max occurs at dY/dX = 0 ==> x = -b/2c
|
static float |
parabolic_minMaxLoc(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
static void |
parabolic_minMaxLoc(Point2D l_at,
Point2D p1,
double v1,
Point2D p2,
double v2,
Point2D p3,
double v3) |
static Point2D |
parabolic_minMaxSoln2D(Point2D[] XYs,
int npts)
WO 11/8/00 2D prabolic interpolation.
|
static double |
parabolic_minMaxVal(double x1,
double y1,
double x2,
double y2,
double x3,
double y3) |
static float |
parabolic_minMaxVal(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
static double |
parabolic_minMaxVal(Point2D p1,
double v1,
Point2D p2,
double v2,
Point2D p3,
double v3) |
static float |
plane_sep(float[] testPt,
float[] planePt1,
float[] planePt2,
float[] planePt3)
sep between the plane defined by the 3 points and the test point (positive number)
|
static float |
plane_sep(Point3D testPt,
float[] planePt1,
float[] planePt2,
float[] planePt3) |
static float |
Point_sep(Point2D p1,
Point2D p2) |
static double |
Point_sep(Point3D p1,
Point3D p2) |
static void |
PowerSpectrum1D(float[] vals,
float[] ps)
perform one-sided power spectral density
for power spectrum use compilation of '+' and '-' frequences and real and imaginary parts, where present note: NumRec puts real of k=0 into slot [0] & real of k=N/2 into slot [1] the rest go as: real of k=1 goes into slot[2], img k=1 goes into [3] also: for real vals freq[-k] == freq[k]^* (complex conjugate) and not kept see Num Rec section 13.4 (p551) and 12.0 |
static void |
PowerSpectrum2D(float[][] vals,
float[][] ps) |
static void |
PowerSpectrum3D(float[][][] vals,
float[][][] ps) |
static double[] |
prosph2cart(double[] xyz,
double F) |
static double[] |
prosph2cart(double lambda,
double mu,
double theta,
double F) |
static float[] |
prosph2cart(float[] lmt,
float F) |
static float[] |
prosph2cart(float lambda,
float mu,
float theta,
float F) |
static float[][][] |
realFt(byte[][][] A) |
static float[] |
realFt(float[] data)
WO 1/4/11 this version to return in same complex number format as 2D and 3D versions
|
static float[][] |
realFt(float[][] data)
WO 7/2/01 my 2D to 3D driver.
|
static float[][][] |
realFt(float[][][] A)
3D FT and InverseFT.
|
static float[][][] |
realFt(int[][][] A) |
static float[][][] |
realFt(short[][][] A) |
static void |
realFt1D(float[] data,
float[] real,
float[] img)
WO these are my functions to run the Numerical Recipe fourier functions
my take in the data[0..N-1] and empty real[0..N/2+1] and im[] arrays on output, I fill the fourier tranform arrays. |
static void |
realFt1D(float[] data,
int N,
float[] real,
float[] img) |
static float[][] |
realInvFt(float[][] ft) |
static float[][][] |
realInvFt(float[][][] ft) |
static void |
realInvFt1D(float[] real,
float[] img,
float[] data) |
static void |
realInvFt1D(float[] real,
float[] img,
float[] data,
int N) |
static float[][] |
scaleKernel(float[][] orig,
int n,
float max,
float min) |
static double |
sep(double[] p1,
double[] p2) |
static float |
sep(float[] p1,
float[] p2) |
static float |
sep(float[] p1,
Point2D p2) |
static float |
sep(float[] p1,
Point3D p2) |
static float |
sep(int[] p1,
int[] p2)
Eucledian distance between 2 points.
|
static float |
sep(Point2D p2,
float[] p1) |
static float |
sep(Point2D p2,
Point2D p1) |
static float |
sep(Point3D p2,
float[] p1) |
static float |
sep(java.awt.Point p2,
java.awt.Point p1) |
static java.lang.String |
setStringString(java.lang.String target,
java.lang.String key,
int skip,
java.lang.String strSep,
java.lang.String newvalue)
WO 5/18/09 trying to re-set individual values from a base dicom header, passed as 'target'
if there are multiple values on the same line, separated by some delimiter (eg "\") then need to pass that delimiter even if you want just the first value on that line -- need to know where to stop replacing characters. |
static double[] |
sph2cart(double r,
double theta,
double phi) |
static float[] |
sph2cart(float r,
float theta,
float phi)
return x,y,z in array[3]
|
static int |
sphericalHarmonicNterms(int[] orders) |
static int |
sphericalHarmonicNterms(int rorder,
int nl) |
static double |
sphericalHarmonicTerm(double r,
double theta,
double phi,
int ri,
int l,
int m)
WO my spherical harmonics expansions powered by 1/r
1/29/07 problem when r is close to 0 as 1/r blows up. |
static double[] |
sphericalHarmonicTerms(double r,
double theta,
double phi,
int rorder,
int nl)
WO my spherical harmonics expansions powered by 1/r
ref: the Numerical Recipes in C book page 252 the series is: 1 [r,l,m==0], sin(mu)cos(theta) [r=0,l=1,m=-1], cos(mu)[r=0,l=1,m=0], sin(mu)sin(theta)[r=0,l,m=1], .. |
static float[] |
sphericalHarmonicTerms(float r,
float theta,
float phi,
int rorder,
int nl) |
static float[][][] |
sphericalKernel(float rad)
WO 2/11/11 for radius[mm] spherical kernel.
|
static float[][][] |
sphericalKernel(float rad,
float padding) |
static float[][][] |
sphericalKernel(float rad,
float padding,
float dscale,
float wscale,
float hscale) |
static float[][][] |
sphericalKernel(float rad,
float padding,
float dscale,
float wscale,
float hscale,
float shiftd,
float shiftw,
float shifth) |
static float[][][] |
sphericalKernel(float rad,
float padding,
float dscale,
float wscale,
float hscale,
float shiftd,
float shiftw,
float shifth,
boolean debug)
WO 1/30/11 with fractional shifts option & making it a true partial volume calc
rad and padding are in mm dscale = dimensions of pixel in depth direction [mm] wscale = dimensions of pixel in width(x) direction [mm] d,w,h-shifts are in fractions of pixels in d,w,h directions |
static float |
triangleArea(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
uses Heron's formula
|
static float[] |
triangleNormal(float[] pt1,
float[] pt2,
float[] pt3)
want 3D outward normal to 3D triangle defined by 3 points, with the outwardness set by point order and RHR
|
static float[] |
updateSphericalHarmonicCoeffsArray(float[] oldCoeffs,
int prev_rfit,
int prev_mufit,
int new_rfit,
int new_mufit) |
static double[] |
Vcross(double[] A,
double[] B) |
static float[] |
Vcross(float[] A,
float[] B) |
static Point3D |
Vcross(Point2D A,
Point2D B) |
static float |
VcrossMag(Point2D A,
Point2D B) |
static double |
vlen(double[] a) |
static float |
vlen(float[] a) |
static double |
vlength(double[] a) |
static float |
vlength(float[] a) |
static float[] |
Vminus(float[] A,
float[] B) |
static float[] |
Vmult(float a,
float[] B) |
static void |
vnorm(float[] a) |
static void |
vnorm(Point3D a) |
static float[] |
Vplus(float[] A,
float[] B)
element-wise addition.
|
static float |
WelchWindow(float j,
float N,
float cutoff) |
static float |
WelchWindow(int j,
float N,
float cutoff) |
static float |
WelchWindow(int j,
int N,
float cutoff)
Welch window: I changed it some, replacing 'b' with 'cutoff',
and 'a' with 'N' ('a' was usually set to N/2) |
public static final int X
public static final int Y
public static final int Z
public static final double PI
public static float areaIntegral(float x, float R)
public static float computeAreaUnderArc(float X1, float X2, float R)
public static float computePixelArcArea(float Xp1, float Xp2, float Yp1, float Yp2, float R)
public static float computePixel3dArcVol(float Xp1, float Xp2, float Yp1, float Yp2, float Zp1, float Zp2, float R)
public static float[] getDistToCylAxis(float ptAxis_pxW, float ptAxis_pxH, float ptAxis_pxD, float testPt_pxW, float testPt_pxH, float testPt_pxD, float[] tangent_mm, float scaleW, float scaleH, float scaleD)
tangent_mm[]
- (float) tangent along cylinder central axis [mm] xyz (=whd) orderptAxis_pxW,H,D
- (float) point on central axis [pixels]testPt_pxW,H,D
- (float) point to compute distance to [pixels]scaleW,
- scaleH, scaleD (float) mmPerPixelW,H,Dpublic static float[] getDistToCylAxis(float ptAxis_pxW, float ptAxis_pxH, float testPt_pxW, float testPt_pxH, float[] tangent_mm, float scaleW, float scaleH)
public static float computeCylPartialVol(float ptAxis_pxW, float ptAxis_pxH, float ptAxis_pxD, float voxel_pxW, float voxel_pxH, float voxel_pxD, float[] tangent_mm, float scaleW, float scaleH, float scaleD, float R, float axialSearchLimit)
ptAxis_pxD,W,H
- (float) point on central axis [pixels]voxel_pxD,W,H
- (float) point to compute distance to [pixels] (assume is center of voxel)tangent_mm[]
- (float) tangent along cylinder central axis [mm]scaleD,
- scaleW, scaleH (float) mmPerPixelD,W,HR
- (float) radius of cylinder [mm]axialSearchLimit
- (float) limit of projected distance along cylindrical axis [mm]public static float computeCylPartialVol(float ptAxis_pxW, float ptAxis_pxH, float voxel_pxW, float voxel_pxH, float[] tangent_mm, float scaleW, float scaleH, float R, float axialSearchLimit)
public static float computeSpherePartialVol(float cen_pxW, float cen_pxH, float cen_pxD, float voxel_pxW, float voxel_pxH, float voxel_pxD, float scaleW, float scaleH, float scaleD, float R)
cen_pxD,W,H
- (float) centroid of sphere [pixels]voxel_pxD,W,H
- (float) point to compute distance to [pixels] (assume is center of voxel)scaleD,
- scaleW, scaleH (float) mmPerPixelD,W,HR
- (float) radius of sphere [mm]public static float computeSpherePartialVol(float cen_pxW, float cen_pxH, float voxel_pxW, float voxel_pxH, float scaleW, float scaleH, float R)
public static float computeOnePixel3dArcVol(float Xp1, float Xp2, float Yp1, float Yp2, float Zp1, float Zp2, float R)
public static float inwardBendAngle(Point2D a, Point2D b, Point2D c)
public static float dot(float[] a, float[] b)
public static double dot(double[] a, double[] b)
public static float[] Vcross(float[] A, float[] B)
public static double[] Vcross(double[] A, double[] B)
public static float[] Vplus(float[] A, float[] B)
public static float[] Vminus(float[] A, float[] B)
public static float[] Vmult(float a, float[] B)
public static void vnorm(float[] a)
public static void vnorm(Point3D a)
public static float vlen(float[] a)
public static float vlength(float[] a)
public static double vlen(double[] a)
public static double vlength(double[] a)
public static float sep(float[] p1, Point2D p2)
public static float sep(java.awt.Point p2, java.awt.Point p1)
public static float sep(Point2D p2, float[] p1)
public static float sep(Point3D p2, float[] p1)
public static float sep(float[] p1, Point3D p2)
public static float sep(int[] p1, int[] p2)
public static float sep(float[] p1, float[] p2)
public static double sep(double[] p1, double[] p2)
public static float line_sep2D(float testPtx, float testPty, float[] linePt1, float[] linePt2)
public static float line_sep2D(float[] testPt, float[] linePt1, float[] linePt2)
public static float line_sep(float[] testPt, float[] linePt1, float[] linePt2)
public static boolean lineSegment_sep2DlessThanThresh(float testPtx, float testPty, float[] linePt1, float[] linePt2, float thresh)
public static float plane_sep(float[] testPt, float[] planePt1, float[] planePt2, float[] planePt3)
public static float plane_sep(Point3D testPt, float[] planePt1, float[] planePt2, float[] planePt3)
public static float triangleArea(float x1, float y1, float x2, float y2, float x3, float y3)
public static float[] triangleNormal(float[] pt1, float[] pt2, float[] pt3)
public static java.lang.String decimalString(double x)
public static java.lang.String decimalString(double x, int n)
public static java.lang.String decimalString(float x)
public static java.lang.String decimalString(float x, int n)
public static double getStringValue(java.lang.String target)
public static double getStringValue(java.lang.String target, java.lang.String key)
public static double getStringValue(java.lang.String target, java.lang.String key, int skip)
public static double getStringValue(java.lang.String target, java.lang.String key, java.lang.String strSep)
public static double getStringValue(java.lang.String target, java.lang.String key, int skip, java.lang.String strSep)
key
- is inital stuff in front of numbers that you want to skip over before starting the listskip
- is how many numbers to skip between accepted numbersstrSep
- is the string separator between numbers.public static java.lang.String getStringString(java.lang.String target, java.lang.String key)
public static java.lang.String getStringString(java.lang.String target, java.lang.String key, int skip)
public static java.lang.String getStringString(java.lang.String target, java.lang.String key, java.lang.String strSep)
public static java.lang.String getStringString(java.lang.String target, java.lang.String key, int skip, java.lang.String strSep)
public static java.lang.String setStringString(java.lang.String target, java.lang.String key, int skip, java.lang.String strSep, java.lang.String newvalue)
public static Point3D getStringPoint3D(java.lang.String target, java.lang.String key)
public static Point3D getStringPoint3D(java.lang.String target, java.lang.String key, int skip)
public static Point3D getStringPoint3D(java.lang.String target, java.lang.String key, java.lang.String strsep)
public static Point3D getStringPoint3D(java.lang.String target, java.lang.String key, int skip, java.lang.String strsep)
public static Point3Dint getStringPoint3Dint(java.lang.String target, java.lang.String key, int skip, java.lang.String strsep)
public static float[] getStringValues(java.lang.String target, java.lang.String key)
public static float[] getStringValues(java.lang.String target, int nvals, java.lang.String key)
public static float[] getStringValues(java.lang.String target, int nvals, java.lang.String key, int skip)
public static float[] getStringValues(java.lang.String target, int nvals, java.lang.String key, java.lang.String strsep)
public static float[] getStringValues(java.lang.String target, int nvals, java.lang.String key, int skip, java.lang.String strsep)
public static double getDicomValue(java.lang.String dicomheader, java.lang.String key)
public static double getDicomValue(java.lang.String dicomheader, java.lang.String key, java.lang.String strsep)
public static double getDicomValue(java.lang.String dicomheader, java.lang.String key, int skip)
public static double getDicomValue(java.lang.String dicomheader, java.lang.String key, int skip, java.lang.String strsep)
public static double getDicomValue(ij.ImagePlus imp, java.lang.String key)
public static double getDicomValue(ij.ImagePlus imp, java.lang.String key, int skip)
public static double getDicomValue(java.util.Properties props, java.lang.String key)
public static double getDicomValue(java.util.Properties props, java.lang.String key, int skip)
public static Point3D getDicomPoint3D(ij.ImagePlus imp, java.lang.String key)
public static Point3D getDicomPoint3D(ij.ImagePlus imp, java.lang.String key, int skip)
public static void invertKernel(float[][] A)
public static float[][] calcCircKernel(int krad)
public static float[][][] calcSphericalKernel(int krad)
public static float[][] diskTemplate(float rad)
public static float[][] diskTemplate(float rad, float padding)
public static float[][] diskTemplate(float rad, float padding, float wscale, float hscale)
public static float[][] diskTemplate(float rad, float padding, float wscale, float hscale, float shiftw, float shifth)
rad,padding
- in mmwscale,hscale
- dimensions of pixel in width(x) direction [mm]wshift,hshift
- are in fractions of pixels in w,h directionspublic static float[][][] sphericalKernel(float rad)
public static float[][][] sphericalKernel(float rad, float padding)
public static float[][][] sphericalKernel(float rad, float padding, float dscale, float wscale, float hscale)
public static float[][][] sphericalKernel(float rad, float padding, float dscale, float wscale, float hscale, float shiftd, float shiftw, float shifth)
public static float[][][] sphericalKernel(float rad, float padding, float dscale, float wscale, float hscale, float shiftd, float shiftw, float shifth, boolean debug)
public static float[][] gaussianKernel(int n)
WO 7/12/01 4 sigma not large enough for deconvolution of gaussian, need 6 (else clipped ends give freq ripples)
public static float[][] gaussianKernel(int nx, int ny)
public static float[][] gaussianKernel(float sigma)
public static float[][] gaussianKernel(float sigmax, float sigmay)
public static float[][][] gaussianKernel(int nd, int nw, int nh)
public static float[][][] gaussianKernel(double sigmad, double sigmaw, double sigmah)
public static float[][][] gaussianKernel(float sigmad, float sigmaw, float sigmah)
public static float[][] gaussianGradKernel(int n)
public static float[][] motionBlurKernel(int blurx, int blury)
public static float[][][] beadKernel3D(int radius)
public static float beadProfile(int size, float rad_at)
public static float NormalizedBeadProfile(int size, float rad_at)
public static float[][] beadKernel(int n)
public static float[][] gradKernel(float[][] orig, int n)
public static float[][] scaleKernel(float[][] orig, int n, float max, float min)
public static float BartlettWindow(int j, float a, float b)
public static float WelchWindow(int j, int N, float cutoff)
public static float WelchWindow(int j, float N, float cutoff)
public static float WelchWindow(float j, float N, float cutoff)
public static float HannWindow(int j, float a)
public static float HannWindow(int j, float a, float cutoff)
public static float HannWindow(float j, float a, float cutoff)
public static void PowerSpectrum1D(float[] vals, float[] ps)
public static void PowerSpectrum2D(float[][] vals, float[][] ps)
public static void PowerSpectrum3D(float[][][] vals, float[][][] ps)
public static int getFFT_N(int n)
public static float[][] multFt(float[][] ftA, float[][] ftB)
public static float[][][] multFt(short[][][] ftA, float[][][] ftB)
public static float[][][] multFt(float[][][] ftA, short[][][] ftB)
public static float[][][] multFt(float[][][] ftA, float[][][] ftB)
public static float[] paddedFT(short[] A)
public static float[][] paddedFT(short[][] A)
public static float[][][] paddedFT(short[][][] A)
public static float[] paddedFT(float[] A)
public static float[][] paddedFT(float[][] A)
public static float[][][] paddedFT(float[][][] A)
public static float[][] paddedFT(short[][] A, int padW, int padH)
public static float[][][] paddedFT(short[][][] A, int padD, int padW, int padH)
public static float[][] paddedFT(float[][] A, int padW, int padH)
public static float[][][] paddedFT(float[][][] A, int padD, int padW, int padH)
public static void FTshift(short[][] A)
public static void FTshift(short[][][] A)
public static void FTshift(float[][] A)
public static void FTshift(float[][][] A)
public static void realFt1D(float[] data, float[] real, float[] img)
NR indexing after doing FT is wacky, also it is a complex number
such that G(-k) = G(k)^* (complex conjugate) and the -k values are
not stored in the array
GmixedUpComplex[0]= k==0(real only); GmixedUpComplex[1]= k==N/2(real only)
GmixedUpComplex[2]= k==1 (real); GmixedUpComplex[3]= k==1 (imaginary)
GmixedUpComplex[4]= k==2 (real); GmixedUpComplex[5]= k==2 (imaginary)s
...
GmixedUpComplex[N-2]= k==N/2(real); GmixedUpComplex[N-1]= k==N/2 (img)
public static void realFt1D(float[] data, int N, float[] real, float[] img)
public static float[] realFt(float[] data)
public static void realInvFt1D(float[] real, float[] img, float[] data)
public static void realInvFt1D(float[] real, float[] img, float[] data, int N)
public static float[][] realFt(float[][] data)
public static float[][] realInvFt(float[][] ft)
public static float[][][] realFt(float[][][] A)
WO 7/01/01 one must use both sides (+/- freq) components of the ft array in
the N1 and N2 dimensions because the right side (-freq) is not neccessarily the
complex conjugate in 3D (complex conjugate in N1 * complex conj. in N2 gives a mixture)
that is NOT == to flipping the complex conj. over the plane twice in the 3rd quadrant
WO 7/02/01 my convention for the Ft array: ft[0..N1][0..N2][0..N3 +2]
the last 2 indices of ft hold the real&img parts for freq3 = +N3/2
this last row takes care of the values stored in NR's speq array
WO 3/6/03 this routine gave same real and img values as other FFt routine, but with '-' sign applied to imaginary part
public static float[][][] realFt(byte[][][] A)
public static float[][][] realFt(short[][][] A)
public static float[][][] realFt(int[][][] A)
public static float[][][] realInvFt(float[][][] ft)
public static void four1(float[] data, int N, int isign)
public static void NRfour1(float[] data, int nn, int isign)
public static void NRrealft(float[] data, int n, int isign)
public static double parabolic_interpol(double x_at, double x1, double y1, double x2, double y2, double x3, double y3)
public static double parabolic_minMaxLoc(double x1, double y1, double x2, double y2, double x3, double y3)
public static double parabolic_minMaxVal(double x1, double y1, double x2, double y2, double x3, double y3)
public static float parabolic_interpol(float x_at, float x1, float y1, float x2, float y2, float x3, float y3)
public static float parabolic_minMaxLoc(float x1, float y1, float x2, float y2, float x3, float y3)
public static float parabolic_minMaxVal(float x1, float y1, float x2, float y2, float x3, float y3)
public static double parabolic_interpol(Point2D p_at, Point2D p1, double v1, Point2D p2, double v2, Point2D p3, double v3)
public static void parabolic_minMaxLoc(Point2D l_at, Point2D p1, double v1, Point2D p2, double v2, Point2D p3, double v3)
public static double parabolic_minMaxVal(Point2D p1, double v1, Point2D p2, double v2, Point2D p3, double v3)
public static Point2D parabolic_minMaxSoln2D(Point2D[] XYs, int npts)
public static void parabolic_interpol2D(Jama.Matrix coeffs, Point2D pt)
public static float[][] getSmoothedPolygon(Polygon2D poly)
public static float[][] getSmoothedPolygon(float[][] poly)
public static float Hermite_00(float x)
public static float Hermite_10(float x)
public static float Hermite_01(float x)
public static float Hermite_11(float x)
public static float eval_Hermite(float x, float p1, float s1, float p2, float s2)
public static double Hermite_00(double x)
public static double Hermite_10(double x)
public static double Hermite_01(double x)
public static double Hermite_11(double x)
public static double eval_Hermite(double x, double p1, double s1, double p2, double s2)
public static float gasdev(java.util.Random ranMe)
public static float[] cart2sph(float x, float y, float z)
public static double[] cart2sph(double x, double y, double z)
public static float[] sph2cart(float r, float theta, float phi)
public static double[] sph2cart(double r, double theta, double phi)
public static double sphericalHarmonicTerm(double r, double theta, double phi, int ri, int l, int m)
public static double[] sphericalHarmonicTerms(double r, double theta, double phi, int rorder, int nl)
public static float[] sphericalHarmonicTerms(float r, float theta, float phi, int rorder, int nl)
public static float[] updateSphericalHarmonicCoeffsArray(float[] oldCoeffs, int prev_rfit, int prev_mufit, int new_rfit, int new_mufit)
public static int sphericalHarmonicNterms(int[] orders)
public static int sphericalHarmonicNterms(int rorder, int nl)
public static double assocLegendre(int l, int absm, double cosmu)
absm:
- absolute value of m is passed in.cosmu:
- = cos(mu) is passed in
the series is: 1 [l,m==0], cos(mu)[l=1,m=0], sin(mu)[l,absm=1]public static double fourier_eval(int m, double theta)
public static double[] get_prosph_surf_terms(double mu, double theta, int order)
public static int get_surfaceFitting_Nterms(int order)
public static double[] get_prosph_terms(double x, double y, double z, int tfr, double F, int[] order, double[] tagNormal)
public static float[] cart2prosph(float x, float y, float z, float F)
public static float[] cart2prosph(float[] xyz, float F)
public static double[] cart2prosph(double[] xyz, double F)
public static double[] cart2prosph(double x, double y, double z, double F)
public static float[] prosph2cart(float lambda, float mu, float theta, float F)
public static float[] prosph2cart(float[] lmt, float F)
public static double[] prosph2cart(double[] xyz, double F)
public static double[] prosph2cart(double lambda, double mu, double theta, double F)