O2Plib.db
Class DbSample

java.lang.Object
  extended by O2Plib.db.DbSample

public class DbSample
extends java.lang.Object

Class DbSample defines information about a sample. The sample can contain spots derived from various sources for Open2Dprot.

The sample id described in the Sample Spot File (SSF) which includes state parameters. This class contains tab-delimited and XML readers and writers for SSF files. The SSF could eventually reside in the RDBMS. It may optionally contain various fields depennding on how it is used. It will ALWAYS contain the name and type of sample (i.e., Rsample or Sample). Optional fields include:

 1. the input or file name if input is being performed.
 2. the output file name depending if output is being performed.
 3. the CalibrateOD calib calibration instance if it exists for the
    input pix.
 4. the DbSpot spotList[] for the sample if spot lists are used.
 5. Debugging state options, default is none.
 6. the input image file specification and pix[] and related
    image info sample if input image is used.
 7. the spot threshold sizing parameter ranges if used for
    spot segmentation
 8. The summary SSF epilogue statistics if SSF input or output used.
 9. The internal SSF Table if used.
This file is derived from Open2Dprot CmpSpots's DbSample.java

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/21 17:03:41 $ $Revision: 1.40 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Nested Class Summary
(package private)  class DbSample.SsfContentHandler
          This class implements the SAX ContentHandler interface and defines callback behavior for the SAX callbacks associated with an XML document's content, stuffing data structures with correct data from xml files.
(package private)  class DbSample.SsfErrorHandler
          SsfErrorHandlerclass implements the SAX ErrorHandler interface and defines callback behavior for the SAX callbacks associated with an XML document's warnings and errors.
 
Field Summary
 DbAccession acc
          The DbAccession database instance.
 java.lang.String[] accFieldNames
          Accession database fields for this sample if not null
 java.lang.String[] accRowData
          Accession database data for this sample if not null
 int areaIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 java.lang.String baseSampleName
          base sample name of the sample without either the path prefix or the file extension.
 java.lang.String baseSSFimageFileName
          name of SSF input base file name from file [FUTURE]
 int bkgrdFilterSize
          size of NxN zonal notch filter background estimator
 CalibrateOD calib
          (Opt) CalibrateOD instance
 int ccMinSize
          Minimum central core component size area threshold in pixels
 int ccNumberIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int countG
          # spots in list.
 int countPairG
          # spots in list.
 int ctrArea1Failed
          # spots failed area1 sizing, i.e., below lower threshold
 int ctrArea2Failed
          # spots failed area2 sizing, i.e., above lower threshold
 int ctrDensity1Failed
          # spots failed density1 sizing, i.e., below lower threshold
 int ctrDensity2Failed
          # spots failed density2 sizing, i.e., above lower threshold
 int ctrDR1Failed
          # spots failed DR1 sizing, i.e., below lower threshold
 int ctrDR2Failed
          # spots failed DR2 sizing, i.e., above lower threshold
 int ctrSxSy1Failed
          # spots failed Sx/Sy sizing, i.e., above lower threshold
 int ctrSxSy2Failed
          # spots failed Sx/Sy sizing, i.e., below upper threshold
 int cwx1
          computing window ULHC coordinate x
 int cwx2
          computing window LRHC coordinate x
 int cwy1
          computing window ULHC coordinate y
 int cwy2
          computing window LRHC coordinate y
 boolean dbugFlag
          Debugging flag
 int dbx1
          Debugging window for -debug: window
 int dbx2
          Debugging window for -debug: window
 int dby1
          Debugging window for -debug: window
 int dby2
          Debugging window for -debug: window
 int densityIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int densityPrimeIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 DbSpot firstSpot
          first spot allocated in the linked spot list.
 DbPspot firstSpotPair
          first spot allocated in the linked spotPairList[] spot-pair list.
 float glbPercentThr
          Saturation threshold [0.0:1.0] , i.e.
 java.lang.String globalStats
          Global statistics created at the preface and end of segmentation
 int idIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int idxSample
          Index of this Sample instance in CSD database.
 java.lang.String inPixFile
          full path name of the sample image file.
 int invalidCentroidsTot
          # of invalid spot centroids found during spot quantification
 DbSpot lastSpot
          last spot allocated (optional)
 DbPspot lastSpotPair
          last spot allocated in the spotPairList[] spot-pair list (optional)
static java.lang.String[] legalImageFileExtens
          List of legal sample image file extensions
 DbSpot listG
          point to first spot of full spot list - initialized to nulls.
 DbPspot listPairG
          point to first spot of full spot list - initialized to nulls.
static int MAX_BUFFERED_SPOTS
          max # spots to buffer in memory when converting the list of spots to string representations.
 int maxAreaFound
          Max area found in accepted spot
 float maxBkgrdDensity
          max background seen in any spot
 int maxBkgrdTot
          Max sample background grayscale (computed elsewhere)
 float maxCalibGrayFound
          Max calibration grayscale found in accepted spot
 float maxDensityFound
          Max density found in accepted spot
 int maxDensityIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 float maxDensityPrimeFound
          Max densityPrime found in accepted spot
 int maxGrayPixel
          max Gray Pixel value in the image1 is (1<
 int maxSpotPairs
          size of spotPairList[]
 int maxSpots
          size of spotList
static int MAXSPOTS
          Default maximum number of spots (i.e.) in initial spot list These are the number of CC's.
 int meanBackgroundIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int meanDensityIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int merX1Idx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int merX2Idx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int merY1Idx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int merY2Idx
          Spot data Table de column field indices if tab-delimited tables are being used.
 float minBkgrdDensity
          min background seen in any spot
 int minBkgrdTot
          Min sample background grayscale (computed elsewhere)
 int minDensityIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int nBitsPerPixel
          # of bits/pixel in the image1
 int nBytesPerPixel
          # of bytes/pixel in the image1
 int nCCread
          # spots actually read from the SSF data file
 int nPairCCread
          # spots actually read from the SSF data file
 int nPixels
          total # of pixels in image1 = pixWidth*pixHeight
 int nSpotsAborted
          # of spots aborted during assembly.
 int nTopSpot
          number of spots current spotList[] that were defined.
 int nTopSpotPair
          number of spot pairs current spotPairList[] that were defined.
 int omittedArea
           
 float omittedDensity
          Data statistics read from the SSF files.
 int omittedNumberSpots
           
 float pctOmittedToDprimeAcceptedSpots
          Pct omitToAccepted/densityPrime_spots failing_t1Density_resizing computed as: (100.0*omittedDensity/totSampleDensityPrime).
 char[] pix
          sample source sample image
 int pixel_x_coordIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int pixel_y_coordIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 float pixelSizeMicrons
          Pixel resolution in the sample image in microns/pixel
 int pixHeight
          Sample image size height from SSF file
 int pixWidth
          Sample image size width from SSF file
 float ratioOmittedToAccepted
          "Omitted(D')/Accepted(D')"
static int RSAMPLE
          The index for the Rsample (Reference Sample)
static int SAMPLE
          The index for the Sample to be paired with the Rsample
 int sampleNameIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int sampleNbr
          The sample number is either RSAMPLE (0) or SAMPLE(1)
 java.lang.String sampleType
          The sample type name is either "Rsample" or "Sample" based on sampleNbr value.
 java.lang.String simpleFileNameA
          simple sample pix file name of the sample without the leading path.
 java.lang.String spotBoundaryStr
          spot boundary string if using boundaries
 int spotBoundaryStrIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 DbSpot[] spotList
          DbSpot list [0:nTopSpot-1] for DbSpot spots entered by CC #.
 int spotNumber
          Unique sequential spot number.
 DbPspot[] spotPairList
          DbPspot list [0:nTopSpotPair-1] for DbPspot spots entered by CC #.
static java.lang.String[] spotTblFields
          Accession table fields
static java.lang.String[] spotTblHelpList
          Accession table help list
static java.lang.String SSF_VERSION
          SSF (Sample Spot-list File) version number
 boolean ssfCWSwitch
          Debugging switch.
 int ssfCWX1
           
 int ssfCWX2
           
 int ssfCWY1
           
 int ssfCWY2
           
 java.io.FileWriter ssfEpilogueFD
          output SSF Epilogue file stream
 java.io.FileWriter ssfFD
          output SSF file stream
 java.lang.String ssfFile
          full path xml/ Sample Spotlist Files (SSF) full path input file.
 java.lang.String ssfInputFile
          name of SSF input file from file [FUTURE]
 int ssfInputFormatMode
          SSF input file modes: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML
 java.lang.String ssfOutputEpilogueFile
          full tab-delim EPILOGUE xml/ Sample Spot-list File full path
 java.lang.String ssfOutputFile
          SSF either tab-delim xml/ Sample Spot-list File full path
 int ssfOutputFormatMode
          SSF output file modes: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML, IO_FORMAT_FULL, IO_FORMAT_GELLAB
 java.lang.String ssfOutputPrefaceFile
          full tab-delim PREFACE xml/ Sample Spot-list File full path
 java.io.FileWriter ssfPrefaceFD
          output SSF Preface file stream
 int sxTotIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int sxyTotIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int syTotIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 float t1Area
          lower threshold of area sizing
 float t1Density
          lower threshold of density' sizing
 float t1Range
          lower threshold of (maxD-minD) sizing
 float t2Area
          upper threshold of area sizing
 float t2Density
          upper threshold of density' sizing
 float t2Range
          upper threshold of (maxD-minD) sizing
 Table td
          SSF data file table
 Table te
          SSF epilogue file table
 int totSampleArea
           
 int totSampleAreaPrime
           
 float totSampleDensity
          Data statistics read from the SSF files.
 float totSampleDensityPrime
          Data statistics read from the SSF files.
 int totSampleNbrSpots
           
 int totSampleNbrSpotsPrime
           
 java.lang.String totStats
          Global total statistics created at the end of the segmentation
 Table tp
          SSF prologue file table
static boolean USE_DOM_XML_SSF
          enable for debugging DOM XML writer
 boolean useInternalDTDflag
          Use internal "Open2Dprot-SSF.dtd" file in SSF XML output file.
static java.lang.String VERSION
          Version for this module
 int volumeIdx
          Spot data Table de column field indices if tab-delimited tables are being used.
 int xSel
          Selected X coordinate, set elsewhere
 int ySel
          Selected Y coordinate, set elsewhere
 
Constructor Summary
DbSample()
          DbSample() - create null DbSample
DbSample(int sampleNbr)
          DbSample() - setup DbSample part of the database
DbSample(int sampleNbr, java.lang.String ssfFile, java.lang.String baseSamplename, java.lang.String simplePixFileSample, int ssfFormatMode)
          DbSample() - setup DbSample part of the database
 
Method Summary
 void assignAccessionDB(DbAccession acc)
          assignAccessionDB() - assign the accession database
 boolean assignRsampleToAllSpotsInSpotList(DbSample dbRsample)
          assignRsampleToAllSpotsInSpotList() - assign the dbRsample field in all spots in the current spot list
 boolean calcDensPrime(boolean bkgrdCorrectionSwitch, boolean rmvDprimeSizingSwitch)
          calcDensPrime() - For all spots update the spotList with background corrections by computing D' = Density - Area*MeanBkgrdDensity
 boolean chkSampleImageExists()
          chkSampleImageExists() - test if the original image file exists for the sample
 void clearSpotList()
          clearSpotList() - clear spot list
 void clearSpotPairList()
          clearSpotPairList() - clear spot list
 java.lang.String cvtSpotToSpotRecordStr(DbSpot r)
          cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode.
 java.lang.String cvtSpotToSpotRecordStr(DbSpot r, int useSsfFormatMode)
          cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode.
 java.lang.StringBuffer cvtSpotToSpotRecordStr(java.lang.StringBuffer s, DbSpot r)
          cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode.
 DbSpot findSpotByXY(int xT, int yT, int distThr, boolean allSpotsFlag)
          findSpotByXY() - find a spot in the spot list that is within distThr of the (x,y) coordinate specified.
 DbPspot findSpotPairByXY(int nSample, int xT, int yT, int distThr, boolean allSpotsFlag)
          findSpotPairByXY() - find a spot in the spot-pair list that is within distThr of the (x,y) coordinate specified.
 java.lang.String getSampleAccStr()
          getSampleAccStr() - get printable data including accession name/value row for this sample
 void init()
          init() - init the DbSample instance state sample names.
 boolean insertSpot(DbSpot r, DbSpot sp)
          insertSpot() - insert spot r BEFORE spot sp and update spotList[0:nTopSpot-1].
 boolean insertSpotPair(DbPspot r, DbPspot sp)
          insertSpotPair() - insert DbPspot r BEFORE sp and update spotPairList[0:nTopSpotPair-1].
 boolean isDBwindow(int x, int y)
          isDBwindow() - test if (x,y) is inside the debug window.
 boolean isValidROI(int rX1, int rY1, int rX2, int rY2)
          isValidROI() - check if current region of interest (ROI) is valid
 java.lang.String listAllSpots(boolean includeNullSpotsFlag, boolean useDbugWindFlag)
          listAllSpots() - list all spots in the spot list.
 boolean lookupSampleInAccDB(java.lang.String accNameData, java.lang.String accFieldName, java.lang.String accFile)
          lookupSampleInAccDB() - lookup the sample by (nave,value) pair for this sample in the accession DB.
 boolean lookupSsfSpotlistTableIndices()
          lookupSsfSpotlistTableIndices() - lookup SSF data table indices
 boolean pushSpot(DbSpot r)
          pushSpot() - push DbSpot spot into spotList[0:nTopSpot-1].
 boolean pushSpotPair(DbPspot r)
          pushSpotPair() - push DbPspot spot-pair into spotPairList[0:nTopSpotPair-1].
 boolean readAllSsfSpotlistTables()
          readAllSsfSpotlistTables() - read SSF data, preface and epilogue tables Note: this reads the SSF data produced by "Seg2Dgel -ssfFormat:F" which produces three files.
 java.lang.String readSSFdata()
          readSSFdata() - Read sample Sample Spot-list Files (SSF) into a linked list data base of DbSpot objects.
 boolean readSsfEpilogueTable(java.lang.String epilogueFile)
          readSsfEpilogueTable() - read SSF epilogue tab-delimited file
 boolean readSsfPrefaceTable(java.lang.String prefaceFile)
          readSsfPrefaceTable() - read SSF preface tab-delimited file
 boolean readSsfSpotlistTable(java.lang.String ssfFile)
          readSsfSpotlistTable() - read SSF data table from tab-delimited data
 boolean readSsfSpotlistXML(java.lang.String XMLfileName)
          readSsfSpotlistXML() - read SSF spot list, preface and epilogue data from XML file.
 boolean removeSpot(DbSpot r)
          removeSpot() - remove spot from spotList[0:nTopSpot-1].
 boolean removeSpotPair(DbPspot r)
          removeSpotPair() - remove DbPspot from spotPairList[0:nTopSpotPair-1].
 void reset()
          reset() - reset the DbSample state for current sample.
 void resetSampleStats()
          resetSampleStats() - reset global sample stats
 boolean rmvSPFlistsAndTable()
          rmvSPFlistsAndTable() - remove the SSF and SPF spot lists, and Tables if they exist.
 boolean saveAccRowForSample(java.lang.String[] accRowData)
          saveAccRowForSample() - save accession row entry data in the accession database table for this sample.
 void setBkgrdFilterSize(int bkgFilterSize)
          setBkgrdFilterSize() - set spot saturated percent threshold state for the current sample.
 boolean setCalValueListCalibAccFields(float[] wedgeCalValues)
          setCalValueListCalibAccFields() - set Calibration wedge wedgeCalValues in the accession DB field for this sample.
 void setCW(int cwX1, int cwX2, int cwY1, int cwY2)
          setCW() - set the computing window state for current sample.
 boolean setCWroi(int rX1, int rY1, int rX2, int rY2)
          setCWroi() - set region of interest (ROI) to Computing Window (CW).
 boolean setCWroi(int rX1, int rY1, int rX2, int rY2, java.lang.String[] accRowDataS)
          setCWroi() - set region of interest (ROI) to Computing Window (CW)
 void setDbugFlag(boolean dbugFlag)
          setDbugFlag() - set the dbugFlag
 boolean setDBwindow(int rX1, int rY1, int rX2, int rY2)
          setDBwindow() - set debug window of interest to region of interest (ROI).
 void setDebugCW(boolean ssfCWflag, int dbCWX1, int dbCWY1, int dbCWX2, int dbCWY2)
          setDebugCW() - enable/disable debug computing window to restrict data read when test if p.(xMom,yMom) in SSF CW for debugging.
 void setIdxSample(int idxSample)
          setIdxSample() - set the idxSample used in the CSD database
 void setMinCentralCoreSize(int ccMinimumSize)
          setMinCentralCoreSize() - set spot minimum central core component area size state in pixels for the current sample.
 boolean setROI2CALCW(int rX1, int rY1, int rX2, int rY2)
          setROI2CALCW() - set Calibration wedge computing window ROI
 boolean setROI2CW(int rX1, int rY1, int rX2, int rY2)
          setROI2CW() - set region of interest (ROI) to Computing Window (CW)
 void setSampleNames(java.lang.String sampleType, java.lang.String sampleName, java.lang.String simplePixFileSample, java.lang.String inPixFileSample, java.lang.String ssfFileSample)
          setSampleNames() - set the DbSample state for current sample.
 void setSaturationPercentThresholds(float glbPctThr)
          setSaturationPercentThresholds() - set spot saturated percent threshold state for the current sample.
 void setSizingThresholds(float t1area, float t2area, float t1density, float t2density, float t1range, float t2range)
          setSizingThresholds() - set the spot sizing threshold for the current sample.
 boolean setupSpotList(int newSize)
          setupSpotList() - create or regrow the spot list.
 boolean setupSpotPairList(int newSize)
          setupSpotPairList() - create or regrow the DbPspot paired-spot list.
 void setUseInternalDTDflag(boolean useInternalDTDflag)
          setUseInternalDTDflag() - set the use internal DTD flag.
 boolean setWedgeCWroi(int rX1, int rY1, int rX2, int rY2)
          setWedgeCWroi() - set Calibration wedge computing window ROI.
 boolean setWedgeCWroi(int rX1, int rY1, int rX2, int rY2, java.lang.String[] accRowDataS)
          setWedgeCWroi() - set Calibration wedge computing window ROI
 boolean setWedgeGrayListData(java.lang.String wedgeCalListStr, int[] wedgeGrayList)
          setWedgeGrayListData() - set Calibration wedge wedgeGrayList in the accession DB field for this sample.
 boolean sortSpotList(int sortByFeature, boolean ascendingFlag)
          sortSpotList() - sort spotList[0:nTopSpot-1] by feature SORT_BY_xxxx.
 boolean sortSpotPairList(int sortByFeature, int sortByNsample, boolean ascendingFlag)
          sortSpotPairList() - sort spotPairList[0:nTopSpotPair-1] by feature SORT_BY_xxxx.
 boolean writeEntireDOM_XML(java.lang.String outputFile)
          writeEntireDOM_XML() - write the entire SSF file into an XML file using DOM/JDOM/...
 boolean writeEntireSSF(java.lang.String bannerTitle, java.lang.String[] swList, java.lang.String projDir, java.lang.String filesUsed, java.lang.String ssfOutputFile, int ssfOutputFormatMode)
          writeEntireSSF() - write the entire SSF file.
 boolean writeFinish(java.lang.String filesUsed)
          writeFinish() - finish and close the segemented output file.
 boolean writeSpotsToFile()
          writeSpotsToFile() - write the linked spot list, spot by spot, into the log file.
 boolean writeSSFpreface(java.lang.String bannerTitle, java.lang.String[] swList, java.lang.String filesUsed, java.lang.String projDir)
          writeSSFpreface() - write the SSF preface to the SSF file in ssfFD.
 boolean writeStatisticsToSSFfile()
          writeStatisticsToSSFfile() - write the segmented spot statistics to the SSF file in ssfFD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

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

See Also:
Constant Field Values

SSF_VERSION

public static final java.lang.String SSF_VERSION
SSF (Sample Spot-list File) version number

See Also:
Constant Field Values

USE_DOM_XML_SSF

public static boolean USE_DOM_XML_SSF
enable for debugging DOM XML writer


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

MAXSPOTS

public static int MAXSPOTS
Default maximum number of spots (i.e.) in initial spot list These are the number of CC's. Previously it was 10000, 8000, 5000 so could change this...


MAX_BUFFERED_SPOTS

public static int MAX_BUFFERED_SPOTS
max # spots to buffer in memory when converting the list of spots to string representations. If the # of spots is LT this threshold then buffer them, else append the spot string to the file as it is converted.


legalImageFileExtens

public static final java.lang.String[] legalImageFileExtens
List of legal sample image file extensions


sampleNbr

public int sampleNbr
The sample number is either RSAMPLE (0) or SAMPLE(1)


idxSample

public int idxSample
Index of this Sample instance in CSD database. [optional]


sampleType

public java.lang.String sampleType
The sample type name is either "Rsample" or "Sample" based on sampleNbr value.


baseSampleName

public java.lang.String baseSampleName
base sample name of the sample without either the path prefix or the file extension. E.g., "gel123".


acc

public DbAccession acc
The DbAccession database instance.


simpleFileNameA

public java.lang.String simpleFileNameA
simple sample pix file name of the sample without the leading path. E.g., "gel123.gif"


inPixFile

public java.lang.String inPixFile
full path name of the sample image file. E.g., "demo/ppx/gel123.gif"


ssfFile

public java.lang.String ssfFile
full path xml/ Sample Spotlist Files (SSF) full path input file. E.g., "demo/xml/gel123.xml"


ssfInputFile

public java.lang.String ssfInputFile
name of SSF input file from file [FUTURE]


baseSSFimageFileName

public java.lang.String baseSSFimageFileName
name of SSF input base file name from file [FUTURE]


ssfInputFormatMode

public int ssfInputFormatMode
SSF input file modes: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML


useInternalDTDflag

public boolean useInternalDTDflag
Use internal "Open2Dprot-SSF.dtd" file in SSF XML output file.


ssfOutputFile

public java.lang.String ssfOutputFile
SSF either tab-delim xml/ Sample Spot-list File full path


ssfOutputPrefaceFile

public java.lang.String ssfOutputPrefaceFile
full tab-delim PREFACE xml/ Sample Spot-list File full path


ssfOutputEpilogueFile

public java.lang.String ssfOutputEpilogueFile
full tab-delim EPILOGUE xml/ Sample Spot-list File full path


ssfOutputFormatMode

public int ssfOutputFormatMode
SSF output file modes: Allowed: FileIO.IO_FORMAT_TAB_DELIM, IO_FORMAT_XML, IO_FORMAT_FULL, IO_FORMAT_GELLAB


ssfFD

public java.io.FileWriter ssfFD
output SSF file stream


ssfPrefaceFD

public java.io.FileWriter ssfPrefaceFD
output SSF Preface file stream


ssfEpilogueFD

public java.io.FileWriter ssfEpilogueFD
output SSF Epilogue file stream


calib

public CalibrateOD calib
(Opt) CalibrateOD instance


spotNumber

public int spotNumber
Unique sequential spot number. This may change during segmentation as spots are removed via threshold sizing. This is a one-way list.


countG

public int countG
# spots in list.


listG

public DbSpot listG
point to first spot of full spot list - initialized to nulls.


nCCread

public int nCCread
# spots actually read from the SSF data file


nTopSpot

public int nTopSpot
number of spots current spotList[] that were defined. This is a one-way list.


maxSpots

public int maxSpots
size of spotList


spotList

public DbSpot[] spotList
DbSpot list [0:nTopSpot-1] for DbSpot spots entered by CC #. allocated to maxSpots. This is a one-way list.


firstSpot

public DbSpot firstSpot
first spot allocated in the linked spot list.


lastSpot

public DbSpot lastSpot
last spot allocated (optional)


countPairG

public int countPairG
# spots in list.


listPairG

public DbPspot listPairG
point to first spot of full spot list - initialized to nulls.


nPairCCread

public int nPairCCread
# spots actually read from the SSF data file


nTopSpotPair

public int nTopSpotPair
number of spot pairs current spotPairList[] that were defined. This is a one-way list.


maxSpotPairs

public int maxSpotPairs
size of spotPairList[]


spotPairList

public DbPspot[] spotPairList
DbPspot list [0:nTopSpotPair-1] for DbPspot spots entered by CC #. allocated to maxSpots. This is a one-way list.


firstSpotPair

public DbPspot firstSpotPair
first spot allocated in the linked spotPairList[] spot-pair list.


lastSpotPair

public DbPspot lastSpotPair
last spot allocated in the spotPairList[] spot-pair list (optional)


dbugFlag

public boolean dbugFlag
Debugging flag


dbx1

public int dbx1
Debugging window for -debug: window


dbx2

public int dbx2
Debugging window for -debug: window


dby1

public int dby1
Debugging window for -debug: window


dby2

public int dby2
Debugging window for -debug: window


ssfCWSwitch

public boolean ssfCWSwitch
Debugging switch. Test if p.(xMom,yMom) in SSF CW for debugging. In which case limit spots to those within the CW.


ssfCWX1

public int ssfCWX1

ssfCWY1

public int ssfCWY1

ssfCWX2

public int ssfCWX2

ssfCWY2

public int ssfCWY2

pix

public char[] pix
sample source sample image


pixWidth

public int pixWidth
Sample image size width from SSF file


pixHeight

public int pixHeight
Sample image size height from SSF file


pixelSizeMicrons

public float pixelSizeMicrons
Pixel resolution in the sample image in microns/pixel


nPixels

public int nPixels
total # of pixels in image1 = pixWidth*pixHeight


nBytesPerPixel

public int nBytesPerPixel
# of bytes/pixel in the image1


nBitsPerPixel

public int nBitsPerPixel
# of bits/pixel in the image1


maxGrayPixel

public int maxGrayPixel
max Gray Pixel value in the image1 is (1<

xSel

public int xSel
Selected X coordinate, set elsewhere


ySel

public int ySel
Selected Y coordinate, set elsewhere


cwx1

public int cwx1
computing window ULHC coordinate x


cwx2

public int cwx2
computing window LRHC coordinate x


cwy1

public int cwy1
computing window ULHC coordinate y


cwy2

public int cwy2
computing window LRHC coordinate y


t1Area

public float t1Area
lower threshold of area sizing


t2Area

public float t2Area
upper threshold of area sizing


t1Density

public float t1Density
lower threshold of density' sizing


t2Density

public float t2Density
upper threshold of density' sizing


t1Range

public float t1Range
lower threshold of (maxD-minD) sizing


t2Range

public float t2Range
upper threshold of (maxD-minD) sizing


glbPercentThr

public float glbPercentThr
Saturation threshold [0.0:1.0] , i.e. 0 to 100%


ccMinSize

public int ccMinSize
Minimum central core component size area threshold in pixels


bkgrdFilterSize

public int bkgrdFilterSize
size of NxN zonal notch filter background estimator


totSampleDensity

public float totSampleDensity
Data statistics read from the SSF files. These are spots accepted by spot program before correcting density by background subtraction and that still passed the sizing criteria.


totSampleArea

public int totSampleArea

totSampleNbrSpots

public int totSampleNbrSpots

totSampleDensityPrime

public float totSampleDensityPrime
Data statistics read from the SSF files. These are spots accepted by spot program after correcting density by background subtraction and that still passed the sizing criteria.


totSampleAreaPrime

public int totSampleAreaPrime

totSampleNbrSpotsPrime

public int totSampleNbrSpotsPrime

omittedDensity

public float omittedDensity
Data statistics read from the SSF files. Spots omitted from SSF because they failed the sizing criteria of the spot program.


omittedArea

public int omittedArea

omittedNumberSpots

public int omittedNumberSpots

pctOmittedToDprimeAcceptedSpots

public float pctOmittedToDprimeAcceptedSpots
Pct omitToAccepted/densityPrime_spots failing_t1Density_resizing computed as: (100.0*omittedDensity/totSampleDensityPrime).


maxCalibGrayFound

public float maxCalibGrayFound
Max calibration grayscale found in accepted spot


maxAreaFound

public int maxAreaFound
Max area found in accepted spot


maxDensityFound

public float maxDensityFound
Max density found in accepted spot


maxDensityPrimeFound

public float maxDensityPrimeFound
Max densityPrime found in accepted spot


invalidCentroidsTot

public int invalidCentroidsTot
# of invalid spot centroids found during spot quantification


nSpotsAborted

public int nSpotsAborted
# of spots aborted during assembly.


ratioOmittedToAccepted

public float ratioOmittedToAccepted
"Omitted(D')/Accepted(D')"


ctrArea1Failed

public int ctrArea1Failed
# spots failed area1 sizing, i.e., below lower threshold


ctrArea2Failed

public int ctrArea2Failed
# spots failed area2 sizing, i.e., above lower threshold


ctrDensity1Failed

public int ctrDensity1Failed
# spots failed density1 sizing, i.e., below lower threshold


ctrDensity2Failed

public int ctrDensity2Failed
# spots failed density2 sizing, i.e., above lower threshold


ctrDR1Failed

public int ctrDR1Failed
# spots failed DR1 sizing, i.e., below lower threshold


ctrDR2Failed

public int ctrDR2Failed
# spots failed DR2 sizing, i.e., above lower threshold


ctrSxSy1Failed

public int ctrSxSy1Failed
# spots failed Sx/Sy sizing, i.e., above lower threshold


ctrSxSy2Failed

public int ctrSxSy2Failed
# spots failed Sx/Sy sizing, i.e., below upper threshold


minBkgrdDensity

public float minBkgrdDensity
min background seen in any spot


maxBkgrdDensity

public float maxBkgrdDensity
max background seen in any spot


maxBkgrdTot

public int maxBkgrdTot
Max sample background grayscale (computed elsewhere)


minBkgrdTot

public int minBkgrdTot
Min sample background grayscale (computed elsewhere)


spotBoundaryStr

public java.lang.String spotBoundaryStr
spot boundary string if using boundaries


globalStats

public java.lang.String globalStats
Global statistics created at the preface and end of segmentation


totStats

public java.lang.String totStats
Global total statistics created at the end of the segmentation


accFieldNames

public java.lang.String[] accFieldNames
Accession database fields for this sample if not null


accRowData

public java.lang.String[] accRowData
Accession database data for this sample if not null


spotTblHelpList

public static java.lang.String[] spotTblHelpList
Accession table help list


spotTblFields

public static java.lang.String[] spotTblFields
Accession table fields


sampleNameIdx

public int sampleNameIdx
Spot data Table de column field indices if tab-delimited tables are being used.


idIdx

public int idIdx
Spot data Table de column field indices if tab-delimited tables are being used.


merX1Idx

public int merX1Idx
Spot data Table de column field indices if tab-delimited tables are being used.


merX2Idx

public int merX2Idx
Spot data Table de column field indices if tab-delimited tables are being used.


merY1Idx

public int merY1Idx
Spot data Table de column field indices if tab-delimited tables are being used.


merY2Idx

public int merY2Idx
Spot data Table de column field indices if tab-delimited tables are being used.


minDensityIdx

public int minDensityIdx
Spot data Table de column field indices if tab-delimited tables are being used.


maxDensityIdx

public int maxDensityIdx
Spot data Table de column field indices if tab-delimited tables are being used.


meanDensityIdx

public int meanDensityIdx
Spot data Table de column field indices if tab-delimited tables are being used.


meanBackgroundIdx

public int meanBackgroundIdx
Spot data Table de column field indices if tab-delimited tables are being used.


pixel_x_coordIdx

public int pixel_x_coordIdx
Spot data Table de column field indices if tab-delimited tables are being used.


pixel_y_coordIdx

public int pixel_y_coordIdx
Spot data Table de column field indices if tab-delimited tables are being used.


areaIdx

public int areaIdx
Spot data Table de column field indices if tab-delimited tables are being used.


densityIdx

public int densityIdx
Spot data Table de column field indices if tab-delimited tables are being used.


densityPrimeIdx

public int densityPrimeIdx
Spot data Table de column field indices if tab-delimited tables are being used.


sxTotIdx

public int sxTotIdx
Spot data Table de column field indices if tab-delimited tables are being used.


syTotIdx

public int syTotIdx
Spot data Table de column field indices if tab-delimited tables are being used.


sxyTotIdx

public int sxyTotIdx
Spot data Table de column field indices if tab-delimited tables are being used.


volumeIdx

public int volumeIdx
Spot data Table de column field indices if tab-delimited tables are being used.


ccNumberIdx

public int ccNumberIdx
Spot data Table de column field indices if tab-delimited tables are being used.


spotBoundaryStrIdx

public int spotBoundaryStrIdx
Spot data Table de column field indices if tab-delimited tables are being used.


td

public Table td
SSF data file table


tp

public Table tp
SSF prologue file table


te

public Table te
SSF epilogue file table

Constructor Detail

DbSample

public DbSample()
DbSample() - create null DbSample


DbSample

public DbSample(int sampleNbr)
DbSample() - setup DbSample part of the database

Parameters:
sampleNbr - is the sample number. 0 is RSAMPLE, 0 is SAMPLE.

DbSample

public DbSample(int sampleNbr,
                java.lang.String ssfFile,
                java.lang.String baseSamplename,
                java.lang.String simplePixFileSample,
                int ssfFormatMode)
DbSample() - setup DbSample part of the database

Parameters:
sampleNbr - is the sample number. 0 is RSAMPLE, 0 is SAMPLE.
ssfFile - is full path pix file name for Rsample or Sample
baseSamplename - is base pix file name for Rsample or Sample
simplePixFileSample - is simple pix file name for Rsample or Sample
ssfFormatMode - is the I/O input mode.
Method Detail

setIdxSample

public void setIdxSample(int idxSample)
setIdxSample() - set the idxSample used in the CSD database

Parameters:
idxSample - is the index sample. -1 is none, 0 is Rsample values > 0 are Samples.

init

public void init()
init() - init the DbSample instance state sample names. This also does a reset() and resetSampleStats().


rmvSPFlistsAndTable

public boolean rmvSPFlistsAndTable()
rmvSPFlistsAndTable() - remove the SSF and SPF spot lists, and Tables if they exist. We may want to call this from the CSD after the data has been copied to the CSD Rspot database. The G.C. should be called separately.

Returns:
true if succeed.

assignAccessionDB

public void assignAccessionDB(DbAccession acc)
assignAccessionDB() - assign the accession database

Parameters:
acc - is accession database

setDbugFlag

public void setDbugFlag(boolean dbugFlag)
setDbugFlag() - set the dbugFlag

Parameters:
dbugFlag - status to set

setUseInternalDTDflag

public void setUseInternalDTDflag(boolean useInternalDTDflag)
setUseInternalDTDflag() - set the use internal DTD flag. This is used to decide if add internal "Open2Dprot-SSF.dtd" file in SSF XML output file.

Parameters:
useInternalDTDflag - status to set

reset

public void reset()
reset() - reset the DbSample state for current sample. This should be called at the start of a new session.


resetSampleStats

public void resetSampleStats()
resetSampleStats() - reset global sample stats


clearSpotList

public void clearSpotList()
clearSpotList() - clear spot list


setupSpotList

public boolean setupSpotList(int newSize)
setupSpotList() - create or regrow the spot list.

Parameters:
newSize - of the spotLists
Returns:
true if succeed
See Also:
clearSpotList(), findSpotByXY(int, int, int, boolean), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), pushSpot(O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), sortSpotList(int, boolean)

pushSpot

public boolean pushSpot(DbSpot r)
pushSpot() - push DbSpot spot into spotList[0:nTopSpot-1]. If spotList.length is < maxSpots, then (re)grow the list. Also maintain the firstSpot, lastSpot, r.prevSpot, r.nextSpot.

Parameters:
r - DbSpot to push into the spotList.
Returns:
true if succeed.
See Also:
clearSpotList(), findSpotByXY(int, int, int, boolean), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), setupSpotList(int), sortSpotList(int, boolean)

insertSpot

public boolean insertSpot(DbSpot r,
                          DbSpot sp)
insertSpot() - insert spot r BEFORE spot sp and update spotList[0:nTopSpot-1]. Also maintain the firstSpot, lastSpot, r.prevSpot, r.nextSpot.

Parameters:
r - spot to insert
sp - spot to insert BEFORE. If null, then insert at the end of the list.
Returns:
true if succeed, false if problem
See Also:
clearSpotList(), findSpotByXY(int, int, int, boolean), pushSpot(O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), setupSpotList(int), sortSpotList(int, boolean)

removeSpot

public boolean removeSpot(DbSpot r)
removeSpot() - remove spot from spotList[0:nTopSpot-1]. Also maintain the firstSpot, lastSpot, r.prevSpot, r.nextSpot.

Parameters:
r - spot to remove from the spotList.
Returns:
true if succeed, false if spot was not found.
See Also:
clearSpotList(), findSpotByXY(int, int, int, boolean), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), pushSpot(O2Plib.db.DbSpot), setupSpotList(int), sortSpotList(int, boolean)

sortSpotList

public boolean sortSpotList(int sortByFeature,
                            boolean ascendingFlag)
sortSpotList() - sort spotList[0:nTopSpot-1] by feature SORT_BY_xxxx. This updates spotList[], firstSpot, lastSpot, r.prevSpot, r.nextSpot. Keep the same spot list size - even if most of it is null.

