Class JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest

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.JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest
All Implemented Interfaces:
AlgorithmInterface, DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest 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

  • Constructor Details

    • JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest

      public JDialogProstate2DSlicesAtlasPngConverter3DSurfaceTrainAndTest(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_Layer_extra

      private void traverse_Layer_extra(File dir)
    • traverse_patientID

      private void traverse_patientID(File dir, String patientID)
    • traverse_date

      private void traverse_date(File dir, String patientID, String date)
    • traverse_orientation

      private void traverse_orientation(File dir, String hashID)
    • traverse_serial

      private void traverse_serial(File dir, String hashID, String orientation)
    • traverse_dicom

      private void traverse_dicom(File dir, String hashID, String orientation)
    • traverse_Layer

      private void traverse_Layer(File dir)
    • traverse_firstLayer

      private void traverse_firstLayer(File firstDir, String child)
    • traverse_secondLayer

      private void traverse_secondLayer(File firstLayer, String hashID)
    • 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.
    • saveTestedImages

      public void saveTestedImages()
    • crossValidationTestExtra

      public void crossValidationTestExtra()
    • crossValidationTrain

      public void crossValidationTrain()
    • crossValidationTest

      public void crossValidationTest()
    • printTable

      private void printTable()
    • readImagesExra

      public void readImagesExra()
    • readImages

      public void readImages()
    • saveImages

      public void saveImages(ModelImage image, int[] index, String folderName, String orientation)
    • saveImagesTest

      public void saveImagesTest(ModelImage cropKeyImage, String pid, String folderName)
    • savePNGfile

      private void savePNGfile(String dirName, String fileName, ModelImage srcImage, float minIntensity, float maxIntensity, int xDim, int yDim, boolean isMask)
    • smoothVOI60

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

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

      public void readFile()
    • loadSTLBinaryMesh

      private void loadSTLBinaryMesh(File file, ModelImage kImage, int imageOrientation)
    • loadSTLBinaryMesh

      private void loadSTLBinaryMesh(File file, ModelImage kImage, int imageOrientation, String hashID)
    • readSTLBinary

      private void readSTLBinary(FileInputStream data, ModelImage kImage, int imageOrientation) throws IOException
      Throws:
      IOException
    • readSTLBinary

      private void readSTLBinary(FileInputStream data, ModelImage kImage, int imageOrientation, String hashID) throws IOException
      Throws:
      IOException
    • pause

      public static void pause()
    • init

      public void init()
      Initial panel
    • buildKeyImagePanel

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