Package gov.nih.mipav.view.dialogs
Class JFrameRegistrationMosaic
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
gov.nih.mipav.view.dialogs.JFrameRegistrationMosaic
- All Implemented Interfaces:
AlgorithmInterface,ActionListener,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
public class JFrameRegistrationMosaic
extends JFrame
implements ActionListener, MouseListener, MouseMotionListener, AlgorithmInterface
JFrameRegistrationMosaic is a window/gui that enables the user to manually align two images with the mouse and then
call the AlgorithmRegOAR2D registration algorithm to create a mosaic image with the two aligned images. Multiple
images can be added to the mosaic and aligned one at a time.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested 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 boolean[][]For masking, set to true if the reference image is written into the same location:.private boolean[][]backup:.private javax.media.j3d.Shape3D[]Backup shape for Undo:.private ModelImage[]Backup Image for Undo:.private javax.media.j3d.Shape3D[]Backup shape for Undo:.private javax.media.j3d.TransformGroup[]Backup Transform for Undo:.private javax.media.j3d.Shape3D[]Reference to the border shape data structure for changing the color based on which image is selected:.private ModelImage[]Reference to the model images:.private javax.media.j3d.TransformGroup[]Reference and tile image transformations:.private javax.media.j3d.Shape3D[]Reference to the texture-mapped polygon on which the image is displayed:.private booleanBrute force default is off:.private booleanDisplay transfromed image in separate window: set to false (no display).private booleanprivate booleanDefault subsample set to true:.private booleanBoolean to check that a file is loaded before mouse operations are allowed to occur.private booleanFor blending the reference and tile images, reference image is not blended with background, reset when initData() is called.private booleanTo reset m_kReferenceAlpha:.private booleanTrue when scale factor should be used:.private floatDefault rotation coarse rate, set to 2 degrees:.private floatDefault rotation fine rate, set to 1 degree:.private floatDefault rotation start, set to negative 5 degrees:.private floatDefault rotation end, set to postive 5 degrees:.private floatdefault rotation range (0).private floatScale factor for large images:.private floatdefault x scale range (0).private floatdefault y scale range (0).private intDefault cost function, set to correlation ratio (smoothed, weighted):.private intDefault degrees of freedom:.private intDefault image interpolation, set to be bilinear interpolation:.private intDefault interpolation for the transform algorithm:.private intDefault number of iteration set to 2:.private intDefault number of minima to test from level 8 at level 4 (set to 3):.private intindex of the non-selected image:.private intBackup of the open index:.private intIndex of the reference image:.private intBackup of the reference index:.private intdefault number of divisions for scale optimazation:.private intindex of the selected image:private intIndex of the tile image:.private intdefault x,y translation range (0).private intx,y positions of the mouse when one of the mouse buttons is pressed:.private intx,y positions of the mouse when one of the mouse buttons is pressed:.private JButtonLaunches the JDialogRegistrationOAR2D dialog to set registration options:.private javax.media.j3d.Canvas3DDrawing canvas:.private JButtonClose all images and remove them from the scene:.private javax.media.j3d.Transform3Dcurrent transformation based on mouseDragged event:.private JButtonOpen the mosaic image help.private MouseEventReference to the mousePressed event:.private javax.media.j3d.Transform3DAccumulated transformation prior to current mouseDrag:.private JButtonOpen reference image:.private JButtonOpen tile image:.private ModelImageFor blending between refernce and transformed tile images:.private ModelImageFor blending between refernce and transformed tile images:.private JButtonInitialize and start the registration based on how the user positioned the two images:.private JButtonSave the mosaic image:.private javax.media.j3d.BranchGroupScene graph root node:.private ModelImageFor blending between refernce and transformed tile images:.private JButtonToggle which image is currently selected:.private JButtonUndo the last registration for the mosaic image:.private com.sun.j3d.utils.universe.SimpleUniverseSimpleUniverse:.private static final longUse serialVersionUID for interoperability.Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields 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
ConstructorsConstructorDescriptionJFrameRegistrationMosaic - Creates new window for manual (mouse-based) registration of two images. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) actionPerformed - JButton events:voidalgorithmPerformed(AlgorithmBase kAlgorithm) algorithmPerformed - when the alignment algorithm finishes, the transformed tile is blended with the reference image and displayed:private voidbackupMosaic -- Backs up the reference invalid input: '&' tile polygon shapes, borders, ModelImages, and TransformGroups before the registration is called, so that registration can be undone by the user:private voidcloseAllImages(boolean bResetAlpha) closeAllImages -- clears the scenegraph of all displayed images and deletes references to the images:private javax.media.j3d.Canvas3DcreateCanvas(JPanel kPanel) createCanvas - Creates the Canvas3D for rendering the images.private booleancreateMosaicOpenDialog(boolean bSave) createMosaicOpenDialog - Creates a file open dialog for image files (.jpg, tiff, etc.).private voidcreateTexturedPolygon(javax.media.j3d.TransformGroup kTransformGroup, BufferedImage kImage, int iWidth, int iHeight, int iWidthPow2, int iHeightPow2) createTexturedPolygon - Creates a texture-mapped polygon with the BufferedImage displayed as the texture.voiddispose()dispose - Removes member variables.voidgetVariablesFromDialog(JDialogRegistrationOAR2D kOptionsDialog, boolean bCallAlgorithm) Called from inside the JDialogRegistrationOAR2D class when the user has set the parameters and closes the dialog.private voidinitData()initData -- Initializes the selected, open, reference and tile indexes.private voidinitGUI()initGUI - Initializes GUI toolbar and buttons and displays the registration window.voidmouseClicked.voidmouseDragged.voidmouseEntered.voidmouseExited.voidmouseMoved.voidmousePressed(MouseEvent kMouseEvent) mousePressed, store the current transformation for the selected image so the new transformations calculated in the mouseDragged function can be concatenated onto the current transform.voidmouseReleased.private booleanregisterImages - Registers the reference and tile images based on the how the user positions the images with the mouse.private voidprivate booleansaveMosaic -- Opens a save dialog and saves the mosaic image in the selected file format.private voidstoreImage(ModelImage kImage) storeImage - creates a BufferedImage from the ModelImage data where the BufferedImage's size is the next-largest power of two from the ModelImage size.private voidtoggleSelectedImage - Toggles which image is currently selected.private voidundoMosaic -- Restores the backed-up ImageTransforms, PolygonShapes, BorderShapes, and ModelImages after an undo button press:Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, 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, 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 java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
m_aabReference
private boolean[][] m_aabReferenceFor masking, set to true if the reference image is written into the same location:. -
m_aabReferenceBackup
private boolean[][] m_aabReferenceBackupbackup:. -
m_akBackupBorders
private javax.media.j3d.Shape3D[] m_akBackupBordersBackup shape for Undo:. -
m_akBackupImages
Backup Image for Undo:. -
m_akBackupPolygons
private javax.media.j3d.Shape3D[] m_akBackupPolygonsBackup shape for Undo:. -
m_akBackupTG
private javax.media.j3d.TransformGroup[] m_akBackupTGBackup Transform for Undo:. -
m_akBorderShapes
private javax.media.j3d.Shape3D[] m_akBorderShapesReference to the border shape data structure for changing the color based on which image is selected:. -
m_akImages
Reference to the model images:. -
m_akImageTransforms
private javax.media.j3d.TransformGroup[] m_akImageTransformsReference and tile image transformations:. -
m_akPolygonShapes
private javax.media.j3d.Shape3D[] m_akPolygonShapesReference to the texture-mapped polygon on which the image is displayed:. -
m_bBruteForce
private boolean m_bBruteForceBrute force default is off:. -
m_bDisplayTransform
private boolean m_bDisplayTransformDisplay transfromed image in separate window: set to false (no display). -
m_bDoSubsample
private boolean m_bDoSubsampleDefault subsample set to true:. -
m_bDoMultiThread
private boolean m_bDoMultiThread -
m_bFileLoaded
private boolean m_bFileLoadedBoolean to check that a file is loaded before mouse operations are allowed to occur. -
m_bFirst
private boolean m_bFirstFor blending the reference and tile images, reference image is not blended with background, reset when initData() is called. -
m_bResetAlpha
private boolean m_bResetAlphaTo reset m_kReferenceAlpha:. -
m_bSetScale
private boolean m_bSetScaleTrue when scale factor should be used:. -
m_fCoarseRate
private float m_fCoarseRateDefault rotation coarse rate, set to 2 degrees:. -
m_fFineRate
private float m_fFineRateDefault rotation fine rate, set to 1 degree:. -
m_fRotateBegin
private float m_fRotateBeginDefault rotation start, set to negative 5 degrees:. -
m_fRotateEnd
private float m_fRotateEndDefault rotation end, set to postive 5 degrees:. -
m_fRotationRange
private float m_fRotationRangedefault rotation range (0). -
m_fScale
private float m_fScaleScale factor for large images:. -
m_fXScaleRange
private float m_fXScaleRangedefault x scale range (0). -
m_fYScaleRange
private float m_fYScaleRangedefault y scale range (0). -
m_iCost
private int m_iCostDefault cost function, set to correlation ratio (smoothed, weighted):. -
m_iDOF
private int m_iDOFDefault degrees of freedom:. -
m_iInterp
private int m_iInterpDefault image interpolation, set to be bilinear interpolation:. -
m_iInterp2
private int m_iInterp2Default interpolation for the transform algorithm:. -
m_iMaxIterations
private int m_iMaxIterationsDefault number of iteration set to 2:. -
m_iNumMinima
private int m_iNumMinimaDefault number of minima to test from level 8 at level 4 (set to 3):. -
m_iOpen
private int m_iOpenindex of the non-selected image:. -
m_iOpenSave
private int m_iOpenSaveBackup of the open index:. -
m_iReference
private int m_iReferenceIndex of the reference image:. -
m_iReferenceSave
private int m_iReferenceSaveBackup of the reference index:. -
m_iScaleSteps
private int m_iScaleStepsdefault number of divisions for scale optimazation:. -
m_iSelected
private int m_iSelectedindex of the selected image: -
m_iTile
private int m_iTileIndex of the tile image:. -
m_iTranslationRange
private int m_iTranslationRangedefault x,y translation range (0). -
m_iXClick
private int m_iXClickx,y positions of the mouse when one of the mouse buttons is pressed:. -
m_iYClick
private int m_iYClickx,y positions of the mouse when one of the mouse buttons is pressed:. -
m_kAdvancedOptionsButton
Launches the JDialogRegistrationOAR2D dialog to set registration options:. -
m_kCanvas
private javax.media.j3d.Canvas3D m_kCanvasDrawing canvas:. -
m_kCloseAllButton
Close all images and remove them from the scene:. -
m_kCurrentTransform
private javax.media.j3d.Transform3D m_kCurrentTransformcurrent transformation based on mouseDragged event:. -
m_kMouseEvent
Reference to the mousePressed event:. -
m_kOldTransform
private javax.media.j3d.Transform3D m_kOldTransformAccumulated transformation prior to current mouseDrag:. -
m_kOpenReferenceButton
Open reference image:. -
m_kOpenTileButton
Open tile image:. -
m_kReferenceAlpha
For blending between refernce and transformed tile images:. -
m_kReferenceAlphaBackup
For blending between refernce and transformed tile images:. -
m_kRegisterButton
Initialize and start the registration based on how the user positioned the two images:. -
m_kSaveButton
Save the mosaic image:. -
m_kHelpButton
Open the mosaic image help. -
m_kScene
private javax.media.j3d.BranchGroup m_kSceneScene graph root node:. -
m_kTileAlpha
For blending between refernce and transformed tile images:. -
m_kToggleSelectedButton
Toggle which image is currently selected:. -
m_kUndoButton
Undo the last registration for the mosaic image:. -
m_kUniverse
private com.sun.j3d.utils.universe.SimpleUniverse m_kUniverseSimpleUniverse:.
-
-
Constructor Details
-
JFrameRegistrationMosaic
public JFrameRegistrationMosaic()JFrameRegistrationMosaic - Creates new window for manual (mouse-based) registration of two images.
-
-
Method Details
-
actionPerformed
actionPerformed - JButton events:- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- button event
-
repaintButtons
private void repaintButtons() -
algorithmPerformed
algorithmPerformed - when the alignment algorithm finishes, the transformed tile is blended with the reference image and displayed:- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
kAlgorithm- AlgorithmBase
-
dispose
public void dispose()dispose - Removes member variables. -
getVariablesFromDialog
Called from inside the JDialogRegistrationOAR2D class when the user has set the parameters and closes the dialog.- Parameters:
kOptionsDialog- the JDialogRegistrationOAR2D object containing the updated registration parametersbCallAlgorithm- boolean when true this function activates the registration algorithm, when false, the user must then press the "register images" button to register.
-
mouseClicked
mouseClicked.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- MouseEvent
-
mouseDragged
mouseDragged.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- MouseEvent
-
mouseEntered
mouseEntered.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e- MouseEvent
-
mouseExited
mouseExited.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e- MouseEvent
-
mouseMoved
mouseMoved.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
e- MouseEvent
-
mousePressed
mousePressed, store the current transformation for the selected image so the new transformations calculated in the mouseDragged function can be concatenated onto the current transform.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
kMouseEvent- MouseEvent
-
mouseReleased
mouseReleased.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- MouseEvent
-
backupMosaic
private void backupMosaic()backupMosaic -- Backs up the reference invalid input: '&' tile polygon shapes, borders, ModelImages, and TransformGroups before the registration is called, so that registration can be undone by the user: -
closeAllImages
private void closeAllImages(boolean bResetAlpha) closeAllImages -- clears the scenegraph of all displayed images and deletes references to the images:- Parameters:
bResetAlpha- true if all images are closed, false if a new mosaic is created
-
createCanvas
createCanvas - Creates the Canvas3D for rendering the images.- Parameters:
kPanel- the JPanel that contains the Canvas3D in the frame- Returns:
- Canvas3D the new canvas
-
createMosaicOpenDialog
private boolean createMosaicOpenDialog(boolean bSave) createMosaicOpenDialog - Creates a file open dialog for image files (.jpg, tiff, etc.). If a new file is opened it is mapped onto a polygon and placed in the scene graph:- Parameters:
bSave- open file for saving (true) or open file for reading (false)- Returns:
- boolean, success or failure for the file open
-
createTexturedPolygon
private void createTexturedPolygon(javax.media.j3d.TransformGroup kTransformGroup, BufferedImage kImage, int iWidth, int iHeight, int iWidthPow2, int iHeightPow2) createTexturedPolygon - Creates a texture-mapped polygon with the BufferedImage displayed as the texture. The texture-mapped polygon is created so that the displayed texture and size of the polygon match the size in pixels of the original image loaded from file -- even when the original image size is not a power of two. The displayed image must match the original data image so that the registration is accurate.- Parameters:
kTransformGroup- the TransformGroup which will contain the new textured polygon in the scene graphkImage- the BufferedImage, power or two size image, padded if necessary, containing the original image data.iWidth- the original image widthiHeight- the original image heightiWidthPow2- the next-largest power of two widthiHeightPow2- the next-largest power of two height
-
initData
private void initData()initData -- Initializes the selected, open, reference and tile indexes. Called on startup and after a closeAllImages() -
initGUI
private void initGUI()initGUI - Initializes GUI toolbar and buttons and displays the registration window. -
registerImages
private boolean registerImages()registerImages - Registers the reference and tile images based on the how the user positions the images with the mouse. Two new registered images are created, each containing one registered sub-image. The AlgorithmRegOAR2D is then called on the two new registered images, to better refine the registration. Upon completion of the registration algorithm, a new mosaic image is created.- Returns:
- boolean, sucess/failure of registeration
-
saveMosaic
private boolean saveMosaic()saveMosaic -- Opens a save dialog and saves the mosaic image in the selected file format.- Returns:
- boolean, sucess/failure of file save
-
storeImage
storeImage - creates a BufferedImage from the ModelImage data where the BufferedImage's size is the next-largest power of two from the ModelImage size. The BufferedImage is then passed to the createTexturedPolygon function for display in the scene graph.- Parameters:
kImage- the input ModelImage containing the image data.
-
toggleSelectedImage
private void toggleSelectedImage()toggleSelectedImage - Toggles which image is currently selected. Changes the color of the image borders. -
undoMosaic
private void undoMosaic()undoMosaic -- Restores the backed-up ImageTransforms, PolygonShapes, BorderShapes, and ModelImages after an undo button press:
-