O2Plib.db.CSD
Class CSDlms

java.lang.Object
  extended by O2Plib.db.CSD.CSDglb
      extended by O2Plib.db.CSD.CSDlms

public class CSDlms
extends CSDglb

Class CSDlms contains lists of LMset landmark database for the Composite Samples Database (CSD).


 This file is derived from Open2Dprot, MAExplorer, Flicker and
 GELLAB-II 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/09 15:04:26 $ $Revision: 1.10 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 DbLM dbLM
          landmark database if it exists
 java.lang.String landmarkFile
          Landmark file name
 LMset[] lmSetsList
          list of LMsets [0:nLMsetsList-1]
 java.lang.String[] lmSetsNames
          Names of the LMsets [0:nLMsetsList-1]
 int maxLMS
          the actual number of LMS used if any.
 int nLMsetsList
          Size of list of LMsets
static java.lang.String VERSION
          Version for this module
 
Fields inherited from class O2Plib.db.CSD.CSDglb
allSetSamples, AP, batchDir, BF_IS_LMS_SPOT, BF_ISVALIDSPOT, cacheDir, cdbIsOpenFlag, condListDB, CONSOLE_FLAG, CP, CSD_DBTYPE_CACHE, CSD_DBTYPE_RDBMS, CSD_DBTYPE_TAB_DELIM, CSD_DBTYPE_UNKNOWN, CSD_DBTYPE_XML, csdAcc, csdCache, csdCacheFile, csdDatabaseFile, csdFormatMode, csdIO, csdLMS, csdName, csdRdbmsFile, csdSizes, csdTabDelimFile, csdTotals, CSDversion, csdXMLfile, dataFiltersListDB, dateCreation, dateLastSession, dbRsample, dbSample, dbSamplesListDB, dbSPFlistsDB, dBugLMsetNbr, dBugPspotNbr, dBugRspotNbr, dBugSampleNbr, EP, epSetSamples, exprListsDB, GS, LM, MAX_NODE_SAFTY_FACTOR, mrl, nbrTimesInitialized, nCondListDB, nDataFiltersDB, needToSaveCSDdataFlag, NEVER, nExprListsDB, nOclDB, nodeSaftyFactor, normListDB, nRmapsDB, nRspotListsDB, nSamplesDB, nSPFfilesUsedDB, nSPFlistsDB, oclListDB, oclNameDB, PP, ppxDir, projDir, rdbmsDir, rMapsListDB, RSAMPLE, rspotListsDB, SAMPLE, sampleNamesDB, sampleNamesUsedDB, SP, tmpDir, US, useInternalDTDflag, wrkAnotation, wrkCalib, wrkERspot, wrkExpr, wrkSetSamples, xmlDir, xSetSamples, ySetSamples
 
Constructor Summary
CSDlms()
          CSDlms() - Constructor for new CSDlms.
 