Parameters:
sortByFeature - DbSpot.SPOT_FEATURE_xxxx
ascendingFlag - to sort in assending order
Returns:
true if succeed, false if problem
See Also:
clearSpotList(), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), findSpotByXY(int, int, int, boolean), pushSpot(O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), setupSpotList(int)

clearSpotPairList

public void clearSpotPairList()
clearSpotPairList() - clear spot list


setupSpotPairList

public boolean setupSpotPairList(int newSize)
setupSpotPairList() - create or regrow the DbPspot paired-spot list.

Parameters:
newSize - of the spotLists
Returns:
true if succeed

pushSpotPair

public boolean pushSpotPair(DbPspot r)
pushSpotPair() - push DbPspot spot-pair into spotPairList[0:nTopSpotPair-1]. If spotPairList.length is < maxSpotPairs, then (re)grow the list. Also maintain the firstSpotPair, lastSpotPair, r.prevSpot, r.nextSpot.

Parameters:
r - DbPspot to push into the spotPairList.
Returns:
true if succeed.
See Also:
setupSpotPairList(int)

insertSpotPair

public boolean insertSpotPair(DbPspot r,
                              DbPspot sp)
insertSpotPair() - insert DbPspot r BEFORE sp and update spotPairList[0:nTopSpotPair-1]. Also maintain the firstSpotPair, lastSpotPair, r.prevSpot, r.nextSpot.

