Scientific Visualization Module

Overview

What is Scientific Visualization?
[Source]

Scientific visualization primarily concerned with the visualization of three dimensional phenomena like architectural, meteorological, medical, biological, etc.
Its emphasis is on realistic renderings of volumes, surfaces, illumination sources, and so forth, perhaps with dynamic (time) component.

The benefits include improved communication and efficiency as well as better management and decision making.

Visualization Pipeline

Basics of Visualization

The fundamental concept of visualization involves the transformation of raw data into meaningful visual representations, which serve the purpose of providing valuable insights.




Scientific Visualization Pipeline:


Adapted from BU Tech



  1. Produce Data


    1. Simulated Data
    2. Images
    3. Numerical
    4. Some measured value
    5. Observed phenomena

  2. Analyze, Filter, Reformat


    Cleaning up the data

    1. Removing noise
    2. Replacing missing values
    3. Clamping values to be within a specific range of interest

    Performing operations to yield more useful data

  3. Apply SciVis Techniques


    Converts raw information into something more understandable.

    Visually extracting meaning from a scinetific dataset using various techniques.

  4. Map to Geometry


    1. Scalars, vectors, tensors
    2. 1D, 2D, 3D
    3. Mesh

  5. Render, Post Process

  6. Results



Visualization Toolkit [VTK]
  1. Open source, multiplatform
  2. Supports distributed computation models
  3. Extensible, modular architecture
  4. Available for 3D computer graphics, image processing and visualization
  5. Collection of C++ libraries
  6. Leveraged by many applications
  7. Divided into logical areas
    1. Filtering
    2. Information Visualization
    3. Volume Rendering
  8. Cross platform, using OpenGL
  9. Wrapped in Python, Tool Command Language (TCL) and Java

Software: ParaView

Paraview is a powerful software tool widely used in scientific visualization to explore and analyze complex data sets. Designed for researchers and scientists, Paraview facilitates the creation of interactive and immersive visualizations that provide deeper insights into scientific phenomena. With its versatile range of visualization techniques and advanced rendering capabilities, Paraview enables the representation of diverse data types, including numerical simulations, computational models, and experimental results. Its intuitive interface and extensive customization options make it a valuable tool for understanding and communicating scientific data effectively.

It is an end-user application with support for:
1. Parallel Data Archiving
2. Parallel Reading
3. Parallel Processing
4. Parallel Rendering
5. Single node, Client-Server, MPI Cluster Rendering

More Paraview features:



Paraview Summary:

Basics of Paraview
  1. Data Ranges



  2. Supported Data Types


    It is an end-user application with support for:
    1. Point Data
    2. Polygonal data
    3. Images
    4. Multi-block
    5. Adaptive Mesh Refinement
    6. Time series support

  3. Supported Visualization Algorithms

  4. Special Features

  5. Supported File Formats

  6. Visualization Pipeline

  7. Visualizing Data using Paraview

Tutorial

ParaView is a powerful scientific visualization software that empowers researchers and scientists to explore, analyze, and communicate complex data sets. By providing an intuitive and versatile platform, Paraview enables the transformation of scientific data into visually compelling representations, facilitating the understanding of intricate patterns and structures. With its extensive range of visualization techniques and interactive features, Paraview offers an essential tool for investigating scientific phenomena, uncovering insights, and conveying findings effectively in various fields such as physics, engineering, medicine, and environmental sciences.

We will be going through the steps to create visualizations using Paraview.

Step 0: Understanding the Interface

  1. User Interface
  2. Figure 1 Screenshot
    Figure 1: User Interface
  3. Simple Camera Manipulations

    1. Drag left, middle, right buttons for rotate, pan and zoom.
    2. Also use Shift, Ctrl, Alt modifiers
    3. Also try holding down x, y, z
    4. Figure 2 Screenshot
      Figure 2: Camera Manipulations
  4. Getting Back Graphical User Interface(GUI) Components

    1. Menu Bar
    2. View -> Toolbars
    3. Figure 3 Screenshot
      Figure 3: GUI Interface
  5. Help Menu
  6. Figure 4 Screenshot
    Figure 4: Help Menu
  7. Undo/Redo
  8. Figure 5 Screenshot
    Figure 5: Undo/Redo
  9. Copy/Paste/Reset/Save Parameters
  10. Figure 6 Screenshot
    Figure 6: Copy/Paste/Reset/Save Parameters
  11. Pipeline Object Control
  12. Figure 7 Screenshot
    Figure 7: Pipeline Object Control
  13. Using Auto Apply

    1. Click Auto Apply.
    2. Change the Resolution parameter (or any other parameter).
    3. Note that the visualization automatically updates without having to hit Apply.
    4. Figure 8 Screenshot
      Figure 8: Auto Apply

