|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ImageData
public class ImageData
ImageData class supports image data object access. This is the top level data structure for a basic image object (left or right). It contains the input and output Image objects and input and output int[] pix arrays.
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 | |
---|---|
java.awt.Image |
bcImg
brightness contrast filtered image if used. |
boolean |
blackIsZeroFlag
Is true if original input image has BLACK as gray value 0, else WHITE is gray value 0 |
Boundary |
bnd
This boundary boundary is ImageData specific. |
CalibrateOD |
calib
calibration data is ImageData specific |
(package private) boolean |
doingTransform
set by doXform, cleared by doneWithXform |
DrawHistogram |
dwCalHist
generic Calibration popup histogram for image |
DrawHistogram |
dwHist
generic ROI popup histogram for image |
long |
endTime
ending time of last transform |
java.lang.String |
errStr
last error message associated with obj |
static Flicker |
flk
Flicker global classes |
boolean |
hasODmapFlag
Indicates that there is an valid mapGrayToOD map else if it was set to 1:1 the flag is set false. |
int[] |
hist
Histogram of data [0:maxGray] |
private java.awt.image.IndexColorModel |
icm
Index Color map |
ImageDataMeas |
idM
Current measured circular mask spot for this image |
ImageDataROI |
idROI
Region(s) Of Interest (ROI). |
ImageDataSpotList |
idSL
Spot list (measured spots) for this image |
int |
iHeight
height of original input image |
java.awt.Image |
iImg
input image. |
java.lang.String |
imageFile
full-path input image file name |
int |
IMG_TYPE_GIF
GIF image type |
int |
IMG_TYPE_J2K
[FUTURE] JPEG2000 image type. |
int |
IMG_TYPE_JPG
JPEG image type |
int |
IMG_TYPE_PPX
GELLAB-II PPX image type |
int |
IMG_TYPE_TIF
TIFF image type |
int |
IMG_TYPE_UNKNOWN
Unknown image type |
int |
imgType
image type is one of IMG_TYPE_xxx |
int[] |
iPix
For ImageXform and display - input image pixel data for display. |
boolean |
isClickableDBflag
flag set if currently selected image is clickable |
boolean |
isColorImgFlag
Is true if it is a color image where red!=green or red!=blue or when it is read in. |
int |
iWidth
width of original input image |
(package private) double |
mag
magnification factor |
(package private) float |
magVal
|
float[] |
mapGrayToOD
mapGrayToOD data if not null |
int |
maxG
maximum Gray value seen in the original iPix[]. |
int |
minG
minimum Gray value seen in the original iPix[]. |
int |
nBitsPerPixel
# of bits/pixel. |
java.awt.Image |
oImg
output image generated by ImageXform. |
int |
pixelMask
bit mask to get the pixel (1 << nBitsPerPixel) -1 |
static boolean |
reportErrorMsgsFlag
report errors on loading else ignore messages |
int |
runTimeMsec
# of milli-seconds to process last transform |
long |
startTime
starting time of last transform |
SliderState |
state
SliderState threshold parameters associated with the image |
(package private) boolean |
threadIsPaintFlag
Ok to paint ImageScroller |
java.lang.String |
title
current title for image scroller associated with iData |
boolean |
userClickableImageDBflag
User enabled image as clickable DB checkbox to get DB entry |
static Util |
util
extended Flicker state variable class |
int |
xObj
Image current object mark |
int |
yObj
Image current object mark |
java.awt.Image |
zImg
ZoomMag filtered image if used. |
int |
zoomedHeight
zoomed height |
int |
zoomedWidth
zoomed width |
(package private) int |
zoomMagScr
zoom value |
Constructor Summary | |
---|---|
ImageData()
ImageData() - Constructor for extensions |
|
ImageData(java.lang.String iName,
java.awt.Image newImg,
java.awt.Dimension iSize,
boolean blackIsZeroFlag,
float[] mapGrayToOD,
Flicker flkS)
ImageData() - Constructor. |
Method Summary | |
---|---|
boolean |
applyNTSCrgb2grayTransform()
applyNTSCrgb2grayTransform() - optionally convert RGT to grayscale for the iPix[] data. |
void |
changeImageData(java.lang.String iName,
java.awt.Image newImg,
java.awt.Dimension iSize,
boolean blackIsZeroFlag,
float[] mapGrayToOD)
changeImageData() - change values of this ImageData object |
boolean |
checkAndMakeIpix(boolean reportErrorMsgsFlag)
checkAndMakeIpix() - check & make iData.iPix if !exists. |
boolean |
checkAndMakeIpix(java.lang.String useXform,
boolean reportErrorMsgsFlag)
checkAndMakeIpix() - check & make iData.iPix if it does not exist. |
static int |
cvtRGBvalToNTSCgrayVal(int rgbPixelVal)
cvtRGBvalToNTSCgrayVal() - convert RGB value to NTSC grayscale value. |
java.awt.Image |
getImageForBCInput()
getImageForBCInput() - get image for input to Brightness/Contrast filter. |
java.awt.Image |
getImageForDisplayInput()
getImageForDisplayInput() - get image for input to display painting. |
java.awt.Image |
getImageForXformInput()
getImageForXformInput() - get the image for input to image transform. |
java.awt.Image |
getImageForZoomInput()
getImageForZoomInput() - get image for input to ZoomMag filter. |
int |
getImgType()
getImgType() - get image type from IMG_TYPE_xxx |
private static int[] |
getPixelDataFromImage(java.awt.Image img,
int width,
int height)
getPixelDataFromImage() - get the pixel data from the image |
boolean |
isRGBcolorImage()
isRGBcolorImage() - test if red!=green!=blue for any pixels |
ImageData |
loadBlankImageData(java.lang.String name,
int w,
int h)
loadBlankImageData() - create and return a blank ImageData object [NOTE] This code has a bug since it does not create the empty window correctly. |
java.awt.Point |
mapStateToZoom(java.awt.Point XYobjToMap)
mapStateToZoom() - map state point to zoomed/dezoomed point based on zoomMagVal. |
java.awt.Point |
mapZoomToState(java.awt.Point zoomedXYobjToMap)
mapZoomToState() - map zoom point to state point based on zoomMagVal. |
java.awt.Point |
mapZoomToState(java.awt.Point zoomedXYobjToMap,
int gw,
int gh)
mapZoomToState() - map zoom point to state point with Guard Region factored in. |
void |
printImgDebugState(java.lang.String msg)
printImgDebugState() - Debugging print (iImg,oImg,zImg) object Java pointers. |
void |
printProperties(java.lang.String msg,
java.awt.Image img,
java.awt.Image zoomInputImg)
printProperties() - Debugging print (iImg,oImg,zImg) object Java pointers, and img width & height. |
void |
resetImageData(boolean iImgFlushFlag)
resetImageData() - reset this ImageData object. |
static java.awt.Image |
resizeImageToTargetSize(java.awt.Image img,
int w,
int h,
int minTargetSize,
int maxTargetSize,
int targetSize)
resizeImageToTargetSize() - resize image to target size if the w or h is outside the range [minTargetSize : maxTargetSize]. |
void |
setDefaultGrayscaleIndexColorMap()
setDefaultGrayscaleIndexColorMap() - set the default grayscale colormap to a RGB IndexColorMap with all colors the same |
void |
setDefaultGrayscaleIndexColorMap(byte[] r,
byte[] g,
byte[] b)
setDefaultGrayscaleIndexColorMap() - set the RGB IndexColorMap from (r,g,b) maps Note: see Hacking Java, pg 90 on cycling color palette [TODO] Update the display... |
void |
setOrigInputPixels(int[] origInputPixels,
int nBitsPerPixel,
boolean blackIsZeroFlag)
setOrigInputPixels() - set the original image iPix[] pixels and associated flags. |
void |
setTitle(java.lang.String title)
setTitle() - change the title for the ImageData instance. |
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 final int IMG_TYPE_UNKNOWN
public final int IMG_TYPE_GIF
public final int IMG_TYPE_JPG
public final int IMG_TYPE_TIF
public final int IMG_TYPE_PPX
public final int IMG_TYPE_J2K
public java.awt.Image iImg
public java.awt.Image oImg
public java.awt.Image zImg
public java.awt.Image bcImg
public int xObj
public int yObj
public int iWidth
public int iHeight
public int zoomedWidth
public int zoomedHeight
public int imgType
public boolean isColorImgFlag
public boolean blackIsZeroFlag
public int nBitsPerPixel
public int pixelMask
public int maxG
public int minG
public int[] iPix
public static boolean reportErrorMsgsFlag
public java.lang.String errStr
public java.lang.String imageFile
public long startTime
public long endTime
public int runTimeMsec
public boolean userClickableImageDBflag
public boolean isClickableDBflag
private java.awt.image.IndexColorModel icm
boolean doingTransform
boolean threadIsPaintFlag
public java.lang.String title
int zoomMagScr
double mag
float magVal
public SliderState state
public Boundary bnd
public CalibrateOD calib
public float[] mapGrayToOD
public boolean hasODmapFlag
public int[] hist
public DrawHistogram dwHist
public DrawHistogram dwCalHist
public ImageDataSpotList idSL
public ImageDataMeas idM
public ImageDataROI idROI
Constructor Detail |
---|
public ImageData(java.lang.String iName, java.awt.Image newImg, java.awt.Dimension iSize, boolean blackIsZeroFlag, float[] mapGrayToOD, Flicker flkS)
iName
- is name of imagenewImg
- is existing input image to setthis.iImg.iSize
- is size of imageblackIsZeroFlag
- is true if image has black as 0 gray valuemapGrayToOD
- is Map of Gray to OD if existsflk
- is instance of Flickerpublic ImageData()
Method Detail |
---|
public int getImgType()
public void setTitle(java.lang.String title)
title
- to usepublic void setDefaultGrayscaleIndexColorMap(byte[] r, byte[] g, byte[] b)
r
- is red mapg
- is green mapb
- is blue mappublic void setDefaultGrayscaleIndexColorMap()
public void resetImageData(boolean iImgFlushFlag)
iImgFlushFlag
- to flush iImg if truepublic void changeImageData(java.lang.String iName, java.awt.Image newImg, java.awt.Dimension iSize, boolean blackIsZeroFlag, float[] mapGrayToOD)
iName
- is name of imagenewImg
- is existing input image to set to this ImageData instanceiSize
- is size of imageblackIsZeroFlag
- is true if image has black as 0 gray valuemapGrayToOD
- is Map of Gray to OD if exists and is not nullpublic static java.awt.Image resizeImageToTargetSize(java.awt.Image img, int w, int h, int minTargetSize, int maxTargetSize, int targetSize)
img
- is image to resizew
- is actual widthh
- is actual heightminTargetSize
- allowedmaxTargetSize
- allowedtargetSize
- to set the image to if resizing and it is not 0
private static int[] getPixelDataFromImage(java.awt.Image img, int width, int height)
img
- image to usewidth
- of imageheight
- of image
public ImageData loadBlankImageData(java.lang.String name, int w, int h)
name
- of empty image to createw
- is width of empty imageh
- is height of empty image
public boolean checkAndMakeIpix(boolean reportErrorMsgsFlag)
reportErrorMsgsFlag
- to report error it it occurs on load
public boolean checkAndMakeIpix(java.lang.String useXform, boolean reportErrorMsgsFlag)
useXform
- to check for "DeZoom" transform.reportErrorMsgsFlag
- to report error it it occurs on load
public boolean isRGBcolorImage()
public static final int cvtRGBvalToNTSCgrayVal(int rgbPixelVal)
rgbPixelVal
- public boolean applyNTSCrgb2grayTransform()
First we recompute the isColorImgFlag status. If it is true, it is a color image where red!=green or red!=blue. This flag is then be tested if we want to map the (R,G,B) to NTSC(R,G,B) grayscale on a pixel level so we could quantify the color data.
This is only applied if the flk.useNTSCrgbTograyCvtFlag and the iData.isColorImgFlag was recomputed as true. It always computes (minG, maxG) for the iPix[] LSB 8-bit data (AFTER the NTSC conversion if required).
public java.awt.Image getImageForXformInput()
public java.awt.Image getImageForZoomInput()
public java.awt.Image getImageForBCInput()
public java.awt.Image getImageForDisplayInput()
public void printImgDebugState(java.lang.String msg)
msg
- - to print if anypublic final void setOrigInputPixels(int[] origInputPixels, int nBitsPerPixel, boolean blackIsZeroFlag)
origInputPixels
- is the original pixels array datanBitsPerPixel
- is # bits/pixel in the original pixelsblackIsZeroFlag
- is true if original input image
has BLACK as gray value 0, else WHITE is gray value 0public void printProperties(java.lang.String msg, java.awt.Image img, java.awt.Image zoomInputImg)
msg
- - to print if anyimg
- - to print if anyzoomInputImg
- - to print if anypublic java.awt.Point mapStateToZoom(java.awt.Point XYobjToMap)
mappedXYobj
- to use if not null, else create one.
public java.awt.Point mapZoomToState(java.awt.Point zoomedXYobjToMap, int gw, int gh)
mappedXYobj
- to use if not null, else create one.gw
- guard widthgh
- guard height
public java.awt.Point mapZoomToState(java.awt.Point zoomedXYobjToMap)
mappedXYobj
- to use if not null, else create one.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |