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

public class JDialogProstateExtractCEFeature extends JDialogBase implements AlgorithmInterface
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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • UI

      private ViewUserInterface UI
      The main user interface.
    • radioButtonSVMBinary

      private JRadioButton radioButtonSVMBinary
      SVM option button.
    • radioButtonSVMMulticlass

      private JRadioButton radioButtonSVMMulticlass
    • svmTrainingBinary

      private boolean svmTrainingBinary
      flag to indicate is SVM training with binary class or multi-class.
    • boxYmin

      private int boxYmin
      cropped image boundary.
    • boxYmax

      private int boxYmax
      cropped image boundary.
    • boxXmin

      private int boxXmin
    • boxXmax

      private int boxXmax
    • xBounds

      private int[] xBounds
      x dimension bounds
    • yBounds

      private int[] yBounds
      y dimension bound
    • zBounds

      private int[] zBounds
      z dimension bound
    • cropAlgo

      private AlgorithmAddMargins cropAlgo
      crop image algorithm
    • textureAlgo

      Algorithm to save Hurst index and Haralick features.
    • imageIntensityFilter

      private boolean imageIntensityFilter
      image intensity.
    • coherenceEnhancingDiffusionFilter

      private boolean coherenceEnhancingDiffusionFilter
      Coherence Enhancing Diffusion filter.
    • regisotropicDiffusionFilter

      private boolean regisotropicDiffusionFilter
      Anisotropic Diffusion filter.
    • IHN3CorrectionFilter

      private boolean IHN3CorrectionFilter
      Inhomogeneity N3 correction.
    • modeFilter

      private boolean modeFilter
      Haralick mode filter.
    • meanFilter

      private boolean meanFilter
      Haralick mean filter.
    • medianFilter

      private boolean medianFilter
      Haralick median filter.
    • invertFilter

      private boolean invertFilter
      Haralick invert filter.
    • haralickFilter

      private boolean haralickFilter
      haralick filter.
    • gaborFilter

      private boolean gaborFilter
      gabor filter.
    • hurstFilter

      private boolean hurstFilter
      Hurst index.
    • waveletFilter

      private boolean waveletFilter
      Wavelet filter.
    • gaussianFilter

      private boolean gaussianFilter
      gussian filter.
    • gmFilter

      private boolean gmFilter
      gradient magnitude filter.
    • numberFeatures

      private int numberFeatures
      number features being saved.
    • haralickFeatureNumber

      private int haralickFeatureNumber
      Haralick feature numbers.
    • labelKeyImage

      private JLabel labelKeyImage
      2D Slices key image directory.
    • textFieldKeyImage

      private JTextField textFieldKeyImage
    • buttonKeyImage

      private JButton buttonKeyImage
    • imageSelectionPanel

      private JPanel imageSelectionPanel
      2D slices image selection panel.
    • keyImageChooser

      private JFileChooser keyImageChooser
      2D slice images file chooser.
    • keyImageDirectory

      private String keyImageDirectory
      2D slices image directory.
    • axisList

      private JComboBox axisList
      axis region.
    • labelAxis

      private JLabel labelAxis
    • Axial

      private static int Axial
    • Saggital

      private static int Saggital
    • Coronal

      private static int Coronal
    • axis

      private int axis
    • waveletFeatureNumber

      private int waveletFeatureNumber
      wavelet feature number.
    • keyImageVector

      private Vector<String> keyImageVector
      key images names vector.
    • keyImages

      private Vector<ModelImage> keyImages
      key images vector.
    • keyImageVOIVector

      private Vector<String> keyImageVOIVector
      key image VOI names vector.
    • keyImageVOIs

      private Vector<VOI[]> keyImageVOIs
      key image VOIs vector.
    • cropKeyImages

      private Vector<ModelImage> cropKeyImages
      cropped key image, crop from 512x512 to central prostate gland region.
    • cropKeyImagesCE

      private Vector<Vector<ModelImage>> cropKeyImagesCE
      cropped CE image vector.
    • modelDirName

      public static final String modelDirName
      See Also:
    • featureDirName

      public static final String featureDirName
      See Also:
    • labelSaveImage

      private JLabel labelSaveImage
      Save features directory.
    • textFieldSaveImage

      private JTextField textFieldSaveImage
    • buttonSaveImage

      private JButton buttonSaveImage
    • saveImageChooser

      private JFileChooser saveImageChooser
      Saved features directory.
    • saveImageDirectory

      private String saveImageDirectory
  • Constructor Details

    • JDialogProstateExtractCEFeature

      public JDialogProstateExtractCEFeature(Frame theParentFrame)
      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

      public void actionPerformed(ActionEvent event)
      Action performed handler for this dialog.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
    • 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

      private void traverse(File dir)
      Traverse the 2D slices directory.
      Parameters:
      dir -
    • processDir

      private void processDir(File dir)
      Process directory, save the image names and voi names.
      Parameters:
      dir -
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      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:
      algorithmPerformed in interface AlgorithmInterface
      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 image
      srcImage - corresponding src image
      sliceNumber - slice number
      Returns:
      Feature vectors for the 2D slices.
    • init

      public void init()
      Dialog GUI initialization.
    • buildKeyImagePanel

      public void buildKeyImagePanel()
      Build the panel.