Tensor Visualization Direct Methods: Pseudo-colors and Glyphs Pseudo-Colors

• Any derived properties of the can be mapped to color plots • Assume a tensor T is defined at each vertex – Components (or entries) – Tensor magnitude

1 2 – Trace, . If T is the Jacobian of a flow field, this tells how∑ much it has. Pseudo-Colors

Divergence and curl of a Pseudo-Colors

• Scalar properties of tensor (continued) – – Eigen-values • • Can be λ used to compute the determinant for diagonalizable tensor

• More importantly, it can be used to study the Anisotropy direction anisotropy of the , e.g. + strength mapped to saturation diffusion tensor used in medical applications Glyphs

• 1D shapes: the simplest is to map each eigen- vector direction to a line segment with length corresponding to the strength (i.e. eigen-value)

• 2D/3D shapes: better visualization of the local property of tensor, such as anisotropy

The glyphs for visualizing the anisotropy of a symmetric tensor Geometric-based Method Hyperstreamlines

• Let T(x) be a (2nd order) symmetric – real eigenvalues, orthogonal eigenvectors

• Hyperstreamline: by integrating along one of the eigenvectors

• Important: Eigenvector fields are not vector fields! – eigenvectors have no magnitude and no orientation (are bidirectional) – the choice of the eigenvector can be made consistently as long as eigenvalues are all different – Hyperstreamlines can intersect only at points where two or more eigenvalues are equal, so-called degenerate points . Red – major Green – minor Compute One Hyperstreamline

• Choose integrator: – Euler – Runge-Kutta • Choose step size (can be adaptive) • Provide seed point position and determine starting direction • Advance the front

• Note that the angle ambiguity. This is because the computation of the eigenvector at each sample point (i.e. vertex of the mesh) is independent of each other. Therefore, inconsistent directions may be chosen at neighboring vertices. – Additional step to remove angle ambiguity. A between the current advancing direction and the eigenvector direction at current position is performed. A positive value indicates the consistent direction; otherwise, the inverse direction should be used! Evenly-Spaced Placement

• Input: – dsep … start distance – dtest … minimum distance

• Compute an initial hyperstreamline from a random seed point, put to queue • Compute a set of candidate seeds that are dsep away from the initial hyperstreamline, put to queue • current hyperstreamline = initial hyperstreamline • WHILE not finished DO: – TRY: get new seed point which is dsep away from current hyperstreamline – IF successful THEN • compute new hyperstreamline until distance dtest is reached (or other…) AND put to queue – ELSE IF no more hyperstreamline in queue THEN • exit loop – ELSE next hyperstreamline in queue becomes current hyperstreamline Hyper-Streamline Placement

– [Jobard and Lefer 1997; Alliez et al. 2003; Zhang et al. 2007]

The method based on Our method Jobard and Lefer’s

According to different applications, the termination conditions may be different Hyperstreamlines

Hyperstreamlines rendered as tubes with elliptic cross , radii proportional to 2nd and 3rd eigenvalue

[Shen and Pang 2004]

Widely used in diffusion tensor imaging tractography Hyperstreamlines

Hyperstreamlines can also be used to convey some physical behaviors in the tensor. For instance, in flow analysis, the hyperstreamlines computed based on the eigen analysis of the Jacobian of the flow field can convey stretching and rotational flow deformation

[Zhang et al. TVCG 2009] Hyperstreamlines

[Prckovska et al. 2010]

Hybrid visualization: hyperstreamlines + glyphs

Good for some non-symmetric tensor visualization where the rotational components can be encoded by the glyphs Problem of Hyperstreamlines

• Ambiguity in (nearly) isotropic regions: – Partial voluming effect, especially in low resolution images (MR images) – Noise in data – Solution: tensorlines [Weinstein, Kindlmann 1999]

Tensorline • Advection vector Hyperstreamline • Stabilization of propagation by considering Arrows: major eigenvector • Input velocity vector • Output velocity vector (after application of tensor operation) • Vector along major eigenvector • Weighting of three components depends on anisotropy at specific position: • Linear anisotropy: only along major eigenvector • Other cases: input or output vector Texture-based Method HyperLIC [Zheng and Pang]

