O2Plib.db
Class LMset

java.lang.Object
  extended by O2Plib.db.LMset
Direct Known Subclasses:
DbLM

public class LMset
extends java.lang.Object

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/.

Version:
$Date: 2005/12/21 23:50:18 $ $Revision: 1.18 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

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

VERSION

public static final java.lang.String VERSION
Version for this module

See Also:
Constant Field Values

PARAM_MAXLANDMARKS

public static int PARAM_MAXLANDMARKS
Default maximum number of landmarks i.e LM set A:Z or A:Za:z


PARAM_MAX_ALT_LMS

public static int PARAM_MAX_ALT_LMS
Default max # of alternate landmarks to try for secondary pairing


PARAM_DEF_NBR_ALT_LMS

public static int PARAM_DEF_NBR_ALT_LMS
Default # of alternate landmarks to try for secondary pairing


DIST_THR_LANDMARK

public static int DIST_THR_LANDMARK
Default distance to accept (x,y) to existing landmark


MAX_RATIO_ALT_DIST_THRESHOLD

public static float MAX_RATIO_ALT_DIST_THRESHOLD
Default distance threshold to use to ignore alternate landmarks > distance


RSAMPLE

public static final int RSAMPLE
The index for the Rsample (Reference Sample)

See Also:
Constant Field Values

SAMPLE

public static final int SAMPLE
The index for the Sample to be paired with the Rsample

See Also:
Constant Field Values

rsampleName

public java.lang.String rsampleName

sampleName

public java.lang.String sampleName

maxLMS

public int maxLMS
maximum size of the landmarks read from the landmark DB


nbrLandmarks

public int nbrLandmarks
actual size of the landmarks read from the landmark DB


xlm

public int[][] xlm
X position of landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE]. Note: a -1 value means undefined.


ylm

public int[][] ylm
Y position of landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE]. Note: a -1 value means undefined.


useLM

public boolean[] useLM
set false if bad landmark [0:nbrLandmarks-1]


minEffectiveRadius

public 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.


distNearestLM

public float[][] distNearestLM
distance between closest landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE] for each sample and that landmark


distNextNearestLM

public float[][] distNextNearestLM
distance between next closest landmarks [0:nbrLandmarks-1][RSAMPLE:SAMPLE] for each sample and that landmark


lmErrDist

public float[][] lmErrDist
LSQ error of landmarks to latched spots from SSF [0:nbrLandmarks-1][RSAMPLE:SAMPLE]


nearestLM

public int[][] nearestLM
LM nearest to this one [0:nbrLandmarks-1][RSAMPLE:SAMPLE]


nextNearestLM

public int[][] nextNearestLM
NEXT nearest LM [0:nbrLandmarks-1][RSAMPLE:SAMPLE]


setSizeLM

public int[][] setSizeLM
# of spots in the LM set [0:nbrLandmarks-1][RSAMPLE:SAMPLE]


editRsampleLMSFlag

public boolean editRsampleLMSFlag
To enble editing Rsample landmark values. This flag prevents changing the values of the Rsample while allowing changing of the Sample values. NOTE: must set true to change Rsample landmarks.

Constructor Detail

LMset

public LMset()
LMset() - set up lndmark part of the database of size nbrLandmarks.


LMset

public LMset(int maxLMSallowed)
LMset() - set up lndmark part of the database of size nbrLandmarks.

Parameters:
maxLMSallowed - to change the default.
Method Detail

setLMSsetRsampleAndSampleNames

public void setLMSsetRsampleAndSampleNames(java.lang.String rsampleName,
                                           java.lang.String sampleName)
setLMSsetRsampleAndSampleNames() - set the Rsample and Sample names

Parameters:
rsampleName - set default Rsample
sampleName - set default Sample

setRsampleEditEnable

public void setRsampleEditEnable(boolean editRsampleLMSFlag)
setRsampleEditEnable() - enble editing Rsample landmark values. This flag prevents changing the values of the Rsample while allowing changing of the Sample values.

