Class JDialogVolViewResample

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

public class JDialogVolViewResample extends JDialogBase
Dialog to ask user to resample the images to power of 2 before volume rendering.
Author:
Ruida Cheng
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • RGBTA

      protected ModelRGB RGBTA
      Lookup table of the color imageA, B.
    • RGBTB

      protected ModelRGB RGBTB
      Lookup table of the color imageA, B.
    • extents

      private int[] extents
      Original dimensions extents value array.
    • extXInput

      private JTextField extXInput
      Original X, Y, Z dimension extents values.
    • extYInput

      private JTextField extYInput
      Original X, Y, Z dimension extents values.
    • extZInput

      private JTextField extZInput
      Original X, Y, Z dimension extents values.
    • extXOutput

      private JTextField extXOutput
      Power of 2 X, Y, Z dimension extents values.
    • extYOutput

      private JTextField extYOutput
      Power of 2 X, Y, Z dimension extents values.
    • extZOutput

      private JTextField extZOutput
      Power of 2 X, Y, Z dimension extents values.
    • forcePadding

      private boolean forcePadding
      Flag to force the padding of blank images to the end of images.
    • forceResample

      private boolean forceResample
      Boolean flag to do resample images.
    • imageA

      private ModelImage imageA
      Model images A and B.
    • imageB

      private ModelImage imageB
      Model images A and B.
    • imageAOriginal

      private ModelImage imageAOriginal
      The non-cloned image which we want to load into the renderer.
    • leftPanelRenderMode

      private int leftPanelRenderMode
      The left panel renderer mode.
    • LUTa

      private ModelLUT LUTa
      Lookup table of the imageA, B.
    • LUTb

      private ModelLUT LUTb
      Lookup table of the imageA, B.
    • m_iFilter

      private int m_iFilter
      Resample filter type, default: Trilinear Interpoloation.
    • m_kFilterType

      private JComboBox m_kFilterType
      Resample filter selection box.
    • nDim

      private final int nDim
      Number of available dimension.
    • newRes

      private float[] newRes
      Resample resolutioin corresponding to Power of 2.
    • padButton

      private JButton padButton
      Pad button is used for inserting blank images to the end of the image. This approach creates the power of 2 image. Pad Button is only enabled when the power of 2 value is greater than the slices number.
    • radioBrainSurfaceFlattenerR

      private JRadioButton radioBrainSurfaceFlattenerR
      Radio button of the brainsurface flattener render mode in the right panel.
    • radioFlythruL

      private JRadioButton radioFlythruL
      Radio button of the fly througth mode in the left panel.
    • radioSurfaceView

      private JRadioButton radioSurfaceView
      Radio button of the surface view mode in the left panel.
    • radioNoneR

      private JRadioButton radioNoneR
      Radio button of the none mode in the right panel.
    • radioRaycastR

      private JRadioButton radioRaycastR
      Radio button of the raycast render mode in the right panel.
    • radioShearwarpR

      private JRadioButton radioShearwarpR
      Radio button of the shearwarp render mode in the right panel.
    • radioSurfaceL

      private JRadioButton radioSurfaceL
      Radio button of the surface render mode int the left panel.
    • radioSurfaceR

      private JRadioButton radioSurfaceR
      Radio button of the surface render mode in the right panel.
    • res

      private float[] res
      Original resolutioin arrray.
    • resampledImage

      private ModelImage resampledImage
      Temp Model image.
    • rightPanelRenderMode

      private int rightPanelRenderMode
      The right panel renderer mode.
    • segmentationImage

      private ModelImage segmentationImage
      An image with areas designated as special (vessels, etc).
    • sr

      Reference to ViewJFrameSurfaceRenderer.
    • startupCommand

      private String startupCommand
      The action command to send to the volume renderer after we start it (can be used to open a tab). Used by RFAST to open up the RFA simulation immediately.
    • volExtents

      private int[] volExtents
      Resampled dimension value in Power of 2.
    • volSize

      private int volSize
      Volume size X*Y*Z.
    • m_kVolViewType

      private final String m_kVolViewType
      Type of ViewJFrameVolumeView object (using WildMagic or not)
  • Constructor Details

    • JDialogVolViewResample

      public JDialogVolViewResample(ModelImage _imageA, ModelImage _imageB, String kCommand)
      Creates the dialog, using the input parameters to place it on the screen.
      Parameters:
      _imageA - Model image A.
      _imageB - Model image B.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      On "OK", sets the name variable to the text entered. On "Cancel" disposes of this dialog and sets cancel flag.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggered this method.
    • buildNotResampleButton

      public JButton buildNotResampleButton()
      Builds the Cancel button. Sets it internally as well return the just-built button.
      Returns:
      Return the noll resample button.
    • disposeLocal

      public void disposeLocal()
      Dispose memory.
    • exec

      public void exec()
      Do resampling.
    • init

      public void init()
      Build the resample dialog.
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Sets the flags for the checkboxes.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - event that triggered this function
    • sendActionOnStart

      public void sendActionOnStart(String cmd)
      Sets a command that should be sent to the renderer after it is started.
      Parameters:
      cmd - the action command
    • setSegmentationImage

      public void setSegmentationImage(ModelImage img)
      Set the image which we can check to see if the probe is hitting anything important (such as vessels, etc).
      Parameters:
      img - segmentation image
    • buildTitledBorder

      protected TitledBorder buildTitledBorder(String title, Border _border)
      Builds a titled border with the given title, an etched border, and the proper font and color.
      Parameters:
      title - Title of the border
      _border - Return the border built
      Returns:
      The titled border.
    • finalize

      protected void finalize() throws Throwable
      Clear up memory from gc.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - Call the dispose local to dispose memory.
    • initLUT

      protected ModelLUT initLUT(ModelImage img) throws OutOfMemoryError
      Creates and initializes the LUT for an image.
      Parameters:
      img - the image to create a LUT for
      Returns:
      a LUT for the image img (null if a color image)
      Throws:
      OutOfMemoryError - if enough memory cannot be allocated for this method
    • buildPadButton

      private void buildPadButton()
      Builds the Pad button for padding the blank images.
    • buildResampleButton

      private JButton buildResampleButton()
      Builds the OK button. Sets it internally as well return the just-built button.
      Returns:
      Return the resample button built.