Introduction to scientific visualization in the westgrid environment
Download
1 / 68

IntroToVizInWestG.v1.. - PowerPoint PPT Presentation


  • 303 Views
  • Uploaded on

Introduction to Scientific Visualization in the WestGrid Environment Jon Johansson What is Scientific Visualization? convert scientific data into visual form use computer to process data numerical algorithms such as marching cubes to extract features

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'IntroToVizInWestG.v1..' - liam


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

What is scientific visualization l.jpg
What is Scientific Visualization? Environment

  • convert scientific data into visual form

    • use computer to process data

      • numerical algorithms such as marching cubes to extract features

      • add color, lights, camera view (create a 3D scene)

      • graphics techniques to render

    • the data sets can be large – many gigabytes or more

  • resulting image is presented to the human visual processing system for the direct analysis and interpretation of the information


What is scientific visualization3 l.jpg
What is Scientific Visualization? Environment

  • generally deals with data that has a natural geometric structure

    • MRI, CAT data (measured)

    • weather simulations (computed)


What is scientific visualization4 l.jpg
What is Scientific Visualization? Environment

  • the key point is that we can understand data in a picture much better than we can understand a bunch of numbers

  • WestGrid resources can generate a lot of numbers!!


What is scientific visualization5 l.jpg
What is Scientific Visualization? Environment

  • use well understood algorithms to extract features from data sets

  • goals

    • understand the data (exploration)

      • interactively examine the data looking for the parts that are interesting

    • communicate the data to peers

      • publications

      • conferences


What is scientific visualization6 l.jpg
What is Scientific Visualization? Environment

  • once we find interesting structures in the data we have the freedom to arrange

    • colors

    • lights

    • transparency

    • camera views

  • this should clarify what we are looking at


Westgrid visualization resources l.jpg
WestGrid Visualization Resources Environment

  • WestGrid provides a visualization server located at Simon Fraser University

  • the machine can be accessed as:

    • hydra.westgrid.ca

    • vizserver.westgrid.ca

    • IP address: 206.12.24.8

  • Hydra is an SGI Onyx UltimateVision graphics supercomputer

    • 24 processors

    • 14 GB RAM

    • 10 graphics pipes


Westgrid visualization resources8 l.jpg
WestGrid Visualization Resources Environment

  • You should have access to hydra automatically by being granted access to WestGrid resources

  • Info about accounts:

    • http://www.westgrid.ca/support//About_Accounts

  • Apply for an account at:

    • http://www.westgrid.ca/support//Applying_for_an_Account


Westgrid visualization resources9 l.jpg
WestGrid Visualization Resources Environment

Web links for more information:

  • WestGrid Collaboration/Visualization

    • http://www.westgrid.ca/collabvis/visualization/

  • Visualization Server Usage page

    • http://www.westgrid.ca/collabvis/visualization/vizserver_software.php

  • SFU Visualization Server Site

    • http://www.westgrid.ca/support_old/site/site-viz.php


Opengl vizserver l.jpg
OpenGL Vizserver Environment

  • SGI Vizserver is client-server software that allows you to run fully hardware-accelerated graphics applications on a remote machine and have images delivered to your desktop

  • the server is installed on

    • hydra.westgrid.ca

  • the client is installed on your workstation


Opengl vizserver11 l.jpg
OpenGL Vizserver Environment

  • OpenGL VizServer

    • the server software runs on the WestGrid Visualization Server machine

    • the client runs on the users desktop machine

    • http://www.sgi.com/products/software/vizserver/

  • there are currently 5 licenses for the Vizserver software on hydra


Opengl vizserver12 l.jpg
OpenGL Vizserver Environment

  • Application-transparent

    • OpenGL Vizserver runs existing OpenGL® API-based applications without modification

  • Shared application control

    • OpenGL Vizserver instantly turns existing stand-alone applications into collaborative applications with up to five remote sites sharing control of a single interactive application


Opengl vizserver13 l.jpg
OpenGL Vizserver Environment

  • Platform/system independent

    • OpenGL Vizserver gives existing workstations, personal computers, and even wireless handheld devices the power of a Silicon Graphics Prism or SGI Onyx family system, as well as direct interaction with experts on Silicon Graphics workstations.


Opengl vizserver14 l.jpg
OpenGL Vizserver Environment

  • you can run nearly any graphics or visualization application on the remote SGI host (hydra.westgrid.ca), and have the resulting imagery delivered to your desktop

  • the client machine simply decompresses and displays the image created by the server