Parameters:
editRsampleLMSFlag -

cloneLMset

public LMset cloneLMset()
cloneLMset() - clone a new instance of this LM set.

Returns:
a cloned instance of this instance.

copyLMset

public boolean copyLMset(LMset srcC)
copyLMset() - copy specified LMset into this LM set.

Parameters:
srcC - is the LM set to copy
Returns:
true if succeed and srcC has been copied to this.

copyRsampleLMset

public boolean copyRsampleLMset(LMset srcC)
copyRsampleLMset() - copy only Rsample (x,y) data in specified LMset into this LM set.

Parameters:
srcC - is the LM set to copy
Returns:
true if succeed and srcC has been copied to this.

copySampleLMset

public boolean copySampleLMset(LMset srcC)
copySampleLMset() - copy only Sample (x,y) data in specified LMset into this LM set.

Parameters:
srcC - is the LM set to copy
Returns:
true if succeed and srcC has been copied to this.

initLMset

public void initLMset()
initLMset() - reset the LMset state for both samples.


growLMset

public int growLMset(int newSize)
growLMset() - regrow the landmark set up to newSize. If adding the new landmark would exceed the size of the lists, then grow the list. If it grows the list and you did not specify the size newSize, the maxLMS grows by maxLMS/4. It copies data up to [0:nbrLandmarks-1].

Parameters:
newSize - - if 0, then regrow maxLMS += maxLMS/4.
Returns:
new maxLMS size. Return 0 if set was never allocated in which case it must be inited.

clearLMset

public void clearLMset(boolean clearBothSamplesFlag)
clearLMset() - reset the LMset state to contain no entries.

Parameters:
clearBothSamplesFlag - to clear xy values for both the Rsample and the Sample

clearSampleLMset

public void clearSampleLMset()
clearSampleLMset() - reset only the Sample LMset state to contain no entries. it does not clear the Rsample side.


getLMSstr

public java.lang.String getLMSstr()
getLMSstr() - get the landmark set summary as a printable string.

Returns:
string

findLMbyXYcoords

public 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.

Parameters:
sampleNbr - is either RSAMPLE or SAMPLE
x - - Sample X coordinates
y - - Sample Y coordinates
Returns:
index of landmark if match, else -1 if failed

findLMbyXYcoords

public 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.

Parameters:
sampleNbr - is either RSAMPLE or SAMPLE
x - - Sample X coordinates
y - - Sample Y coordinates
distThr - - overide default distance threshold
Returns:
index of landmark if match, else -1 if failed

addLandmarkToLMset

public 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. If adding the new landmark would exceed the size of the lists, then grow the list. If it grows the list, the maxLMS grows (increase by 1/4 the size each time). Only add a new Rsample landmark if editRsampleLMSFlag is set. We search for (x,y) in Rsample and/or Sample that are within THR_LATCH_DISTANCE. [TODO] Check if regrowing the maxLMS might cause problems elsewhere. in which case would need to change the caller's paradigm.

Parameters:
x1 - - Rsample X coordinates
y1 - - Rsample Y coordinates
x2 - - Sample X coordinates
y2 - - Sample Y coordinates
Returns:
true if succeed, false if problems or more than maxLMS landmarks already are defined.
See Also:
findLMbyXYcoords(int, int, int)

appendLandmarkToLMset

public 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. If adding the new landmark would exceed the size of the lists, then grow the list. If it grows the list, the maxLMS grows (increase by 1/4 the size each time).

Parameters:
x1 - - Rsample X coordinates
y1 - - Rsample Y coordinates
x2 - - Sample X coordinates
y2 - - Sample Y coordinates
Returns:
false if did not need to regrow the list and true if it did.

setBothLandmarksToLMset

public 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.

Parameters:
lmN - is the landmark to set and must be >= 0 and < maxLMS
x1 - - Rsample X coordinates
y1 - - Rsample Y coordinates
x2 - - Sample X coordinates
y2 - - Sample Y coordinates
Returns:
true if succeed

