|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nih.mipav.view.renderer.JPanelHistoLUT
public class JPanelHistoLUT
This class produces a frame where the user can specify a specific LUT, the number of colors of the LUT or dynamically edit the LUT. The frame with histogram of the image data is displayed using the color map. All frames using the color map are dynamically updated with the new color map. This control panel is the control LUT of the gray scale images.
Field Summary | |
---|---|
protected int |
displayMode
Indicates which image is to be acted upon when two images are displayed. |
static int |
IMAGE_A
Display mode image A. |
static int |
IMAGE_B
Display mode image B. |
Constructor Summary | |
---|---|
JPanelHistoLUT(ModelImage _imageA,
ModelImage _imageB,
ModelLUT _LUTa,
ModelLUT _LUTb,
boolean _entireFlag)
Makes a frame of the histogram and LUT. |
|
JPanelHistoLUT(ModelImage _imageA,
ModelImage _imageB,
ModelLUT _LUTa,
ModelLUT _LUTb,
boolean _entireFlag,
boolean bUpdateImage)
Makes a frame of the histogram and LUT. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent event)
Calls various methods depending on the action. |
void |
disposeLocal()
Still needs more work Matt. |
void |
dragPoint(MouseEvent mouseEvent)
Placeholder. |
protected void |
finalize()
Calls dispose. |
void |
focusGained(FocusEvent e)
Focus Events: |
void |
focusLost(FocusEvent e)
If focus is lost from either threshold field (lower/upper), update the new value on the LUT. |
int |
getDisplayMode()
Get the LUT panel current display mode. |
ViewJComponentHLUTBase |
getHistoLUTComponentA()
Get the histogram component for imageA. |
ViewJComponentHLUTBase |
getHistoLUTComponentB()
Get the histogram component for imageB. |
ModelImage |
getImageA()
Accessor that returns the imageA. |
ModelImage |
getImageB()
Accessor that returns the imageB. |
ModelLUT |
getLUT()
This method returns the current LUT. |
ModelLUT |
getLUTa()
Get the imageA histo component lut. |
ModelLUT |
getLUTb()
Get the imageB histo component lut. |
ViewJComponentLUT |
getLUTComponentA()
Get the imageA LUT. |
ViewJComponentLUT |
getLUTComponentB()
Get the imageB LUT. |
JPanel |
getMainPanel()
Return the main control panel. |
int |
getSelectedLUT()
Returns which LUT is currently visible. |
TransferFunction |
getTransferLine()
This method is used to obtain the VOIBase Single Transfer Line. |
boolean |
isImageUpdate()
Indicates if real-time update of the image should take place. |
void |
itemStateChanged(ItemEvent event)
Sets the flags for the checkboxes. |
void |
keyPressed(KeyEvent e)
Unchanged. |
void |
keyReleased(KeyEvent e)
Unchanged. |
void |
keyTyped(KeyEvent e)
If the ENTER key is hit while in threshold boxes, update the LUT's threshold (for dual threshold). |
void |
loadLUTFrom(boolean loadAll,
String filename,
String dirName,
boolean quietMode)
This method loads the LUT for the active image. |
void |
loadOnlyLUTFrom(boolean loadAll,
String filename,
String dirName,
boolean quietMode)
This method loads the LUT for the active image. |
protected String |
makeString(float number,
int decPts)
Makes a string of a float with a specific number of decimal points. |
void |
notifyOfUpdate(ModelLUT LUT,
int imageAorB)
Enable button to indicate image has changed and the histogram should be recalculated. |
void |
removeHistoLUTb()
Removes the tabbed pane for the histogram of image B. |
void |
resizePanel(int panelWidth,
int frameHeight)
Resizig the control panel with ViewJFrameVolumeView's frame width and height. |
void |
saveLUTAs(boolean saveAll,
String filename,
String dirName)
This method saves the LUT for the active image. |
void |
saveOnlyLUTAs(boolean saveAll,
String filename,
String dirName)
This method saves the LUT for the active image. |
void |
selectLUTa()
Forces the panel to display the LUTB panel. |
void |
selectLUTb()
Forces the panel to display the LUTB panel. |
void |
setAllOff()
Placeholder. |
void |
setCTMode(int st,
int end)
This method is used to set Computed Tomography (CT) presets for CT images. |
void |
setHistoLUTa(ModelLUT lut)
Change the histogram component LUT. |
void |
setHistoLUTb(ModelLUT lut)
Change the histogram component LUT. |
void |
setImageA(ModelImage image)
Accessor that sets the imageA. |
void |
setImageB(ModelImage image)
Accessor that sets the imageB. |
void |
setLinearLUT()
This method sets the histogram to Linear Transfer Function Mode. |
void |
setLUT(ModelLUT LUT)
Replaces the LUT and builds a new LUT component. |
void |
setLUTa(ModelLUT _LUTa)
Set imageA lookup table. |
void |
setLUTA(ModelLUT LUT)
Replaces the LUT A component. |
void |
setLUTb(ModelLUT _LUTb)
Set imageB lookup table. |
void |
setLUTB(ModelLUT LUT)
Replaces the LUT B component. |
void |
setRangeText(float x,
float y,
int _index)
Set the range value of the text field. |
void |
setSlice(int slice)
Does nothing in this. |
void |
setTimeSlice(int tSlice)
Does nothing in this class. |
void |
stateChanged(ChangeEvent e)
Sets values based on knob along slider. |
protected boolean |
testParameter(String str,
double minValue,
double maxValue)
Tests that the entered parameter is in range. |
void |
updateComponentLUT()
Placeholder. |
void |
updateFrames(boolean flag)
Update all of the image frames that display the image this histo lut is for. |
void |
updateHistoLUT(ModelImage _imageA,
ModelLUT _LUTa,
ModelImage _imageB,
ModelLUT _LUTb,
boolean progressFlag)
This method is called to update the histogram(s) displayed in each tabbed pane of the frame. |
boolean |
updateImageExtents()
This methods calls the componentImage's REPAINT method to redraw the screen. |
boolean |
updateImages()
This methods calls the componentImage's REPAINT method to redraw the screen. |
boolean |
updateImages(boolean flag)
This methods calls the componentImage's update method to redraw the screen. |
boolean |
updateImages(ModelLUT LUTa,
ModelLUT LUTb,
boolean flag,
int interpMode)
This methods calls the componentImage's update method to redraw the screen. |
void |
updateLUTPositionString(String str)
Sets the position string in the LUT text field. |
void |
updateThresholdFields(float lower,
float upper)
Method to update the threshold text fields when the lower or upper threshold changes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IMAGE_A
public static final int IMAGE_B
protected int displayMode
Constructor Detail |
---|
public JPanelHistoLUT(ModelImage _imageA, ModelImage _imageB, ModelLUT _LUTa, ModelLUT _LUTb, boolean _entireFlag)
_imageA
- Model of imageA_imageB
- Model of imageB_LUTa
- Model of LUT for image A_LUTb
- Model of LUT for image B_entireFlag
- Flag indicating if histogram should be done on all of image.public JPanelHistoLUT(ModelImage _imageA, ModelImage _imageB, ModelLUT _LUTa, ModelLUT _LUTb, boolean _entireFlag, boolean bUpdateImage)
_imageA
- Model of imageA_imageB
- Model of imageB_LUTa
- Model of LUT for image A_LUTb
- Model of LUT for image B_entireFlag
- Flag indicating if histogram should be done on all of image.Method Detail |
---|
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- event that triggered functionpublic void disposeLocal()
public void dragPoint(MouseEvent mouseEvent)
dragPoint
in interface HistoLUTParent
mouseEvent
- drag eventpublic void focusGained(FocusEvent e)
focusGained
in interface FocusListener
e
- event handler.public void focusLost(FocusEvent e)
focusLost
in interface FocusListener
e
- FocusEventpublic int getDisplayMode()
public ViewJComponentHLUTBase getHistoLUTComponentA()
public ViewJComponentHLUTBase getHistoLUTComponentB()
public ModelImage getImageA()
public ModelImage getImageB()
public ModelLUT getLUT()
public final ModelLUT getLUTa()
public final ModelLUT getLUTb()
public ViewJComponentLUT getLUTComponentA()
public ViewJComponentLUT getLUTComponentB()
public JPanel getMainPanel()
public int getSelectedLUT()
public TransferFunction getTransferLine()
public boolean isImageUpdate()
isImageUpdate
in interface HistoLUTParent
true
if real time update should take placepublic void itemStateChanged(ItemEvent event)
itemStateChanged
in interface ItemListener
event
- event that triggered this functionpublic void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
e
- key press event handler.public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
e
- kay release event handler.public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
e
- KeyEventpublic void loadLUTFrom(boolean loadAll, String filename, String dirName, boolean quietMode)
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.public void loadOnlyLUTFrom(boolean loadAll, String filename, String dirName, boolean quietMode)
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.public void notifyOfUpdate(ModelLUT LUT, int imageAorB)
LUT
- new Lookup tableimageAorB
- indicates which histogram needs to be recalculatedpublic void removeHistoLUTb()
public void resizePanel(int panelWidth, int frameHeight)
panelWidth
- panel width.frameHeight
- parent frame height.public void saveLUTAs(boolean saveAll, String filename, String dirName)
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 topublic void saveOnlyLUTAs(boolean saveAll, String filename, String dirName)
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 topublic void selectLUTa()
public void selectLUTb()
public void setAllOff()
setAllOff
in interface HistoLUTParent
public void setCTMode(int st, int end)
st
- starting preset of the windowend
- ending preset of the windowJDialogCT
public final void setHistoLUTa(ModelLUT lut)
lut
- the new lutpublic final void setHistoLUTb(ModelLUT lut)
lut
- the new lutpublic void setImageA(ModelImage image)
image
- image to set frame topublic void setImageB(ModelImage image)
image
- image to set frame topublic void setLinearLUT()
public void setLUT(ModelLUT LUT)
setLUT
in interface HistoLUTParent
LUT
- New LUTpublic void setLUTA(ModelLUT LUT)
LUT
- new LUTpublic void setLUTa(ModelLUT _LUTa)
_LUTa
- ModelLUTapublic void setLUTB(ModelLUT LUT)
LUT
- new LUTpublic void setLUTb(ModelLUT _LUTb)
_LUTb
- ModelLUTbpublic void setRangeText(float x, float y, int _index)
setRangeText
in interface HistoLUTParent
x
- the x threshold range valuey
- the y threshold range value_index
- the cursor indexpublic void setSlice(int slice)
setSlice
in interface ViewImageUpdateInterface
slice
- slice value.public void setTimeSlice(int tSlice)
setTimeSlice
in interface ViewImageUpdateInterface
tSlice
- time slice value.public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
e
- event that triggered this functionpublic void updateComponentLUT()
updateComponentLUT
in interface HistoLUTParent
public void updateFrames(boolean flag)
updateFrames
in interface HistoLUTParent
flag
- this boolean indicates if the frame that displays the image should re-export the image and apply
new LUTModelImage.notifyImageDisplayListeners()
public void updateHistoLUT(ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, boolean progressFlag)
_imageA
- image A_LUTa
- lookup table for image A_imageB
- image B_LUTb
- lookup table for image BprogressFlag
- passed to calculateHistogram algorithm. If false progress bar is not displayedpublic boolean updateImageExtents()
updateImageExtents
in interface ViewImageUpdateInterface
public boolean updateImages()
updateImages
in interface ViewImageUpdateInterface
public boolean updateImages(boolean flag)
updateImages
in interface ViewImageUpdateInterface
flag
- forces show to re import image and calc. java image
public boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode)
updateImages
in interface ViewImageUpdateInterface
LUTa
- LUT used to update imageALUTb
- LUT used to update imageBflag
- forces show to re import image and calc. java imageinterpMode
- image interpolation method (Nearest or Smooth)
public void updateLUTPositionString(String str)
updateLUTPositionString
in interface HistoLUTParent
str
- the position stringpublic void updateThresholdFields(float lower, float upper)
updateThresholdFields
in interface HistoLUTParent
lower
- the lower threshold valueupper
- the upper threshold valueprotected void finalize() throws Throwable
finalize
in class Object
Throwable
- dispose memory.protected String makeString(float number, int decPts)
number
- number to be converted to a stringdecPts
- the number of decimal points
protected boolean testParameter(String str, double minValue, double maxValue)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |