Paraview + Volume Rendering tutorial
Overview
Volume rendering is a technique for visualizing 3D datasets, such as MRI or CT scans. In this tutorial, we'll be looking at two pieces of software for visualizing volumetric data: Paraview and Ben's Volume Renderer. Paraview is a popular application for scientific data visualization, which supports a wide variety of data formats and rendering algorithms. Ben's volume renderer is a volume renderer for HMDs that was created by Ben Knorlein. Ben's volume renderer supports a variety of data formats (e.g. NRRD files and TIFF image stacks) and colormaps, as well as multi-user collaboration.
First, you'll look at the process of rendering volumetric data in Paraview. Then, you'll look at how volumetric rendering works in Ben's Volume Renderer.
Volume Rendering in Paraview
Estimated time: 20-30 minutes
Overview
In this section of the tutorial, you'll be visualizing a CT scan of a rat heart vessel in Paraview. Note that you should complete this section of the tutorial by yourself.
Installation
Note: Complete the following steps on your Paperspace Machine.
Download Paraview 5.6.0 from this link.
If you are using paperspace:
copy the link above, open the paperspace console and open Google Chrome on your console
Click the circle icon menu in the top right, and click sync clipboard
Press the command to sync your local clipboard to Paperspace (Ctrl+V on Windows and Cmd+V on Mac)
If Cmd+V does not work on Mac, try Ctrl+V - Lexi
Then press Ctrl+V to paste the download link into your browser on paperspace and download.
Find the .exe file by going to where you installed Paraview (default is C:\Program Files \ Paraview 5.6.0-WIndows-msvc2015-64bit) and open the bin file. Scroll down until you find a file named paraview.exe
Run the .exe file and complete the installation process. .
Visualizing the Rat Heart
This tutorial will demonstrate how to visualize sample density (.vtk file here).
Download the following vtk file on Paperspace.
Open ParaView on your Paperspace machine by navigating to C:\Files\ParaView 5.6.0-Windows-msvc2015-64bit\bin (or wherever you installed it) and clicking on paraview.exe.
You can also open Paraview from the list of applications in Windows start menu under the ParaView 5.6.0-Windows-msvc2015-64bit folder.
Open the vtk file in ParaView.
Under the Pipeline Browser, make sure the eye icon is clicked. Then, a rectangle with a white outline should appear.
We want to view the data as a volume. In one of the drop down menus in the top section of the interface, change "Outline" to "Volume."
6. We can also change the color scheme and each color's range in the data. To do this, click the Edit button under Coloring.
7. Under the Information tab (on left side next to properties), we can get learn more about the data, including the size of the dataset, the data ranges, and data type.
8. In the third row of the top section, there are various cube icons that help us alter and further analyze a volume, including contour (surface rendering), slicing (cutting a plane from the data set), and clipping (cutting a section of the dataset). Experiment with these functions!
If these appear greyed out, try pressing the Apply button under Properties.
9. Choose a visualization to view in VR. Then connect your headset to your machine using Remote Desktop.
10. Once connected, open the Tools dropdown of the upper left menu in Paraview from your desktop and select Manage Plugins.
10. Scroll down to the OpenVR plugin, click on it, and select load plugin.
11. Click the Send to OpenVR button in the left menu.
11. Put on your headset again. You should now see your visualization in VR. Take a screenshot of it and post it to the class board.
Controls
Hold both side triggers and push them towards/away from each other to move the visualization up/down.
Some example visualizations from past years:
Credit: Alejandro Romero (Spring 2021)
Ben's Volume Renderer
Estimated time: 40 minutes
Requirements: Windows 10*, SteamVR, and Visual Studio Community 2019 (or later versions).
Overview
In this section of the tutorial, you'll be visualizing three different datasets:
The rat heart vessel
A 3D model of the Narragansett bay
A 3D model of microtissue cells captured from a confocal microscope
You'll be visualizing these datasets with a partner, which will be given at the beginning of class. Note that the volume renderer implements controller-viewer collaboration, in which one user -- the controller -- performs actions while the other users -- the viewers -- spectate. Practically speaking, this means that you and your partner will have to take turns as the controller.
Objectives
While working through this section of the tutorial, complete the following objectives:
Recreate a similar rat heart vessel visualization to the one you created in the Paraview tutorial (this will require scaling and z-scaling; see the Volume Renderer Controls section for more information). Then, make a screenshot of your recreation and add it to the activity board doc.
Visualize the two other datasets, take screenshots, and add them to the activity board doc. Be sure to play around with the color curves mentioned in the Volume Renderer Controls section
Installation
Steps:
Download the Volume Renderer zip file.
If you are using paperspace:
copy the link above, open the paperspace console and open Google Chrome on your console
Click the circle icon menu in the top right, and click sync clipboard
Press the command to sync your local clipboard to Paperspace (Ctrl+V on Windows and Cmd+V on Mac)
Then press Ctrl+V to paste the download link into your browser on paperspace and download.
Click the downloaded file to open it and unzip it by clicking Extract All
Next, run setup.bat by double clicking on the file. You'll be prompted with the following screen:
Enter your name.
Next, enter your appid, which will be given to you at the beginning of class.
At this point, the Volume Renderer should be ready to run!
Starting the Volume Renderer
Close SteamVR if it's running on your machine and connect your headset to your machine using Virtual Desktop.
Launch Virtual Desktop and connect your headset to your remote machine.
Launch SteamVR IN YOUR HEADSET using the Virtual Desktop menu.
Depending on what dataset you want to visualize and whether you're the controller or viewer, you'll need to run one of the files from the file explorer:
To visualize the rat heart vessel as the controller, select rat_heart_controller.bat
To visualize the rat heart vessel as an observer, select rat_heart_observer.bat
To visualize the Narragansett Bay dataset as the controller, select OSOM_HMD_controller.bat
To visualize the Narragansett Bay dataset as an observer, select OSOM_HMD_observer.bat
To visualize the microtissue dataset as the controller, select NRRD_HMD_controller.bat
To visualize the microtissue dataset as an observer, select NRRD_HMD_observer.bat
To exit out of the current visualization, press the hamburger menu button on your left controller, then press the Desktop button in the bottom left and select a new file.
Volume Renderer Controls
Ben's Volume Renderer supports a variety of controls that utilize both the Oculus Quest controllers and a menu. While working on the above objectives, you'll likely want to view these controls in your headset. This can be done launching the SteamVR menu (click the button with three bars on the left Oculus controller) and selecting Desktop from left panel of the SteamVR menu.
Quest 2 Controller Controls
Menu Controls
The menu in the Volume Renderer allows you to customize the appearance of the rendered model. Here is a brief description of what each option does:
alpha multiplier -> changes the opacity of the rendered model (less alpha = more transparent)
threshold -> adjusts the minimum value required for a data point to be visualized (larger threshold = less details)
scale -> changes the overall scale of the model (in all dimensions)
z-scale -> adjusts scale of the z dimension of the model
slices -> adjusts the number of slices used to visualize the model (less slices = less detail)
use transferfunction -> activate this to adjust the colors of the model; see the second image below demonstrates what your menu should look like once this feature is activated