changeLandmarkToLMset

public 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. Only change a Rsample landmark if editRsampleLMSFlag is set.

Parameters:
lmN - is the landmark to edit and must be >= 0 and < maxLMS
x1 - - Rsample X coordinates
y1 - - Rsample Y coordinates
x2 - - Sample X coordinates
y2 - - Sample Y coordinates
Returns:
true if succeed

delLandmarkFromLMset

public 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. If editRsampleLMSFlag is set, then delete the landmark otherwise set the Sample (x,y) to (-1,-1). If editRsampleLMSFlag is NOT set, then we are allowed to shrink the size of the LM set. We search for (x,y) in Sample that is within THR_LATCH_DISTANCE.

Parameters:
sampleNbr - is either RSAMPLE or SAMPLE
x - - sample X coordinates
y - - sample Y coordinates
Returns:
true if succeed, false if a problem or no more spots to delete.
See Also:
findLMbyXYcoords(int, int, int)

delLandmarkFromLMset

public 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. If editRsampleLMSFlag is set, then delete the landmark.

Parameters:
x - - sample X coordinates
y - - sample Y coordinates
x2 - - Sample X coordinates
y2 - - Sample Y coordinates
Returns:
true if succeed, false if !editRsampleLMSFlag or not the same landmark.
See Also:
findLMbyXYcoords(int, int, int)

computeLMSradii

public 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[-]'.

See Also:
getSpotLMSradiiStr()

getSpotLMSradiiStr

public java.lang.String getSpotLMSradiiStr()
getSpotLMSradiiStr() - get the printable report mapping all landmarks effective radii.
 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]

Returns:
report string
See Also:
computeLMSradii()

getSpotLMsetRadiiStr

public java.lang.String getSpotLMsetRadiiStr()
getSpotLMsetRadiiStr() - get the printable report mapping all landmarks effective radii.
 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]

Returns:
report string

getSpotLMsetRadiiStr

public java.lang.String getSpotLMsetRadiiStr(java.lang.String rSampleName,
                                             java.lang.String sampleName,
                                             int dBugLMnbr)
getSpotLMsetRadiiStr() - get the printable report mapping all landmarks effective radii.
 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]

Parameters:
rSampleName - is Rsample name, if not null, for printing
sampleName - is Sample name, if not null, for printing
dBugLMnbr - to only print selected lmNbr if not -1 which prints all.
Returns:
report string

getLMsetStr

public java.lang.String getLMsetStr()
getLMsetStr() - get the printable report for all landmarks in the LM set.
 E.g., 
 LM[A]= (209,191, 228,177)
 LM[B]= (178,153, 197,142)
            . . .    
          x   y    x   y
         Rsample  Sample 

Returns:
report string

cvLMsetToPrintStr

public java.lang.String cvLMsetToPrintStr(int k)
cvLMsetToPrintStr() - get the basic landmark data for a landmark k with just xy coords and landmark name.
 E.g., 
 LM[B]= (178,153, 197,142)
          x   y    x   y
         Rsample  Sample 

Returns:
report string

cvLMtoDetailedPrintStr

public java.lang.String cvLMtoDetailedPrintStr(int k)
cvLMtoDetailedPrintStr() - get the full landmark data for a landmark 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

Returns:
report string

cvLMSIdx2Name

public 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"].

Parameters:
i - is landmark name index
Returns:
the letter code String, else "N.A" if not legal LMset number

cvLMSname2Idx

public static int cvLMSname2Idx(java.lang.String lmsLetterName)
cvLMSname2Idx() - maps landmark String letter name to a landmark index number. It maps ["A":"Z"] ==> 0:25, and ["a":"z"]==>26:51. If the landmark number is already be a numeric string "1", "2", ... corresponding to "A", "B", ... it will be mapped to 0, 1, ... Note: "1", "2", "3", "4", ... are the Table values, whereas 0, 1 , 2, 3, ... are the LMset internal numeric values.

