SCALAR VISUALIZATION. OUTLINE Visualizing scalar data A number of the most popular scalar...

Post on 08-Jan-2018

263 views 3 download

description

VISUALIZATION PIPELINE 1. Data Importing 2. Data Filtering 3. Data Mapping 4. Date Rendering

Transcript of SCALAR VISUALIZATION. OUTLINE Visualizing scalar data A number of the most popular scalar...

SCALAR VISUALIZATION

OUTLINE• Visualizing scalar data

• A number of the most popular scalar visualization techniques• Color mapping

• Contouring

• Height plots

• Color mapping• Design of effective colormaps• Contouring in 2D and 3D • Height plots

VISUALIZATION PIPELINE

1. Data Importing2. Data Filtering3. Data Mapping4. Date Rendering

SCALAR FUNCTION

10]) [Chap.ion Visualizat Volume Slicing, ,Isosurface e.g., D,-(3

:

)contouring mapping,color plot,-height e.g., D,-(2:

histogram) D,-(1 :

3

2

RR

RR

RR

f

f

f

COLOR MAPPING•color look-up table•Associate a specific color with every scalar value•The geometry of Dv is the same as D

)N

if(N-i)fc(c

}{cC

i

,...N,ii

maxmin

21

Where

LUMINANCE COLORMAP•Use grayscale to represent scalar value

Luminance Colormap

)y-10(x 44

ef •Most scientific data (through measurement, observation, or simulation) are intrinsically grayscale, not color

Legend

RAINBOW COLORMAP•Red: high value; Blue: low value•A commonly used colormap

Luminance Map Rainbow Colormap

RAINBOW COLORMAP•Construction

•f<dx: R=0, G=0, B=1•f=2: R=0, G=1, B=1•f=3: R=0, G=1, B=0•f=4: R=1, G=1, B=0•f>6-dx: R=1, G=0, B=0

RAINBOW COLORMAPImplementation

void c(float f, float & R, float & G, float &B){

const float dx=0.8f=(f<0) ? 0: (f>1)? 1 : f //clamp f in [0,1]g=(6-2*dx)*f+dx //scale f to [dx, 6-dx]R=max(0, (3-fabs(g-4)-fabs(g-5))/2);G=max(0,(4-fabs(g-2)-fabs(g-4))/2);B=max(0,(3-fabs(g-1)-fabs(g-2))/2);

}

3RR :c DvD:c

COLORMAP: DESIGNING ISSUES

•Choose right color map for correct perception•Grayscale: good in most cases•Rainbow: e.g., temperature map•Rainbow + white: e.g., landscape

•Blue: sea, lowest•Green: fields•Brown: mountains•White: mountain peaks, highest

RAINBOW COLORMAP

http://atmoz.org/img/weatherchannel_national_temps.png

EXP: EARTH MAP

http://www.oera.net/How2/PlanetTexs/EarthMap_2500x1250.jpg

EXP: SUN IN GREEN-WHITE COLORMAP

EXP: CORONAL LOOP

http://media.skyandtelescope.com/images/SPD+on+CME+image+5+--+TRACE.gif

COLOR BANDING EFFECT

Caused by a small number of colors in a look-up table

CONTOURING•A contour line C is defined as all points p in a dataset D that have the same scalar value, or isovalue s(p)=x

})(|{)( xpsDpxC •A contour line is also called an isoline

•In 3-D dataset, a contour is a 2-D surface, called isosurface

CONTOURING

Cartograph

CONTOURINGOne contour at s=0.11

S > 0.11 S < 0.11

Contouring and Color Banding

CONTOURING

7 contour lines

Contouring and Colormapping:

Show (1) the smooth variation and (2) the specific values

PROPERTIES OF CONTOURS•Indicating specific values of interest•In the height-plot, a contour line corresponds with the interaction of the graph with a horizontal plane of s value

PROPERTIES OF CONTOURS•The tangent to a contour line is the direction of the function’s minimal (zero) variation•The perpendicular to a contour line is the direction of the function’s maximum variation: the gradient

Contour linesGradient vector

CONSTRUCTING CONTOURS

V=0.48

Finding line segments within cells

CONSTRUCTING CONTOURS•For each cell, and then for each edge, test whether the isoline value v is between the attribute values of the two edge end points (vi, vj)•If yes, the isoline intersects the edge at a point q, which uses linear interpolation

ij

ijji

vvvvpvvp

q

)()(

•For each cell, at least two points, and at most as many points as cell edges•Use line segments to connect these edge-intersection points within a cell •A contour line is a polyline.

CONSTRUCTING CONTOURS

V=0.37: 4 intersection points in a cell -> Contour ambiguity

IMPLEMENTATION: MARCHING SQUARES•Determining the topological state of the current cell with respect to the isovalue v

•Inside state (1): vertex attribute value is less than isovalue•Outside state (0): vertex attribute value is larger than isovalue•A quad cell: (S3S2S1S0), 24=16 possible states

•(0001): first vertex inside, other vertices outside•Use optimized code for the topological state to construct independent line segments for each cell•Merge the coincident end points of line segments originating from neighboring grid cells that share an edge

Topological State of a Quad Cell

Implementation: Marching Squares

Topological State of a hex Cell

Implementation: Marching Cube

Marching cube generates a set of polygons for each contoured cell: triangle, quad, pentagon, and hexagon

CONTOURS IN 3-D•In 3-D scalar dataset, a contour at a value is an isosurface

Isosurface for a value corresponding to the skin tissue of an MRI scan 1283 voxels

CONTOURS IN 3-D

Two nested isosurface: the outer isosurface is transparent

HEIGHT PLOTS•The height plot operation is to “warp” the data domain surface along the surface normal, with a factor proportional to the scalar value

s

hs

Dxxnxsxxm

DDm

),()()(

,:

HEIGHT PLOTS

Height plot over a planar 2-D surface

HEIGHT PLOTS

Height plot over a nonplanar 2-D surface

VECTOR VISULIZATION

Divergence and VorticityVector Glyphs Vector Color CodingDisplacement PlotsStream ObjectsTexture-Based Vector VisualizationSimplified Representation of Vector Fields

VECTOR FUNCTION

) D-2:case(simpler

D)-3in (usually

22

33

RRf:

RRf:

VECTOR VERSUS SCALAR

),,(

),,(),,(

V

VV

),,(

ˆˆˆ :Vector

z

y

x

zyxf

zyxfzyxf

V

or

VVVV

or

kVjViVV

V

z

y

x

zyx

zyx

),,(

s :Scalar

zyxfss

EXAMPLE IN 2-D

xy

),(),(

VV

:Vector

y

x

yxfyxf

V

V

V

y

x

yxs

es

yxfsyx

:exp

),(s :Scalar

)( 22

GRADIENT OF A SCALAR

)(

)(

)(

22

22

22

2

2

2D:Exp

),,(

vectora isscalar a ofGradient

yxy

yxx

yx

yeysV

xexsV

es

zs

ys

xssV

GRADIENT OF A SCALAR

(1,1) (0,1), (0,0),at ector gradient v theDraw2s and 1,s 0,s linecontour Draw

1

1

2D:Exp

ysV

xsV

yxs

y

x

DIVERGENCE OF A VECTOR

3D)in volumeand 2Din (area Γby enclosed area theis|Γ|

3D)in surface closed and 2Din curve (closed

cehypersurfa closed is Γ

dsnVV )(||

1lim0

DIVERGENCE OF A VECTOR•Divergence computes the flux that the vector field transports through the imaginary boundary Γ, as Γ0•Divergence of a vector is a scalar•A positive divergence point is called source, because it indicates that mass would spread from the point (in fluid flow)•A negative divergence point is called sink, because it indicates that mass would get sucked into the point (in fluid flow)•A zero divergence denotes that mass is transported without compression or expansion.

DIVERGENCE OF A VECTOR

xV

xV

xV zyx

V

source :divergence Positive211V

y)(x,V

:Exp

Free Divergence000V

x)(y,V

:Exp

sink :divergence Negative211V

(-x,-y)V

:Exp

DIVERGENCE OF A VECTOR

VORTICITY OF A VECTOR

3D)in volumeand 2Din (area by enclosed area theis|Γ|

3D)in surface and 2Din (curve cehypersurfa closed is

)(||

1lim0

sdVV

VORTICITY OF A VECTOR

•Vorticity computes the rotation flux around a point•Vorticity of a vector is a vector•The magnitude of vorticity expresses the speed of angular rotation•The direction of vorticity indicates direction perpendicular to the plane of rotation•Vorticity signals the presence of vortices in vector field

VORTICITY OF A VECTOR

Color: Glyph:

VECTOR GLYPH

))(,( xVkxxl

x

V

•Vector glyph mapping technique associates a vector glyph (or icon) with the sampling points of the vector dataset•The magnitude and direction of the vector attribute is indicated by the various properties of the glyph: location, direction, orientation, size and color

VECTOR GLYPH

Line glyph, or hedgehog glyph

Sub-sampled by a factor of 8(32 X 32)

Original (256 X 256)

Velocity Field of a 2D Magnetohydrodynamic Simulation

VECTOR GLYPH

Velocity Field of a 2D Magnetohydrodynamic Simulation

Line glyph, or hedgehog glyph

Sub-sampled by a factor of 4(64 X 64)

Original (256 X 256)

VECTOR GLYPHSub-sampled by a factor of 2(128 X 128)

Original (256 X 256)

Problem with a denseRepresentation using glyph: (1) clutter(2) miss-representation

VECTOR GLYPH

RandomSub-sampling

Is better

VECTOR GLYPH: 3DSimulation box: 128 X 85 X 42; or 456,960 data point

100,000 glyphsProblem: visual occlusion

VECTOR GLYPH: 3D

Simulation box: 128 X 85 X 42; or 456,960 data point10,000 glyphs: less occlusion

VECTOR GLYPH: 3D

Simulation box: 128 X 85 X 42; or 456,960 data point100,000 glyphs, 0.15 transparency: less occlusion

VECTOR GLYPH: 3D

Simulation box: 128 X 85 X 42; or 456,960 data point3D velocity isosurface

VECTOR GLYPH

•Glyph method is simple to implement, and intuitive to interpretation

•High-resolution vector datasets must be sub-sampled in order to avoid overlapping of neighboring glyphs.

•Glyph method is a sparse visualization: does not represent all points

•Occlusion•Subsampling artifacts: difficult to interpolate

•Alternative: color mapping method is a dense visualization

VECTOR COLOR CODING

•Similar to scalar color mapping, vector color coding is to associate a color with every point in the data domain

•Typically, use HSV system (color wheel)•Hue is used to encode the direction of the vector, e.g., angle arrangement in the color wheel

•Value of the color vector is used to encode the magnitude of the vector

•Saturation is set to one

2-D Velocity Field of the MHD simulation:

Orientation,Magnitude

Vector Color Coding

2-D Velocity Field of the MHD simulation:

Orientation only; no magnitude

Vector Color Coding

VECTOR COLOR CODING•Dense visualization

•Lacks of intuitive interpretation; take time to be trained to interpret the image

STREAM OBJECTS•Vector glyph plots show the trajectories over a short time of trace particles released in the vector fields

•Stream objects show the trajectories for longer time intervals for a given vector field

STREAMLINES•Streamline is a curved path over a given time interval of a trace particle passing through a given start location or seed point

point seed the,)0(

)()

T]} [0, ),({

0

0

ppwhere

dtpV(τp

pS

t

Streamlines

All lines are traced up to the same maximum time TSeed points (gray ball) are uniformly sampled

Color is used to reinforce the vector magnitude

STREAMLINES: ISSUES•Require numerical integration, which accumulates errors as the integration time increases

tVpp

where

tipVdtpV(τp

iii

t

it

11

/

00

)()()

nintegratioEuler

•Euler integration: fast but less accurate•Runge-Kutta integration: slower but more accurate•Need to find optimal value of time step Δt•Choose number and location of seed points•Trace to maximum time or maximum length•Trace upstream or downstream•Saved as a polyline on an unstructured grid

Stream tubes

Tracing downstream: the seed points are on a regular grid

•Add a circular cross section along the streamline curves, making the lines thicker

Stream tubes

Tracing upstream: the arrow heads are on a regular grid

Stream Objects in 3-D

Input: 128 X 85 X 42

Undersampling:10 X 10 X 10

Opacity 1

Maximum Length

Stream Objects in 3-D

Input: 128 X 85 X 42

Undersampling:3 X 3 X 3

Opacity 1

Maximum Length

Stream Objects in 3-D

Input: 128 X 85 X 42

Undersampling:3 X 3 X 3

Opacity 0.3

Maximum Time

Stream Objects in 3-D

Stream tubes

Seed area at the flow inlet

Stream Ribbons

Two thick Ribbons Vorticity

is color codedVector Glyth

STREAM RIBBONS

•A stream ribbon is created by launching two stream lines from two seed points close to each other. The surface created by the lines of minimal length with endpoints on the two streamlines is called a stream ribbon

STREAM SURFACE

•Given a seed curve Γ, a stream surface SΓ is a surface that contains Γ and its streamlines

•Everywhere tangent to the vector field•Flow can not cross the surface

•Stream tube is a particular case of a stream surface: the seed curve is a small closed curve

•Stream ribbon is also a particular case of a stream surface: the seed curve is a short line

TEXTURE-BASED VECTOR VIS.

•Discrete or sparse visualizations can not convey information about every point of a given dataset domain

•Similar to color plots, texture-based vector visualization is a dense representation

•The vector field (direction and magnitude) is encoded by texture parameters, such as luminance, color, graininess, and pattern structure

Vector magnitude: Color

Vector direction: Graininess

TEXTURE-BASED VECTOR VIS.

LIC principle: Line Integrated Convolution Principle

TEXTURE-BASED VECTOR VIS.

function blurring of width :function blurringor weighting:

Ppoint seed of streamline : texturenoise :

)(

)(

)()),(()(

2

Lk(s)S(p,s)N

esk

dssk

dsskspSNpT

s

L

L

L

L

TEXTURE-BASED VECTOR VIS.

•LIC is a process of blurring or filtering the texture (noise) image along the streamlines •Due to blurring, the pixels along a streamline are getting smoothed; the graininess of texture is gone •However, between neighboring streamlines, the graininess of texture is preserved, showing contrast.