1 GATE-540 Reconstruction from Voxels (GATE-540) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies & General Manager SimBT Inc. e-mail : [email protected]Game Technologies Program – Middle East Technical University – Spring 2010 Reference: William E. Lorensen and Harvey E. Cline
28
Embed
GATE-540 1 Reconstruction from Voxels (GATE-540) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies & General Manager SimBT.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1GATE-540
Reconstruction from Voxels
(GATE-540)
Dr.Çağatay ÜNDEĞER
InstructorMiddle East Technical University, GameTechnologies
• Each scanning process results in two dimensional “slices” of data.
13GATE-540
Data Slices
14GATE-540
Marching Cubes Extraction
• Extracts surfaces from adjacent pairs of data slices using cubes.
• Cubes “march” through the pair of slices until the entire surface of both slices has been examined.
15GATE-540
Marching Cubes Overview
• Load slices.• Create a cube from pixels on adjacent slices.• Find vertices on the surfaces.• Determine the intersection edges.• Interpolate the edge intersections.• Calculate vertex normals.• Output triangles and normals.
16GATE-540
How Are Cubes Constructed
• Uses identical squares of four pixels connected between adjacent slices.
• Each cube vertex is examined to see if it lies “on” or “off” the surface.
17GATE-540
How Are The Cubes Used
• Pixels on the slice surfaces determine 3D surfaces.
• 256 surface permutations, but only 15 unique patterns.
• A normal is calculated for each triangle vertex for rendering.
18GATE-540
15 Unique Patterns
19GATE-540
Triangle Creation
• Determine triangles contained by a cube.• Determine which cube edges are intersected.• Interpolate intersection point using pixel
density.• Calculate unit normals for each triangle vertex
using the gradient vector.
20GATE-540
Determining Triangles
• An index to a pre-calculated array of 256 possible polygon configurations (28 = 256) within the cube
• Treat each of the 8 scalar values (cube corners) as a bit in an 8-bit integer.
• 8 scalars (8 bits) determine the actual index to the polygon configuration array.
21GATE-540
Determining Inside/Outside
• Select a iso-value that the surface will pass through.
• If the scalar's value is higher than the iso-value then – The appropriate bit is set to one (inside)
• If it is lower then– The appropriate bit is set to zero (outside)
iso-value = 0.3
0.1 0.8
0.5 0.0
22GATE-540
Determining Intersections
• Determine intersection points to iso-suface by interpolation.
0.1 0.8
0.5
0.3
0.3
0.00.3
0.3iso-value = 0.3
23GATE-540
Determining Intersections
• Gradient of the scalar field at each grid point is also the normal vector of a hypothetical iso-surface passing from that point.
24GATE-540
Determining Intersections
• Interpolate these normals along the edges of each cube to find the normals of the generated vertices.
N
N
25GATE-540
Grid Resolution
• Variations can increase/decrease surface density.
26GATE-540
Examples
27GATE-540
Marching Squares
• 2D version of Marching Cubes• Aims at drawing lines between interpolated
values along the edges of a square considering given weights of the corners and a reference value.
28GATE-540
Conclusion
• Marching Squires / Marching Cubes provides a simple algorithm to translate a series of 2D medical scans into 2D / 3D objects.