Package gov.nih.mipav.view.dialogs
Class JDialogTreT1
- All Implemented Interfaces:
AlgorithmInterface,ScriptableActionInterface,DialogDefaultsInterface,ActionDiscovery,AlgorithmTreParams,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
public class JDialogTreT1
extends JDialogTreMethod
implements AlgorithmInterface, ActionDiscovery, AlgorithmTreParams
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classThis listener focuses on the TRE processing choice chosen.private classThis listener focuses on the type of scanner used to acquire the images.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.FlipBufferStrategyNested classes/interfaces inherited from interface gov.nih.mipav.view.dialogs.AlgorithmTreParams
AlgorithmTreParams.FieldStrength, AlgorithmTreParams.InversionType, AlgorithmTreParams.ScannerType, AlgorithmTreParams.Threshold -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate JComboBoxprivate intprivate booleanprivate booleanThe list of possible maps that can be calculatedprivate AlgorithmTreT1private JTextField[]private JComboBox[]private JTextFieldprivate JPanelprivate static intprivate int[]private JRadioButtonprivate JRadioButtonprivate JRadioButtonprivate double[]private ButtonGroupprivate JTextField[]private JPanelprivate JPanelprivate ButtonGroupprivate AlgorithmTreParams.InversionTypeprivate booleanprivate JComboBox[]private double[]private doubleprivate JTextFieldprivate JTextField[]private JPanelprivate int[]private doubleprivate JTextFieldprivate JScrollPaneprivate double[]private double[]private doubleprivate JTextFieldprivate JRadioButtonprivate JRadioButtonprivate JCheckBoxprivate doubleprivate doubleprivate JTextFieldprivate doubleprivate JTextFieldprivate AlgorithmTreParams.FieldStrengthThe following GUI choices change algorithm operation using enumsprivate intprivate intprivate JTextFieldprivate booleanprivate booleanprivate booleanprivate doubleprivate double[]private doubleprivate doubleprivate AlgorithmTreParams.ScannerTypeprivate JCheckBoxprivate booleanprivate JCheckBoxprivate JCheckBoxprivate JCheckBoxprivate JRadioButtonprivate JCheckBoxprivate booleanprivate double[]private JComboBox[]private int[]private JTextFieldprivate JScrollPaneprivate JTextFieldprivate JPanelprivate JRadioButtonprivate JRadioButtonprivate JTabbedPaneprivate static Stringprivate String[]The GUI list of imagesprivate double[]private JScrollPaneprivate doubleprivate booleanprivate JCheckBoxprivate booleanprivate String[]The ordered list of images that the algorithm is dependent on.Fields inherited from class gov.nih.mipav.view.dialogs.JDialogTreMethod
guiBuilder, hardCheckBox, hardNoiseThreshold, lowerLeftCorner, lowerRightCorner, noCheckBox, noiseScale, smartCheckBox, SUCCESS, thresholdMethod, totalThreshold, upperLeftCorner, upperRightCornerFields inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParametersFields 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
ConstructorsConstructorDescriptionBlank constructor needed for dynamic instantiation.JDialogTreT1(Frame theParentFrame, ModelImage im) Construct the TRE dialog. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidalgorithmPerformed(AlgorithmBase algorithm) Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).private voidThis method builds the conventional tabs based on possibly pre-defined values.protected JPanelprotected JPanelprivate voidprotected JScrollPaneprivate JPanelprivate JPanelprotected JScrollPaneprivate JPanelprotected JPanelprivate JPanelprotected JScrollPaneprivate JPanelprotected JPanelprivate JPanelprotected voidStarts the algorithm.Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used insetGUIFromParams()).Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).protected voidprotected voidStore the result image in the script runner's image table now that the action execution is finished.Return meta-information about this discoverable action for categorization and labeling purposes.getOutputImageName(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).private voidbooleanReturns whether the action has successfully completed its execution.private voidrun()private voidSpecifies an addendum to the preferred size of the dialog equal to the length of the longest image.protected voidSet the dialog GUI using the script parameters while running this algorithm as part of a script.private voidprivate voidprivate StringsetUI(boolean process) Sets UI variables for either saving between processing steps or later reuse.protected voidRecord the parameters just used to run this algorithm in a script.private booleanMethods inherited from class gov.nih.mipav.view.dialogs.JDialogTreMethod
buildHardThresholdPanel, buildNoThresholdPanel, buildSmartThresholdPanel, buildThresholdPanel, setHardThresholdUI, setSmartThresholdUIMethods inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
getDialogActionString, insertScriptLine, isComplete, scriptRun, setCompleteMethods 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, itemStateChanged, 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gov.nih.mipav.view.dialogs.ActionDiscovery
scriptRun
-
Field Details
-
title
-
dialogWidthAdd
private static int dialogWidthAdd -
treTR
private double treTR -
irspgrTR
private double irspgrTR -
irspgrKy
private double irspgrKy -
irspgrFA
private double irspgrFA -
maxT1
private double maxT1 -
maxM0
private double maxM0 -
treFA
private double[] treFA -
irspgrTr
private double[] irspgrTr -
irspgrTI
private double[] irspgrTI -
spgrData
private double[] spgrData -
irspgrData
private double[] irspgrData -
scale
private double scale -
pointScale
private double pointScale -
scaleIncrement
private double scaleIncrement -
estimates
private double[] estimates -
residuals
private double[] residuals -
direction
private int[] direction -
spgrImageIndex
private int[] spgrImageIndex -
irspgrImageIndex
private int[] irspgrImageIndex -
b1ImageIndex
private int b1ImageIndex -
angleIncrement
private double angleIncrement -
Nsa
private int Nsa -
Nti
private int Nti -
maxAngle
private double maxAngle -
smoothB1Field
private boolean smoothB1Field -
mriStrength
The following GUI choices change algorithm operation using enums -
scannerType
-
inversionType
-
calculateT1
private boolean calculateT1The list of possible maps that can be calculated -
showB1Map
private boolean showB1Map -
calculateM0
private boolean calculateM0 -
invertT1toR1
private boolean invertT1toR1 -
useWeights
private boolean useWeights -
uniformAngleSpacing
private boolean uniformAngleSpacing -
wList
The ordered list of images that the algorithm is dependent on. -
titles
The GUI list of images -
cAlgo
-
doConvTre
-
doHifiTre
-
hifiPanel
-
straightPanel
-
spgrPanel
-
convSpec
-
hifiSpec
-
treLong
-
spgrImageComboBoxAr
-
flipAngleAr
-
spgrRepTime
-
spgrNumFA
-
irspgrNum
-
isGEButton
-
isSiemensButton
-
irspgrTRField
-
irspgrFAField
-
numSlicesField
-
doubleInvRadio
-
singleInvRadio
-
t15Radio
-
t30Radio
-
smoothB1Box
-
irspgrCombo
-
irspgrField
-
inversionGroup
-
fieldStrengthGroup
-
leastSquaresCheck
-
convRepTime
-
convFAFieldAr
-
convimageComboAr
-
b1Field
-
maxT1Field
-
maxM0Field
-
showT1Map
-
showM0Map
-
showR1Map
-
showB1Check
-
tab
-
irspgrGeneralPanel
-
irspgrPanel
-
performTreT1withPreCalculatedB1Map
private boolean performTreT1withPreCalculatedB1Map -
performStraightTreT1
private boolean performStraightTreT1 -
performTreT1HIFI
private boolean performTreT1HIFI -
useB1Map
-
-
Constructor Details
-
JDialogTreT1
public JDialogTreT1()Blank constructor needed for dynamic instantiation. -
JDialogTreT1
Construct the TRE dialog.- Parameters:
theParentFrame- Parent frame.im- Source image.
-
-
Method Details
-
initParams
private void initParams() -
algorithmPerformed
Description copied from interface:AlgorithmInterfaceCalled after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase
-
buildHIFIPanel
-
buildConventionalTreT1Panel
-
buildSPGRPanel
-
buildSPGRPanelInner
-
buildIRSPGRPanel
-
buildIRSPGRPanelGEInner
-
buildIRSPGRPanelSiemensInner
-
buildTreT1LongPanel
-
buildTreT1LongPanelInner
-
buildTreT1SpecificsPanel
-
buildTreT1SpecificsPanelInner
-
buildTreT1HIFISpecificsPanel
-
buildTreT1HIFISpecificsPanelInner
-
callAlgorithm
protected void callAlgorithm()Description copied from class:JDialogScriptableBaseStarts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.- Specified by:
callAlgorithmin classJDialogScriptableBase
-
displayTotalDialog
protected void displayTotalDialog() -
setDialogWidthAdd
private void setDialogWidthAdd()Specifies an addendum to the preferred size of the dialog equal to the length of the longest image. -
doPostAlgorithmActions
protected void doPostAlgorithmActions()Store the result image in the script runner's image table now that the action execution is finished.- Overrides:
doPostAlgorithmActionsin classJDialogScriptableBase
-
setGUIFromParams
protected void setGUIFromParams()Description copied from class:JDialogScriptableBaseSet the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParamsin classJDialogScriptableBase
-
storeParamsFromGUI
Description copied from class:JDialogScriptableBaseRecord the parameters just used to run this algorithm in a script.- Specified by:
storeParamsFromGUIin classJDialogScriptableBase- Throws:
ParserException- If there is a problem creating/recording the new parameters.
-
buildConventionalTabs
private void buildConventionalTabs()This method builds the conventional tabs based on possibly pre-defined values. Each method places these tabs in containers to allow for nice display. -
buildHIFITabs
private void buildHIFITabs() -
run
private void run() -
setProcessConvUI
private void setProcessConvUI() -
setProcessHifiUI
private void setProcessHifiUI() -
setUI
Sets UI variables for either saving between processing steps or later reuse. When process is true, null values cause an issue to be returned, when process is false (indicating UI variables are just being transferred between processing steps), no action is taken for null values- Parameters:
process-- Returns:
-
validateUI
private boolean validateUI() -
createInputParameters
Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used insetGUIFromParams()).- Specified by:
createInputParametersin interfaceActionDiscovery- Returns:
- A parameter table listing the inputs of this algorithm.
-
createOutputParameters
Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).- Specified by:
createOutputParametersin interfaceActionDiscovery- Returns:
- A parameter table listing the outputs of this algorithm.
-
getActionMetadata
Return meta-information about this discoverable action for categorization and labeling purposes.- Specified by:
getActionMetadatain interfaceActionDiscovery- Returns:
- Metadata for this action.
-
getOutputImageName
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:
getOutputImageNamein 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:
isActionCompletein interfaceActionDiscovery- Returns:
- True, if the action is complete. False, if the action failed or is still running.
-