Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scientific Visualization

Similar presentations


Presentation on theme: "Scientific Visualization"— Presentation transcript:

1 Scientific Visualization
姜明 北京大学数学科学学院 Based on [EA], Chapter 11. 更新时间2018年9月20日星期四5时44分34秒

2 Outline Data + Geometry Height Fields and Contours
Visualizing Surfaces and Scalar Fields Isosurfaces and Marching Cubes Mesh Simplification Direct Volume Rendering Vector-Field Visualization Visualization Examples

3 Data + Geometry Scientific visualization is the merging of data with the display of geometric objects through computer graphics. Scalar visualization 3D volume of scalars X-ray attenuation coefficient Vector visualization 3D volume of vector data Velocity in a fluid Tensor Visualization Matrix of data Stresses in a mechanical part

4 Difficulties Data are only data Large size of data sets.
Not geometric objects and cannot be displayed directly by graphics systems. We must create geometric object from them. Large size of data sets. Multi-dimensional data points. How we convert data to geometric objects and select the attributes of those objects determines a variety of visualization strategies.

5 Height Fields and Contours
z = f(x,y) Contours g(x,y) = c. Ovals of Cassini Meshes Contour Plots Marching Squares

6 Ovals of Cassini 卵形线 The family of quartic curves, also called Cassini ellipses, described by a point such that the product of its distances from two fixed points a distance 2a apart is a constant b2. The shape of the curve depends on b/a . a < b, a single loop with an oval or dog bone shape, 1st & 2nd. a = b, a lemniscate (双纽线), 3rd. a > b, two loops, 4th. Mathematica

7 Meshes A display with a rectangular mesh from height data for a part of Honolulu, Hawaii.

8 Contour Plots This is an implicit function display problem.
In practice, even if a function is given analytically, it is usually easier to find approximate contours by first sampling the function to obtain a set of values. The contours are then found by a technique called marching squares.

9 Marching Cubes Algorithm
Based on assumption: a contour can only pass through a cell in a finite number of ways Idea: A case table is constructed and enumerates all possible topological states of a cell, given combinations of scalar values at the cell points. It is the marching cubes algorithm in 3D It was reported by Lorenson and Cline in 1987.

10 Labeling the vertices of a cube
Thresholding of the vertices Coloring of the vertices

11 Contour crossing of a cell edge
Once Multiple times

12 Occam's Razor William of Occam (circa or 1285 till circa or 1349, apparently 10th April 1349) is also known as William of Ockham. We attribute to William the scientific principle known nowadays as "Occam's razor". Occam's Razor, also spelled Occam's razor,  also called law of economy,  or law of parsimony (简约法), a principle stated by Ockham that Pluralitas non est ponenda sine necessitate; “Plurality should not be posited without necessity.” The principle gives precedence to simplicity; of two competing theories, the simplest explanation of an entity is to be preferred. In his writings, Occam stressed the Aristotelian principle that entities must not be multiplied beyond what is necessary. A problem should be stated in its basic and simplest terms. In science, the simplest theory that fits the facts of a problem is the one that should be selected. ( Albert Einstein: “Everything should be as simple as possible, but no simpler”.

13

14 Four Unique Cases under Symmetry

15 Ambiguous Case

16 2D Contouring Ambiguity
Either choices are acceptable because contour lines are continuous and closed Break contour Join contour or

17 Program contour2.c Study this program for different parameter values.
Find out bugs in the code.

18 Visualizing Surfaces and Scalar Fields
More data in 3D. Lacking the extra dimension to use for display in 3D.

19 Volumetric Data Sets Voxel
Right parallelepiped of sides ∆x, ∆y, ∆z, centered at (xi,yj,zk). 3D array of voxel values on a equally spaced grid is called a structured data sets because we do not need to store where each sampling point is in space. Scattered data require us to store this location information, and is called unstructured data. Two basic ways for rendering Isosurface uses only a subset of the voxles. f(x,y,z) = c, c is the isosurface value. Direct volume rendering makes use of every voxel in producing an image.

20 Visualization of Implicit Functions
g (x, y, z) = 0. Ray casting involves computing the intersections. Another method is finding isosurfaces from sampled values of the function on a grid. The prime method is marching cube.

21 Isosurfaces and Marching Cubes
Marching cubes cases for 3D isosurface generation 2 ** 8 (256) possible cases have been reduced to 15 cases using symmetry in Lorensen and Cline’s original presentation. When there is only 1 corner value less than the isovalue, this forms a single triangle which intersects the edges which meet at this corner. There is only 1 unique configuration of this sort. By symmetry, we get 8 configurations which have 7 corners’ values less than the isovalue, still of this sort.

22 For configurations with 2 corners less than the isovalue, there are 3 unique configurations, depending on whether the corners belong to the same edge, belong the same face of the cube, or are diagonally positioned relative to each other. For configurations with 3 corners less than the isovalue there are again 3 unique configurations, depending on whether there are 0, 1, or 2 shared edges (2 shared edges gives you an 'L' shape). There are 6 unique configurations when you have 4 corners less than the isovalue, depending on whether there are 0, 2, 3 or 4 shared edges.