Parameters:
r - DbPspot to insert
sp - DbPspot to insert BEFORE. If null, then insert at the end of the list.
Returns:
true if succeed, false if problem
See Also:
setupSpotPairList(int)

removeSpotPair

public boolean removeSpotPair(DbPspot r)
removeSpotPair() - remove DbPspot from spotPairList[0:nTopSpotPair-1]. Also maintain the firstSpotPair, lastSpotPair, r.prevSpot, r.nextSpot.

Parameters:
r - DbPspot to remove from the spotPairList.
Returns:
true if succeed, false if spot was not found.

sortSpotPairList

public boolean sortSpotPairList(int sortByFeature,
                                int sortByNsample,
                                boolean ascendingFlag)
sortSpotPairList() - sort spotPairList[0:nTopSpotPair-1] by feature SORT_BY_xxxx. This updates spotPairList[], firstSpotPair, lastSpotPair, r.prevSpot, r.nextSpot. Keep the same spot list size - even if most of it is null.

Parameters:
sortByFeature - DbSpot.SPOT_FEATURE_xxxx
sortByNsample - is either RSAMPLE or SAMPLE
ascendingFlag - to sort in assending order
Returns:
true if succeed, false if problem

findSpotPairByXY

public DbPspot findSpotPairByXY(int nSample,
                                int xT,
                                int yT,
                                int distThr,
                                boolean allSpotsFlag)
findSpotPairByXY() - find a spot in the spot-pair list that is within distThr of the (x,y) coordinate specified. Search the linked list rather than the spotPairList[]. If nSample is RSAMPLE, use (rXabs,yYabs), else if nSample is SAMPLE use (sXabs,yAbs).

Parameters:
nSample - is either RSAMPLE or SAMPLE
xT - coordinate of test position
yT - coordinate of test position
distThr - minimum Euclidean distance for it to be accepted
allSpotsFlag - to get all spots, else just BF_ISVALIDSPOT spots
Returns:
spot if found, else null

setSampleNames

public void setSampleNames(java.lang.String sampleType,
                           java.lang.String sampleName,
                           java.lang.String simplePixFileSample,
                           java.lang.String inPixFileSample,
                           java.lang.String ssfFileSample)
setSampleNames() - set the DbSample state for current sample. This should be called just before reading the SSF.

Parameters:
sampleType - is either "Rsample" or "Sample"
sampleName - is the base sample name (no path prefix or .ext). is name is also in the accession and landmark databases. E.g., "sample1".
simplePixFileSample - is the base name of the input pix file (with .ext). E.g., "sample1.gif".
inPixFileSample - is the full path of the input pix file. E.g., "demo/ppx/sample1.gif".
ssfFileSample - is the full path of the SSF file E.g., "demo/xml/sample1-SSF.xml".

setCW

public void setCW(int cwX1,
                  int cwX2,
                  int cwY1,
                  int cwY2)
setCW() - set the computing window state for current sample.

Parameters:
cwX1 - is the ULHC x
cwX2 - is the LRHC x
cwY1 - is the ULHC y
cwY2 - is the LRHC y

