Package gov.nih.mipav.view.dialogs
Class JDialogScriptableTransform
- 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.dialogs.JDialogScriptableBase
-
- gov.nih.mipav.view.dialogs.JDialogScriptableTransform
-
- All Implemented Interfaces:
AlgorithmInterface
,ScriptableActionInterface
,DialogDefaultsInterface
,ActionDiscovery
,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.event.ChangeListener
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class JDialogScriptableTransform extends JDialogScriptableBase implements AlgorithmInterface, javax.swing.event.ChangeListener, ActionDiscovery
Dialog to get user input, then call algorithmTransform. User may select resample or transform. User may input matrix or use image's associated transformation matrix. User may input desired resolutions and dims. User may select interpolation method. Creates new volume. You can choose either of 2 goals in bilinear or trilinear interpolation, but you cannot choose both. You can choose to: 1.) Match the start row, column, and slice in the original image with the start row, column, and slice in the transformed image with no duplication of start values and match the end row, column, and slice in the original image with the end row column, and slice in the transformed image with no duplication of end values with a smooth interpolation occurring between the beginning and end. For a smooth bilinear or trilinear interpolation you must map from 0 to n1t - 1 in the transformed image to 0 to n1 - 1 in the original image. Mapping from n1t - 1 to n1t in the transformed image to n1 - 1 to n1 in the source image would lead to multiple identical transformed copies for source image values between n1 - 1 and n1 - 0.5 and identical or out of bounds transformed values for source values from n1 - 0.5 to n1. This necessitates using equations of the form (dim - 1) * res = (transformedDim - 1) * transformedRes. Since the field of view = dim * res, this does not preserve field of view. If a user wishes to reslice an image and have the beginning and end slices match without duplication, then this would be the method to select 2.) If a user simply wishes to magnify the field of view and is not worried about duplicate beginning and end values, then preserve the field of view = dim * res = transformedDim * transformedRes. If the interpolation is not bilinear or trilinear, then the purpose of interpolation is always to preserve the FOV. For either interpolation purpose, note that if the user selects the new dimension, then the floating point resolution can be perfectly adjusted, but if the user selects the new resolution, since dimensions are integers, the new dimension value may not be perfectly adjusted.- Version:
- 0.1 Nov. 19, 1999
- Author:
- Delia McGarry, Neva Cherniavsky, Zohara Cohen
- 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 static int
ACPC_TO_ORIG
DOCUMENT ME!private static int
ACPC_TO_TLRC
DOCUMENT ME!private AlgorithmTalairachTransform
algoTal
DOCUMENT ME!private AlgorithmTransform
algoTrans
or if the source image is to be replaced.private javax.swing.JCheckBox
clipCheckbox
DOCUMENT ME!private javax.swing.JComboBox
comboBoxImage
DOCUMENT ME!private javax.swing.JComboBox
comboBoxInterp
DOCUMENT ME!private javax.swing.JComboBox
comboBoxTalTransform
DOCUMENT ME!private javax.swing.JRadioButton
computeTImage
DOCUMENT ME!private int
constantFOV
We use the constant to preserve the FOV.private javax.swing.JRadioButton
constantFOVradio
Radio button for constant FOV interpolation.private javax.swing.ButtonGroup
cropOrPad
DOCUMENT ME!private javax.swing.JRadioButton
cropRadio
DOCUMENT ME!private javax.swing.JLabel
current
DOCUMENT ME!private int
cXdim
DOCUMENT ME!private float
cXres
DOCUMENT ME!private int
cYdim
DOCUMENT ME!private float
cYres
DOCUMENT ME!private int
cZdim
DOCUMENT ME!private float
cZres
DOCUMENT ME!private int
dataType
private float[]
dims
private boolean
do25D
DOCUMENT ME!private boolean
doClip
DOCUMENT ME!private boolean
doInvMat
DOCUMENT ME!private boolean
doPad
DOCUMENT ME!private boolean
doRotateCenter
DOCUMENT ME!private boolean
doTalairach
DOCUMENT ME!private boolean
doUpdateOrigin
DOCUMENT ME!private boolean
doVOI
DOCUMENT ME!private boolean
enableSATransform
private javax.swing.JRadioButton
endMatchFOVradio
Radio button for slice start & end matching interpolation.private boolean[]
fileClip
private int[]
fileInterp
private javax.swing.JRadioButton
fileMatrix
DOCUMENT ME!private boolean[]
filePad
private TransMatrix
fileTransMatrix
Stores the matrix read in from a file it then can be converted to the corrected axis orientation (i.e. world coordinate and/or left-hand coordinate systems).private boolean[]
filetVOI
private float
fillValue
private ModelImage
image
source imageprivate javax.swing.JCheckBox
image25DCheckbox
DOCUMENT ME!private double
imageMax
private double
imageMin
private int
interp
Interpolation methodprivate javax.swing.ButtonGroup
interpFOVgroup
Button group for interpolation type, contant FOV or start, end matching.private javax.swing.JCheckBox
invertCheckbox
DOCUMENT ME!private boolean
isSATransform
is this a scanner anatomical transform (->AXIAL)private javax.swing.JLabel
labelDimX
DOCUMENT ME!private javax.swing.JLabel
labelDimY
DOCUMENT ME!private javax.swing.JLabel
labelDimZ
DOCUMENT ME!private javax.swing.JLabel
labelOrigin
private javax.swing.JLabel
labelResX
DOCUMENT ME!private javax.swing.JLabel
labelResY
DOCUMENT ME!private javax.swing.JLabel
labelResZ
DOCUMENT ME!private javax.swing.JLabel
labelRx
DOCUMENT ME!private javax.swing.JLabel
labelRy
DOCUMENT ME!private javax.swing.JLabel
labelRz
DOCUMENT ME!private javax.swing.JLabel
labelSKx
DOCUMENT ME!private javax.swing.JLabel
labelSKy
DOCUMENT ME!private javax.swing.JLabel
labelSKz
DOCUMENT ME!private javax.swing.JLabel
labelSx
DOCUMENT ME!private javax.swing.JLabel
labelSy
DOCUMENT ME!private javax.swing.JLabel
labelSz
DOCUMENT ME!private javax.swing.JLabel
labelTransformDimX
private javax.swing.JLabel
labelTransformDimY
private javax.swing.JLabel
labelTransformDimZ
private javax.swing.JLabel
labelTransformResX
private javax.swing.JLabel
labelTransformResY
private javax.swing.JLabel
labelTransformResZ
private javax.swing.JLabel
labelTx
DOCUMENT ME!private javax.swing.JLabel
labelTy
DOCUMENT ME!private javax.swing.JLabel
labelTz
DOCUMENT ME!private boolean
leftHandSystem
If true change matrix to the left-hand coordinate system.private javax.swing.JSlider
magSlider
DOCUMENT ME!private javax.swing.ButtonGroup
matrixDeterminationGroup
DOCUMENT ME!private java.lang.String
matrixDirectory
private java.lang.String
matrixFile
DOCUMENT ME!private javax.swing.JTextField
matrixFName
DOCUMENT ME!private int
max
DOCUMENT ME!private javax.swing.JLabel
maximum
DOCUMENT ME!private int
min
DOCUMENT ME!private javax.swing.JLabel
minimum
DOCUMENT ME!private javax.swing.JRadioButton
noTransform
DOCUMENT ME!private static int
ORIG_TO_ACPC
DOCUMENT ME!private static int
ORIG_TO_TLRC
DOCUMENT ME!private javax.swing.JComboBox
outOfBoundsComboBox
private int
outOfBoundsIndex
Tells how to select fill value for out of bounds data 0 for image minimum 1 for NaN for float, zero otherwise. 2 for user defined 3 for image maximumprivate javax.swing.JLabel
outOfBoundsLabel
private javax.swing.ButtonGroup
outputDimsGroup
private int
oXdim
DOCUMENT ME!private float
oXres
DOCUMENT ME!private int
oYdim
DOCUMENT ME!private float
oYres
DOCUMENT ME!private int
oZdim
DOCUMENT ME!private float
oZres
DOCUMENT ME!private javax.swing.JRadioButton
padRadio
DOCUMENT ME!private boolean
preserveFOV
DOCUMENT ME!private javax.swing.JRadioButton
preserveFOV2Button
private javax.swing.JRadioButton
preserveFOVButton
private javax.swing.JRadioButton
preserveOutputDimsButton
private javax.swing.JRadioButton
prevSelectedTransformRadioButton
private boolean
quiet
private java.lang.String
RESAMPLE_STATUS_DEFAULT_TEXT
private javax.swing.ButtonGroup
resampleGroup
DOCUMENT ME!private ModelImage
resampleImage
DOCUMENT ME!private javax.swing.JRadioButton
resampleMatrixSourceButton
private javax.swing.JRadioButton
resampleMatrixTargetButton
private javax.swing.JPanel
resamplePanel
private javax.swing.JRadioButton
resampleSlider
DOCUMENT ME!private javax.swing.JTextField
resampleStatusTextField
private javax.swing.JRadioButton
resampletoImage
DOCUMENT ME!private javax.swing.JRadioButton
resampletoMatrixFile
DOCUMENT ME!private javax.swing.JRadioButton
resampletoUser
DOCUMENT ME!private javax.swing.ButtonGroup
resDimGroup
private float[]
resols
private javax.swing.ButtonGroup
resTransformGroup
private ModelImage
resultImage
DOCUMENT ME!private javax.swing.ButtonGroup
rotationAxisGroup
DOCUMENT ME!private javax.swing.JRadioButton
rotCenter
DOCUMENT ME!private javax.swing.JRadioButton
rotOrigin
DOCUMENT ME!private javax.swing.JRadioButton
separateDimResButton
private static long
serialVersionUID
Use serialVersionUID for interoperability.private int[]
sourceXdim
private float[]
sourceXres
private int[]
sourceYdim
private float[]
sourceYres
private int[]
sourceZdim
private float[]
sourceZres
private AlgorithmTPSpline
spline
private javax.swing.JRadioButton
storedMatrix
DOCUMENT ME!private javax.swing.JComboBox
storedMatrixBox
private javax.swing.JTabbedPane
tabbedPane
Tabbed paneprivate int[]
targetXdim
private float[]
targetXres
private int[]
targetYdim
private float[]
targetYres
private int[]
targetZdim
private float[]
targetZres
private javax.swing.JTextField
textDimX
DOCUMENT ME!private javax.swing.JTextField
textDimY
DOCUMENT ME!private javax.swing.JTextField
textDimZ
DOCUMENT ME!private javax.swing.JTextField
textResX
DOCUMENT ME!private javax.swing.JTextField
textResY
DOCUMENT ME!private javax.swing.JTextField
textResZ
DOCUMENT ME!private javax.swing.JTextField
textRx
DOCUMENT ME!private javax.swing.JTextField
textRy
DOCUMENT ME!private javax.swing.JTextField
textRz
DOCUMENT ME!private javax.swing.JTextField
textSKx
DOCUMENT ME!private javax.swing.JTextField
textSKy
DOCUMENT ME!private javax.swing.JTextField
textSKz
DOCUMENT ME!private javax.swing.JTextField
textSx
DOCUMENT ME!private javax.swing.JTextField
textSy
DOCUMENT ME!private javax.swing.JTextField
textSz
DOCUMENT ME!private javax.swing.JTextField
textTransformDimX
private javax.swing.JTextField
textTransformDimY
private javax.swing.JTextField
textTransformDimZ
private javax.swing.JTextField
textTransformResX
private javax.swing.JTextField
textTransformResY
private javax.swing.JTextField
textTransformResZ
private javax.swing.JTextField
textTx
DOCUMENT ME!private javax.swing.JTextField
textTy
DOCUMENT ME!private javax.swing.JTextField
textTz
DOCUMENT ME!private TalairachTransformInfo
tInfo
DOCUMENT ME!private static int
TLRC_TO_ACPC
DOCUMENT ME!private static int
TLRC_TO_ORIG
DOCUMENT ME!private java.lang.String
TRANSFORM_STATUS_DEFAULT_TEXT
private javax.swing.JTextField
transformStatusTextField
private int
transformType
DOCUMENT ME!private java.lang.String[]
tVal
DOCUMENT ME!private int[]
units
private javax.swing.JCheckBox
updateOriginCheckbox
DOCUMENT ME!private javax.swing.JRadioButton
userDefinedMatrix
DOCUMENT ME!private ViewUserInterface
userInterface
DOCUMENT ME!private boolean
useSACenter
private javax.swing.JCheckBox
useSACenterBox
checkbox telling the algorithm to use the scanner coordinate center rather than the image centerprivate javax.swing.JLabel
valueLabel
private javax.swing.JTextField
valueText
private javax.swing.JCheckBox
voiCheckbox
DOCUMENT ME!private boolean
wcSystem
If true change matrix to the world coordinate system.private TransMatrix
xfrm
DOCUMENT ME!private javax.swing.JCheckBox
xyAspectRatio
DOCUMENT ME!private javax.swing.JCheckBox
xyzAspectRatio
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParameters
-
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 JDialogScriptableTransform()
Empty constructor needed for dynamic instantiation (used during scripting).JDialogScriptableTransform(java.awt.Frame theParentFrame, ModelImage im)
Constructs new transform dialog and sets up GUI components.JDialogScriptableTransform(java.awt.Frame theParentFrame, ModelImage im, boolean doInit)
Constructs new transform dialog and sets up GUI components.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the OK button is pressed, sets the variables, and calls the algorithm.void
algorithmPerformed(AlgorithmBase algorithm)
This method is required if the AlgorithmPerformed interface is implemented.private void
buildComboBox()
Builds a list of images to register to the template image.private javax.swing.JPanel
buildMatrixPanel()
Builds the matrixPanel.private javax.swing.JPanel
buildOptionPanel()
Builds the OptionPanel.private javax.swing.JPanel
buildResamplePanel()
Builds the resample panel.(package private) javax.swing.JPanel
buildResampleStatusPanel()
(package private) javax.swing.JPanel
buildTransformStatusPanel()
protected void
callAlgorithm()
Calls the algorithm with the set variables.private void
callTalAlgorithm()
DOCUMENT ME!private void
clearResampleOriginalValues()
private void
clearResampleStatusBox()
private void
clearTransformStatusBox()
ParameterTable
createInputParameters()
Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used insetGUIFromParams()
).ParameterTable
createOutputParameters()
Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).private void
disableResampleMatrixFileButton()
protected void
doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table).private void
enableDims(boolean state)
DOCUMENT ME!private void
enableResampleMatrixFileButton()
private void
enableResampleMatrixFileButtonTargetOnly()
private void
enableResols(boolean state)
DOCUMENT ME!private void
enableYSettings(boolean state)
DOCUMENT ME!void
finalize()
void
focusLost(java.awt.event.FocusEvent event)
When the user clicks the mouse out of a text field, resets the necessary variables.ActionMetadata
getActionMetadata()
Return meta-information about this discoverable action for categorization and labeling purposes.private int[]
getAxisOrientation(float[][] array)
Return the 3 axis orientation codes that correspond to the closest standard anatomical orientation of the (i,j,k) axes.(package private) java.io.File
getFileFromName(java.lang.String fileName)
java.lang.String
getOutputImageName(java.lang.String imageParamName)
Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).ModelImage
getResultImage()
Accessor that returns the image.private boolean
hasV1TargetData()
private void
init()
Initializes the dialog box to a certain size and adds the components.boolean
isActionComplete()
Returns whether the action has successfully completed its execution.private boolean
isCorrectTranformMatrixFile(java.lang.String fileName)
private boolean
isV2MatrixDataFile()
private boolean
isValidV2MatrixFileRead()
void
itemStateChanged(java.awt.event.ItemEvent event)
Method to handle item events.java.lang.String
matrixFileMenu()
Allows the user to select matrix file.private void
populateResampleMatrixFileValues()
TransMatrix
readTransformMatrixFile(java.lang.String fileName)
Reads a matrix from a file.private TransMatrix
readTransformMatrixFile(java.lang.String fileName, boolean runningFromScript)
Reads a matrix from a file.private TransMatrix
reorientCoordSystem(TransMatrix rkMatrix)
Re-orient the matrix to world and left-hand coordinate systems if required.static TransMatrix
reorientCoordSystem(TransMatrix rkMatrix, ModelImage rkImage, ModelImage rkResampleImage, boolean bWcSystem, boolean bLeftHandSystem)
Re-orient the matrix to world and left-hand coordinate systems if required.void
setClipFlag(boolean flag)
Accessor that sets the clip flag.private void
setDefaultResampleToUser()
DOCUMENT ME!void
setDimAndResXYZ()
Resets the dimension and resolution fields for resampling panel.void
setDoInvMat(boolean flag)
Accessor that sets the boolean for invert matrix.void
setDoTalairach(boolean doTalairach)
Accessor that sets the boolean for doing a Talairach type transformation.void
setFileXDim(int xDim)
void
setFillValue(float fillValue)
Accessor that sets the fillValue.protected void
setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.void
setImage25D(boolean flag)
Accessor that sets the slicing flag.void
setInterp(int interp)
Accessor that sets the interpolation method.void
setLeftHandSystem(boolean leftHandSys)
Sets the left-hand coordinate flag.void
setMatrix(TransMatrix matrix)
Accessor that sets the transformation matrix.void
setOutDimensions(int[] outDim)
Accessor to set the output image's dimensions.void
setOutResolutions(float[] outRes)
Accessor to set the output image's resolutions.void
setPadFlag(boolean flag)
Accessor that sets the padding flag.void
setPreserveFOV(boolean flag)
Accessor that sets value for the preserveFOV booleanvoid
setQuiet(boolean quiet)
private void
setResampleStatusBox(java.lang.String status)
private void
setTransformStatusBox(java.lang.String status)
void
setTransformType(int transformType)
Accessor that sets the type of Talairach transformation.void
setUnits(int[] units)
Accessor that sets the units.void
setUpdateOrigin(boolean flag)
Accessor that sets the update origin flag.private boolean
setVariables()
Sets the variables needed to run the algorithm.void
setVOIFlag(boolean flag)
Accessor that sets the voi flag.void
setWCSystem(boolean wcSys)
Sets the world coordinate flag.void
stateChanged(javax.swing.event.ChangeEvent event)
Sets values based on knob along slider.protected void
storeParamsFromGUI()
Record the parameters just used to run this algorithm in a script.private boolean
testType(int type, float value)
Determine if the value is in the image type range and within the float range since AlgorithmTransform does not use double buffers.private void
updateResampleStatusImage()
private void
updateResampleStatusUserSpecified()
-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
getDialogActionString, insertScriptLine, isComplete, scriptRun, setComplete
-
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, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, 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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nih.mipav.view.dialogs.ActionDiscovery
scriptRun
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
ORIG_TO_ACPC
private static final int ORIG_TO_ACPC
DOCUMENT ME!- See Also:
- Constant Field Values
-
ORIG_TO_TLRC
private static final int ORIG_TO_TLRC
DOCUMENT ME!- See Also:
- Constant Field Values
-
ACPC_TO_TLRC
private static final int ACPC_TO_TLRC
DOCUMENT ME!- See Also:
- Constant Field Values
-
TLRC_TO_ACPC
private static final int TLRC_TO_ACPC
DOCUMENT ME!- See Also:
- Constant Field Values
-
TLRC_TO_ORIG
private static final int TLRC_TO_ORIG
DOCUMENT ME!- See Also:
- Constant Field Values
-
ACPC_TO_ORIG
private static final int ACPC_TO_ORIG
DOCUMENT ME!- See Also:
- Constant Field Values
-
algoTal
private AlgorithmTalairachTransform algoTal
DOCUMENT ME!
-
algoTrans
private AlgorithmTransform algoTrans
or if the source image is to be replaced.
-
clipCheckbox
private javax.swing.JCheckBox clipCheckbox
DOCUMENT ME!
-
voiCheckbox
private javax.swing.JCheckBox voiCheckbox
DOCUMENT ME!
-
image25DCheckbox
private javax.swing.JCheckBox image25DCheckbox
DOCUMENT ME!
-
updateOriginCheckbox
private javax.swing.JCheckBox updateOriginCheckbox
DOCUMENT ME!
-
invertCheckbox
private javax.swing.JCheckBox invertCheckbox
DOCUMENT ME!
-
comboBoxImage
private javax.swing.JComboBox comboBoxImage
DOCUMENT ME!
-
comboBoxInterp
private javax.swing.JComboBox comboBoxInterp
DOCUMENT ME!
-
comboBoxTalTransform
private javax.swing.JComboBox comboBoxTalTransform
DOCUMENT ME!
-
computeTImage
private javax.swing.JRadioButton computeTImage
DOCUMENT ME!
-
do25D
private boolean do25D
DOCUMENT ME!
-
doRotateCenter
private boolean doRotateCenter
DOCUMENT ME!
-
doTalairach
private boolean doTalairach
DOCUMENT ME!
-
doVOI
private boolean doVOI
DOCUMENT ME!
-
doClip
private boolean doClip
DOCUMENT ME!
-
doPad
private boolean doPad
DOCUMENT ME!
-
preserveFOV
private boolean preserveFOV
DOCUMENT ME!
-
doUpdateOrigin
private boolean doUpdateOrigin
DOCUMENT ME!
-
doInvMat
private boolean doInvMat
DOCUMENT ME!
-
fileTransMatrix
private TransMatrix fileTransMatrix
Stores the matrix read in from a file it then can be converted to the corrected axis orientation (i.e. world coordinate and/or left-hand coordinate systems).
-
image
private ModelImage image
source image
-
interp
private int interp
Interpolation method
-
fillValue
private float fillValue
-
labelOrigin
private javax.swing.JLabel labelOrigin
-
labelResX
private javax.swing.JLabel labelResX
DOCUMENT ME!
-
labelResY
private javax.swing.JLabel labelResY
DOCUMENT ME!
-
labelResZ
private javax.swing.JLabel labelResZ
DOCUMENT ME!
-
labelDimX
private javax.swing.JLabel labelDimX
DOCUMENT ME!
-
labelDimY
private javax.swing.JLabel labelDimY
DOCUMENT ME!
-
labelDimZ
private javax.swing.JLabel labelDimZ
DOCUMENT ME!
-
labelTransformResX
private javax.swing.JLabel labelTransformResX
-
labelTransformResY
private javax.swing.JLabel labelTransformResY
-
labelTransformResZ
private javax.swing.JLabel labelTransformResZ
-
labelTransformDimX
private javax.swing.JLabel labelTransformDimX
-
labelTransformDimY
private javax.swing.JLabel labelTransformDimY
-
labelTransformDimZ
private javax.swing.JLabel labelTransformDimZ
-
textTransformResX
private javax.swing.JTextField textTransformResX
-
textTransformResY
private javax.swing.JTextField textTransformResY
-
textTransformResZ
private javax.swing.JTextField textTransformResZ
-
textTransformDimX
private javax.swing.JTextField textTransformDimX
-
textTransformDimY
private javax.swing.JTextField textTransformDimY
-
textTransformDimZ
private javax.swing.JTextField textTransformDimZ
-
resTransformGroup
private javax.swing.ButtonGroup resTransformGroup
-
resampleMatrixSourceButton
private javax.swing.JRadioButton resampleMatrixSourceButton
-
resampleMatrixTargetButton
private javax.swing.JRadioButton resampleMatrixTargetButton
-
labelTx
private javax.swing.JLabel labelTx
DOCUMENT ME!
-
labelTy
private javax.swing.JLabel labelTy
DOCUMENT ME!
-
labelTz
private javax.swing.JLabel labelTz
DOCUMENT ME!
-
labelRx
private javax.swing.JLabel labelRx
DOCUMENT ME!
-
labelRy
private javax.swing.JLabel labelRy
DOCUMENT ME!
-
labelRz
private javax.swing.JLabel labelRz
DOCUMENT ME!
-
labelSx
private javax.swing.JLabel labelSx
DOCUMENT ME!
-
labelSy
private javax.swing.JLabel labelSy
DOCUMENT ME!
-
labelSz
private javax.swing.JLabel labelSz
DOCUMENT ME!
-
labelSKx
private javax.swing.JLabel labelSKx
DOCUMENT ME!
-
labelSKy
private javax.swing.JLabel labelSKy
DOCUMENT ME!
-
labelSKz
private javax.swing.JLabel labelSKz
DOCUMENT ME!
-
leftHandSystem
private boolean leftHandSystem
If true change matrix to the left-hand coordinate system.
-
magSlider
private javax.swing.JSlider magSlider
DOCUMENT ME!
-
matrixDeterminationGroup
private javax.swing.ButtonGroup matrixDeterminationGroup
DOCUMENT ME!
-
rotationAxisGroup
private javax.swing.ButtonGroup rotationAxisGroup
DOCUMENT ME!
-
cropOrPad
private javax.swing.ButtonGroup cropOrPad
DOCUMENT ME!
-
matrixFile
private java.lang.String matrixFile
DOCUMENT ME!
-
matrixDirectory
private java.lang.String matrixDirectory
-
matrixFName
private javax.swing.JTextField matrixFName
DOCUMENT ME!
-
max
private int max
DOCUMENT ME!
-
min
private int min
DOCUMENT ME!
-
maximum
private javax.swing.JLabel maximum
DOCUMENT ME!
-
minimum
private javax.swing.JLabel minimum
DOCUMENT ME!
-
current
private javax.swing.JLabel current
DOCUMENT ME!
-
oXdim
private int oXdim
DOCUMENT ME!
-
oYdim
private int oYdim
DOCUMENT ME!
-
oZdim
private int oZdim
DOCUMENT ME!
-
cXdim
private int cXdim
DOCUMENT ME!
-
cYdim
private int cYdim
DOCUMENT ME!
-
cZdim
private int cZdim
DOCUMENT ME!
-
oXres
private float oXres
DOCUMENT ME!
-
oYres
private float oYres
DOCUMENT ME!
-
oZres
private float oZres
DOCUMENT ME!
-
cXres
private float cXres
DOCUMENT ME!
-
cYres
private float cYres
DOCUMENT ME!
-
cZres
private float cZres
DOCUMENT ME!
-
units
private int[] units
-
resampleGroup
private javax.swing.ButtonGroup resampleGroup
DOCUMENT ME!
-
resampleImage
private ModelImage resampleImage
DOCUMENT ME!
-
resampletoUser
private javax.swing.JRadioButton resampletoUser
DOCUMENT ME!
-
resampletoImage
private javax.swing.JRadioButton resampletoImage
DOCUMENT ME!
-
resampleSlider
private javax.swing.JRadioButton resampleSlider
DOCUMENT ME!
-
resampletoMatrixFile
private javax.swing.JRadioButton resampletoMatrixFile
DOCUMENT ME!
-
resultImage
private ModelImage resultImage
DOCUMENT ME!
-
rotCenter
private javax.swing.JRadioButton rotCenter
DOCUMENT ME!
-
rotOrigin
private javax.swing.JRadioButton rotOrigin
DOCUMENT ME!
-
cropRadio
private javax.swing.JRadioButton cropRadio
DOCUMENT ME!
-
padRadio
private javax.swing.JRadioButton padRadio
DOCUMENT ME!
-
storedMatrix
private javax.swing.JRadioButton storedMatrix
DOCUMENT ME!
-
noTransform
private javax.swing.JRadioButton noTransform
DOCUMENT ME!
-
userDefinedMatrix
private javax.swing.JRadioButton userDefinedMatrix
DOCUMENT ME!
-
fileMatrix
private javax.swing.JRadioButton fileMatrix
DOCUMENT ME!
-
storedMatrixBox
private javax.swing.JComboBox storedMatrixBox
-
textResX
private javax.swing.JTextField textResX
DOCUMENT ME!
-
textResY
private javax.swing.JTextField textResY
DOCUMENT ME!
-
textResZ
private javax.swing.JTextField textResZ
DOCUMENT ME!
-
textDimX
private javax.swing.JTextField textDimX
DOCUMENT ME!
-
textDimY
private javax.swing.JTextField textDimY
DOCUMENT ME!
-
textDimZ
private javax.swing.JTextField textDimZ
DOCUMENT ME!
-
resampleStatusTextField
private javax.swing.JTextField resampleStatusTextField
-
transformStatusTextField
private javax.swing.JTextField transformStatusTextField
-
textTx
private javax.swing.JTextField textTx
DOCUMENT ME!
-
textTy
private javax.swing.JTextField textTy
DOCUMENT ME!
-
textTz
private javax.swing.JTextField textTz
DOCUMENT ME!
-
textRx
private javax.swing.JTextField textRx
DOCUMENT ME!
-
textRy
private javax.swing.JTextField textRy
DOCUMENT ME!
-
textRz
private javax.swing.JTextField textRz
DOCUMENT ME!
-
textSx
private javax.swing.JTextField textSx
DOCUMENT ME!
-
textSy
private javax.swing.JTextField textSy
DOCUMENT ME!
-
textSz
private javax.swing.JTextField textSz
DOCUMENT ME!
-
textSKx
private javax.swing.JTextField textSKx
DOCUMENT ME!
-
textSKy
private javax.swing.JTextField textSKy
DOCUMENT ME!
-
textSKz
private javax.swing.JTextField textSKz
DOCUMENT ME!
-
tInfo
private TalairachTransformInfo tInfo
DOCUMENT ME!
-
transformType
private int transformType
DOCUMENT ME!
-
tVal
private java.lang.String[] tVal
DOCUMENT ME!
-
userInterface
private ViewUserInterface userInterface
DOCUMENT ME!
-
wcSystem
private boolean wcSystem
If true change matrix to the world coordinate system.
-
xfrm
private TransMatrix xfrm
DOCUMENT ME!
-
xyAspectRatio
private javax.swing.JCheckBox xyAspectRatio
DOCUMENT ME!
-
xyzAspectRatio
private javax.swing.JCheckBox xyzAspectRatio
DOCUMENT ME!
-
preserveFOVButton
private javax.swing.JRadioButton preserveFOVButton
-
preserveOutputDimsButton
private javax.swing.JRadioButton preserveOutputDimsButton
-
outputDimsGroup
private javax.swing.ButtonGroup outputDimsGroup
-
preserveFOV2Button
private javax.swing.JRadioButton preserveFOV2Button
-
separateDimResButton
private javax.swing.JRadioButton separateDimResButton
-
resDimGroup
private javax.swing.ButtonGroup resDimGroup
-
useSACenterBox
private javax.swing.JCheckBox useSACenterBox
checkbox telling the algorithm to use the scanner coordinate center rather than the image center
-
useSACenter
private boolean useSACenter
-
tabbedPane
private javax.swing.JTabbedPane tabbedPane
Tabbed pane
-
isSATransform
private boolean isSATransform
is this a scanner anatomical transform (->AXIAL)
-
enableSATransform
private boolean enableSATransform
-
constantFOV
private int constantFOV
We use the constant to preserve the FOV. Either 1 or 0;
-
interpFOVgroup
private javax.swing.ButtonGroup interpFOVgroup
Button group for interpolation type, contant FOV or start, end matching.
-
constantFOVradio
private javax.swing.JRadioButton constantFOVradio
Radio button for constant FOV interpolation.
-
endMatchFOVradio
private javax.swing.JRadioButton endMatchFOVradio
Radio button for slice start & end matching interpolation.
-
dims
private float[] dims
-
resols
private float[] resols
-
outOfBoundsLabel
private javax.swing.JLabel outOfBoundsLabel
-
outOfBoundsComboBox
private javax.swing.JComboBox outOfBoundsComboBox
-
valueLabel
private javax.swing.JLabel valueLabel
-
valueText
private javax.swing.JTextField valueText
-
imageMin
private double imageMin
-
imageMax
private double imageMax
-
dataType
private int dataType
-
resamplePanel
private javax.swing.JPanel resamplePanel
-
outOfBoundsIndex
private int outOfBoundsIndex
Tells how to select fill value for out of bounds data 0 for image minimum 1 for NaN for float, zero otherwise. 2 for user defined 3 for image maximum
-
spline
private AlgorithmTPSpline spline
-
fileInterp
private int[] fileInterp
-
sourceXres
private float[] sourceXres
-
sourceYres
private float[] sourceYres
-
sourceZres
private float[] sourceZres
-
targetXres
private float[] targetXres
-
targetYres
private float[] targetYres
-
targetZres
private float[] targetZres
-
sourceXdim
private int[] sourceXdim
-
sourceYdim
private int[] sourceYdim
-
sourceZdim
private int[] sourceZdim
-
targetXdim
private int[] targetXdim
-
targetYdim
private int[] targetYdim
-
targetZdim
private int[] targetZdim
-
filetVOI
private boolean[] filetVOI
-
fileClip
private boolean[] fileClip
-
filePad
private boolean[] filePad
-
quiet
private boolean quiet
-
RESAMPLE_STATUS_DEFAULT_TEXT
private java.lang.String RESAMPLE_STATUS_DEFAULT_TEXT
-
TRANSFORM_STATUS_DEFAULT_TEXT
private java.lang.String TRANSFORM_STATUS_DEFAULT_TEXT
-
prevSelectedTransformRadioButton
private javax.swing.JRadioButton prevSelectedTransformRadioButton
-
-
Constructor Detail
-
JDialogScriptableTransform
public JDialogScriptableTransform()
Empty constructor needed for dynamic instantiation (used during scripting).
-
JDialogScriptableTransform
public JDialogScriptableTransform(java.awt.Frame theParentFrame, ModelImage im)
Constructs new transform dialog and sets up GUI components.- Parameters:
theParentFrame
- Parent frame.im
- Source image.
-
JDialogScriptableTransform
public JDialogScriptableTransform(java.awt.Frame theParentFrame, ModelImage im, boolean doInit)
Constructs new transform dialog and sets up GUI components.- Parameters:
theParentFrame
- Parent frame.im
- Source image.
-
-
Method Detail
-
setQuiet
public void setQuiet(boolean quiet)
- Parameters:
quiet
-
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the OK button is pressed, sets the variables, and calls the algorithm.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
event
- Event that triggers function.
-
algorithmPerformed
public void algorithmPerformed(AlgorithmBase algorithm)
This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to to complete, so that the dialog can be display the result image and/or clean up.- Specified by:
algorithmPerformed
in interfaceAlgorithmInterface
- Parameters:
algorithm
- Algorithm that caused the event.
-
finalize
public void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
focusLost
public void focusLost(java.awt.event.FocusEvent event)
When the user clicks the mouse out of a text field, resets the necessary variables.- Specified by:
focusLost
in interfacejava.awt.event.FocusListener
- Overrides:
focusLost
in classJDialogBase
- Parameters:
event
- event that triggers this function
-
getResultImage
public ModelImage getResultImage()
Accessor that returns the image.- Returns:
- The result image
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent event)
Method to handle item events.- Specified by:
itemStateChanged
in interfacejava.awt.event.ItemListener
- Overrides:
itemStateChanged
in classJDialogBase
- Parameters:
event
- event that cause the method to fire
-
matrixFileMenu
public java.lang.String matrixFileMenu()
Allows the user to select matrix file.- Returns:
- fileName
-
getFileFromName
java.io.File getFileFromName(java.lang.String fileName)
-
isCorrectTranformMatrixFile
private boolean isCorrectTranformMatrixFile(java.lang.String fileName)
-
readTransformMatrixFile
private TransMatrix readTransformMatrixFile(java.lang.String fileName, boolean runningFromScript)
Reads a matrix from a file.- Parameters:
fileName
- name of the matrix file.runningFromScript
- if this was invoked from the script runner
-
readTransformMatrixFile
public TransMatrix readTransformMatrixFile(java.lang.String fileName)
Reads a matrix from a file.- Parameters:
fileName
- name of the matrix file.
-
setPreserveFOV
public void setPreserveFOV(boolean flag)
Accessor that sets value for the preserveFOV boolean- Parameters:
flag
-true
indicates that output dim should be set from input dim*res or input (dim-1)*res. flagfalse
indicates that the output dim should be set from the selected image output dim.
-
setClipFlag
public void setClipFlag(boolean flag)
Accessor that sets the clip flag.- Parameters:
flag
-true
indicates clip image,false
otherwise.
-
setDoInvMat
public void setDoInvMat(boolean flag)
Accessor that sets the boolean for invert matrix.- Parameters:
flag
-true
indicates invert matrix,false
otherwise.
-
setDimAndResXYZ
public void setDimAndResXYZ()
Resets the dimension and resolution fields for resampling panel. Called by focusLost.
-
setDoTalairach
public void setDoTalairach(boolean doTalairach)
Accessor that sets the boolean for doing a Talairach type transformation.- Parameters:
doTalairach
- boolean
-
setImage25D
public void setImage25D(boolean flag)
Accessor that sets the slicing flag.- Parameters:
flag
-true
indicates slices should be blurred independently.
-
setInterp
public void setInterp(int interp)
Accessor that sets the interpolation method.- Parameters:
interp
- DOCUMENT ME!
-
setLeftHandSystem
public void setLeftHandSystem(boolean leftHandSys)
Sets the left-hand coordinate flag. If true, change matrix to the left-hand coordinate system.- Overrides:
setLeftHandSystem
in classJDialogBase
- Parameters:
leftHandSys
- DOCUMENT ME!
-
setMatrix
public void setMatrix(TransMatrix matrix)
Accessor that sets the transformation matrix.- Parameters:
matrix
- The transformation matrix.
-
setOutDimensions
public void setOutDimensions(int[] outDim)
Accessor to set the output image's dimensions.- Parameters:
outDim
- Array of the dimensions.
-
setOutResolutions
public void setOutResolutions(float[] outRes)
Accessor to set the output image's resolutions.- Parameters:
outRes
- Array of the resolutions.
-
setPadFlag
public void setPadFlag(boolean flag)
Accessor that sets the padding flag.- Parameters:
flag
-true
indicates slices should be blurred independently.
-
setFillValue
public void setFillValue(float fillValue)
Accessor that sets the fillValue.- Parameters:
fillValue
- DOCUMENT ME!
-
setTransformType
public void setTransformType(int transformType)
Accessor that sets the type of Talairach transformation.- Parameters:
transformType
- int
-
setUnits
public void setUnits(int[] units)
Accessor that sets the units.- Parameters:
units
- of image
-
setUpdateOrigin
public void setUpdateOrigin(boolean flag)
Accessor that sets the update origin flag.- Parameters:
flag
-true
indicates to update the image origin using the transformation matrix.
-
setVOIFlag
public void setVOIFlag(boolean flag)
Accessor that sets the voi flag.- Parameters:
flag
-true
indicates transform VOI,false
otherwise.
-
setWCSystem
public void setWCSystem(boolean wcSys)
Sets the world coordinate flag. If true, change matrix to the world coordinate system.- Overrides:
setWCSystem
in classJDialogBase
- Parameters:
wcSys
- DOCUMENT ME!
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent event)
Sets values based on knob along slider.- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
- Parameters:
event
- ChangeEvent event that triggered this function
-
setFileXDim
public void setFileXDim(int xDim)
- Parameters:
xDim
- By setting fileXdim[0] to zero can change path selected in callAlgorithm
-
callAlgorithm
protected void callAlgorithm()
Calls the algorithm with the set variables.- Specified by:
callAlgorithm
in classJDialogScriptableBase
-
doPostAlgorithmActions
protected void doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.- Overrides:
doPostAlgorithmActions
in classJDialogScriptableBase
-
setGUIFromParams
protected void setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParams
in classJDialogScriptableBase
-
storeParamsFromGUI
protected void storeParamsFromGUI() throws ParserException
Record the parameters just used to run this algorithm in a script.- Specified by:
storeParamsFromGUI
in classJDialogScriptableBase
- Throws:
ParserException
- If there is a problem creating/recording the new parameters.
-
buildComboBox
private void buildComboBox()
Builds a list of images to register to the template image.
-
buildMatrixPanel
private javax.swing.JPanel buildMatrixPanel()
Builds the matrixPanel.- Returns:
- The matrix panel.
-
buildOptionPanel
private javax.swing.JPanel buildOptionPanel()
Builds the OptionPanel.- Returns:
- DOCUMENT ME!
-
buildResamplePanel
private javax.swing.JPanel buildResamplePanel()
Builds the resample panel.- Returns:
- The resample panel.
-
callTalAlgorithm
private void callTalAlgorithm()
DOCUMENT ME!
-
enableDims
private void enableDims(boolean state)
DOCUMENT ME!- Parameters:
state
- DOCUMENT ME!
-
enableResols
private void enableResols(boolean state)
DOCUMENT ME!- Parameters:
state
- DOCUMENT ME!
-
enableYSettings
private void enableYSettings(boolean state)
DOCUMENT ME!- Parameters:
state
- DOCUMENT ME!
-
getAxisOrientation
private int[] getAxisOrientation(float[][] array)
Return the 3 axis orientation codes that correspond to the closest standard anatomical orientation of the (i,j,k) axes.- Parameters:
array
- 4x4 matrix that transforms (i,j,k) indexes to x,y,z coordinates where +x =Left, +y = Posterior, +z = Superior Only the upper-left 3x3 corner of the matrix is used This routine finds the permutation of (x,y,z) which has the smallest angle to the (i,j,k) axes directions, which are columns of the input matrix- Returns:
- DOCUMENT ME!
-
init
private void init()
Initializes the dialog box to a certain size and adds the components.
-
buildResampleStatusPanel
javax.swing.JPanel buildResampleStatusPanel()
-
buildTransformStatusPanel
javax.swing.JPanel buildTransformStatusPanel()
-
reorientCoordSystem
private TransMatrix reorientCoordSystem(TransMatrix rkMatrix)
Re-orient the matrix to world and left-hand coordinate systems if required.- Parameters:
rkMatrix
- the matrix to be converted- Returns:
- result
- See Also:
reorientCoordSystem(gov.nih.mipav.model.structures.TransMatrix)
-
reorientCoordSystem
public static TransMatrix reorientCoordSystem(TransMatrix rkMatrix, ModelImage rkImage, ModelImage rkResampleImage, boolean bWcSystem, boolean bLeftHandSystem)
Re-orient the matrix to world and left-hand coordinate systems if required. Note at the moment the voxel resolutions are handled in the transformation algorithm. At some future point we should adjust for voxel resolutions in the transformation matrix - its faster.- Parameters:
rkMatrix
- the matrix to be convertedrkImage
- main imagerkResampleImage
- resampled imagebWcSystem
- true if world coord systembLeftHandSystem
- true if left-handed system.- Returns:
- result
-
setDefaultResampleToUser
private void setDefaultResampleToUser()
DOCUMENT ME!
-
setVariables
private boolean setVariables()
Sets the variables needed to run the algorithm.- Returns:
- Flag indicating successful set of the variables.
-
testType
private boolean testType(int type, float value)
Determine if the value is in the image type range and within the float range since AlgorithmTransform does not use double buffers.- Parameters:
type
- image typevalue
- value tested- Returns:
- true if value is within acceptable range
-
getActionMetadata
public ActionMetadata getActionMetadata()
Return meta-information about this discoverable action for categorization and labeling purposes.- Specified by:
getActionMetadata
in interfaceActionDiscovery
- Returns:
- Metadata for this action.
-
createInputParameters
public ParameterTable createInputParameters()
Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used insetGUIFromParams()
).- Specified by:
createInputParameters
in interfaceActionDiscovery
- Returns:
- A parameter table listing the inputs of this algorithm.
-
createOutputParameters
public ParameterTable createOutputParameters()
Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).- Specified by:
createOutputParameters
in interfaceActionDiscovery
- Returns:
- A parameter table listing the outputs of this algorithm.
-
getOutputImageName
public java.lang.String getOutputImageName(java.lang.String imageParamName)
Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).- Specified by:
getOutputImageName
in interfaceActionDiscovery
- Parameters:
imageParamName
- The output image parameter label for which to get the image name.- Returns:
- The image name of the requested output image parameter label.
-
isActionComplete
public boolean isActionComplete()
Returns whether the action has successfully completed its execution.- Specified by:
isActionComplete
in interfaceActionDiscovery
- Returns:
- True, if the action is complete. False, if the action failed or is still running.
-
disableResampleMatrixFileButton
private void disableResampleMatrixFileButton()
-
enableResampleMatrixFileButton
private void enableResampleMatrixFileButton()
-
enableResampleMatrixFileButtonTargetOnly
private void enableResampleMatrixFileButtonTargetOnly()
-
populateResampleMatrixFileValues
private void populateResampleMatrixFileValues()
-
clearResampleOriginalValues
private void clearResampleOriginalValues()
-
setResampleStatusBox
private void setResampleStatusBox(java.lang.String status)
-
clearResampleStatusBox
private void clearResampleStatusBox()
-
isValidV2MatrixFileRead
private boolean isValidV2MatrixFileRead()
-
isV2MatrixDataFile
private boolean isV2MatrixDataFile()
-
hasV1TargetData
private boolean hasV1TargetData()
-
setTransformStatusBox
private void setTransformStatusBox(java.lang.String status)
-
clearTransformStatusBox
private void clearTransformStatusBox()
-
updateResampleStatusUserSpecified
private void updateResampleStatusUserSpecified()
-
updateResampleStatusImage
private void updateResampleStatusImage()
-
-