CmpSpots
Class CmpAssign

java.lang.Object
  extended by CmpSpots.Cmpglb
      extended by CmpSpots.CmpAssign

public class CmpAssign
extends Cmpglb

Class CmpAssign assigns spots to landmark sets for the 2D spot pairing program. Al spot-pairing label code assignments are made in methods in this class. It also contains a method to assign all of the SSF spots to individual landmark set subsets of spots (per sample and landmark number). The latter method also computes a small number of next nearest landmarks stored in the alternated landmark list for each spot.

This code was derived and refactored from GELLAB-II cmpgl2 C language files as well as the Open2Dprot Seg2Dgel program.

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/10/20 12:20:34 $ $Revision: 1.23 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702
See Also:
Open2Dprot Home

Field Summary
 
Fields inherited from class CmpSpots.Cmpglb
acc, accDatabaseFile, accFile, accFormatMode, AP, applicationName, argsV, asgn, banner, bannerTitle, baseImageFileNameRsample, baseImageFileNameSample, batchDir, cacheDir, cmpspotsURL, commutativeLMSswitch, CONSOLE_FLAG, CP, cs, data, DATE, dbLM, dbRsample, dbSample, DBUG_ALL_SSF_SPOTS, DBUG_APPEND, DBUG_ASSIGN_CODES, DBUG_ASSIGN_SSF_TO_LMS, DBUG_COMPUTE_RADII, DBUG_CONSOLE, DBUG_DUMP_LM_SET_SPOTS, DBUG_DUMP_PREFACE_EPILOGUE, DBUG_DUMP_SPF, DBUG_FIND_LMS_IN_SSFS, DBUG_FREE_0200000, DBUG_FREE_04000, DBUG_INITIAL_SPOT_PAIRING, DBUG_PRINT_AT, DBUG_PRINT_FULL_NODE_INFO, DBUG_PRINT_LMS_SET_SPOTS, DBUG_PRINT_LMS_SPOT_MAPPING, DBUG_READ_LANDMARKS, DBUG_READ_SSF_DATA, DBUG_SECONDARY_PAIRING, DBUG_SPECIFIC_SPOTS, DBUG_SWITCH_ANALYSIS, DBUG_SWITCHES, dBugBits, dbugBitsHelpStr, dBugLMsetList, debugSwitch, defaultSwitch, demoFileList, demoSwitch, docFileList, dtdSwitch, EP, fileSeparator, fio, fourSqrtPi, GS, ini, inPixFileRsample, inPixFileSample, inputFormatSwitch, isCsamplePrimeSwitch, jarFileList, jarLibrFileList, landmarkDatabaseFile, latchLandmarkSpotSwitch, legalImageFileExtens, LM, LMSETCOLOR, lmsFile, lmsFormatMode, MAX_LM_LATCH_THR, maxLatchDist, nbrAltLMSSwitch, nDbugLMsetList, NEVER, nlmDB, nSwitches, OPTBKGROUND, osName, pair, pair2ndary, paramH, pix, pix1, pix2, pixFileExtn, PP, ppxDir, pra, projDir, projDirSwitch, propertiesFile, propertiesFileSwitch, ps, PUBLISH, rdbmsDir, REVISION, rRoiDbug, rRoiDbugSwitch, RSAMPLE, rsampleName, rsampleSwitch, SAMPLE, sampleName, sampleSwitch, secondaryPairingSwitch, simplePixFileRsample, simplePixFileSample, sort, SP, spfFormatMode, spfFormatSwitch, spfOutputFile, spfOutputPrefaceFile, SPOTBOXCOLOR, sRoiDbug, sRoiDbugSwitch, ssfFileRsample, ssfFileSample, ssfFormatMode, ssfInputEpilogueFileRsample, ssfInputEpilogueFileSample, ssfInputFileRsample, ssfInputFileSample, ssfInputPrefaceFileRsample, ssfInputPrefaceFileSample, startTime, sw, switchOptCBvalue, switchOptData, switchOptValue, thrPPswitch, thrSPswitch, timerSwitch, tmpDir, updateSwitch, US, usageSwitch, USE_DEMO_DATA, useAccFileSwitch, useHistGUISwitch, useLmsFileSwitch, usePercentDensitySwitch, usePopupGUISwitch, userDir, util, VERSION, xmlDir
 
Constructor Summary
CmpAssign()
          CmpAssign() - Constructor
 
Method Summary
 void assignCodes(int k)
          assignCodes() - assign spot code (SP,PP,AP,US) to paired spots.
private  void assignCodesToG1spots(int k)
          assignCodesToG1spots() - assign spot code (SP,PP,AP,US) to G1 paired spots.