setSizingThresholds

public void setSizingThresholds(float t1area,
                                float t2area,
                                float t1density,
                                float t2density,
                                float t1range,
                                float t2range)
setSizingThresholds() - set the spot sizing threshold for the current sample.

Parameters:
t1area - is lower threshold of area sizing
t2area - is upper threshold of area sizing
t1density - is lower threshold of integrated density sizing
t2density - is upper threshold of integrated density sizing
t1range - is lower threshold of pixel density range sizing
t2range - is upper threshold of pixel density range sizing

setSaturationPercentThresholds

public void setSaturationPercentThresholds(float glbPctThr)
setSaturationPercentThresholds() - set spot saturated percent threshold state for the current sample.

Parameters:
glbPctThr - Saturation threshold [0.0 : 1.0] , i.e. 0 to 100%

setMinCentralCoreSize

public void setMinCentralCoreSize(int ccMinimumSize)
setMinCentralCoreSize() - set spot minimum central core component area size state in pixels for the current sample.

Parameters:
ccMinimumSize - for sizing

setBkgrdFilterSize

public void setBkgrdFilterSize(int bkgFilterSize)
setBkgrdFilterSize() - set spot saturated percent threshold state for the current sample.

Parameters:
bkgFilterSize - background filter size

chkSampleImageExists

public boolean chkSampleImageExists()
chkSampleImageExists() - test if the original image file exists for the sample

Parameters:
dbS - is the DbSample instance" dbRsample, dbSample or other.
Returns:
true if succeed

getSampleAccStr

public java.lang.String getSampleAccStr()
getSampleAccStr() - get printable data including accession name/value row for this sample

Returns:
printable string

saveAccRowForSample

public boolean saveAccRowForSample(java.lang.String[] accRowData)
saveAccRowForSample() - save accession row entry data in the accession database table for this sample. This assumes that you have made any editing changes you need in accRowData.

Parameters:
accRowData - to save
Returns:
true if succeed

isDBwindow

public final boolean isDBwindow(int x,
                                int y)
isDBwindow() - test if (x,y) is inside the debug window. i.e., (xDbug>=dbx1 && xDbug<=dbx2 && yDbug>=dby1 && yDbug<=dby2))

Parameters:
x - is value to test
y - is value to test
Returns:
true if inside debug window

setDBwindow

public boolean setDBwindow(int rX1,
                           int rY1,
                           int rX2,
                           int rY2)
setDBwindow() - set debug window of interest to region of interest (ROI). If it is a valid window, then do various debug printouts. To disable, set it to an illegal window outside of [0:pixWidth-1, 0:pixHeight-1].

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if succeed.

setCWroi

public boolean setCWroi(int rX1,
                        int rY1,
                        int rX2,
                        int rY2,
                        java.lang.String[] accRowDataS)
setCWroi() - set region of interest (ROI) to Computing Window (CW)

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
accRowDataS - is the replacement value for accRowData to use
Returns:
true if succeed.

setCWroi

public boolean setCWroi(int rX1,
                        int rY1,
                        int rX2,
                        int rY2)
setCWroi() - set region of interest (ROI) to Computing Window (CW). It updates the sample accRowData[] instance.

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if succeed.

setWedgeCWroi

public boolean setWedgeCWroi(int rX1,
                             int rY1,
                             int rX2,
                             int rY2,
                             java.lang.String[] accRowDataS)
setWedgeCWroi() - set Calibration wedge computing window ROI

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
accRowDataS - is the replacement value for accRowData to use
Returns:
true if succeed.

setCalValueListCalibAccFields

public boolean setCalValueListCalibAccFields(float[] wedgeCalValues)
setCalValueListCalibAccFields() - set Calibration wedge wedgeCalValues in the accession DB field for this sample.

Returns:
true if succeed.

setWedgeCWroi

public boolean setWedgeCWroi(int rX1,
                             int rY1,
                             int rX2,
                             int rY2)
setWedgeCWroi() - set Calibration wedge computing window ROI. It updates the sample accRowData[] instance.

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if succeed.

setWedgeGrayListData

public boolean setWedgeGrayListData(java.lang.String wedgeCalListStr,
                                    int[] wedgeGrayList)
setWedgeGrayListData() - set Calibration wedge wedgeGrayList in the accession DB field for this sample.

Returns:
true if succeed.

setROI2CW

public boolean setROI2CW(int rX1,
                         int rY1,
                         int rX2,
                         int rY2)
setROI2CW() - set region of interest (ROI) to Computing Window (CW)

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if succeed.

setROI2CALCW

public boolean setROI2CALCW(int rX1,
                            int rY1,
                            int rX2,
                            int rY2)
setROI2CALCW() - set Calibration wedge computing window ROI

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if succeed.

isValidROI

public boolean isValidROI(int rX1,
                          int rY1,
                          int rX2,
                          int rY2)
isValidROI() - check if current region of interest (ROI) is valid

Parameters:
rX1 - - ULHC x coordinate
rY1 - - ULHC y coordinate
rX2 - - LRHC x coordinate
rY2 - - LRHC y coordinate
Returns:
true if valid

lookupSampleInAccDB

public boolean lookupSampleInAccDB(java.lang.String accNameData,
                                   java.lang.String accFieldName,
                                   java.lang.String accFile)
lookupSampleInAccDB() - lookup the sample by (nave,value) pair for this sample 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
Returns:
true if succeed

setDebugCW

public void setDebugCW(boolean ssfCWflag,
                       int dbCWX1,
                       int dbCWY1,
                       int dbCWX2,
                       int dbCWY2)
setDebugCW() - enable/disable debug computing window to restrict data read when test if p.(xMom,yMom) in SSF CW for debugging. In which case limit spots to those within the CW.

Parameters:
ssfCWSflag - is debugging switch.
dbWX1 - is debug window X1
dbCWY1 - is debug window Y1
dbCWX2 - is debug window X2
dbCWY2 - is debug window Y2

calcDensPrime

public boolean calcDensPrime(boolean bkgrdCorrectionSwitch,
                             boolean rmvDprimeSizingSwitch)
calcDensPrime() - For all spots update the spotList with background corrections by computing D' = Density - Area*MeanBkgrdDensity

Parameters:
bkgrdCorrectionSwitch - if use background correction.
       Otherwise compute:
          mnBackground= calib.mapGrayToCal[mnBkgrdGrayvalue],
          densityPrime= density - (.area*.mnBackground).
rmvDprimeSizingSwitch - if remove spots from list by D' sizing, i.e. remove spots if (r.densityPrime < t1Density)
Returns:
true if succeed, false if there is an error

assignRsampleToAllSpotsInSpotList

public boolean assignRsampleToAllSpotsInSpotList(DbSample dbRsample)
assignRsampleToAllSpotsInSpotList() - assign the dbRsample field in all spots in the current spot list

Returns:
true if succeed, false if there is an error

listAllSpots

public java.lang.String listAllSpots(boolean includeNullSpotsFlag,
                                     boolean useDbugWindFlag)
listAllSpots() - list all spots in the spot list.