Method Summary
 boolean addLMS(LMset lms)
          addLMS() - add LMset to list of LMsets.
 boolean addLMS(LMset lms, java.lang.String sName)
          addLMS() - add LMset to list of LMsets.
 void clear()
          clear() - clear condition.
 void computeAllLMSradii()
          computeAllLMSradii() -compute the LMS radii for a sample pairs.
 boolean createLMsetListFromDbLMtable(DbLM dbLM)
          createLMsetListFromDbLMtable() - build LM set list from DbLM table
 LMset[] getListOfLMSlists()
          getListOfLMSlists() - get the list of LMset objects
 java.lang.String getLMsetsDBradiiReport(int dBugLMset)
          getLMsetsDBradiiReport() - get LMset half-radii report for all (sample, Rsample) landmarks for all CSDlms LMsets.
 java.lang.String getLMsetsDBxyValuesReport(int dBugLMset)
          getLMsetsDBxyValuesReport() - get LMset(x,y) values report for all (sample, Rsample) landmarks for all CSDlms LMsets.
 java.lang.String[] getLMSlistsNames()
          getLMSlistsNames() - get the list of LMset names
 int getRsample_xLM(int idxSample, int lmNbr)
          getRsample_xLM() - get the Rsample's nbrLM landmark X value
 int getRsample_yLM(int idxSample, int lmNbr)
          getRsample_yLM() - get the Rsample's nbrLM landmark Y value
 int getSample_xLM(int idxSample, int lmNbr)
          getSample_xLM() - get the Sample's nbrLM landmark X value
 int getSample_yLM(int idxSample, int lmNbr)
          getSample_yLM() - get the Sample's nbrLM landmark Y value
 int getSampleSpotNbr(int idxSample, int lmNbr)
          getSampleSpotNbr() - get the Sample's nbrLM landmark spotNumber value [TODO- REFACTORE] since dbLM list not in CSD with DbSpots.
 boolean getSampleUseLMflag(int idxSample, int lmNbr)
          getSampleUseLMflag() - get the sample's useLM flag
 boolean isLandmarkSpot(DbPspot ps)
          isLandmarkSpot() - test if sample's ccNbr spot is a landmark spot.
 int lookupIdxByLMS(LMset lms)
          lookupIdxByLMS() - lookup index of LMset name in list of LMsets.
 int lookupIdxByLMS(java.lang.String sName)
          lookupIdxByLMS() - lookup index of LMset name in list of LMsets.
 boolean regrowLMS(int newSize)
          regrowLMS() - grow the condition.
 boolean rmvLMS(java.lang.String sName)
          rmvLMS() - remove LMset name from list of LMsets.
 DbLM setLandmarkDB(DbLM dbLM, java.lang.String landmarkFile, int lmsFormatMode)
          setLandmarkDB() - assign the landmark DB.
 java.lang.String toString()
          toString() - get a pretty-print string representation of this instance
 java.lang.String toTabDelimitedData()
          toTabDelimitedData() - get a string representation of this instance as tab-delimited data values
 java.lang.String toTabDelimitedFields()
          toTabDelimitedFields() - get a string representation of this instance as tab-delimited data fields
 java.lang.String toXML()
          toXML() - get a string representation of this instance as XML
 int updateLMsetsFromDbLM(java.lang.String rsampleName, java.lang.String[] sampleNames)
          updateLMsetsFromDbLM() - update the LMset database from the DbLM that was previously setup.
 
Methods inherited from class O2Plib.db.CSD.CSDglb
initGlb
 
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

landmarkFile

public java.lang.String landmarkFile
Landmark file name


dbLM

public DbLM dbLM
landmark database if it exists


maxLMS

public int maxLMS
the actual number of LMS used if any.


nLMsetsList

public int nLMsetsList
Size of list of LMsets


lmSetsNames

public java.lang.String[] lmSetsNames
Names of the LMsets [0:nLMsetsList-1]


lmSetsList

public LMset[] lmSetsList
list of LMsets [0:nLMsetsList-1]

Constructor Detail

CSDlms

public CSDlms()
CSDlms() - Constructor for new CSDlms.

Method Detail

clear

public void clear()
clear() - clear condition.


setLandmarkDB

public DbLM setLandmarkDB(DbLM dbLM,
                          java.lang.String landmarkFile,
                          int lmsFormatMode)
setLandmarkDB() - assign the landmark DB. Open it if it is not already opened.

Parameters:
dbLM - to use if it is already opened.
landmarkFile - is landmark database file
lmsFormatMode - is the LMS DB format

updateLMsetsFromDbLM

public int updateLMsetsFromDbLM(java.lang.String rsampleName,
                                java.lang.String[] sampleNames)
updateLMsetsFromDbLM() - update the LMset database from the DbLM that was previously setup.

Parameters:
rSampleName - to look for
sampleNames - is a list of SPF samples paired with the Rsample
Returns:
the # of (Rsample,samples[]) LMsets updated from the LM DB.

computeAllLMSradii

public void computeAllLMSradii()
computeAllLMSradii() -compute the LMS radii for a sample pairs.


regrowLMS

public boolean regrowLMS(int newSize)
regrowLMS() - grow the condition. If the size is LEQ 0, then clear the list (set it to null).

Parameters:
newSize - of the condition list
Returns:
true if succeed

addLMS

public boolean addLMS(LMset lms,
                      java.lang.String sName)
addLMS() - add LMset to list of LMsets.