Step 1: Creating a Cylinder Source

  1. Go to the Sources menu.
  2. Select Geometric Shapes.
  3. Select Cylinder.
  4. Figure 9 Screenshot
    Figure 9: Sources
  5. A Cylinder1 object should appear in the pipeline browser
  6. If the cylinder does not automatically appear in the 3D viewer click the Apply Button (on the Properties Tab)
  7. Figure 10 Screenshot
    Figure 10: Creating Cylinder
  8. Explore the resolution feature
  9. Adjust the Resolution slider
  10. Figure 11 Screenshot
    Figure 11: Resolution slider
  11. Explore the resoulution feature by adjusting the Resolution slider or type in a value.
  12. Click the Apply button to accept changes.
  13. Display Properties
  14. Figure 12 Screenshot
    Figure 12: Display Properties
  15. Change Render Properties

    1. Scroll down to the Display (Geometry Representation) section
    2. Click the Edit button. This button is replicated in the tool bar
    3. Select a new color for the cylinder.
    4. Figure 13 Screenshot
      Figure 13: Edit Color
  16. Render View Options
  17. Figure 14 Screenshot
    Figure 14: Render View Options
  18. Resulting Cylinder
  19. Figure 15 Screenshot
    Figure 15: Resulting Cylinder
  20. Changing the Color Palette

    1. Make sure the orientation axes are visible in the lower left corner.
    2. Click the color palette button and change the colors.
    3. Try several color palettes or edit the current color palatte.
  21. Edit Color Palette
  22. Figure 16 Screenshot
    Figure 16: Edit Color Palette
  23. Choose Color Palette
  24. Figure 17 Screenshot
    Figure 17: Choose Color Palette
  25. Advanced Properties
  26. Figure 18 Screenshot
    Figure 18: Advanced Properties
  27. Searching Properties

    1. Type “specular” in the properties search box
    2. Change Specular value to 1 (makes the cylinder shiny)
    3. Figure 19 Screenshot
      Figure 19: Specular
    4. Other interesting properties incluse Axes Grids and Opacity amongst others.

Step 2: Let's start working with Training data.

  1. Click on the button on the banner saying “Edit” and then "Reset".
  2. Figure 20 Screenshot
    Figure 20: Paraview Interface
  3. Click on the button on the banner saying “File” and then "Open" after locating the file 'headsq.vti'
  4. Figure 21 Screenshot
    Figure 21: Open File
    1. New Object in Pipeline Browser
    2. Click Apply to update the viewer window if necessary.
    3. Figure 22 Screenshot
      Figure 22: Viewer
    4. You should see a bounding box in the 3D viewer window
    5. Figure 23 Screenshot
      Figure 23: Viewer with bounding box

Step 3:: Creating an Isosurface

  1. On the upper ribbon, you will find a tab called "Filters". Click on Common and then Contour
  2. Figure 24 Screenshot
    Figure 24: Isosurface Selections
  3. A new object appeared in the pipeline browser (Contour 1)
  4. Contour – Extracts the points, curves, or surfaces where a scalar field is equal to a user-defined value.
    The surface is often also called an isosurface.
  5. Figure 25 Screenshot
    Figure 25: Isosurface
  6. Value Range for the data set is now visible
  7. Figure 26 Screenshot
    Figure 26: Value Ranges
  8. Value Range for the data set is [ 0, 4095 ]
  9. Only one value is showing: 2047.5
  10. Click Apply to see what points, curves, or surfaces in the dataset have a value of 2047.5
  11. Figure 27 Screenshot
    Figure 27: Value Range Selections
  12. If you do not see anything in the 3D window click the eye icon next to Contour1 in the Pipeline Browser
  13. This allows you to toggle between views in the 3D Viewer
  14. Figure 28 Screenshot
    Figure 28: 3D Viewer

  15. Visually explore the dataset by looking at the visualization from all angles.
  16. Figure 29 Screenshot
    Figure 29: Visualization from different angles


    Figure 30 Screenshot
    Figure 30: Visualization from different planes

