|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Seg2Dgel.Sg2glb Seg2Dgel.Sg2notch
public class Sg2notch
Class Sg2notch performs a spot boundary notch analysis for the 2D gel segmenter.
This algorithm is based on an algorithm for region splitting based on chain codes used in bone marrow smear image analysis described in: Lemkin, P.: An approach to region splitting. Computer Graphics and Image Processing, 10: 281-288 (1979).
This code was derived and refactored from GELLAB-II sg2gii and libr 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 |
BND_MIN_NOTCH_ALIGN_ANGLE_THR
align. |
static int |
BND_MIN_NOTCH_ALIGN_RATIO_THR
align. |
static int |
BND_MIN_NOTCH_ANGLE_DIFF_THR
Diff angle < value to be notch point. |
static int |
BND_MIN_NOTCH_PEAK_DIST_THR
min pixel dist between MaxMin peaks |
static int |
BND_MIN_NOTCH_STRENGTH_THR
min # adj points w/decreasing angle |
static int |
BND_NOTCH_DIST_OFFSET
Pixels for 180 micron/pixel. |
static boolean |
dbugFlag
Debugging flag |
static int |
INITIAL_MAXNOTCHES
Max # of notches |
static int |
maxNotchesAlloc
initial # of notches size allocation |
private static int[] |
maxPeakXbot
Peak tables [1:n] |
private static int[] |
maxPeakXleft
Peak tables [1:n] |
private static int[] |
maxPeakXright
Peak tables [1:n] |
private static int[] |
maxPeakXtop
Peak tables [1:n] |
private static int[] |
maxPeakYbot
Peak tables [1:n] |
private static int[] |
maxPeakYleft
Peak tables [1:n] |
private static int[] |
maxPeakYright
Peak tables [1:n] |
private static int[] |
maxPeakYtop
Peak tables [1:n] |
static int |
minNotchAlignAngleThr
align. |
static int |
minNotchAlignRatioThr
align. |
static int |
minNotchAngleDiffThr
diff angle < value to be notch point. |
static int |
minNotchPeakDistThr
Notch distance between peaks threshold |
static int |
minNotchStrengthThr
# points w/adjacent min angle |
private static int[] |
minPeakXbot
Peak tables [1:n] |
private static int[] |
minPeakXleft
Peak tables [1:n] |
private static int[] |
minPeakXright
Peak tables [1:n] |
private static int[] |
minPeakXtop
Peak tables [1:n] |
private static int[] |
minPeakYbot
Peak tables [1:n] |
private static int[] |
minPeakYleft
Peak tables [1:n] |
private static int[] |
minPeakYright
Peak tables [1:n] |
private static int[] |
minPeakYtop
Peak tables [1:n] |
int |
nNotches
# of notches found |
int |
nNotchPairs
# of notch pairs |
static int |
notchDistOffset
dist. |
int[] |
notchIndices
Notch sub-objects - [0:nNotches-1] List of chain code indices for notches detected |
int[] |
notchPair1X
Notch 1 X sub-objects - [0:nNotches-1] 1st notch pair member |
int[] |
notchPair1Y
Notch 1 Y sub-objects - [0:nNotches-1] 1st notch pair member |
int[] |
notchPair2X
Notch 1 X sub-objects - [0:nNotches-1] 2nd notch pair member |
int[] |
notchPair2Y
Notch 2 Y sub-objects - [0:nNotches-1] 2nd notch pair member |
Constructor Summary | |
---|---|
Sg2notch()
Sg2notch() - Constructor |
Method Summary | |
---|---|
void |
deleteBndAndNotch(DbBoundary bnd)
deleteBndAndNotch() - delete the boundary data structure data and the notch data, but keep the empty object. |
private void |
drawLineBetweenNotchPair(int idxNotchPair,
DbBoundary drawListBnd)
drawLineBetweenNotchPair() - split PPX image by drawing a line of 'color' of 1 pixel width between the two points of the notch-pair idxNotchPair. |
int[] |
findMinMaxPeaksInRLM(int minI,
int maxI,
int[] rlm,
int[] minPeakI,
int[] minPeakR,
int[] maxPeakI,
int[] maxPeakR)
findMinMaxPeaksInRLM() - find minPeak{IR}[1:nMin] and maxPeak{IR}[1:nMax] in rlm[minI:maxI] data such that peaks are at least tminDist apart. |
private int |
findNotchesInChainCode(DbBoundary bnd)
findNotchesInChainCode()- find notches in smoothed chain code. |
private int |
findPairedNotchesInRLM(DbBoundary bnd)
findPairedNotchesInRLM() - find notches in RLMs generated by findBoundary(). |
void |
init(int minNotchPeakDistThr,
int minNotchAngleDiffThr,
int minNotchAlignAngleThr,
int minNotchAlignRatioThr,
int minNotchStrengthThr,
int notchDistOffset,
int maxNotchesAlloc)
init() - init any globals required i.e. |
private int |
pairChainCodeNotches(DbBoundary bnd)
pairChainCodeNotches() - return a list of paired notches. |
private int |
pushXYintoFBLandInterpolateLine(DbBoundary drawBnd,
int x1,
int y1,
int x2,
int y2)
pushXYintoFBLandInterpolateLine() - interpolate two points (x1,y1) to point (x2,y2) into a list of x,y coordinates which are pushed into the boundary. |
void |
resetNotchDB()
resetNotchDB() - reset the notch database |
static void |
setDbugFlag(boolean debugFlag)
setDbugFlag() - set the debug flag |
DbBoundary |
splitPixByFBLboundaryAnal(boolean useFindRLMnotchPointsFlag)
splitPixByFBLboundaryAnal() - analyze boundary derived from FBL and split image by drawing lines between well-formed notch pairs. |
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 |
---|
public static final int INITIAL_MAXNOTCHES
public static final int BND_MIN_NOTCH_PEAK_DIST_THR
public static final int BND_MIN_NOTCH_ALIGN_ANGLE_THR
public static final int BND_MIN_NOTCH_ALIGN_RATIO_THR
public static final int BND_MIN_NOTCH_ANGLE_DIFF_THR
public static final int BND_MIN_NOTCH_STRENGTH_THR
public static final int BND_NOTCH_DIST_OFFSET
public static int minNotchPeakDistThr
public static int minNotchAngleDiffThr
public static int minNotchAlignAngleThr
public static int minNotchAlignRatioThr
public static int notchDistOffset
public static int minNotchStrengthThr
public static int maxNotchesAlloc
public static boolean dbugFlag
private static int[] minPeakXtop
private static int[] maxPeakXtop
private static int[] minPeakYtop
private static int[] maxPeakYtop
private static int[] minPeakXbot
private static int[] maxPeakXbot
private static int[] minPeakYbot
private static int[] maxPeakYbot
private static int[] minPeakXleft
private static int[] maxPeakXleft
private static int[] minPeakYleft
private static int[] maxPeakYleft
private static int[] minPeakXright
private static int[] maxPeakXright
private static int[] minPeakYright
private static int[] maxPeakYright
public int[] notchIndices
public int[] notchPair1X
public int[] notchPair2X
public int[] notchPair1Y
public int[] notchPair2Y
public int nNotches
public int nNotchPairs
Constructor Detail |
---|
public Sg2notch()
Method Detail |
---|
public static void setDbugFlag(boolean debugFlag)
debugFlag
- to setpublic void resetNotchDB()
public void init(int minNotchPeakDistThr, int minNotchAngleDiffThr, int minNotchAlignAngleThr, int minNotchAlignRatioThr, int minNotchStrengthThr, int notchDistOffset, int maxNotchesAlloc)
minNotchPeakDistThr
- - default values if not zero.minNotchAngleDiffThr
- minNotchAlignAngleThr
- minNotchAlignRatioThr
- minNotchStrengthThr
- notchDistOffset
- maxNotchesAlloc
- public int[] findMinMaxPeaksInRLM(int minI, int maxI, int[] rlm, int[] minPeakI, int[] minPeakR, int[] maxPeakI, int[] maxPeakR)
TOP boundary min1 min2 min3 /-----\ /--------\ /-------\ / \ max1 / \ max2 / \ / \-------/ \------/ | \ | \ /-------\ /------\ / \------/ min1 \----------/ min2 \-------/ max1 max2 max3 BOTTOM boundaryNOTE: the current peak finder grabs the LAST one of a run. If there are several with the same value, we should really backup the saved 'I' to 1/2 the run length!
minI
- is start of datamaxI
- is end of datarlm
- is rlm[minI:maxI] data to analyze for peaksminPeakI
- is [0:nMin-1] Peaks at minimum valuesminPeakR
- is [0:nMin-1] Peaks at minimum valuesmaxPeakI
- is [0:nMax-1] Peaks at minimum valuesmaxPeakR
- is [0:nMax-1] Peaks at maximum values
private int findPairedNotchesInRLM(DbBoundary bnd)
TOP boundary min1 min2 min3 /-----\ /--------\ /-------\ / \ max1 / \ max2 / \ / \-------/ \------/ | \ | \ /-------\ /------\ / \------/ min1 \----------/ min2 \-------/ max1 max2 max3 BOTTOM boundary
bnd
- is the boundary to convert
private int findNotchesInChainCode(DbBoundary bnd)
a1 (i-1) (i+1) a2 a1 \ A / ------> A > 180deg \ / \ A < 180deg \/ \ a2 (i)Normally as we go around a boundary the angle is < 45 degrees for a smoothed boundary since the object is CONVEX. However, if it drops below minNotchAngleDiffThr, then call it a notch point and push it.
bnd
- is the boundary to analyze
private int pairChainCodeNotches(DbBoundary bnd)
dPerp/dNotch > minNotchAlignRatioThr [TODO] Could add test to check if corresponding notch angles align as well.
ARGS IN: bnd(notchIndices[], nNotches) ARGS OUT: bnd(notchPair1XY[], notchPair2XY[], nNotchPairs)
bnd
- is the boundary to analyzeprivate void drawLineBetweenNotchPair(int idxNotchPair, DbBoundary drawListBnd)
ARGS IN: bnd(notchIndices[],idxNotchPair,notchPair1[],notchPair2[]) ppx[] ARGS OUT: ppx[]
bnd
- is the boundary to analyzeidxNotchPair
- is the notch pair to split PPXdrawListBnd
- is the drawing list boundary of pixels to zapprivate int pushXYintoFBLandInterpolateLine(DbBoundary drawBnd, int x1, int y1, int x2, int y2)
drawBnd
- is boundary to draw the line intox1
- starting X coordinatey1
- starting Y coordinatex2
- ending X coordinatey2
- ending Y coordinate
public DbBoundary splitPixByFBLboundaryAnal(boolean useFindRLMnotchPointsFlag)
useFindRLMnotchPointsFlag
- if true analyze by RLM not boundary
this is !justXYCflag ==> all structs
public void deleteBndAndNotch(DbBoundary bnd)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |