Class ImageDataSpotList

java.lang.Object
  extended by ImageDataSpotList

public class ImageDataSpotList
extends java.lang.Object

ImageDataSpotList class supports image data spot list object access.

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 Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker

Version:
$Date$ $Revision$
Author:
P. Lemkin (LECB/NCI), G. Thornwall (SAIC), Frederick, MD
See Also:
Flicker Home

Field Summary
 boolean changeSpotList
           
static Flicker flk
          Flicker global classes
 ImageData id
          Instance of ImageData for extended classes
 int measCtr
          "Measurement counter" in measurements for this image
 int nSpots
          # of measured spots used in SpotList[]
 int nSpotsBackup
          # of measured spots used in SpotListBkup[]
 Spot[] spotList
          List of measured spots data if not null [0:nSpots-1].
 Spot[] spotListBkup
          Backup list of measured spots data if not null [0:nSpotsBkup-1].
static Util util
          extended Flicker state variable class
 
Constructor Summary
ImageDataSpotList(ImageData id)
          ImageDataSpotList() - Constructor for Spot Lists
 
Method Summary
 Spot addUniqueSpotToSpotList(int nGel, int nbr, int nCirMask, int circleRadius, int xC, int yC, int xB, int yB, float area, boolean isCalibFlag, boolean useTotDensityFlag, float density, float densPrime, float bkgrd, float mnDens, float totDens, float mnDensPrime, float mnBkgrd, float dMax, float dMin, float dMaxBkgrd, float dMinBkgrd)
          addUniqueSpotToSpotList() - add spot if it is unique to the spot list else just update the spot measurement but keep the spot number if it is an existing spot if +- 1 pixel in xC and/or yC
 boolean backupSpotList(boolean clearSpotListFlag)
          backupSpotList() - backup spotList[0:nSpots-1] to spotListBkup[] and nSpotBkup.
 void clean()
          clean() - cleanup the instance.
 boolean clearSpotList()
          clearSpotList() - prompt "are you sure" and clear spot list if 'yes'.
 boolean editSpotFromSpotList(Spot s, boolean editOnlyIDflag)
          editSpotFromSpotList() - edit the spot from the spot list if found
 boolean editSpotFromSpotList(Spot s1, Spot s2, boolean editOnlyIDflag)
          editSpotFromSpotList() - edit the spot from the spot list if found
 void forceClearSpotList()
          forceClearSpotList() - clear spot list and do NOT prompt if not empty.
 boolean lookupProtIDandNameToSpotList(ImageData iData)
          lookupProtIDandNameToSpotList() - if the gel is clickable and the user enabled the clickable DB checkbox, then search the clickableCGIbaseURL protein database for all spots in the spot list and for those that have matches, update the Spot.id and Spot.name.
 Spot lookupSpotInSpotListByXY(int xC, int yC)
          lookupSpotInSpotListByXY() - lookup the spot in the spotList[0:nSpots-1] if the (xC,yC) are +- 1 pixel in x and/or y.
 java.lang.String mapSPIDtoPIRURL(java.lang.String defaultURL, java.lang.String clickCGIbaseURL, int x, int y)
          mapSPIDtoPIRURL() - if using a PIR server database AND we have either looked up the Swiss-Prot ID for the spot, then map the dataURL to the PRI site by adding the SP ID to the currentPRIbaseURL.
 boolean restoreSpotList()
          restoreSpotList() - retore spotList[0:nSpots-1] from spotListBkup[] and nSpotBkup.
 boolean rmvSpotFromSpotList(Spot s)
          rmvSpotFromSpotList() - remove the spot from the spot list if found If the spot is at the end of the list, the reuse the spot number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flk

public static Flicker flk
Flicker global classes


util

public static Util util
extended Flicker state variable class


id

public ImageData id
Instance of ImageData for extended classes


changeSpotList

public boolean changeSpotList

spotList

public Spot[] spotList
List of measured spots data if not null [0:nSpots-1]. Preallocate to [0:flk.MAX_SPOTS-1]


nSpots

public int nSpots
# of measured spots used in SpotList[]


measCtr

public int measCtr
"Measurement counter" in measurements for this image


spotListBkup

public Spot[] spotListBkup
Backup list of measured spots data if not null [0:nSpotsBkup-1]. Preallocate to [0:flk.MAX_SPOTS-1]. This lets us push the current spot list while we temporarily use a new set of spots for some task (e.g., calibrate by a set of spot measurements) and then restore it later. Currently, we only do this to one level and this list is NOT saved when you exit the program.


nSpotsBackup

public int nSpotsBackup
# of measured spots used in SpotListBkup[]

Constructor Detail

ImageDataSpotList

public ImageDataSpotList(ImageData id)
ImageDataSpotList() - Constructor for Spot Lists

Method Detail

clean

public void clean()
clean() - cleanup the instance. Clear idSL.spotList[0:nSpots-1]. Prompt "are you sure" and clear spot list if 'yes'. Clean up spotlist and backup spot list.


clearSpotList

public boolean clearSpotList()
clearSpotList() - prompt "are you sure" and clear spot list if 'yes'.

Returns:
true if cleared the spot list

forceClearSpotList