Step 4:: Isosurfaces


You should be here:
Pipeline Browser:
1. Two Objects
2. Value Range [0, 4095]

  1. Select 2047.5 showing in Value Range. Selecting the value should highlight it.
  2. Delete that value (click the minus button to remove all values)
  3. Figure 31 Screenshot
    Figure 31: Delete Values
  4. Click the button below the minus button to: Add a Range Of Values
  5. Figure 32 Screenshot
    Figure 32: Range of Values
  6. Should see the Add Range Window

    1. Use this window to set the range of values
    2. For this tutorial
      Min: 0
      Max: 4095
    3. Feel free to pay around with the range (between 0 and 4905)
    4. Click OK
    5. Figure 33 Screenshot
      Figure 33: Range of Values
    6. Notice the Value Range: [0, 4095]
      There are 10 values (steps) showing values between 0 and 4095
    7. Figure 34 Screenshot
      Figure 34: Range of Values Steps
  7. Apply the Contour
  8. Figure 35 Screenshot
    Figure 35: Contour
  9. This may take a few seconds to render.
  10. Figure 36 Screenshot
    Figure 36: Rendered Visualization
  11. Explore the rendering.
  12. Figure 37 Screenshot
    Figure 37: Explore Rendered Visualization

Step 5:: Explore the data set


Let's start working on varying the set value range
  1. Reset Vaues

    1. Click red X – Remove all entries.
    2. Figure 38 Screenshot
      Figure 38: Remove entries
    3. Click Add a range of values button
    4. Figure 39 Screenshot
      Figure 39: Add Range
    5. Click OK.
    6. Click Apply.
  2. You should be here:
  3. Figure 40 Screenshot
    Figure 40: You should be here
  4. Clip Isosurface

    1. CLIP - Intersects the geometry with a half space.
      The effect is to remove all the geometry on one side of a user-defined plane.
    2. Select Contour 1: (in pipeline Browser)
    3. Filters
    4. Common
    5. Clip
    6. Figure 41 Screenshot
      Figure 41: Clip
    7. A new object appeared in the pipeline browser (Clip 1).
    8. Clipping plane (see red vertical line and horizontal arrow)
    9. Figure 42 Screenshot
      Figure 42: Clipping Pane
    10. Select the arrow point (arrow turns red)
    11. Rotate (drag) the arrow point until the arrow is pointing out of the screen toward you
    12. Figure 43 Screenshot
      Figure 43: Arrow
    13. Resulting visualization.
    14. Figure 44 Screenshot
      Figure 44: Resulting Visualization
    15. Click Apply after making your selection.
    16. Figure 45 Screenshot
      Figure 45: Apply
    17. Make sure the eye icon is not greyed out on the Clip1 object in the Pipeline Browser
    18. Figure 46 Screenshot
      Figure 46: Eye
    19. Rotating the view reveals the clipped isosurface
    20. Figure 47 Screenshot
      Figure 47: Rotated Views
    21. Click Apply after making your selection.
  5. Inside Out Property

    If this property is set to 0, then clip filter will return that portion of the dataset that lies within the clip function.

    If set to 1, the portions of the dataset that lie outside the clip function will be returned instead
    Figure 48 Screenshot
    Figure 48: Inside Out Property
    Slice Isosurface

    1. Click the eye icon next to Clip1 in the pipeline browser (hide the clip plot).
    2. Select Contour 1
    3. Figure 49 Screenshot
      Figure 49: Eye
    4. Select Filters then Common and finally Slice.
    5. On the map, click any state to view the pop-up. It should look like this:
      Figure 50 Screenshot
      Figure 50: Filters
    6. Select Slice1.
    7. Figure 51 Screenshot
      Figure 51: View
    8. Resulting Visualizations
    9. Figure 52 Screenshot
      Figure 52: Resulting Visualizations
    10. Click Apply
    11. Figure 52 Screenshot
      Figure 53: Summary
  6. Pipeline Browser
  7. Figure 54 Screenshot
    Figure 54: Pipeline Browser

Step 6:: Saving your work.


There are many options to save your work:
Figure 55 Screenshot
Figure 55: Saving Pane
  1. Save State
    It saves the state of the visualization pipeline itself, including all the pipeline modules, views, their layout, and their properties.
    This is referred to as the application state or, just, state.

    In Paraview, you can save the state using the File Save State . . . menu option.
    Conversely, to load a saved state file, you can use File Load State. . . .
  2. Save Data
    You can save the dataset produced by any pipeline module in ParaView, including sources, readers, and filters.
    To save the dataset in paraview, begin by selecting the pipeline module in the Pipeline browser to make it the active source.
    For modules with multiple output ports, select the output port producing the dataset of interest.
    To save the dataset, use the File Save Data menu or the button in the Main Controls toolbar. You can also use the keyboard shortcut Ctrl + S (or + S ).

    The Save File dialog will allow you to select the filename and the file format. The available list of file formats depends on the type of the dataset you are trying to save.
  3. Save Screenshot
    To save the render image from a view in paraview, use the File Save Screenshot menu option. This will pop up the Save Screenshot Options dialog.

    This dialog allows you to select various image parameters, such as image resolution and image quality (which depends on the file format chosen).
    Figure 56 Screenshot
    Figure 56: Screenshot Dialog
    The dialog also provides an option to change the color palette to use to save the image using Override Color Palette.

    By default, Paraview will save rendered results from the active view. Optionally, you can save an image comprising of all the views layed out exactly as on the screen by unchecking the Save only selected view button.

Conclusion

After following this tutorial you should be able to get started with creating custom scientific visualizations using Paraview.
here are some additional resources to help you learn more about using Paraview:

  1. ParaView Documentation: The official ParaView documentation is an excellent resource for understanding the software's features, workflows, and capabilities. It provides detailed explanations, tutorials, and examples to help users get started and explore advanced topics. You can find the documentation at: https://docs.paraview.org/
  2. ParaView Tutorial Videos: The ParaView website offers a collection of tutorial videos covering various aspects of using ParaView for scientific visualization. These videos provide step-by-step instructions and demonstrations, making it easier to grasp the software's functionality. You can access the tutorial videos at: https://www.paraview.org/tutorial/
  3. ParaView Guide: "The ParaView Guide" is a comprehensive book written by the creators of ParaView. It provides in-depth coverage of ParaView's features, including data processing, visualization techniques, and advanced topics. The guide offers practical examples and insights into effective scientific visualization practices. You can find the book on the ParaView website or online booksellers.
  4. Online Courses and Webinars: Several online platforms and institutions offer courses and webinars specifically designed to teach ParaView. These resources provide structured learning experiences, often with hands-on exercises, to help users gain proficiency in using the software. Platforms like Coursera, Udemy, and edX may have relevant courses available.
  5. Example Data and Tutorials: ParaView provides a collection of example datasets and tutorials that cover various scientific visualization scenarios. These resources can be accessed within the software itself and offer practical hands-on experience to learn specific visualization techniques and workflows.

ParaView and Python Shell

We will be going through the steps to utlize the Python Shell for scripting in Paraview.

Step 0: Setting up the Python Shell

  1. Click on Edit in the toolbar and select Reset Session.
  2. Setting up the Python Shell
  3. Figure 1 Screenshot
    Figure 1: User Interface
  4. Click on View in the toolbar and check the Python Shell.
  5. Figure 2 Screenshot
    Figure 2: View Options
  6. Interface
  7. Figure 3 Screenshot
    Figure 3: Shell visible in interface
  8. About ParaView and Python Shell

    1. You can copy commands from elsewhere and paste them into the Python Shell
    2. Python is case sensitive. Be sure to use the correct capitalization as shown.
    3. Python is indent sensitive. Be sure to not indent.
  9. Saving your output

    1. Save a Screenshot
    2. Must show render window and python scripting window
    3. Save as PythonScritping output

      LastnameFirstInitial_ParaViewPythonFig#.jpg

Step 1: Creating a Pipeline

  1. Type the following into the Python Shell.

    >>> sphere = Sphere()
    >>> Show()
    >>> Render()
    >>> ResetCamera()
  2. Figure 4 Screenshot
    Figure 4: Sphere
  3. In Python Shell create a source

    >>> sphere = Sphere()
    >>> Show()
    >>> Render()
    >>> ResetCamera()
  4. Then feed that into a filter

    >>> Hide()
    >>> shrink = Shrink()
    >>> Show()
    >>> Render()
  5. Figure 5 Screenshot
    Figure 5: Sphere with filter

Step 2: Changing Properties

  1. Get listing of sphere’s properties

    >>> dir(sphere)
  2. Examine and then change one

    >>> print(sphere.ThetaResolution)
    >>> sphere.ThetaResolution=16
    >>> Render()
  3. Change a different filter

    >>> shrink.ShrinkFactor = 0.25
    >>> Render()
  4. Figure 6 Screenshot
    Figure 6: Sphere with different properties

Step 3: Branching and Merging Pipelines

  1. Feed sphere’s output into a second filter

    >>> wireframe = ExtractEdges(Input=sphere)
    >>> Show()
    >>> Render()
  2. Feed two filters into one

    >>> group = GroupDatasets(Input=[shrink,wireframe])
    >>> Show()
    >>> Hide(shrink)
    >>> Hide(wireframe)
    >>> Render()
  3. Change a different filter

    >>> shrink.ShrinkFactor = 0.25
    >>> Render()
  4. Figure 7 Screenshot
    Figure 7: Group Datasets

Finding Pipeline Objects

  1. GetSources() - Returns a list of objects listed in the Pipeline Browser
  2. GetActiveSource() - Returns the object selected in the Pipeline Browser
  3. SetActiveSource() - Sets the object selected in the Pipeline Browser to the given object

Exercise

  1. Create a new pipeline

    >>> cone = Cone()
    >>> help(cone)
  2. This gives you the full list of properties. What is the resolution?

    >>> cone.Resolution
  3. Increase the resolution to 32.
  4. What is the cone’s center? Change the center to 1, 2, 3.

    >>> cone.Center=[1,2,3]
  5. Apply a shrink filter to the cone.

    >>> shrinkFilter = Shrink(cone)
    >>> shrinkFilter.Input
  6. Create a Cone Object

    >>> shrinkFilter.UpdatePipeline()
    >>> shrinkFilter.GetDataInformation().GetNumberOfCells()
    >>> shrinkFilter.GetDataInformation().GetNumberOfPoints()
  7. What we did:

    1. Create Cone Object
    2. Set Cone Resolution
    3. Set Cone Center Properties
    4. Apply Shrink Filter to the Cone
    5. Update Pipeline
  8. Rendering

    Two objects are needed to render the output

    1. A representation – takes a data object and renders it in a view
    2. A view – is responsible for managing a render context and a collection of representations
    3. Rendering the Object

      >>> Show(shrinkFilter)
      >>> Render()
    4. Figure 8 Screenshot
      Figure 8: Rendering Shell Output

Review

Horizonal assessment of GIS core concepts mapped to Bloom’s Taxonomy of Hierarchical Learning

What you should know:

Bloom’s Taxonomy Hierarchy You should know
Remember Recall basic GIS concepts.
Understand Define basic GIS concepts.
Apply Use symbolization, classification, and data skills to make a new map for different regions.
Evaluate Consider ethical and communications implications of your chose of variables, colors and map projects in in your final visualizations
Analysis Compare and contrast different physical or cultural regions, question the difference that imagery at a different scale would make on your assessment of land and use change
Create Design, create, and give a presentation using multimedia web-GIS maps and web mapping applications.


Resources
Download ParaView
Effective Mapping in Tableau

What you should be able to do:

You should be able to do
Factual Understand terms such as plate, continent, ocean, fault line, depth, magnitude and others.
Conceptual Understand how different variables affect overall quality of geographic content
Procedural Demonstrate how to perform specific tasks in a geographic information system (GIS) , collect data, and map results.
Metacognitive Apply strategic knowledge about to approach a problem using GIS, spatial data, and the spatial perspective.