|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBoundary
public class Boundary
Class Boundary performs boundary operations and its instance exists in the ImageData object.
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
Field Summary | |
---|---|
(package private) int |
area
|
java.awt.Point[] |
bnd
Boundary of object |
(package private) java.awt.Color |
bndColor
color to draw boundary |
boolean |
bndOpenFlag
boundary is active |
(package private) double |
density
|
(package private) double |
densRaw
|
private Flicker |
flk
|
(package private) int |
iHeight
height of image to measure |
(package private) int |
iWidth
width of image to measure |
(package private) float[] |
mapGrayToOD
gray scale to OD map |
int |
MAX_BND
Max boundary size |
(package private) int |
maxBnd
Max size of boundary array |
(package private) double |
maxd
|
java.lang.String |
measType
"Quant" or "Bkgrd" |
(package private) int |
measurementNbr
measurement # |
(package private) int |
merx1
|
(package private) int |
merx2
|
(package private) int |
mery1
|
(package private) int |
mery2
|
(package private) double |
mind
|
(package private) double |
mnbackground
|
(package private) int |
nPoints
# points drawn so far |
(package private) int |
perim
|
(package private) double |
sdDensity
|
(package private) double |
sx
|
(package private) double |
sxy
|
(package private) double |
sy
|
(package private) boolean |
validFeaturesFlag
Set object features as function of input pixels [] and boundary |
(package private) double |
xAbs
|
(package private) int[] |
xPoints
coordinates for drawing using polyline |
(package private) double |
yAbs
|
(package private) int[] |
yPoints
coordinates for drawing using polyline |
Constructor Summary | |
---|---|
Boundary(Flicker flk)
Boundary() - constructor. |
Method Summary | |
---|---|
void |
clean()
clean() - clean up before init or when kill instance before GC |
java.lang.String |
cvFeatures2str(java.lang.String imageFile)
cvFeatures2str() - cvt object features to printable string |
void |
drawBoundary(java.awt.Graphics g)
drawBoundary() - draw boundary backwards |
void |
drawBoundaryInImage(java.awt.Graphics g)
drawBoundaryInImage() - redraw boundary in window if visible. |
void |
eraseBoundary()
eraseBoundary() - erase boundary backwards one at a time. |
boolean |
finishMeasurement(int iWidth,
int iHeight,
int[] inputPix,
int pixelMask)
finishMeasurement() - finish measurement and compute features |
java.awt.Point[] |
getBoundary()
getBoundary() - return boundary |
int |
getBoundaryLength()
getBoundaryLength() - return nPoints for boundary |
boolean |
getValidFeaturesFlag()
getValidFeaturesFlag() - get the valid features set after measurement |
int |
interpolatePoints(int xOld,
int yOld,
int xNew,
int yNew)
interpolatePoints() - interpolate (xOld,yOld) to (xNew,yNew) into list of x,y coordinates of maximum size maxN which are pushed onto the bnd[] point list. |
void |
measureRegion(int[] inputPixels,
int pixelMask)
measureRegion() - compute image features for object inside boundary. |
void |
processBoundaryMode(int x,
int y,
boolean shiftMod)
processBoundaryMode() - process drawing mouse event if boundaryMode |
int |
pushBoundary(int x,
int y)
pushBoundary() - push unique boundary points from last point to current |
void |
regrowBoundary(int newSize)
regrowBoundary() - increase boundary size |
void |
setBndColor(java.awt.Color c)
setBndColor() - set the boundary drawing color |
void |
setBndState(boolean bndOpenFlag)
setBndState() - set the boundary state in the imageCanvas |
void |
setMapGrayToOD(float[] mapGrayToOD)
setMapGrayToOD() - set the MapGrayToOD[] table |
void |
startMeasurement(java.lang.String measType,
int iWidth,
int iHeight)
startMeasurement() - start measurement of object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Flicker flk
public final int MAX_BND
public java.lang.String measType
public boolean bndOpenFlag
float[] mapGrayToOD
public java.awt.Point[] bnd
int iWidth
int iHeight
int measurementNbr
int maxBnd
int nPoints
java.awt.Color bndColor
boolean validFeaturesFlag
double mnbackground
double density
double sx
double sy
double sxy
double maxd
double mind
double xAbs
double yAbs
double densRaw
double sdDensity
int area
int perim
int merx1
int merx2
int mery1
int mery2
int[] xPoints
int[] yPoints
Constructor Detail |
---|
public Boundary(Flicker flk)
Method Detail |
---|
public void setMapGrayToOD(float[] mapGrayToOD)
mapGrayToOD
- map of grayscale to ODpublic void drawBoundary(java.awt.Graphics g)
g
- is graphics context where we draw the boundarypublic void clean()
public final void setBndState(boolean bndOpenFlag)
bndOpenFlag
- to toggle boundary drawing overlaypublic final void setBndColor(java.awt.Color c)
c
- is boundary colorpublic final boolean getValidFeaturesFlag()
public final void startMeasurement(java.lang.String measType, int iWidth, int iHeight)
measType
- is "Quant" or "Bkgrd"iWidth
- is width of imageiHeight
- is height of imagefinishMeasurement(int, int, int[], int)
public void measureRegion(int[] inputPixels, int pixelMask)
ALGORITHM: [1] Given contiguous the convex hull list of points enclosing region. [2] Define the region by a run length map with one run/line. [3] When finished measuring, compute features as function of pixel data inside of the RLM. (Only count pixels INSIDE of boundary.) [4] Then conditionally print these out with the area, density, etc. This algorithm is the same used in the FLICKER program described in: Lemkin,P., Merril,C., Lipkin,L., etal. "Software Aids for the Analysis of 2D Gel Electrophoresis Images", Comp. Biomed. Res. 12, 517 (1979).
inputPixels
- is array of pixels to use.pixelMask
- is pixel mask to use on inputPixelspublic final void regrowBoundary(int newSize)
newSize
- of boundarypublic final int interpolatePoints(int xOld, int yOld, int xNew, int yNew)
xOld
- is starting coordinateyOld
- is starting coordinatexNew
- is final coordinateyNew
- is final coordinate
public final int getBoundaryLength()
public final java.awt.Point[] getBoundary()
public final int pushBoundary(int x, int y)
x
- is new boundary coordinatey
- is new boundary coordinate
public final void eraseBoundary()
public boolean finishMeasurement(int iWidth, int iHeight, int[] inputPix, int pixelMask)
iWidth
- is getSize().width of imageiHeight
- is getSize().height of imageinputPix
- is image buffer pixels from iData{1|2}. input pixelspixelMask
- to get gray value from low order inputPix bits
public java.lang.String cvFeatures2str(java.lang.String imageFile)
imageFile
- is image file
public final void drawBoundaryInImage(java.awt.Graphics g)
g
- is graphics contextpublic final void processBoundaryMode(int x, int y, boolean shiftMod)
x
- is point to pushy
- is point to pushshiftMod
- status
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |