Class JDialogProstateExtractCEFeature
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.renderer.WildMagic.ProstateFramework.JDialogProstateExtractCEFeature
- All Implemented Interfaces:
AlgorithmInterface,DialogDefaultsInterface,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
After the 3D images convert to 2D slices ( 512x512 ), this class picks the 2D
slices, extracts the Coherence Enhanced diffusion based features, and saves
those features with linear SVM readable file formats. User specifies the 2D
slices saved directory as input, and the same directory as the output. The
class automatically apply the following steps, 1) picks those slices, cropped
region according to central prostate gland. 2) apply Coherence Enhanced filter to
each cropped slice. 3) Save the Hurst index and Haralick features of each 2D
slice to corresponding directory.
Those saved CE features will be used to create linear SVM models. Also, for test
cases, this class functions as the pre-processing steps to save CE features before
automatic segmentation.
- Author:
- Ruida Cheng
- 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 static intprivate intprivate JComboBoxaxis region.private intprivate intprivate intcropped image boundary.private intcropped image boundary.private JButtonprivate JButtonprivate booleanCoherence Enhancing Diffusion filter.private static intprivate AlgorithmAddMarginscrop image algorithmprivate Vector<ModelImage> cropped key image, crop from 512x512 to central prostate gland region.private Vector<Vector<ModelImage>> cropped CE image vector.static final Stringprivate booleangabor filter.private booleangussian filter.private booleangradient magnitude filter.private intHaralick feature numbers.private booleanharalick filter.private booleanHurst index.private booleanInhomogeneity N3 correction.private booleanimage intensity.private JPanel2D slices image selection panel.private booleanHaralick invert filter.private JFileChooser2D slice images file chooser.private String2D slices image directory.private Vector<ModelImage> key images vector.key images names vector.key image VOIs vector.key image VOI names vector.private JLabelprivate JLabel2D Slices key image directory.private JLabelSave features directory.private booleanHaralick mean filter.private booleanHaralick median filter.private booleanHaralick mode filter.static final Stringprivate intnumber features being saved.private JRadioButtonSVM option button.private JRadioButtonprivate booleanAnisotropic Diffusion filter.private static intprivate JFileChooserSaved features directory.private Stringprivate static final longprivate booleanflag to indicate is SVM training with binary class or multi-class.private JTextFieldprivate JTextFieldAlgorithm to save Hurst index and Haralick features.private ViewUserInterfaceThe main user interface.private intwavelet feature number.private booleanWavelet filter.private int[]x dimension boundsprivate int[]y dimension boundprivate int[]z dimension boundFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Action performed handler for this dialog.voidalgorithmPerformed(AlgorithmBase algorithm) This method is required if the AlgorithmPerformed interface is implemented.voidBuild the panel.private voidFrom the cropped images, apply Coherence Enhanced Diffusion filter to each 2D slices.private voidCalculate number of features being saved.voidDriver to do automatic feature extraction.voidCrop the central prostate gland region from the 512x512 slices.voiddispose memory.voidExtract CE features.voidinit()Dialog GUI initialization.voiddebuger for file names read.private voidprocessDir(File dir) Process directory, save the image names and voi names.voidread 2D slices directory.private voidRead 2D slices.private voidRecord the save 2D slice features directory.Features[]saveFeatureSpaceValue(ModelImage resultImage, ModelImage classificationImage, ModelImage keyImage, ModelImage srcImage, int sliceNumber) Save CE features to user specified directory.private voidTraverse the 2D slices directory.Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
UI
The main user interface. -
radioButtonSVMBinary
SVM option button. -
radioButtonSVMMulticlass
-
svmTrainingBinary
private boolean svmTrainingBinaryflag to indicate is SVM training with binary class or multi-class. -
boxYmin
private int boxYmincropped image boundary. -
boxYmax
private int boxYmaxcropped image boundary. -
boxXmin
private int boxXmin -
boxXmax
private int boxXmax -
xBounds
private int[] xBoundsx dimension bounds -
yBounds
private int[] yBoundsy dimension bound -
zBounds
private int[] zBoundsz dimension bound -
cropAlgo
crop image algorithm -
textureAlgo
Algorithm to save Hurst index and Haralick features. -
imageIntensityFilter
private boolean imageIntensityFilterimage intensity. -
coherenceEnhancingDiffusionFilter
private boolean coherenceEnhancingDiffusionFilterCoherence Enhancing Diffusion filter. -
regisotropicDiffusionFilter
private boolean regisotropicDiffusionFilterAnisotropic Diffusion filter. -
IHN3CorrectionFilter
private boolean IHN3CorrectionFilterInhomogeneity N3 correction. -
modeFilter
private boolean modeFilterHaralick mode filter. -
meanFilter
private boolean meanFilterHaralick mean filter. -
medianFilter
private boolean medianFilterHaralick median filter. -
invertFilter
private boolean invertFilterHaralick invert filter. -
haralickFilter
private boolean haralickFilterharalick filter. -
gaborFilter
private boolean gaborFiltergabor filter. -
hurstFilter
private boolean hurstFilterHurst index. -
waveletFilter
private boolean waveletFilterWavelet filter. -
gaussianFilter
private boolean gaussianFiltergussian filter. -
gmFilter
private boolean gmFiltergradient magnitude filter. -
numberFeatures
private int numberFeaturesnumber features being saved. -
haralickFeatureNumber
private int haralickFeatureNumberHaralick feature numbers. -
labelKeyImage
2D Slices key image directory. -
textFieldKeyImage
-
buttonKeyImage
-
imageSelectionPanel
2D slices image selection panel. -
keyImageChooser
2D slice images file chooser. -
keyImageDirectory
2D slices image directory. -
axisList
axis region. -
labelAxis
-
Axial
private static int Axial -
Saggital
private static int Saggital -
Coronal
private static int Coronal -
axis
private int axis -
waveletFeatureNumber
private int waveletFeatureNumberwavelet feature number. -
keyImageVector
key images names vector. -
keyImages
key images vector. -
keyImageVOIVector
key image VOI names vector. -
keyImageVOIs
key image VOIs vector. -
cropKeyImages
cropped key image, crop from 512x512 to central prostate gland region. -
cropKeyImagesCE
cropped CE image vector. -
modelDirName
- See Also:
-
featureDirName
- See Also:
-
labelSaveImage
Save features directory. -
textFieldSaveImage
-
buttonSaveImage
-
saveImageChooser
Saved features directory. -
saveImageDirectory
-
-
Constructor Details
-
JDialogProstateExtractCEFeature
Constructor.- Parameters:
theParentFrame-
-
-
Method Details
-
disposeLocal
public void disposeLocal()dispose memory. -
calculateNumberFeatures
private void calculateNumberFeatures()Calculate number of features being saved. Currently, only Hurst index and Haralick features being used. -
actionPerformed
Action performed handler for this dialog.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase
-
recordSaveImageDir
private void recordSaveImageDir()Record the save 2D slice features directory. -
readKeyImageDir
private void readKeyImageDir()Read 2D slices. -
printImages
public void printImages()debuger for file names read. -
traverse
Traverse the 2D slices directory.- Parameters:
dir-
-
processDir
Process directory, save the image names and voi names.- Parameters:
dir-
-
algorithmPerformed
This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to to complete, so that the dialog can be display the result image and/or clean up.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- Algorithm that caused the event.
-
callAlgorithm
public void callAlgorithm()Driver to do automatic feature extraction. -
calculateCoherenceEnhancingDiffusion
private void calculateCoherenceEnhancingDiffusion()From the cropped images, apply Coherence Enhanced Diffusion filter to each 2D slices. -
cropKeyImages
public void cropKeyImages()Crop the central prostate gland region from the 512x512 slices. -
readFiles
public void readFiles()read 2D slices directory. -
extractFeatures
public void extractFeatures()Extract CE features. -
saveFeatureSpaceValue
public Features[] saveFeatureSpaceValue(ModelImage resultImage, ModelImage classificationImage, ModelImage keyImage, ModelImage srcImage, int sliceNumber) Save CE features to user specified directory.- Parameters:
resultImage- result image from feature extraction algorithm.classificationImage- corresponding class +1 or -1.keyImage- cropped key imagesrcImage- corresponding src imagesliceNumber- slice number- Returns:
- Feature vectors for the 2D slices.
-
init
public void init()Dialog GUI initialization. -
buildKeyImagePanel
public void buildKeyImagePanel()Build the panel.
-