Package gov.nih.mipav.view.renderer
Class JPanelHistoRGB
java.lang.Object
gov.nih.mipav.view.renderer.JPanelHistoRGB
- All Implemented Interfaces:
HistoLUTParent,ActionListener,ItemListener,MouseListener,MouseMotionListener,EventListener,ChangeListener
public class JPanelHistoRGB
extends Object
implements ItemListener, ActionListener, ChangeListener, MouseMotionListener, MouseListener, HistoLUTParent
Deprecated.
This class produces a frame where the histogram of the image data is displayed using the color mapping. All frames
using the color map are dynamically updated with the new color map. This control panel manipulate the Histogram RGB
LUT table for the color images.
- Version:
- 1.0
- Author:
- Matthew J. McAuliffe, Ph.D. ( Primary ), Ruida Cheng
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classDeprecated.Wrapper in order to hold the control panel layout in the JScrollPane. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JToggleButtonDeprecated.R, G, B channel control buttons.protected floatDeprecated.Indicates the amount of blending when two images are loaded in the image frame.private booleanDeprecated.Update the LUT in real-time:private JCheckBoxDeprecated.Update Blue channel histogram check box A, B.private JCheckBoxDeprecated.Update Blue channel histogram check box A, B.private JToggleButtonDeprecated.R, G, B channel control buttons.protected intDeprecated.Indicates which image is to be acted upon when two images are displayed.private booleanDeprecated.Flag indicating if histogram should be done on all of image or not.private JCheckBoxDeprecated.Update Green channel histogram check box A, B.private JCheckBoxDeprecated.Update Green channel histogram check box A, B.private JToggleButtonDeprecated.R, G, B channel control buttons.private ModelHistogramDeprecated.imageA histogram of the Blue channel.private ModelHistogramDeprecated.imageA histogram of the Green channel.private ModelHistogramDeprecated.imageA histogram of the Red channel.private ModelHistogramDeprecated.imageB histogram, the Blue channel.private ModelHistogramDeprecated.imageB histogram, the Green channel.private ModelHistogramDeprecated.imageB histogram of the Red channel.private ViewJPanelHistoLUTDeprecated.The panel containing the RGB histogram component.private ViewJPanelHistoLUTDeprecated.The panel containing the RGB histogram component.static final intDeprecated.Display mode image A.static final intDeprecated.Display mode image B.private ModelImageDeprecated.Model image A, B.private ModelImageDeprecated.ImageB reference.fprivate JToggleButtonDeprecated.Toggle buttons for transfer, threshold and threshold inverse.private JCheckBoxDeprecated.The histogram log view check box.private JCheckBoxDeprecated.The histogram log view check box.private JPanelDeprecated.The main GUI control panel.private ViewMenuBuilderDeprecated.Not used now.private JPanelDeprecated.Tabbed control panel A, B.private JPanelDeprecated.Tabbed control panel A, B.private JCheckBoxDeprecated.Update Red channel histogram check box A, B.private JCheckBoxDeprecated.Update Red channel histogram check box A, B.private JToggleButtonDeprecated.R, G, B channel control buttons.private ViewJComponentRegistrationDeprecated.Not used now.private int[]Deprecated.RGB extents.private ModelRGBDeprecated.Model RGB table A reference.private ModelRGBDeprecated.Model RGB table B reference.private JScrollPaneDeprecated.Scroll pane.private JPanelHistoRGB.DrawingPanelDeprecated.Scroll panel that holding the all the control components.private JTabbedPaneDeprecated.The Tabbed control panel.private JToggleButtonDeprecated.Toggle buttons for transfer, threshold and threshold inverse.private JToolBarDeprecated.ToolBar that hold the linear, horizontal mode etc.private ViewToolBarBuilderDeprecated.Object which generates the toolbar.private JToggleButtonDeprecated.Toggle buttons for transfer, threshold and threshold inverse. -
Constructor Summary
ConstructorsConstructorDescriptionJPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag) Deprecated.JPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag, boolean bUpdateImage) Deprecated.JPanelHistoRGB(ViewJComponentRegistration _regComponent, ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Deprecated.Calls various methods depending on the action.private voidDeprecated.This method builds a menu which contains the options for opening/saving a LUT or set of transfer functions, closing the LUT, and utilities such as CT presets.private voidbuildPanelA(ModelImage image, boolean entireFlag) Deprecated.Method that displays the histogram and LUT and other controls to manipulate the LUT.private voidbuildPanelB(ModelImage image, boolean entireFlag) Deprecated.Method that displays the histogram and LUT and other controls to manipulate the LUT.private voidcalcHistogram(int imageAorB, boolean entireFlag, boolean progressFlag) Deprecated.Calculates histogram for the image(s).voidDeprecated.Still needs more work Matt.voiddragPoint(MouseEvent mouseEvent) Deprecated.Placeholder.protected voidfinalize()Deprecated.Calls dispose.intDeprecated.Accessor that indicates which image is active:final ViewJComponentHistoRGBDeprecated.Get the histogram component for imageA.final ViewJComponentHistoRGBDeprecated.Get the histogram component for imageB.Deprecated.Accessor that returns the imageA.Deprecated.Accessor that returns the imageB.Deprecated.Get the control panel.booleanDeprecated.Indicates if real-time update of the image should take place.voiditemStateChanged(ItemEvent event) Deprecated.Sets the flags for the checkboxes.voidloadLUTFrom(boolean loadAll, String filename, String dirName, boolean quietMode) Deprecated.This method loads the LUT for the active image.voidmouseClicked(MouseEvent mouseEvent) Deprecated.Unchanged.voidmouseDragged(MouseEvent mouseEvent) Deprecated.Unchanged.voidmouseEntered(MouseEvent mouseEvent) Deprecated.Unchanged.voidmouseExited(MouseEvent mouseEvent) Deprecated.Unchanged.voidmouseMoved(MouseEvent mouseEvent) Deprecated.Unchanged.voidmousePressed(MouseEvent mouseEvent) Deprecated.Unchanged.voidmouseReleased(MouseEvent mouseEvent) Deprecated.Unchanged.voidDeprecated.Removes the tabbed pane for the histogram of image B.voidresizePanel(int panelWidth, int frameHeight) Deprecated.Resizig the control panel with ViewJFrameVolumeView's frame width and height.voidDeprecated.This method saves the LUT for the active image.voidDeprecated.Accessor to disable the all RGB color channels button if one of the lines has moved.voidsetAlphaBlend(int value) Deprecated.Sets the alpha blending of parameter for two image displaying.voidsetBlueOn(boolean bOn, boolean bImageA) Deprecated.voidsetGreenOn(boolean bOn, boolean bImageA) Deprecated.voidsetImageA(ModelImage image) Deprecated.Accessor that sets the imageA.voidsetImageB(ModelImage image) Deprecated.Accessor that sets the imageB.voidDeprecated.Placeholder.voidsetRangeText(float x, float y, int _index) Deprecated.Placeholder.voidsetRedOn(boolean bOn, boolean bImageA) Deprecated.voidDeprecated.The following 2 functions set the RGB tables for images A and B.voidDeprecated.DOCUMENT ME!voidDeprecated.Resets the buttons depending on which tab was selected.protected booleantestParameter(String str, double minValue, double maxValue) Deprecated.Tests that the entered parameter is in range.voidupdate()Deprecated.Redisplay histoLUT.voidDeprecated.Placeholder.voidupdateFrames(boolean flag) Deprecated.Update all of the image frames that display the image this histo lut is for.voidupdateHistoRGB(ModelImage _imageA, ModelImage _imageB, boolean progressFlag) Deprecated.This method is called to update the histogram(s) displayed in each tabbed pane of the frame.voidDeprecated.Placeholder.voidupdateThresholdFields(float lower, float upper) Deprecated.Placeholder.
-
Field Details
-
IMAGE_A
public static final int IMAGE_ADeprecated.Display mode image A.- See Also:
-
IMAGE_B
public static final int IMAGE_BDeprecated.Display mode image B.- See Also:
-
alphaBlend
protected float alphaBlendDeprecated.Indicates the amount of blending when two images are loaded in the image frame. -
displayMode
protected int displayModeDeprecated.Indicates which image is to be acted upon when two images are displayed. -
blueCheckBoxA
Deprecated.Update Blue channel histogram check box A, B. Updating during mouse dragging -
blueCheckBoxB
Deprecated.Update Blue channel histogram check box A, B. Updating during mouse dragging -
entireFlag
private boolean entireFlagDeprecated.Flag indicating if histogram should be done on all of image or not. -
greenCheckBoxA
Deprecated.Update Green channel histogram check box A, B. Updating during mouse dragging -
greenCheckBoxB
Deprecated.Update Green channel histogram check box A, B. Updating during mouse dragging -
histogramABlue
Deprecated.imageA histogram of the Blue channel. -
histogramAGreen
Deprecated.imageA histogram of the Green channel. -
histogramARed
Deprecated.imageA histogram of the Red channel. -
histogramBBlue
Deprecated.imageB histogram, the Blue channel. -
histogramBGreen
Deprecated.imageB histogram, the Green channel. -
histogramBRed
Deprecated.imageB histogram of the Red channel. -
histoPanelA
Deprecated.The panel containing the RGB histogram component. -
histoPanelB
Deprecated.The panel containing the RGB histogram component. -
imageA
Deprecated.Model image A, B. Define inside this class in order to get rid of the JFrame -
imageB
Deprecated.ImageB reference.f -
logCheckBoxA
Deprecated.The histogram log view check box. -
logCheckBoxB
Deprecated.The histogram log view check box. -
mainPanel
Deprecated.The main GUI control panel. -
panelA
Deprecated.Tabbed control panel A, B. -
panelB
Deprecated.Tabbed control panel A, B. -
redCheckBoxA
Deprecated.Update Red channel histogram check box A, B. Updating during mouse dragging -
redCheckBoxB
Deprecated.Update Red channel histogram check box A, B. Updating during mouse dragging -
redRGBButton
Deprecated.R, G, B channel control buttons. -
blueRGBButton
Deprecated.R, G, B channel control buttons. -
greenRGBButton
Deprecated.R, G, B channel control buttons. -
allRGBButton
Deprecated.R, G, B channel control buttons. -
regComponent
Deprecated.Not used now. -
RGBExtents
private int[] RGBExtentsDeprecated.RGB extents. -
RGBTA
Deprecated.Model RGB table A reference. -
RGBTB
Deprecated.Model RGB table B reference. -
scroller
Deprecated.Scroll pane. -
scrollPanel
Deprecated.Scroll panel that holding the all the control components. -
tabbedPane
Deprecated.The Tabbed control panel. -
toolBar
Deprecated.ToolBar that hold the linear, horizontal mode etc. -
toolBarObj
Deprecated.Object which generates the toolbar. -
transferButton
Deprecated.Toggle buttons for transfer, threshold and threshold inverse. -
thresholdButton
Deprecated.Toggle buttons for transfer, threshold and threshold inverse. -
inverseThresholdButton
Deprecated.Toggle buttons for transfer, threshold and threshold inverse. -
bImageUpdate
private boolean bImageUpdateDeprecated.Update the LUT in real-time:
-
-
Constructor Details
-
JPanelHistoRGB
public JPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag) Deprecated.Makes a frame of the histogram.- Parameters:
_imageA- Model of imageA_imageB- Model of imageB_RGBTA- Model RGB_RGBTB- Model RGB_entireFlag- Flag indicating if histogram should be done on all of image.- See Also:
-
JPanelHistoRGB
public JPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag, boolean bUpdateImage) Deprecated.Makes a frame of the histogram.- Parameters:
_imageA- Model of imageA_imageB- Model of imageB_RGBTA- Model RGB_RGBTB- Model RGB_entireFlag- Flag indicating if histogram should be done on all of image.bUpdateImage- update the displayed image continuously when true or on mouse-release when false.- See Also:
-
JPanelHistoRGB
public JPanelHistoRGB(ViewJComponentRegistration _regComponent, ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag) Deprecated.Makes a frame of the histogram.- Parameters:
_regComponent- component to pass parameters to in manual registration_imageA- Model of imageA_imageB- Model of imageB_RGBTA- Model RGB_RGBTB- Model RGB_entireFlag- Flag indicating if histogram should be done on all of image.- See Also:
-
-
Method Details
-
actionPerformed
Deprecated.Calls various methods depending on the action.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- event that triggered function
-
disposeLocal
public void disposeLocal()Deprecated.Still needs more work Matt. -
dragPoint
Deprecated.Placeholder.- Specified by:
dragPointin interfaceHistoLUTParent- Parameters:
mouseEvent- drag event
-
getHistoLUTComponentA
Deprecated.Get the histogram component for imageA.- Returns:
- the imageA histogram component
-
getHistoLUTComponentB
Deprecated.Get the histogram component for imageB.- Returns:
- the imageB histogram component
-
getImageA
Deprecated.Accessor that returns the imageA.- Returns:
- image
-
getImageB
Deprecated.Accessor that returns the imageB.- Returns:
- imageB
-
getMainPanel
Deprecated.Get the control panel.- Returns:
- Container control panel.
-
isImageUpdate
public boolean isImageUpdate()Deprecated.Indicates if real-time update of the image should take place.- Specified by:
isImageUpdatein interfaceHistoLUTParent- Returns:
trueif real time update should take place
-
itemStateChanged
Deprecated.Sets the flags for the checkboxes.- Specified by:
itemStateChangedin interfaceItemListener- Parameters:
event- event that triggered this function
-
loadLUTFrom
Deprecated.This method loads the LUT for the active image. If the image is not a color image then both the functions and the LUT data are loaded. If this is a color image, then only the functions are loaded.- Parameters:
loadAll- loadAll boolean indicating that both lut and transfer functions should be loaded. If false, then only transfer functions are loaded.filename- filename filename to save LUT asdirName- dirName directory to save LUT toquietMode- quietMode if true indicates that warnings should not be displayed.
-
mouseClicked
Deprecated.Unchanged.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
mouseEvent- mouse event handler.
-
mouseDragged
Deprecated.Unchanged.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
mouseEvent- mouse event handler.
-
mouseEntered
Deprecated.Unchanged.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
mouseEvent- mouse event handler.
-
mouseExited
Deprecated.Unchanged.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
mouseEvent- mouse event handler.
-
mouseMoved
Deprecated.Unchanged.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
mouseEvent- mouse event handler.
-
mousePressed
Deprecated.Unchanged.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
mouseEvent- mouse event handler.
-
mouseReleased
Deprecated.Unchanged.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
mouseEvent- mouse event handler.
-
removeHistoRGBb
public void removeHistoRGBb()Deprecated.Removes the tabbed pane for the histogram of image B. -
resizePanel
public void resizePanel(int panelWidth, int frameHeight) Deprecated.Resizig the control panel with ViewJFrameVolumeView's frame width and height.- Parameters:
panelWidth- widthframeHeight- height
-
saveLUTAs
Deprecated.This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.- Parameters:
saveAll- boolean indicating that both lut and transfer functions should be saved. If false, then only transfer functions are saved.If either filename or directory is null, then the user will be prompted for a filename.
filename- filename to save LUT asdirName- directory to save LUT to
-
setAllOff
public void setAllOff()Deprecated.Accessor to disable the all RGB color channels button if one of the lines has moved.- Specified by:
setAllOffin interfaceHistoLUTParent
-
setAlphaBlend
public void setAlphaBlend(int value) Deprecated.Sets the alpha blending of parameter for two image displaying.- Parameters:
value- amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
-
setImageA
Deprecated.Accessor that sets the imageA.- Parameters:
image- image to set frame to
-
setImageB
Deprecated.Accessor that sets the imageB.- Parameters:
image- image to set frame to
-
setLUT
Deprecated.Placeholder.- Specified by:
setLUTin interfaceHistoLUTParent- Parameters:
newLUT- lut
-
setRangeText
public void setRangeText(float x, float y, int _index) Deprecated.Placeholder.- Specified by:
setRangeTextin interfaceHistoLUTParent- Parameters:
x- xy- y_index- index
-
setRGBTA
Deprecated.The following 2 functions set the RGB tables for images A and B.- Parameters:
RGBT- RGB table reference.
-
setRGBTB
Deprecated.DOCUMENT ME!- Parameters:
RGBT- RGB table reference.
-
setRedOn
public void setRedOn(boolean bOn, boolean bImageA) Deprecated. -
setGreenOn
public void setGreenOn(boolean bOn, boolean bImageA) Deprecated. -
setBlueOn
public void setBlueOn(boolean bOn, boolean bImageA) Deprecated. -
stateChanged
Deprecated.Resets the buttons depending on which tab was selected.- Specified by:
stateChangedin interfaceChangeListener- Parameters:
e- Event that triggered this function.
-
update
public void update()Deprecated.Redisplay histoLUT. -
updateComponentLUT
public void updateComponentLUT()Deprecated.Placeholder.- Specified by:
updateComponentLUTin interfaceHistoLUTParent
-
updateFrames
public void updateFrames(boolean flag) Deprecated.Update all of the image frames that display the image this histo lut is for.- Specified by:
updateFramesin interfaceHistoLUTParent- Parameters:
flag- this boolean indicates if the frame that displays the image should re-export the image and apply new LUT- See Also:
-
updateHistoRGB
Deprecated.This method is called to update the histogram(s) displayed in each tabbed pane of the frame.- Parameters:
_imageA- image A_imageB- image BprogressFlag- passed to calculateHistogram algorithm. If false progress bar is not displayed.
-
updateLUTPositionString
Deprecated.Placeholder.- Specified by:
updateLUTPositionStringin interfaceHistoLUTParent- Parameters:
str- string
-
updateThresholdFields
public void updateThresholdFields(float lower, float upper) Deprecated.Placeholder.- Specified by:
updateThresholdFieldsin interfaceHistoLUTParent- Parameters:
lower- lower thresholdupper- upper threshold
-
finalize
Deprecated.Calls dispose. -
testParameter
Deprecated.Tests that the entered parameter is in range.- Parameters:
str- the value entered by the userminValue- the minimum value this variable may be set tomaxValue- the maximum value this variable may be set to- Returns:
- boolean result of test
-
buildMenu
private void buildMenu()Deprecated.This method builds a menu which contains the options for opening/saving a LUT or set of transfer functions, closing the LUT, and utilities such as CT presets. -
buildPanelA
Deprecated.Method that displays the histogram and LUT and other controls to manipulate the LUT. Panel for image A.- Parameters:
image- Model of imageentireFlag- Flag indicating if histogram should be made of entire image.
-
buildPanelB
Deprecated.Method that displays the histogram and LUT and other controls to manipulate the LUT. Panel for image B.- Parameters:
image- Model of imageentireFlag- Flag indicating if histogram should be made of entire image.
-
calcHistogram
private void calcHistogram(int imageAorB, boolean entireFlag, boolean progressFlag) Deprecated.Calculates histogram for the image(s).- Parameters:
imageAorB- flag to indicate if histogram is to be calculated for imageA or imageB.entireFlag- if true calculate histogram for the entire image. if false uses areas defined by VOI regions.progressFlag- passed to calculateHistogram algorithm. If false progress bar is not displayed.
-
getDisplayMode
public int getDisplayMode()Deprecated.Accessor that indicates which image is active:- Returns:
- displayMode = IMAGE_A or IMAGE_B
-