23 Lorensen an Cline’s original presentation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 3, 6, 7, 10, 12 and 13 are contouring ambiguity cases.

24 9 11 5 14 12 13

25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 and 14 are symmetric [EA, p. 575].

26

27 Ambiguity problem Ambiguity happens, when difference colors are assigned to the diagonal opposite vertices of the same side.

28 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Is Problem Resolvable? Problem is a sampling problem Not enough samples to know the local detail No solution in a mathematical sense without extra information More of a problem with volume extension (marching cubes) where selecting “wrong” interpretation can leave a hole in a surface Multiple methods in literature to give better appearance Supersampling Look at larger area before deciding 28 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

29 Example marchingsource.cpp

30 Mesh Simplification One of the disadvantages of marching cube is that the algorithm can generate many more triangles than really necessary. We can often create a new mesh with far fewer triangles such that the rendered surfaces are visually indistinguishable. Many approaches for the mesh simplification problem. One popular approach is triangle decimation which removes some edges and vertices.

31 Direct Volume Rendering
The weakness of isosurface rendering is that not all voxels contribute to the final image. It is possible to miss important part of the data by selecting the wrong isovalue. Direct volume rendering constructs images in which all voxels contribute to rendered images. Once the viewer is set, there exists an order in which we can do either front-to-back or back-to-front rendering for the volume data.

32 Front-to-back rendering
Early methods treated each voxel as a small cube that was either completely transparent or completely opaque. Front-to-back rendering Rays were traced until the first opaque voxel was encountered on each ray. The corresponding pixel in the image was colored black. If no opaque voxel was found along the ray, the image pixel was colored white. Back-to-front rendering A painter’s algorithm was used to paint only the opaque voxels. Both techniques produced images with serious artifacts that results from treating each voxel as a cube that was projected to the screen. They also failed to display the information in all the voxels. With the use of color and opacity, we can avoid or mitigate these problems.

33 Assignment of Color and Opacity
Example: CT data volume Soft tissues, fatty tissues, hard tissues. The color assignment can be based on the histogram of voxel values. Opacity are assigned on the basis of which voxel we wish to emphasize in the image. This is related to pattern recognition. Often, user can pursue it interactively.

34 Example Volume rendered CT scan of a forearm with different color schemes for muscle, fat, bone, and blood

35 Splatting (I) Back-to-front painting
The viewer location determines the front and defines the order to process the voxel array. Each voxel is assigned a simple shape. This shape is projected onto the image. The projection is called the splat or footprint. The shape depends on the sampling strategy for reducing the alias effects. Hexagonal, elliptical and Gaussian splats. [with obj.]crush or squash (something) with a sound of this type 啪的一声打碎(或压碎)he was splatting a bug. 他正在啪啪地打一只虫。 [no obj.] land or be squashed with a sound of this type 着地时作啪嗒声;被压扁(或压碎)时作啪嗒声

36 Splatting (II) Every volume element is splatted, as Lee Westover said, like a snow ball, on to the viewing surface in back to front order. These splats are rendered as disks whose properties (color and transparency) vary diametrically in normal (Gaussian) manner. Start with a background image and blend in successive splats. Go through the data volume back to front, relative to the position of the viewer.

37 Volume Ray Tracing Front-to-back rendering by ray-tracing.
Use the same blending formula for splatting. Need to have all the data because a ray passes through many slices.

38 Vector-Field Visualization
Hedgehogs Glyphs Color Particle Traces and Streamlines

39 Hedgehogs Vector data is displayed as 3D directed line segment whose orientation and magnitude are determined by the data. Example: wind data.

40 Glyphs Use other geometric objects rather than the line segments.
That can be oriented and scaled according to the magnitude and direction.

41 Scaling of Hedgehog “Scaling glyphs also posses interesting problems. In what Tufts has termed a ‘visualization lie’, scaling a 2D or 3D glyph results in nonlinear difference in appearance. The surface area of an object increases with the square of its scale factor, so two vector differing by a factor of two in magnitude may appear up to four times different based on surface area. Such scaling issues are common in data visualization, and great care must be taken to avoiding misleading viewers.” W. Schroeder, H. Martin and B. Lorensen: Visualization Toolkit, Prentice Hall, Inc., 1998, p. 168.

42 Color We can use color either alone or to reinforce other methods of displaying.

43 Visualization Examples
Particle traces and streamlines for flow visualization.

44 Stream tubes are similar to stream lines, except the tubes have width, providing another dimension that you can use to represent information.

45 One Slice of MRI Data

46 2D Contour Plot

47 3D Slice View

48 3D Isosurface

49 Isosurface and Slice View

50 Slice and Arrows

51 Isosurface and Slice


Download ppt "Scientific Visualization"

Similar presentations


Ads by Google