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,java.awt.event.ActionListener,java.awt.event.FocusListener,java.awt.event.ItemListener,java.awt.event.WindowListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.RootPaneContainer,javax.swing.WindowConstants
public class JDialogVolViewResample extends JDialogBase
Dialog to ask user to resample the images to power of 2 before volume rendering.- Author:
- Ruida Cheng
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
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 int[]extentsOriginal dimensions extents value array.private javax.swing.JTextFieldextXInputOriginal X, Y, Z dimension extents values.private javax.swing.JTextFieldextXOutputPower of 2 X, Y, Z dimension extents values.private javax.swing.JTextFieldextYInputOriginal X, Y, Z dimension extents values.private javax.swing.JTextFieldextYOutputPower of 2 X, Y, Z dimension extents values.private javax.swing.JTextFieldextZInputOriginal X, Y, Z dimension extents values.private javax.swing.JTextFieldextZOutputPower of 2 X, Y, Z dimension extents values.private booleanforcePaddingFlag to force the padding of blank images to the end of images.private booleanforceResampleBoolean flag to do resample images.private ModelImageimageAModel images A and B.private ModelImageimageAOriginalThe non-cloned image which we want to load into the renderer.private ModelImageimageBModel images A and B.private intleftPanelRenderModeThe left panel renderer mode.private ModelLUTLUTaLookup table of the imageA, B.private ModelLUTLUTbLookup table of the imageA, B.private intm_iFilterResample filter type, default: Trilinear Interpoloation.private javax.swing.JComboBoxm_kFilterTypeResample filter selection box.private java.lang.Stringm_kVolViewTypeType of ViewJFrameVolumeView object (using WildMagic or not)private intnDimNumber of available dimension.private float[]newResResample resolutioin corresponding to Power of 2.private javax.swing.JButtonpadButtonPad button is used for inserting blank images to the end of the image.private javax.swing.JRadioButtonradioBrainSurfaceFlattenerRRadio button of the brainsurface flattener render mode in the right panel.private javax.swing.JRadioButtonradioFlythruLRadio button of the fly througth mode in the left panel.private javax.swing.JRadioButtonradioNoneRRadio button of the none mode in the right panel.private javax.swing.JRadioButtonradioRaycastRRadio button of the raycast render mode in the right panel.private javax.swing.JRadioButtonradioShearwarpRRadio button of the shearwarp render mode in the right panel.private javax.swing.JRadioButtonradioSurfaceLRadio button of the surface render mode int the left panel.private javax.swing.JRadioButtonradioSurfaceRRadio button of the surface render mode in the right panel.private javax.swing.JRadioButtonradioSurfaceViewRadio button of the surface view mode in the left panel.private float[]resOriginal resolutioin arrray.private ModelImageresampledImageTemp Model image.protected ModelRGBRGBTALookup table of the color imageA, B.protected ModelRGBRGBTBLookup table of the color imageA, B.private intrightPanelRenderModeThe right panel renderer mode.private ModelImagesegmentationImageAn image with areas designated as special (vessels, etc).private static longserialVersionUIDUse serialVersionUID for interoperability.private ViewJFrameVolumeViewsrReference to ViewJFrameSurfaceRenderer.private java.lang.StringstartupCommandThe action command to send to the volume renderer after we start it (can be used to open a tab).private int[]volExtentsResampled dimension value in Power of 2.private intvolSizeVolume 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, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogVolViewResample(ModelImage _imageA, ModelImage _imageB, java.lang.String kCommand)Creates the dialog, using the input parameters to place it on the screen.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)On "OK", sets the name variable to the text entered.javax.swing.JButtonbuildNotResampleButton()Builds the Cancel button.private voidbuildPadButton()Builds the Pad button for padding the blank images.private javax.swing.JButtonbuildResampleButton()Builds the OK button.protected javax.swing.border.TitledBorderbuildTitledBorder(java.lang.String title, javax.swing.border.Border _border)Builds a titled border with the given title, an etched border, and the proper font and color.voiddisposeLocal()Dispose 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(java.awt.event.ItemEvent event)Sets the flags for the checkboxes.voidsendActionOnStart(java.lang.String cmd)Sets a command that should be sent to the renderer after it is started.voidsetSegmentationImage(ModelImage img)Set 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, windowOpened
-
Methods 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, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
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, 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, 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, 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 Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
RGBTA
protected ModelRGB RGBTA
Lookup table of the color imageA, B.
-
RGBTB
protected ModelRGB RGBTB
Lookup table of the color imageA, B.
-
extents
private int[] extents
Original dimensions extents value array.
-
extXInput
private javax.swing.JTextField extXInput
Original X, Y, Z dimension extents values.
-
extYInput
private javax.swing.JTextField extYInput
Original X, Y, Z dimension extents values.
-
extZInput
private javax.swing.JTextField extZInput
Original X, Y, Z dimension extents values.
-
extXOutput
private javax.swing.JTextField extXOutput
Power of 2 X, Y, Z dimension extents values.
-
extYOutput
private javax.swing.JTextField extYOutput
Power of 2 X, Y, Z dimension extents values.
-
extZOutput
private javax.swing.JTextField extZOutput
Power of 2 X, Y, Z dimension extents values.
-
forcePadding
private boolean forcePadding
Flag to force the padding of blank images to the end of images.
-
forceResample
private boolean forceResample
Boolean flag to do resample images.
-
imageA
private ModelImage imageA
Model images A and B.
-
imageB
private ModelImage imageB
Model images A and B.
-
imageAOriginal
private ModelImage imageAOriginal
The non-cloned image which we want to load into the renderer.
-
leftPanelRenderMode
private int leftPanelRenderMode
The left panel renderer mode.
-
LUTa
private ModelLUT LUTa
Lookup table of the imageA, B.
-
LUTb
private ModelLUT LUTb
Lookup table of the imageA, B.
-
m_iFilter
private int m_iFilter
Resample filter type, default: Trilinear Interpoloation.
-
m_kFilterType
private javax.swing.JComboBox m_kFilterType
Resample filter selection box.
-
nDim
private final int nDim
Number of available dimension.
-
newRes
private float[] newRes
Resample resolutioin corresponding to Power of 2.
-
padButton
private javax.swing.JButton 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
private javax.swing.JRadioButton radioBrainSurfaceFlattenerR
Radio button of the brainsurface flattener render mode in the right panel.
-
radioFlythruL
private javax.swing.JRadioButton radioFlythruL
Radio button of the fly througth mode in the left panel.
-
radioSurfaceView
private javax.swing.JRadioButton radioSurfaceView
Radio button of the surface view mode in the left panel.
-
radioNoneR
private javax.swing.JRadioButton radioNoneR
Radio button of the none mode in the right panel.
-
radioRaycastR
private javax.swing.JRadioButton radioRaycastR
Radio button of the raycast render mode in the right panel.
-
radioShearwarpR
private javax.swing.JRadioButton radioShearwarpR
Radio button of the shearwarp render mode in the right panel.
-
radioSurfaceL
private javax.swing.JRadioButton radioSurfaceL
Radio button of the surface render mode int the left panel.
-
radioSurfaceR
private javax.swing.JRadioButton radioSurfaceR
Radio button of the surface render mode in the right panel.
-
res
private float[] res
Original resolutioin arrray.
-
resampledImage
private ModelImage resampledImage
Temp Model image.
-
rightPanelRenderMode
private int rightPanelRenderMode
The right panel renderer mode.
-
segmentationImage
private ModelImage segmentationImage
An image with areas designated as special (vessels, etc).
-
sr
private ViewJFrameVolumeView sr
Reference to ViewJFrameSurfaceRenderer.
-
startupCommand
private java.lang.String 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[] volExtents
Resampled dimension value in Power of 2.
-
volSize
private int volSize
Volume size X*Y*Z.
-
m_kVolViewType
private final java.lang.String m_kVolViewType
Type of ViewJFrameVolumeView object (using WildMagic or not)
-
-
Constructor Detail
-
JDialogVolViewResample
public JDialogVolViewResample(ModelImage _imageA, ModelImage _imageB, java.lang.String kCommand)
Creates the dialog, using the input parameters to place it on the screen.- Parameters:
_imageA- Model image A._imageB- Model image B.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
On "OK", sets the name variable to the text entered. On "Cancel" disposes of this dialog and sets cancel flag.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggered this method.
-
buildNotResampleButton
public javax.swing.JButton 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
public void itemStateChanged(java.awt.event.ItemEvent event)
Sets the flags for the checkboxes.- Specified by:
itemStateChangedin interfacejava.awt.event.ItemListener- Overrides:
itemStateChangedin classJDialogBase- Parameters:
event- event that triggered this function
-
sendActionOnStart
public void sendActionOnStart(java.lang.String cmd)
Sets a command that should be sent to the renderer after it is started.- Parameters:
cmd- the action command
-
setSegmentationImage
public void setSegmentationImage(ModelImage img)
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
protected javax.swing.border.TitledBorder buildTitledBorder(java.lang.String title, javax.swing.border.Border _border)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
protected void finalize() throws java.lang.ThrowableClear up memory from gc.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- Call the dispose local to dispose memory.
-
initLUT
protected ModelLUT initLUT(ModelImage img) throws java.lang.OutOfMemoryError
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:
java.lang.OutOfMemoryError- if enough memory cannot be allocated for this method
-
buildPadButton
private void buildPadButton()
Builds the Pad button for padding the blank images.
-
buildResampleButton
private javax.swing.JButton buildResampleButton()
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- Return the resample button built.
-
-