|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectImageDataMeas
public class ImageDataMeas
ImageDataMeas class supports image data spot measurement 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
Field Summary | |
---|---|
float |
bkgrdGrayValue
Capture "background" pixel gray or OD value. |
int |
bkgrdObjX
Capture "background" X coordinate |
int |
bkgrdObjY
Capture "background" Y coordinate |
Spot |
curSpot
Current spot set with showMeasValue if being measured. |
static Flicker |
flk
Flicker global classes |
ImageData |
id
Instance of ImageData for extended classes |
static int[] |
maskArea
List of areas under each mask index by the mask radius |
static int[][][] |
maskNxN
Array of masks [0:nMasks-1][0:Nr][0:Nr] where Nr is (2*radius+1) |
static int[] |
maskRadius
Array of mask radius size where Nr is (2*radius+1) |
static int[] |
maskTotWeight
List of total weights under each mask index by the mask radius |
float |
maxBkgrdGrayValue
Capture max "background" pixel gray or OD value |
float |
maxGrayValue
Capture max pixel gray or OD value within mask |
float |
maxMeasGrayValue
Capture max "measurement" pixel gray or OD value |
float |
meanBkgrdGrayValue
Capture mean "background" pixel gray or OD value. |
float |
meanGrayValue
Capture mean pixel gray or OD value within mask |
float |
meanMeasGrayValue
Capture mean "measurement" pixel gray or OD value. |
float |
measGrayValue
Capture "measurement" pixel gray or OD value. |
int |
measObjX
Capture "background" X coordinate |
int |
measObjY
Capture "background" Y coordinate |
float |
minBkgrdGrayValue
Capture min "background" pixel gray or OD value |
float |
minGrayValue
Capture min pixel gray or OD value within mask |
float |
minMeasGrayValue
Capture min "measurement" pixel gray or OD value |
static int |
nMasks
number of masks [0:nMasks-1][0:Nr][0:Nr] |
float |
totGrayValue
Capture total pixel gray or OD value within mask |
float |
totMeasGrayValue
Capture total "measurement" pixel gray or OD value. |
static Util |
util
extended Flicker state variable class |
Constructor Summary | |
---|---|
ImageDataMeas()
ImageData() - Constructor for creating spot masks Defaults to Flicker.MAX_CIRCLE_RADIUS # of masks |
|
ImageDataMeas(ImageData iData)
ImageData() - Constructor for spot measurement extension |
|
ImageDataMeas(int maxRadiusToCreate)
ImageData() - Constructor for creating spot masks of size 1x1 to (maxRadiusToCreate X maxRadiusToCreate) |
Method Summary | |
---|---|
boolean |
calcHistogram(int x1,
int y1,
int x2,
int y2)
calcHistogram() - compute grayscale histogram under the specified computing window [x1:x2, y1:y2]. |
private static int |
calcMaskArea(int[][] mask)
calcMaskArea() - compute the area under the mask |
private static int |
calcMaskTotWeight(int[][] mask)
calcMaskTotWeight() - compute the total weights under the mask |
float |
calcSumValuesUnderMask(int radius,
int x0,
int y0,
boolean useTotDensityFlag)
calcSumValuesUnderMask() - compute sum of pixel values under the mask corresponding to the mask set by the current radius. |
float |
captureBackgroundValue()
captureBackgroundValue() - capture the values under the mask of the selected image if it is left or right and assign it to the background pixel value for the current image. |
float |
captureMeasCWvalue()
captureMeasCWvalue() - capture the pixel values under the computing window of the selected image if it is left or right and assign it to the measurement pixel value for the current image. |
float |
captureMeasValue()
captureMeasValue() - capture the pixel values under the mask of the selected image if it is left or right and assign it to the measurement pixel value for the current image. |
void |
clean()
clean() - init the image data measurement state |
static int |
createMaskDatabase(int maxCircleRadius)
createMaskDatabase() - create the set of circular masks of size NrxNr stored in a 3D array [0:nMasks-1][0:Nr][0:Nr] where Nr is (2*radius+1) |
static java.lang.String |
cvMaskToStr(int[][] mask,
java.lang.String msg)
cvMaskToStr() - convert a mask to a printable string |
java.lang.String |
cvtGrayValueToODstr(int g)
cvtGrayValueToODstr() - convert gray value to OD string if the map has been defined for the ImageData instance |
int |
getPixelValue(int x,
int y)
getPixelValue() - get the pixel value for the image at (x,y). |
java.lang.String |
getPixelValueStr(int xObj,
int yObj)
getPixelValueStr() - get the pixel value string for the image where the trial object (xObj,yObj) is located. |
static void |
main(java.lang.String[] args)
main() - createMaskDatabase function for debugging... |
static void |
setCircleMaskRadius(int radius,
ImageData iData)
setCircleMaskRadius() - set the circle radius for measurement and background, as well as the circle mask given the radius. |
void |
setupCircularMaskStatistics()
setupCircularMaskStatistics()- compute the mask area and total weights for each mask. |
java.lang.String |
showBkgrdValue()
showBkgrdValue() - print the background measurement value. |
java.lang.String |
showMeasValue(java.lang.String measMode)
showMeasValue() - print the measurement value subtracting the background value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Flicker flk
public static Util util
public ImageData id
public static int[][][] maskNxN
public static int nMasks
public static int[] maskRadius
public static int[] maskArea
public static int[] maskTotWeight
public float maxGrayValue
public float minGrayValue
public Spot curSpot
public float totGrayValue
public float meanGrayValue
public float meanBkgrdGrayValue
public float meanMeasGrayValue
public float totMeasGrayValue
public float bkgrdGrayValue
public float measGrayValue
public float maxBkgrdGrayValue
public float maxMeasGrayValue
public float minBkgrdGrayValue
public float minMeasGrayValue
public int bkgrdObjX
public int bkgrdObjY
public int measObjX
public int measObjY
Constructor Detail |
---|
public ImageDataMeas(ImageData iData)
iData
- is the ImageData instancepublic ImageDataMeas()
public ImageDataMeas(int maxRadiusToCreate)
maxRadiusToCreate
- Method Detail |
---|
public void clean()
public static int createMaskDatabase(int maxCircleRadius)
maxCircleRadius
- is the maximum circle size radius
public static java.lang.String cvMaskToStr(int[][] mask, java.lang.String msg)
mask
- is [nR][nR] to printmsg
- is optional message to prefix out if not null
public void setupCircularMaskStatistics()
private static int calcMaskArea(int[][] mask)
mask
- is 2D mask
private static int calcMaskTotWeight(int[][] mask)
mask
- is 2D mask
public static void setCircleMaskRadius(int radius, ImageData iData)
radius
- - of the circle maskiData
- - if set to I1 or I2, null otherwisepublic float calcSumValuesUnderMask(int radius, int x0, int y0, boolean useTotDensityFlag)
radius
- is mask radius to use (2*radius+1)x0
- center of the mask'ed datay0
- center of the mask'ed datauseTotFlag
- to return total gray values else mean gray values.
public final int getPixelValue(int x, int y)
Notes: 1) because we only keep 24-bit (R,G,B) pixel image data, we only report the least significant 8-bits (blue channel) for the gray value. 2) If the original image data had > 8-bits, we still report it (for now) as 8-bits.
public java.lang.String cvtGrayValueToODstr(int g)
g
- is the gray value to convert
public java.lang.String getPixelValueStr(int xObj, int yObj)
Notes: 1) because we only keep 24-bit (R,G,B) pixel image data, we only report the least significant 8-bits (blue channel) for the gray value. 2) If the original image data had > 8-bits, we still report it (for now) as 8-bits. 3) [TODO] could remap RGB via NTSC mapping...
xObj
- pixel coordinateyObj
- pixel coordinate
public float captureBackgroundValue()
public java.lang.String showBkgrdValue()
public float captureMeasValue()
public float captureMeasCWvalue()
public java.lang.String showMeasValue(java.lang.String measMode)
measMode
- is "circleMask", "compROI", "boundary"
public boolean calcHistogram(int x1, int y1, int x2, int y2)
x1
- - ULHC x coordinatey1
- - ULHC y coordinatex2
- - LRHC x coordinatey2
- - LRHC y coordinatepublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |