|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.db.LMset
public class LMset
Class LMset maintains the Landmark database for Open2Dprot. It contains data for a subset of spots or virtual spots in two samples that are used to define local regions of congruence. These "spots" are called landmarks since they orient the local regions. A landmark spot is a 4-tuple of coordinate data (x1,y1,x2,y2). These can be added to a landmark set up to size maxLMS. If adding a new landmark would exceed the size of the lists, then it will grow the list by increasing the size by maxLMS/4 each time.
This file is derived from early Open2Dprot CmpSpots code.
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 |
DIST_THR_LANDMARK
Default distance to accept (x,y) to existing landmark |
float[][] |
distNearestLM
distance between closest landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE] for each sample and that landmark |
float[][] |
distNextNearestLM
distance between next closest landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE] for each sample and that landmark |
boolean |
editRsampleLMSFlag
To enble editing Rsample landmark values. |
float[][] |
lmErrDist
LSQ error of landmarks to latched spots from SSF [0:nbrLandmarks-1][RSAMPLE:SAMPLE] |
static float |
MAX_RATIO_ALT_DIST_THRESHOLD
Default distance threshold to use to ignore alternate landmarks > distance |
int |
maxLMS
maximum size of the landmarks read from the landmark DB |
float[] |
minEffectiveRadius
Min effective radius distance between closest landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE] is the min of the half radius of the two samples for that landmark. |
int |
nbrLandmarks
actual size of the landmarks read from the landmark DB |
int[][] |
nearestLM
LM nearest to this one [0:nbrLandmarks-1][RSAMPLE:SAMPLE] |
int[][] |
nextNearestLM
NEXT nearest LM [0:nbrLandmarks-1][RSAMPLE:SAMPLE] |
static int |
PARAM_DEF_NBR_ALT_LMS
Default # of alternate landmarks to try for secondary pairing |
static int |
PARAM_MAX_ALT_LMS
Default max # of alternate landmarks to try for secondary pairing |
static int |
PARAM_MAXLANDMARKS
Default maximum number of landmarks i.e LM set A:Z or A:Za:z |
static int |
RSAMPLE
The index for the Rsample (Reference Sample) |
java.lang.String |
rsampleName
|
static int |
SAMPLE
The index for the Sample to be paired with the Rsample |
java.lang.String |
sampleName
|
int[][] |
setSizeLM
# of spots in the LM set [0:nbrLandmarks-1][RSAMPLE:SAMPLE] |
boolean[] |
useLM
set false if bad landmark [0:nbrLandmarks-1] |
static java.lang.String |
VERSION
Version for this module |
int[][] |
xlm
X position of landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE]. |
int[][] |
ylm
Y position of landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE]. |
Constructor Summary | |
---|---|
LMset()
LMset() - set up lndmark part of the database of size nbrLandmarks. |
|
LMset(int maxLMSallowed)
LMset() - set up lndmark part of the database of size nbrLandmarks. |
Method Summary | |
---|---|
boolean |
addLandmarkToLMset(int x1,
int y1,
int x2,
int y2)
addLandmarkToLMset() - add landmark at (x1,y1,x2,y2) to the landmark set up to maxLMS. |
boolean |
appendLandmarkToLMset(int x1,
int y1,
int x2,
int y2)
appendLandmarkToLMset() - append landmark at (x1,y1,x2,y2) to the landmark set up to maxLMS. |
boolean |
changeLandmarkToLMset(int lmN,
int x1,
int y1,
int x2,
int y2)
changeLandmarkToLMset() - change landmark lmN to (x1,y1,x2,y2) in the landmark set. |
void |
clearLMset(boolean clearBothSamplesFlag)
clearLMset() - reset the LMset state to contain no entries. |
void |
clearSampleLMset()
clearSampleLMset() - reset only the Sample LMset state to contain no entries. |
LMset |
cloneLMset()
cloneLMset() - clone a new instance of this LM set. |
void |
computeLMSradii()
computeLMSradii() - compute minimum half radii for each valid LM and save them in 'minEffectiveRadius[-]' and then their nearest neighbor's landmark number in 'nearestLM[-]'. |
boolean |
copyLMset(LMset srcC)
copyLMset() - copy specified LMset into this LM set. |
boolean |
copyRsampleLMset(LMset srcC)
copyRsampleLMset() - copy only Rsample (x,y) data in specified LMset into this LM set. |
boolean |
copySampleLMset(LMset srcC)
copySampleLMset() - copy only Sample (x,y) data in specified LMset into this LM set. |
java.lang.String |
cvLMsetToPrintStr(int k)
cvLMsetToPrintStr() - get the basic landmark data for a landmark k with just xy coords and landmark name. |
static java.lang.String |
cvLMSIdx2Name(int i)
cvLMSIdx2Name() - map an internal LMSet landmark number in the range of [0:nlandmarks-1] to a LMS letter name [0:25] maps to ["A":"Z"] and [26:51] maps to ["a":"z"]. |
static int |
cvLMSname2Idx(java.lang.String lmsLetterName)
cvLMSname2Idx() - maps landmark String letter name to a landmark index number. |
java.lang.String |
cvLMtoDetailedPrintStr(int k)
cvLMtoDetailedPrintStr() - get the full landmark data for a landmark k |
java.awt.Point |
cvXYtoOtherSample(int xS,
int yS,
int srcSample,
int dstSample,
int lmSetNbr)
cvXYtoOtherSample() - maps (x,y) from source sample to the destination sample |
boolean |
delLandmarkFromLMset(int sampleNbr,
int x,
int y)
delLandmarkFromLMset() - delete landmark at (x1,y1,x2,y2) from the landmark set if the two coordinates for the specified. |
boolean |
delLandmarkFromLMset(int x1,
int y1,
int x2,
int y2)
delLandmarkFromLMset() - delete landmark at (x1,y1,x2,y2) from landmark set if the two pairs of coordinates are within THR_LATCH_DISTANCE. |
int |
findLMbyXYcoords(int sampleNbr,
int x,
int y)
findLMbyXYcoords() - find the (x,y) in the landmark set if the smallest distance between (x,y) and the landmark is <= DIST_THR_LANDMARK. |
int |
findLMbyXYcoords(int sampleNbr,
int x,
int y,
int distThr)
findLMbyXYcoords() - find the (x,y) in the landmark set if the smallest distance between (x,y) and the landmark is <= distThr. |
java.lang.String |
getLMSDBbyNamestr(java.lang.String rSampleName,
java.lang.String sampleName)
getLMSDBbyNamestr() - get the LMset summary as a printable string. |
java.lang.String |
getLMSDBbyNamestr(java.lang.String rSampleName,
java.lang.String sampleName,
int dBugLMset)
getLMSDBbyNamestr() - get the LMset summary as a printable string. |
java.lang.String |
getLMsetStr()
getLMsetStr() - get the printable report for all landmarks in the LM set. |
java.lang.String |
getLMSstr()
getLMSstr() - get the landmark set summary as a printable string. |
java.lang.String |
getSpotLMsetRadiiStr()
getSpotLMsetRadiiStr() - get the printable report mapping all landmarks effective radii. |
java.lang.String |
getSpotLMsetRadiiStr(java.lang.String rSampleName,
java.lang.String sampleName,
int dBugLMnbr)
getSpotLMsetRadiiStr() - get the printable report mapping all landmarks effective radii. |
java.lang.String |
getSpotLMSradiiStr()
getSpotLMSradiiStr() - get the printable report mapping all landmarks effective radii. |
int |
growLMset(int newSize)
growLMset() - regrow the landmark set up to newSize. |
void |
initLMset()
initLMset() - reset the LMset state for both samples. |
java.awt.Point |
mapRsampleXYtoSample(int x,
int y)
mapRsampleXYtoSample() - map Rsample (x,y) to coordinate system of Sample. |
java.awt.Point |
mapRsampleXYtoSampleLMset(int x,
int y,
int lmN)
mapRsampleXYtoSampleLMset() - map Rsample (x,y) to coordinate system of Sample. |
java.awt.Point |
mapSampleXYtoRsample(int x,
int y)
mapSampleXYtoRsample() - map Sample (x,y) to coordinate system of Rsample. |
java.awt.Point |
mapSampleXYtoRsampleLMset(int x,
int y,
int lmN)
mapSampleXYtoRsampleLMset() - map Sample (x,y) to coordinate system of Rsample. |
boolean |
setBothLandmarksToLMset(int lmN,
int x1,
int y1,
int x2,
int y2)
setBothLandmarksToLMset() - set landmark lmN to (x1,y1,x2,y2) in the landmark set. |
void |
setLMSsetRsampleAndSampleNames(java.lang.String rsampleName,
java.lang.String sampleName)
setLMSsetRsampleAndSampleNames() - set the Rsample and Sample names |
void |
setRsampleEditEnable(boolean editRsampleLMSFlag)
setRsampleEditEnable() - enble editing Rsample landmark values. |
java.lang.String |
toBriefString()
toBriefString() - get a brief pretty-print string representation of this instance |
java.lang.String |
toBriefXML()
toBriefXML() - get a brief string representation of this instance as XML. |
java.lang.String |
toFullXML()
toFullXML() - get a full string representation of this instance as XML. |
java.lang.String |
toString()
toString() - get a full pretty-print string representation of this instance |
java.lang.String |
toXML()
toXML() - get a full string representation of this instance as XML. |
java.lang.String |
toXML(boolean useFullFlag)
toXML() - get a string representation of this instance as XML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static int PARAM_MAXLANDMARKS
public static int PARAM_MAX_ALT_LMS
public static int PARAM_DEF_NBR_ALT_LMS
public static int DIST_THR_LANDMARK
public static float MAX_RATIO_ALT_DIST_THRESHOLD
public static final int RSAMPLE
public static final int SAMPLE
public java.lang.String rsampleName
public java.lang.String sampleName
public int maxLMS
public int nbrLandmarks
public int[][] xlm
public int[][] ylm
public boolean[] useLM
public float[] minEffectiveRadius
public float[][] distNearestLM
public float[][] distNextNearestLM
public float[][] lmErrDist
public int[][] nearestLM
public int[][] nextNearestLM
public int[][] setSizeLM
public boolean editRsampleLMSFlag
Constructor Detail |
---|
public LMset()
public LMset(int maxLMSallowed)
maxLMSallowed
- to change the default.Method Detail |
---|
public void setLMSsetRsampleAndSampleNames(java.lang.String rsampleName, java.lang.String sampleName)
rsampleName
- set default RsamplesampleName
- set default Samplepublic void setRsampleEditEnable(boolean editRsampleLMSFlag)
editRsampleLMSFlag
- public LMset cloneLMset()
public boolean copyLMset(LMset srcC)
srcC
- is the LM set to copy
public boolean copyRsampleLMset(LMset srcC)
srcC
- is the LM set to copy
public boolean copySampleLMset(LMset srcC)
srcC
- is the LM set to copy
public void initLMset()
public int growLMset(int newSize)
newSize
- - if 0, then regrow maxLMS += maxLMS/4.
public void clearLMset(boolean clearBothSamplesFlag)
clearBothSamplesFlag
- to clear xy values for both the Rsample
and the Samplepublic void clearSampleLMset()
public java.lang.String getLMSstr()
public int findLMbyXYcoords(int sampleNbr, int x, int y)
sampleNbr
- is either RSAMPLE or SAMPLEx
- - Sample X coordinatesy
- - Sample Y coordinates
public int findLMbyXYcoords(int sampleNbr, int x, int y, int distThr)
sampleNbr
- is either RSAMPLE or SAMPLEx
- - Sample X coordinatesy
- - Sample Y coordinatesdistThr
- - overide default distance threshold
public boolean addLandmarkToLMset(int x1, int y1, int x2, int y2)
x1
- - Rsample X coordinatesy1
- - Rsample Y coordinatesx2
- - Sample X coordinatesy2
- - Sample Y coordinates
findLMbyXYcoords(int, int, int)
public boolean appendLandmarkToLMset(int x1, int y1, int x2, int y2)
x1
- - Rsample X coordinatesy1
- - Rsample Y coordinatesx2
- - Sample X coordinatesy2
- - Sample Y coordinates
public boolean setBothLandmarksToLMset(int lmN, int x1, int y1, int x2, int y2)
lmN
- is the landmark to set and must be >= 0 and < maxLMSx1
- - Rsample X coordinatesy1
- - Rsample Y coordinatesx2
- - Sample X coordinatesy2
- - Sample Y coordinates
public boolean changeLandmarkToLMset(int lmN, int x1, int y1, int x2, int y2)
lmN
- is the landmark to edit and must be >= 0 and < maxLMSx1
- - Rsample X coordinatesy1
- - Rsample Y coordinatesx2
- - Sample X coordinatesy2
- - Sample Y coordinates
public boolean delLandmarkFromLMset(int sampleNbr, int x, int y)
sampleNbr
- is either RSAMPLE or SAMPLEx
- - sample X coordinatesy
- - sample Y coordinates
findLMbyXYcoords(int, int, int)
public boolean delLandmarkFromLMset(int x1, int y1, int x2, int y2)
x
- - sample X coordinatesy
- - sample Y coordinatesx2
- - Sample X coordinatesy2
- - Sample Y coordinates
findLMbyXYcoords(int, int, int)
public void computeLMSradii()
getSpotLMSradiiStr()
public java.lang.String getSpotLMSradiiStr()
E.g., Table: half-radius for nearest and next-nearest landmarks Min R[A]=13 distNLM[28,26] to NLMs[D,D], distNNLM[38,38] to NNLMs[M,E] Min R[B]=18 distNLM[42,36] to NLMs[C,C], distNNLM[49,47] to NNLMs[A,A] . . . Min R[U]=44 distNLM[92,87] to NLMs[T,T], distNNLM[93,90] to NNLMs[V,V] Min R[V]=45 distNLM[93,90] to NLMs[U,U], distNNLM[112,112] to NNLMs[P,P]
computeLMSradii()
public java.lang.String getSpotLMsetRadiiStr()
E.g., Table: half-radius for nearest and next-nearest landmarks Min R[A]=13 distNLM[28,26] to NLMs[D,D], distNNLM[38,38] to NNLMs[M,E] Min R[B]=18 distNLM[42,36] to NLMs[C,C], distNNLM[49,47] to NNLMs[A,A] . . . Min R[U]=44 distNLM[92,87] to NLMs[T,T], distNNLM[93,90] to NNLMs[V,V] Min R[V]=45 distNLM[93,90] to NLMs[U,U], distNNLM[112,112] to NNLMs[P,P]
public java.lang.String getSpotLMsetRadiiStr(java.lang.String rSampleName, java.lang.String sampleName, int dBugLMnbr)
E.g., Table: half-radius for nearest and next-nearest landmarks Min R[A]=13 distNLM[28,26] to NLMs[D,D], distNNLM[38,38] to NNLMs[M,E] Min R[B]=18 distNLM[42,36] to NLMs[C,C], distNNLM[49,47] to NNLMs[A,A] . . . Min R[U]=44 distNLM[92,87] to NLMs[T,T], distNNLM[93,90] to NNLMs[V,V] Min R[V]=45 distNLM[93,90] to NLMs[U,U], distNNLM[112,112] to NNLMs[P,P]
rSampleName
- is Rsample name, if not null, for printingsampleName
- is Sample name, if not null, for printingdBugLMnbr
- to only print selected lmNbr if not -1 which prints all.
public java.lang.String getLMsetStr()
E.g., LM[A]= (209,191, 228,177) LM[B]= (178,153, 197,142) . . . x y x y Rsample Sample
public java.lang.String cvLMsetToPrintStr(int k)
E.g., LM[B]= (178,153, 197,142) x y x y Rsample Sample
public java.lang.String cvLMtoDetailedPrintStr(int k)
E.g., Min R[B]=18 distNLM[42,36] to NLMs[C,C], distNNLM[49,47] to NNLMs[A,A] i.e. radius dBtoC1 dBtoC2 dBtoA1 dBtoA2
public static java.lang.String cvLMSIdx2Name(int i)
i
- is landmark name index
public static int cvLMSname2Idx(java.lang.String lmsLetterName)
lmsLetterName
- is the lamdmark String name character
public java.awt.Point cvXYtoOtherSample(int xS, int yS, int srcSample, int dstSample, int lmSetNbr)
xS
- - source sample coordinatesyS
- - source sample coordinatessrcSample
- - source sample number (RSAMPLE or SAMPLE)dstSample
- - source sample number (SAMPLE or RSAMPLE)lmSetNbr
- - associated that coordinates belong to
public java.awt.Point mapRsampleXYtoSample(int x, int y)
x
- is Rsmple X coordinatey
- is Rsample Y coordinate
public java.awt.Point mapSampleXYtoRsample(int x, int y)
x
- is Sample X coordinatey
- is Sample Y coordinate
public java.awt.Point mapSampleXYtoRsampleLMset(int x, int y, int lmN)
x
- is Sample X coordinatey
- is Sample Y coordinatelmN
- is the landmark that (x,y) is closest to.
public java.awt.Point mapRsampleXYtoSampleLMset(int x, int y, int lmN)
x
- is Sample X coordinatey
- is Sample Y coordinatelmN
- is the landmark that (x,y) is closest to.
public java.lang.String getLMSDBbyNamestr(java.lang.String rSampleName, java.lang.String sampleName)
rSampleName
- is Rsample namesampleName
- is Sample name
public java.lang.String getLMSDBbyNamestr(java.lang.String rSampleName, java.lang.String sampleName, int dBugLMset)
rSampleName
- is Rsample namesampleName
- is Sample namedBugLMset
- is -1 to report all landmarks, else just specified one
public java.lang.String toBriefString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toBriefXML()
public java.lang.String toFullXML()
public java.lang.String toXML()
public java.lang.String toXML(boolean useFullFlag)
useFullFlag
- add full details else just brief summary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |