Package gov.nih.mipav.view.renderer
Class JDialogVolViewResample
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
gov.nih.mipav.view.dialogs.JDialogBase
gov.nih.mipav.view.renderer.JDialogVolViewResample
- All Implemented Interfaces:
DialogDefaultsInterface,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
Dialog to ask user to resample the images to power of 2 before volume rendering.
- Author:
- Ruida Cheng
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]Original dimensions extents value array.private JTextFieldOriginal X, Y, Z dimension extents values.private JTextFieldPower of 2 X, Y, Z dimension extents values.private JTextFieldOriginal X, Y, Z dimension extents values.private JTextFieldPower of 2 X, Y, Z dimension extents values.private JTextFieldOriginal X, Y, Z dimension extents values.private JTextFieldPower of 2 X, Y, Z dimension extents values.private booleanFlag to force the padding of blank images to the end of images.private booleanBoolean flag to do resample images.private ModelImageModel images A and B.private ModelImageThe non-cloned image which we want to load into the renderer.private ModelImageModel images A and B.private intThe left panel renderer mode.private ModelLUTLookup table of the imageA, B.private ModelLUTLookup table of the imageA, B.private intResample filter type, default: Trilinear Interpoloation.private JComboBoxResample filter selection box.private final StringType of ViewJFrameVolumeView object (using WildMagic or not)private final intNumber of available dimension.private float[]Resample resolutioin corresponding to Power of 2.private JButtonPad button is used for inserting blank images to the end of the image.private JRadioButtonRadio button of the brainsurface flattener render mode in the right panel.private JRadioButtonRadio button of the fly througth mode in the left panel.private JRadioButtonRadio button of the none mode in the right panel.private JRadioButtonRadio button of the raycast render mode in the right panel.private JRadioButtonRadio button of the shearwarp render mode in the right panel.private JRadioButtonRadio button of the surface render mode int the left panel.private JRadioButtonRadio button of the surface render mode in the right panel.private JRadioButtonRadio button of the surface view mode in the left panel.private float[]Original resolutioin arrray.private ModelImageTemp Model image.protected ModelRGBLookup table of the color imageA, B.protected ModelRGBLookup table of the color imageA, B.private intThe right panel renderer mode.private ModelImageAn image with areas designated as special (vessels, etc).private static final longUse serialVersionUID for interoperability.private ViewJFrameVolumeViewReference to ViewJFrameSurfaceRenderer.private StringThe action command to send to the volume renderer after we start it (can be used to open a tab).private int[]Resampled dimension value in Power of 2.private intVolume size X*Y*Z.Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionJDialogVolViewResample(ModelImage _imageA, ModelImage _imageB, String kCommand) Creates the dialog, using the input parameters to place it on the screen. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) On "OK", sets the name variable to the text entered.Builds the Cancel button.private voidBuilds the Pad button for padding the blank images.private JButtonBuilds the OK button.protected TitledBorderbuildTitledBorder(String title, Border _border) Builds a titled border with the given title, an etched border, and the proper font and color.voidDispose memory.voidexec()Do resampling.protected voidfinalize()Clear up memory from gc.voidinit()Build the resample dialog.protected ModelLUTinitLUT(ModelImage img) Creates and initializes the LUT for an image.voiditemStateChanged(ItemEvent event) Sets the flags for the checkboxes.voidsendActionOnStart(String cmd) Sets a command that should be sent to the renderer after it is started.voidSet the image which we can check to see if the probe is hitting anything important (such as vessels, etc).Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods 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, validateTreeMethods 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, remove, 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, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
RGBTA
Lookup table of the color imageA, B. -
RGBTB
Lookup table of the color imageA, B. -
extents
private int[] extentsOriginal dimensions extents value array. -
extXInput
Original X, Y, Z dimension extents values. -
extYInput
Original X, Y, Z dimension extents values. -
extZInput
Original X, Y, Z dimension extents values. -
extXOutput
Power of 2 X, Y, Z dimension extents values. -
extYOutput
Power of 2 X, Y, Z dimension extents values. -
extZOutput
Power of 2 X, Y, Z dimension extents values. -
forcePadding
private boolean forcePaddingFlag to force the padding of blank images to the end of images. -
forceResample
private boolean forceResampleBoolean flag to do resample images. -
imageA
Model images A and B. -
imageB
Model images A and B. -
imageAOriginal
The non-cloned image which we want to load into the renderer. -
leftPanelRenderMode
private int leftPanelRenderModeThe left panel renderer mode. -
LUTa
Lookup table of the imageA, B. -
LUTb
Lookup table of the imageA, B. -
m_iFilter
private int m_iFilterResample filter type, default: Trilinear Interpoloation. -
m_kFilterType
Resample filter selection box. -
nDim
private final int nDimNumber of available dimension. -
newRes
private float[] newResResample resolutioin corresponding to Power of 2. -
padButton
Pad button is used for inserting blank images to the end of the image. This approach creates the power of 2 image. Pad Button is only enabled when the power of 2 value is greater than the slices number. -
radioBrainSurfaceFlattenerR
Radio button of the brainsurface flattener render mode in the right panel. -
radioFlythruL
Radio button of the fly througth mode in the left panel. -
radioSurfaceView
Radio button of the surface view mode in the left panel. -
radioNoneR
Radio button of the none mode in the right panel. -
radioRaycastR
Radio button of the raycast render mode in the right panel. -
radioShearwarpR
Radio button of the shearwarp render mode in the right panel. -
radioSurfaceL
Radio button of the surface render mode int the left panel. -
radioSurfaceR
Radio button of the surface render mode in the right panel. -
res
private float[] resOriginal resolutioin arrray. -
resampledImage
Temp Model image. -
rightPanelRenderMode
private int rightPanelRenderModeThe right panel renderer mode. -
segmentationImage
An image with areas designated as special (vessels, etc). -
sr
Reference to ViewJFrameSurfaceRenderer. -
startupCommand
The action command to send to the volume renderer after we start it (can be used to open a tab). Used by RFAST to open up the RFA simulation immediately. -
volExtents
private int[] volExtentsResampled dimension value in Power of 2. -
volSize
private int volSizeVolume size X*Y*Z. -
m_kVolViewType
Type of ViewJFrameVolumeView object (using WildMagic or not)
-
-
Constructor Details
-
JDialogVolViewResample
Creates the dialog, using the input parameters to place it on the screen.- Parameters:
_imageA- Model image A._imageB- Model image B.
-
-
Method Details
-
actionPerformed
On "OK", sets the name variable to the text entered. On "Cancel" disposes of this dialog and sets cancel flag.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggered this method.
-
buildNotResampleButton
Builds the Cancel button. Sets it internally as well return the just-built button.- Returns:
- Return the noll resample button.
-
disposeLocal
public void disposeLocal()Dispose memory. -
exec
public void exec()Do resampling. -
init
public void init()Build the resample dialog. -
itemStateChanged
Sets the flags for the checkboxes.- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classJDialogBase- Parameters:
event- event that triggered this function
-
sendActionOnStart
Sets a command that should be sent to the renderer after it is started.- Parameters:
cmd- the action command
-
setSegmentationImage
Set the image which we can check to see if the probe is hitting anything important (such as vessels, etc).- Parameters:
img- segmentation image
-
buildTitledBorder
Builds a titled border with the given title, an etched border, and the proper font and color.- Parameters:
title- Title of the border_border- Return the border built- Returns:
- The titled border.
-
finalize
Clear up memory from gc. -
initLUT
Creates and initializes the LUT for an image.- Parameters:
img- the image to create a LUT for- Returns:
- a LUT for the image
img(null if a color image) - Throws:
OutOfMemoryError- if enough memory cannot be allocated for this method
-
buildPadButton
private void buildPadButton()Builds the Pad button for padding the blank images. -
buildResampleButton
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- Return the resample button built.
-