Package gov.nih.mipav.model.structures
Class ModelRGB
- java.lang.Object
-
- gov.nih.mipav.model.structures.ModelSerialCloneable
-
- gov.nih.mipav.model.structures.ModelStorageBase
-
- gov.nih.mipav.model.structures.ModelRGB
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ModelRGB extends ModelStorageBase
Model of a RGB Table. 256 length red, green, and blue tables are constructed from the red, green, and blue transfer functions. A 256 indexedRGB integer array is returned by exportIndexedRGB with alpha always equal to 255 in the most significant byte, followed by red, green, and blue in the following bytes with the red, green , and blue values able to vary from 0 to 255.- Version:
- 1.0
- Author:
- Matthew J. McAuliffe, Ph.D., William Gandler
- 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
blueLine
Function that maps the blue function of the LUT.private boolean
BOn
Flag indicating whether the blue channel should be displayed.private boolean
GOn
Flag indicating whether the green channel should be displayed.private TransferFunction
greenLine
Function that maps the green function of the LUT.private int[]
indexedRGB
DOCUMENT ME!private int
nColors
Number of colors in the LUT.private TransferFunction
redLine
Function that maps the red function of the LUT.private boolean
ROn
Flag indicating whether the red channel should be displayed.private static long
serialVersionUID
Use serialVersionUID for interoperability.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 Instance Methods Concrete Methods Modifier and Type Method Description private void
calcRGBBand(TransferFunction function, float[] band)
Calculates the color band (i.e. red, green, blue) for the LUT using the the corresponding transfer functionvoid
evenDistributionFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.int[]
exportIndexedRGB()
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.TransferFunction
getBlueFunction()
Accessor that returns the blue transfer function.boolean
getBOn()
Returns the boolean indicating if the blue channel should be displayed.java.awt.Color
getColor(int index)
Gets a specific index of the RGB table.boolean
getGOn()
Returns the boolean indicating if the green channel should be displayed.TransferFunction
getGreenFunction()
Accessor that returns the green transfer function.TransferFunction
getRedFunction()
Accessor that returns the red transfer function.boolean
getROn()
Returns the boolean indicating if the red channel should be displayed.void
makeGrayTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.void
makeHorizonTransferFunctions()
Creates the R, G, and B transfer functions to produce a horizontal linear scale LUT.void
makeIndexedRGB()
Special RGB table to be used to display java image.void
makeRGB(int _nColors)
This method uses the R, G, B transfer functions to build the desired RGB tables.void
setBlueFunction(TransferFunction fn)
Accessor that returns the blue transfer function.void
setBOn(boolean blueOn)
Sets if the blue channel to the boolean value.void
setColor(int index, java.awt.Color RGBcolor)
Sets a specific index of the RGB table with the given color.void
setGOn(boolean greenOn)
Sets if the green channel to the boolean value.void
setGreenFunction(TransferFunction fn)
Accessor that returns the green transfer function.void
setRedFunction(TransferFunction fn)
Accessor that returns the red transfer function.void
setROn(boolean redOn)
Sets if the red channel to the boolean value.-
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, finalize, 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
-
blueLine
private TransferFunction blueLine
Function that maps the blue function of the LUT.
-
BOn
private boolean BOn
Flag indicating whether the blue channel should be displayed.
-
GOn
private boolean GOn
Flag indicating whether the green channel should be displayed.
-
greenLine
private TransferFunction greenLine
Function that maps the green function of the LUT.
-
indexedRGB
private int[] indexedRGB
DOCUMENT ME!
-
nColors
private int nColors
Number of colors in the LUT.
-
redLine
private TransferFunction redLine
Function that maps the red function of the LUT.
-
ROn
private boolean ROn
Flag indicating whether the red channel should be displayed.
-
x
private float[] x
The X coordinates of the transfer functions.
-
-
Method Detail
-
evenDistributionFunctions
public void evenDistributionFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.
-
exportIndexedRGB
public final int[] exportIndexedRGB()
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.- Returns:
- indexedRGB location to which the exporting takes place
-
getBlueFunction
public TransferFunction getBlueFunction()
Accessor that returns the blue transfer function.- Returns:
- the transfer function that describes how to map the blue values
-
setBlueFunction
public void setBlueFunction(TransferFunction fn)
Accessor that returns the blue transfer function.
-
getBOn
public final boolean getBOn()
Returns the boolean indicating if the blue channel should be displayed.- Returns:
- BOn = true then display the blue channel (default = true)
-
getColor
public java.awt.Color getColor(int index)
Gets a specific index of the RGB table.- Parameters:
index
- index of the RGB table, normally 0-255- Returns:
- RGBcolor color at index
-
getGOn
public final boolean getGOn()
Returns the boolean indicating if the green channel should be displayed.- Returns:
- GOn = true then display the green channel (default = true)
-
getGreenFunction
public TransferFunction getGreenFunction()
Accessor that returns the green transfer function.- Returns:
- the transfer function that describes how to map the green values
-
setGreenFunction
public void setGreenFunction(TransferFunction fn)
Accessor that returns the green transfer function.
-
getRedFunction
public TransferFunction getRedFunction()
Accessor that returns the red transfer function.- Returns:
- the transfer function that describes how to map the red values
-
setRedFunction
public void setRedFunction(TransferFunction fn)
Accessor that returns the red transfer function.
-
getROn
public final boolean getROn()
Returns the boolean indicating if the red channel should be displayed.- Returns:
- RaOn = true then display the red channel (default = true)
-
makeGrayTransferFunctions
public void makeGrayTransferFunctions()
Creates the R, G, and B transfer functions to produce a gray scale LUT.
-
makeHorizonTransferFunctions
public void makeHorizonTransferFunctions()
Creates the R, G, and B transfer functions to produce a horizontal linear scale LUT.
-
makeIndexedRGB
public void makeIndexedRGB()
Special RGB table to be used to display java image. Assumes RGB values that range between (0 and 255) are stored in the RGB table;
-
makeRGB
public void makeRGB(int _nColors)
This method uses the R, G, B transfer functions to build the desired RGB tables.- Parameters:
_nColors
- indicates the number of colors to used in the RGB table.
-
setBOn
public final void setBOn(boolean blueOn)
Sets if the blue channel to the boolean value.- Parameters:
blueOn
- if true blue channel should be displayed.
-
setColor
public void setColor(int index, java.awt.Color RGBcolor)
Sets a specific index of the RGB table with the given color.- Parameters:
index
- index of the RGB table, normally 0-255RGBcolor
- color to be placed at the index
-
setGOn
public final void setGOn(boolean greenOn)
Sets if the green channel to the boolean value.- Parameters:
greenOn
- if true green channel should be displayed.
-
setROn
public final void setROn(boolean redOn)
Sets if the red channel to the boolean value.- Parameters:
redOn
- if true red channel should be displayed.
-
calcRGBBand
private void calcRGBBand(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
-
-