Class JDialogProstate2DHEDmap

All Implemented Interfaces:
AlgorithmInterface, DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogProstate2DHEDmap extends JDialogBase implements AlgorithmInterface
This class convert the 3D images to 2D slices based atlas. Users specify the 3D prostate images dir, and output 2D slices based dir, the algorithm auto convert each 3D image to 2D slices with corresponding VOIs. Each saved VOIs is 2-contour based VOI, which is used to build the Active Appearance Model (AAM).
Author:
Ruida Cheng
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • UI

      private ViewUserInterface UI
      The main user interface.
    • boxYmin

      private int boxYmin
      bounding box for crop the image. Currently set from 0 to 512, the orginal image slice size.
    • boxYmax

      private int boxYmax
      bounding box for crop the image. Currently set from 0 to 512, the orginal image slice size.
    • boxXmin

      private int boxXmin
    • boxXmax

      private int boxXmax
    • xBounds

      private int[] xBounds
      X cropped region bounds.
    • yBounds

      private int[] yBounds
      Y cropped region bounds.
    • zBounds

      private int[] zBounds
      Z cropped region bound.
    • cropAlgo

      private AlgorithmAddMargins cropAlgo
      crop margin algorithm.
    • cropImage

      private ModelImage cropImage
      result cropped image.
    • labelKeyImage

      private JLabel labelKeyImage
      key image directory.
    • textFieldKeyImage

      private JTextField textFieldKeyImage
    • buttonKeyImage

      private JButton buttonKeyImage
    • imageSelectionPanel

      private JPanel imageSelectionPanel
    • keyImageChooser

      private JFileChooser keyImageChooser
      key images variables.
    • keyImageDirectory

      private String keyImageDirectory
    • axisList

      private JComboBox axisList
    • labelAxis

      private JLabel labelAxis
    • Axial

      private static int Axial
    • Saggital

      private static int Saggital
    • Coronal

      private static int Coronal
    • axis

      private int axis
    • keyImages

      private Vector<ModelImage> keyImages
      image vector to hold the actual images.
    • keyImageVOIs

      private Vector<VOI[]> keyImageVOIs
      voi vector to hold the actual vois.
    • keyImageVector1

      private Vector<String> keyImageVector1
    • keyImageVOIVector1

      private Vector<String> keyImageVOIVector1
    • keyImageVector2

      private Vector<String> keyImageVector2
    • keyImageVOIVector2

      private Vector<String> keyImageVOIVector2
    • keyImageVector3

      private Vector<String> keyImageVector3
    • keyImageVOIVector3

      private Vector<String> keyImageVOIVector3
    • keyImageVector4

      private Vector<String> keyImageVector4
    • keyImageVOIVector4

      private Vector<String> keyImageVOIVector4
    • keyImageVector5

      private Vector<String> keyImageVector5
    • keyImageVOIVector5

      private Vector<String> keyImageVOIVector5
    • cropKeyImages

      private Vector<ModelImage> cropKeyImages
      cropped key image vector.
    • labelSaveImage

      private JLabel labelSaveImage
      saved 2D slices atlas dir.
    • textFieldSaveImage

      private JTextField textFieldSaveImage
    • buttonSaveImage

      private JButton buttonSaveImage
    • saveImageChooser

      private JFileChooser saveImageChooser
    • saveImageDirectory

      private String saveImageDirectory
    • imageTable

    • newImageTable

      Hashtable<Integer,Vector<String>> newImageTable
    • maskTable

  • Constructor Details

    • JDialogProstate2DHEDmap

      public JDialogProstate2DHEDmap(Frame theParentFrame)
      Constructor.
      Parameters:
      theParentFrame -
  • Method Details

    • disposeLocal

      public void disposeLocal()
      dispose memory
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Dialog local actionPerformed handler.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
    • initImageTable

      private void initImageTable()
    • printImageTable

      private void printImageTable()
    • sortImageTable

      private void sortImageTable()
    • recordSaveImageDir

      private void recordSaveImageDir()
      Let user specify the saved 2D slices atlas, record the save directory.
    • readKeyImageDir

      private void readKeyImageDir()
      Read 3D images atlas directory.
    • traverse_folder_1

      private void traverse_folder_1(File dir)
    • processDir_folder_1

      private void processDir_folder_1(File dir)
    • sortKeyImage_1

      public void sortKeyImage_1()
    • traverse_folder_2

      private void traverse_folder_2(File dir)
    • processDir_folder_2

      private void processDir_folder_2(File dir)
    • sortKeyImage_2

      public void sortKeyImage_2()
    • traverse_folder_3

      private void traverse_folder_3(File dir)
    • processDir_folder_3

      private void processDir_folder_3(File dir)
    • sortKeyImage_3

      public void sortKeyImage_3()
    • traverse_folder_4

      private void traverse_folder_4(File dir)
    • processDir_folder_4

      private void processDir_folder_4(File dir)
    • traverse_folder_5

      private void traverse_folder_5(File dir, boolean test)
    • processDir_folder_5

      private void processDir_folder_5(File dir)
    • sortKeyImage_4

      public void sortKeyImage_4()
    • traverse_folder_5_old

      private void traverse_folder_5_old(File dir)
    • traverse_folder_5

      private void traverse_folder_5(File dir)
    • traverse_folder_5

      private void traverse_folder_5(File dir, int index)
    • processDir_folder_5

      private void processDir_folder_5(File dir, int index)
    • sortKeyImage_5

      public void sortKeyImage_5()
    • printImages

      public void printImages()
      Debugger for test the image and VOis reading.
    • 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 function to read image and VOIs, and convert each 3D image to 2D slices.
    • generateContours

      private void generateContours()
    • saveTestedImages

      public void saveTestedImages()
    • saveImages

      public void saveImages()
      Save the 2D slices and VOIs to user specified dir.
    • savePNGfile

      private void savePNGfile(String dirName, String fileName, ModelImage srcImage, float minIntensity, float maxIntensity, boolean isMask)
    • rotateToStartingPoint_yMid

      private void rotateToStartingPoint_yMid(float[] xPts, float[] yPts, int xDim, int yDim)
      Re-oriented the starting and ending VOIs.
      Parameters:
      xPts - voi x coordinate
      yPts - voi y coordinate
      xDim - image x dimension
      yDim - image y dimension
    • rotateToStartingPoint_leftMost

      private void rotateToStartingPoint_leftMost(float[] xPts, float[] yPts, int xDim, int yDim)
    • smoothVOI60

      public void smoothVOI60(ModelImage maskImage, ModelImage resultImage)
      Smooth VOIs to 60 points.
      Parameters:
      maskImage -
      resultImage -
    • smoothVOI30

      public void smoothVOI30(ModelImage maskImage, ModelImage resultImage)
    • generateBoundaryContours

      private void generateBoundaryContours(VOIBase srcContour, ModelImage targetImageSlice)
      Convert VOI from one contour to two contours
      Parameters:
      srcContour - single VOI contour
      targetImageSlice - target 2D image slice
    • cropKeyImages

      public void cropKeyImages()
      Crop key images.
    • loadFiles

      public void loadFiles()
      load image files and voi files
    • deleteDir

      public static boolean deleteDir(File dir)
      Debugger to test dir deletion.
      Parameters:
      dir -
      Returns:
    • readFile

      public void readFile()
    • init

      public void init()
      Initial panel
    • buildKeyImagePanel

      public void buildKeyImagePanel()
      Panel contains both the 3D image dir and saved 2D slices atlas dir.