Parameters:
includeNullSpotsFlag - list null spots (ccNumber==0) as well
useDbugWindFlag - to test if spot coords in debug ROI
Returns:
list of all spots.
See Also:
clearSpotList(), findSpotByXY(int, int, int, boolean), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), pushSpot(O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), setupSpotList(int), sortSpotList(int, boolean)

findSpotByXY

public DbSpot findSpotByXY(int xT,
                           int yT,
                           int distThr,
                           boolean allSpotsFlag)
findSpotByXY() - find a spot in the spot list that is within distThr of the (x,y) coordinate specified. Search the linked list rather than the spotList[]/

Parameters:
xT - coordinate of test position
yT - coordinate of test position
distThr - minimum Euclidean distance for it to be accepted
allSpotsFlag - to get all spots, else just BF_ISVALIDSPOT spots
Returns:
spot if found, else null
See Also:
clearSpotList(), insertSpot(O2Plib.db.DbSpot, O2Plib.db.DbSpot), pushSpot(O2Plib.db.DbSpot), removeSpot(O2Plib.db.DbSpot), setupSpotList(int), sortSpotList(int, boolean)

readSSFdata

public java.lang.String readSSFdata()
readSSFdata() - Read sample Sample Spot-list Files (SSF) into a linked list data base of DbSpot objects. It also reads the parameters and summary info that is stored in this class instance. This method will read the file as either a tab-delimited file or as a .xml file.

Returns:
report string containing printable spot counts if succeed, else null if a problem
See Also:
readAllSsfSpotlistTables(), readSsfSpotlistXML(java.lang.String)

readAllSsfSpotlistTables

public boolean readAllSsfSpotlistTables()
readAllSsfSpotlistTables() - read SSF data, preface and epilogue tables Note: this reads the SSF data produced by "Seg2Dgel -ssfFormat:F" which produces three files. Note: this tab-delimited file input mode will be depricated and use of XML encouraged to implement the Open2Dprot data-exchange paradigm.
    xml/sample.txt  the spotlist data  
    xml/sample-PREFACE.txt  the preface  
    xml/sample-EPILOGUE.txt the epilogue 
 which is equivalent to data generated by " -ssfFormat:X"
    xml/sample.xml  

Returns:
true if succeed

readSsfSpotlistXML

public boolean readSsfSpotlistXML(java.lang.String XMLfileName)
readSsfSpotlistXML() - read SSF spot list, preface and epilogue data from XML file. Note: this reads the SSF data produced by "Seg2Dgel -ssfFormat:X" which produces 1 file
    xml/sample.xml  
 is equivalent to data generated by "Seg2Dgel -ssfFormat:F"
    xml/sample.txt  the spotlist data  
    xml/sample-PREFACE.txt  the preface  
    xml/sample-EPILOGUE.txt  the epilogue 

Parameters:
XMLfileName - to read
Returns:
true if succeed

lookupSsfSpotlistTableIndices

public boolean lookupSsfSpotlistTableIndices()
lookupSsfSpotlistTableIndices() - lookup SSF data table indices

Returns:
true if succeed

readSsfSpotlistTable

public boolean readSsfSpotlistTable(java.lang.String ssfFile)
readSsfSpotlistTable() - read SSF data table from tab-delimited data

Parameters:
ssfFile - is tab-delimited SSF data file
Returns:
true if succeed

readSsfPrefaceTable

public boolean readSsfPrefaceTable(java.lang.String prefaceFile)
readSsfPrefaceTable() - read SSF preface tab-delimited file

Parameters:
prefaceFile - to read
Returns:
true if succeed

readSsfEpilogueTable

public boolean readSsfEpilogueTable(java.lang.String epilogueFile)
readSsfEpilogueTable() - read SSF epilogue tab-delimited file

Parameters:
epilogueFile - to read
Returns:
true if succeed

writeEntireSSF

public boolean writeEntireSSF(java.lang.String bannerTitle,
                              java.lang.String[] swList,
                              java.lang.String projDir,
                              java.lang.String filesUsed,
                              java.lang.String ssfOutputFile,
                              int ssfOutputFormatMode)
writeEntireSSF() - write the entire SSF file. The data mode is determined by the ssfFormat. This should only be called AFTER the segmentation is finished and all data and spot statistics are available.

Parameters:
bannerTitle - is optional title to put into output file header if not null.
swList - is optional list of program switches used by the SSF generating program if not null.
projDir - is optional project directory if not null.
filesUsed - is optional list of files associated with SSF.
ssfOutputFile - is the SSF output format mode
Returns:
true if succeed

writeEntireDOM_XML

public boolean writeEntireDOM_XML(java.lang.String outputFile)
writeEntireDOM_XML() - write the entire SSF file into an XML file using DOM/JDOM/... etc. This should only be called AFTER the segmentation is finished and all data and spot statistics are available. [TODO] add DOM/JDOM ... code

Returns:
true if succeed

cvtSpotToSpotRecordStr

public java.lang.String cvtSpotToSpotRecordStr(DbSpot r,
                                               int useSsfFormatMode)
cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode.

Parameters:
r - is the spot to convert to a string
useSsfFormatMode - to use in conversion
Returns:
String spot record

cvtSpotToSpotRecordStr

public java.lang.String cvtSpotToSpotRecordStr(DbSpot r)
cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode.

Parameters:
r - is the spot to convert to a string
Returns:
String spot record

cvtSpotToSpotRecordStr

public java.lang.StringBuffer cvtSpotToSpotRecordStr(java.lang.StringBuffer s,
                                                     DbSpot r)
cvtSpotToSpotRecordStr() - convert spot statistics to string depending on the SSF conversion mode. Note: use StringBuffer to speed things up since it is called for each accepted spot.

Parameters:
sBuf - is the string buffer to add the spot stats
r - is the spot to convert to a string
Returns:
StringBuffer spot record with data appended

writeSpotsToFile

public boolean writeSpotsToFile()
writeSpotsToFile() - write the linked spot list, spot by spot, into the log file. Spots which did not meet the sizing criteria are NOT writen and the the r.spotNumber is renumbered. If generating the segmented spot image in pix5, and the -DOTs.

Returns:
true if succeed, false if there is an error

writeSSFpreface

public boolean writeSSFpreface(java.lang.String bannerTitle,
                               java.lang.String[] swList,
                               java.lang.String filesUsed,
                               java.lang.String projDir)
writeSSFpreface() - write the SSF preface to the SSF file in ssfFD.

Parameters:
bannerTitle - is the title line (optional)
swList - is optional list of program switches used by the SSF generating program if not null.
filesUsed - is optional list of files associated with SSF.
projDir - is optional project directory if not null.
Returns:
true if succeed

writeStatisticsToSSFfile

public boolean writeStatisticsToSSFfile()
writeStatisticsToSSFfile() - write the segmented spot statistics to the SSF file in ssfFD.

Returns:
true if succeed

writeFinish

public boolean writeFinish(java.lang.String filesUsed)
writeFinish() - finish and close the segemented output file.

Parameters:
filesUsed - is optional list of files associated with SSF.
Returns:
true if succeed