Class JDialogTrainingListGenerator

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

public class JDialogTrainingListGenerator extends JDialogBase implements AlgorithmInterface
The class converts the 2D-volumetric approach axial, sagittal and coronal MRI and CED png slices (or MRI png slices alone) into a file list. HED uses the list to train HED deep learning model. Training case only.
Author:
Ruida Cheng
See Also:
  • Field Details

  • Constructor Details

    • JDialogTrainingListGenerator

      public JDialogTrainingListGenerator(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
    • writePngPairAll

      private void writePngPairAll()
      Write the axial.lst, sagittal.lst and coronal.lst for each fold and each orientation. Those lists will be used to train the HNN models.
    • readKeyImageDir

      private void readKeyImageDir()
      Read the 10-fold cross-validataion training folds
    • traverse_train_folds

      private void traverse_train_folds(File dir)
      Traverse the specified 10-fold training directory
      Parameters:
      dir -
    • processDir_folder

      private void processDir_folder(File dir, String foldNumber)
      Traverse the each fold directory
      Parameters:
      dir - directory
      foldNumber - fold hash ID, i.e. fold1, fold2, fold3, ... etc.
    • processDir_orientation

      private void processDir_orientation(File dir, String orientation, String foldNumber)
      Under each fold, traverse the orientation directories, i.e. axial, coronal, sagittal directories.
      Parameters:
      dir - direcotry
      orientation - orientation keyword or hashID
      foldNumber - fold keyword or hashID
    • process_file

      private void process_file(File dir, String orientation, String foldNumber)
      Read the base directory for images and vois png files. Recording the full path.
      Parameters:
      dir - directory
      orientation - orientatino hash ID
      foldNumber - fold hash ID
    • sortAll

      public void sortAll()
      Sort the full path tables for images and vois. Sort the image and voi pairs in sorted order.
    • 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.
    • init

      public void init()
      Initial panel