Class JDialogPromise12_mhg_to_nii

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

public class JDialogPromise12_mhg_to_nii extends JDialogBase implements AlgorithmInterface
This is the first try to 3D convolution deep learning models. 3D-Unet. Miccai Promise 12 data: Preprocessed after, 1. N4 correction 2. Transform to 0.5m x 0.5m x 1.5m resolution images 3. Intensity normalization Convert the image to double type. Save the images and masks in .nii.gz format. Apply 3D cube cropping to the 3D images. The 3D cube size is 64x64x64. The MR image and corresponding binary mask images need to crop into two 3D small cubes, then merge them into H5 readable volume.
Author:
Ruida Cheng
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • UI

      private ViewUserInterface UI
      The main user interface.
    • labelKeyImage

      private JLabel labelKeyImage
      key image directory.
    • textFieldKeyImage

      private JTextField textFieldKeyImage
    • buttonKeyImage

      private JButton buttonKeyImage
    • imageSelectionPanel

      private JPanel imageSelectionPanel
    • keyImages

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

      private Vector<ModelImage> keyImagesCrop
    • keyImagesScaleIntensity

      private Vector<ModelImage> keyImagesScaleIntensity
    • keyImagesMask

      private Vector<ModelImage> keyImagesMask
    • keyImageVector1

      private Vector<String> keyImageVector1
    • keyImageVOIVector1

      private Vector<String> keyImageVOIVector1
    • keyImageVector2

      private Vector<String> keyImageVector2
    • 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
  • Constructor Details

    • JDialogPromise12_mhg_to_nii

      public JDialogPromise12_mhg_to_nii(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
    • 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()
    • 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.
    • saveNiiImages

      public void saveNiiImages()
    • scaleIntensity

      public void scaleIntensity()
    • scaleIntensity

      public ModelImage scaleIntensity(ModelImage image)
    • loadFiles

      public void loadFiles()
      load image files and voi files
    • 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.