public class ImageLookup extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
dataType
data type of the image
|
static int |
HIST_EQ
Constant to pass to the scale method for histogram equalization scaling
|
static int |
LINEAR_SCALE
Constant to pass to the scale method for linear scaling
|
static int |
LOG_SCALE
Constant to pass to the scale method for logarithmic scaling
|
protected static int |
LOOKUP_MAX
maximum image value allowed
|
protected static int |
LOOKUP_MIN
minimum image value allowed
|
protected static int |
LOOKUP_SIZE
size of a lookup table for full short range
|
protected byte[] |
lookupArray
array used by lookup table
|
protected int |
lookupOffset
lookup table offset (subtract from image value before lookup)
|
protected int |
lookupSize
size of the lookup table
|
protected javax.media.jai.LookupTableJAI |
lookupTable
use to convert short data to byte using the selected algorithm
|
protected static int |
MAX_COLOR
maximum color value used in lookup table
|
protected static int |
MIN_COLOR
minimum color value used in lookup table
|
protected static int |
NCOLORS
assume 256 colors in the final image
|
protected int |
scaledHighCut
high cut value scaled to ushort range
|
protected int |
scaledLowCut
low cut value scaled to ushort range
|
static int |
SQRT_SCALE
Constant to pass to the scale method for square root scaling
|
Constructor and Description |
---|
ImageLookup()
default constructor
|
Modifier and Type | Method and Description |
---|---|
protected int |
fillLookupTable(int imageVal,
int imageLim,
int pixVal)
Set the values in the lookup table from imageVal to imageLim to the
given pixel value return the new imageVal index.
|
javax.media.jai.LookupTableJAI |
getLookupTable()
Return the generated lookup table
|
javax.media.jai.PlanarImage |
histEqScale(javax.media.jai.PlanarImage im,
double lowCut,
double highCut,
javax.media.jai.ROI roi,
ImageHistogram imageHistogram)
Install a lookup table to perform a histogram equalization color
scale operation on the image using the given cut levels and ROI and
return the resulting image.
|
javax.media.jai.PlanarImage |
linearScale(javax.media.jai.PlanarImage im,
double lowCut,
double highCut)
Install a lookup table to perform a linear scale operation on
the image using the given cut levels and return the resulting
image.
|
javax.media.jai.PlanarImage |
logScale(javax.media.jai.PlanarImage im,
double lowCut,
double highCut)
Install a lookup table to perform a logarithmic scale operation
on the image using the given cut levels and return the
resulting image.
|
protected javax.media.jai.PlanarImage |
makeLookupTable(javax.media.jai.PlanarImage im,
double lowCut,
double highCut)
Create an empty lookup table for the given image and scale the
image to unsigned short range, if necessary, so that we can use
a lookup table of at most 65536 bytes.
|
javax.media.jai.PlanarImage |
scale(javax.media.jai.PlanarImage im,
int scaleAlgorithm,
double lowCut,
double highCut)
Install a lookup table to perform a color scale operation on the image using the given cut levels
and return the resulting image.
|
javax.media.jai.PlanarImage |
scale(javax.media.jai.PlanarImage im,
int scaleAlgorithm,
double lowCut,
double highCut,
javax.media.jai.ROI roi,
ImageHistogram imageHistogram)
Install a lookup table to perform a color scale operation on the image using the given cut levels
and return the resulting image.
|
protected javax.media.jai.PlanarImage |
scaleToShortRange(javax.media.jai.PlanarImage im,
double lowCut,
double highCut)
Scale the given image to short range, if needed, and return the new image.
|
javax.media.jai.PlanarImage |
sqrtScale(javax.media.jai.PlanarImage im,
double lowCut,
double highCut)
Install a lookup table to perform a sqare root scale operation
on the image using the given cut levels and return the
resulting image.
|
protected static final int NCOLORS
protected static final int MIN_COLOR
protected static final int MAX_COLOR
protected static final int LOOKUP_SIZE
protected static final int LOOKUP_MIN
protected static final int LOOKUP_MAX
public static final int LINEAR_SCALE
public static final int SQRT_SCALE
public static final int LOG_SCALE
public static final int HIST_EQ
protected javax.media.jai.LookupTableJAI lookupTable
protected byte[] lookupArray
protected int lookupSize
protected int lookupOffset
protected int dataType
protected int scaledLowCut
protected int scaledHighCut
public javax.media.jai.LookupTableJAI getLookupTable()
protected javax.media.jai.PlanarImage scaleToShortRange(javax.media.jai.PlanarImage im, double lowCut, double highCut)
protected javax.media.jai.PlanarImage makeLookupTable(javax.media.jai.PlanarImage im, double lowCut, double highCut)
protected int fillLookupTable(int imageVal, int imageLim, int pixVal)
public javax.media.jai.PlanarImage scale(javax.media.jai.PlanarImage im, int scaleAlgorithm, double lowCut, double highCut)
im
- the input image (for FITS, after applying BZERO and BSCALE, if needed)scaleAlgorithm
- on of the constants defined in this class (LINEAR_SCALE, SQRT_SCALE, LOG_SCALE)lowCut
- ignore image pixel values below this valuehighCut
- ignore image pixel values above this valuepublic javax.media.jai.PlanarImage scale(javax.media.jai.PlanarImage im, int scaleAlgorithm, double lowCut, double highCut, javax.media.jai.ROI roi, ImageHistogram imageHistogram)
im
- the input image (for FITS, after applying BZERO and BSCALE, if needed)scaleAlgorithm
- on of the constants defined in this class (LINEAR_SCALE, SQRT_SCALE, LOG_SCALE, HIST_EQ)lowCut
- ignore image pixel values below this valuehighCut
- ignore image pixel values above this valueroi
- if set, this describes the region of interest to use for histogram equalization.imageHistogram
- if set, this is used along with the ROI to generate the image histogrampublic javax.media.jai.PlanarImage linearScale(javax.media.jai.PlanarImage im, double lowCut, double highCut)
public javax.media.jai.PlanarImage sqrtScale(javax.media.jai.PlanarImage im, double lowCut, double highCut)
public javax.media.jai.PlanarImage logScale(javax.media.jai.PlanarImage im, double lowCut, double highCut)
public javax.media.jai.PlanarImage histEqScale(javax.media.jai.PlanarImage im, double lowCut, double highCut, javax.media.jai.ROI roi, ImageHistogram imageHistogram)
im
- the input image (for FITS, after applying BZERO and BSCALE, if needed)lowCut
- ignore image pixel values below this valuehighCut
- ignore image pixel values above this valueroi
- if set, this describes the region of interest to use for histogram equalization.imageHistogram
- if set, this is used along with the ROI to generate the image histogramCopyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.