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:
Serializable,Cloneable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.model.structures.ModelStorageBase
ModelStorageBase.DataType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TransferFunctionFunction that maps the blue function of the LUT.private booleanFlag indicating whether the blue channel should be displayed.private booleanFlag indicating whether the green channel should be displayed.private TransferFunctionFunction that maps the green function of the LUT.private int[]DOCUMENT ME!private intNumber of colors in the LUT.private TransferFunctionFunction that maps the red function of the LUT.private booleanFlag indicating whether the red channel should be displayed.private static final longUse serialVersionUID for interoperability.private float[]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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcalcRGBBand(TransferFunction function, float[] band) Calculates the color band (i.e. red, green, blue) for the LUT using the the corresponding transfer functionvoidCreates the R, G, and B transfer functions to produce a gray scale LUT.final int[]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.Accessor that returns the blue transfer function.final booleangetBOn()Returns the boolean indicating if the blue channel should be displayed.getColor(int index) Gets a specific index of the RGB table.final booleangetGOn()Returns the boolean indicating if the green channel should be displayed.Accessor that returns the green transfer function.Accessor that returns the red transfer function.final booleangetROn()Returns the boolean indicating if the red channel should be displayed.voidCreates the R, G, and B transfer functions to produce a gray scale LUT.voidCreates the R, G, and B transfer functions to produce a horizontal linear scale LUT.voidSpecial RGB table to be used to display java image.voidmakeRGB(int _nColors) This method uses the R, G, B transfer functions to build the desired RGB tables.voidAccessor that returns the blue transfer function.final voidsetBOn(boolean blueOn) Sets if the blue channel to the boolean value.voidSets a specific index of the RGB table with the given color.final voidsetGOn(boolean greenOn) Sets if the green channel to the boolean value.voidAccessor that returns the green transfer function.voidAccessor that returns the red transfer function.final voidsetROn(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, setUShortMethods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
nativeClone
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
blueLine
Function that maps the blue function of the LUT. -
BOn
private boolean BOnFlag indicating whether the blue channel should be displayed. -
GOn
private boolean GOnFlag indicating whether the green channel should be displayed. -
greenLine
Function that maps the green function of the LUT. -
indexedRGB
private int[] indexedRGBDOCUMENT ME! -
nColors
private int nColorsNumber of colors in the LUT. -
redLine
Function that maps the red function of the LUT. -
ROn
private boolean ROnFlag indicating whether the red channel should be displayed. -
x
private float[] xThe X coordinates of the transfer functions.
-
-
Constructor Details
-
ModelRGB
public ModelRGB()Default constructor. -
ModelRGB
public ModelRGB(int[] dimExtents) constructor.- Parameters:
dimExtents- array indicating RGB table extent in each dimension (e.g. 4x256)
-
-
Method Details
-
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
Accessor that returns the blue transfer function.- Returns:
- the transfer function that describes how to map the blue values
-
setBlueFunction
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
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
Accessor that returns the green transfer function.- Returns:
- the transfer function that describes how to map the green values
-
setGreenFunction
Accessor that returns the green transfer function. -
getRedFunction
Accessor that returns the red transfer function.- Returns:
- the transfer function that describes how to map the red values
-
setRedFunction
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
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
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
-