Discrete Data Structure and Colour...
Transcript of Discrete Data Structure and Colour...
Discrete Data Structure and Colour Mapping
Computer Animation and Visualisation – Lecture 11
Taku Komura
Institute for Perception, Action & Behaviour School of Informatics
Overview
About Visualization
Scientific Visualisation
Information Visualisation
Discrete data structure
Topology and interpolation
Data Attributes
Colour Mapping
Techniques in Visualisation
Scientific Visualisation
Visualising numbers with spatial structure
Information Visualisation
Visualising abstract data with no spatial structure
Discrete Vs. Continuous
Real World is continuous eyes designed towards the perception of continuous shape
Data is discrete finite resolution representation of a real world (of abstract) concept
Difficult to visualise continuous shape from raw discrete sampling
we need topology and interpolation
Topology
Topology : relationships within the data invariant under geometric transformation
Which vertex is connected with which vertex by an edge?
Which area is surrounded by which edges?
Interpolation & Topology
If we introduce topology our visualisation of discrete data improves
why ? : because then we can interpolate based on the topology
Interpolation & Topology
Use interpolation to shade whole cube:
Interpolation: producing intermediate
samples from a discrete representation
Importance of representation
What happens if we change the representation?
Discrete data samples remain the same topology has changed ⇒ effects interpolation ⇒ effects visualisation
Dataset Representation of the Structure
Points specify where the data is known
specify geometry in ℝN
Cells allow us to interpolate between points
specify topology of points
Point with known attribute data (i.e. colour ≈ temperature)
Cell (i.e. the triangle) over which we can interpolate data.
Cells
Fundamental building blocks of visualisation
our gateway from discrete to interpolated data
Various Cell Types
defined by topological dimension
specified as an ordered point list (connectivity
list)
primary or composite cells
- composite : consists of one or more primary cells
Vertex (0D) Line (1D) Triangle, pixel, quad (2D) Triangle mesh, polygon mesh (2D) Tetrahedra, voxel (3D)
Various Cell types
Topological Dimension Topological Dimension: number of independent continuous variables
specifying a position within the topology of the data
different from geometric dimension (position within general space)
Topological Geometric
point 0D 2D/3D/… e.g. 2D (x,y)
curve 1D 2D/3D/… e.g. 3D point on curve
surface 2D 3D (in general)
volume 3D 3D (in general) e.g. MRI or CT scan
Temporal volume 4D 3D (+ t)
Data Representation
Data objects : structure + value
referred to as datasets
Structure
Points, Cells
—————————
Data Attributes
Scalars, vectors
Normals, texture
coordinates, tensors etc
Attribute Data Information associated with data topology
usually associated to points or cells
Examples : temperature, wind speed, humidity, rain fall (meteorology)
heat flux, stress, vibration (engineering)
texture co-ordinates, surface normal, colour (computer graphics)
Usually categorised into specific types:
scalar (1D)
vector (commonly 2D or 3D; ND in ℝN)
tensor (N dimensional array)
Attribute Data : Scalar
Single valued data at each location
simplest and most common form of visualisation data
volume density (MRI) elevation from reference plane
ozone levels
Attribute Data : Vector Data
Magnitude and direction at each location 3D triplet of values (i, j, k)
Also Normals – vectors of unit length (magnitude = 1)
Magnetic Field
Force / Displacement Wind Speed
Attribute Data : Tensor Data
K-dimensional array at each location
Generalisation of vectors and matrices Tensor of rank k can be considered a k-
dimensional table - Rank 0 is a scalar - Rank 1 is a vector - Rank 2 is a matrix - Rank 3 is a regular 3D array
- Example : Tensor Stress
Visualisation Algorithms Generally, classified by attribute type
scalar algorithms (e.g. colour mapping, contouring )
vector algorithms (e.g. glyphs, lines)
tensor algorithms (e.g. tensor ellipses)
Scalar Algorithms
Scalar data : single value at each location
Structure of data set may be 1D, 2D or 3D+
we want to visualise the scalar within this structure
Two fundamental algorithms
colour mapping (transformation : value → colour)
contouring (transformation : value transition → contour)
Colour Mapping
Map scalar values to colour range for display e.g.
- scalar value = height / max elevation
- colour range = blue →red
Colour Look-up Tables (LUT)
provide scalar to colour conversion
scalar values = indices into LUT
Colour LUT Type equation here.Assume
scalar values Si in range {min→max}
n unique colours, {colour0... colourn-1} in LUT
Define mapped colour C:
if Si < min then C = colourmin
if Si > max then C = colourmax
else
colour0
colour1
colour2
colourn-
1
Si C
LUT
𝐶 = color𝑆𝑖 − 𝑚𝑖𝑛
𝑚𝑎𝑥 − 𝑚𝑖𝑛
Colour Transfer Function
More general form of colour LUT
A continuous function instead of a discrete LUT scalar value S; colour value C
colour transfer function : f(S) = C
e.g. define f() to convert densities to realistic skin/bone/tissue colours
Colour Spaces - RGB Colours represented as R,G,B intensities
3D colour space (cube) with axes R, G and B
each axis 0 → 1 (below scaled to 0-255 for 1 byte per colour channel)
Black = (0,0,0) (origin); White = (1,1,1) (opposite corner)
Problem : difficult to map continuous scalar range to 3D space
- can use subset (e.g. a diagonal axis) but imperfect
Colour Spaces - Greyscale Linear combination of R, G, B
Defined as linear range
easy to map linear scalar range to grayscale intensity
can enhance structural detail in visualisation - The shading effect is emphasized
- as distraction of colour is removed
not really using full graphics capability
lose colour associations :
e.g. red=bad/hot, green=safe, blue=cold
Example
Winding numbers : say we have a curve on a 2D plane How much a point is surrounded by the curve
- Winding numbers
We can calculate the winding numbers at every location
- 1/4 1 0
Winding numbers visualized by grey scale
Cup with an open top Star with an open top
A bar
Color Spaces – RGB
B(x) R(x)
Combining different channels to define a mapping function
Winding numbers visualized by red and blue
Cup with an open top Star with an open top
A bar
Colour spaces - HSV
Colour represented in H,S,V parametrised space
commonly modelled as a cone
H (Hue) = dominant wavelength of colour
colour type {e.g. red, blue, green...}
S (Saturation) = amount of Hue present
“vibrancy” or purity of colour
V (Value) = brightness of colour
brightness of the colour
Colour spaces - HSV HSV Component Ranges
Hue = 0 → 360o
Saturation = 0 → 1
- e.g. for Hue≈blue
0.5 = sky colour; 1.0 = primary blue
Value = 0 → 1 (amount of light)
- e.g. 0 = black, 1 = bright
All can be scaled to 0→100% (i.e. min→max) use hue range for colour gradients
very useful for scalar visualisation with colour maps
Example : HSV image components
Winding numbers by HSV (only changing hue)
Cup with an open top Star with an open top
A bar
Different Colour Spaces
A B
C D
Visualising gas density in a combustion chamber
Scalar = gas density
Colour Map =
A: grayscale
B: hue range blue to red
C: hue range red to blue
D: specifically designed transfer function
- highlights contrast
Color maps from Matlab
Colour Table/Transfer Function Design
Key focus of colour table design
emphasize important features / distinctions
minimise extraneous detail
Often task specific
consider application (e.g. temperature change, use hue red to blue)
Rainbow colour maps – rapid change in colour hue
representing a ‘rainbow’ of colours.
shows small gradients well as colours change quickly.
Examples of Manually Designed LUT 3D Height Data
HSV based colour transfer function
continuous transition of height represented
8 colour limited lookup table
discrete height transitions
Based on human knowledge
Summary
Discrete data structure
Topology and interpolation
Topological dimension
Data Representation
Structure - Topology - Cells
- Geometry - points
Attributes
Colour Mapping