Landmark
Class Landmark

java.lang.Object
  extended by Landmark.Lmsglb
      extended by Landmark.Landmark

public class Landmark
extends Lmsglb

The Landmarking program for Open2Dprot is used to add and edit landmark data for the landmark database of sets of corresponding pairs of (x,y) landmarks for pairs of Rsample and Samples.

Edited and refactored by Greg Thornwall, SAIC.

This code was derived and refactored other Open2Dprot Java programs and from GELLAB-II landmark C language files "Version November 9, 1999".

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/22 11:44:08 $ $Revision: 1.24 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 
Fields inherited from class Landmark.Lmsglb
acc, accDatabaseFile, accFile, accFormatMode, applicationName, argsV, banner, bannerTitle, baseImageFileNameRsample, baseImageFileNameSample, batchDir, cacheDir, commutativeLMSswitch, CONSOLE_FLAG, cs, data, DATE, dbLM, dbRsample, dbSample, DBUB_FREE_040000, DBUG_APPEND, DBUG_COMPUTE_RADII, DBUG_CONSOLE, DBUG_FREE_010, DBUG_FREE_0100, DBUG_FREE_01000, DBUG_FREE_010000, DBUG_FREE_0100000, DBUG_FREE_01000000, DBUG_FREE_020, DBUG_FREE_0200, DBUG_FREE_02000, DBUG_FREE_020000, DBUG_FREE_0200000, DBUG_FREE_02000000, DBUG_FREE_040, DBUG_FREE_0400, DBUG_FREE_04000, DBUG_FREE_0400000, DBUG_PRINT_AT, DBUG_SWITCH_ANALYSIS, DBUG_SWITCHES, dbugBitName, dBugBits, dbugBitsHelpStr, dbugBitValues, dBugLMnbr, debugSwitch, defaultSwitch, demoFileList, demoSwitch, docFileList, dtdSwitch, editRsampleLMSFlag, fileSeparator, fio, fourSqrtPi, ini, inPixFileRsample, inPixFileSample, inputFormatSwitch, jarFileList, jarLibrFileList, landmarkDatabaseFile, landmarkURL, legalImageFileExtens, lmsFile, lmsFormatMode, makeBkupCopyFlag, needToSaveLMSdataFlag, NEVER, nlmDB, nSwitches, OPTBKGROUND, osName, paramH, pix, pixFileExtn, ppxDir, pra, projDir, projDirSwitch, propertiesFile, propertiesFileSwitch, PUBLISH, rdbmsDir, REVISION, RSAMPLE, rsampleName, rsampleSwitch, SAMPLE, sampleName, sampleSwitch, separateFlickerWindowFlag, simplePixFileRsample, simplePixFileSample, sort, spfFormatMode, ssfCWX1, ssfCWX2, ssfCWY1, ssfCWY2, ssfFileRsample, ssfFileSample, ssfFormatMode, ssfInputEpilogueFileRsample, ssfInputEpilogueFileSample, ssfInputFileRsample, ssfInputFileSample, ssfInputPrefaceFileRsample, ssfInputPrefaceFileSample, startTime, sw, switchOptCBvalue, switchOptData, switchOptValue, timerSwitch, tmpDir, tryToSaveCurLMSflag, updateSwitch, usageSwitch, USE_DEMO_DATA, useAccFileSwitch, useLmsFileSwitch, userDir, useRsampleLMSFlag, util, VERSION, xmlDir
 
Constructor Summary
Landmark()
           
 
Method Summary
 boolean createNewLandmarkDBfile(java.lang.String lmsDatabaseName, java.lang.String lmsDBfile)
          createNewLandmarkDBfile() - create a new the landmark database file with the header but not the data.
private  boolean lookupSampleEntryInAccDB(java.lang.String accNameData, java.lang.String accFieldName, java.lang.String accFile, DbSample dbS)
          lookupSampleEntryInAccDB() - lookup the sample image name in the accession DB.
static void main(java.lang.String[] args)
          main() - for Landmark 2D spot-landmark program for Open2Dprot.
 boolean openLandmarkDBfile(java.lang.String lmsDatabaseName, boolean tryToSaveCurAccFile)
          openLandmarkDBfile() - open the landmark database.
private  int processSamples(java.lang.String[] args)
          processSamples() - process the two samples.
private  char[] readSsfImage(java.lang.String imageFile, DbSample dbS)
          readSsfImage() - read the SSF image and set image status in the dbSample instance
private static void resetResources(boolean fullResetFlag)
          resetResources() - reset any resources that must be reset for the next run of the program.
 boolean setNewRsampleLMSfromAnotherLMSdbPair(java.lang.String rSample, java.lang.String sample)
          setNewRsampleLMSfromAnotherLMSdbPair() - lookup LMS DB for specified (rsample, sample) pair and set Rsample list of spots into current dbLM LMset.
 boolean setRsampleByName(java.lang.String rName)
          setRsampleByName() - set and load the Rsample data into dbRsample
 boolean setSampleByName(java.lang.String sName)
          setSampleByName() - set and load the Sample data into dbSample
