|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
ij.gui.GenericDialog
bunwarpj.MainDialog
public class MainDialog
Class to create the dialog for bUnwarpJ. It extends GenericDialog to allow the user interacting with the other windows.
| Nested Class Summary |
|---|
| 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 |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
ACCURATE_MODE
accurate mode constant |
private boolean |
bIsReverse
consistency flag (if false, unidirectional registration is done) |
private boolean |
bMacro
macro flag |
private boolean |
clearMask
Boolean for clearing mask |
private double |
consistencyWeight
consistency weight |
private java.awt.TextField |
consistencyWeightTextField
consistency weight text field |
private double |
curlWeight
curl weight |
private double |
divWeight
divergence weight |
static int |
FAST_MODE
fast mode constant |
private boolean |
finalActionLaunched
flag to see if the finalAction was launched |
private ij.ImagePlus[] |
imageList
List of available images in ImageJ |
private int |
imagePyramidDepth
maximum depth for the image pyramid |
private double |
imageWeight
image similarity weight |
private double |
landmarkWeight
landmarks weight |
private int |
max_scale_deformation
maximum scale deformation |
private int |
maxImageSubsamplingFactor
image subsampling factor at highest resolution level |
private java.awt.Choice |
maxScaleChoice
maximum scale choice |
private int |
min_scale_deformation
minimum scale deformation |
private int |
min_scale_image
minimum image scale |
private java.awt.Choice |
minScaleChoice
minimum scale choice |
private int |
mode
mode ("Accurate" by default) |
private java.awt.Choice |
modeChoice
accurate mode choice |
static int |
MONO_MODE
unidirectional ("mono") mode constant |
private ij.process.ImageProcessor |
originalSourceIP
initial source image processor |
private ij.process.ImageProcessor |
originalTargetIP
initial target image processor |
private ij.gui.Roi |
previousSourceRoi
region of interest of the source image before calling the plugin |
private ij.gui.Roi |
previousTargetRoi
region of interest of the target image before calling the plugin |
private java.awt.Scrollbar |
resamplingSlider
resampling scroll bar |
private java.awt.TextField |
resamplingTextField
resampling text field |
private boolean |
richOutput
flag for rich output (verbose option) |
private boolean |
saveTransformation
flag for save transformation option |
private BSplineModel |
source
Model for source image |
private double[][] |
sourceAffineMatrix
Initial affine matrix for the source image |
private java.awt.Choice |
sourceChoice
source image choice |
private int |
sourceChoiceIndex
index of the source choice |
private ij.gui.ImageCanvas |
sourceIc
Canvas of the source image |
private ij.ImagePlus |
sourceImp
Image representation for source image |
private Mask |
sourceMsk
Mask for source image |
private PointHandler |
sourcePh
Point handlers for the landmarks in the source image |
private boolean |
stopRegistration
flag to stop the registration |
private double |
stopThreshold
stopping threshold |
private BSplineModel |
target
Model for target image |
private double[][] |
targetAffineMatrix
Initial affine matrix for the target image |
private java.awt.Choice |
targetChoice
target image choice |
private int |
targetChoiceIndex
index of the target choice |
private ij.gui.ImageCanvas |
targetIc
Canvas of the target image |
private ij.ImagePlus |
targetImp
Image representation for target image |
private Mask |
targetMsk
Mask for target image |
private PointHandler |
targetPh
Point handlers for the landmarks in the target image |
private PointToolbar |
tb
Toolbar handler |
| Fields inherited from class ij.gui.GenericDialog |
|---|
checkbox, choice, defaultText, defaultValues, MAX_SLIDERS, numberField, slider, stringField, textArea1, textArea2, theLabel |
| Fields inherited from class java.awt.Dialog |
|---|
DEFAULT_MODALITY_TYPE |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
MainDialog(java.awt.Frame parentWindow,
ij.ImagePlus[] imageList,
int mode,
int maxImageSubsamplingFactor,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
boolean richOutput,
boolean saveTransformation)
Create a new instance of MainDialog. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
Actions to be taken during the dialog. |
private void |
addImageList(java.awt.Choice choice)
Add the image list to the list of choices. |
void |
applyRawTransformationToSource(double[][] transformation_x,
double[][] transformation_y)
Apply a raw transformation to the source image. |
void |
applyTransformationToSource(int intervals,
double[][] cx,
double[][] cy)
Apply the transformation defined by the spline coefficients to the source image. |
private void |
cancelSource()
Close all the variables related to the source image. |
private void |
cancelTarget()
Close all the variables related to the target image. |
private void |
computeImagePyramidDepth()
Compute the depth of the image resolution pyramid. |
private void |
createSourceImage(boolean bIsReverse)
Create the source image, i.e. |
private void |
createTargetImage()
Create target image. |
void |
freeMemory()
Free the memory used in the program. |
ij.process.ImageProcessor |
getOriginalSourceIP()
Get original source image process. |
ij.process.ImageProcessor |
getOriginalTargetIP()
Get original target image process. |
BSplineModel |
getSource()
Get source image model. |
double[][] |
getSourceAffineMatrix()
Get the source initial affine matrix. |
Mask |
getSourceMask()
Get source Mask. |
Mask |
getSourceMsk()
Get source point handler. |
PointHandler |
getSourcePh()
Get source point handler. |
BSplineModel |
getTarget()
Get target image model. |
double[][] |
getTargetAffineMatrix()
Get the target initial affine matrix. |
Mask |
getTargetMask()
Get target Mask. |
Mask |
getTargetMsk()
Get target point handler. |
PointHandler |
getTargetPh()
Get target point handler. |
void |
grayImage(PointHandler ph)
Method to color the area of the mask. |
boolean |
isClearMaskSet()
Get clearMask flag. |
boolean |
isFinalActionLaunched()
Get finalActionLaunched flag. |
boolean |
isMacroCall()
Get the macro flag |
boolean |
isSaveTransformationSet()
Get saveTransformation flag. |
boolean |
isStopRegistrationSet()
Get stopRegistration flag. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
Action to be taken when choices change. |
void |
joinThreads()
Join the threads for the source and target images. |
private void |
loadPointRoiAsLandmarks()
Load point rois in the source and target images as landmarks. |
private void |
permuteImages(boolean bIsReverse)
Permute the pointer for the target and source images. |
private void |
removePoints()
Remove the points from the points handlers of the source and target image. |
void |
repaintToolbar()
Repaint toolbar. |
private void |
restartModelThreads(boolean bIsReverse)
Re-launch the threads for the image models of the source and target. |
void |
restoreAll()
Restore the initial conditions. |
void |
setClearMask(boolean val)
Set the clearMask flag. |
void |
setFinalActionLaunched(boolean b)
Set final action launched flag. |
void |
setSaveTransformation(boolean b)
Set saveTransformation flag. |
private void |
setSecondaryPointHandlers()
Set the secondary point handlers. |
void |
setSourceAffineMatrix(double[][] affineMatrix)
Set source intial affine matrix. |
void |
setSourceMask(java.lang.String sFileName)
Set source Mask. |
void |
setStopRegistration()
Set the stopRegistration flag to true. |
void |
setToolbarAllUp()
Set toolbar tools all up. |
void |
showDialog()
Show main bUnwarpJ dialog |
private void |
stopSourceThread()
Stop the thread of the source image. |
private void |
stopTargetThread()
Stop the thread of the target image. |
void |
ungrayImage(PointAction pa)
Ungray image. |
void |
windowClosing(java.awt.event.WindowEvent e)
Actions to be taken when closing the dialog. |
| Methods inherited from class ij.gui.GenericDialog |
|---|
addCheckbox, addCheckboxGroup, addChoice, addDialogListener, addHelp, addMessage, addNumericField, addNumericField, addPanel, addPanel, addPreviewCheckbox, addPreviewCheckbox, addSlider, addStringField, addStringField, addTextAreas, adjustmentValueChanged, centerDialog, enableYesNoCancel, enableYesNoCancel, focusGained, focusLost, getButtons, getCheckboxes, getChoices, getErrorMessage, getInsets, getMessage, getNextBoolean, getNextChoice, getNextChoiceIndex, getNextNumber, getNextString, getNextText, getNumericFields, getPreviewCheckbox, getSliders, getStringFields, getTextArea1, getTextArea2, getValue, hideCancelButton, invalidNumber, keyPressed, keyReleased, keyTyped, paint, previewRunning, setEchoChar, setInsets, setOKLabel, setup, textValueChanged, wasCanceled, wasOKed, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int FAST_MODE
public static int ACCURATE_MODE
public static int MONO_MODE
private ij.ImagePlus[] imageList
private ij.gui.ImageCanvas sourceIc
private ij.gui.ImageCanvas targetIc
private ij.ImagePlus sourceImp
private ij.ImagePlus targetImp
private ij.process.ImageProcessor originalSourceIP
private ij.process.ImageProcessor originalTargetIP
private BSplineModel source
private BSplineModel target
private Mask sourceMsk
private Mask targetMsk
private double[][] sourceAffineMatrix
private double[][] targetAffineMatrix
private PointHandler sourcePh
private PointHandler targetPh
private boolean clearMask
private PointToolbar tb
private boolean finalActionLaunched
private boolean stopRegistration
private int sourceChoiceIndex
private int targetChoiceIndex
private int min_scale_deformation
private int max_scale_deformation
private int mode
private int maxImageSubsamplingFactor
private double divWeight
private double curlWeight
private double landmarkWeight
private double imageWeight
private double consistencyWeight
private boolean richOutput
private boolean saveTransformation
private int min_scale_image
private int imagePyramidDepth
private double stopThreshold
private boolean bIsReverse
private boolean bMacro
private ij.gui.Roi previousSourceRoi
private ij.gui.Roi previousTargetRoi
private java.awt.Choice sourceChoice
private java.awt.Choice targetChoice
private java.awt.Choice minScaleChoice
private java.awt.Choice maxScaleChoice
private java.awt.Choice modeChoice
private java.awt.TextField resamplingTextField
private java.awt.Scrollbar resamplingSlider
private java.awt.TextField consistencyWeightTextField
| Constructor Detail |
|---|
public MainDialog(java.awt.Frame parentWindow,
ij.ImagePlus[] imageList,
int mode,
int maxImageSubsamplingFactor,
int min_scale_deformation,
int max_scale_deformation,
double divWeight,
double curlWeight,
double landmarkWeight,
double imageWeight,
double consistencyWeight,
double stopThreshold,
boolean richOutput,
boolean saveTransformation)
parentWindow - pointer to the parent windowimageList - list of images from ImageJmode - default registration mode (0 = Fast, 1 = Accurate, 2 = Mono)maxImageSubsamplingFactor - subsampling factor at highest resolution levelmin_scale_deformation - default minimum scale deformation valuemax_scale_deformation - default maximum scale deformation valuedivWeight - default divergence weightcurlWeight - default curl weightlandmarkWeight - default landmarks weightimageWeight - default image similarity weightconsistencyWeight - default consistency weightstopThreshold - default stopping thresholdrichOutput - default verbose flagsaveTransformation - default save transformations flag| Method Detail |
|---|
public void setSourceMask(java.lang.String sFileName)
sFileName - source mask file namepublic void setSourceAffineMatrix(double[][] affineMatrix)
affineMatrix - initial affine matrixpublic Mask getSourceMask()
public Mask getTargetMask()
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class ij.gui.GenericDialogpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerwindowClosing in class ij.gui.GenericDialogpublic void showDialog()
showDialog in class ij.gui.GenericDialogpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListeneritemStateChanged in class ij.gui.GenericDialoge - item event
public void applyTransformationToSource(int intervals,
double[][] cx,
double[][] cy)
intervals - intervals in the deformationcx - b-spline X- coefficientscy - b-spline Y- coefficients
public void applyRawTransformationToSource(double[][] transformation_x,
double[][] transformation_y)
transformation_x - X- mappingtransformation_y - Y- mappingpublic void freeMemory()
public void grayImage(PointHandler ph)
ph - image point handlerpublic boolean isFinalActionLaunched()
public boolean isClearMaskSet()
public boolean isSaveTransformationSet()
public void setSaveTransformation(boolean b)
public boolean isStopRegistrationSet()
public void joinThreads()
public void restoreAll()
public void setClearMask(boolean val)
public void setStopRegistration()
public double[][] getSourceAffineMatrix()
public double[][] getTargetAffineMatrix()
public void ungrayImage(PointAction pa)
pa - point action pointerprivate void addImageList(java.awt.Choice choice)
choice - list of choicesprivate void cancelSource()
private void cancelTarget()
private void computeImagePyramidDepth()
private void createSourceImage(boolean bIsReverse)
bIsReverse - determines the transformation direction (source-target=TRUE or target-source=FALSE)private void createTargetImage()
private void loadPointRoiAsLandmarks()
private void permuteImages(boolean bIsReverse)
bIsReverse - determines the transformation direction (source-target=TRUE or target-source=FALSE)private void removePoints()
private void restartModelThreads(boolean bIsReverse)
bIsReverse - boolean variable to indicate the use of consistencyprivate void setSecondaryPointHandlers()
private void stopSourceThread()
private void stopTargetThread()
public PointHandler getSourcePh()
public PointHandler getTargetPh()
public Mask getSourceMsk()
public Mask getTargetMsk()
public void setFinalActionLaunched(boolean b)
public void setToolbarAllUp()
public void repaintToolbar()
public BSplineModel getTarget()
public ij.process.ImageProcessor getOriginalSourceIP()
public ij.process.ImageProcessor getOriginalTargetIP()
public BSplineModel getSource()
public boolean isMacroCall()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||