Scalar Data
Alark Joshi
Announcements
• Pick two papers to present
– Email me your top 3/4 choices.
– FIFO allotment
• Contact your clients
• Blog summaries: http://cs.boisestate.edu/~alark/cs564/participants.html
Data Grids
Topology
• If points are arbitrarily distributed and there is no connectivity between them, the data is called scattered
• Otherwise, data is composed of cells bounded by grid lines
• Topology specifies the connectivity of data
• Geometry specifies the position of the data
Topology
• Properties of geometric shapes that remain unchanged even when under distortion
Topologically equivalent
• Things that can be transformed into each other by stretching and squeezing, without tearing or sticking together bits which were previously separated
Grid Types
• Grids differ substantially in the cells (building blocks) they are constructed from and in the way the topological information is specified
Structured and Unstructured Grids
• Structured grids have a regular topology and regular/irregular geometry
• Unstructured grids have irregular topology and geometry
Characteristics of Structured Grids
• Easier to compute with
• May require more elements or unevenly shaped elements to precisely cover the underlying domain
• Topology is represented implicitly by an n-vector of dimensions
• Geometry is represented explicitly by an array of points
• Every interior point has the same number of neighbors
Characteristics of Unstructured Grids
• If no implicit topological information is given, the grids are called unstructured grids
• Grid point geometry and connectivity must be stored
• Dedicated data structures needed to allow for efficient traversal and data retrieval
• Often composed of triangles or tetrahedra
• Typically, fewer elements are needed to cover the domain
Image credits: http://geolab.larc.nasa.gov/GridTool/Training/VGRID/
Unstructured Grids
• Can be adapted to capture local features
Types of grids
• Cartesian or equidistant grids
– Structured grid
– Number of points = Nx * Ny * Nz
Types of grids
• Uniform grids are similar to Cartesian grids
• Consist of equal cells but with different resolution in at least one dimension (dx ≠dy ≠ dz)
• Typical example is medical imaging data that consists of slices
– Slice images with square pixels (dx = dy)
– Larger slice distance (dz > dx = dy)
Types of grids
• Rectilinear grids
• Topology is still regular but irregular spacing between grid points
• Topology is still implicit
Types of grids
• Curvilinear grids
– Topology is still regular but irregular spacing between grid points
– Topology is implicit, but vertex positions are explicitly stored
Types of grids
• Multigrids
– Focus in specific area to avoid unnecessary detail in other areas
• Finer grid for regions of interest
• Difficulties at the boundaries between low and high res grids for operations such as interpolation
Scalar Data Visualization
Basic Strategies
• Mapping to geometry – Function plots
– Height fields
– Isolines and isosurfaces
• Color coding
• Techniques for 3D scalar data – Volume visualization
– Slicing
• Visualization method depends heavily on dimensionality of domain
Function Plots
• Function plot for a 1D scalar field
– Points
– 1D manifold: line
– Errors bars possible
Function Plots
• Gnuplot examples
Function plots for 2D scalar field
• Points
• 2D manifold: surfaces
• Surface representations
– Wireframe
– Hidden lines
– Shaded surface
Function plots for 2D scalar field
• Shaded surface
Isolines
• Visualization of 2D scalar fields
• Given a scalar function 𝑓: Ω → 𝑅 and a scalar value 𝑐 ∈ 𝑅
• Isoline consists of points 𝑥, 𝑦 𝑓 𝑥, 𝑦 = 𝑐}
• If f() is differentiable and grad(f) ≠0 then isolines are curves
• Contour lines
Image credits: http://giscommons.org/?page_id=18
Isolines
Isolines
• Pixel by pixel contouring
• Straightforward approach: scan all pixels for equivalence with isovalue
• Input: 𝑓: 1, … 𝑥𝑚𝑎𝑥 ∗ 1, … , 𝑦𝑚𝑎𝑥 → 𝑅
• Isovalues I1,…In and isocolors c1,…, cn
• Algorithm:
Color coding
• Easy to apply colors to 1D and 2D scalar fields
– Map color each pixel on a 1D input signal or 2D image
Color coding
• Example:
– Separate color table to visualize the brain
– Separate color table to visualize the tissue
Volume Visualization
• Scalar volumetric data Ω 𝜖 𝑅3 → 𝑅
• Medical application: CT, MRI, ultrasound, confocal microscopy etc.
Volume Visualization
• Seismic applications: Oil exploration, earthquake prediction, etc.
Volume Visualization
• Create a representation of a 3D scalar dataset Ω 𝜖 𝑅3 → 𝑅
• Voxel (volume element) similar to pixel (picture element)
• Values between grid points are resampled by interpolation
Volume visualization
• Challenges
– Essential information in the interior
– Occlusion?
– Often datasets cannot be described by geometric representation (medical, phenomena such as fire, clouds, etc.)
Image credits: Peter Kutz
Slicing
• 2D approach
– Interactively resample the data on slices perpendicular to the x-, y-, z-axis
– Use visualization techniques for 2D scalar fields
• Color coding, isolines, height fields
Oblique slicing
• Also known as Multiplanar Reformatting (MPR)
• Resample the data on arbitrarily oriented slices
– Resampling can be done on the CPU or graphics hardware (GPU) using built-in trilinear interpolation
Volume visualization
• Slicing: Display the data mapped to colors, on a slice plane
• Isosurfacing: Generate opaque/semi opaque surfaces
• Transparency effects
Semi-transparent material
Iso-surface
slice
Direct Volume Rendering
• Render volume without extracting any surfaces (DVR)
• Map scalar values to optical properties (color, opacity)
• Need optical model
• Solve volume rendering integral for viewing rays into the volume
Direct Volume Rendering
• Volume Rendering Integral
where x(λ) = viewing ray parameterized by the distance λ to the viewpoint. c(s(x)) = color assigned in the classification step. Here color and extinction coefficient assigned to each material is taken into consideration. D = maximum distance that the ray traverses before it goes outside the volume
τ(s(x)) = extinction coefficient assigned in the classification step
Volume Rendering Integral
Ci+1 = Ai*Ci + (1 - Ai)*ai*ci
Ai+1 = Ai + (1 - Ai)*ai
Ci ; Ai
ci ; ai
Ci+1 ; Ai+1
Ray Casting
• Goal: numerical approximation of volume rendering integral
• Resample volume at equi-spaced locations along the ray
• Reconstruct at continuous location via tri-linear interpolation
• Approximate integral
Interpolation
• Linear interpolation 𝑥 = 𝑥1 ∗𝑥−𝑥0
𝑥1−𝑥0
+ 𝑥0 ∗𝑥1−𝑥
𝑥1−𝑥0
• Bilinear interpolation • 𝑃′ 𝑥, 𝑦 = 𝑃 1,1 ∗ 1 − 𝑑 ∗ 1 − 𝑑′ + 𝑃 1,2 ∗ 𝑑 ∗
1 − 𝑑′ + 𝑃 2,1 ∗ 𝑑′ ∗ 1 − 𝑑 + 𝑃 2,2 ∗ 𝑑 ∗ 𝑑′
Trilinear Interpolation [Levoy]
Levoy Interpolation
Interpolation
Nearest Neighbor Binary
Trilinear Interpolation Smooth/Weighted
Direct Volume Rendering
• Marc Levoy. Display of Surfaces from Volume Data. IEEE Comput. Graph. Appl. 8(3), 29-37, 1988.
• One of the first papers that said “it is not necessary to fit geometric primitives to sampled data”
• Create images directly from volumetric data
• Fast and simple technique
• Identified a volume rendering pipeline
• Discussed the gradient operator for shading
Acquired values
Data preparation
Prepared values
classification
Voxel colors
Ray-tracing / resampling Ray-tracing / resampling
Sample colors
compositing
Voxel opacities
Sample opacities
Image Pixels
Volume Rendering Pipeline
shading
Shading • In Computer Graphics, the normal of a
triangle/quad serves as an indication of the orientation of that surface
• All the lighting computations require a surface normal
lights
i
n
sdiambientatotal
shiny
RVkLNkIIkI#
1
ˆˆˆˆ
Shading
• No normals in volumetric data
• Use gradients as normals
Classification
• Extract features in a dataset
• Histogram can be a helpful aid
• Non trivial due to irregularities in intensity of structure and acquisition devices
• Often requires tedious manipulation of transfer functions
Transfer Functions
• Color table for volume visualization
– Map raw voxel intensity values into color, opacity etc.
Classification
• Examples of four different transfer functions
Novel contributions
• Translation – translates rays vs. data set
• Classification – novel, uses gradient
• Shading – interpolates colors/opacities vs. normals (gouraud)
• Interpolation – tri-linear, central difference
• Compositing – image order (ray-casting)
– back-to-front
Blog comments
• Reed – “find it interesting that … main reason why this form of visualization became necessary was for MRI and CT scanning technology”
• Tim – “he could have performed more rendering experiments to provide more data on completion time. ”
• Archana – “creating a mechanism to display weak and fuzzy surfaces”
• Peter – “ impressed with the author’s scientific approach”
Volume Rendering
• Robert A. Drebin, Loren Carpenter, and Pat Hanrahan. Volume rendering. SIGGRAPH Comput. Graph. 22, 4 (June 1988), 65-74
• Classify volume into material percentages
– several materials per voxel are possible
• Calculate colors and opacities for each voxel
• Calculate a density for each voxel
• Determine the gradient from the density volume
Drebin, et. al.
• Determine a surface strength for each voxel from the density volume
• Using the color and opacity volume, the gradient volume and the strength volume, compute a shaded volume.
• Transform and view this volume
Drebin, et. al.
Original CT Data
Fat Tissue Bone
Density Color and Opacity
Strength
Gradient NX NY NZ
Shaded
Transformed
Final Image
Drebin, et. al.
• Material Classification
– Use a probability, rather than a threshold.
– Bayesian estimate
– Zone centered
– We know the x-ray absorptions of the materials (bone, ...)
Air Fat
Tissue Bone
Drebin, et. al.
• Work backwards, given x-ray absorption, I, what is the probability of it being air? Of bone?, …
– P(I) = i Pi(I)
• I => percent of material (our goal)
• Pi(I) => probability distribution that material i has an intensity I. – The x-ray absorption of a homogenous material.
– Known a priori
Drebin, et. al.
• Bayesian Estimate
i(I) = Pi(I) / Pj(I) for all n materials. I (I) = 1
Drebin, et. al.
• Surface Extraction
• Each material has a density, both a real and an artificial one for visualization.
• D(x,y,z) = Pi(I)(x,y,z) I
• N = D, and normalize
• For noisy data, blur D.
Drebin, et. al.
• Lighting
– absorption
– emitting
– surface scattering and absorption
• Compositing
– Front over Surface over Back
L
N
I I
S
Blog comments
• Reed – “grasp on the way surfaces are estimated, and the way colors and densities are managed.”
• Peter – “rather than simply showing images, the paper presents a convincing comparison of images created using different processes.”
• Josh – “ The usage of matte volumes is also interesting in that even at this early stage in volume rendering it providing a means of extracting particular regions of a volume or even merging two regions”