Opengl vizserver15 l.jpg
OpenGL Vizserver Environment

  • why the Vizserver approach is better:

    • X doesn't support hardware accelerated 3D graphics

      • OpenGL function calls are passed to the graphics card on your desktop

    • the X protocol is horribly inefficient

      • Vizserver uses a much more streamlined (custom) protocol to move events and payload image data

      • data compression is available

    • Vizserver lets multiple users interact simultaneously with a single application running on the graphics server

      • each connection has a dedicated graphics pipe


Opengl vizserver16 l.jpg
OpenGL Vizserver Environment

  • OpenGL Vizserver clients are available for

    • SGI® IRIX® OS-based systems, such as Silicon Graphics Octane2, Silicon Graphics Fuel, Silicon Graphics® O2+™, and the SGI Onyx family

    • Linux®

    • Solaris™

    • Windows NT®, Windows® 2000, Windows® XP, and Windows® XP Tablet PC Edition

    • Mac OS X


Opengl vizserver17 l.jpg
OpenGL Vizserver Environment

  • the OpenGL Vizserver client is a free download from the SGI website

    • https://support.sgi.com/login

  • note that you must create a Supportfolio ID to be able to download the client

    • this is free


Connection to hydra l.jpg
Connection to Hydra Environment

  • you need to create an SSH tunnel to hydra to be able to use it.

  • from a Linux/Unix machine:

    • ssh -L 7051:hydra.westgrid.ca:7051

      -N [email protected]

    • replace “username” with your WestGrid username and you will be prompted for your password

  • 7051 is the port that vizserver uses to make connections


Connection to hydra19 l.jpg
Connection to Hydra Environment

  • you will need to set an environment variable to be able start a vizserver session:

    • VSX_SESSION_HOST = hydra.westgrid.ca

  • launch the vizserver client

    • connect to “localhost” not to hydra

    • the connection is handled by the tunnel

  • you still need to authenticate to Hydra with your WestGrid username and password.

    • http://www.westgrid.ca/collabvis/documents/vizserver_tunnel.pdf


Connection to hydra20 l.jpg
Connection to Hydra Environment

Sample session start

  • set up the SSH tunnel

  • set the environment variable (Bash shell)

    • export VSX_SESSION_HOST=hydra.westgrid.ca

  • launch the client

    • vizserver -h localhost


Opengl vizserver21 l.jpg
OpenGL Vizserver Environment

  • Sample session start (cont.)

  • enter your WestGrid user id and password to login to hydra

  • start a session

  • select parameters for the session

  • launch applications from the vizserver console window


Ssh tunneling l.jpg
SSH tunneling Environment

  • also called “port forwarding” or “port mapping”

  • forward a network port from one network node to another

  • used to carry insecure network traffic over the Internet in a secure way

  • users outside a firewall can access a service inside the firewall


Ssh tunneling23 l.jpg
SSH tunneling Environment

  • ssh connects using port 22

    • connection is encrypted and secure

  • vizserver connects using port 7051

    • connection is not encrypted

  • to make a vizserver session secure, wrap the vizserver session inside ssh


Ssh tunneling24 l.jpg
SSH tunneling Environment

  • on the source machine

    • ssh listens for packets addressed to port 7051

    • all those packets are encrypted and addressed to the destination using port 22

  • on the destination machine

    • when the packets are received, ssh decrypts them

    • packets are then sent to the destination port


Ssh tunneling25 l.jpg
SSH tunneling Environment

  • We can use a GUI and manually assign port forwarding

    • port 7051 on localhost is forwarded to 7051 on the remote host

      • this is an “outgoing” tunnel

    • we don’t need an incoming (reverse) tunnel for port 7051 - only an outgoing tunnel to the server

  • our big concern is that the username and password used to authenticate to hydra be encrypted


Scientific visualization l.jpg
Scientific Visualization Environment

  • Having opened a connection to hydra we would like to use a visualization application – what’s available?


Viz packages l.jpg
Viz Packages Environment

  • OpenDX, VTK are AVS use a pipelined, component-based architecture

  • a user can quickly assemble modular software components into a “finished application.”

  • these systems are flexible in the sense that components can be combined in a multitude of ways, thereby allowing an application developer to accomplish a wide variety of visualization tasks

  • they are extensible as they offer the means for developers to add new components to the system, thereby extending the system’s functionality


Scientific visualization28 l.jpg
Scientific Visualization Environment

  • to be able to run OpenDX on hydra:

    • set the environment variable DXROOT to

      • setenv DXROOT /usr/local/dx (tcsh)

      • export DXROOT=/usr/local/dx (bash)

    • add the following directory to your library path

      • setenv LD_LIBRARY_PATH {LD_LIBRARY_PATH}:/usr/local/lib/ (tcsh)