static java.lang.String[] setupDebugSwitches(java.lang.String[] argv)
          setupDebugSwitches() - setup the debug switches
static java.lang.String[] setupDemoSwitches(java.lang.String[] argv)
          setupDemoSwitches() - setup the demo switches for the "gel-HM-019" (HUMAN-AML) and "gel-HM-071" (Human-ALL) samples
static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
          setupMinDefaultsSwitches() - add the minimum default switches.
 
Methods inherited from class Landmark.Lmsglb
initGlb, resetGlb, showReportStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Landmark

public Landmark()
Method Detail

main

public static void main(java.lang.String[] args)
main() - for Landmark 2D spot-landmark program for Open2Dprot.

Parameters:
args - is the argument list of command line

processSamples

private int processSamples(java.lang.String[] args)
processSamples() - process the two samples.

Returns:
exit code. It is 0 if succeed, else non-zero for errors this gets passed to System.exit(exit code).

lookupSampleEntryInAccDB

private boolean lookupSampleEntryInAccDB(java.lang.String accNameData,
                                         java.lang.String accFieldName,
                                         java.lang.String accFile,
                                         DbSample dbS)
lookupSampleEntryInAccDB() - lookup the sample image name in the accession DB.

Parameters:
accNameData - is the sample image name to search for. Do not specify the file extension.
accFieldName - is the accession field name
accFile - is the name of the accession file
dbS - is the SSF instance to use
Returns:
true if succeed

readSsfImage

private char[] readSsfImage(java.lang.String imageFile,
                            DbSample dbS)
readSsfImage() - read the SSF image and set image status in the dbSample instance

Parameters:
imageFile - to read
dbS - to update
Returns:
image array

setRsampleByName

public boolean setRsampleByName(java.lang.String rName)
setRsampleByName() - set and load the Rsample data into dbRsample

Parameters:
rName - - Rsample name to load
Returns:
true if succeed

setSampleByName

public boolean setSampleByName(java.lang.String sName)
setSampleByName() - set and load the Sample data into dbSample

Parameters:
sampleName - - to load
Returns:
true if succeed

setNewRsampleLMSfromAnotherLMSdbPair

public boolean setNewRsampleLMSfromAnotherLMSdbPair(java.lang.String rSample,
                                                    java.lang.String sample)
setNewRsampleLMSfromAnotherLMSdbPair() - lookup LMS DB for specified (rsample, sample) pair and set Rsample list of spots into current dbLM LMset.

Parameters:
rSample - to use
sample - to use in pair
Returns:
true if succeed

resetResources

private static void resetResources(boolean fullResetFlag)
resetResources() - reset any resources that must be reset for the next run of the program.

Parameters:
fullResetFlag - force new resource allocation

openLandmarkDBfile

public boolean openLandmarkDBfile(java.lang.String lmsDatabaseName,
                                  boolean tryToSaveCurAccFile)
openLandmarkDBfile() - open the landmark database. First check to see if the current landmark DB needs to be close

Parameters:
lmsDatabaseName - name of new landmark database file
tryToSaveCurAccFile - if needed (i.e., if the needToSaveAccessionDataFlag flag is set).
Returns:
true if succeed

createNewLandmarkDBfile

public boolean createNewLandmarkDBfile(java.lang.String lmsDatabaseName,
                                       java.lang.String lmsDBfile)
createNewLandmarkDBfile() - create a new the landmark database file with the header but not the data. This does NOT open the file - it just creates it. NOTE: can not create a new landmark database file with the same name as an existing database file to protect old databases.

Parameters:
lmsDatabaseName - name of new landmark database file
lmsDBfile - is full path of new landmark database file
Returns:
true if succeed

setupMinDefaultsSwitches

public static java.lang.String[] setupMinDefaultsSwitches(java.lang.String[] argv)
setupMinDefaultsSwitches() - add the minimum default switches.

Parameters:
argv - is list of original switches
Returns:
new argV merged switch list

setupDemoSwitches

public static java.lang.String[] setupDemoSwitches(java.lang.String[] argv)
setupDemoSwitches() - setup the demo switches for the "gel-HM-019" (HUMAN-AML) and "gel-HM-071" (Human-ALL) samples

Parameters:
argv - is list of original switches
Returns:
new argV merged switch list

setupDebugSwitches

public static java.lang.String[] setupDebugSwitches(java.lang.String[] argv)
setupDebugSwitches() - setup the debug switches

Parameters:
argv - list of original switches
Returns:
new argV merged switch list