Package gov.nih.mipav.view
Class ViewJFrameImage
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- gov.nih.mipav.view.ViewJFrameBase
-
- gov.nih.mipav.view.ViewJFrameImage
-
- All Implemented Interfaces:
VOIManagerInterfaceListener
,ViewImageUpdateInterface
,ViewOpenFrameInterface
,java.awt.event.ActionListener
,java.awt.event.ComponentListener
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.event.ChangeListener
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
- Direct Known Subclasses:
ViewJFrameFastMarching2
,ViewJFrameFastMarching3
public class ViewJFrameImage extends ViewJFrameBase implements java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, ViewOpenFrameInterface, VOIManagerInterfaceListener
Makes a frame and put a single image component into it.- Version:
- 1.0 Sept 28, 1998
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
ViewJComponentEditImage
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ViewJFrameImage.DicomQueryListener
(package private) class
ViewJFrameImage.OkColorListener
Pick up the selected color and call method to change the VOI color.-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private ViewJColorChooser
colorChooser
Reference to the color chooser.protected ViewJComponentEditImage
componentImage
Object where DICOM image, ... is converted and displayed as a Java imageprotected ViewControlsImage
controls
Reference to the toolbars located in the controls object.private boolean
doOrients
DOCUMENT ME!private boolean
doOrigins
When loading an image into B slot, should origins and orients be matched?private JDialogDataProvenance
dpDialog
Data provenance dialogprivate JDialogGridOptions
gridOptions
Only want one gridoptions dialog per jframeimage.protected float
heightResFactor
Storage for correction parameters where datasets have non isotropic values.protected float[]
imageBufferA
Buffer used to store image intensities the presently viewed slice of image A.protected float[]
imageBufferB
Buffer used to store image intensities the presently viewed slice of image B.protected JDialogImageInfo
infoDialogA
reference to the JDialogImageInfo for updating slice/resolutions.protected JDialogImageInfo
infoDialogB
DOCUMENT ME!private boolean
isShiftDown
boolean indicating if shift button is down.protected boolean
logMagDisplay
Flag indicating whether or not that the image should be displayed in Log scale.protected javax.swing.JMenuBar
menuBar
Reference to the frame's menu bar.protected ViewMenuBar
menuBarMaker
Constructs the image menu bar.protected ViewMenuBuilder
menuBuilder
This object contains a number of useful functions for building a menu and querying the state of menu items.protected JDialogMultiPaint
multipaintDialog
reference to the JDialogMultiPaint for shortcutsprotected int
nImage
Number of slices in a 3D dataset.protected int
nTImage
Number of time sequences in a 4D dataset.private boolean
paintBrushLocked
used in conjuction with the above variable, stating that the paint brush has been changed but will change back to previous.protected int[]
pixBuffer
Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data.protected int[]
pixBufferB
Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data.private JDialogAAMClassification
prostateAAMClassification
private JDialogAAMplusSVM
prostateML
private int
quickPaintBrushIndex
DOCUMENT ME!protected float[]
resols
Storage of the image voxel resolutions.protected javax.swing.JScrollPane
scrollPane
The scrollPane where the image is displayed.private static long
serialVersionUID
Use serialVersionUID for interoperability.protected int[]
units
Storage of the resolution units of measure.protected javax.swing.ButtonGroup
VOIGroup
protected VOIManagerInterface
voiManager
protected javax.swing.JMenu
voiMenu
protected float
widthResFactor
Storage for correction parameters where datasets have non isotropic values.protected JDialogWinLevel[]
windowLevel
Reference to the two window and level dialogs where [0] is for imageA, [1] for imageB.protected static int
xScreen
Width of the display screen.protected static int
yScreen
Height of the display screen.protected float
zoom
Defaults magnification of image to 1.private JDialogZoom
zoomDialog
Reference to the magnification tool.-
Fields inherited from class gov.nih.mipav.view.ViewJFrameBase
absoluteGoToButton, absoluteGoToPanel, absoluteLabel, absoluteLabelVals, absolutePanel, absoluteXLabel, absoluteXTextField, absoluteYLabel, absoluteYTextField, absoluteZLabel, absoluteZTextField, alphaBlend, defaultLUTa, defaultLUTb, displayMode, IMAGE_A, IMAGE_A_B, IMAGE_B, imageA, imageB, isClosing, linkedScrolling, linkFrame, linkTriFrame, LUTa, LUTb, progressBar, scannerLPS_APLabel, scannerLPS_APTextField, scannerLPS_GoToButton, scannerLPS_GoToPanel, scannerLPS_ISLabel, scannerLPS_ISTextField, scannerLPS_RLLabel, scannerLPS_RLTextField, scannerLPSLabel, scannerLPSLabelVals, scannerLPSPanel, scannerRAS_APLabel, scannerRAS_APTextField, scannerRAS_GoToButton, scannerRAS_GoToPanel, scannerRAS_ISLabel, scannerRAS_ISTextField, scannerRAS_RLLabel, scannerRAS_RLTextField, scannerRASLabel, scannerRASLabelVals, scannerRASPanel, scannerTabbedPane, tabbedPane, talGoToButton, talGoToPanel, talXLabel, talXTextField, talYLabel, talYTextField, talZLabel, talZTextField, userInterface, zoomMode
-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description ViewJFrameImage(ModelImage _imageA)
Makes a frame and puts an image into it.ViewJFrameImage(ModelImage _imageA, ModelImage _imageB)
Makes a frame and puts an image component into it, does not display the frame through ViewJFrameImage's init() method.ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa)
Makes a frame and puts an image into it.ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa, java.awt.Dimension loc)
Makes a frame and puts an image component into it.ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa, java.awt.Dimension loc, boolean logMagDisplay)
Makes a frame and puts an image component into it.ViewJFrameImage(ModelSimpleImage simpleImage, java.lang.String name)
Constructs a ModelSimpleImage VJF
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
aamClassification()
private void
aamGroupRename()
private void
aamGroups()
private void
aamMLClassification()
void
about()
Makes an aboutDialog box and displays information of the image plane presently being displayed.void
actionPerformed(java.awt.event.ActionEvent event)
calls various methods depending on the action.void
addSphereVOIs(VOI annotations)
private void
adjustScrollbars(int x, int y)
DOCUMENT ME!void
changeMenuEnables()
Routine to enable some menu items and disable othter menu items when the dimensionality or type of the image is changed.private boolean
checkForActiveVOIs()
void
close()
Closes window and disposes of frame and component.void
close(boolean closeAll)
Closes window and disposes of frame and component.void
collapseAlltoSinglePaint(boolean showProgressBar)
This method is provided for the user to convert a masked area back to a painted area.void
componentResized(java.awt.event.ComponentEvent event)
Resizes frame and all components.protected void
computeIdealWindowSize()
private void computeIdealWindowSize() This method will enlarge or shrink the window size in response to the componentImage being zoomed.private void
convertVOITBI()
void
create3DVOI(boolean bIntersection)
protected int[]
createBuffers()
Create the buffers for imageA and imageB.void
decSlice()
Decreases the slice to be displayed by one and updates title frame.void
decSliceEyeTracker()
private void
deepCNNConvert()
private void
deepCNNMap()
private void
deepCNNTest()
private void
deepCNNTrain()
private void
deepKneesAtlas()
private void
deepKneesMap()
void
doLinkedScrolling(int offset)
void
enableImageB(boolean enable)
Quick and simple way for ViewJFrameBase to tell the ViewJFrameImage it created to set the menu (right now only for 2Dimensional) for image B.private void
extractCEFeature()
void
finalize()
Cleans memory.private void
generateAtlasImage()
Read the 3D atlas images directory, convert each 3D image to 2D slices based atlas.private void
generateEndingSlices()
ModelImage
getActiveImage()
Returns the reference to the currently active image.protected JDialogImageInfo
getActiveImageInfoDialog()
Returns a reference to the image info dialog for the active image.ModelLUT
getActiveLUT()
ModelRGB
getActiveRGB()
float
getAlphaBlend()
Returns the alphaBlend value for blending between imageA and imageB.WildMagic.LibFoundation.Mathematics.Vector3f
getCenterPt()
ViewJComponentEditImage
getComponentImage()
Returns the reference to the component image.ViewControlsImage
getControls()
Get control widgets (toolbars, sliders) for the image frame.javax.swing.JFrame
getFrame()
int
getFrameHeight()
Return the height that the frame should have.int[]
getFrameLandMarkPoints()
Get the frame four corner landmark points.java.awt.Dimension
getFrameSize()
Return the preferred size for the frame.java.awt.Dimension
getFrameSize(java.awt.Dimension size)
Return the preferred size for the frame.int
getFrameWidth()
Return the width that the frame should have.ModelImage
getImageA()
Returns the reference to imageA.ModelImage
getImageB()
Returns the reference to imageB.protected JDialogImageInfo
getImageInfoDialogB()
Returns the image info dialog for image B.javax.swing.JMenuBar
getJMenuBar()
java.util.Vector<ModelImage>
getRegisteredFramedImages(ModelImage activeImage)
Returns the Vector of Registered Framed Images that are of the same number of dimensions as the active image and same extents for dimesions 3, 4, and 5.java.util.Vector<ModelImage>
getRegisteredFramedImages4D3D(ModelImage activeImage)
If active image is 4D, this returns all 3d images that have same x,y,and z dimensionality as the 4d imageint
getRegisteredFramedImagesSize()
Returns the size of the RegisteredFramedImages Vector.ModelRGB
getRGBTA()
Gets the RGB LUT table for ARGB image A.ModelRGB
getRGBTB()
Gets the RGB LUT table for ARGB image B.javax.swing.JScrollPane
getScrollPane()
DOCUMENT ME!protected int
getScrollPaneHeight()
Get the height of the scroll pane holding the component image.protected java.awt.Dimension
getScrollPaneSize()
Get the size of the scroll pane holding the component image.java.awt.Dimension
getScrollPaneSize(java.awt.Dimension size)
Return the preferred size for the component image scroll pane.protected int
getScrollPaneWidth()
Get the width of the scroll pane holding the component image.int
getViewableSlice()
Get the top-most slice.int
getViewableTimeSlice()
Gets the current Time slice which is being viewed.ViewMenuBar
getViewMenuBar()
VOIManagerInterface
getVOIManager()
boolean
handleMaskToPaint(boolean showProgressBar)
This method is provided for the user to convert a masked area back to a painted area.private void
hedCNNMap()
void
incSlice()
Increases the slice to be displayed by one and updates title frame.void
incSliceEyeTracker()
private void
init(ModelLUT LUTa, java.awt.Dimension loc, boolean logMagDisplay)
Initializes the frame and variables.protected void
initComponentImage(int[] extents)
Creates and initializes the component image for the given image.void
initExtentsVariables(ModelImage img)
Initializes the variables based on the image extents.protected void
initLUT()
Creates and initializes the LUT for the first image (imageA
) if it hasn't been already.void
initResolutions()
Initializes the resolutions and units from the image.protected void
initVOI()
Initialize the 3D VOI interface.void
initZoom()
Initializes the zoom variables for the first image (imageA).private boolean
isMultipleImages()
Helper method to establish if there are other images so that a dialog can be created.private boolean
isMultipleSameSizeImages(boolean isForCalculator)
Helper method to establish if there are images of the same dimensionality so that a dialog can be created.void
keyPressed(java.awt.event.KeyEvent e)
********************************************************************* **************************** Key Events *** **************************void
keyReleased(java.awt.event.KeyEvent e)
DOCUMENT ME!void
keyTyped(java.awt.event.KeyEvent e)
DOCUMENT ME!private void
loadProstateMask()
protected java.lang.String
makeTitle()
Constructs the title of the frame with the image name and the slice location.void
maskToPaint()
void
mouseClicked(java.awt.event.MouseEvent event)
DOCUMENT ME!void
mouseDragged(java.awt.event.MouseEvent e)
DOCUMENT ME!void
mouseEntered(java.awt.event.MouseEvent event)
DOCUMENT ME!void
mouseExited(java.awt.event.MouseEvent event)
DOCUMENT ME!void
mouseMoved(java.awt.event.MouseEvent e)
DOCUMENT ME!void
mousePressed(java.awt.event.MouseEvent event)
DOCUMENT ME!void
mouseReleased(java.awt.event.MouseEvent event)
DOCUMENT ME!ViewJFrameImage
openFrame(ModelImage image)
ViewOpenFrameInterface function to create a new frame from a result image (jdialog produced)void
paintToShortMask()
void
paintToUbyteMask()
void
PointerActive(boolean bActive)
void
printImage()
Method to send an image to the printer.private void
propagatePaintToAllSlices()
DOCUMENT ME!private void
propagatePaintToNextSlice()
DOCUMENT ME!private void
propagatePaintToPreviousSlice()
DOCUMENT ME!WildMagic.LibFoundation.Mathematics.Vector3f
PropDown(int iActive)
WildMagic.LibFoundation.Mathematics.Vector3f
PropUp(int iActive)
private void
prostateSemiAutoBSpline()
private void
prostateSemiAutoBSplineFuzzyC()
private void
reconstructSurfaceFromVOIs()
Reconstruct the prostate surface from the coarse VOIs cloudy points.void
removeComponentListener()
void
removeControls()
Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.void
removeKeyListener()
void
removeMouseListener()
void
removeMouseMotionListener()
void
removeWindowListener()
void
saveImageInfo()
Saves the image info; need to do before saving image.private void
saveMergedVOIs()
This method merges the 3 axial, sagittal, coronal VOIs and save them into one cloudy points file.private void
saveProstateBoundaryFeature()
private void
saveProstateFeatures()
private void
saveProstateFeatures2D()
void
setActiveImage(int active)
Sets the active image for drawing VOIs.void
setActiveImage(ModelImage kImage)
void
setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.boolean
setAndLoad(ModelImage image2load)
DOCUMENT ME!boolean
setAndLoad(ModelImage image2load, boolean doOrigins, boolean doOrients, double defaultValue, double defaultRed, double defaultGreen, double defaultBlue)
DOCUMENT ME!void
setCenter(WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
void
setControls()
Sets the menu and controls (i.e. toolbars) of the main frame!void
setCursor(java.awt.Cursor kCursor)
void
setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.void
setImageB(ModelImage _imageB)
Sets the reference to imageB.void
setLUTa(ModelLUT LUT)
Sets the LUT for image A.void
setLUTb(ModelLUT LUT)
Sets the LUT for image B.void
setModified()
void
setOutputWindowBox(boolean isShown)
Updates the checkbox to show whether or not the output window is currently displayed.void
setPaintBitmapSwitch(boolean paintBitmapSwitch)
When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.void
setPaintMask(java.util.BitSet mask)
void
setRGBTA(ModelRGB RGBT)
Sets the RGB LUT table for ARGB image A.void
setRGBTB(ModelRGB RGBT)
Sets the RGB LUT table for ARGB image B.void
setShiftDown(boolean isShiftDown)
DOCUMENT MEvoid
setSlice(int slice)
Sets the slice to be displayed and updates title frame.void
setSlice(int slice, boolean updateLinkedImages)
DOCUMENT ME!void
setTimeSlice(int slice)
Sets the slice to be displayed and updates title frame.void
setTimeSlice(int slice, boolean checkScroll)
Sets the slice to be displayed and updates title frame.void
setTitle()
Sets the title of the frame with the image name and the slice location.boolean
setZoomB()
Sets the magnification of Image B.void
setZoomDialogNull()
Sets the magnification dialog to null.void
showEditImageInfo()
DOCUMENT ME!void
stateChanged(javax.swing.event.ChangeEvent event)
DOCUMENT ME!private void
surfaceReconstructionTBI()
protected boolean
testParameter(java.lang.String str, double minValue, double maxValue)
Tests that the entered parameter is in range.private void
testProstateBoundaryFeatureTrain()
void
testProstateFeatures()
private void
testProstateFeatures2D()
private void
testProstateFeaturesClassification()
private void
testProstateFeaturesTrain()
void
triPlanarClosing()
DOCUMENT ME!void
updateData()
void
updateFrame(float sX, float sY)
Updates the this frame's size the components sizes.void
updateFrame(float sX, float sY, int x, int y)
public void updateFrame(float xZoom, float yZoom, int x, int y) This method is called when the user is zooming in or out.protected void
updateHistoLUTFrame(int imageAorB)
Deprecated.protected void
updateHistoLUTFrame(int imageAorB, ViewJComponentEditImage compImg)
Deprecated.protected void
updateHistoRGBFrame(int imageAorB)
Deprecated.protected void
updateHistoRGBFrame(int imageAorB, ViewJComponentEditImage compImg)
Deprecated.boolean
updateImageExtents()
This methods calls the componentImage's REPAINT method to redraw the screen.boolean
updateImages()
This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.boolean
updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen.boolean
updateImages(boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.boolean
updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.void
updateMenubar()
This method updates the menubar; ie: after an image has been opened.void
updateWinLevel(int min, int max)
Update the window level sliders from the CT preset dialog.void
windowClosing(java.awt.event.WindowEvent event)
Closes window and disposes of frame and component.-
Methods inherited from class gov.nih.mipav.view.ViewJFrameBase
about, buildLabelPanel, canCloseImageBAfterLoad, closeImageB, componentHidden, componentMoved, componentShown, getDefaultLUTa, getDefaultLUTb, getDisplayMode, getImageNameA, getImageNameB, getLastState, getLUTa, getLUTb, getTriImg, getUserInterface, handleMaskPopupMenu, handlePaintToMaskPopupMenu, handleZoomPopupMenu, initExtents, initImageBuffer, initLUT, initNumSlices, initPixelBuffer, initResFactor, initResolutions, initRGB, initSlicePositions, initUnits, initZoom, loadAllVOIs, loadAllVOIsFrom, loadImage, loadLUT, loadLUTandTransferFunctionFrom, loadLUTandTransferFunctionFrom, makeString, newFrameBeenCreated, openVOI, openVOI, pickImageFile, save, save, save, saveAllVOIs, saveAllVOIsTo, saveLabels, saveLUT, saveLUTandTransferFunction, saveLUTandTransferFunction, saveLUTAs, saveLUTAs, saveVOI, saveVOIAs, saveVOIAs, saveVOIIntensities, saveVOIIntensitiesTo, setAbsPositionLabels, setEnableCloseImageBAfterLoad, setImageA, setLastState, setLinkedFrame, setLinkedTriFrame, setLUTs, setMessageText, setOpacityInfo, setpaintBitmap, setScannerPosition, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
xScreen
protected static final int xScreen
Width of the display screen.
-
yScreen
protected static final int yScreen
Height of the display screen.
-
componentImage
protected ViewJComponentEditImage componentImage
Object where DICOM image, ... is converted and displayed as a Java image
-
controls
protected ViewControlsImage controls
Reference to the toolbars located in the controls object.
-
heightResFactor
protected float heightResFactor
Storage for correction parameters where datasets have non isotropic values.
-
imageBufferA
protected float[] imageBufferA
Buffer used to store image intensities the presently viewed slice of image A.
-
imageBufferB
protected float[] imageBufferB
Buffer used to store image intensities the presently viewed slice of image B.
-
infoDialogA
protected JDialogImageInfo infoDialogA
reference to the JDialogImageInfo for updating slice/resolutions.
-
infoDialogB
protected JDialogImageInfo infoDialogB
DOCUMENT ME!
-
logMagDisplay
protected boolean logMagDisplay
Flag indicating whether or not that the image should be displayed in Log scale. Used primarily for displaying the FFT of an image.
-
menuBar
protected javax.swing.JMenuBar menuBar
Reference to the frame's menu bar.
-
menuBarMaker
protected ViewMenuBar menuBarMaker
Constructs the image menu bar.
-
menuBuilder
protected ViewMenuBuilder menuBuilder
This object contains a number of useful functions for building a menu and querying the state of menu items.
-
nImage
protected int nImage
Number of slices in a 3D dataset.
-
nTImage
protected int nTImage
Number of time sequences in a 4D dataset.
-
pixBuffer
protected int[] pixBuffer
Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data. The ARGB values are generated by using the imageA intensities as a index into a LUT.
-
pixBufferB
protected int[] pixBufferB
Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data. The ARGB values are generated by using the imageB intensities as a index into a LUT.
-
resols
protected float[] resols
Storage of the image voxel resolutions. One resolution value per dimension.
-
scrollPane
protected javax.swing.JScrollPane scrollPane
The scrollPane where the image is displayed.
-
units
protected int[] units
Storage of the resolution units of measure. For example, mm, cm, inches ...
-
widthResFactor
protected float widthResFactor
Storage for correction parameters where datasets have non isotropic values.
-
windowLevel
protected JDialogWinLevel[] windowLevel
Reference to the two window and level dialogs where [0] is for imageA, [1] for imageB.
-
zoom
protected float zoom
Defaults magnification of image to 1.
-
colorChooser
private ViewJColorChooser colorChooser
Reference to the color chooser.
-
doOrients
private final boolean doOrients
DOCUMENT ME!- See Also:
- Constant Field Values
-
doOrigins
private final boolean doOrigins
When loading an image into B slot, should origins and orients be matched?- See Also:
- Constant Field Values
-
gridOptions
private JDialogGridOptions gridOptions
Only want one gridoptions dialog per jframeimage.
-
isShiftDown
private boolean isShiftDown
boolean indicating if shift button is down.
-
paintBrushLocked
private boolean paintBrushLocked
used in conjuction with the above variable, stating that the paint brush has been changed but will change back to previous.
-
quickPaintBrushIndex
private int quickPaintBrushIndex
DOCUMENT ME!
-
zoomDialog
private JDialogZoom zoomDialog
Reference to the magnification tool.
-
dpDialog
private JDialogDataProvenance dpDialog
Data provenance dialog
-
multipaintDialog
protected JDialogMultiPaint multipaintDialog
reference to the JDialogMultiPaint for shortcuts
-
VOIGroup
protected javax.swing.ButtonGroup VOIGroup
-
voiMenu
protected javax.swing.JMenu voiMenu
-
voiManager
protected VOIManagerInterface voiManager
-
prostateAAMClassification
private JDialogAAMClassification prostateAAMClassification
-
prostateML
private JDialogAAMplusSVM prostateML
-
-
Constructor Detail
-
ViewJFrameImage
public ViewJFrameImage(ModelImage _imageA)
Makes a frame and puts an image into it. Image will be centered on screen.- Parameters:
_imageA
- ModelImage - first image to display
-
ViewJFrameImage
public ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa)
Makes a frame and puts an image into it. Image will be centered on screen.- Parameters:
_imageA
- ModelImage - first image to displayLUTa
- LUT of the imageA (if null grayscale LUT is constructed)
-
ViewJFrameImage
public ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa, java.awt.Dimension loc)
Makes a frame and puts an image component into it.- Parameters:
_imageA
- First image to displayLUTa
- LUT of the imageA (if null grayscale LUT is constructed)loc
- location where image should be initially placed
-
ViewJFrameImage
public ViewJFrameImage(ModelImage _imageA, ModelImage _imageB)
Makes a frame and puts an image component into it, does not display the frame through ViewJFrameImage's init() method.- Parameters:
_imageA
- First image to display_imageB
- Second image to display
-
ViewJFrameImage
public ViewJFrameImage(ModelImage _imageA, ModelLUT LUTa, java.awt.Dimension loc, boolean logMagDisplay)
Makes a frame and puts an image component into it.- Parameters:
_imageA
- First image to displayLUTa
- LUT of the imageA (if null grayscale LUT is constructed)loc
- location where image should be initially placedlogMagDisplay
- Display log magnitude of image
-
ViewJFrameImage
public ViewJFrameImage(ModelSimpleImage simpleImage, java.lang.String name)
Constructs a ModelSimpleImage VJF- Parameters:
simpleImage
-name
-
-
-
Method Detail
-
about
public void about()
Makes an aboutDialog box and displays information of the image plane presently being displayed.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
calls various methods depending on the action.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Specified by:
actionPerformed
in classViewJFrameBase
- Parameters:
event
- event that triggered function
-
close
public void close()
Closes window and disposes of frame and component.- Overrides:
close
in classViewJFrameBase
-
close
public void close(boolean closeAll)
Closes window and disposes of frame and component.- Overrides:
close
in classViewJFrameBase
-
removeComponentListener
public void removeComponentListener()
-
removeMouseMotionListener
public void removeMouseMotionListener()
-
removeWindowListener
public void removeWindowListener()
-
removeMouseListener
public void removeMouseListener()
-
removeKeyListener
public void removeKeyListener()
-
collapseAlltoSinglePaint
public void collapseAlltoSinglePaint(boolean showProgressBar)
This method is provided for the user to convert a masked area back to a painted area. It only affects those areas that were masked with the intensity value that is currently active.- Parameters:
showProgressBar
- DOCUMENT ME!
-
componentResized
public void componentResized(java.awt.event.ComponentEvent event)
Resizes frame and all components.- Specified by:
componentResized
in interfacejava.awt.event.ComponentListener
- Overrides:
componentResized
in classViewJFrameBase
- Parameters:
event
- event that triggered function
-
decSlice
public void decSlice()
Decreases the slice to be displayed by one and updates title frame.
-
decSliceEyeTracker
public void decSliceEyeTracker()
-
doLinkedScrolling
public void doLinkedScrolling(int offset)
-
enableImageB
public void enableImageB(boolean enable)
Quick and simple way for ViewJFrameBase to tell the ViewJFrameImage it created to set the menu (right now only for 2Dimensional) for image B.- Parameters:
enable
- whether to enable the imageB related menu items
-
changeMenuEnables
public void changeMenuEnables()
Routine to enable some menu items and disable othter menu items when the dimensionality or type of the image is changed.
-
finalize
public void finalize() throws java.lang.Throwable
Cleans memory.- Overrides:
finalize
in classViewJFrameBase
- Throws:
java.lang.Throwable
- theException
raised by this method
-
getActiveImage
public ModelImage getActiveImage()
Returns the reference to the currently active image.- Specified by:
getActiveImage
in interfaceVOIManagerInterfaceListener
- Returns:
- the active image
-
getAlphaBlend
public float getAlphaBlend()
Returns the alphaBlend value for blending between imageA and imageB.- Overrides:
getAlphaBlend
in classViewJFrameBase
- Returns:
- the alphaBlend value for blending between imageA and imageB
-
getComponentImage
public ViewJComponentEditImage getComponentImage()
Returns the reference to the component image.- Returns:
- component image
-
getControls
public ViewControlsImage getControls()
Get control widgets (toolbars, sliders) for the image frame.- Specified by:
getControls
in classViewJFrameBase
- Returns:
- the controls for this image frame
-
getFrameHeight
public int getFrameHeight()
Return the height that the frame should have.- Returns:
- the frame's height
-
getFrameSize
public java.awt.Dimension getFrameSize()
Return the preferred size for the frame.- Returns:
- the size the frame should be
-
getFrameSize
public java.awt.Dimension getFrameSize(java.awt.Dimension size)
Return the preferred size for the frame.- Parameters:
size
- if non-null, its dimensions are changed to the size the frame should be- Returns:
- the size the frame should be
-
getFrameWidth
public int getFrameWidth()
Return the width that the frame should have.- Returns:
- the frame's width
-
getImageA
public ModelImage getImageA()
Returns the reference to imageA.- Specified by:
getImageA
in classViewJFrameBase
- Returns:
- image
-
getImageB
public ModelImage getImageB()
Returns the reference to imageB.- Specified by:
getImageB
in classViewJFrameBase
- Returns:
- imageB
-
getViewMenuBar
public ViewMenuBar getViewMenuBar()
- Returns:
- menuBarMaker
-
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
- Overrides:
getJMenuBar
in classjavax.swing.JFrame
- Returns:
- menuBar
-
getRegisteredFramedImages
public java.util.Vector<ModelImage> getRegisteredFramedImages(ModelImage activeImage)
Returns the Vector of Registered Framed Images that are of the same number of dimensions as the active image and same extents for dimesions 3, 4, and 5.- Returns:
- Vector
-
getRegisteredFramedImages4D3D
public java.util.Vector<ModelImage> getRegisteredFramedImages4D3D(ModelImage activeImage)
If active image is 4D, this returns all 3d images that have same x,y,and z dimensionality as the 4d image- Returns:
- Vector
-
getRegisteredFramedImagesSize
public int getRegisteredFramedImagesSize()
Returns the size of the RegisteredFramedImages Vector.- Returns:
- size of the Vector
-
getRGBTA
public ModelRGB getRGBTA()
Gets the RGB LUT table for ARGB image A.- Overrides:
getRGBTA
in classViewJFrameBase
- Returns:
- RGBT the new RGB LUT to be applied to the image
-
getRGBTB
public ModelRGB getRGBTB()
Gets the RGB LUT table for ARGB image B.- Overrides:
getRGBTB
in classViewJFrameBase
- Returns:
- RGBT the new RGB LUT to be applied to the image
-
getScrollPane
public javax.swing.JScrollPane getScrollPane()
DOCUMENT ME!- Returns:
- JScrollPane
-
getScrollPaneSize
public java.awt.Dimension getScrollPaneSize(java.awt.Dimension size)
Return the preferred size for the component image scroll pane.- Parameters:
size
- if non-null, its dimensions are changed to the size the scroll pane should be- Returns:
- the size the scroll pane should be
-
getViewableSlice
public int getViewableSlice()
Get the top-most slice.- Returns:
- returns the slice which is currently displayed
-
getViewableTimeSlice
public int getViewableTimeSlice()
Gets the current Time slice which is being viewed.- Returns:
- int the current time slice
-
handleMaskToPaint
public boolean handleMaskToPaint(boolean showProgressBar)
This method is provided for the user to convert a masked area back to a painted area. It only affects those areas that were masked with the intensity value that is currently active.- Parameters:
showProgressBar
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
incSlice
public void incSlice()
Increases the slice to be displayed by one and updates title frame.
-
incSliceEyeTracker
public void incSliceEyeTracker()
-
initExtentsVariables
public void initExtentsVariables(ModelImage img)
Initializes the variables based on the image extents. (i.e. number of slices, number of time slices, the initial z-slice, etc.- Parameters:
img
- the image to set the extent variables for
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
********************************************************************* **************************** Key Events *** **************************.*********************************************************************- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
- Parameters:
e
- DOCUMENT ME!
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
DOCUMENT ME!- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
- Parameters:
e
- DOCUMENT ME!
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
DOCUMENT ME!- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
- Parameters:
e
- DOCUMENT ME!
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent event)
DOCUMENT ME!- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Parameters:
event
- DOCUMENT ME!
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
DOCUMENT ME!- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Parameters:
e
- DOCUMENT ME!
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent event)
DOCUMENT ME!- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Parameters:
event
- DOCUMENT ME!
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent event)
DOCUMENT ME!- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- Parameters:
event
- DOCUMENT ME!
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
DOCUMENT ME!- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
- Parameters:
e
- DOCUMENT ME!
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
DOCUMENT ME!- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Parameters:
event
- DOCUMENT ME!
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
DOCUMENT ME!- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Parameters:
event
- DOCUMENT ME!
-
openFrame
public ViewJFrameImage openFrame(ModelImage image)
ViewOpenFrameInterface function to create a new frame from a result image (jdialog produced)- Specified by:
openFrame
in interfaceViewOpenFrameInterface
-
printImage
public void printImage()
Method to send an image to the printer.
-
removeControls
public void removeControls()
Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls. Since the controls point to this particular image, when we remove the controls, turn off the highlight box.- Specified by:
removeControls
in classViewJFrameBase
- See Also:
ViewJComponentEditImage.useHighlight(boolean)
,Component.repaint()
-
saveImageInfo
public void saveImageInfo()
Saves the image info; need to do before saving image.
-
setActiveImage
public void setActiveImage(int active)
Sets the active image for drawing VOIs. VOIs are only drawn in the active image. In addition, algorithms are executed on the active window.- Specified by:
setActiveImage
in interfaceVOIManagerInterfaceListener
- Specified by:
setActiveImage
in classViewJFrameBase
- Parameters:
active
- IMAGE_A or IMAGE_B
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Specified by:
setAlphaBlend
in classViewJFrameBase
- Parameters:
value
- amount [0,100] that is the percentage of Image A to be displayed
-
setAndLoad
public boolean setAndLoad(ModelImage image2load)
DOCUMENT ME!- Parameters:
image2load
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setAndLoad
public boolean setAndLoad(ModelImage image2load, boolean doOrigins, boolean doOrients, double defaultValue, double defaultRed, double defaultGreen, double defaultBlue)
DOCUMENT ME!- Parameters:
image2load
- DOCUMENT ME!doOrigins
- DOCUMENT ME!doOrients
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
setControls
public void setControls()
Sets the menu and controls (i.e. toolbars) of the main frame! This puts the menus and controls needed to controls the operations of this frame. Different image frames have different menu and controls. Notify this componentImage that it needs to display highlight box, notifying user that this componentImage is the image being controlled- Specified by:
setControls
in classViewJFrameBase
- See Also:
ViewJComponentEditImage.useHighlight(boolean)
,Component.repaint()
-
setEnabled
public void setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.- Specified by:
setEnabled
in classViewJFrameBase
- Parameters:
flag
- if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
-
setImageB
public void setImageB(ModelImage _imageB)
Sets the reference to imageB.- Specified by:
setImageB
in classViewJFrameBase
- Parameters:
_imageB
- image to set the frame to
-
setLUTa
public void setLUTa(ModelLUT LUT)
Sets the LUT for image A.- Overrides:
setLUTa
in classViewJFrameBase
- Parameters:
LUT
- the LUT
-
setLUTb
public void setLUTb(ModelLUT LUT)
Sets the LUT for image B.- Overrides:
setLUTb
in classViewJFrameBase
- Parameters:
LUT
- the LUT
-
setOutputWindowBox
public void setOutputWindowBox(boolean isShown)
Updates the checkbox to show whether or not the output window is currently displayed.- Parameters:
isShown
- boolean is the output window shown
-
setPaintBitmapSwitch
public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.- Specified by:
setPaintBitmapSwitch
in classViewJFrameBase
- Parameters:
paintBitmapSwitch
- if true do not getMask on a setActiveImage command
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
Sets the RGB LUT table for ARGB image A.- Specified by:
setRGBTA
in classViewJFrameBase
- Parameters:
RGBT
- the new RGB LUT to be applied to the image
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
Sets the RGB LUT table for ARGB image B.- Specified by:
setRGBTB
in classViewJFrameBase
- Parameters:
RGBT
- the new RGB LUT to be applied to the image
-
setShiftDown
public void setShiftDown(boolean isShiftDown)
DOCUMENT ME.*- Parameters:
isShiftDown
- DOCUMENT ME!
-
setSlice
public void setSlice(int slice)
Sets the slice to be displayed and updates title frame.- Specified by:
setSlice
in interfaceViewImageUpdateInterface
- Parameters:
slice
- indicates image slice to be displayed
-
setSlice
public void setSlice(int slice, boolean updateLinkedImages)
DOCUMENT ME!- Parameters:
slice
- DOCUMENT ME!updateLinkedImages
- DOCUMENT ME!
-
setTimeSlice
public void setTimeSlice(int slice)
Sets the slice to be displayed and updates title frame.- Specified by:
setTimeSlice
in interfaceViewImageUpdateInterface
- Parameters:
slice
- indicates image time-slice (4th dimension) to be displayed
-
setTimeSlice
public void setTimeSlice(int slice, boolean checkScroll)
Sets the slice to be displayed and updates title frame.- Parameters:
slice
- indicates image time-slice (4th dimension) to be displayedwhether
- linked images should change their linked image sets
-
setTitle
public void setTitle()
Sets the title of the frame with the image name and the slice location.- Specified by:
setTitle
in classViewJFrameBase
-
setZoomB
public boolean setZoomB()
Sets the magnification of Image B. Allocates the image buffers so that it can be displayed properly.- Returns:
- true if setting the zoom on imageB was successful
-
setZoomDialogNull
public void setZoomDialogNull()
Sets the magnification dialog to null.
-
showEditImageInfo
public void showEditImageInfo()
DOCUMENT ME!
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent event)
DOCUMENT ME!- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
- Overrides:
stateChanged
in classViewJFrameBase
- Parameters:
event
- DOCUMENT ME!
-
triPlanarClosing
public void triPlanarClosing()
DOCUMENT ME!
-
updateFrame
public void updateFrame(float sX, float sY)
Updates the this frame's size the components sizes. If the magnified image fits into the frame that will fit into the screen then frame and image are sized appropriately. If the frame, to fit the image, exceeds the screen size the frame remains the same size and the image magnified and placed in the scroll pane.- Parameters:
sX
- zoom in the x dimensionsY
- zoom in the y dimension
-
updateFrame
public void updateFrame(float sX, float sY, int x, int y)
public void updateFrame(float xZoom, float yZoom, int x, int y) This method is called when the user is zooming in or out.- Parameters:
sX
- float zoom in the x dimensionsY
- float zoom in the y dimensionx
- int X-pixel the user wants to zoom aroundy
- int Y-pixel the user wants to zoom around
-
updateImageExtents
public boolean updateImageExtents()
This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.- Specified by:
updateImageExtents
in interfaceViewImageUpdateInterface
- Specified by:
updateImageExtents
in classViewJFrameBase
- Returns:
- whether the image extents update was successful
- See Also:
ViewImageUpdateInterface
-
updateImages
public boolean updateImages()
This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Returns:
- boolean confirming successful update
-
updateImages
public boolean updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Parameters:
forceShow
- forces show to re import image and calc. java image- Returns:
- boolean confirming successful update
-
updateImages
public boolean updateImages(boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Parameters:
forceShow
- forces show to re import image and calc. java imageinterpMode
-- Returns:
- boolean confirming successful update
-
updateImages
public boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Parameters:
LUTa
- LUT used to update imageALUTb
- LUT used to update imageBforceShow
- forces show to re import image and calc. java imageinterpMode
- image interpolation method (Nearest or Smooth)- Returns:
- boolean confirming successful update
-
updateMenubar
public void updateMenubar()
This method updates the menubar; ie: after an image has been opened.
-
updateWinLevel
public void updateWinLevel(int min, int max)
Update the window level sliders from the CT preset dialog.- Parameters:
min
- min value.max
- max value.
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent event)
Closes window and disposes of frame and component.- Specified by:
windowClosing
in interfacejava.awt.event.WindowListener
- Overrides:
windowClosing
in classViewJFrameBase
- Parameters:
event
- Event that triggered function
-
createBuffers
protected int[] createBuffers() throws java.lang.OutOfMemoryError
Create the buffers for imageA and imageB.- Returns:
- the extents of the buffers
- Throws:
java.lang.OutOfMemoryError
- if enough memory cannot be allocated for this method
-
getActiveImageInfoDialog
protected JDialogImageInfo getActiveImageInfoDialog()
Returns a reference to the image info dialog for the active image. Image A and image B have references to their individual dialogs.- Returns:
- a reference to the image info dialog for the active image
-
getImageInfoDialogB
protected JDialogImageInfo getImageInfoDialogB()
Returns the image info dialog for image B.- Returns:
- the image info dialog for image B
-
getScrollPaneHeight
protected int getScrollPaneHeight()
Get the height of the scroll pane holding the component image.- Returns:
- the height of the component image scroll pane
-
getScrollPaneSize
protected java.awt.Dimension getScrollPaneSize()
Get the size of the scroll pane holding the component image.- Returns:
- the size of the component image scroll pane
-
getScrollPaneWidth
protected int getScrollPaneWidth()
Get the width of the scroll pane holding the component image.- Returns:
- the width of the component image scroll pane
-
initLUT
protected void initLUT() throws java.lang.OutOfMemoryError
Creates and initializes the LUT for the first image (imageA
) if it hasn't been already.- Throws:
java.lang.OutOfMemoryError
- if enough memory cannot be allocated for this method
-
initResolutions
public void initResolutions()
Initializes the resolutions and units from the image.
-
initZoom
public void initZoom()
Initializes the zoom variables for the first image (imageA).
-
makeTitle
protected java.lang.String makeTitle()
Constructs the title of the frame with the image name and the slice location.- Returns:
- the image frame title
-
testParameter
protected boolean testParameter(java.lang.String str, double minValue, double maxValue)
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
-
updateHistoLUTFrame
@Deprecated protected void updateHistoLUTFrame(int imageAorB)
Deprecated.Displays histoLUT frame for a gray scale image.- Parameters:
imageAorB
- whether to show the IMAGE_A, IMAGE_B or IMAGE_A_B lut frame
-
updateHistoLUTFrame
@Deprecated protected void updateHistoLUTFrame(int imageAorB, ViewJComponentEditImage compImg)
Deprecated.Displays histoLUT frame for a gray scale image.- Parameters:
imageAorB
- whether to show the IMAGE_A, IMAGE_B or IMAGE_A_B lut framecompImg
- the component image with the image histogram frames to update
-
updateHistoRGBFrame
@Deprecated protected void updateHistoRGBFrame(int imageAorB)
Deprecated.Displays histoRGB frame for an RGB image.- Parameters:
imageAorB
- indicates whether to show IMAGE_A, IMAGE_B or IMAGE_A_B (both).
-
updateHistoRGBFrame
@Deprecated protected void updateHistoRGBFrame(int imageAorB, ViewJComponentEditImage compImg)
Deprecated.Displays histoRGB frame for an RGB image.- Parameters:
imageAorB
- indicates whether to show IMAGE_A, IMAGE_B or IMAGE_A_B (both).compImg
- the component image with the image histogram frames to update
-
adjustScrollbars
private void adjustScrollbars(int x, int y)
DOCUMENT ME!- Parameters:
x
- inty
- int
-
computeIdealWindowSize
protected void computeIdealWindowSize()
private void computeIdealWindowSize() This method will enlarge or shrink the window size in response to the componentImage being zoomed. It will only resize the window to IMAGE_SCREEN_RATIO of the screen size, in this case 3/5. If the image is zoomed past that size, scrollbars are added. If the user has dragged the window to a size larger than 3/5 of screen size, I assume he wants it that way and the window will not be resized in that case upon zoom-in.
-
init
private void init(ModelLUT LUTa, java.awt.Dimension loc, boolean logMagDisplay) throws java.lang.OutOfMemoryError
Initializes the frame and variables.- Parameters:
LUTa
- LUT of the imageA (if null grayscale LUT is constructed)loc
- location where image should be initially placedlogMagDisplay
- a boolean indicating if the log magnitude of image should be displayed.- Throws:
java.lang.OutOfMemoryError
- if enough memory cannot be allocated for the GUI
-
initComponentImage
protected void initComponentImage(int[] extents) throws java.lang.OutOfMemoryError
Creates and initializes the component image for the given image.- Parameters:
extents
- the image dimensionality.- Throws:
java.lang.OutOfMemoryError
- if enough memory cannot be allocated for this method
-
isMultipleImages
private boolean isMultipleImages()
Helper method to establish if there are other images so that a dialog can be created. Used by registration methods, load frame, etc.- Returns:
true
if there are images to operate on.
-
isMultipleSameSizeImages
private boolean isMultipleSameSizeImages(boolean isForCalculator)
Helper method to establish if there are images of the same dimensionality so that a dialog can be created. Used by image calculator, concat, etc.- Parameters:
isForCalculator
- whether this call is being done before using the image calculator- Returns:
true
if there are images to operate on.
-
propagatePaintToAllSlices
private void propagatePaintToAllSlices()
DOCUMENT ME!
-
propagatePaintToNextSlice
private void propagatePaintToNextSlice()
DOCUMENT ME!
-
propagatePaintToPreviousSlice
private void propagatePaintToPreviousSlice()
DOCUMENT ME!
-
checkForActiveVOIs
private boolean checkForActiveVOIs()
-
convertVOITBI
private void convertVOITBI()
-
surfaceReconstructionTBI
private void surfaceReconstructionTBI()
-
saveMergedVOIs
private void saveMergedVOIs()
This method merges the 3 axial, sagittal, coronal VOIs and save them into one cloudy points file. This function is used by the prostate surface reconstruction analysis.
-
reconstructSurfaceFromVOIs
private void reconstructSurfaceFromVOIs()
Reconstruct the prostate surface from the coarse VOIs cloudy points.
-
saveProstateFeatures
private void saveProstateFeatures()
-
saveProstateFeatures2D
private void saveProstateFeatures2D()
-
saveProstateBoundaryFeature
private void saveProstateBoundaryFeature()
-
testProstateFeatures2D
private void testProstateFeatures2D()
-
testProstateFeatures
public void testProstateFeatures()
-
testProstateFeaturesClassification
private void testProstateFeaturesClassification()
-
testProstateFeaturesTrain
private void testProstateFeaturesTrain()
-
testProstateBoundaryFeatureTrain
private void testProstateBoundaryFeatureTrain()
-
generateAtlasImage
private void generateAtlasImage()
Read the 3D atlas images directory, convert each 3D image to 2D slices based atlas. And save the final 2D slice and corresponding VOIs to specified atlas directory.
-
generateEndingSlices
private void generateEndingSlices()
-
aamGroups
private void aamGroups()
-
aamGroupRename
private void aamGroupRename()
-
aamClassification
private void aamClassification()
-
deepCNNTrain
private void deepCNNTrain()
-
deepCNNTest
private void deepCNNTest()
-
deepCNNConvert
private void deepCNNConvert()
-
deepKneesAtlas
private void deepKneesAtlas()
-
deepKneesMap
private void deepKneesMap()
-
deepCNNMap
private void deepCNNMap()
-
hedCNNMap
private void hedCNNMap()
-
aamMLClassification
private void aamMLClassification()
-
extractCEFeature
private void extractCEFeature()
-
loadProstateMask
private void loadProstateMask()
-
prostateSemiAutoBSplineFuzzyC
private void prostateSemiAutoBSplineFuzzyC()
-
prostateSemiAutoBSpline
private void prostateSemiAutoBSpline()
-
initVOI
protected void initVOI()
Initialize the 3D VOI interface.
-
getCenterPt
public WildMagic.LibFoundation.Mathematics.Vector3f getCenterPt()
- Specified by:
getCenterPt
in interfaceVOIManagerInterfaceListener
-
getFrame
public javax.swing.JFrame getFrame()
- Specified by:
getFrame
in interfaceVOIManagerInterfaceListener
-
getVOIManager
public VOIManagerInterface getVOIManager()
- Specified by:
getVOIManager
in interfaceVOIManagerInterfaceListener
-
PointerActive
public void PointerActive(boolean bActive)
- Specified by:
PointerActive
in interfaceVOIManagerInterfaceListener
-
PropDown
public WildMagic.LibFoundation.Mathematics.Vector3f PropDown(int iActive)
- Specified by:
PropDown
in interfaceVOIManagerInterfaceListener
-
PropUp
public WildMagic.LibFoundation.Mathematics.Vector3f PropUp(int iActive)
- Specified by:
PropUp
in interfaceVOIManagerInterfaceListener
-
create3DVOI
public void create3DVOI(boolean bIntersection)
- Specified by:
create3DVOI
in interfaceVOIManagerInterfaceListener
-
setActiveImage
public void setActiveImage(ModelImage kImage)
- Specified by:
setActiveImage
in interfaceVOIManagerInterfaceListener
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
- Specified by:
setCenter
in interfaceVOIManagerInterfaceListener
-
setCursor
public void setCursor(java.awt.Cursor kCursor)
- Specified by:
setCursor
in interfaceVOIManagerInterfaceListener
- Overrides:
setCursor
in classjava.awt.Window
-
setModified
public void setModified()
- Specified by:
setModified
in interfaceVOIManagerInterfaceListener
-
updateData
public void updateData()
- Specified by:
updateData
in interfaceVOIManagerInterfaceListener
-
getActiveLUT
public ModelLUT getActiveLUT()
- Specified by:
getActiveLUT
in interfaceVOIManagerInterfaceListener
-
getActiveRGB
public ModelRGB getActiveRGB()
- Specified by:
getActiveRGB
in interfaceVOIManagerInterfaceListener
-
setPaintMask
public void setPaintMask(java.util.BitSet mask)
- Specified by:
setPaintMask
in interfaceVOIManagerInterfaceListener
-
paintToShortMask
public void paintToShortMask()
- Specified by:
paintToShortMask
in interfaceVOIManagerInterfaceListener
-
paintToUbyteMask
public void paintToUbyteMask()
- Specified by:
paintToUbyteMask
in interfaceVOIManagerInterfaceListener
-
maskToPaint
public void maskToPaint()
- Specified by:
maskToPaint
in interfaceVOIManagerInterfaceListener
-
getFrameLandMarkPoints
public int[] getFrameLandMarkPoints()
Get the frame four corner landmark points.- Returns:
- landmark points result[0] = startX; result[1] = startY; result[2] = endX; result[3] = endY;
-
addSphereVOIs
public void addSphereVOIs(VOI annotations)
- Specified by:
addSphereVOIs
in interfaceVOIManagerInterfaceListener
-
-