Package gov.nih.mipav.view
Class ColorWheel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Canvas
-
- gov.nih.mipav.view.ColorWheel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class ColorWheel extends java.awt.Canvas- Author:
- pandyan This is the Color Wheel class for the DTI Color Display Plugin References: Developed in concert with Sinisa Pajevic from the NIH/CIT/DCB/MSCL group, Lin-Ching Chang D.Sc., Carlo Pierpaoli MD Ph.D., and Lindsay Walker MS from the the NIH/NICHD/LIMB/STBB group and Olga Vogt from the NIH/CIT/DCB/ISL/BIRSS group: Mathematical and Statistical Computing Laboratory (MSCL) Biomedical Imaging Research Services Section (BIRSS) Imaging Sciences Laboratory (ISL) Division of Cumputational Bioscience (DCB) Center for Informational Technology (CIT) Section on Tissue Biophysics and Biomimetics (STBB) Laboratory of Integrative and Medical Biophysics (LIMB) National Institute of Child Health & Humann Development National Institutes of Health Publication Reference: S. Pajevic and C. Pierpaoli, "Color Schemes to Represent the Orientation of Anisotropic Tissues from Diffusion Tensor Data: Application to White Matter Fiber Tract Mapping in the Human Brain," Magnetic Resonance in Medicine, vol. 42, no. 3, pp. 526-540, 1999
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private float[]blueShiftColorsarray of r,g,b values after blue shiftingprivate floatgammagamma correctionprivate float[]greenAdjColorsarray of r,g,b values after green adjprivate java.awt.GraphicsoffGraphicsoffscreen graphics handleprivate java.awt.ImageoffImageoffscreen imageprivate floatpBblue saturationprivate floatpCcolor rangeprivate floatpGgreen adjprivate floatpSsat vs thetaprivate intr1radii of all the circles...r6 is the outermost radiusprivate intr2radii of all the circles...r6 is the outermost radiusprivate intr3radii of all the circles...r6 is the outermost radiusprivate intr4radii of all the circles...r6 is the outermost radiusprivate intr5radii of all the circles...r6 is the outermost radiusprivate intr6radii of all the circles...r6 is the outermost radiusprivate float[]redShiftColorsarray of r,g,b values after red shiftingprivate floatstevensBetaStevens Betaprivate java.lang.Stringtypetype of color wheel ABSVAL, NOSYMM, ROTATIONALSYMM, MIRRORSYMM
-
Constructor Summary
Constructors Constructor Description ColorWheel(java.lang.String initialType, int radius)constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]adjustGreen(float r1, float g1, float b1)adjust green intensityvoidcalculateRadii()calculates radii of the interior circles using Lambertian equal areas equation used: r = 2 |sin(theta/2)|java.lang.StringgetType()voidpaint(java.awt.Graphics g)paint methodvoidpaintAbsValColorWheel()Paints the Absolute Value Color WheelvoidpaintMirrorSymmColorWheel()Paints the Mirror Symmetry Color WheelvoidpaintNoSymmColorWheel()Paints the No Symmetry Color WheelvoidpaintRotationalSymmColorWheel()Paints the Rotational Symmetry Color WheelvoidsetGamma(float gamma)voidsetPB(float pb)voidsetPC(float pc)voidsetPG(float pg)voidsetPS(float ps)voidsetStevensBeta(float stevensBeta)voidsetType(java.lang.String type)float[]shiftBlue(float r1, float g1, float b1)blue shiftfloat[]shiftRed(float r1, float g1, float b1)red shiftvoidupdate(java.awt.Graphics g)Calls paint without erasing background - this reduces flicker!-
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
-
-
-
Field Detail
-
offImage
private java.awt.Image offImage
offscreen image
-
offGraphics
private java.awt.Graphics offGraphics
offscreen graphics handle
-
r1
private int r1
radii of all the circles...r6 is the outermost radius
-
r2
private int r2
radii of all the circles...r6 is the outermost radius
-
r3
private int r3
radii of all the circles...r6 is the outermost radius
-
r4
private int r4
radii of all the circles...r6 is the outermost radius
-
r5
private int r5
radii of all the circles...r6 is the outermost radius
-
r6
private int r6
radii of all the circles...r6 is the outermost radius
-
type
private java.lang.String type
type of color wheel ABSVAL, NOSYMM, ROTATIONALSYMM, MIRRORSYMM
-
pS
private float pS
sat vs theta
-
pC
private float pC
color range
-
pB
private float pB
blue saturation
-
gamma
private float gamma
gamma correction
-
pG
private float pG
green adj
-
stevensBeta
private float stevensBeta
Stevens Beta
-
blueShiftColors
private float[] blueShiftColors
array of r,g,b values after blue shifting
-
redShiftColors
private float[] redShiftColors
array of r,g,b values after red shifting
-
greenAdjColors
private float[] greenAdjColors
array of r,g,b values after green adj
-
-
Method Detail
-
paint
public void paint(java.awt.Graphics g)
paint method- Overrides:
paintin classjava.awt.Canvas
-
calculateRadii
public void calculateRadii()
calculates radii of the interior circles using Lambertian equal areas equation used: r = 2 |sin(theta/2)|
-
paintAbsValColorWheel
public void paintAbsValColorWheel()
Paints the Absolute Value Color Wheel
-
paintNoSymmColorWheel
public void paintNoSymmColorWheel()
Paints the No Symmetry Color Wheel
-
paintRotationalSymmColorWheel
public void paintRotationalSymmColorWheel()
Paints the Rotational Symmetry Color Wheel
-
paintMirrorSymmColorWheel
public void paintMirrorSymmColorWheel()
Paints the Mirror Symmetry Color Wheel
-
shiftBlue
public float[] shiftBlue(float r1, float g1, float b1)blue shift- Parameters:
r1-g1-b1-- Returns:
-
shiftRed
public float[] shiftRed(float r1, float g1, float b1)red shift- Parameters:
r1-g1-b1-- Returns:
-
adjustGreen
public float[] adjustGreen(float r1, float g1, float b1)adjust green intensity- Parameters:
r1-g1-b1-- Returns:
-
update
public void update(java.awt.Graphics g)
Calls paint without erasing background - this reduces flicker!- Overrides:
updatein classjava.awt.Canvas- Parameters:
g- Graphics handle
-
setGamma
public void setGamma(float gamma)
-
setPB
public void setPB(float pb)
-
setPC
public void setPC(float pc)
-
setPG
public void setPG(float pg)
-
setPS
public void setPS(float ps)
-
setStevensBeta
public void setStevensBeta(float stevensBeta)
-
setType
public void setType(java.lang.String type)
-
getType
public java.lang.String getType()
-
-