Class JDialogProstateImageCategorize

  • All Implemented Interfaces:
    AlgorithmInterface, DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogProstateImageCategorize
    extends JDialogBase
    implements AlgorithmInterface
    This class exhaustively trains the 2D slices based Active Appearance Model (AAM). For example, 100 3D prostate MRI images are converted to 2D slices atlas, each slice saved directory contains 100 2D slice images and corresponding VOIs. Based on the 2D slices and VOIs, this class performs shape based similarity measure between closed shape VOIs, sub-groups the image and VOIs, then apply the AAM training to each sub-group to generate the AAM model. The exhaustive search algorithm subdivides the atlas into smaller groups with a similar shape measure. After forming the smaller group, the search algorithm marks the relevant images and VOIs as visited, and iteratively searches the data in the atlas, terminating when no more similarity shapes can be found. AAM training follow the work of Stegmann et al. Cootes. et al. to create AAM model. M. B. Stegmann, B. K. Ersboll, and R. Larsen, "FAME-A Flexible Appearance Modeling Environment", IEEE Trans. Med. Imag., 22(10):1319-1331, October, 2003. T. F. Cootes, G. J. Edwards, and C. J. Taylor, "Active appearance models", Proc. Eur. Conf. Comput. Vis. 2:484-498, 1998.
    Author:
    Ruida Cheng
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  JDialogProstateImageCategorize.perImageCost
      NMI based image similarity measure cost class.
      (package private) class  JDialogProstateImageCategorize.perShapeCost
      Shape similarity measure cost class.
      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      ActionPerformed handler.
      void algorithmPerformed​(AlgorithmBase algorithm)
      empty function to implement the algorithm interface.
      private float area​(float[] xPts, float[] yPts, int nPts)
      Shape area computation
      private void categorizeByShape()
      Shape based similarity measure.
      private void categorizeByTexture()
      Texture bases similarity measure.
      private void counterClockwise​(float[] x, float[] y, float[] z, int nPts)  
      private void groupImages()
      Group images and exhaustively train the AAM model.
      void init()
      Dialog GUI interface initialization.
      static void pause()
      Pauses the display until the user hits enter.
      private void processDir​(java.io.File dir)
      Process the directory.
      private void readImagesAndVOIs()
      Read image and corresponding VOI.
      private void readImagesAndVOIsFromMid()
      Read image and VOIs start from the mid slice.
      private void readImagesAndVOIsInReverse()
      Read image and VOI in reverse order.
      private void readKeyImageDir()
      Read the key image director and generate image name and voi name vectors.
      private void selectGroupDir()
      Let user choose the Group trained model directory to save.
      private void sortImageVectorString​(java.util.Vector<java.lang.String> imageVector)
      Sort image vector in ascending order.
      private void sortVOIVectorString​(java.util.Vector<java.lang.String> voiVector)
      Sort VOI name vector in ascending order.
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • imageSelectionPanel

        private javax.swing.JPanel imageSelectionPanel
      • buttonPanel

        private javax.swing.JPanel buttonPanel
      • axisList

        private javax.swing.JComboBox axisList
        axis region
      • labelAxis

        private javax.swing.JLabel labelAxis
      • Axial

        private static int Axial
        axis orietation.
      • Saggital

        private static int Saggital
      • Coronal

        private static int Coronal
      • axis

        private int axis
      • labelKeyImage

        private javax.swing.JLabel labelKeyImage
        Key image related variables.
      • textFieldKeyImage

        private javax.swing.JTextField textFieldKeyImage
      • buttonKeyImage

        private javax.swing.JButton buttonKeyImage
      • labelGroup

        private javax.swing.JLabel labelGroup
        Save group directory.
      • textFieldGroup

        private javax.swing.JTextField textFieldGroup
      • buttonGroup

        private javax.swing.JButton buttonGroup
      • keyImageChooser

        private javax.swing.JFileChooser keyImageChooser
        key images variables.
      • keyImageName

        private java.lang.String keyImageName
      • keyImageDirectory

        private java.lang.String keyImageDirectory
      • imageVector

        private java.util.Vector<java.lang.String> imageVector
        image and voi string vector.
      • voiVector

        private java.util.Vector<java.lang.String> voiVector
      • groupChooser

        private javax.swing.JFileChooser groupChooser
        group variables.
      • groupName

        private java.lang.String groupName
      • groupDirectory

        private java.lang.String groupDirectory
      • sliceImages

        private java.util.Vector<ModelImage> sliceImages
        image vector.
      • imageVOIs

        private java.util.Vector<VOI[]> imageVOIs
        VOI vector.
      • groupIndex

        private int groupIndex
        group index.
    • Constructor Detail

      • JDialogProstateImageCategorize

        public JDialogProstateImageCategorize​(java.awt.Frame theParentFrame)
        Constructor
        Parameters:
        theParentFrame - parent frame reference.
    • Method Detail

      • algorithmPerformed

        public void algorithmPerformed​(AlgorithmBase algorithm)
        empty function to implement the algorithm interface.
        Specified by:
        algorithmPerformed in interface AlgorithmInterface
        Parameters:
        algorithm - the algorithm which has just completed
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        ActionPerformed handler.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
      • init

        public void init()
        Dialog GUI interface initialization.
      • readKeyImageDir

        private void readKeyImageDir()
        Read the key image director and generate image name and voi name vectors.
      • processDir

        private void processDir​(java.io.File dir)
        Process the directory.
        Parameters:
        dir -
      • sortImageVectorString

        private void sortImageVectorString​(java.util.Vector<java.lang.String> imageVector)
        Sort image vector in ascending order.
        Parameters:
        imageVector - image name vector.
      • sortVOIVectorString

        private void sortVOIVectorString​(java.util.Vector<java.lang.String> voiVector)
        Sort VOI name vector in ascending order.
        Parameters:
        voiVector -
      • selectGroupDir

        private void selectGroupDir()
        Let user choose the Group trained model directory to save.
      • groupImages

        private void groupImages()
        Group images and exhaustively train the AAM model.
      • area

        private float area​(float[] xPts,
                           float[] yPts,
                           int nPts)
        Shape area computation
        Parameters:
        xPts - VOI points x coordinate
        yPts - VOI points y coordinate
        nPts - number of VOI points.
        Returns:
      • categorizeByShape

        private void categorizeByShape()
        Shape based similarity measure. Exhaustive training.
      • pause

        public static void pause()
        Pauses the display until the user hits enter.
      • counterClockwise

        private void counterClockwise​(float[] x,
                                      float[] y,
                                      float[] z,
                                      int nPts)
      • categorizeByTexture

        private void categorizeByTexture()
        Texture bases similarity measure. Currently disabled.
      • readImagesAndVOIs

        private void readImagesAndVOIs()
        Read image and corresponding VOI.
      • readImagesAndVOIsInReverse

        private void readImagesAndVOIsInReverse()
        Read image and VOI in reverse order.
      • readImagesAndVOIsFromMid

        private void readImagesAndVOIsFromMid()
        Read image and VOIs start from the mid slice.