Parameters:
lmsLetterName - is the lamdmark String name character
Returns:
the landmark name index, else -1 if not legal LM name letter

cvXYtoOtherSample

public 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

Parameters:
xS - - source sample coordinates
yS - - source sample coordinates
srcSample - - source sample number (RSAMPLE or SAMPLE)
dstSample - - source sample number (SAMPLE or RSAMPLE)
lmSetNbr - - associated that coordinates belong to
Returns:
mapped point (xD,yD) in destination sample space.

mapRsampleXYtoSample

public java.awt.Point mapRsampleXYtoSample(int x,
                                           int y)
mapRsampleXYtoSample() - map Rsample (x,y) to coordinate system of Sample.

Parameters:
x - is Rsmple X coordinate
y - is Rsample Y coordinate
Returns:
mapped coordinates, else null

mapSampleXYtoRsample

public java.awt.Point mapSampleXYtoRsample(int x,
                                           int y)
mapSampleXYtoRsample() - map Sample (x,y) to coordinate system of Rsample.

Parameters:
x - is Sample X coordinate
y - is Sample Y coordinate
Returns:
mapped coordinates, else null

mapSampleXYtoRsampleLMset

public java.awt.Point mapSampleXYtoRsampleLMset(int x,
                                                int y,
                                                int lmN)
mapSampleXYtoRsampleLMset() - map Sample (x,y) to coordinate system of Rsample.

Parameters:
x - is Sample X coordinate
y - is Sample Y coordinate
lmN - is the landmark that (x,y) is closest to.
Returns:
mapped coordinates, else null

mapRsampleXYtoSampleLMset

public java.awt.Point mapRsampleXYtoSampleLMset(int x,
                                                int y,
                                                int lmN)
mapRsampleXYtoSampleLMset() - map Rsample (x,y) to coordinate system of Sample.

Parameters:
x - is Sample X coordinate
y - is Sample Y coordinate
lmN - is the landmark that (x,y) is closest to.
Returns:
mapped coordinates, else null

getLMSDBbyNamestr

public java.lang.String getLMSDBbyNamestr(java.lang.String rSampleName,
                                          java.lang.String sampleName)
getLMSDBbyNamestr() - get the LMset summary as a printable string. This includes the list of landmark coordinates and whether the landmarks are inside the sample's CWs. If the names are null don't print the title line.

Parameters:
rSampleName - is Rsample name
sampleName - is Sample name
Returns:
string if found data. Data is in LMset instance state.

getLMSDBbyNamestr

public java.lang.String getLMSDBbyNamestr(java.lang.String rSampleName,
                                          java.lang.String sampleName,
                                          int dBugLMset)
getLMSDBbyNamestr() - get the LMset summary as a printable string. This includes the list of landmark coordinates and whether the landmarks are inside the sample's CWs. If the names are null don't print the title line.

Parameters:
rSampleName - is Rsample name
sampleName - is Sample name
dBugLMset - is -1 to report all landmarks, else just specified one
Returns:
string if found data. Data is in LMset instance state.

toBriefString

public java.lang.String toBriefString()
toBriefString() - get a brief pretty-print string representation of this instance

Returns:
string representation of this instance

toString

public java.lang.String toString()
toString() - get a full pretty-print string representation of this instance

Overrides:
toString in class java.lang.Object
Returns:
string representation of this instance

toBriefXML

public java.lang.String toBriefXML()
toBriefXML() - get a brief string representation of this instance as XML. Just list values. Do Not include the sample names.

Returns:
string representation of this instance

toFullXML

public java.lang.String toFullXML()
toFullXML() - get a full string representation of this instance as XML. Use full representation.

Returns:
string representation of this instance

toXML

public java.lang.String toXML()
toXML() - get a full string representation of this instance as XML. Use full representation.

Returns:
string representation of this instance

toXML

public java.lang.String toXML(boolean useFullFlag)
toXML() - get a string representation of this instance as XML.

Parameters:
useFullFlag - add full details else just brief summary
Returns:
string representation of this instance