Date post: | 14-Jun-2018 |
Category: |
Documents |
Upload: | phamnguyet |
View: | 225 times |
Download: | 0 times |
2
Outline
● What is scientific visualization?● ParaView and visualization pipelines● data import● 1D, 2D, 3D data visualization● Isosurfaces and volume rendering● Data sets and formats● Putting it all together
3
Agenda (approximate)
● 9-10:30 - Introduction to Visualization and Paraview● 10:30 - 10:45 Coffee break● 10:45 - 12:00 Hands-on Activities● 12:00 - 1:00 Lunch Break● 1:00 - 2:30 Hands-on Activities cont.● 2:30 - 2:45 Coffee Break● 2:45 - 4:00 Project
Introduction to visualization and ParaView
Coffee
Hands-onActivities
Lunch Hands-onActivities
Coffee
Project
9:00 10:00 11:00 12:00 1:00 2:00 3:00
4
Acknowledgements: Workshop History
● Based on UofA Vis Workshop– Jon Johansson, Chris Want @ UofA
● Original materials and data sets
– Delivered many times at UofA
– BCNet/HPCS 2012 in May
– Westgrid Visualization Roadshow● SFU (2), USask, URegina
– HPCS 2013 - Brian Corrie
– Today at McGill
5
Are you ready?
● Ensure that you have:– Paraview installed on your laptop
– paraview.zip - execise files● unzip paraview.zip (Linux/Unix)● double click (Mac/Windows)
– PVExercises.pdf - exercise descriptions
6
What is Scientific Visualization?
● Data into knowledge: Visualization presents scientific data to the human visual and cognitive system for analysis and interpretation
● The goal: extract/communicate knowledge/insight.● Our goal: Convert scientific data into visual form
– Exploration: understand the data– Interactively examine the data – Looking for aspects of the data that are interesting– Communication: communicate the data to peers
● within the research group● to external community (presentations, publications)
7
Neo: Do you always look at it encoded?Neo: Do you always look at it encoded?Cypher: You get used to it. All I see is blonde, brunette, red-head...Cypher: You get used to it. All I see is blonde, brunette, red-head...
8
9
ParaView
● Paraview provides a full set of tools for manipulating, transforming, processing, rendering and animating data
● Allows for visualization and analysis methods based on points, lines, areas, volumes, images or geometric primitives in any combination
● Provides powerful parallel execution and advanced display (3D stereoscopic viewing)
● http://www.paraview.org
10
ParaView
● Project began in 2000– Kitware, Inc. and Los Alamos National Laboratory.
● ParaView is open source– ParaView is supported by Kitware
– Kitware contributes to ParaView development
● ParaView is built on top of the Visualization Toolkit (VTK)– VTK came out of GE Research
● First public release in October 2002: ParaView 0.6
11
ParaView Architecture
● ParaView uses a client-server model– In stand-alone mode the client does all processing
on the local machine
● The client process is the user interface– it always runs on a workstation (desktop)
● The server does computation– In a single process on a local/remote machine, or
– In many processes on a cluster
12
Paraview Modes
● Stand-alone mode– Computations and user
interface are run on same machine
● Client/server mode– Computations are run on
a server
● Parallel mode– Server launches an mpi
job on a cluster
13
Exercise 1: Starting ParaView
● Linux/Unix: type paraview● Windows: Select paraview from start menu● Mac: click ParaView in App folder● ParaView GUI should start up● The server “pvserver” is run for you
14
Optional Exercise: Connect to Guillimin
● log in – ssh [email protected]
● Start an interactive job on lmgpu– msub -q lmgpu -I -l
nodes=1:ppn=1,walltime=1:00:00
● Wait for job to start● Start the paraview server
– module load paraview
– pvserver
● Set up port forwarding– ssh guillimin.clumeq.ca -L
11111:lm-2r02-n79:1111
● In local ParaView– File > Connect > Add Server
– localhost:11111
– Click Configure > Manual > Save
– Click Connect
This is not necessary for today, the lab workstations haveplenty of power for our data sets
We will develop Guillimin's remote visualization capabilitiesas phase II comes online and with user interest
15
ParaView Interface
Menus
Toolbars
PipelineBrowser
ObjectInspector
3D view
16
Visualization Pipeline
Reader Filter Filter Mapper Renderer
Imports data from a source(e.g. data file)
modify and/ormanipulatedata
modify and/ormanipulatedata
Transform datato geometry(e.g. points, lines, polygons,colours)
Converts geometryinto an image(e.g. pixels,vector graphics,polygons, volume rendering)
Filter
modify and/ormanipulatedata
17
Visualization Pipeline
● Most visualization packages use a pipeline model (ParaView, VTK, VisIT, Avizo)
● Pipeline components can be combined in many different ways to create a visualization
● Developers can add new components to the system to extend the package's functionality– ParaView allows python scripts as filters
18
Object-Based Rendering
● Object based model with lighting● Arrange the view (camera)● Render image from the camera position
19
Object Rendering
● Results in an image as seen from the camera's viewpoint
● Lights give shading, highlights and can modify color
● Surfaces nearest the camera occlude those behind
20
ParaView Objects
● ParaView supports many techniques for generating renderable objects from data.
● For scalar data these include:– Points and glyphs
– Contours and isosurfaces
– Histograms
– Two-dimensional and three-dimensional plots
● For vector data– Arrow plots, streamlines, etc
21
ParaView Objects
● Annotations– Ribbons, tubes, axes, text
– Display of data locations, meshes and boundaries
● Data interactions are also supported:– probing (selecting a location in a volume)
– picking (selecting a location on the surface of an object)
– arbitrary surface and volume sampling
– arbitrary cutting/mapping planes
22
Importing Data
● Avoid data conversion!● For best results generate your
data in a vtk file format– STRUCTURED_POINTS
– STRUCTURED_GRID
– RECTILINEAR_GRID
– UNSTRUCTURED_GRID
– POLYDATA
– VTK XML
● Many common scientific data file formats can be opened and visualized
23
ParaView Data Formats
● VTK: .vtk, .pvtk, .vtp, .vtu, .vti, .vts, .vtr, .pvtp, .pvtu, .pvti, .pvts, .pvtr, .vtm, .vtmb, .vthb● Paraview: .pvd● Self-describing data formats: HDF5, netCDF● Ensight: .case, .sos● Protein Data Bank: .pdb● Xmol Molecule Files: .xyz● Gaussian Cube Files: .cube● POP Ocean Files: .pop● Images: .png, .tif● RAW (binary): .raw● lots of others, look at: File → Open File → Files of type:● Open Source: Add a custom reader for your own data format
24
Pipelines
● A program in ParaView is called a “visualization pipeline”
● The eye icon controls whether the output of a fileter is visible in the active window
● Data flows from the data source/reader down through the filters
PVServer →Data Source →
Filters →
Data
Flo
w
25
Pipelines
● The highlighted filter can be configured through the “Object Inspector”
● The data produced by the filter is described in the “Information” tab
26
Pipelines
● You can change a filter's behaviour in the “Properties” tab
● Click “Apply” when you want your changes to take effect
27
Exercise 2: Pipelines
● File->Open the sample data set paraview/Bumps/Bumps.vtk
● Change the colors for the data– Properties->Edit
– Select the “Rainbow” colormap
28
29
Exercise 2: Pipelines
● Add dimension to data– Use WarpByScalar filter
– Uses scalar value as Z-dimension
● Scale magnitude of offset– Set the scale factor to 5
30
Exercise 3: ParaView Windows
● Reproduce this image:– Use objects from the
“Sources” menu● Cone● Sphere● Box● Cylinder
– Use the icons in the upper right of a window to split the view
31
ParaView Views
● ParaView has many types of views
● Some filters open a view window suitable to the filter's output– e.g. histograms
32
Exercise 4: 1D data
● Please do activity 2 from the handout
● You will recreate the plots seen here
33
Exercise 5: 2D data
● Please do activity 3 from the handout
● You will recreate the plots seen here
34
Exercise 6: Animation
● ParaView is capable of easily making simple animations– Not designed for complex animations
● Activity: Please do activity 4 from your handout
35
Exercise 7: 3D Data
● 3D regular grid data - e.g. Medical CT scan● Slice planes through gridded data● Please reconstruct the following image using
Slice filters on the jaw_16bit.vti data file:
36
Exercise 8: Isosurfaces
● Use isosurfaces to generate the visualization– 3D-Data/jow_8bit.vti
● Isosurfaces with different colours represent the jaw, spine and skin
37
Big Project: Electric Field
● Let's put together what we've learned to create a visualization project involving:– A scalar field
– A vector field
– Annotations
38
Electric Potential
● Consider the electric potential due to a dielectric cylinder introduced into a constant electric field, .
● The parameters used are:
39
The Goal: Create this visualization
40
Task 1: Create a VTK File
● In the directory paraview/EPot is a file containing the electric potential data in ascii text format
● Add an appropriate header to create a vtk file (hint: refer to Bumps.vtk)– The origin is -50 for each axis
– The data spacing is 1 with 101 points along each axis
– There are 1013 points in the volume
41
Task 2: Slice the data set
● Open your .vtk file with ParaView
● Add a slice filter– Origin = 0, 0, -49.99
(not -50.0)
– Z Normal
42
Task 3: Contour Lines
● Add a contour filter– Delete the default range and click on Add Range
● From = -1750, To = 1750, Steps = 8
● This adds 8 lines● Can you make them tubes?
43
44
Task 4: Compute Electric Field
● Use the Gradient filter and the Calculator filter to compute the electric field from the electric potential:
– Use the Gradient filter on the potential
– In the properties tab of the Calculator set Result Array name to ElectricField
– Calculate the expression:
-EPotentialGradient
45
Electric Field
● Use a slice filter to put a slice in the center of the volume
● If the input of the slice is a vector field, the magnitude will be displayed
46
Magnitude of the Electric Field
47
Streamlines
● Use a StreamTracer filter to the Calculator generating the Electric field
● Use a line source to seed the streamlines– Seed Type: Line Source
– Point1 = (50,50,0)
– Point2 = (50,-50,0)
– Resolution=10
● Add tubes to the lines
48
Streamlines
49
Glyphs
● The top slice of our goal visualization shows glyphs at some grid points of the electric field– Arrows indicating the direction and magnitude of the vector field
● Add a slice filter to the Calculator filter (electric field)– Origin=(0,0,50)
● Use a MaskPoints filter to control the points in the slice that will be glyphed– Set On Ratio to 10, Check the Random box with Randomized ID strides
● Add a Glyph module with– Glyph Type: Arrow
– Scale Mode: Vector
– Adjust the arrow size parameters to your liking
50
Glyphs
51
Final view of the data
● We have created three visualizations of the data on three different slices
● We are still lacking context!
● Add information to help the viewer understand what they are looking at
52
Adding Meaning
● Annotations: titles, labels, explanations● Outline: define the volume of space being
visualized● Axes: orientation, scale● Legend: map the colours to a scale● Geometry: Add a cylinder to represent the
dielectric cylinder
53
Annotations
54
Adding Meaning
● Annotations: titles, labels, explanations– Sources -> Text
● Outline: define the volume of space being visualized– Use “Outline” filter on original
data, add tubes
● Axes: orientation, scale– Display tab, “Show Cube
Axes”
● Legend: map the colours to a scale– Display tab, Edit Color Map
● Geometry: Add a cylinder to represent the dielectric cylinder– Sources -> Cylinder
– Height: 100
– Radius: 10
– Resolution: 50
– Opacity: 0.5– Orientation: (90,0,0)
55
Putting it all together...
56
Putting it all together...
● Goals of the exercise...– Extract relevant information from the data set
– Show a variety of techniques that can be applied to the data set
– Provide enough annotation to orient the viewer
– Provide a visualization that communicates insight/understanding
57
Visualization Information
● Compute Canada– http://computecanada.ca/index.php/en/resources/visuali
zation
● Software– Kitware - http://www.kitware.com
– ParaView - http://www.paraview.org
– VTK - http://www.vtk.org
– VisIT - http://wci.llnl.gov/codes/visit/
– Avizo - http://www.vsg3d.com/avizo/overview
58
The End
What questions do you have?