All Implemented Interfaces:
ActionListener, FocusListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, ListSelectionListener

public class JPanelProbe extends JPanelRendererJ3D implements ChangeListener, ListSelectionListener
Dialog to turn slices bounding box of surface renderer on and off, and to change the color of the frame. This dialog also control the X, Y, Z slices movements.
Author:
Ruida Cheng
See Also:
  • Field Details

    • serialVersionUID

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

      private static int NONE
      cursor default nevigation mode.
    • PROBEMOVE

      private static int PROBEMOVE
      cursor probe nevigation mode.
    • bonePresetButton

      private JButton bonePresetButton
      DOCUMENT ME!
    • burnBackFaceCB

      private JCheckBox burnBackFaceCB
      burning point back face culling check box.
    • burnBase

      private BurnBase burnBase
      Burn base reference.
    • burnClipCB

      private JCheckBox burnClipCB
      burning point clipping check box.
    • burnIndex

      private int burnIndex
      Current burning point index being hightlighted.
    • burningPtTransVector

      private javax.vecmath.Vector3f burningPtTransVector
      Burning point coordinate vector in world coordinate system.
    • burnList

      private JList burnList
      Burn list that hold the burning point names.
    • calcButton

      private JButton calcButton
      Calculat button.
    • center

      private javax.vecmath.Point3f center
      Burning point coordinate.
    • centerLabel

      private JLabel centerLabel
      burning point center label.
    • clipping

      private boolean clipping
      Burning surface being clipped or not.
    • colorButton

      private JButton colorButton
      Burning point color button.
    • colorChooser

      private ViewJColorChooser colorChooser
      Color chooser when the user changes the color of the surface.
    • colorLabel

      private JLabel colorLabel
      Burning point color label.
    • culling

      private boolean culling
      Burning surface being culled ( back face bulling ) or not.
    • cursorMode

      private int cursorMode
      curreent cursor nevigation mode.
    • diffVolumeLabel

      private JLabel diffVolumeLabel
      Volume difference label for the current treatment.
    • diffVolumeText

      private JTextField diffVolumeText
      Volume difference text.
    • drawingPane

      private JPanelProbe.DrawingPane drawingPane
      Associate structure of the scroll pane to resize the panel properly.
    • endPtTransVector

      private javax.vecmath.Vector3f endPtTransVector
      End point coordinate vector in the world coordinate system.
    • entryPointLabel

      private JLabel entryPointLabel
      entry point label.
    • entryPointPanel

      private JPanel entryPointPanel
      Panel that hold the entry point roation check box.
    • entryPointRotationCB

      private JCheckBox entryPointRotationCB
      entry point rotation check box.
    • liverPresetButton

      private JButton liverPresetButton
      Liver segmentation preset opacity transform function control button.
    • loadVisualizationButton

      private JButton loadVisualizationButton
      Load button for the opacity transform function.
    • m_kProbeTwistLabel

      private JLabel m_kProbeTwistLabel
      DOCUMENT ME!
    • m_kProbeTwistSlider

      private JSlider m_kProbeTwistSlider
      Rotation/Twist around the direction of the probe:.
    • maxBox

      private float maxBox
      The maximum of the fram box values.
    • noTargetTreatment

      private TreatmentInformation noTargetTreatment
      Treatment information to be used if the user wants to burn without any target surface.
    • opacity

      private float opacity
      Burning point opacity.
    • opacityLabel

      private JLabel opacityLabel
      The opacity slider label.
    • opacitySlider

      private JSlider opacitySlider
      burning point surface opacity slider.
    • opacitySliderLabels

      private JLabel[] opacitySliderLabels
      burning point surface opacity slider label.
    • parentFrame

      private ViewJFrameVolumeView parentFrame
      Volume view frame work reference.
    • probe

      private Probe probe
      Probe reference.
    • probeList

      private JList probeList
      Probes list.
    • probeResetButton

      private JToggleButton probeResetButton
      Reset probe nevigation mode.
    • probeTargetButton

      private JToggleButton probeTargetButton
      Control the tri-planar probe nevigation mode.
    • radiusLabel

      private JLabel radiusLabel
      burning point diameter label.
    • resultLabel

      private JLabel resultLabel
      result label to show the bone, vasculature detection information message.
    • saveVisualizationButton

      private JButton saveVisualizationButton
      Save button for the opacity tranform function.
    • scroller

      private JScrollPane scroller
      Scroll pane that control the resizing of the panel.
    • semiXLabel

      private JLabel semiXLabel
      burning point semi axis X label.
    • semiXText

      private JTextField semiXText
      burning point semi axis X text field.
    • semiYLabel

      private JLabel semiYLabel
      burning point semi axis Y label.
    • semiYText

      private JTextField semiYText
      burning point semi axis Y text field.
    • semiZLabel

      private JLabel semiZLabel
      burning point semi axis Z label.
    • semiZText

      private JTextField semiZText
      burning point semi axis Z text field.
    • showBurnLabels

      private boolean showBurnLabels
      Flag indicates the show burning text label or not.
    • showBurnLabelsCB

      private JCheckBox showBurnLabelsCB
      Show the burning text label checkbox.
    • skinPresetButton

      private JButton skinPresetButton
      Skin segmentation preset opacity transform function control button.
    • sliderX

      private JSlider sliderX
      The probe X slider that control the probe push and pull movements.
    • snapToTarget

      private boolean snapToTarget
      Whether to snap to center of a target surface when it is selected; defaults to true.
    • snapToTargetCB

      private JCheckBox snapToTargetCB
      Checkbox indicating whether to snap to center of a target surface when it is selected.
    • startPtTransVector

      private javax.vecmath.Vector3f startPtTransVector
      Start point ( invisible ) coordinate vector in world coordinate system.
    • tabbedPane

      private JTabbedPane tabbedPane
      The main tabbed pane in the volume view frame.
    • tabPanel

      private JPanel tabPanel
      The main tab contrl panel.
    • targetList

      private JList targetList
      Surface target list (tumors).
    • targetVolumeText

      private JTextField targetVolumeText
      Label containing the volume of the current target surface.
    • targetXText

      private JTextField targetXText
      X label for the center coordinate of the current target surface.
    • targetYText

      private JTextField targetYText
      Y label for the center coordinate of the current target surface.
    • targetZText

      private JTextField targetZText
      Z label for the center coordinate of the current target surface.
    • tipLengthCB

      private JComboBox tipLengthCB
      Combo box for indicating the length of the probe tip. Currently used just by CoolTip probe.
    • toolBar

      private JToolBar toolBar
      Tool bar.
    • totalVolumeLabel

      private JLabel totalVolumeLabel
      Burning points total volume label.
    • totalVolumeText

      private JTextField totalVolumeText
      Burning point total volume text.
    • traverseButton

      private JToggleButton traverseButton
      Control the tri-planar default view nevigation mode.
    • treatmentVector

      private Vector<TreatmentInformation> treatmentVector
      List of treatment sets.
    • volumeLabel

      private JLabel volumeLabel
      buring point volume label.
    • volumeText

      private JTextField volumeText
      burning pont volume text box.
    • xBox

      private float xBox
      Parent frame box value.
    • yBox

      private float yBox
      Parent frame box value.
    • zBox

      private float zBox
      Parent frame box value.
    • xLabel

      private JLabel xLabel
      burning point X, Y, Z coordinate label.
    • yLabel

      private JLabel yLabel
      burning point X, Y, Z coordinate label.
    • zLabel

      private JLabel zLabel
      burning point X, Y, Z coordinate label.
    • xLabelEntry

      private JLabel xLabelEntry
      entry point X, Y, Z coordinate label.
    • yLabelEntry

      private JLabel yLabelEntry
      entry point X, Y, Z coordinate label.
    • zLabelEntry

      private JLabel zLabelEntry
      entry point X, Y, Z coordinate label.
    • xRes

      private float xRes
      The resolutions of the (possibly respampled) image (the one shown in the renderer).
    • yRes

      private float yRes
      The resolutions of the (possibly respampled) image (the one shown in the renderer).
    • zRes

      private float zRes
      The resolutions of the (possibly respampled) image (the one shown in the renderer).
    • xSliderS

      private JSlider xSliderS
      slider that controls the probe moves along the x direction.
    • xText

      private JTextField xText
      burning point X, Y, Z coordinate text box.
    • yText

      private JTextField yText
      burning point X, Y, Z coordinate text box.
    • zText

      private JTextField zText
      burning point X, Y, Z coordinate text box.
    • xTextEntry

      private JTextField xTextEntry
      entry point X, Y, Z coordinate text box.
    • yTextEntry

      private JTextField yTextEntry
      entry point X, Y, Z coordinate text box.
    • zTextEntry

      private JTextField zTextEntry
      entry point X, Y, Z coordinate text box.
    • ySliderS

      private JSlider ySliderS
      slider that controls the probe moves along the y direction.
    • zSliderS

      private JSlider zSliderS
      slider that controls the probe moves along the z direction.
  • Constructor Details

    • JPanelProbe

      public JPanelProbe(SurfaceRender parent, ViewJFrameBase _parentFrame, float xBox, float yBox, float zBox)
      Constructor to initialize the probe control panel.
      Parameters:
      parent - SurfaceRender reference.
      _parentFrame - ViewJFrameVolumeView reference.
      xBox - DOCUMENT ME!
      yBox - DOCUMENT ME!
      zBox - DOCUMENT ME!
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Action perform event function that handle all the commands in the probe panel.
      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class JPanelRendererBase
      Parameters:
      event - Action Event
    • detectTissue

      public void detectTissue()
      Detect the body tissue component. If the bone or the vasculature is detected, draw the corresponding color along the probing path, also, show the detection message in the search panel.
    • dispose

      public void dispose()
      Dispose memory.
    • enableProbeBehavior

      public void enableProbeBehavior(boolean flag)
      Enable probe mouse behavior branch group.
      Parameters:
      flag - true means turn on, false means turn off.
    • getBurnBase

      public BurnBase getBurnBase()
      Get the burn base reference inside the probe control panel.
      Returns:
      BurnBase
    • getBurnLabelFlag

      public boolean getBurnLabelFlag()
      Get the show burning point label's flag.
      Returns:
      boolean show label or not.
    • getBurnPoint

      public javax.vecmath.Vector3f getBurnPoint()
      Get the burning point world coordinate.
      Returns:
      Vector3f burning point tranform vector.
    • getBurnRootParentBG

      public javax.media.j3d.BranchGroup getBurnRootParentBG()
      Get the burn root branch group. JPanelSurface calls this method during the geometry picking procedure.
      Returns:
      BranchGroup
    • getCurSurface

      public SurfaceAttributes getCurSurface()
      Get the current highlight surface.
      Returns:
      SurfaceAttributes
    • getCurTreatment

      public TreatmentInformation getCurTreatment()
      Get the treatment info that matches the currently selected target surface.
      Returns:
      info about a treatment
    • getEndPoint

      public javax.vecmath.Vector3f getEndPoint()
      Get the end point world coordinate vector.
      Returns:
      Vector3f end point transform vector.
    • getEntryPoint

      public javax.vecmath.Point3f getEntryPoint()
      Get the entry ponit world coordinate.
      Returns:
      Point3f entry ponit transform vector.
    • getMainPanel

      public JPanel getMainPanel()
      Get the main control panel.
      Specified by:
      getMainPanel in class JPanelRendererBase
      Returns:
      JPanel main control panel.
    • getProbeBase

      public Probe getProbeBase()
      Get the probe base reference inside the burning control panel.
      Returns:
      Probe
    • getProbesRootBG

      public javax.media.j3d.BranchGroup getProbesRootBG()
      Return the root to the probes branches.
      Returns:
      BranchGroup probes branch group
    • getStartPoint

      public javax.vecmath.Vector3f getStartPoint()
      Get the start point world coordinate vector.
      Returns:
      Vector3f start point tranform vector.
    • getTargetSurface

      public SurfaceAttributes getTargetSurface()
      Return the currently targeted surface.
      Returns:
      the attributes of the current target surface
    • isSnapToTarget

      public boolean isSnapToTarget()
      Return whether the user wants to snap to the treatment target surface.
      Returns:
      whether to snap to the target
    • loadVisualizationDataFrom

      public void loadVisualizationDataFrom(boolean loadAll, String filename, String dirName, boolean quietMode)
      This method loads the LUT and opacity transfer function for the active image.
      Parameters:
      loadAll - boolean indicating that both lut and transfer functions should be loaded. If false, then only transfer functions are loaded.
      filename - filename to load LUT from
      dirName - directory to load LUT from
      quietMode - if true indicates that warnings should not be displayed.
    • removeProbingPath

      public void removeProbingPath()
      During mouse release, remove the probing path and clear the probe color mask.
    • resizePanel

      public void resizePanel(int panelWidth, int frameHeight)
      Resizig the control panel with ViewJFrameVolumeView's frame width and height.
      Overrides:
      resizePanel in class JPanelRendererBase
      Parameters:
      panelWidth - the panel should be
      frameHeight - the height of the renderer frame
    • saveVisualizationDataAs

      public void saveVisualizationDataAs(boolean saveAll, String filename, String dirName)
      This method saves the LUT and opacity function for the active image. If either filename or directory is null, then the user will be prompted for a filename.
      Parameters:
      saveAll - boolean indicating that both lut and transfer functions should be saved. If false, then only transfer functions are saved.
      filename - filename to save LUT as
      dirName - directory to save LUT to
    • setProbeGreenColor

      public void setProbeGreenColor(boolean flag)
      When the probe is picked, switch the probe geometry appearance to green.
      Parameters:
      flag - boolean probe picked or not.
    • startBurn

      public void startBurn()
      When the burn button is clicked, invoked the start burn method to show the burnning process.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      State change event, invokded by the sliders moves.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - ChangeEvent
    • transformPtVolumeToImage

      public javax.vecmath.Point3f transformPtVolumeToImage(javax.vecmath.Point3f pt)
      Transform a java3d point [-1,1] to the image volume space.
      Parameters:
      pt - the point in java3d space
      Returns:
      the equivalent point in volume space
    • updateBurnList

      public void updateBurnList(int index)
      Updates the burn name list's selected element. Called from the JPanelSurface.
      Parameters:
      index - selected index number.
    • updateProbeList

      public void updateProbeList()
      Update probe list.
    • updateProbePos

      public void updateProbePos(float x, float y, float z)
      Updates the probe world coordinate from the tri-planar view's mouse drag event.
      Parameters:
      x - float x coordinate
      y - float y coordinate
      z - float z coordinate
    • updateTargetList

      public void updateTargetList()
      Update target surface list from the JPanelSurface control dialog.
    • updateTreatmentPanel

      public void updateTreatmentPanel(boolean swapBurnList)
      Update the treatment panel components to correpsond to the currently selected target surface.
      Parameters:
      swapBurnList - whether to swap in the burn list of the currently selected target surface treatment (used when a new selection is made in the target list)
    • valueChanged

      public void valueChanged(ListSelectionEvent kEvent)
      Value changed event, which invoked by probe name list, burn name list, surface name list, burn param name list.
      Specified by:
      valueChanged in interface ListSelectionListener
      Parameters:
      kEvent - ListSelection Event
    • withinDistance

      public boolean withinDistance(float centerX, float centerY, float centerZ, float ptrX, float ptrY, float ptrZ, double r)
      Check to see if the given voxel is within the sphere radius from the center point.
      Parameters:
      centerX - float center x coordinate
      centerY - float center y coordinate
      centerZ - float center z coordinate
      ptrX - float given point x coordinate
      ptrY - float given point x coordinate
      ptrZ - float given point x coordinate
      r - double given radius
      Returns:
      boolean true within the distance, false not.
    • createBoldLabel

      private static JLabel createBoldLabel(String title)
      Creates a label in the proper (bold) font and color.
      Parameters:
      title - The title of the label.
      Returns:
      The new label.
    • createLabel

      private static JLabel createLabel(String title)
      Creates a label in the proper font and color.
      Parameters:
      title - The title of the label.
      Returns:
      The new label.
    • buildBurnPackingPanel

      private void buildBurnPackingPanel()
      Build the tab panel containing ablation (sphere/ellipsoid) packing parameters, etc.
    • buildBurnVisPanel

      private void buildBurnVisPanel()
      Build the tab containing the color, opac, picking, labels, etc for burns.
    • buildProbeModelPanel

      private void buildProbeModelPanel()
      Build the tab which allows the user to change the currently used probe model.
    • buildProbePlacementPanel

      private void buildProbePlacementPanel()
      Build the tab with controls / info used in probe placement before a burn. This includes rot, trans, in/out, entry pt rotation, warning of intersection of problem regions, and the saving / loading of a problem region mapping.
    • buildProbeSlider

      private JPanel buildProbeSlider()
      Setup the probe moving control panel that include x, y, z moving sliders.
      Returns:
      the trans x, y, z and in/out probe movement panel.
    • buildTabbedPanel

      private void buildTabbedPanel()
      Build the four tabbed panes, probe control pane, burn control pane, burn parameter control pane, and demo pane.
    • buildTargetListPanel

      private JPanel buildTargetListPanel()
      Build the target surface (tumor) control panel. This panel can add or remove surfaces, also changes the surface opacity.
      Returns:
      the target surface list panel.
    • buildTargetPanel

      private void buildTargetPanel()
      Build the tab which allows the user to pick the current tumor to target, to load/remove tumor surfaces and show tumor position and volume info.
    • buildToolBar

      private void buildToolBar()
      Build the probe toolbar control.
    • buildTreatmentPanel

      private void buildTreatmentPanel()
      Build the tab containing ablation treatment information, including a list of burns; burn removal, position and volume; comparison of current tumor vs current set of burns.
    • enableBurnTreatmentComponents

      private void enableBurnTreatmentComponents(boolean flag)
      Enable or disable the components on the target treatment panel.
      Parameters:
      flag - whether to enable the components
    • enableBurnVisComponents

      private void enableBurnVisComponents(boolean flag)
      Enable or disable the components on the burn visualization panel.
      Parameters:
      flag - whether to enable the components
    • getColorChange

      private void getColorChange(Color color)
      This is called when the user chooses a new color for the surface. It changes the color of the surface.
      Parameters:
      color - Color to change surface to.
    • getTreatmentInfo

      private TreatmentInformation getTreatmentInfo(int index)
      Get information about a treatment.
      Parameters:
      index - the index of the treatment to retreive
      Returns:
      info about a treatment
    • init

      private void init()
      Initialize the whole probe panel control layout.
    • loadImage

      private ModelImage loadImage()
      Ask the user for an image to load and return it.
      Returns:
      the image the user wants to load
    • loadVisualizationSettings

      private void loadVisualizationSettings(TransferFunction lut, TransferFunction opac)
      Loads visualization settings for this image.
      Parameters:
      lut - the lut transfer function
      opac - the opacity transfer function
    • removeAllBurn

      private void removeAllBurn()
      Remove all the burning point geometry shapes in the volume.
    • removeBurn

      private void removeBurn()
      The action taken when the Remove button is clicked in the list box. All selected surfaces in the list box are removed from the scene graph.
    • saveImage

      private void saveImage(ModelImage img)
      Ask the user for a name to save an image as and then write it out to disk.
      Parameters:
      img - the image to save
    • startBurnPacking

      private void startBurnPacking()
      Start to try to choose an optimal ablation plan for the current target surface.
    • updateTargetLabels

      private void updateTargetLabels()
      Update the labels which show info about the current target surface.