Immersive ParaView

From KitwarePublic
Jump to: navigation, search

Overview

  1. Configure and build ParaView with the VR plugin enabled.
  2. Configuring the server display specification (.pvx file).
  3. Setup connections to input event streams.
  4. Launch pvserver.

For further reading, the following articles in The Kitware Source detail the VR plugin:

Build ParaView

Note: For distributed Windows environments, alternate instructions are available for building with VRPN and Microsoft MPI here: ParaView/VRPN with MS-MPI

Follow regular build instructions from http://paraview.org/Wiki/ParaView:Build_And_Install. In addition following steps needs to be performed:

  • Install Qt (client) and MPI (client and server) as they are ParaView dependencies. If using VRPN to generate VR input events, make sure that it is built and installed as well.
  • When configuring cmake enable BUILD_SHARED_LIB, PARAVIEW_BUILD_QT_GUI, PARAVIEW_USE_MPI and PARAVIEW_BUILD_PLUGIN_VRPlugin .
  • Enable PARAVIEW_USE_VRPN or PARAVIEW_USE_VRUI (Apple/Linux only) depending on input event source you wish to use.
    • If VRPN support is enabled and the library is not installed in the default paths then VRPN_INCLUDE_DIR and VRPN_LIBRARY may also need be set.

Configuring Displays

The ParaView server is responsible for configuring displays. The display configuration is stored on a ".pvx" file.

ParaView has no concept of units and therefore user have to make sure that the configuration values are in the same measurements units as what tracker has producing. So for example if tracker data is in meters, then everything is considered in meters, if feet then feet becomes the unit for configuration.

Structure of PVX Config File

<?xml version="1.0" ?>
<pvx>
  <Process Type="server|dataserver|renderserver">
    <!-- 
      The only supported Type values are "server", "dataserver" or "renderserver".
      This controls which executable this configuration is applicable to.
      There can be multiple <Process /> elements in the same pvx file.
      ------------------------------------------------------
      |  Executable     | Applicable Process Type          |
      |  pvserver       | server, dataserver, renderserver |
      |  pvrenderserver | server, renderserver             |
      |  pvdataserver   | server, dataserver               |
      ------------------------------------------------------
     -->
    <EyeSeparation Value="0.065"/> <!-- Should be specified in the configuration file-->
    <Machine Name="hostname"
             Environment="DISPLAY=:0"
             Geometry="1920x1080+0+0"
             FullScreen="0"
             ShowBorders="0"
             LowerLeft="-1.0 -1.0 -1.0"
             LowerRight="1.0 -1.0 -1.0"
             UpperRight="1.0  1.0 -1.0">
      <!--
         There can be multiple <Machine> elements in a <Process> element, 
         each one identifying the configuration for a process. 
         All attributes are optional.
         Name: Hostname of the machine on which the process will run.
         Environment: Environment variables for the process.
         Geometry: Geometry of the render window for this process.
                   Specified as "<width>x<height>+<xoffset>+<yoffset>".
         FullScreen: Ignore Geometry and render fullscreen.
         ShowBorders: Show/hide window decorations.
         LowerLeft|LowerRight|UpperRight: Define corners of the display in
                                          data coordinates.
       -->
    </Machine>
  </Process>
</pvx>

Example Config.pvx

  • The following example is for a six sided cave with origin at (0,0,0):
<?xml version="1.0" ?>
<pvx>
 <Process Type="client" />
 <Process Type="server">
 <EyeSeparation Value="0.065"/>
  <Machine Name="Front"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft=" -1 -1 -1"
           LowerRight=" 1 -1 -1"
           UpperRight=" 1  1 -1" />
  <Machine Name="Right"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft="  1 -1 -1"
           LowerRight=" 1 -1  1"
           UpperRight=" 1  1  1" />
  <Machine Name="Left"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft=" -1 -1  1"
           LowerRight="-1 -1 -1"
           UpperRight="-1  1 -1"/>
  <Machine Name="Top"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft=" -1  1 -1"
           LowerRight=" 1  1 -1"
           UpperRight=" 1  1  1"/>
  <Machine Name="Bottom"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft=" -1 -1  1"
           LowerRight=" 1 -1  1"
           UpperRight=" 1 -1 -1"/>
  <Machine Name="Back"
           Environment="DISPLAY=:0"
           FullScreen="1"
           ShowBorders="0"
           LowerLeft="  1 -1  1"
           LowerRight="-1 -1  1"
           UpperRight="-1  1  1"/>
  </Process>
</pvx>
  • A sample PVX is provided in ParaView/Documentation/cave.pvx. This can be used to play with different display configurations.

Notes on PVX file usage

  • PVX file should be specified as the last command line argument of the server processes.
  • The PVX file is typically specified for all the executables configured in it. In case of data-server/render-server configuration, if you are setting up the environment for the two processes groups, then the PVX file must be passed as a command line option to both the executables: pvdataserver and pvrenderserver.
  • When running in parallel the file is read on all nodes; hence it must be present on all nodes.
  • ParaView has no concept of units.
    • Use tracker units as default unit for corner points values, eye separation and anything else that requires real world units.

Configure Input Connections

This section details the specification of VRPN or VRUI connections using the ParaView VR plugin's user interface.

Loading the VR plugin in ParaView

  1. Start the ParaView application.
  2. Load the VR plugin:
    1. Tools >> Manage Plugins...
    2. Select "VRPlugin", click "Load Selected".
    3. If the "VR Panel" shown below does not appear, show it by checking View >> VR Panel.
      VRPanel.png


Add a New Connection

  1. Click "Add" under "VR Connections".
  2. VRPN:
    VRAddVRPN.png
    1. Select "VRPN" as the connection type.
    2. Enter a name for the connection.
    3. Specify the address of the VRPN server in the form "<device>@<hostname/IP>".
    4. Add inputs by specifying their type (tracker, button, or analog), id #, and a unique identifier, then clicking the "+" icon. The identifier should be descriptive as it will be used when configuring interactions later.
  3. VRUI:
    VRAddVRUI.png
    1. Select "VRUI" as the connection type.
    2. Enter a name for the connection.
    3. Specify the hostname or IP address of the VRUI server.
    4. Specify the port that the VRUI server is using.
    5. Add inputs by specifying their type (tracker, button, or analog), id #, and a unique identifier, then clicking the "+" icon. The identifier should be descriptive as it will be used when configuring interactions later.
  4. Click OK

Configure Interactions

  1. In the "Interactions" section of the VR Panel, configure the interation you would like to add by selecting values from the drop-down boxes. These boxes allow selection of an object, a property of that object, and an interaction style. Common combinations are:
    1. Track styles use a RenderView object and Eye Transform Matrix property.
    2. Grab styles use a RenderView object and Model Transform Matrix property.
    3. Slice Position styles use a Slice object filter and "Slice Type - Origin" property.
    4. Slice Orientation styles use a Slice filter object and "Slice Type - Normal" property.
  2. Click "Add" once the desired style, object, and property are displayed.
  3. A window will appear, displaying the various inputs needed by the interaction style. Select the input corresponding to each action using the connection and input name defined earlier.
    1. Example -- Grab Style:
      VRStyleConfig.png
  4. Click Ok

Saving/Restoring VR Plugin Configurations

The Save/Resume buttons at the bottom of the VR configuration panel can be used to write the current plugin state to a file, which can later be applied to an existing session. The file is of the format:

<VRPluginState>
  <VRConnectionManager>
    <VRPNConnection name="vrpnConnection" address="Tracker0@localhost">
      <Button id="0" name="b0"/>
      <Button id="1" name="b1"/>
      <Button id="2" name="b2"/>
      <Tracker id="0" name="head"/>
      <Tracker id="1" name="wand"/>
      <TrackerTransform value="
        1  0  0  0
        0  0 -1  1.524
        0  1  0  0
        0  0  0  1"/>
    </VRPNConnection>
  </VRConnectionManager>
  <VRInteractorStyles>
    <Style class="vtkVRTrackStyle" proxyName="RenderView1" proxy="2300" property="EyeTransformMatrix">
      <Tracker role="Tracker" name="vrpnConnection.head"/>
    </Style>
    <Style class="vtkVRGrabWorldStyle" proxyName="RenderView1" proxy="2300" property="ModelTransformMatrix">
      <Button role="Reset world" name="vrpnConnection.b0"/>
      <Button role="Rotate world" name="vrpnConnection.b1"/>
      <Button role="Translate world" name="vrpnConnection.b2"/>
      <Tracker role="Tracker" name="vrpnConnection.wand"/>
    </Style>
  </VRInteractorStyles>
</VRPluginState>

Note: the TrackerTransform entry is used to apply a transformation to all incoming tracker data for a given connection. It is not currently configurable through the GUI, and must be added manually if needed.

Start monitoring events

Ensure that the VRPN/VRUI server is running, and click "Start" to begin listening for events. The configured objects should respond to input events as specified.

Saving/Restoring Configurations

VR configurations is written into the ParaView state file. It is recommended that the VR connections and interactions are initially configured in a clean ParaView instances, and then the state is saved. To use the configuration, load the state file with the VR configuration and setup the visualization as usual.

Example System Specific Configurations