|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSeg2Dgel.Sg2glb
Seg2Dgel.Sg2cc
public class Sg2cc
Class Sg2cc computes the pixel neighborhood central core (CC) for the 2D Gel Spot Segmenter from the averaged image (pix4).
This computes two images (see Sg2glb.XXXX_CODE):
pix3 which is the central core coded image
and
pix2 which is the magnitude of the laplacian (or a monotonic
function corresponding to this magnitude).
The filters used are determined by the command line switches.
This code was derived and refactored from GELLAB-II sg2gii C
language files.
This work was produced by Peter Lemkin of the National Cancer
Institute, an agency of the United States Government. As a work of
the United States Government there is no associated copyright. It is
offered as open source software under the Mozilla Public License
(version 1.1) subject to the limitations noted in the accompanying
LEGAL file. This notice must be included with the code. The Open2Dprot
Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.
| Field Summary | |
|---|---|
static int |
nthCCImgCtr
# of current CC image being dumped |
private static int[] |
tmpB
Tmp array used in buffer swapping |
private static boolean |
useEuclideanNormFlag
use either Euclidian else city-block norm |
private static int |
xOffset
Horizontal offset for convolution. |
private static int |
yOffset
Vertical offset for convolution. |
| Constructor Summary | |
|---|---|
Sg2cc()
Sg2cc() - Constructor |
|
| Method Summary | |
|---|---|
static void |
centralCorePix(boolean euclideanNormFlag)
centralCorePix() - Compute the 2nd derivative, i.e., Laplacian, of the average of pix1 where the average was put into pix4. |
void |
dumpCCppx(boolean incNflag,
java.lang.String tag,
java.lang.String msg)
dumpCCppx() - debugging tool to dump the CC image in gellab/tmp file with name: "CCfile-nnn-tag" + pixFileExtn where 'nnn' is the current iteration # incremented if incNflag is set and 'tag' is a short string. |
private static boolean |
get3x3Laplacian(int x1,
int x2,
int y)
get3x3Laplacian() - Compute: 3x3 Laplacianfor line y [x1:x2] and save results in bufcc[x1:x2] and bufmag[x1:x2]. |
private static boolean |
get5x5Laplacian(int x1,
int x2,
int y)
get5x5Laplacian() - Compute: 5x5 Laplacian for line y [x1:x2] and save results in bufcc[x1:x2] and bufmag[x1:x2]. |
private static boolean |
getBusseLaplacian(int x1,
int x2,
int y)
getBusseLaplacian() - Compute: Busse Laplacian for line y [x1:x2] and save results in bufcc[x1:x2] and bufmag[x1:x2]. |
private static boolean |
getLineLaplacian(int x1,
int x2,
int y,
boolean horizLineFilterFlag)
getLineLaplacian() - Compute: Line filter Laplacian for line y [x1:x2] and save results in bufcc[x1:x2] and bufmag[x1:x2]. |
| Methods inherited from class Seg2Dgel.Sg2glb |
|---|
get2D, get2D, getPixLineBuf, getPixLineBuf, initGlb, isDBwindow, isDBwindow, put2Dbuf, resetGlb, set2D, set2D, setPixLineBuf, setPixLineBuf, showReportStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static int xOffset
private static int yOffset
private static int[] tmpB
private static boolean useEuclideanNormFlag
public static int nthCCImgCtr
| Constructor Detail |
|---|
public Sg2cc()
| Method Detail |
|---|
public static void centralCorePix(boolean euclideanNormFlag)
The global pixel neighborhood variables are:
i2U
3 i12 1
shift direction <=== i4L i14 i10 i10 i0R
5 i16 7
i6D
The buffering is done for the both 5x5 neighborhood for which\
the 3x3 is a subset.
That is: Absolute Magnitude(Laplacian(pix4)) ==> pix2
Direction(Laplacian(pix4)) ==> pix3
private static boolean get3x3Laplacian(int x1,
int x2,
int y)
The global 3x3 pixel neighborhood variables are:
i13 i12 i11
shift direction <=== i14 i18 i10
i15 i16 i17
0 0 0
dX = 1 -2 1
0 0 0
0 1 0
dY = 0 -2 0
0 1 0
Where, CC is 1 if dX and dY<0, else 0.
mag is magnitude fct (dX, dY).
x1 - is leftmost pixel on line to Laplacianx2 - is rightmost pixel on line to Laplaciany - is line to Laplacian
private static boolean get5x5Laplacian(int x1,
int x2,
int y)
The global 5x5 pixel neighborhood variables are:
i2U
i13 i12 i11
shift direction <=== i4L i14 i18 i10 i0R
i15 i16 i17
i6D
0 0 0 0 0
dX = 1 1 -4 1 1
0 0 0 0 0
0 1 0
0 1 0
dY = 0 -4 0
0 1 0
0 1 0
Where, CC is 1 if dX and dY<0, else 0.
mag is magnitude fct (dX, dY).
x1 - is leftmost pixel on line to Laplacianx2 - is rightmost pixel on line to Laplaciany - is line to Laplacian
private static boolean getBusseLaplacian(int x1,
int x2,
int y)
0 0 0
dX = 1 -2 1
0 0 0
0 1 0
dY = 0 -2 0
0 1 0
Where, CC is 1 if dX and dY<0, else 0.
mag is magnitude fct (dX, dY).
x1 - is leftmost pixel on line to Laplacianx2 - is rightmost pixel on line to Laplaciany - is line to Laplacian
private static boolean getLineLaplacian(int x1,
int x2,
int y,
boolean horizLineFilterFlag)
-laplacian:L,,
switch.
Current legal filters are
(lineLaplacianHeight X lineLaplacianWidth)
The Vertical line detector filter using horizonal diff
=======================================================
0 0 0
dX3 = 1 -2 1
1 -2 1
...
0 0 0
0 0 0 0 0
dX5 = 1 2 -6 2 1
1 2 -6 2 1
...
0 0 0 0 0
0 0 0 0 0 0 0
dX7 = 1 2 3 -12 3 2 1
1 2 3 -12 3 2 1
...
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
dX9 = 1 2 3 4 -20 4 3 2 1
1 2 3 4 -20 4 3 2 1
...
0 0 0 0 0 0 0 0 0
The Horizontal line detector filter using vertical diff
=======================================================
0 1 1 ... 0
dY3 = 0 -2 -2 ... 0
0 1 1 ... 0
0 1 1 ... 0
0 2 2 ... 0
dY5 = 0 -6 -6 ... 0
0 2 2 ... 0
0 1 1 ... 0
0 1 1 ... 0
0 2 2 ... 0
0 3 3 ... 0
dY7 = 0 -12 -12 ...0
0 3 3 ... 0
0 2 2 ... 0
0 1 1 ... 0
0 1 1 ... 0
0 2 2 ... 0
0 3 3 ... 0
0 4 4 ... 0
dY9 = 0 -20 -20 ... 0
0 4 4 ... 0
0 3 3 ... 0
0 2 2 ... 0
0 1 1 ... 0
Where, CC is 1 if dX and dY<0, else 0.
mag is magnitude fct (dX, dY).
x1 - is leftmost pixel on line to Laplacianx2 - is rightmost pixel on line to Laplaciany - is line to LaplacianhorizLineFilterFlag - horizontal line filter, else
vertical line filter
public void dumpCCppx(boolean incNflag,
java.lang.String tag,
java.lang.String msg)
incNflag - is true if increment ntag - is used to construct file namemsg - is inserted in image
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||