Package gov.nih.mipav.model.structures
Class ModelLUT
- java.lang.Object
-
- gov.nih.mipav.model.structures.ModelSerialCloneable
-
- gov.nih.mipav.model.structures.ModelStorageBase
-
- gov.nih.mipav.model.structures.ModelLUT
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ModelLUT extends ModelStorageBase
Model of a Lookup Table (LUT). At present, one can construct 10 different LUTs: GRAY, SPECTRUM, HOTMETAL, COOLHOT, SKIN, STRIPED, RED, GREEN, BLUE, GRAY_BR, and BONE. This class allows the programmer to specify the number of colors for the LUT. The LUT extents should be 4 x 256 or problems may arise with the differing colormaps (This class can be extended to handle arbitrary size LUTs but 256 is almost universal). There are 256 locations with alpha, red, green, and blue values as floats in order to store both RGB or HSI or etc. The LUTs are calculated from the corresponding transfer functions for each of a, r, g, and b.- Version:
- 1.0
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.model.structures.ModelStorageBase
ModelStorageBase.DataType
-
-
Field Summary
Fields Modifier and Type Field Description private TransferFunction
alphaLine
Fucntion that attenuates image values.static int
BlackBody
Customized LUTsstatic int
BLUE
Sets up the transfer function colors to be monochrome-blue.private TransferFunction
blueLine
Function that maps the blue function of the LUT.static int
BONE
Sets up the transfer function to be yellow-ish orange which is supposed to make bones look good.static int
Cardiac
static int
COOLHOT
Sets up the transfer function colors to be cool-hot.static java.lang.String
customLUTsLocation
Opens and returns a buffered reader for a given custom LUT name.static int
Flow
static int
GEcolor
static int
GRAY
Sets up the transfer function colors to be gray.static int
GRAY_BR
Sets up the transfer function colors to be gray, with blue in the first location, red in the last location.static int
GrayRainbow
static int
GREEN
Sets up the transfer function colors to be monochrome-green.private TransferFunction
greenLine
Function that maps the green function of the LUT.static int
HotGreen
static int
HotIron
static int
HotMetal
static int
HOTMETAL
Sets up the transfer function colors to be hotmetal.static int
Hue1
static int
Hue2
private int[]
indexedLUT
Special int array where the LUT is packed with alpha in the most significant byte of the int, followed red, green, and blue.static int
ired
private int
nColors
Number of colors in the LUT.static int
NIH
static int
Rainbow
static int
Rainbow2
static int
Rainbow3
static int
Ratio
static int
RED
Sets up the transfer function colors to be monochrome-red.private TransferFunction
redLine
Function that maps the red function of the LUT.private int[]
remappedLUT
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.static int
SKIN
Sets up the transfer function colors to be skin-colors.static int
Spectrum
static int
SPECTRUM
Sets up the transfer function colors to be colours of .static int
Stern
static int
STRIPED
Sets up the transfer function colors to be striped.private TransferFunction
transferLine
Function that maps image values into the LUT.private int
type
DOCUMENT ME!static int
UCLA
static int
VR_Bones
static int
VR_Muscles_Bones
static int
VR_Red_Vessels
private float[]
x
The X coordinates of the transfer functions.-
Fields inherited from class gov.nih.mipav.model.structures.ModelStorageBase
ARGB, ARGB_FLOAT, ARGB_FLOAT_STRING, ARGB_STRING, ARGB_UINTEGER, ARGB_UINTEGER_STRING, ARGB_USHORT, ARGB_USHORT_STRING, BOOLEAN, BOOLEAN_STRING, bufferTypeStr, BYTE, BYTE_STRING, COMPLEX, COMPLEX_STRING, DCOMPLEX, DCOMPLEX_STRING, DOUBLE, DOUBLE_STRING, fileInfo, FLOAT, FLOAT_STRING, INTEGER, INTEGER_STRING, lastMax, lastMin, LINEAR, logMagDisp, LONG, LONG_STRING, NEAREST, RW_LOCKED, SHORT, SHORT_STRING, TAYLOR, UBYTE, UBYTE_STRING, UINTEGER, UINTEGER_STRING, UNLOCKED, USHORT, USHORT_STRING, W_LOCKED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ModelLUT
buildTDistLUT(int dof, double sig, ModelImage image)
Build LUT consisting of a student t-distribution at the specified level os significance for the given degrees of freedom.private void
calcBand(TransferFunction function, float[] band)
Calculates the color band (i.e. red, green, blue) for the LUT using the the corresponding transfer functionint[]
exportIndexedLUT()
This is a method to export a special int array where the alpha is stored in the most significant byte, then red, green and blue.int
exportIndexedLUT(int[] arrayLUT)
This is a method to export a special int array where the alpha is stored in the most significant byte, then red, green and blue.static void
exportIndexedLUTMin(ModelLUT kLut, byte[] remappedLUTMin)
static void
exportIndexedLUTMin(ModelLUT kLut, byte[] remappedLUTMin, int index)
static void
exportIndexedLUTMin(ModelRGB kRGBT, byte[] remappedLUTMin)
float[][]
exportRGB_LUT(boolean applyAlpha)
This is a method to export a 2D float array of the LUT.void
finalize()
Calls disposeLocal of this class to ensure this class nulls the references to global class variables so that memory will be recovered.TransferFunction
getAlphaFunction()
Accessor that returns the alpha transfer function.TransferFunction
getBlueFunction()
Accessor that returns the blue transfer function.java.awt.Color
getColor(int index)
Gets a specific index of the LUT.TransferFunction
getGreenFunction()
Accessor that returns the green transfer function.int[]
getIndexedLUT()
int
getLUTType()
Accessor to get LUT type.TransferFunction
getRedFunction()
Accessor that returns the red transfer function.TransferFunction
getTransferFunction()
Accessor that returns the transfer function.void
invertLUT()
Inverts the LUT using the values stored in the band arrays and not the transfer functions.void
makeBlueTransferFunctions()
Creates the R, G, and B transfer functions to produce a blue scale LUT.void
makeBoneTransferFunctions()
Creates the R, G, and B transfer functions to produce a bone scale LUT.void
makeCoolHotTransferFunctions()
Creates the R, G, and B transfer functions to produce a "Cool hot" scale LUT.void
makeCTThighTransferFunctions()
Makes a LUT specifically for viewing CT thigh imagesvoid
makeCustomizedLUT(java.lang.String name)
makeVR with customized LUTvoid
makeGrayBRTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.void
makeGrayTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.void
makeGreenTransferFunctions()
Creates the R, G, and B transfer functions to produce a green scale LUT.void
makeHotMetalTransferFunctions()
Creates the R, G, and B transfer functions to produce a spectrum scale LUT.void
makeIndexedLUT(int[] opacityArray)
Special LUT to be used to display java image.void
makeLUT(int _nColors)
This method uses the A, R, G, B transfer functions to build the desired LUT.void
makeRedTransferFunctions()
Creates the R, G, and B transfer functions to produce a red scale LUT.void
makeSkinTransferFunctions()
Creates the R, G, and B transfer functions to produce a skin scale LUT.void
makeSpectrumTransferFunctions()
Creates the R, G, and B transfer functions to produce a spectrum scale LUT.void
makeStripedLUT()
makeStripedLUT -void
oneToZeroLUTAdjust()
The purpose of this method is to adjust the zero index of the LUT from (1, 1, 1) to (0, 0, 0) The reason is so image A and image B are not blended throughout by default.static java.io.BufferedReader
openLUTFile(java.lang.String lutName)
void
resetAlphaLine()
Resets the alpha function to be linear.void
resetTransferLine(float min, float max)
Resets the transfer function to be linear.void
resetTransferLine(float min, float imgMin, float max, float imgMax)
Resets the transfer function to be linear.void
setColor(int index, int alpha, int red, int green, int blue)
Sets a specific index of the LUT with the given color and updates the compressed LUT.void
setColor(int index, java.awt.Color LUTcolor)
Sets a specific index of the LUT with the given color.void
setTransferFunction(TransferFunction txFunction)
Sets the LUTs transfer function.java.lang.String
toString()
displays the LUT colours and alpha values in hex.java.lang.String
toString(boolean displayInHex, boolean displayAlphaValues)
Presents the Lookuptable by.void
zeroToOneLUTAdjust()
The purpose of this method is to adjust the zero index of the LUT from (0, 0, 0) to (1, 1, 1) The reason is so image A and image B are blended throughout by default.-
Methods inherited from class gov.nih.mipav.model.structures.ModelStorageBase
addSurfaceMask, allocateData, calcAvgIntenStdDev, calcMinMax, calcMinMax, calcMinMaxMag, calcMinMaxNonZero, clone, computeDataSize, construct, convertToFloat, disposeLocal, export, export, exportComplexData, exportComplexSliceXY, exportData, exportData, exportData, exportData, exportData, exportData, exportData, exportData, exportData, exportData, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDataNoLock, exportDComplexData, exportDiagonal, exportDiagonal, exportDiagonal, exportDMagData, exportMagData, exportMagData, exportRGBData, exportRGBData, exportRGBData, exportRGBData, exportRGBData, exportRGBDataNoLock, exportRGBDataNoLock, exportSliceXY, exportSliceXY, exportSliceXY, exportSliceXY, exportSliceXY, exportSliceXY, findMax, get, get, get, get, get, getAvgInten, getAvgIntenB, getAvgIntenG, getAvgIntenR, getAxisOrientation, getBiLinear, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getBufferTypeStr, getByte, getByte, getByte, getByte, getByte, getByteBiLinear, getByteTriLinear, getC, getConvolve, getDataSize, getDataType, getDouble, getDouble, getDouble, getDouble, getDouble, getDoubleBiLinear, getDoubleTriLinear, getExtents, getExtents, getExtents, getExtentsSize, getFileInfo, getFileInfo, getFilterType, getFloat, getFloat, getFloat, getFloat, getFloat, getFloatBiLinear, getFloatC, getFloatC, getFloatC, getFloatTriLinear, getFloatTriLinearBounds, getFloatTriLinearBounds, getFloatTriLinearBoundsTime, getFreq1, getFreq2, getFreqU, getFreqV, getHaveWindowed, getHeight, getImage25D, getImageOrientation, getInt, getInt, getInt, getInt, getInt, getIntBiLinear, getIntTriLinear, getLockStatus, getLogMagDisplay, getLong, getLong, getLong, getLong, getLong, getLongBiLinear, getLongTriLinear, getMax, getMaxA, getMaxB, getMaxG, getMaxR, getMin, getMinA, getMinB, getMinG, getMinR, getNDims, getNoLogMax, getNoLogMin, getNoLogMinNonZero, getNonZeroMax, getNonZeroMaxB, getNonZeroMaxG, getNonZeroMaxR, getNonZeroMin, getNonZeroMinB, getNonZeroMinG, getNonZeroMinR, getNumPixels, getOrigin, getOrigin, getOriginalCropCheckbox, getOriginalDoCrop, getOriginalEnd, getOriginalEpsilon, getOriginalExtents, getOriginalFilterConstruction, getOriginalFilterOrder, getOriginalKernelDimension, getOriginalRs, getOriginalStart, getRadiologicalView, getResolutions, getResolutions, getResolutions, getShort, getShort, getShort, getShort, getShort, getShortBiLinear, getShortTriLinear, getSigmaU, getSigmaV, getSize, getSliceSize, getSmallestMagnitudeNegative, getSmallestMagnitudeNegativeB, getSmallestMagnitudeNegativeG, getSmallestMagnitudeNegativeR, getSmallestMagnitudePositive, getSmallestMagnitudePositiveB, getSmallestMagnitudePositiveG, getSmallestMagnitudePositiveR, getStdDeviation, getStdDeviationB, getStdDeviationG, getStdDeviationR, getSumPixelInten, getSumPixelIntenB, getSumPixelIntenG, getSumPixelIntenR, getSurfaceMask, getSurfaceMaskColor, getTheta, getTriLinear, getType, getTypeMax, getTypeMin, getTypeString, getUByte, getUByte, getUByte, getUByte, getUByte, getUByteBiLinear, getUByteTriLinear, getUInt, getUInt, getUInt, getUInt, getUInt, getUIntBiLinear, getUIntTriLinear, getUnequalDim, getUnitsOfMeasure, getUnitsOfMeasure, getUnitsOfMeasure, getUShort, getUShort, getUShort, getUShort, getUShort, getUShortBiLinear, getUShortTriLinear, getVolumeIterationFactors, getVolumeSize, getWidth, importComplexData, importData, importData, importData, importData, importData, importData, importData, importData, importData, importData, importDComplexData, importRGBData, importRGBData, importRGBData, importUData, importUData, importUData, reallocate, reallocate, reallocate, recomputeDataSize, releaseLock, removeSurfaceMask, removeSurfaceMasks, restoreSurfaceMasks, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setAll, setAll, setAll, setAll, setAll, setAllUByte, setAllUShort, setC, setC, setC, setC, setC, setComplex, setConvolve, setExtents, setFileInfo, setFileInfo, setFilterType, setFreq1, setFreq2, setFreqU, setFreqV, setHaveWindowed, setImage25D, setLock, setLock, setLogMagDisplay, setMax, setMaxB, setMaxG, setMaxR, setMin, setMinB, setMinG, setMinR, setOriginalCropCheckbox, setOriginalDoCrop, setOriginalEnd, setOriginalEpsilon, setOriginalExtents, setOriginalFilterConstruction, setOriginalFilterOrder, setOriginalKernelDimension, setOriginalRs, setOriginalStart, setRadiologicalView, setResolutions, setResolutions, setShort, setShort, setSigmaU, setSigmaV, setTheta, setType, setType, setUByte, setUByte, setUByte, setUByte, setUByte, setUInt, setUInt, setUInt, setUInt, setUInt, setUnequalDim, setUShort, setUShort, setUShort, setUShort, setUShort
-
Methods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
nativeClone
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
GRAY
public static final int GRAY
Sets up the transfer function colors to be gray.- See Also:
- Constant Field Values
-
SPECTRUM
public static final int SPECTRUM
Sets up the transfer function colors to be colours of .- See Also:
- Constant Field Values
-
HOTMETAL
public static final int HOTMETAL
Sets up the transfer function colors to be hotmetal.- See Also:
- Constant Field Values
-
COOLHOT
public static final int COOLHOT
Sets up the transfer function colors to be cool-hot.- See Also:
- Constant Field Values
-
SKIN
public static final int SKIN
Sets up the transfer function colors to be skin-colors.- See Also:
- Constant Field Values
-
STRIPED
public static final int STRIPED
Sets up the transfer function colors to be striped.- See Also:
- Constant Field Values
-
RED
public static final int RED
Sets up the transfer function colors to be monochrome-red.- See Also:
- Constant Field Values
-
GREEN
public static final int GREEN
Sets up the transfer function colors to be monochrome-green.- See Also:
- Constant Field Values
-
BLUE
public static final int BLUE
Sets up the transfer function colors to be monochrome-blue.- See Also:
- Constant Field Values
-
GRAY_BR
public static final int GRAY_BR
Sets up the transfer function colors to be gray, with blue in the first location, red in the last location.- See Also:
- Constant Field Values
-
BONE
public static final int BONE
Sets up the transfer function to be yellow-ish orange which is supposed to make bones look good.- See Also:
- Constant Field Values
-
BlackBody
public static final int BlackBody
Customized LUTs- See Also:
- Constant Field Values
-
Cardiac
public static final int Cardiac
- See Also:
- Constant Field Values
-
Flow
public static final int Flow
- See Also:
- Constant Field Values
-
GEcolor
public static final int GEcolor
- See Also:
- Constant Field Values
-
GrayRainbow
public static final int GrayRainbow
- See Also:
- Constant Field Values
-
HotGreen
public static final int HotGreen
- See Also:
- Constant Field Values
-
HotIron
public static final int HotIron
- See Also:
- Constant Field Values
-
HotMetal
public static final int HotMetal
- See Also:
- Constant Field Values
-
Hue1
public static final int Hue1
- See Also:
- Constant Field Values
-
Hue2
public static final int Hue2
- See Also:
- Constant Field Values
-
ired
public static final int ired
- See Also:
- Constant Field Values
-
NIH
public static final int NIH
- See Also:
- Constant Field Values
-
Rainbow
public static final int Rainbow
- See Also:
- Constant Field Values
-
Rainbow2
public static final int Rainbow2
- See Also:
- Constant Field Values
-
Rainbow3
public static final int Rainbow3
- See Also:
- Constant Field Values
-
Ratio
public static final int Ratio
- See Also:
- Constant Field Values
-
Spectrum
public static final int Spectrum
- See Also:
- Constant Field Values
-
Stern
public static final int Stern
- See Also:
- Constant Field Values
-
UCLA
public static final int UCLA
- See Also:
- Constant Field Values
-
VR_Bones
public static final int VR_Bones
- See Also:
- Constant Field Values
-
VR_Muscles_Bones
public static final int VR_Muscles_Bones
- See Also:
- Constant Field Values
-
VR_Red_Vessels
public static final int VR_Red_Vessels
- See Also:
- Constant Field Values
-
alphaLine
private TransferFunction alphaLine
Fucntion that attenuates image values.
-
blueLine
private TransferFunction blueLine
Function that maps the blue function of the LUT.
-
greenLine
private TransferFunction greenLine
Function that maps the green function of the LUT.
-
indexedLUT
private int[] indexedLUT
Special int array where the LUT is packed with alpha in the most significant byte of the int, followed red, green, and blue.
-
nColors
private int nColors
Number of colors in the LUT.
-
redLine
private TransferFunction redLine
Function that maps the red function of the LUT.
-
remappedLUT
private int[] remappedLUT
DOCUMENT ME!
-
transferLine
private TransferFunction transferLine
Function that maps image values into the LUT. The x coord. ranges [image.min, image.max];
-
type
private int type
DOCUMENT ME!
-
x
private float[] x
The X coordinates of the transfer functions.
-
customLUTsLocation
public static final java.lang.String customLUTsLocation
Opens and returns a buffered reader for a given custom LUT name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModelLUT
public ModelLUT()
Default Constructor.
-
ModelLUT
public ModelLUT(int _type, int _nColors, int[] dimExtents)
Constructor.- Parameters:
_type
- indicates type of lut (ie. GRAY, SPECTRUM ...)_nColors
- number of colors defined in LUTdimExtents
- array indicating LUT extent in each dimension (e.g. 4x256)
-
-
Method Detail
-
finalize
public void finalize()
Description copied from class:ModelStorageBase
Calls disposeLocal of this class to ensure this class nulls the references to global class variables so that memory will be recovered.- Overrides:
finalize
in classModelStorageBase
-
buildTDistLUT
public static ModelLUT buildTDistLUT(int dof, double sig, ModelImage image)
Build LUT consisting of a student t-distribution at the specified level os significance for the given degrees of freedom.- Parameters:
dof
- degrees of freedomsig
- level of significanceimage
-- Returns:
-
exportIndexedLUT
public final int[] exportIndexedLUT()
This is a method to export a special int array where the alpha is stored in the most significant byte, then red, green and blue. Note that the transfer function has been applied to it.- Returns:
- remappedLUT location where indexLUT will be exported to
-
exportIndexedLUTMin
public static void exportIndexedLUTMin(ModelLUT kLut, byte[] remappedLUTMin)
- Parameters:
kLUT
- model lutkTransferLine
- transfer functioniHeight
- lut heightiTable
-
-
exportIndexedLUTMin
public static void exportIndexedLUTMin(ModelLUT kLut, byte[] remappedLUTMin, int index)
-
exportIndexedLUTMin
public static void exportIndexedLUTMin(ModelRGB kRGBT, byte[] remappedLUTMin)
-
exportIndexedLUT
public final int exportIndexedLUT(int[] arrayLUT)
This is a method to export a special int array where the alpha is stored in the most significant byte, then red, green and blue. Without the transfer function applied to the LUT- Parameters:
arrayLUT
- location where indexLUT will be exported.- Returns:
- int 0 indictes error, and 1 indicates successful completion
-
exportRGB_LUT
public final float[][] exportRGB_LUT(boolean applyAlpha)
This is a method to export a 2D float array of the LUT. This method is used by the ViewJComponent show methods to blend between two images.- Parameters:
applyAlpha
- flag indicating if the LUT's alpha values should be applied- Returns:
- float returns the RGB LUT a 2D array
-
getAlphaFunction
public TransferFunction getAlphaFunction()
Accessor that returns the alpha transfer function.- Returns:
- the transfer function that describes how to map the alpha values
-
getBlueFunction
public TransferFunction getBlueFunction()
Accessor that returns the blue transfer function.- Returns:
- the transfer function that describes how to map the blue values
-
getColor
public java.awt.Color getColor(int index)
Gets a specific index of the LUT.- Parameters:
index
- index of the LUT, normally 0-255- Returns:
- LUTcolor color at index
-
getGreenFunction
public TransferFunction getGreenFunction()
Accessor that returns the green transfer function.- Returns:
- the transfer function that describes how to map the green values
-
getLUTType
public int getLUTType()
Accessor to get LUT type.- Returns:
- LUT type
-
getRedFunction
public TransferFunction getRedFunction()
Accessor that returns the red transfer function.- Returns:
- the transfer function that describes how to map the red values
-
getTransferFunction
public TransferFunction getTransferFunction()
Accessor that returns the transfer function.- Returns:
- the transfer function that describes how to remap the image intensities into display values from the LUT.
-
invertLUT
public void invertLUT()
Inverts the LUT using the values stored in the band arrays and not the transfer functions.
-
makeBlueTransferFunctions
public void makeBlueTransferFunctions()
Creates the R, G, and B transfer functions to produce a blue scale LUT.
-
makeBoneTransferFunctions
public void makeBoneTransferFunctions()
Creates the R, G, and B transfer functions to produce a bone scale LUT.
-
makeCoolHotTransferFunctions
public void makeCoolHotTransferFunctions()
Creates the R, G, and B transfer functions to produce a "Cool hot" scale LUT. (blue -> pink -> red -> orange -> yellow -> white)
-
makeCTThighTransferFunctions
public void makeCTThighTransferFunctions()
Makes a LUT specifically for viewing CT thigh images
-
makeGrayBRTransferFunctions
public void makeGrayBRTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.
-
makeGrayTransferFunctions
public void makeGrayTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.
-
makeGreenTransferFunctions
public void makeGreenTransferFunctions()
Creates the R, G, and B transfer functions to produce a green scale LUT.
-
makeHotMetalTransferFunctions
public void makeHotMetalTransferFunctions()
Creates the R, G, and B transfer functions to produce a spectrum scale LUT. (black -> red -> orange -> yellow -> white)
-
makeIndexedLUT
public void makeIndexedLUT(int[] opacityArray)
Special LUT to be used to display java image. Assumes RGB values that range between (0 and 255) are stored in the LUT;- Parameters:
opacityArray
- DOCUMENT ME!
-
makeLUT
public void makeLUT(int _nColors)
This method uses the A, R, G, B transfer functions to build the desired LUT.- Parameters:
_nColors
- indicates the number of colors to used in the LUT.
-
makeRedTransferFunctions
public void makeRedTransferFunctions()
Creates the R, G, and B transfer functions to produce a red scale LUT.
-
makeSkinTransferFunctions
public void makeSkinTransferFunctions()
Creates the R, G, and B transfer functions to produce a skin scale LUT. (blue -> pink -> red -> orange -> yellow -> white)
-
makeSpectrumTransferFunctions
public void makeSpectrumTransferFunctions()
Creates the R, G, and B transfer functions to produce a spectrum scale LUT. (blue -> light blue -> green -> yellow -> orange -> red)
-
makeStripedLUT
public void makeStripedLUT()
makeStripedLUT -
-
makeCustomizedLUT
public void makeCustomizedLUT(java.lang.String name)
makeVR with customized LUT
-
oneToZeroLUTAdjust
public void oneToZeroLUTAdjust()
The purpose of this method is to adjust the zero index of the LUT from (1, 1, 1) to (0, 0, 0) The reason is so image A and image B are not blended throughout by default.
-
resetAlphaLine
public void resetAlphaLine()
Resets the alpha function to be linear.
-
resetTransferLine
public void resetTransferLine(float min, float max)
Resets the transfer function to be linear.- Parameters:
min
- DOCUMENT ME!max
- DOCUMENT ME!
-
resetTransferLine
public void resetTransferLine(float min, float imgMin, float max, float imgMax)
Resets the transfer function to be linear.- Parameters:
min
- float the minimum for the data range of this image typeimgMin
- float the actual minimum data value for the imagemax
- float the maximum for the data range of this image typeimgMax
- float the actual maximum data value for the image
-
setColor
public void setColor(int index, java.awt.Color LUTcolor)
Sets a specific index of the LUT with the given color.- Parameters:
index
- index of the LUT, normally 0-255LUTcolor
- color to be placed at the LUT
-
setColor
public void setColor(int index, int alpha, int red, int green, int blue)
Sets a specific index of the LUT with the given color and updates the compressed LUT.- Parameters:
index
- int index of the LUTalpha
- int 0-255 alphared
- int 0-255 redgreen
- int 0-255 greenblue
- int 0-255 blue
-
setTransferFunction
public void setTransferFunction(TransferFunction txFunction)
Sets the LUTs transfer function.- Parameters:
txFunction
- DOCUMENT ME!
-
toString
public java.lang.String toString()
displays the LUT colours and alpha values in hex.- Overrides:
toString
in classjava.lang.Object
- Returns:
- DOCUMENT ME!
-
toString
public java.lang.String toString(boolean displayInHex, boolean displayAlphaValues)
Presents the Lookuptable by.- Parameters:
displayInHex
- DOCUMENT ME!displayAlphaValues
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
zeroToOneLUTAdjust
public void zeroToOneLUTAdjust()
The purpose of this method is to adjust the zero index of the LUT from (0, 0, 0) to (1, 1, 1) The reason is so image A and image B are blended throughout by default.
-
calcBand
private void calcBand(TransferFunction function, float[] band)
Calculates the color band (i.e. red, green, blue) for the LUT using the the corresponding transfer function- Parameters:
function
- the band's transfer functionband
- storage location after conversion from transfer function to the band
-
getIndexedLUT
public int[] getIndexedLUT()
-
openLUTFile
public static final java.io.BufferedReader openLUTFile(java.lang.String lutName) throws java.io.IOException
- Throws:
java.io.IOException
-
-