Scientific visualization29 l.jpg
Scientific Visualization Environment

  • In order to create a visualization:

    • import your data into the package

    • explore the data looking for the interesting features

      • lots of work here

    • having found interesting features set up the view to show them clearly. Select:

      • colors/surface properties

      • camera view

      • lights (these have some properties to adjust)

    • export images/animations


Scientific visualization30 l.jpg
Scientific Visualization Environment

  • color choice can help to clarify a visualization

  • a handy guide is the online paper “A Rule-based Tool for Assisting Colormap Selection” by Lawrence D. Bergman, Bernice E. Rogowitz and Lloyd A. Treinish, all from IBM

  • http://www.research.ibm.com/dx/proceedings/pravda/index.htm

  • lots of interesting references at the end


Scientific visualization31 l.jpg
Scientific Visualization Environment

  • another very nice online publication is “How NOT to Lie with Visualization” by Bernice E. Rogowitz and Lloyd A. Treinish, from IBM

  • http://www.research.ibm.com/dx/proceedings/pravda/truevis.htm

  • PRAVDA is intellectual property (IBM’s) separate from OpenDX and isn’t freely available

  • the papers are still worth reading


Scientific visualization32 l.jpg
Scientific Visualization Environment

Source: http://www.research.ibm.com/dx/proceedings/pravda/truevis.htm


Sample data set l.jpg
Sample Data Set Environment

  • We have the electric potential due to a dielectric cylinder introduced into a constant electric field E0

  • the parameters I used are:

    • E0 = 50 V/m

    • dielectric constant = 5

    • Rcyl = 10 m

    • -50 m ≤ x, y, z ≤ 50 m


Sample data set34 l.jpg
Sample Data Set Environment


Opendx data import l.jpg
OpenDX Data Import Environment

  • a data file might consist of ascii values, each line containing 4 values

    -8.50000000 14.72243186 48.00000000 326.96078431

    -8.50000000 14.72243186 49.00000000 326.96078431

    -8.50000000 14.72243186 50.00000000 326.96078431

    -9.50627936 14.09363873 -50.00000000 365.66830060

    -9.50627936 14.09363873 -49.00000000 365.66830060

    -9.50627936 14.09363873 -48.00000000 365.66830060

  • it’s important know how the file was written:

  • row major:

    for( i = 0; i < nx; i++){

    for( j = 0; j < ny; j++){

    for( k = 0; k < nz; k++){

    fprintf( outfh, "%12.8f %12.8f %12.8f %12.8f \n", x, y, z, V );

    }

    }

    }

  • row major is defined by the last index varying the fastest


Opendx data import36 l.jpg
OpenDX Data Import Environment

  • We have a data set that has regular spacings in the x, y and z directions

  • We don’t need to read the coordinates for each point from a file

  • The general header file to read in this data is:

    • file = ./pot_cart.dat

    • grid = 101 x 101 x 101

    • format = ascii

    • interleaving = field

    • majority = row

    • header = lines 0

    • field = potential

    • structure = scalar

    • type = float

    • dependency = positions

    • positions = regular, regular, regular, -50.0, 1.0, -50.0, 1.0, -50.0, 1.0

    • end


Sample data set37 l.jpg
Sample Data Set Environment

  • the connections between the points are inferred when you tell OpenDX that the data are “row major”

  • these are Cartesian connections


Sample data set38 l.jpg
Sample Data Set Environment

  • you can also work in non-Cartesian coordinates

  • the grid is row major in cylindrical coordinates (r, phi, z)

  • write Cartesian coordinates in the file and connections are inferred from the cylindrical grid


Sample data set39 l.jpg
Sample Data Set Environment


Sample data set40 l.jpg
Sample Data Set Environment


Data import l.jpg
Data Import Environment

  • Start with a FileSelector module to browse to the general file describing the data set and connect it to an import module which actually does the reading

  • Double click on the FileSelector to get a widget to browse the file system

  • When the data is in the package we can start applying algorithms to it and look for interesting features


Components of the visualization l.jpg
Components of the visualization Environment

  • Isovalues of the electric potential

  • The lower slice shows the electric potential with contour lines to give a sense of the shape change close to the cylinder

    • Use a slab module to extract a slice of the potential field

    • Use the Isosurface module to extract contour lines at values

      • -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts


Components of the visualization43 l.jpg
Components of the visualization Environment

  • In the Slab module set the parameters:

    • dimension: “z”

    • position: 0

    • thickness: (0 or 1)

      • this is the default

  • The AutoColor module generates a color map so that we have something to see



