Class JDialogKnees_90_data_train_extraction

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

public class JDialogKnees_90_data_train_extraction extends JDialogBase implements AlgorithmInterface
This class converts the original knees MRI images into isotropic images. 1) Convert the VOIs into binary image masks. 2) Convert the original images into isotropic images 3) Convert the isotropic images from sagittal to axial; sagittal to coronal. 4) Along each orietation, generate the CED image in addition to MRI. 5) Save all the images (isotropic axial, sagittal, coronal images with corresponding binary masks).
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.
    • labelKeyImage

      private JLabel labelKeyImage
      key image directory.
    • textFieldKeyImage

      private JTextField textFieldKeyImage
    • buttonKeyImage

      private JButton buttonKeyImage
    • imageSelectionPanel

      private JPanel imageSelectionPanel
    • keyImages

      private Hashtable<String,ModelImage> keyImages
      image vector to hold the actual images.
    • maskImages

      private Hashtable<String,ModelImage> maskImages
    • keyImagesCrop

      private Vector<ModelImage> keyImagesCrop
    • keyImagesScaleIntensity

      private Vector<ModelImage> keyImagesScaleIntensity
    • keyImageVOIs

      private Vector<ModelImage> keyImageVOIs
      voi vector to hold the actual vois.
    • 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
    • algoTrans

      private AlgorithmTransform algoTrans
    • axialList

      private Hashtable<String,ModelImage> axialList
    • axialMaskList

      private Hashtable<String,ModelImage> axialMaskList
    • sagittalList

      private Hashtable<String,ModelImage> sagittalList
    • sagittalMaskList

      private Hashtable<String,ModelImage> sagittalMaskList
    • coronalList

      private Hashtable<String,ModelImage> coronalList
    • coronalMaskList

      private Hashtable<String,ModelImage> coronalMaskList
    • axial_index

      private int axial_index
    • sagittal_index

      private int sagittal_index
    • coronal_index

      private int coronal_index
    • cedTableAxial

      Hashtable<String,ModelImage> cedTableAxial
    • cedTableSagittal

      Hashtable<String,ModelImage> cedTableSagittal
    • cedTableCoronal

      Hashtable<String,ModelImage> cedTableCoronal
    • origTable

      Hashtable<String,String> origTable
    • nameTable

      Hashtable<String,String> nameTable
    • nameVOITable

      Hashtable<String,String> nameVOITable
    • keyImagesTransform

      Hashtable<String,ModelImage> keyImagesTransform
    • keyImageMasksTransform

      Hashtable<String,ModelImage> keyImageMasksTransform
    • noCasesList

      private Vector<String> noCasesList
      List of patients need work. 2966L 3225L 6205L 6909R 9717L 9808R 3022L 8868R 5733L 8121L 8136L 9808L 7654R (wrong fem VOI, it's FAT GRE VOI) 2911L (miss patella) 5271R (miss femur) 4983L (miss femur) 5026L (miss femur,need work) 9808R (miss femur) 1959L (femur VOI wrong)
  • Constructor Details

    • JDialogKnees_90_data_train_extraction

      public JDialogKnees_90_data_train_extraction(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_femur

      private void traverse_folder_femur(File dir, String hashID)
    • read_name

      private void read_name(File dir)
    • traverse_folder_patella

      private void traverse_folder_patella(File dir, String hashID)
    • read_name_patella

      private void read_name_patella(File 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 function to read image and VOIs, and convert each 3D image to 2D slices.
    • transform

      public void transform()
    • convertVOItoMask

      public void convertVOItoMask()
    • saveOrthogonalCEDImage

      public void saveOrthogonalCEDImage()
    • runCED

      public void runCED()
    • saveHED2DsliceCED

      public void saveHED2DsliceCED()
    • saveImage

      public void saveImage(ModelImage image, ModelImage imageMask, String orientation)
    • calculateCoherenceEnhancingDiffusion

      private ModelImage calculateCoherenceEnhancingDiffusion(ModelImage inImage)
    • conversion

      public void conversion()
    • scaleIntensity

      public ModelImage scaleIntensity(ModelImage image)
    • calculateTransform

      public ModelImage calculateTransform(ModelImage keyImage)
    • saveImages

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

      public void saveImagesTest()
    • savePNGfile

      private void savePNGfile(String dirName, String fileName, ModelImage srcImage, float minIntensity, float maxIntensity, int xDim, int yDim, boolean isMask)
    • 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.