|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Seg2Dgel.Sg2glb Seg2Dgel.Sg2fnd
public class Sg2fnd
Class Sg2fnd finds the next spot for the 2D Gel Spot segmenter using a 4-neighbor definition of a spot. The algorithm uses a variety of theoretical (Laplacian of Gaussian) as well as heuristic methods to define the spot.
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 | |
---|---|
private static java.lang.String |
dirCode
Direction codes for debugging |
private static java.lang.String |
EAST
Direction codes for debugging |
private static int[] |
exteriorFBLg
Exterior pixel FBL stack g value |
private static int[] |
exteriorFBLx
Exterior pixel FBL stack x coordinate |
private static int[] |
exteriorFBLy
Exterior pixel FBL stack y coordinate |
private static int |
exteriorTopFBL
Size of the exterior pixel FBL stack |
static int |
interiorFBLcc
The interior FBL CC is constant so don't do a list |
static int[] |
interiorFBLg
This is the list of FBL G values[0:interiorTopFBL-1] used if optimizing the FBL. |
static int[] |
interiorFBLx
This is the list of FBL X values[0:interiorTopFBL-1] used if optimizing the FBL. |
static int[] |
interiorFBLy
This is the list of FBL Y values[0:interiorTopFBL-1] used if optimizing the FBL. |
static int |
interiorTopFBL
top of interiorFBL?[]'s stacks |
static int |
maxInteriorFBLsize
Actual allocation size of Interior stacks that are initialized when they are used |
static int |
maxInteriorTopFBL
max of interiorTopFBL |
private static int |
maxSizeExteriorFBL
Exterior pixel FBL stack size |
private static java.lang.String |
NONE
Direction codes for debugging |
private static java.lang.String |
NORTH
Direction codes for debugging |
static int[] |
propLineBuf
Temporary propagation line buffer [0:pixWidth]. |
private static java.lang.String |
SOUTH
Direction codes for debugging |
private static java.lang.String |
WEST
Direction codes for debugging |
Constructor Summary | |
---|---|
Sg2fnd()
Sg2fnd() - Constructor |
Method Summary | |
---|---|
private static void |
addInteriorCCtoFBL()
addInteriorCCtoFBL() - add the pixels in the INTERIOR FBL back to the FBL so we can do the feature calculations correctly. |
java.lang.String |
cvtInteriorFBLtoStr()
cvtInteriorFBLtoStr() - convert the interiorFBL to a string |
private static void |
fillCorners()
fillCorners() - fill corners such that the central pixel (C) is in [2:MAX_CC_CODE] and the 4-ngh pixels (N) are cc+PCC_BASE_CODE and the diagonal (E) to be filled is either BKGRD_CODE (i.e., 0), or KILL_SPOT_CODE, or ISOLATED_PIXEL_CODE in the central core image. |
private static void |
fillHolesInPCCconcavities()
fillHolesInPCCconcavities() - Fill HOLES in the propagated central core such that central pixels with (BKGRD_CODE (i.e. |
private static void |
fillIt(int x,
int y,
int propVal)
fillIt() - fill the blob corners at (x,y). |
private static void |
fillPCC(int x,
int y,
int propVal)
fillPCC() - fill the blob PCC concavities at (x,y). |
static int |
findAllSpots()
findAllSpots() - Find and segment all the spots in the image marking both the various images central-core and propagated-central-core and output image as well as computing the features which are saved in the next spot record. |
static int |
findSpot(int xstart,
int ystart,
int ccLookForCode,
DbSpot r)
findSpot() - Given a new spot pixel (x,y,ccLookForCode) find all (x,y) pairs that are 4-neighbor connected to this spot with central core pixel ccLookForCode. |
static void |
killSpotPCCandZimages()
killSpotPCCandZimages() - kill spot in FBL by writing killSpotColor codes to PCC image pix3 and output image pix5. |
static void |
killSpotPCCimage()
killSpotPCCimage() - kill spot in FBL by writing killSpotColor codes to PCC image pix3. |
static void |
killSpotZimage()
killSpotZimage() - kill spot in FBL by writing 0's to output image pix5. |
private static void |
maxPropagate()
maxPropagate() - Do 4-neighbor propagation of all CC's in Final Blob List to to PCCs to fill in any concavities on the edge of the spot so the spot is round as would be expected. |
static void |
numberComponents()
numberComponents() - Label the central core image pixels [MIN_CC_CODE : MAX_CC_CODE] mod PCC_BASE_CODE for all pixels in the Final Blob List. |
private static int |
propSpotTo2ndDrivMaxima(int x1,
int y1,
int dx,
int dy,
java.lang.String directionCode)
propSpotTo2ndDrivMaxima() - Propagate the value CC+PCC_BASE_CODE in the central core image (with pixel value CC) from (x1,y1) using (dx,dy) as the propagated central core image starting position until either see a UNLABELED_CC_CODE (i.e. |
static void |
reset()
reset() - reset any resources that must be reset for the next run of the segmenter. |
static boolean |
rmvConcavities()
rmvConcavities() - Remove UNLABELED_CC_CODE's concavities of the central core image by searching for the following pattern (in four 90-degree combinations) and replacing it with another pattern. |
static void |
rmvInteriorCCpixels()
rmvInteriorCCpixels() - remove the interior FBL cc pixels and save them in the interiorFBX[x,y,g] PDLs indexed by interiorTopFBL. |
private static void |
roundCorners()
roundCorners() - Fill corners such that the central pixel is |
private static void |
roundIt(int x,
int y,
int propVal)
roundIt() - round it in pix4 and the FBL. |
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 maxSizeExteriorFBL
private static int[] exteriorFBLx
private static int[] exteriorFBLy
private static int[] exteriorFBLg
private static int exteriorTopFBL
public static int maxInteriorFBLsize
public static int[] interiorFBLx
public static int[] interiorFBLy
public static int[] interiorFBLg
public static int interiorFBLcc
public static int interiorTopFBL
public static int maxInteriorTopFBL
public static int[] propLineBuf
private static java.lang.String NONE
private static java.lang.String WEST
private static java.lang.String EAST
private static java.lang.String SOUTH
private static java.lang.String NORTH
private static java.lang.String dirCode
Constructor Detail |
---|
public Sg2fnd()
Method Detail |
---|
public static void reset()
public static final int findAllSpots()
public static int findSpot(int xstart, int ystart, int ccLookForCode, DbSpot r)
If the image has saturated regions, then the CC may be incorrect and several (many) spots are glombed together which is bogus and may result in spots 10000 or 1000000 pixels in area and make the segmenter run a VERY long time or run out of memory. The only reasonable solution is to abort the spot finding and kill the spot. Since spots will be sized out if the area > t2Area, this is not too unreasonable. Note that the remaining connected pixels will not be caught and will result in additional bogus spots. Garbage in Garbage out...
xstart
- x coord where start looking for a spotystart
- y coord where start looking for a spotccLookForCode
- is the code where we start looking for a spotr
- is the current spot if calling this method on an existing spot
otherwise it is null
public static void rmvInteriorCCpixels()
public java.lang.String cvtInteriorFBLtoStr()
public static final boolean rmvConcavities()
Note that it would be faster if did this on edge pixels only, but the computation to find these is about the same as doing this on all of FBL. In the following, c is UNLABELED_CC_CODE. The following illustrates the remapping algorithm. c c c c c - - - - - c c c 0 c or c 0 - or c 0 c or - 0 c - - - c c - c c c - c c WEST EAST SOUTH NORTH is changed to c c c c c - - - - - c c c 0 c or c c - or c c c or - c c - - - c c - c c c - c c
public static final void numberComponents()
private static final int propSpotTo2ndDrivMaxima(int x1, int y1, int dx, int dy, java.lang.String directionCode)
x1
- y1
- dx
- dy
- directionCode
-
private static final void maxPropagate()
private static final void fillIt(int x, int y, int propVal)
x
- y
- propVal
- private static final void fillCorners()
private static final void fillPCC(int x, int y, int propVal)
x
- y
- propVal
- private static final void fillHolesInPCCconcavities()
private static final void roundIt(int x, int y, int propVal)
x
- y
- propVal
- private static final void roundCorners()
- x 0 - x x - - - or the other 3 permutations. Then check: x - - x 0 - x x x. The diagonal is then filled with the value x. NOTE: this algorithm must operate on the FBL iteratively in a relaxation scheme since pixels added could contribute to new pixels. NOTE: it has a tendency to "square up" corners. Then, update output picture (if being generated).
private static final void addInteriorCCtoFBL()
public static void killSpotPCCimage()
public static void killSpotZimage()
public static void killSpotPCCandZimages()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |