Package gov.nih.mipav.view.dialogs
Class JDialogRegistrationOAR2D
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.JDialogRegistrationOAR2D
- All Implemented Interfaces:
AlgorithmInterface,ScriptableActionInterface,DialogDefaultsInterface,ActionDiscovery,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
public class JDialogRegistrationOAR2D
extends JDialogScriptableBase
implements AlgorithmInterface, ActionDiscovery, ScriptableActionInterface
Dialog to get user input, then call AlgorithmRegOAR2D.
- Author:
- Neva Cherniavsky
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JDialogVariables for Advanced Settings dialog.private JCheckBoxCheckBox to turn brute-force registration on or off:.private JDialogDialog to set the brute-force registration parameters:.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private floatDOCUMENT ME!private JTextFieldDOCUMENT ME!private JComboBoxDOCUMENT ME!private JComboBoxDOCUMENT ME!private JComboBoxDOCUMENT ME!private JComboBoxDOCUMENT ME!private JComboBoxDOCUMENT ME!private JComboBoxprivate intDOCUMENT ME!private intprivate StringDOCUMENT ME!private StringDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private JCheckBoxCheckBox to turn color registration on or off:.private intDOCUMENT ME!private booleanprivate booleanprivate booleanDOCUMENT ME!private final intprivate StringDOCUMENT ME!private StringDOCUMENT ME!private floatprivate floatDOCUMENT ME!private JTextFieldDOCUMENT ME!private doubleprivate doubleprivate ModelImageDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private JCheckBoxDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private JLabelDOCUMENT ME!private final intprivate booleanIf true the dialog for this instance of JDialogRegistrationOAR2D will not activate the AlgorithmRegOAR2D:.private ModelImageDOCUMENT ME!private JComboBoxprivate Stringprivate JLabelprivate intDOCUMENT ME!private intDOCUMENT ME!private JTextFieldDOCUMENT ME!private JCheckBoxprivate final intprivate JRadioButtonDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private JTextFieldDOCUMENT ME!private JComboBoxprivate intTells 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 JLabelprivate final intprivate ModelImageDOCUMENT ME!private ModelImageDOCUMENT ME!private AlgorithmRegOAR2DDOCUMENT ME!private AlgorithmRegELSUNCOAR2Dprivate ModelImageDOCUMENT ME!private floatDOCUMENT ME!private JTextFieldDOCUMENT ME!private floatDOCUMENT ME!private JTextFieldDOCUMENT ME!private floatDOCUMENT ME!private JTextFieldBrute-force registration parameters:.private JCheckBoxDOCUMENT ME!private intDOCUMENT ME!private JTextFieldBrute-force registration parameters:.private intprivate static final longUse serialVersionUID for interoperability.private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JCheckBoxDOCUMENT ME!private intDOCUMENT ME!private JTextFieldBrute-force registration parameters:.private ViewUserInterfaceDOCUMENT ME!private JLabelprivate JTextFieldprivate JLabelprivate JTextFieldprivate JRadioButtonDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private JRadioButtonDOCUMENT ME!private floatDOCUMENT ME!private JTextFieldBrute-force registration parameters:.private floatDOCUMENT ME!private JTextFieldBrute-force registration parameters:.Fields 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
ConstructorsConstructorDescriptionEmpty constructor needed for dynamic instantiation (used during scripting).JDialogRegistrationOAR2D(Frame theParentFrame, ModelImage im) Creates new dialog for user to choose type of 2D image registration algorithm to run.JDialogRegistrationOAR2D(Frame theParentFrame, ModelImage ref, ModelImage match, int iCost, int iDOF, int iInterp, float fRotateBegin, float fRotateEnd, float fCoarseRate, float fFineRate, boolean bDoSubsample, int iMaxIterations, int iNumMin, int iInterp2, boolean bDisplayTransform, float fRotateBF, float fXScaleBF, float fYScaleBF, int iScaleStepsBF, int iTranslationBF) Creates new dialog for user to choose type of 2D image registration algorithm to run. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Closes dialog box when the OK button is pressed, sets the variables, and calls the algorithm.voidalgorithmPerformed(AlgorithmBase algorithm) This method is required if the AlgorithmPerformed interface is implemented.private JDialogbuildAdvancedDialog(int maxIter, int numMinima) Build advanced settings dialog.private JDialogBuilds the bruteForceDialog so the user can set the brute-force registration parameters:private JComboBoxbuildImgComboBox(ModelImage image) Builds a list of images.protected voidCalls the algorithm with the set-up parameters.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 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.booleanAccessor to get whether or not to do the brute-force registration.floatAccessor to get the coarse sample begin.floatAccessor to get the coarse sample end.floatAccessor to get the coarse sample rate.intAccessor to get the choice of cost function.booleanAccessor to get the display transform flag.intgetDOF()Accessor to get the degrees of freedom.floatAccessor to get the fine sample rate.intAccessor to get the initial interpolation.intAccessor to get the final interpolation.intAccessor to get maxIterations.intAccessor to get numMinima.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).Accessor to get the result image.floatAccessor to get the rotation range for brute force registration:intAccessor to get the y scale range for brute force registration:booleanAccessor to get whether or not subsampling occurs.intAccessor to get the translation range for brute force registration:floatAccessor to get the x scale range for brute force registration:floatAccessor to get the y scale range for brute force registration:private voidinit()Initializes the GUI components and displays the dialog.private voidInitializes the GUI components, based on the preset values set by the class calling the constructor.booleanReturns whether the action has successfully completed its execution.voiditemStateChanged(ItemEvent event) Changes the interpolation box to enabled or disabled depending on if the transform box is checked or not.voidsetCoarseBegin(float x) Accessor to set the coarse sample begin.voidsetCoarseEnd(float x) Accessor to set the coarse sample end.voidsetCoarseRate(float x) Accessor to set the coarse sample rate.voidsetCostChoice(int x) Accessor to set the choice of cost function.voidsetDisplayTransform(boolean flag) Accessor to set the display transform flag.voidsetDOF(int x) Accessor to set the degrees of freedom.voidsetFillValue(float fillValue) Accessor to set intensity value for out of bounds datavoidsetFineRate(float x) Accessor to set the fine sample rate.protected voidSet the dialog GUI using the script parameters while running this algorithm as part of a script.voidAccessor to set the input weight image.voidsetInterp(int x) Accessor to set the initial interpolation.voidsetInterp2(int x) Accessor to set the final interpolation.voidsetMatrixDirectory(String matrixDirectory) Accessor to set directory in which the matrix file is storedvoidsetMultiThread(boolean doMultiThread) Accessor to set whether or not powell's algorithm uses multithreadingvoidsetOutOfBoundsIndex(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 maxvoidAccessor to set the reference image.voidAccessor to set the reference weight image.voidsetSearchAlgorithm(int searchAlgorithm) voidsetSubsample(boolean doSubsample) Accessor to set whether or not subsampling occurs.private booleanSets the variables needed to call the registration algorithm based on the values entered in the dialog.voidsetVoisOnly(boolean flag) Accessor to set the VOIs only flag.voidsetWeighted(boolean flag) Accessor to set the weighted images flag.protected voidRecord the parameters just used to run this algorithm in a script.private booleantestType(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.Methods 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, 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
scriptRunMethods inherited from interface gov.nih.mipav.model.scripting.ScriptableActionInterface
insertScriptLine, scriptRun
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
POWELL
private final int POWELL- See Also:
-
ELSUNC
private final int ELSUNC- See Also:
-
LEVENBERG_MARQUARDT
private final int LEVENBERG_MARQUARDT- See Also:
-
NL2SOL
private final int NL2SOL- See Also:
-
searchAlgorithm
private int searchAlgorithm -
advancedDialog
Variables for Advanced Settings dialog. -
maxIterationsText
DOCUMENT ME! -
numMinText
DOCUMENT ME! -
bruteForceCheckBox
CheckBox to turn brute-force registration on or off:. -
bruteForceDialog
Dialog to set the brute-force registration parameters:. -
buttonWeightInput
DOCUMENT ME! -
buttonWeightRef
DOCUMENT ME! -
coarseRateText
DOCUMENT ME! -
comboBoxCostFunct
DOCUMENT ME! -
comboBoxSearchAlgo
-
comboBoxDOF
DOCUMENT ME! -
comboBoxImage
DOCUMENT ME! -
comboBoxInterp
DOCUMENT ME! -
comboBoxInterp2
DOCUMENT ME! -
cost
private int costDOCUMENT ME! -
interp
private int interpDOCUMENT ME! -
interp2
private int interp2DOCUMENT ME! -
DOF
private int DOFDOCUMENT ME! -
displayTransform
private boolean displayTransformDOCUMENT ME! -
doColor
private boolean doColorDOCUMENT ME! -
doColorCheckBox
CheckBox to turn color registration on or off:. -
doSubsample
private boolean doSubsampleDOCUMENT ME! -
doJTEM
private boolean doJTEM -
doMultiThread
private boolean doMultiThread -
fileNameWRef
DOCUMENT ME! -
directoryWRef
DOCUMENT ME! -
fileNameWInput
DOCUMENT ME! -
directoryWInput
DOCUMENT ME! -
fineRateText
DOCUMENT ME! -
inputWeightImage
DOCUMENT ME! -
refWeightImage
DOCUMENT ME! -
labelCoarse
DOCUMENT ME! -
labelCoarseDegrees
DOCUMENT ME! -
labelFine
DOCUMENT ME! -
labelFineDegrees
DOCUMENT ME! -
labelInterp2
DOCUMENT ME! -
labelRotateDegrees
DOCUMENT ME! -
labelRotateRange
DOCUMENT ME! -
labelRotateRangeTo
DOCUMENT ME! -
m_bSubsetDialog
private boolean m_bSubsetDialogIf true the dialog for this instance of JDialogRegistrationOAR2D will not activate the AlgorithmRegOAR2D:. -
matchImage
DOCUMENT ME! -
maxIterations_def
private int maxIterations_defDOCUMENT ME! -
numMinima_def
private int numMinima_defDOCUMENT ME! -
maxIterations
private int maxIterationsDOCUMENT ME! -
noneRadio
DOCUMENT ME! -
numMinima
private int numMinimaDOCUMENT ME! -
refImage
DOCUMENT ME! -
reg2
DOCUMENT ME! -
reg2E
-
resultImage
DOCUMENT ME! -
rotateBegin
private float rotateBeginDOCUMENT ME! -
rotateEnd
private float rotateEndDOCUMENT ME! -
coarseRate
private float coarseRateDOCUMENT ME! -
fineRate
private float fineRateDOCUMENT ME! -
rotateBeginText
DOCUMENT ME! -
rotateEndText
DOCUMENT ME! -
rotationBF
private float rotationBFDOCUMENT ME! -
xscaleBF
private float xscaleBFDOCUMENT ME! -
yscaleBF
private float yscaleBFDOCUMENT ME! -
rotationText
Brute-force registration parameters:. -
translationText
Brute-force registration parameters:. -
xscaleText
Brute-force registration parameters:. -
yscaleText
Brute-force registration parameters:. -
scaleStepsText
Brute-force registration parameters:. -
sampleCheckBox
DOCUMENT ME! -
jtemCheckBox
DOCUMENT ME! -
multiThreadCheckBox
-
scaleStepsBF
private int scaleStepsBFDOCUMENT ME! -
textInput
DOCUMENT ME! -
textRef
DOCUMENT ME! -
transformCheckbox
DOCUMENT ME! -
translationBF
private int translationBFDOCUMENT ME! -
UI
DOCUMENT ME! -
voiRadio
DOCUMENT ME! -
voisOnly
private boolean voisOnlyDOCUMENT ME! -
weighted
private boolean weightedDOCUMENT ME! -
weightRadio
DOCUMENT ME! -
outOfBoundsLabel
-
outOfBoundsComboBox
-
valueLabel
-
valueText
-
imageMin
private double imageMin -
imageMax
private double imageMax -
dataType
private int dataType -
outOfBoundsIndex
private int outOfBoundsIndexTells 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 -
fillValue
private float fillValue -
matrixLabel
-
matrixComboBox
-
matrixDirectory
-
userDirectoryLabel
-
userDirectoryText
-
-
Constructor Details
-
JDialogRegistrationOAR2D
public JDialogRegistrationOAR2D()Empty constructor needed for dynamic instantiation (used during scripting). -
JDialogRegistrationOAR2D
Creates new dialog for user to choose type of 2D image registration algorithm to run.- Parameters:
theParentFrame- Parent frame.im- Source image.
-
JDialogRegistrationOAR2D
public JDialogRegistrationOAR2D(Frame theParentFrame, ModelImage ref, ModelImage match, int iCost, int iDOF, int iInterp, float fRotateBegin, float fRotateEnd, float fCoarseRate, float fFineRate, boolean bDoSubsample, int iMaxIterations, int iNumMin, int iInterp2, boolean bDisplayTransform, float fRotateBF, float fXScaleBF, float fYScaleBF, int iScaleStepsBF, int iTranslationBF) Creates new dialog for user to choose type of 2D image registration algorithm to run.- Parameters:
theParentFrame- Parent frame.ref- Reference image.match- Match image.iCost- default cost choice.iDOF- default degrees of freedom choice.iInterp- default image interpolation choice.fRotateBegin- default rotation range choice.fRotateEnd- default rotation range choice.fCoarseRate- default rotation coarse rate choice.fFineRate- default rotation fine rate choice.bDoSubsample- default subsampling choice.iMaxIterations- default max iterations choice.iNumMin- default number of minima choice.iInterp2- default display interpolation choice.bDisplayTransform- default display transformed image choice.fRotateBF- default rotation angle range for brute-force registration.fXScaleBF- default scale in x range for brute-force registration.fYScaleBF- default scale in x range for brute-force registration.iScaleStepsBF- default number of steps to divide scale range brute-force registration.iTranslationBF- default translation range for brute-force registration.
-
-
Method Details
-
actionPerformed
Closes dialog box when the OK button is pressed, sets the variables, and calls the algorithm.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggers function.
-
algorithmPerformed
This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to complete.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- Algorithm that caused the event.
-
getBruteForce
public boolean getBruteForce()Accessor to get whether or not to do the brute-force registration.- Returns:
- bruteForceCheckBox.isSelected()
-
getCoarseBegin
public float getCoarseBegin()Accessor to get the coarse sample begin.- Returns:
- rotateBegon Coarse begin
-
getCoarseEnd
public float getCoarseEnd()Accessor to get the coarse sample end.- Returns:
- rotateEnd Coarse end
-
getCoarseRate
public float getCoarseRate()Accessor to get the coarse sample rate.- Returns:
- coarseRate, Coarse rate
-
getCostChoice
public int getCostChoice()Accessor to get the choice of cost function.- Returns:
- cost, Cost function.
-
getDisplayTransform
public boolean getDisplayTransform()Accessor to get the display transform flag.- Returns:
- displayTransform flag
truemeans display the transformed image.
-
getDOF
public int getDOF()Accessor to get the degrees of freedom.- Returns:
- DOF, Degrees of freedom
-
getFineRate
public float getFineRate()Accessor to get the fine sample rate.- Returns:
- fineRate, Fine rate
-
getInterp
public int getInterp()Accessor to get the initial interpolation.- Returns:
- interp, Interpolation
-
getInterp2
public int getInterp2()Accessor to get the final interpolation.- Returns:
- interp2, Interpolation
-
getMaxIterations
public int getMaxIterations()Accessor to get maxIterations.- Returns:
- maxIterations
-
getNumMinima
public int getNumMinima()Accessor to get numMinima.- Returns:
- numMinima
-
getResultImage
Accessor to get the result image.- Returns:
- Result image.
-
getRotationBruteForce
public float getRotationBruteForce()Accessor to get the rotation range for brute force registration:- Returns:
- rotationBF, range of rotations
-
getScaleStepsBruteForce
public int getScaleStepsBruteForce()Accessor to get the y scale range for brute force registration:- Returns:
- scaleStepsBF, number of divisions for scale
-
getSubsample
public boolean getSubsample()Accessor to get whether or not subsampling occurs.- Returns:
- doSubsample
-
getTranslationBruteForce
public int getTranslationBruteForce()Accessor to get the translation range for brute force registration:- Returns:
- translationBF, range of x,y translations
-
getXScaleBruteForce
public float getXScaleBruteForce()Accessor to get the x scale range for brute force registration:- Returns:
- xscaleBF, range of scales in x
-
getYScaleBruteForce
public float getYScaleBruteForce()Accessor to get the y scale range for brute force registration:- Returns:
- yscaleBF, range of scales in y
-
itemStateChanged
Changes the interpolation box to enabled or disabled depending on if the transform box is checked or not.- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classJDialogBase- Parameters:
event- Event that triggered this function.
-
setCoarseBegin
public void setCoarseBegin(float x) Accessor to set the coarse sample begin.- Parameters:
x- Coarse begin
-
setCoarseEnd
public void setCoarseEnd(float x) Accessor to set the coarse sample end.- Parameters:
x- Coarse end
-
setCoarseRate
public void setCoarseRate(float x) Accessor to set the coarse sample rate.- Parameters:
x- Coarse rate
-
setCostChoice
public void setCostChoice(int x) Accessor to set the choice of cost function.- Parameters:
x- Cost function.
-
setDisplayTransform
public void setDisplayTransform(boolean flag) Accessor to set the display transform flag.- Parameters:
flag-truemeans display the transformed image.
-
setDOF
public void setDOF(int x) Accessor to set the degrees of freedom.- Parameters:
x- Degrees of freedom
-
setFineRate
public void setFineRate(float x) Accessor to set the fine sample rate.- Parameters:
x- Fine rate
-
setInputWeightImage
Accessor to set the input weight image.- Parameters:
im- Input weight image.
-
setInterp
public void setInterp(int x) Accessor to set the initial interpolation.- Parameters:
x- Interpolation
-
setInterp2
public void setInterp2(int x) Accessor to set the final interpolation.- Parameters:
x- Interpolation
-
setReferenceImage
Accessor to set the reference image.- Parameters:
im- Reference image.
-
setReferenceWeightImage
Accessor to set the reference weight image.- Parameters:
im- Reference weight image.
-
setSubsample
public void setSubsample(boolean doSubsample) Accessor to set whether or not subsampling occurs.- Parameters:
doSubsample- DOCUMENT ME!
-
setSearchAlgorithm
public void setSearchAlgorithm(int searchAlgorithm) - Parameters:
searchAlgorithm-
-
setMultiThread
public void setMultiThread(boolean doMultiThread) Accessor to set whether or not powell's algorithm uses multithreading- Parameters:
doMultiThread-
-
setVoisOnly
public void setVoisOnly(boolean flag) Accessor to set the VOIs only flag.- Parameters:
flag-truethen only register the parts of the images in the VOIs.
-
setWeighted
public void setWeighted(boolean flag) Accessor to set the weighted images flag.- Parameters:
flag-truemeans there are weighted images.
-
setOutOfBoundsIndex
public void setOutOfBoundsIndex(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 max- Parameters:
outOfBoundsIndex-
-
setFillValue
public void setFillValue(float fillValue) Accessor to set intensity value for out of bounds data- Parameters:
fillValue-
-
setMatrixDirectory
Accessor to set directory in which the matrix file is stored- Parameters:
matrixDirectory-
-
callAlgorithm
protected void callAlgorithm()Calls the algorithm with the set-up parameters.- Specified by:
callAlgorithmin classJDialogScriptableBase
-
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()Set the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParamsin classJDialogScriptableBase
-
storeParamsFromGUI
Record 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.
-
buildAdvancedDialog
Build advanced settings dialog. Returns JDialog.- Parameters:
maxIter- DOCUMENT ME!numMinima- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildBruteForceDialog
Builds the bruteForceDialog so the user can set the brute-force registration parameters:- Returns:
- bruteForceDialog
-
buildImgComboBox
Builds a list of images. Returns combobox.- Parameters:
image- DOCUMENT ME!- Returns:
- Newly created combo box.
-
init
private void init()Initializes the GUI components and displays the dialog. -
initPresets
private void initPresets()Initializes the GUI components, based on the preset values set by the class calling the constructor. Then displays the dialog. -
setVariables
private boolean setVariables()Sets the variables needed to call the registration algorithm based on the values entered in the dialog.- Returns:
trueif the variables are properly set,falseotherwise.
-
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
Return meta-information about this discoverable action for categorization and labeling purposes.- Specified by:
getActionMetadatain interfaceActionDiscovery- Returns:
- Metadata for this action.
-
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.
-
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.
-