Instead using a 1D kernel along the streamline, HyperLIC uses a 2D kernel

is the input and is the output are the nth eigenvalues,λ , eigenvectors , , , 1,2and the weight function at point X. is the integration step. ∆ The LIC pipeline HyperLIC [Zheng and Pang]

Instead using a 1D kernel along the streamline, HyperLIC uses a 2D kernel

Decompose the computation

If we define

The LIC pipeline HyperLIC [Zheng and Pang]

Instead using a 1D kernel along the streamline, HyperLIC uses a 2D kernel

Decompose the computation

Then

This is a two-pass process and are the output images of the un- normalized LIC on and vector fields with input images λand , respectively.λ The LIC pipeline HyperLIC [Zheng and Pang]

Instead using a 1D kernel along the streamline, HyperLIC uses a 2D kernel

Decompose the computation

Then

This is a two-pass process Theoretically, the order in which the eigenvector fields are processed will affect the final image. In practice, the differences are not noticeable The LIC pipeline Some Results

A 2D slice from single point load . It is taken from the middle of the volume and viewed from the point load direction. It is mostly composed of components from medium or minor eigenvectors. We see that the center of this slice is quite isotropic. Around the center is a formed by lines, which means tensors are highly anisotropic. It is the boundary where the minor eigenvalues are zero. Some Results

Flow past a cylinder with hemispherical cap. HyperLIC of two different computational layers of the tensor. Arrows point to locations of degenerate wedge points A Simplified HyperLIC

• Compute two LIC images along the major and minor eigen-vector fields, respectively. • These two computations are independent of each other, and thus, can be parallelized. • Note, the angle ambiguity needs to be properly handled as in the hyperstreamline tracing. • NOTE, this is only meaningful for The image represents a xz-plane slice of a two-force dataset. The left circle symmetric positive definite tensors corresponds to the pushing and the right to the pulling force. The fluctuation of the color is a result of the low resolution of the simulation[Hotz et al. 2004] Review IBFV Extended IBFV

IBFV does not trace out streamlines. So it cannot address the angle ambiguity explicitly!

Consider a s.p.d tensor field T. Let D denote the domain and be the set of points in D where V is discontinuous. While it is not always possible to construct a vector field V from T such that (a) (b) , we build two vector fields and such that ∅ contains only the degenerate points of T, and⋂ every regular point in the domain belongs to for some i. \S Its major eigenvector field can be represented in terms of two spatially varying scalar fields and , (c) (d) which are the magnitude and direction, respectively .

cos ρ 0 sin

[Zhang et al. TVCG07] Extended IBFV

IBFV does not trace out streamlines. So it cannot address the angle ambiguity explicitly!

cos ρ 0 sin We define the following two vector fields from (a) (b)

(c) (d)

is obtained from by choosing directions so that the x- component of is nonnegative everywhere. Therefore , |cos , 0

[Zhang et al. TVCG07] Extended IBFV

IBFV does not trace out streamlines. So it cannot address the angle ambiguity explicitly!

Let and be the images produced using IBFV with and Let and (a) (b) be the blending cos functions. Then, sin the final 1cos image produces the desired result.

(c) (d)

The system first produces images according to two direction assignments: ((a), in the positive x-direction) and ((b), in the positive y-direction) . The images are then blended according to weight functions (a color coding shown in (c)) and . (d) The resulting image no longer contains the visual artifacts from and . 1 [Zhang et al. TVCG07] Some Results

[Zhang et al. TVCG07] Extension to N-Symmetric Field

Visualization [Palacios and Zhang TVCG 2011] Glyph-based Methods Glyphs for Tensors

• 2D/3D shapes: better visualization of the local property of tensor, such as anisotropy

2D

3D

The glyphs for visualizing the anisotropy of a symmetric tensor Glyphs for Tensors

Consider symmetric tensors at this moment. They have real eigenvalues and orthogonal Eigenvectors. Therefore, they can be intuitively represented as .

Three types of anisotropy: Anisotropy measure

• linear anisotropy λ λ λ λ λ • planar anisotropy 2λ λ λ λ λ • isotropy (spherical) 3λ λ λ λ λ λ λ

Image by G. Kindlmann Problem of glyphs: • Shape is poorly recognized in projected view

8 ellipsoids but in two different views (two rows) Problem of cuboid glyphs Problem of cylinder glyphs • Missing symmetry • Seam at • Losing symmetric close to 1 Combining advantages: superquadrics Superquadrics with z as primary axis

Barr, 1981 cos sin ∅ , ∅ sin sin ∅ Superquadrics for some pairs cos ∅ , 0 2,0∅2 Shaded: sub-range used for glyphs Superquadric glyphs (Kindlmann): Given • Compute a base superquadric using an edge, , sharpness value :

: ,∅ 1 1 , ∅ : ,∅ 1 1 • Scale with along x, y, z and rotate into eigenvector frame , , Comparison of shape perception (previous example)

• With ellipsoid glyphs

• With superquadrics glyphs Comparison: Ellipsoids vs. superquadrics (Kindlmann)

This is half of the brain, looking at the posterior part of the Color map | | corpus callosum, which is the main bridge between the two 1 hemispheres. And with the superquadrics, you can see that | | 1 1 on the surface of the corpus callosum, the glyphs have more of a planar component, but on the inside, they're | | 1 basically very linear. Superquadric Glyphs for Symmetric Second-Order Tensors

Extended to general second-order symmetric tensors that can be indefinite

[Schultz and Kindlmann, Vis10] Glyph Packing

Reduce holes, overlaps, and artifacts

[Kindlmann and Westin, Vis06] Energy-based Particle Systems

• Basic pipeline – Seeding based on some statistical property – Force repelling * • Each particle tries to push away its neighboring particles • This process should eventually converge to a stable configuration. – Rendering glyphs Energy-based Particle Systems Energy-based Particle Systems Energy-based Particle Systems Energy-based Particle Systems Energy-based Particle Systems Energy-based Particle Systems Computation of the Energy

is the glyph scaling factor

[Kindlmann and Westin, Vis06] Computation of the Forces

is the glyph scaling factor

[Kindlmann and Westin, Vis06] [Kindlmann and Westin, Vis06] Improvement- Parallel Computation

Original method considers all the particles in the domain Improvement- Parallel Computation

[Kim et al. GPGPU5] Multithreaded (cont)

ò Given the current bin Bi

ò Gather every particle in B i plus the immediate surrounding bins − This is a neighborhood

ò For every particle p i in the bin B i − For every particle p j in the neighborhood

ò If distance from p i to p j < 1.0 − sum the velocity and energy − Advect p i

[Kim et al. GPGPU5] Multithreaded (cont.)

ò Process each particle in the current bin

Current Bin

[Kim et al. GPGPU5] Multithreaded (cont.)

ò Process each particle in the current bin

Current Particle

[Kim et al. GPGPU5] Multithreaded (cont.)

ò sum Energy and Force

[Kim et al. GPGPU5] Multithreaded (cont.)

ò Move current particle

[Kim et al. GPGPU5] Multithreaded (cont.)

ò Process the next particle in the current bin.

[Kim et al. GPGPU5] Multithreaded (cont)

ò While there are bins to be processed YZ − For every particle p in the current bin

ò For every other particle in the neighborhood WX − calculate force and energy

ò Move the particle in the direction F

[Kim et al. GPGPU5] Multithreaded (cont)

ò While there are bins to be processed YZ − For every particle p in the current bin

ò For every other particle in the neighborhood WX − calculate force and energy

ò Move the particle in the direction F

[Kim et al. GPGPU5] Anisotropy Sampling

[Feng et al. TVCG2008] Anisotropy Sampling

[Feng et al. TVCG2008] Anisotropy Sampling

[Feng et al. TVCG2008] Glyph Packing in Bounded Regions

[Chen et al. Vis11]