private  void assignCodesToG2spots(int k)
          assignCodesToG2spots() - Test G2 spots for ambiguous (inconsistent best-paired spots i.e.,
 void assignSSFtoLMS()
          assignSSFtoLMS() - assign spots in each SSF to its nearest landmark set.
 java.lang.String getSpotLMSmappingStr(java.lang.String sTitle)
          getSpotLMSmappingStr() - get the printable report mapping landmarks to spots and their goodness (distance).
 java.lang.String getSpotLMSmappingStr(java.lang.String sTitle, boolean addSpotCntsFlag, boolean addAltLMsetsFlag)
          getSpotLMSmappingStr() - get the printable report mapping landmarks to spots and their goodness (distance).
static void showAllSSFspotsStr(java.lang.String title, int[] filterByLMsets)
          showAllSSFspotsStr() - show the printable list of all spots for both samples in the Report window.
 
Methods inherited from class CmpSpots.Cmpglb
get2D, get2D, initGlb, resetGlb, set2D
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmpAssign

public CmpAssign()
CmpAssign() - Constructor

Method Detail

assignCodes

public void assignCodes(int k)
assignCodes() - assign spot code (SP,PP,AP,US) to paired spots. The dP and DL are updated for all spots. Note: the test for an ambiguous spot is to test whether pointers are not circular.

Parameters:
k - is the landmark to process
See Also:
DbLM#cvLMSIdx2Name, DbLM#getDumpLMsetSpotsStr, assignCodesToG1spots(int), assignCodesToG2spots(int)

assignCodesToG1spots

private void assignCodesToG1spots(int k)
assignCodesToG1spots() - assign spot code (SP,PP,AP,US) to G1 paired spots. The dP and DL are updated for all spots. Note: the test for an ambiguous spot is to test whether pointers are not circular.

Parameters:
k - is the landmark to process in range [0:nlandmarks-1]
See Also:
DbLM#cvLMSIdx2Name, DbLM#getDumpLMsetSpotsStr

assignCodesToG2spots

private void assignCodesToG2spots(int k)
assignCodesToG2spots() - Test G2 spots for ambiguous (inconsistent best-paired spots i.e.,
    G2.bestPaiedSpot == G1 
 and
    G1.bestPaiedSpot != G2
pointers and mark the spots accordingly. Assign spot code (AP,US) to G2 paired spots. The dP and DL are updated for all spots. Note: only AP and US codes need be considered since SP and PP were handled by assignCodesToG1spots().

Parameters:
k - is the landmark to process in range [0:nLandmarks-1]
See Also:
DbLM#cvLMSIdx2Name, DbLM#getDumpLMsetSpotsStr

assignSSFtoLMS

public void assignSSFtoLMS()
assignSSFtoLMS() - assign spots in each SSF to its nearest landmark set. Also keep track of each spots second nearest landmark set which may be DbSpot.maxNbrAltLMs of landmark set names and the distances. NOTE: 2-27-87 Do not consider LMS which are invalid.


getSpotLMSmappingStr

public java.lang.String getSpotLMSmappingStr(java.lang.String sTitle)
getSpotLMSmappingStr() - get the printable report mapping landmarks to spots and their goodness (distance).

Parameters:
sTitle - to add to front of result if not null;
Returns:
report string
See Also:
DbLM#cvLMSIdx2Name

getSpotLMSmappingStr

public java.lang.String getSpotLMSmappingStr(java.lang.String sTitle,
                                             boolean addSpotCntsFlag,
                                             boolean addAltLMsetsFlag)
getSpotLMSmappingStr() - get the printable report mapping landmarks to spots and their goodness (distance).

Parameters:
sTitle - to add to front of result if not null;
addSpotCntsFlag - to also count spots in LM set and validate LM sets sizes against counts
Returns:
report string
See Also:
DbLM#cvLMSIdx2Name

showAllSSFspotsStr

public static void showAllSSFspotsStr(java.lang.String title,
                                      int[] filterByLMsets)
showAllSSFspotsStr() - show the printable list of all spots for both samples in the Report window. If any filters are used, then only print if spot's lmSet is in the set.
 E.g., 
   . . .
 Rsample spot list
 Rsample spot# 1 (xMom,yMom)=(223,321) LM[A] ltLMs={B(6) C(12) P(37} \
                 bpSpt#=354 nxtLMspt#=36 nxtSpt#=2
 Rsample spot# 2 (xMom,yMom)=(243,361) LM[A] ltLMs={B(8) C(11) P(35} \
                 bpSpt#=642 nxtLMspt#=38 nxtSpt#=3
            . . .    

Parameters:
title - if not null
filterByLMsets - of landmark sets to filter spots (if not null).
See Also:
DbSpot#getSSFspotsStr, Util#appendPRmsg