Parameters:
lms - is LMset object
sName - is LMset name
Returns:
true if succeed

addLMS

public boolean addLMS(LMset lms)
addLMS() - add LMset to list of LMsets. Use the LMset (lms.rsampleName+"-"+lms.sampleName) for the name

Parameters:
lms - is LMset object
Returns:
true if succeed

lookupIdxByLMS

public int lookupIdxByLMS(java.lang.String sName)
lookupIdxByLMS() - lookup index of LMset name in list of LMsets.

Parameters:
sName - is LMset name
Returns:
-1 if failed, else the index if succeed

lookupIdxByLMS

public int lookupIdxByLMS(LMset lms)
lookupIdxByLMS() - lookup index of LMset name in list of LMsets.

Parameters:
lms - is LMset object
Returns:
-1 if failed, else the index if succeed

rmvLMS

public boolean rmvLMS(java.lang.String sName)
rmvLMS() - remove LMset name from list of LMsets.

Parameters:
sName - is LMset name
Returns:
true if succeed

getLMSlistsNames

public java.lang.String[] getLMSlistsNames()
getLMSlistsNames() - get the list of LMset names

Returns:
list if succeed else null

getListOfLMSlists

public LMset[] getListOfLMSlists()
getListOfLMSlists() - get the list of LMset objects

Returns:
list if succeed else null

createLMsetListFromDbLMtable

public boolean createLMsetListFromDbLMtable(DbLM dbLM)
createLMsetListFromDbLMtable() - build LM set list from DbLM table

Returns:
list if succeed else null

getLMsetsDBxyValuesReport

public java.lang.String getLMsetsDBxyValuesReport(int dBugLMset)
getLMsetsDBxyValuesReport() - get LMset(x,y) values report for all (sample, Rsample) landmarks for all CSDlms LMsets.

Parameters:
dBugLMset - is -1 to report all landmarks, else just specified one
Returns:
report string

getLMsetsDBradiiReport

public java.lang.String getLMsetsDBradiiReport(int dBugLMset)
getLMsetsDBradiiReport() - get LMset half-radii report for all (sample, Rsample) landmarks for all CSDlms LMsets. This reports half radius for nearest and next nearest landmarks for all landmarks.

Parameters:
dBugLMset - is -1 to report all landmarks, else just specified one
Returns:
report string

getSampleUseLMflag

public boolean getSampleUseLMflag(int idxSample,
                                  int lmNbr)
getSampleUseLMflag() - get the sample's useLM flag

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

getSampleSpotNbr

public int getSampleSpotNbr(int idxSample,
                            int lmNbr)
getSampleSpotNbr() - get the Sample's nbrLM landmark spotNumber value [TODO- REFACTORE] since dbLM list not in CSD with DbSpots.

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

getSample_xLM

public int getSample_xLM(int idxSample,
                         int lmNbr)
getSample_xLM() - get the Sample's nbrLM landmark X value

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

getSample_yLM

public int getSample_yLM(int idxSample,
                         int lmNbr)
getSample_yLM() - get the Sample's nbrLM landmark Y value

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

getRsample_xLM

public int getRsample_xLM(int idxSample,
                          int lmNbr)
getRsample_xLM() - get the Rsample's nbrLM landmark X value

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

getRsample_yLM

public int getRsample_yLM(int idxSample,
                          int lmNbr)
getRsample_yLM() - get the Rsample's nbrLM landmark Y value

Parameters:
idxSample - index of sample to use
lmNbr - to get
Returns:
value

isLandmarkSpot

public boolean isLandmarkSpot(DbPspot ps)
isLandmarkSpot() - test if sample's ccNbr spot is a landmark spot.

Parameters:
ps - is DbPspot to test
Returns:
value

toString

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

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

toTabDelimitedFields

public java.lang.String toTabDelimitedFields()
toTabDelimitedFields() - get a string representation of this instance as tab-delimited data fields

Returns:
string representation of this instance

toTabDelimitedData

public java.lang.String toTabDelimitedData()
toTabDelimitedData() - get a string representation of this instance as tab-delimited data values

Returns:
string representation of this instance

toXML

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

Returns:
string representation of this instance