Components of the visualization45 l.jpg
Components of the visualization Environment

  • Take the output of the Slab module and attach it to the input of an Isosurface module

    • The 2D slab data will result in contour lines

    • Set the isovalues at

      • -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts

  • The contour lines are then passed to a Tube module

    • Set the diameter of the tube to 1.0



Components of the visualization47 l.jpg
Components of the visualization Environment

  • Electric field lines

  • The middle slice is color mapped to the magnitude of the electric field and shows some field lines

    • The lines are diverted in the region of the cylinder

  • Use the Gradient module and the Compute module to calculate the electric field from the electric potential

    E = - gradj


Components of the visualization48 l.jpg
Components of the visualization Environment

  • Use a Slab module to extract a slice of the electric field

  • Use the Streamline module to extract contour lines at values

    • The Streamline module needs the vector field as one input, and a set of seed points as the next input

  • Use the Tube module to produce lines with some thickness


Components of the visualization49 l.jpg
Components of the visualization Environment

  • Use the Compute module after the gradient to negate the vector components

  • In the Compute module set “expression” to

    [-a.x, -a.y, -a.z]

  • In Slab set

    • dimension: “z”

    • position: 50

    • thickness: (0 or 1)

      • this is the default



Components of the visualization51 l.jpg
Components of the visualization Environment

  • To calculate streamlines connect the Electric Field (output of Compute) to the left input of the Streamlines module

  • Use another Slab module to extract a line of points to use as seeds for the stream line

    • Dimension: “x”

    • Position: 0

  • Use Reduce to decrease the number of points by 4

  • Use Tube with diameter 1.0



Components of the visualization53 l.jpg
Components of the visualization Environment

  • The top slice shows vector glyphs at some grid points of the electric field

    • The glyphs show the direction of the field

    • The size of the glyphs is scaled to the magnitude of the field


Components of the visualization54 l.jpg
Components of the visualization Environment

  • Insert a Reduce module and a Glyph module between Slab and Collect

  • The Slab module parameters:

    • Dimension: “z”

    • Position: 100

  • The Reduce module has

    • Factor: 4.0

  • In the Glyph module

    • Type: “rocket”

    • Shape: 1.0

    • Scale: 0.15

    • Ratio: 0.1



Components of the visualization56 l.jpg
Components of the visualization Environment

  • We have applied some visualization techniques to the data and created 3 slices

  • pretty, but what does it mean??

  • this lacks context

  • need some information to help the viewer understand what we are looking at


Components of the visualization57 l.jpg
Components of the visualization Environment

  • Annotations – add these to provide the context for the visualization

  • ShowBox lets the viewer know the volume of space occupied by the data

  • Text: titles, labels – explain a bit

  • Axes provide orientation and scale

  • ColorBar – shows how the numbers are mapped to color

  • Draw the cylinder so we see the cause of all the trouble


Components of the visualization58 l.jpg
Components of the visualization Environment

  • The ShowBox module draws a box around the extents of the data set

    • Use a Tube module to get nicely rendered lines

  • Caption modules allow you to place text in the 2D plane of the screen

    • Set the text and location in the interface



Components of the visualization60 l.jpg
Components of the visualization Environment

  • A very useful annotation in this visualization is some indication of where the cylinder actually is

    • It is, after all, the source of all the disruption in the field


Components of the visualization61 l.jpg
Components of the visualization Environment

  • Use the Construct module to create a line

    • Origin: {[0 0 -50]}

    • Deltas: {[0 0 1]}

    • Counts: [1 1 101]

    • Data: {1}

  • The Tube module creates a cylinder around the line

    • Diameter: 20.0

    • Ngon: 25

  • The Color module does just that

    • Color: “purple”

    • Opacity: 0.3



Components of the visualization63 l.jpg
Components of the visualization Environment

  • When we put it all together and select the camera angle that we want we hopefully have what we want …

  • My goals

    • Show a variety of techniques that I can apply to this data set

    • Provide enough annotation to orient the viewer

    • Make it look nice


Debugging l.jpg
Debugging Environment

  • Debugging

  • Sometimes things aren’t working and you just don’t know why

  • OpenDX’s equivalent of the “print” statement is the Describe module

  • Attach the Describe module to the output port of any module that is providing a field and Describe will give you a summary of what the module is providing in the Message Window.


Debugging66 l.jpg
Debugging Environment


Scientific visualization67 l.jpg
Scientific Visualization Environment

  • lots of info on the web

  • we have some introductory pages at

    • http://sciviz.aict.ualberta.ca


The end l.jpg
The End Environment

  • Questions?


ad