public void forceClearSpotList()
forceClearSpotList() - clear spot list and do NOT prompt if not empty.


backupSpotList

public boolean backupSpotList(boolean clearSpotListFlag)
backupSpotList() - backup spotList[0:nSpots-1] to spotListBkup[] and nSpotBkup.

Parameters:
clearSpotListFlag - to also clear the spotlist
Returns:
true if succeed, false if the list is currently already backed up. You can only backup one time.
See Also:
restoreSpotList

restoreSpotList

public boolean restoreSpotList()
restoreSpotList() - retore spotList[0:nSpots-1] from spotListBkup[] and nSpotBkup.

Returns:
true if succeed, false if the list was not previously backed up. You can only restore a backed up spot list.
See Also:
backupSpotList

editSpotFromSpotList

public boolean editSpotFromSpotList(Spot s,
                                    boolean editOnlyIDflag)
editSpotFromSpotList() - edit the spot from the spot list if found

Parameters:
s - is spot to edit
editOnlyIDflag - if only want to edit/assign the spot id
Returns:
true if edited it, false if failed

editSpotFromSpotList

public boolean editSpotFromSpotList(Spot s1,
                                    Spot s2,
                                    boolean editOnlyIDflag)
editSpotFromSpotList() - edit the spot from the spot list if found

Parameters:
s1 - is spot to edit in left image
s2 - is spot to edit in right image
editOnlyIDflag - if only want to edit/assign the spot id
Returns:
true if edited it, false if failed

rmvSpotFromSpotList

public boolean rmvSpotFromSpotList(Spot s)
rmvSpotFromSpotList() - remove the spot from the spot list if found If the spot is at the end of the list, the reuse the spot number.

Parameters:
s - is spot to remove
Returns:
true if deleted it, false if failed

mapSPIDtoPIRURL

public java.lang.String mapSPIDtoPIRURL(java.lang.String defaultURL,
                                        java.lang.String clickCGIbaseURL,
                                        int x,
                                        int y)
mapSPIDtoPIRURL() - if using a PIR server database AND we have either looked up the Swiss-Prot ID for the spot, then map the dataURL to the PRI site by adding the SP ID to the currentPRIbaseURL. The URL is null if no PIR server was selected.

Parameters:
defaultURL - to use if PIR server access is not enabled.
clickCGIbaseURL - is the Swiss-Prot ID if not null.
Returns:
PIR URL or default URL if failed.

lookupProtIDandNameToSpotList

public boolean lookupProtIDandNameToSpotList(ImageData iData)
lookupProtIDandNameToSpotList() - if the gel is clickable and the user enabled the clickable DB checkbox, then search the clickableCGIbaseURL protein database for all spots in the spot list and for those that have matches, update the Spot.id and Spot.name. If no match,then no change.

Parameters:
iData - is the gel image to update
Returns:
true if updated it, false if failed

addUniqueSpotToSpotList

public Spot addUniqueSpotToSpotList(int nGel,
                                    int nbr,
                                    int nCirMask,
                                    int circleRadius,
                                    int xC,
                                    int yC,
                                    int xB,
                                    int yB,
                                    float area,
                                    boolean isCalibFlag,
                                    boolean useTotDensityFlag,
                                    float density,
                                    float densPrime,
                                    float bkgrd,
                                    float mnDens,
                                    float totDens,
                                    float mnDensPrime,
                                    float mnBkgrd,
                                    float dMax,
                                    float dMin,
                                    float dMaxBkgrd,
                                    float dMinBkgrd)
addUniqueSpotToSpotList() - add spot if it is unique to the spot list else just update the spot measurement but keep the spot number if it is an existing spot if +- 1 pixel in xC and/or yC

Parameters:
nGel - is the Gel# (1 or 2) rof "left" or "right" image.
nbr - is measurement number of spot unique to the associated gel
nCirMask - is the circular mask diameter
circleRadius - is the radius of the circlular mask
xC - is the spot X centroid
yC - is the spot Y centroid
xB - is background x centroid
yB - is background Y centroid
area - is spot area in pixels (float so possibly scaled)
isCalibFlag - is measurements are calibrrated in OD rather than grayscale
useTotDensityFlag - measurements total density else mean values
density - is total density uncorrected for background computed as the sum of the gray value or calibrated gray value (i.e. OD?)
densPrime - is the total density corrected for background by computed as: densPrime = (density - mnBkgrd*area)
bkgrd - is the total spot mean background density
mnDens - is the mean density
totDens - is the total density
mnDensPrime - is mean density corrected for background computed as (mnDensPrime - mnBkgrd)
mnBkgrd - is the mean spot mean background density
dMax - is spot MAX OD
dMin - is spot MIN OD
dMaxBkgrd - background for spot MAX OD or gray value
dMinBkgrd - background for spot MIN OD or gray value
Returns:
the Spot instance if added it or updated the spotList and return spot, else null if problem

lookupSpotInSpotListByXY

public Spot lookupSpotInSpotListByXY(int xC,
                                     int yC)
lookupSpotInSpotListByXY() - lookup the spot in the spotList[0:nSpots-1] if the (xC,yC) are +- 1 pixel in x and/or y.

Parameters:
xC - to test
yC - to test
Returns:
Spot if found, else null