EP1472654A2 - Using runs of cells to traverse a ray through a volume - Google Patents

Using runs of cells to traverse a ray through a volume

Info

Publication number
EP1472654A2
EP1472654A2 EP03702002A EP03702002A EP1472654A2 EP 1472654 A2 EP1472654 A2 EP 1472654A2 EP 03702002 A EP03702002 A EP 03702002A EP 03702002 A EP03702002 A EP 03702002A EP 1472654 A2 EP1472654 A2 EP 1472654A2
Authority
EP
European Patent Office
Prior art keywords
order
voxels
ray
run
runs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP03702002A
Other languages
German (de)
French (fr)
Inventor
Peter Stephenson
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fraunhofer CRCG Inc
Original Assignee
Fraunhofer CRCG Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from PCT/US2002/024711 external-priority patent/WO2003012599A2/en
Priority claimed from PCT/US2002/039716 external-priority patent/WO2003052733A1/en
Application filed by Fraunhofer CRCG Inc filed Critical Fraunhofer CRCG Inc
Publication of EP1472654A2 publication Critical patent/EP1472654A2/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/08Volume rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/06Ray-tracing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/40Hidden part removal
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/20Function-generator circuits, e.g. circle generators line or curve smoothing circuits
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/39Control of the bit-mapped memory
    • G09G5/393Arrangements for updating the contents of the bit-mapped memory

Definitions

  • PCT/US02/2471 1 claims priority from U.S. provisional patent application 60/309,926, Stephenson, et al., Process and apparatus for line drawing, filed 3 August 2001.
  • PCT/US02/39716 claims priority from U.S. provisional patent application 60/341,503, Stephenson, et al., Process and apparatus for anti-aliased line drawing, filed 13 December 2001, and US provisional patent application 60/341,194, Stephenson, et al., Process and apparatus for line drawing in parallel, also filed 13 December 2001.
  • the invention relates generally to techniques for determining which cells of a raster a particular line intersects.
  • the cells of the raster are represented in the memory of a computer system and the computer system's processor makes the determination.
  • the cells of the raster may generally represent a set of locations.
  • the locations may be pixels in a display, and when they are, the techniques may be used to determine which pixels in the display represent the particular line, and thus to generate the line in the display.
  • the flat panel or cathode ray tube display devices typically used with computer systems are raster devices, that is, the display area is made up of a large number of picture elements, or pixels, which are arranged in a grid.
  • the location of any pixel in the display can be specified by its row and column in the grid. Varying the color and intensity of the pixels in the grid makes the image that the display device displays.
  • FIG. 9 is a high-level overview of a computer system with a raster display device.
  • the main components of system 901 are a processor 911 with memory 903 to which processor 903 has access and a monitor 915 for which processor 911 generates displays.
  • Monitor 915 is a raster display device and as such, has a grid of pixels 917.
  • Within memory 903 are stored bitmap 909, bitmap drawing code 985, and bitmap data 907.
  • Bitmap 909 is an area of memory that corresponds to grid of pixels 917. Each item of data in bitmap 909 corresponds to a pixel in grid of pixels 917.
  • Drawing code 985 is code for drawing graphical entities such as lines or polygons in bitmap 909.
  • Bitmap data 907 is data, typically supplied by a user program, which bitmap drawing code 985 uses to draw a graphical entity. For example, if a user program wishes to specify a line, it will typically indicate the start and end coordinates of the line in grid of pixels 917 and drawing code 985 will use that information to draw a corresponding line in bitmap 909.
  • Processor 911 then reads from bitmap 909 to generate an image for display on grid of pixels 917.
  • a display generator component 913 of processor 911 reads bitmap 909 and produces the actual signals for monitor 915 from the data in bitmap 909. It should be noted here that the task of producing a display 917 may be distributed in many different ways across hardware and software components, with the amount of hardware increasing as performance demands increase.
  • FIG. 10 shows why.
  • FIG. 10 shows a representation in pixels 1001 of the line 1003 that is described by the
  • intersection pattern for the line.
  • a line's intersection pattern depends not only on the line's slope, but also on the location of its endpoints relative to the grid of pixels.
  • the intersection pattern for any straight line has regular features that can be used in drawing the straight line in a raster display or analyzing a straight line that is displayed in a raster display.
  • the intersection pattern for line 1003 is a sequence of pixels.
  • the next pixel has either the coordinates (a+l,b) or (a+l,b+l). Which of the two possibilities the next pixel has depends on where the line intersects the current pixel. To draw a line one pixel at a time, one need only determine for each pixel where the line intersects the current pixel and use that information to determine which of the two possible positions to give the next pixel.
  • the intersection pattern includes groups of adjacent pixels that have the same y coordinate. Such a group of pixels is called a run.
  • One such run of three pixels is shown at 1005.
  • An examination of the runs in FIG. 10 shows that they have only two lengths: a short length 107, which is here two pixels, and a long length 1009, which is here three pixels.
  • the general rule is that the runs of an intersection pattern will have only two lengths, and these lengths will be consecutive integers.
  • the lengths of the long and short runs for any given line can be computed as follows:
  • line 1003 contains 41 pixels and 17 runs.
  • intersection pattern 1004 of line 1003 shows that the long and short runs themselves occur in repeating patterns.
  • intersection pattern 1004 there is a repeating pattern of a long run (I followed by two short runs (s) followed by a long run followed by one short run, or Issls, as shown at 1011 and 1013.
  • Issls a repeating pattern of a long run followed by two short runs (s) followed by a long run followed by one short run, or Issls
  • intersection pattern 1004 the complete sequence of runs is Islslsslslslss; therefore we have singularly occurring runs / separating sequences of shorts runs s + and the intersection pattern is constructed of runs of runs with the shape ls + .
  • the terminology of runs of runs is cumbersome so let us define these runs of runs to be second order runs. Where a run is defined by its position and length, a second order run is defined by its position, its length is defined by the number of runs which comprise it, and its shape is determined by whether there are more long or short runs in the pattern.
  • runs By analogy with second order runs, we can define runs to be first order runs and pixels to be zero order runs.
  • the number of second order runs must be the same as the number of long runs in the pattern by definition. If there are n long runs in the line there are a runs to divide amongst n second order runs. Therefore, if the division is to be as even as possible the length of a short second
  • the second order runs appear at 1011 and 1013 in intersection pattern 1004. There are more short runs 1013 than long, so the second order runs have the shape ls + , i.e., one long run followed by a sequence of short runs. There are three long runs 1011 of length three and four short runs 1013 of length two.
  • IA length 3 ' + 1 3 .
  • the shape of the order 3 runs is s + l.
  • the hierarchical description of ordered runs within the intersection pattern will be bounded, as the intersection pattern is eventually repeated if a and d are not coprime.
  • the numerator sequence is a sequence of the numerators of the fractions .
  • the line is at least — from any lattice point. If the value of ⁇ is raised d slowly, the intersection pattern will remain unchanged until the line crosses or intersects a
  • FIG. 11 gives an example. At 1001, the figure shows the intersection pattern of the line
  • the numerator sequence for order 0 of 1001 is shown at 1109 and that for order 0 of 1101 at 1111.
  • the pixels 1104 to the right of this value are denoted by light gray and the pixels 1103 to
  • the shifting of the intersection pattern due to the introduction of a non-zero intercept has a number of side effects.
  • the initial and final run of any order may be truncated. This occurs when the numerator of the intercept is not in the numerator sequence of that order.
  • p w a - 17. Therefore the initial value of the order 0 numerator sequence will not be the same as the initial value of the order 1 numerator sequence and the initial and final runs of order 1 will be truncated.
  • DDA works at the pixel level. Initially, floating-point x and y increments are computed. The x increment is the difference between the ending and starting x coordinates divided by the line's length and the y increment is the difference between the ending and starting y coordinates divided by the line's length. Each time a pixel is set, the current x and v coordinates, which are floating point values, are converted to integers and the pixel is set at the cell defined by the increment. Then the x increment is added to the x coordinate and the y increment is added to the y coordinate.
  • a difficulty with any pixel-by-pixel approach is that it requires a determination where the next pixel will be placed relative to the last pixel for each new pixel.
  • this determination is a floating-point operation. As such, it is both expensive to perform and subject to rounding errors. Moreover, because the determination must be performed with every pixel, the rounding errors may accumulate quickly and cause the line to be drawn inaccurately.
  • Run-based line drawing may also be used to solve problems that arise in efficiently representing rays that traverse three-dimensional space and in speeding traversal of the three-dimensional space by such a ray. It is an object of the present invention to provide solutions to such problems.
  • the invention is a technique employed in a computer system for determining voxels in an object space that are intersected by a ray.
  • the technique involves making projections of the ray on a plurality of planes in the object space, determining cells in the planes that are intercected by the projections, and using the intersected cells to determine the intersected voxels. Determining which cells are intercepted by the projections may be done using runs of cells, as explained in the parents of the present application, and runs of order 1 or greater may be employed.
  • the plurality of planes may be a pair of intersecting planes which are perpendicular to each other and for which the line of intersection is the ray's major axis. Further details of this aspect include techniques for determining intersected voxels that are 26-connected and intersected voxels that are only six-connected. In the 26-connected case, the technique proceeds as follows at the beginning of the next run of voxels:
  • the first order runs of cells that include the points in the projection corresponding to the beginning of the next run of voxels end at the same coordinate of the ray's major axis, the first order runs of cells together determine the next run of voxels through the end of the first order runs; but
  • this aspect includes techniques for determining from the runs of cells whether the voxels intersected by the ray have edge or corner connections.
  • the voxels will have an edge connection if one of the first order runs of cells has a corner connection at a point and the other does not; if both of the first order runs of cells have a corner connection at the point, the intersected voxels have a corner connection.
  • the invention is a technique employed in a computer system of efficiently traversing a volume with a ray.
  • the volume is subdivided into runs of voxels. Certain of the voxels in the runs are associated with data that affects rays.
  • Each ray that traverses the volume intersects one or more of the first runs and it itself made up of a set of second runs of voxels.
  • the technique determines for a second run of voxels belonging to a particular ray whether the second run includes a voxel of a first run that affects rays. When the second run includes such a voxel, the data associated with the voxel is examined.
  • the volume has an axis which is the major axis for both the particular ray and the first runs of voxels and if there are three sets of first runs, each set having a different axis of the volume as its major axis.
  • the first runs contain significant runs that include voxels that affect rays. Determining whether the second run includes a voxel from a first run that affects rays includes determining whether the second run includes a voxel of a significant run.
  • aggregate information is associated with partitions of the first runs.
  • the aggregate information indicates how one or more of the voxels in the partition affect rays. Determining whether the second run includes a voxel from a first run that affects ways includes using the aggregate information associated with a partition determine whether the partition contains a voxel that affects the particular ray.
  • the partitions may be the significant runs. They may also be a number of sets of partitions, with the partitions in each set having a different length. The partitions to use for a particular ray are selected in accordance with the lengths of the runs in the ray.
  • FIG. 1 is an overview of the manner in which lines are drawn using the techniques of the invention
  • FIG. 2 is an overview of a system which draws lines using the techniques of the invention
  • FIG. 3 is a flowchart of how the bitmap processor processes complete runs of pixels
  • FIG. 4 is a flowchart of how the bitmap processor processes truncated runs of pixels
  • FIG. 5 is a flowchart of how the bitmap processor processes a run of order 1;
  • FIG. 6 is a flowchart of how the first truncated run of an order / is processed and set;
  • FIG. 7 shows how the first pixel of a line is handled using the techniques of the invention
  • FIG. 8 shows a flowchart of how a complete run of order is processed
  • FIG. 9 shows a system in which the invention may be employed
  • FIG. 10 shows the structure of a representation of a line as a set of pixels
  • FIG. 11 shows the effect of a displacement of the starting point from the origin on the structure of the representation
  • FIG. 12 shows an example line
  • FIG. 13 shows how the first pixel of the example line is handled;
  • FIG. 14 shows truncated runs of orders 1-3 in the example line;
  • FIG. 15 shows the geometry of the error term and structural parameters in a run of order 1;
  • FIG. 16 is a flowchart of a technique for drawing lines in parallel;
  • FIG. 17 is a diagram showing the geometry of ray traversal;
  • FIG. 18 is a diagram showing the geometry of the projection of a ray on planes that are perpendicular to each other and intersect at the ray's major axis;
  • FIG. 19 is a first diagram showing how voxels intersected by a ray may be computed from the cells intersected by the ray's projections;
  • FIG. 20 shows an algorithm for computing the voxels intersected by a ray;
  • FIG. 21 is a second diagram showing how voxels intersected by a ray may be computed;
  • FIG. 21 is a second diagram showing how voxels intersected by a ray may be computed;
  • FIG. 22 is a third such diagram showing how edge connections appear in the projections;
  • FIG. 23 is an algorithm for detecting edge connections in the voxels;
  • FIG. 24 is a fourth diagram showing how corner connections appear in the projections;
  • FIG. 25 is an algorithm for detecting corner connections in the voxels;
  • FIG. 26 is a diagram showing an encoding run in a volume;
  • FIG. 27 shows a ray traversing a volume which has been divided into encoding runs
  • FIG. 29 shows an algorithm for detecting an intersection between a ray and an encoding run
  • FIG. 30 shows a ray traversing a volume in which the encoding runs have been divided into a hierarchy of runs
  • FIG. 31 shows an algorithm for using a hierarchy of runs to find voxels that will affect the ray.
  • FIG. 1 Overview of line drawing with the invention: FIG. 1
  • FIG. 1 is a flowchart [101] that provides an overview of how a line-segment may be drawn using this invention.
  • Starting parameters include the maximum order of the runs to be used in drawing the lines [122] and the start and endpoints of the line [112,114].
  • the maximum order can be predefined by the manufacturer of an apparatus based on the invention, calculated based on the characteristics of the system or based on the length of the line.
  • the maximum order of the runs [120] is set to two.
  • ( ,, y,) consists of, at most, three sets of runs of any order, i: The first truncated run of order i, the set of full-length runs of order i, and the final truncated run of order i.
  • FIG. 2 Overview of the components of a system for drawing lines according to the invention: FIG. 2
  • FIG. 2 shows the components of a system 201 for drawing lines according to the invention.
  • the main components of system 201 are a Truncated Run Processor [102], which calculates the structure of the first truncated run of order / [202] and the structure of the hierarchy of runs [140] in the line segment, and the Run Processor [104], which calculates the length of the full length runs and the final truncated run [206].
  • the Run Processor [104] calculates the length of the full length runs and the final truncated run [206].
  • the Bitmap Processor is responsible for breaking the run into its composite pixels and setting each pixel into the Bitmap Memory [108].
  • the Truncated Run Processor [102] is responsible for calculating the structure of the first truncated run of the desired order [120] and supplying this structure to the Bitmap Processor [106] so that the truncated run [194] can be set into the Bitmap Memory [108].
  • Bitmap memory [108] may be a bit map such as bitmap 909 in FIG. 9.
  • Truncated Run Processor calculates the structure of the first truncated run, it also calculates the structure of the hierarchy of runs [140] and stores this information [142] for the use by the Run and Memory Processors [104,106]. During this process if the desired maximum order of the process [120] is found to be greater than the maximum order of the hierarchy of runs in the line, the maximum order [120] is set to be the maximum depth of the hierarchy [124].
  • the Truncated Run Processor Based on the start and end points of the line [110], the Truncated Run Processor also calculates and stores [132] the starting pixel position for the line [130].
  • Each component of the first truncated run is calculated based on the error term [150], As each component is processed, the error term is retrieved [152], updated and stored again [154]. Once the first truncated run has been processed, the error term remaining [150] is used by the Run Processor [104] to define the full-length runs in a similar manner.
  • the Run Processor [104] is responsible for calculating the length of each full-length run of the desired maximum order in the digital line. These lengths are passed to the Bitmap Processor [106] such that the runs can be set into the Bitmap Memory [108]. The length of the full-lengths is decided based on the error term [150], which is retrieved [156], updated and stored [158] to process the next full-length run. Thus, the error term is recalculated only at the beginning of each full-length run of the maximum order instead of for each pixel.
  • the Bitmap Processor [106] is responsible for actually setting the runs into the Bitmap Memory [108].
  • the Bitmap Processor [106] can take advantage of this function.
  • the Bitmap Processor [106] also keeps a track of the current position of the line being drawn in relation to the end point of the line [110]. If the line moves reaches the end point [114], the Bitmap Processor [106] signals the Truncated Run Processor [102] or the Run Processor [104] to terminate [162] using an internally stored termination condition [160].
  • the Bitmap Memory [108] is the memory representing the raster display of a graphics system, video memory, image memory or any other type of bitmap.
  • the Bitmap Processor [106] handles the process of setting the pixels of the Bitmap Memory [108]. To draw the line, the Bitmap Processor is given a set of commands [194][196] to draw a collection of runs of various orders into the Bitmap Memory. The information given in the command to draw a run is the length of the run, rf , and the order of the run, / [194][196]. The position of the run in the bitmap [130], ( j ] ,y j [ ] ), is initialized [132] by the Truncated Run Processor [102] and is retrieved by the Bitmap Processor [136]. As the run is drawn, the coordinate is updated to the position of the next run of order i, and is stored for the next iteration [134].
  • Bitmap Memory [108] permits the setting of runs of pixels or runs of runs, etc., the process of reducing the run of order / to runs of order i-1 can be stopped at the permitted level. Therefore, instead of setting pixels into the Bitmap Memory, runs or runs of runs can also be used.
  • each run of any nonzero order i within the digital line has, at most, only two possible run lengths that are consecutive integers where the length is measured as the number of composite runs of the next lowest order, i-1.
  • the runs of order 1 in the line segment (0, 0) to (41, 17) can be described by (Islslsslslslslslsss) [l] .
  • a run of order can then be defined recursively by:
  • a run of order 1 is the maximal set of contiguous pixels with a similar abscissa.
  • a run of order i is the maximal set of contiguous runs of order i-1 such that each run has a shape ( s) [l'1] t (ls + ) [ ' ] , (s + l) [ '-", or (s ) [ " !1 , where (/ + ) [ -' ] and ( ) li'l] denote the occurrence of one or more long and short runs of order /-/ respectively.
  • a run of order 2 can only possess the shape (ts) [l] or (ls*) [Ij '.
  • the type of order 1, t i] is defined to be zero.
  • the types of orders greater than 1 are calculated using structural parameters; the structural parameters and their calculation will be described in detail below.
  • Inputs to the process are the length of the run of order i to be set [194] and the structure of the hierarchy of runs. The process will cease if the end point of the line has been reached [304].
  • the pixels of the run are set directly [340] into the Bitmap Memory.
  • the process of reducing the first truncated run of order k into full-length runs of order k-1 follows directly from the instructions to reduce full-length runs.
  • the only variation comes from the fact that a truncated run is defined to be a run not of its full-length. Therefore at least one run of order k-1 has been truncated from the run of order k. Because this is the first run in the line, the truncated run occurs at the beginning of the run.
  • the process is shown at 401 in FIG. 4.
  • the inputs are the length of the run of order i that is to be set [194] and the structure of the hierarchy of runs [146].
  • the process 401 will cease if the end point of the line has been reached [404].
  • the pixels of the run are set directly [440] into the Bitmap Memory If the order of the run is at least 2, the run is reduced into its composite runs of the next lesser order and each run is set into the Bitmap Memory:
  • FIG. 5 is a flowchart 501 showing how to set the pixels of a run of order 1 [340].
  • the method requires as inputs the starting pixel [136], (x j l ] , y 1 ' 1 ), the end point of the line [114], and the length of the run [194], rf , are required.
  • the starting pixel is stored and updated internally [136].
  • the length of the run [194] is passed to the Bitmap Processor.
  • Each pixel in the run has a similar y-coordinate, which is the y-coordinate of the starting pixel [136], yj 1] .
  • the length of the run to be set [194] is changed to the difference between the x- coordinate of the start of the run being set and the ceiling of the x-coordinate of the endpoint ofthe line, rf ⁇ x ⁇ - x [404].
  • the starting coordinate of the next run of order 1 in the line is calculated from the current coordinate value by incrementing the current y-coordinate of the next pixel position [430], How the first truncated run of order i in the line segment is processed by the Truncated Run Processor: FIGS. 6 and 12
  • a truncated run length of order k is of course made up of run lengths of orders 0 through k- 1.
  • the bits for that order are set before the next higher order is processed.
  • the bits set for order i -1 will always make up the complete truncated or untruncated first run of the order i .
  • the endpoints of the line segment are the real number coordinates (x ,y 0 ) and (x ⁇ ,y ⁇ )
  • the slope of the line is calculated by a - (y, - y 0 )/(x i ⁇ x 0 ) [502].
  • Example line 1201's endpoint (xo, yo) 1203 is (1/2,12/41) ; its endpoint (xi.yi) 1207 is (41+1/2,17+12/41) .
  • the coordinates of the endpoints are rational numbers in this case, a coordinate may be any real number.
  • the first step in the algorithm is to handle the pixel in which the start point of line lies as described in FIG. 13.
  • the dark pixel 1301 at the start of the line will have been processed.
  • l/2j 0
  • the choice from these two is made using the value of the error term /J 0 0] .
  • the error term is greater than or equal to the average run length of order 1 as shown at 709 in FIG. 7, the next pixel is pixel ( ° ] + 1, yQ l ] + 1) . Accordingly, the error term is also updated.
  • the coordinate (x , .yj, 1 ] ) is stored as the position of the next run in the line segment [130].
  • the error term ⁇ ] is stored [152] as the error term for the next run [150].
  • the structure of the hierarchy of runs stores a description of each level in the hierarchy from order 1 to the defined maximum order [120].
  • Each record of the description for order i stores the following entries:
  • the type of the runs of order i in the line, t [k] either 0 or 1.
  • FIG. 15 shows geometrically why the error parameter and the structural parameters can be used in this fashion.
  • the figure shows a first-order run y of pixels 1505 representing a portion of line 1507 with slope a .
  • the slope ⁇ I1] of the run is the same as the slope of the line 1507. Shown at 1503 is the last pixel of the run y " -l .
  • the coordinates are the coordinates of the lower left-hand comer of the first pixel of run y; the coordinates ( ⁇ , TM ) are the coordinates of the lower left-hand comer of the first pixel of the first pixel of run j ' +l.
  • the values of the error parameter and the structural parameters are defined geometrically by means of lines that are parallel to line 1507 and intersect comers of the pixels of runy.
  • line 1509 intersects the upper left-hand comer of pixel 1503;
  • line 1511 intersects the upper left-hand comer of the last pixel 1506 in runy ' ;
  • line 1513 intersects the bottom left-hand co er of the first pixel in runy ' .
  • the error parameter ⁇ ] is the distance on the line formed by the top of pixel 1506 between the intersections of lines 1507 and 1513 with that line. The greater the distance between lines 1507 and 1513, the shorter the next n must be. Moreover, since a line is drawn beginning with a partial ran of the maximum order k and the partial mn is made by beginning with a partial n of order 1, followed by a partial mn of order 2, and continuing through order k, the error term for the partial mn of order i is that resulting from order i - l.
  • the structural parameter ⁇ [n is the distance on the line formed by the top of pixel 1506 between the intersection of line 1513 with the line formed by the top of pixel 1506 and the upper left-hand comer of pixel 1506.
  • the stmctural parameters vary with the slope o ' 3 of the line as represented by mns of order i, and thus can be used to determine the type of order / + 1.
  • FIG. 14 shows line 1201 and the pixels 1402 that will be generated to represent it according to the technique under discussion.
  • At 1401 is shown how the first tmncated mn 1403 of order 1 is set;
  • at 1405 is shown how the first truncated mn 1405 of order 2 is set; and
  • at 1407 how the first tmncated run of order 3 is set.
  • first pixel 1301 has been set and the position of the next pixel relative to first pixel 1301 has been determined as described above.
  • the next step is to handle the first tmncated mn of order 1 if it exists.
  • the portion on the line that will be processed is described by the dark pixels 1403.
  • the initial tmncated mn of order 21405 is described by the dark pixels 1407 in line 1201.
  • the initial tmncated mn of order 2 has a length of one (i.e. one mn of order 1).
  • the last mn of order 1 in a mn of order 2 is a short mn of order 1.
  • a short mn of order 1 has a length of two pixels. Therefore two pixels are set in this stage.
  • the initial tmncated mn of order 31409 is described by the dark pixels 1411.
  • the initial tmncated mn of order 3 has a length of one (i.e. one mn of order 2).
  • the mns of order 3 in the line have a shape s + l , the last mn of order 2 in a mn of order 3 is a long run. Therefore we will set a mn of order 2 of length three.
  • the Run Processor [104] performs the steps shown in flowchart 801.
  • the inputs are the maximum order of the mns (120), the stmcture of the hierarchy of mns [146] which was determined by tmncated mn processor [102] while processing the tmncated mns, and the error term ⁇ [l] provided by tmncated mn processor [102].
  • the mn processor determines the length of the mn of order i in the line and passes the mn's length and order to the Bitmap Processor [106] to set the actual pixels of the run into the Bitmap Memory [732].
  • the calculation of the length of the mn of order i is based on the type of order (i) [702] and the value of the error term [150] , ⁇ f , retrieved [158] by the Run Processor [710,720]. Once the length of the mn has been calculated, the error term is updated, ⁇ f , and stored [156] .
  • the values of the stmctural parameters ⁇ l ' ] and v [ ' ] and the length of a short and long mn, rf and rf , are retrieved [144] from the stmcture of the hierarchy of mns [140].
  • the mn is set into memory [194] by the Bitmap Processor [106] and [732].
  • the Run Processor keeps processing mns as just described until it reaches the end of the line segment [730].
  • a technique similar to the 2D polygon scan conversion embodiment is used.
  • a technique that is also possible is to shade the polygon using lines of constant depth. Think of a plane parallel to the view plane being used. As the plane is moved backwards through the polygon, the line of intersection between the plane and the polygon can be defined. This line has a constant depth that can be used to make the shading technique more efficient. To shade the polygon you can step along this line using the line drawing technique described setting each pixel the color calculated by the shading algorithm.
  • Height field rendering Ray tracing has long been used to render height fields or elevation maps.
  • the mn-based ray line drawing technique can be adapted to traverse a ray over the height field to seek an intersection with an elevation.
  • the voting process requires a line of votes to be cast into an array.
  • the mn-based line digitization techniques described can be used to cast the votes.
  • FIG. 16 Parallel techniques for determining the cells of a raster that are intercepted by a line: FIG. 16
  • An advantage of using mns of any order n to determine the cells of a raster that are intercepted by a line is that once the first tmncated mn of order n is drawn and the stmctural information about the line has been computed, it can be used to determine the positions in the raster of all of the other mns of order n of cells that are intercepted by the line. Consequently, if the hardware or software being used to determine the cells permits it, the cells belonging to the other mns of order n can be computed in parallel.
  • the parallel computations can be performed by calculating each mn of order n in the cells intersected by the line in parallel; or by calculating the positions of groups of mns of order n in the cells intersected by the line in parallel and using the sequential version of the algorithm to draw each group.
  • Another level of parallelism could be attained within each mn by setting multiple mns of a lower order or pixels per iteration of the sequential or parallel version of the algorithm.
  • the mn of order n could be divided into mns of an order less than n, each of which could be processed in parallel.
  • FIG. 16 gives an overview of how mns may be computed in parallel.
  • initialization 1615 which calculates and sets the first tmncated mn of cells and then computes the starting cells of each of the full mns of order i being set, and the part 1615 that sets the full mns in parallel.
  • start 1603 the first part of the initialization is done as shown in FIG. 6.
  • tmncated mn processor 102 receives as inputs the endpoints of the line; from the endpoints, it calculates the line's slope and determines the starting pixel and the starting point and error term ⁇ for the first mn tmncated mn of order 1.
  • the apparatus of FIG. 2 may be modified to perform the processing of FIG. 16 by replacing bitmap processor [106] with a number of bitmap processors 106(a..j), which can operate on bitmap memory 108 in parallel. Run processor 104 would then give each bitmap processor 106(i) the starting cell and stmcture parameters for the mn that bitmap processor 106(i) is to set.
  • the degree of order n may be determined by the number of bitmap processors 106; for example, if there are four bitmap processors, the degree of order n may be that at which the line contains full mns and a final tmncated or untmncated ran such that the total number of the full and final mns is divisible by 4.
  • the degree of order n may be determined by the designer or based on external parameters such as the length and slope of the line.
  • the bitmap processors may also be able to set an array of bits in a single operation; in that case, the order whose runs best fit the array that the bitmap processor can set might be the one for which the operation is parallelized.
  • ⁇ y is the intercept value of the first full length ran given at position (- , o )•
  • j yy -y ⁇ - ' as the height of a mn is always one.
  • ⁇ and v are the stmctural parameters described in the parent of the present application.
  • j in the image given the line segment (x 0 ,v 0 )to (JC,, ,) such that L)O J ⁇ ./ ⁇ [ i 1 where o > ⁇ 0 > ⁇ > Vi ⁇ and x 0 ⁇ *, :
  • Algorithm 1 illustrates a possible implementation of an order 1 algorithm.
  • Algorithm 1 Calculating the length and position ofthej-th run of order 1 in the digital 10 line.
  • the constants cf and cf can be calculated once in the initialization of the algorithm.
  • the constants cf and cf can be calculated iteratively as each new parallel task is created from preexisting constants. Therefore each mn can be set in parallel for a cost of approximately 6 additions, a multiplication and a comparison compared to a cost of 3 additions and two comparisons for the central loop of the sequential algorithm. Hence, the overhead imposed by the parallelization of the algorithm is quickly recouped.
  • migrating to a parallel implementation would add two divisions and a multiplication to the cost of initializing the algorithm and 10 additions, a multiplication and division and a comparison to the cost of calculating the length and position of each mn of order 2.
  • Algorithm 2 Calculating the length and position of the y ' -th run of order 2 in the digital line.
  • Algorithm 3 Calculating the length and position of they-th run of order i in the digital line.
  • ran lengths Within each order the computation of ran lengths is actually an initialization and we count it as such.
  • the ran positions can be computed in parallel. Each position costs 0(1) rational arithmetic operations. However, here division appears to require full precision. Assembling our accounting, we have that initialization over all orders costs O(log d) rational arithmetic operations. Idealizing slightly the partial quotients behavior of GCD, we credit order i with d 12' mns. If we allocate d 12' processors to the /-th mn, the time to compute mn positions across all orders is O(l) rational arithmetic operations.
  • the order of the algorithm must be decided either by the designer or dynamically by the system itself. While the length of the mns in the digital line increases exponentially with the order of the ran, the cost of initializing an algorithm also rises, albeit linearly. Given that the cost of an iteration to decide the position and length of the next mn in the line is so small, the number of mns in the line must be significant enough to warrant using a higher order algorithm.
  • FIG. 17 There are many situations where a program needs to compute the traversal of a ray through three-dimensional space.
  • One example of such a program is one that produces a two- dimensional display of a three-dimensional object; another is one that determines how a signal is propagated through a volume.
  • FIG. 17, which shows how ray traversal may be used to make a two-dimensional representation of a three-dimensional object, is a slightly modified version of Levoy's FIG. 2.
  • the two-dimensional representation of the three-dimensional object is an image 1705 that contains P x P pixels.
  • the image is effectively a "window" into an image space 1701 that contains P x P x W voxels.
  • a voxel is the three-dimensional equivalent of a pixel: it is a data item that corresponds to a cell located at a point (x.y.z) in image space.
  • the data in the voxel contains information about the cell; an example of such information is the color and opacity of the cell. If the color and opacity correspond to data values, the data in the voxel may also include the data values.
  • image space 1701 is non-empty, it will include one or more object spaces 1703.
  • Each object space has as many voxels as are required to contain all of the voxels for a particular object in image space 1701.
  • Each voxel 1709 in object space 1703 contains data as required for the portion of the object represented by the voxel. It should be noted that, as shown in FIG. 2, object space 1703 may not have the same x, y, and z-axes as image space 1701, and that consequently, a ray 1711 may pass through object space 1703 at any angle relative to the axes of object space 1703.
  • one or more rays 1711 corresponding to one or more pixels 1715 in the image are traced through image space 1701. If ray 1711 passes through a voxel 1709 whose data affects the appearance of that pixel, the relevant information from the voxel becomes part of sample 1713 for the pixel. When ray 1711 has completely traversed image space 1701, the information in sample 1713 is used to determine the appearance of pixel 1715.
  • an image space 1701 of any size has an enormous number of voxels, and most of the voxels traversed by a particular ray 1711 are either not part of an object space 1703, and therefore provide no information to the traversing ray, or are behind an opaque voxel and can provide no information to the traversing ray beyond what was obtained from the opaque voxel.
  • Efficient traversal of image space 1701 by a particular ray thus requires both efficient techniques for computing the voxels that are intersected by the ray and efficient techniques for determining which of the voxels intersected by the ray contain information that is relevant to the pixel that corresponds to the ray.
  • the mn-based techniques described in the parents of the present patent application may be employed both to provide efficient computation of the voxels that are intersected by a ray and to provide efficient determination of which of the voxels intersected by the ray contain information relevant to the ray's pixel.
  • the same techniques can of course be employed in other applications where the information gathered by the ray traversal has uses other than or in addition to display generation.
  • FIG. 18 The techniques that are explained in detail in the following are based on the fact that a ray which is traversing a volume in which positions of points are defined relative to X, Y, and Z axes may be represented as two projections: one on the plane defined by the X and Y axes and another on the plane defined by the X and Z axes. This is shown in the diagram of FIG. 18.
  • FIG. 18 shows a volume 1801 that is being traversed by a ray 1816.
  • Points in volume 1801 are specified by the triplet (x,y,z), where x is a value on X axis 1803, y is a value on Y axis 1805, and z is a value on Z axis 1807.
  • X axis 1803 is termed the major axis with regard to traversing ray 1816 because the direction of traversing ray 1816 is closer to that of the X axis 1803 than it is to the other two axes.
  • X axis 1803 is the major axis because for any two points on ray 1816, (a,b,c) and (i,j,k), the difference ⁇ between a and i will be greater than the difference ⁇ between b andy or c and k.
  • Traversing ray 1816 passes through the top and bottom of volume 1801.
  • the point at which ray 1816 intersects plane 1815 is point (x(c), y(d), z(e)) 1819; the point at which the ray intersects plane 1813 is (x(0),y(a), z(b)) 1817.
  • ray 1816 may be projected onto planes 1833 and 1835.
  • One way of doing the projection onto plane 1833 is to construct a line on top plane 1815 which passes through point 1819 and is perpendicular to the edge of plane 1833 which intersects plane 1815, construct a line on bottom plane 1813 which passes through point 1817 and is perpendicular to the edge of plane 1933 which intersects plane 1813, and then construct the projection 1821 of the ray on plane 1833 by connecting the points at which the perpendicular lines intersect the edges.
  • Projection 1827 on plane 1835 can be constructed in the same fashion.
  • projections 1821 and 1827 contain all of the information needed to determine the (x,y,z) coordinates of all of the points in volume 1801 that are on ray 1816; consequently, projections 1821 and 1827 together may be used to represent ray 1819.
  • a three-dimensional lattice of voxels in volume 1801 may be represented by two-dimensional lattices in planes 1833 and 1835 and the voxels intersected by ray 1816 may be determined from the lattice cells intersected in plane 1833 by projection 1821 and the lattice cells intersected in plane 1835 by projection 1827.
  • Figs. 19-22 Determining cells in a two-dimensional lattice that are intersected by a line is of course the problem addressed by the techniques described in the portion of the present patent application that are carried over from the present application's parents. As set forth there, given two points within a two-dimensional lattice, it is possible to describe lattice cells that are intersected by a line connecting the two points in terms of mns and mns of mns of cells.
  • the lattices are projection planes such as planes 1833 and 1835 and the lines are projections of a ray on the projection planes, then it is further possible to determine voxels intersected by the ray from the lattice cells intersected by the projection lines.
  • FIGs. 19 and 20 Determining 26-connected voxels intersected by a ray: FIGs. 19 and 20
  • FIG. 19 shows how to determine 26-connected voxels intersected by a ray from mns of lattice cells on the XY plane 1833 and the XZ plane 1835 that are intersected by the projections of the ray on the XY and XZ planes.
  • Volume 1801 in FIG. 19 has an X-axis 1803, a Y-axis 1805, and a Z-axis 1807, with the X-axis being the major axis.
  • Determining the mns in the XY plane and the XZ plane is done iteratively or in parallel a ran at a time with the corresponding runs of each traversal determining the length of the resultant mn of voxels.
  • the initial mns of lattice cells intercepted by the projections onto the XY and XZ planes are calculated.
  • the shorter of these two rans and the equivalent number of cells of the longer run map to the first ran of voxels intercepted by the ray.
  • mn of lattice cells 1923 and the corresponding portion of mn 1929 map onto ran of voxel cells 1911.
  • the remaining portion of the longer mn 1929 and a co ⁇ esponding portion of mn 1925 map onto run of voxel cells 1913.
  • the remaining portion of ran 1925 and all of run 1931 are then mapped onto mn of voxel cells 1915.
  • Voxels intersected by the three-dimensional line can therefore be determined by taking the length of the shorter of the two corresponding rans of cells as the length of the three-dimensional ran of voxels.
  • the longer two-dimensional mn of cells is then reduced by the length of the shorter ran, which is replaced by the next two- dimensional ran in its traversal.
  • the procedure is more precisely described in Algorithm 2001 in FIG. 20.
  • the cells in the two-dimensional rans need only be 8-connected, i.e., by any of their four sides or four comers. Deteimininfi the 6-connected voxels intersected by a ray: FIG. 21
  • the 6-connected set of voxels that the ray intersects is shown at 2117.
  • Run 2119 corresponds to ran 1923 and the corresponding portion of mn 1929;
  • mn 2121 corresponds to the remaining portion of mn 1929, added cell 2115, and the part of mn 1925 corresponding to the remaining portion of mn 1929.
  • Run 2123 corresponds to the remaining portion of mn 1925, added cell 2107, and mn 1931. All of the voxels in set of voxels 2117 are connected to one or more other voxels in the set by their faces.
  • FIGs. 22-25 With 6-connected sets of voxels that are intersected by a ray, ray-object intersection tests can be avoided if voxels in which the ray intersects only an edge or a comer of the voxel can be excluded from the 6-connected set of voxels.
  • FIG. 22 shows the edge intersection case. First, the edge intersection case must be detected. For an edge intersection to occur in the set of 6-connected voxels intercepted by the ray, a comer intersection must occur in one of the two-dimensional sets of mns. This is shown in FIG. 22, where two-dimensional set of mns 2205 that intersects projection 2201 has a comer intersection 2209 between mns
  • the distance ⁇ between the projection and the comer of the next mn is considered. If the distance is non-zero, no edge intersection occurs. If it is zero, an edge intersection occurs and no voxel corresponding to the cell that is added to the beginning of the next two-dimensional mn is added to the set of voxels.
  • the algorithm is set forth more precisely at 2301 in FIG. 23, where ⁇ indicates a normalized value of ⁇
  • Set of voxels 2421 then has a mn of voxels 2423 that corresponds to two- dimensional mns 2407 and 2415 and a mn of voxels 2427 that co ⁇ esponds to two- dimensional mns 2411 and 2419. Runs of voxels 2427 and 2423 are connected at comer 2425.
  • the three-dimensional traversal algorithm requires two separate two-dimensional traversals of each of the projections of the line pe ⁇ endicular to the major axis. If comer and edge intersections are ignored, the number of mns in the three- dimensional path of the ray is the sum of the number of rans in the two two-dimensional traversals. Therefore the order of the three-dimensional ray traversal algorithm is 0(n/ ⁇ ), where r is now the average length in the three-dimensional path of the ray and n is the associated number of cells.
  • FIG. 26 Using descriptions of rays as sets of runs of voxels to accelerate ray traversal: FIGs. 26-31 Using encoding runs to describe the voxels in a volume: FIG. 26
  • a problem in rendering the contents of a volume as pixels by traversing the volume with rays to obtain the information needed to define the appearance of the pixels is that in general, not all contained in the volume along the path traversed by a particular ray has anything to do with the appearance of the pixel. Two examples of this fact are the following:
  • early ray termination only applies to certain rendering functions such as shaded rendering and isosurfaces. If the entire path of the ray through the volume must be determined, as for an X ray style or maximum intensity projection (MIP) rendering, early ray termination is not valid.
  • MIP maximum intensity projection
  • a general solution to the problem of skipping uninteresting space is to find some way of indicating that the content of a particular set of voxels will have no effect on a traversing ray.
  • the technique generally used is to subdivide the space being traversed into regions that will affect a traversing ray and regions that will not. When the ray enters a region that does not affect it, there is no need to examine individual voxels in the region.
  • Run-length encoding is used in situations where the data being compressed includes sequences of data in which the same value is repeated over and over again. Such a sequence of data may then be represented by giving the value and the number of repetitions. For example, the sequence of 10 eights, 8888888888 may be encoded as the pair ⁇ value, number of occurrences ⁇ , or ⁇ 8,10 ⁇ .
  • the compressed data thus becomes a list of pairs ⁇ value, number of occurrences ⁇ .
  • the sequence of data represents pixels in an image, there may be a list of pairs corresponding to each row of pixels in the image.
  • a row of pixels is of course a mn, and in the following, mns used for encoding will be termed encoding runs, to distinguish them from the rans of cells traversed by a line or ray.
  • the encoding rans may be rows of voxels in the volume.
  • FIG. 26 gives an example of an encoding ran 2603 in volume 1801. Encoding mn 2603 is a row of voxels in 1801 for which the coordinates are (x(i),y(0..n),z(j)).
  • Similar encoding mns may of course be made where the voxels all have the same y and z coordinates and a range of x coordinates or the same x and y coordinates and a range of z coordinates.
  • the best encoding mns to use with a particular ray are those for which the dimension with the range of coordinates is the dimension of the major axis of the ray.
  • Encoding ran 2603 can thus be encoded as a list of sets of three values as follows: ⁇ NULL,y(0),y(a) ⁇ ; ⁇ VALl,(y(b),y(b) ⁇ ; ⁇ NULL,y(c),y(d) ⁇ ; ⁇ VAL2,(y(e),y(f) ⁇ ; ⁇ NULL,y(g),y(h) ⁇ , where a part of the mn that has no effect on the ray is indicated by NULL followed by the y coordinates of the beginning and end of the sequence of voxels that have no effect and a part of the mn that can affect a ray is indicated in the same way, except that NULL is replaced by value(s) that will affect the ray in the sequence.
  • the data items corresponding to the voxels in the significant mn that match the ray voxels must be examined to determine how they affect the ray.
  • Using the techniques just explained to determine the ray voxels for a ray make determining whether there are ray voxels that are the same as voxels in a significant mn in a particular encoding mn easier, since in order for there to be such voxels, a run of the ray voxels must intersect the significant mn.
  • FIG. 27 shows a slice 2701 of a volume of voxels in which the voxels are associated with data from the Visible Human Project male dataset. The data describes the head and neck of a human male.
  • Slice 2701 is a set of voxels that have the full range of x and v coordinates permitted by the volume and a single z coordinate.
  • the interesting region of slice 2701 is represented as a list of encoding mns.
  • the mn of voxels represented by one such mn, 2703(1), is shown in FIG. 27.
  • mn 2703(i) has three runs 2707 that contain no information that will affect a ray and two significant rans 2705; the encoding mn corresponding to mn of voxels 2703(i) will represent that fact as described above.
  • a single ray 2709 is shown traversing the volume. The ray has the X-axis as its major axis; consequently, the encoding mns of interest are those for the X-axis.
  • the ray is further parallel to the z-axis, and is thus completely contained in the encoding mns of slice 2701 throughout its traverse of the volume.
  • the techniques described here can also be used in the case where the ray intersects more than one slice.
  • Ray 2709 intersects a set of rans of ray voxels; one of the rans of ray voxels is shown at 2711; this ran also intersects an encoding ran 2703(1) whose voxels contain information that will affect ray 2709.
  • the problem of finding an intersection between ray 2709 and a significant mn 2705 of an encoding mn 2703 can be solved by detecting any intersection between the ran from the ray and a significant mn in the list of rans associated with the encoding ran. Given that the list of significant rans from the encoding ran is ordered, the search can be performed efficiently and a number of strategies are possible. The simplest is described in algorithm 2801 of FIG. 28.
  • Further acceleration of ray traversal may be achieved by hierarchically grouping encoding mns that lie in the same or adjacent beams of the volume data.
  • a beam is the maximum set of voxels in a slice with the same abscissa or ordinate. Therefore, voxels are arranged into beams, beams are arranged into slices, and slices are arranged into the volume. If the encoding mn has already been divided into significant mns, aggregate information may be maintained about each significant mn. For example, for a maximum intensity projection (MIP) rendering of a volumetric data set, storing the maximum value found within each significant mn would be useful.
  • MIP maximum intensity projection
  • the maximum value of the mn can be compared against the current maximum for the ray. If the ray is already at or above the maximum intensity, there is no need to consider the voxels in the significant mn in detail. In many cases, including such statistical information about the mn dramatically reduces the number of times the original data set has to be accessed.
  • the use of aggregate information as just described establishes a hierarchy of information concerning the encoding mn and permits each partition of an encoding mn to be checked in its entirety for relevance to the ray before the intersecting voxels of the ray and the significant mn are checked in detail.
  • isosurface rendering in which the surface that corresponds to a given value is reconstmcted from the volumetric data.
  • each ray is traced through the volume and where it would cross the isosurface is calculated. Therefore if the viewer is external to the volume and the exterior of the volume is assumed to be empty space, the voxel in which one of its neighboring values is greater than the isosurface value is sought. Within this voxel, the ray may cross the isosurface, and if so, the point of the intersection must be calculated.
  • the minimum and maximum values found within each significant mn can be kept. These values can be used to determine if an isosurface intersection can exist in any composite voxel. If not, the entire significant can be skipped.
  • a three-dimensional mn length encoding of a volume provides an 0(kn ) compression of the volumetric data where k is proportional to the mean number of significant rans in the encoding mn lists and n is the size of the volume.
  • mns are termed in the following significant runs.
  • the maximum number of significant mns in list cannot exceed n/2 by definition.
  • To traverse the mn length encoding of the volume using the mn-based ray traversal scheme each run in the path of the ray is intersected with the significant runs in the encoded mn list.
  • the searching strategy is an 0(k) operation.
  • the procedure in its entirety is therefore 0(n/ ⁇ + k).
  • the behavior of the algorithm is 0(n) when the absolute value of the slope of the two two-dimensional projections of the ray is 1.
  • the behavior will be 0(n/f) as k will typically be much less than n/2.
  • FIGs. 30 and 31 Organizing an encoding run into sets of partitions of various sizes: FIGs. 30 and 31
  • the three-dimensional ray traversal algorithm described is very efficient and for most of the rendering functions employed, such as isosurfacing and maximum intensity projection, the cost to process each voxel traversed by the ray is not high.
  • the aim of using spatial subdivisions to accelerate the traversal process is to reduce the amount of the volume that has to be processed and to concentrate the processing performed to that part of the volume that affects the final image.
  • traversing the ray through the spatial subdivision introduces too much overhead, its contribution is limited.
  • FIG. 30 Shown at 3001 is again a slice of a volume of voxels in which the voxels are associated with data from the Visible Human Project male data set. The data describes the head and neck of a human male.
  • Slice 3001 is a set of voxels that have the full range of x and v coordinates permitted by the volume and a single z coordinate.
  • Ray 2709 intersects slice 3001. The voxels of ray 2709 occur in mns of two lengths: a short mn of 3 voxels is shown at 2711 and a long mn of four voxels is shown at 2612.
  • the encoding mns 3003 have been divided into mn length partitions.
  • the partitions 3005 at the lowest level of the hierarchy each have 4 voxels; each higher-level partition in the hierarchy would contain a greater number of voxels than the previous level.
  • the increase in size is based on the powers of two.
  • a partition at a given level k of the hierarchy contains 2 k of the lowest-level partitions.
  • partition 3005 contains four voxels
  • partition 3007 contains two partitions 3005 and therefore 8 voxels, and so forth for 1 ⁇ k ⁇ 4 .
  • the partitions of the hierarchy can be related to each other in other ways, use of the powers of 2 makes it easy to calculate the partition sizes.
  • Ray 2709 has mns of 3 and 4 voxels; consequently, the best size of partition to use for ray 2709's traversal of slice 3001 is partition 3005.
  • the algorithm is as shown at 3101 in FIG. 31. There are two cases: if the portion of the ray mn being processed extends beyond the partition and if it does not. In the first case, the partition's aggregate data is consulted to determine whether the partition is relevant to the ray; if it is, the voxels of interest in the partition are traversed. Thereupon, the length of the ray ran is decreased by the number of intersecting voxels, and the partition indicator is set to the next partition.
  • the partition's aggregate data is again consulted to determine whether the partition is relevant; if it is, the voxels of interest in the partition are traversed. Thereupon, the amount of the partition to be processed is reduced by the length of the ray mn.
  • the problem is therefore how best to traverse the ray through the mn length partitioning and what is the best partition size to use. If the average length of a ray run is a lot smaller than the size of the partition, there will be little gain, as the aggregate statistics associated with the partition represent the entire partition and the number of ray runs that will be rejected is reduced. Further, if the partition size is much larger than the ray ran, the cost and complexity of checking for significant rans in the partition is greater. Therefore, the cost of traversing the partitioning must be balanced with the savings from finding voxels that need not be considered. If dealing with voxels that are relevant to the ray is expensive, it is better to use a small partition size. If that is not the case, a larger partition size can permit a faster traversal algorithm.
  • a good compromise is to choose a ran-length-partition size that is at least as large as the short ran length in the path of the ray, as was done when a partition size of 4 was chosen in FIG. 30.
  • the ray at each step will traverse at most two partitions. Therefore, the loop to traverse the run through the partitions can be unrolled into a two-stage process, as is done in algorithm 3101. Efficiency of ray traversal with a partitioned hierarchy of runs
  • a three-dimensional ran length partitioning of a volume provides an 0(n 3 /p) compression of the volumetric data where p is the partition size and « 3 is the size of the volume.
  • p is the partition size
  • « 3 is the size of the volume.
  • the order of the ray traversal algorithm is 0(n/ ⁇ ), where ⁇ is the average run length in the path of the ray. Therefore the ray traversal process through the partitioning is 0(n/min(p, ⁇ )). By choosing ⁇ to be less than or equal to the partition size, the complexity of 0(n/ ⁇ ) is maintained for the entire traversal process.
  • any technique of determining the intersected voxels from the intersected cells could be used in addition to those disclosed herein.
  • any method of encoding that distinguishes significant mns from the remainder of the encoding mn may be used, and aggregate values may be maintained for any useful partition of the encoding runs.
  • any useful representation of the mns of cells, the mns of voxels, and the encoding mns may be employed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Image Generation (AREA)

Abstract

Line drawing techniques (Figure 19) that employ runs (1929) or runs of runs of pixels (1929, 1931) to draw the line (1929, 1931) compute line structure information that they use to determine the sequence of runs in the line. This line structure information may be used to compute the positions of a plurality of the runs and then draw the runs in parallel. The line drawing techniques may be also be used with rays in three-dimensions (1803, 1805, 1807). Projections of the ray are made on planes (1833, 1835) that intersect each other on the ray's major axis (1803). The line drawing techniques are used to determine cells in the planes (1929, 1931, 1923, 1925) that are intersected by the projections. The voxels (1913) intersected by the ray are then determined using the cells (1929, 1925). Runs of voxels (1911) in the ray are used in ray traversals. The volume traversed by the ray is subdivided into encoding runs of voxels (1911, 1913, 1915) that may include one or more significant runs containing voxels whose data will affect the ray. Traversal is done by determining for each run of voxels (1911, 1913, 1915) in the ray whether any of the voxels in the ray run are also in a significant run.

Description

Using runs of cells to traverse a ray through a volume
Cross references to related applications
The present patent application claims priority from the following applications: • U.S. provisional patent application 60/346,741, Peter Stephenson, Method for visualizing volumetric datasets, filed 7 January, 2002;
• PCT/US02/24711, Stephenson, et al., Methods and apparatus for determining intersections of a particular line with cells in a lattice filed 2 August 2002; and
• PCT/US02/39716, Peter Stephenson, et al., Using line structure information to enhance line drawing in digital systems, filed 12 December 2002
PCT/US02/2471 1 claims priority from U.S. provisional patent application 60/309,926, Stephenson, et al., Process and apparatus for line drawing, filed 3 August 2001. PCT/US02/39716 claims priority from U.S. provisional patent application 60/341,503, Stephenson, et al., Process and apparatus for anti-aliased line drawing, filed 13 December 2001, and US provisional patent application 60/341,194, Stephenson, et al., Process and apparatus for line drawing in parallel, also filed 13 December 2001.
In the US national stage, this application will be a continuation-in-part of both PCT/US02/24711 and PCT/US02/39716. This application contains the entire Detailed Description of PCT/US02/24711 and the portion of PCTUS02/39716 titled Parallel techniques for determining the cells of a raster that are intercepted by a line. The material in the Detailed Description, which is new to this application, begins with the section Problems of ray traversal in three dimensions.
Background of the invention
1. Field of the invention
The invention relates generally to techniques for determining which cells of a raster a particular line intersects. The cells of the raster are represented in the memory of a computer system and the computer system's processor makes the determination. The cells of the raster may generally represent a set of locations. The locations may be pixels in a display, and when they are, the techniques may be used to determine which pixels in the display represent the particular line, and thus to generate the line in the display. 2. Description of related art: FIGs. 9 -11
Systems using raster display devices: FIG. 9
The flat panel or cathode ray tube display devices typically used with computer systems are raster devices, that is, the display area is made up of a large number of picture elements, or pixels, which are arranged in a grid. The location of any pixel in the display can be specified by its row and column in the grid. Varying the color and intensity of the pixels in the grid makes the image that the display device displays.
FIG. 9 is a high-level overview of a computer system with a raster display device. The main components of system 901 are a processor 911 with memory 903 to which processor 903 has access and a monitor 915 for which processor 911 generates displays. Monitor 915 is a raster display device and as such, has a grid of pixels 917. Within memory 903 are stored bitmap 909, bitmap drawing code 985, and bitmap data 907. Bitmap 909 is an area of memory that corresponds to grid of pixels 917. Each item of data in bitmap 909 corresponds to a pixel in grid of pixels 917. Drawing code 985 is code for drawing graphical entities such as lines or polygons in bitmap 909. Bitmap data 907, finally, is data, typically supplied by a user program, which bitmap drawing code 985 uses to draw a graphical entity. For example, if a user program wishes to specify a line, it will typically indicate the start and end coordinates of the line in grid of pixels 917 and drawing code 985 will use that information to draw a corresponding line in bitmap 909. Processor 911 then reads from bitmap 909 to generate an image for display on grid of pixels 917. In many cases, a display generator component 913 of processor 911 reads bitmap 909 and produces the actual signals for monitor 915 from the data in bitmap 909. It should be noted here that the task of producing a display 917 may be distributed in many different ways across hardware and software components, with the amount of hardware increasing as performance demands increase.
Representing lines using pixels: FIG. 10
Drawing straight lines is a problem with any raster display device. FIG. 10 shows why.
FIG. 10 shows a representation in pixels 1001 of the line 1003 that is described by the
17 . . equation y = — x . The representation includes those pixels in the gπd that are intersected by line 1003. These pixels form a pattern 1004 that is termed the intersection pattern for the line. A line's intersection pattern depends not only on the line's slope, but also on the location of its endpoints relative to the grid of pixels. As will be explained in more detail in the following, the intersection pattern for any straight line has regular features that can be used in drawing the straight line in a raster display or analyzing a straight line that is displayed in a raster display.
At its lowest level, the intersection pattern for line 1003 is a sequence of pixels. For a given next pixel, there are only two possibilities: if the current pixel has the coordinates (a,b), the next pixel has either the coordinates (a+l,b) or (a+l,b+l). Which of the two possibilities the next pixel has depends on where the line intersects the current pixel. To draw a line one pixel at a time, one need only determine for each pixel where the line intersects the current pixel and use that information to determine which of the two possible positions to give the next pixel.
As is apparent from FIG. 10, the intersection pattern includes groups of adjacent pixels that have the same y coordinate. Such a group of pixels is called a run. One such run of three pixels is shown at 1005. An examination of the runs in FIG. 10 shows that they have only two lengths: a short length 107, which is here two pixels, and a long length 1009, which is here three pixels. The general rule is that the runs of an intersection pattern will have only two lengths, and these lengths will be consecutive integers. The lengths of the long and short runs for any given line can be computed as follows:
Within the intersection pattern of the line I : y = —x , there are a runs that correspond to the d 7-axis size of the lattice. As there are only two possible run lengths in a given intersection pattern and the possible lengths are consecutive integers we will refer to the lengths as short
(s) and long (I). To determine what run lengths are possible within the intersection pattern, consider that there are d pixels to be distributed among a runs, the distribution being as
even as possible. If we divide up the d pixels into a runs of length r = we have n ≡ d mod a pixels remaining, 0 < n < a , which have to be distributed along the intersection pattern. Therefore in the intersection pattern of/ there are n long runs each with r+ 1 pixels and a-n short runs with r pixels each. This can be applied to line 1003 as follows: line 1003 contains 41 pixels and 17 runs. The
41 possible run lengths are r = = 2 and r+\ = 3. There are 41 mod 17 ≡ 7 long runs
.17.
1009 of length three shown in light gray and 17-7=10 short runs 1007 of length two shown in dark gray. Therefore using a run-based algorithm improves upon pixel-based algorithms as only a and not d decisions whether to increase the y coordinate by 1 are necessary.
An examination of intersection pattern 1004 of line 1003 shows that the long and short runs themselves occur in repeating patterns. Thus, in intersection pattern 1004, there is a repeating pattern of a long run (I followed by two short runs (s) followed by a long run followed by one short run, or Issls, as shown at 1011 and 1013. In general, there are four possibilities for the patterns of runs:
• ls+, a long run followed by one or more short runs;
• s, one or more long runs followed by a short run; • sl+, a short run followed by one or more long runs; and
• s+l, one or more short runs followed by a long run.
These patterns are termed in the following the shapes of runs. Thus, using this notation, the shape of the runs shown at 1011 and 1013 is ls+. Moreover, it turns out that the first run in
the intersection pattern of the line / : y - ~x must be long. Therefore we need only two d shapes: ls+ and l+s to describe the intersection patterns of a line. ls+ applies when there are more short runs than long runs in the intersection pattern and l+s when there are more long runs than short. In the case where there are equal numbers of runs, the two cases are equivalent.
The properties just described also apply to runs of runs. For example in intersection pattern 1004, the complete sequence of runs is Islslsslslsslslss; therefore we have singularly occurring runs / separating sequences of shorts runs s+ and the intersection pattern is constructed of runs of runs with the shape ls+. The terminology of runs of runs is cumbersome so let us define these runs of runs to be second order runs. Where a run is defined by its position and length, a second order run is defined by its position, its length is defined by the number of runs which comprise it, and its shape is determined by whether there are more long or short runs in the pattern. By analogy with second order runs, we can define runs to be first order runs and pixels to be zero order runs.
To determine the possible lengths of the second order runs let us consider the case where there are more short runs than long and continue the use of our example. In this case, the number of second order runs must be the same as the number of long runs in the pattern by definition. If there are n long runs in the line there are a runs to divide amongst n second order runs. Therefore, if the division is to be as even as possible the length of a short second
order run, r[2] , will be r*2* = There will be «'2' ≡ a mod n long runs and -«[2] short runs of order 2. The second order runs appear at 1011 and 1013 in intersection pattern 1004. There are more short runs 1013 than long, so the second order runs have the shape ls+, i.e., one long run followed by a sequence of short runs. There are three long runs 1011 of length three and four short runs 1013 of length two.
There is no reason to end this hierarchical description at order 2. We can define a recursive hierarchical description of the intersection pattern of the line / based on defining runs of higher order. For orders three and above, there is no restriction that the first run in the intersection pattern must be long and therefore all four possible shapes can occur. For order /, if there are more short runs of order i-\ in the intersection pattern, the shape of the order i runs will be s+l or ls+. If there are more long runs of order t-1, the shape will be l+s or ls+. An example of third order runs in the intersection pattern 1004 is shown at 1015 and 1017. There are three runs of order 3 amongst which the seven runs of order 2 are to be distributed as evenly as possible. Therefore the length of a short run of order 3 is
2 , and amongst the three order 3 runs, there will be 7 mod 3 = 1 long run of
IA length 3' + 1 = 3 . The shape of the order 3 runs is s+l. For lines with a rational slope, the hierarchical description of ordered runs within the intersection pattern will be bounded, as the intersection pattern is eventually repeated if a and d are not coprime.
17 For the example line 1003 / : y = — x , the process reaches its conclusion at order 4. There
are three order 3 runs, of which one is long and two are short. There will be therefore one order 4 run containing all three order 3 runs and starting with the only long order 3 run. 17 The order 4 run is the entire intersection pattern of the line I : y = — x and the lattice
( 1,17)
Dealing with lines that do not intersect the origin: FIG. 11
Introducing a non-zero intercept to a line with rational slope presents a number of
complications. Consider the line / : y = — x + β where a and d are coprime. Within the d frame of the lattice the line y forms an intersection pattern that is repeated throughout the infinite intersection pattern defined upon the unbounded lattice. Therefore we will only consider the intersection pattern , within the frame ^/j(d,a)
Let us consider first the line/ : y = — x + β where β = 0. Within the frame ^ (d,a), the d
vertical distance the line / is above any lattice point within the intersection pattern is -J— d where b[°] = 0,...,d - l where the values b 0] are those values of the order 0 numerator
sequence. The numerator sequence is a sequence of the numerators of the fractions .
These fractions specify the point in the left edge of the pixel at which the line intersects the
pixel. Therefore, the line is at least — from any lattice point. If the value of β is raised d slowly, the intersection pattern will remain unchanged until the line crosses or intersects a
lattice point. Therefore, the first change will occur when β = — . Let the lattice point d intersected be (xh,yh)-
As the line : y = — x + β intersects the point (x/,,yiι) and the line / : y = —Λ: intersects the d d origin, the intersection pattern fjv of the line /' will be identical to the intersection pattern ), of the line / translated by (Xh,y )- Therefore the introduction of an intercept to a line with rational slope will, more often than not, cause a shifting of the intersection pattern of the line. The key values of the intercept at which this translation of the intersection pattern
occurs are β = — where b = 0,...,d-\. d
FIG. 11 gives an example. At 1001, the figure shows the intersection pattern of the line
17 . 23 l : y - — x . At 1101, the figure shows the effect of introducing an intercept value of —
on the interception pattern. The numerator sequence for order 0 of 1001 is shown at 1109 and that for order 0 of 1101 at 1111.
Given that the numerator of the intercept is b=23, we have demarcated the pixels before (1103) and after (1104) b = 23 in order 0 numerator sequence 1109 by a dashed line 1102.
The pixels 1104 to the right of this value are denoted by light gray and the pixels 1103 to
23 the left by dark gray. At 1101, we can see that adding the intercept value — shifts the
41 light gray pixels 1104 to the beginning of the intersection pattern, fir The dark gray pixels 1103 now form the end of the pattern f)r Coinciding with the shift in pixels, the values of numerator sequence of order 0 l l l l are also shifted and now start with a value of b[°] = b = 23. The shifting of the runs of all orders in the intersection pattern with the introduction of a non-zero intercept is mimicked by the shift in the values of the numerator sequence.
The shifting of the intersection pattern due to the introduction of a non-zero intercept has a number of side effects. The initial and final run of any order may be truncated. This occurs when the numerator of the intercept is not in the numerator sequence of that order. A run order is split and forms the initial and final partial run. If the numerator sequence is to be calculated for this order, the initial numerator value will have to be calculated. For example, at 1101, the numerator value of the intercept is 6=23. We know that all of the numerator values of order 1 are less than pw = a - 17. Therefore the initial value of the order 0 numerator sequence will not be the same as the initial value of the order 1 numerator sequence and the initial and final runs of order 1 will be truncated. Using hierarchies of runs to generate lines
There are many line drawing techniques that take advantage of the structure of a line's intersection pattern. At the pixel level, the standard line drawing algorithm of Bresenham may be employed. In this algorithm, the point at which the line intersects the current pixel determines whether the next pixel's y coordinate is incremented by 1. See J. E. Bresenham, "An incremental algorithm for digital plotting", ACM National Conference, August 1963. Bresenham's algorithm may be used only with lines whose start and end coordinates are rational numbers. Where the starting and end coordinates may be any real number, the well-known DDA algorithm must be used. See A. Van Dam, J. Foley, S. Feiner and J. Hughes, Computer Graphics: Principles and Practice, Second Edition in C, Addison- Wesley (1995). Like Bresenham's algorithm, DDA works at the pixel level. Initially, floating-point x and y increments are computed. The x increment is the difference between the ending and starting x coordinates divided by the line's length and the y increment is the difference between the ending and starting y coordinates divided by the line's length. Each time a pixel is set, the current x and v coordinates, which are floating point values, are converted to integers and the pixel is set at the cell defined by the increment. Then the x increment is added to the x coordinate and the y increment is added to the y coordinate. A difficulty with any pixel-by-pixel approach is that it requires a determination where the next pixel will be placed relative to the last pixel for each new pixel. With the DDA algorithm, this determination is a floating-point operation. As such, it is both expensive to perform and subject to rounding errors. Moreover, because the determination must be performed with every pixel, the rounding errors may accumulate quickly and cause the line to be drawn inaccurately.
The overhead of computing the location of the next pixel relative to the last is avoided in algorithms that use runs of pixels instead of individual pixels to draw the line. At the level of a run of order 1, Reggiori has developed an algorithm that determines the length of the next run in the line from the set of two possibilities. See G. B. Reggiori, "Digital computer transformations for irregular line drawings", Technical Report 403-22, New York University, April 1972. Stephenson generalizes these techniques to the full hierarchy of runs in the line including runs of runs, runs of runs of runs, etc. See P. Stephenson, The structure of the digitized line, Ph.D thesis, James Cook University of North Queensland, 1998, which is incorporated by reference herein. Like Bresenham's algorithm, the algorithms that use runs and run hierarchies are limited to lines whose start and end points have rational number coordinates.
All of these algorithms possess a similar conditional structure regardless of whether they are based on pixels such as Bresenham's pixel-based algorithm or the DDA algorithm, runs such as Reggiori's algorithm, or a mixture of runs and runs of runs such as the run-length- slice algorithms. The slopes that are considered are bounded to lie in the range 0 < a < 1. For pixel-based algorithms, that limits the choice of the next pixel to a possible set of two. For run-based algorithms, the choice is made between the two possible run lengths that can exist in the line. In all of these algorithms, the choice is made by checking the value of a decision parameter against the value of zero. For values less than zero, one element of the possible set of choices is used; for values greater than zero, the other choice. For a value of zero, each technique handles this case differently. For line drawing applications, either choice is equally applicable and for ray tracing, this typically signifies a corner intersection.
Run-based line drawing may also be used to solve problems that arise in efficiently representing rays that traverse three-dimensional space and in speeding traversal of the three-dimensional space by such a ray. It is an object of the present invention to provide solutions to such problems.
Summary of the invention
In one aspect, the invention is a technique employed in a computer system for determining voxels in an object space that are intersected by a ray. Broadly stated, the technique involves making projections of the ray on a plurality of planes in the object space, determining cells in the planes that are intercected by the projections, and using the intersected cells to determine the intersected voxels. Determining which cells are intercepted by the projections may be done using runs of cells, as explained in the parents of the present application, and runs of order 1 or greater may be employed. The plurality of planes may be a pair of intersecting planes which are perpendicular to each other and for which the line of intersection is the ray's major axis. Further details of this aspect include techniques for determining intersected voxels that are 26-connected and intersected voxels that are only six-connected. In the 26-connected case, the technique proceeds as follows at the beginning of the next run of voxels:
• if the first order runs of cells that include the points in the projection corresponding to the beginning of the next run of voxels end at the same coordinate of the ray's major axis, the first order runs of cells together determine the next run of voxels through the end of the first order runs; but
• if the first order runs do not end at the same major axis coordinate, the shorter first order run of cells and the corresponding portion of the longer of the first order runs of cells determine the next run of voxels.
In the 6-connected case, the above basic technique is used, but an extra cell is added to the beginning of a first order run of cells prior to using the first order run of cells to determine a run of voxels.
Further, this aspect includes techniques for determining from the runs of cells whether the voxels intersected by the ray have edge or corner connections. The voxels will have an edge connection if one of the first order runs of cells has a corner connection at a point and the other does not; if both of the first order runs of cells have a corner connection at the point, the intersected voxels have a corner connection.
In another aspect, the invention is a technique employed in a computer system of efficiently traversing a volume with a ray. The volume is subdivided into runs of voxels. Certain of the voxels in the runs are associated with data that affects rays. Each ray that traverses the volume intersects one or more of the first runs and it itself made up of a set of second runs of voxels. The technique determines for a second run of voxels belonging to a particular ray whether the second run includes a voxel of a first run that affects rays. When the second run includes such a voxel, the data associated with the voxel is examined. It is advantageous for the technique if the volume has an axis which is the major axis for both the particular ray and the first runs of voxels and if there are three sets of first runs, each set having a different axis of the volume as its major axis. Continuing in more detail with this aspect, the first runs contain significant runs that include voxels that affect rays. Determining whether the second run includes a voxel from a first run that affects rays includes determining whether the second run includes a voxel of a significant run.
In other details, aggregate information is associated with partitions of the first runs. The aggregate information indicates how one or more of the voxels in the partition affect rays. Determining whether the second run includes a voxel from a first run that affects ways includes using the aggregate information associated with a partition determine whether the partition contains a voxel that affects the particular ray. The partitions may be the significant runs. They may also be a number of sets of partitions, with the partitions in each set having a different length. The partitions to use for a particular ray are selected in accordance with the lengths of the runs in the ray.
Other objects and advantages will be apparent to those skilled in the arts to which the invention pertains upon perusal of the following Detailed Description and drawing, wherein:
Brief description of the drawing
FIG. 1 is an overview of the manner in which lines are drawn using the techniques of the invention; FIG. 2 is an overview of a system which draws lines using the techniques of the invention;
FIG. 3 is a flowchart of how the bitmap processor processes complete runs of pixels;
FIG. 4 is a flowchart of how the bitmap processor processes truncated runs of pixels;
FIG. 5 is a flowchart of how the bitmap processor processes a run of order 1; FIG. 6 is a flowchart of how the first truncated run of an order / is processed and set;
FIG. 7 shows how the first pixel of a line is handled using the techniques of the invention;
FIG. 8 shows a flowchart of how a complete run of order is processed;
FIG. 9 shows a system in which the invention may be employed;
FIG. 10 shows the structure of a representation of a line as a set of pixels; FIG. 11 shows the effect of a displacement of the starting point from the origin on the structure of the representation;
FIG. 12 shows an example line;
FIG. 13 shows how the first pixel of the example line is handled; FIG. 14 shows truncated runs of orders 1-3 in the example line;
FIG. 15 shows the geometry of the error term and structural parameters in a run of order 1; FIG. 16 is a flowchart of a technique for drawing lines in parallel; FIG. 17 is a diagram showing the geometry of ray traversal; FIG. 18 is a diagram showing the geometry of the projection of a ray on planes that are perpendicular to each other and intersect at the ray's major axis; FIG. 19 is a first diagram showing how voxels intersected by a ray may be computed from the cells intersected by the ray's projections; FIG. 20 shows an algorithm for computing the voxels intersected by a ray; FIG. 21 is a second diagram showing how voxels intersected by a ray may be computed; FIG. 22 is a third such diagram showing how edge connections appear in the projections; FIG. 23 is an algorithm for detecting edge connections in the voxels; FIG. 24 is a fourth diagram showing how corner connections appear in the projections; FIG. 25 is an algorithm for detecting corner connections in the voxels; FIG. 26 is a diagram showing an encoding run in a volume;
FIG. 27 shows a ray traversing a volume which has been divided into encoding runs; FIG. 29 shows an algorithm for detecting an intersection between a ray and an encoding run; FIG. 30 shows a ray traversing a volume in which the encoding runs have been divided into a hierarchy of runs; and
FIG. 31 shows an algorithm for using a hierarchy of runs to find voxels that will affect the ray.
Detailed Description As indicated in the section Cross references to related applications, this application contains the entire Detailed Description of PCT/US02/24711 and the portion of PCT/US02/###### titled Parallel techniques for determining the cells of a raster that are intercepted by a line. The material in the Detailed Description, which is new to this application, begins with the section Problems of ray traversal in three dimensions.
Overview of line drawing with the invention: FIG. 1
FIG. 1 is a flowchart [101] that provides an overview of how a line-segment may be drawn using this invention. Starting parameters include the maximum order of the runs to be used in drawing the lines [122] and the start and endpoints of the line [112,114]. The maximum order can be predefined by the manufacturer of an apparatus based on the invention, calculated based on the characteristics of the system or based on the length of the line. In the preferred embodiment, the maximum order of the runs [120] is set to two.
The line segment defined between the starting point [112] (x0,y0) and the end point [114]
( ,, y,) consists of, at most, three sets of runs of any order, i: The first truncated run of order i, the set of full-length runs of order i, and the final truncated run of order i. To draw the line segment from (x0,y0) to (xχ i yλ) , we will describe how to calculate and set in the Bitmap Memory [108]:
• The first truncated run of order i [202].
• The full length runs of order / [206].
• The final truncated run of order i while setting the full length runs of order i [206]. An alternative embodiment would calculate the first truncated run, each full length run and the final truncated run separately. Another alternative embodiment would have a desired maximum order [120] of infinity, and therefore the processing of the first truncated run length would draw the entire line segment unless the maximum depth of the hierarchy of runs was reached.
Overview of the components of a system for drawing lines according to the invention: FIG. 2
FIG. 2 shows the components of a system 201 for drawing lines according to the invention. The main components of system 201 are a Truncated Run Processor [102], which calculates the structure of the first truncated run of order / [202] and the structure of the hierarchy of runs [140] in the line segment, and the Run Processor [104], which calculates the length of the full length runs and the final truncated run [206]. To set the runs [202][208] into the Bitmap Memory [108], the description of each run is given to the Bitmap Processor [106]. The Bitmap Processor is responsible for breaking the run into its composite pixels and setting each pixel into the Bitmap Memory [108].
Truncated Run Processor [102]
The Truncated Run Processor [102] is responsible for calculating the structure of the first truncated run of the desired order [120] and supplying this structure to the Bitmap Processor [106] so that the truncated run [194] can be set into the Bitmap Memory [108]. Bitmap memory [108] may be a bit map such as bitmap 909 in FIG. 9.
While the Truncated Run Processor calculates the structure of the first truncated run, it also calculates the structure of the hierarchy of runs [140] and stores this information [142] for the use by the Run and Memory Processors [104,106]. During this process if the desired maximum order of the process [120] is found to be greater than the maximum order of the hierarchy of runs in the line, the maximum order [120] is set to be the maximum depth of the hierarchy [124].
Based on the start and end points of the line [110], the Truncated Run Processor also calculates and stores [132] the starting pixel position for the line [130].
Each component of the first truncated run is calculated based on the error term [150], As each component is processed, the error term is retrieved [152], updated and stored again [154]. Once the first truncated run has been processed, the error term remaining [150] is used by the Run Processor [104] to define the full-length runs in a similar manner.
Run Processor [104] The Run Processor [104] is responsible for calculating the length of each full-length run of the desired maximum order in the digital line. These lengths are passed to the Bitmap Processor [106] such that the runs can be set into the Bitmap Memory [108]. The length of the full-lengths is decided based on the error term [150], which is retrieved [156], updated and stored [158] to process the next full-length run. Thus, the error term is recalculated only at the beginning of each full-length run of the maximum order instead of for each pixel.
Bitmap Processor [106]
The Bitmap Processor [106] is responsible for actually setting the runs into the Bitmap Memory [108].
We assume there is a method to set a pixel of the memory to a desired value, similar to the setPixelfx, y, value ) method described in the prior art. If a method to set a run of higher order, the Bitmap Processor [106] can take advantage of this function. The Bitmap Processor [106] also keeps a track of the current position of the line being drawn in relation to the end point of the line [110]. If the line moves reaches the end point [114], the Bitmap Processor [106] signals the Truncated Run Processor [102] or the Run Processor [104] to terminate [162] using an internally stored termination condition [160].
Bitmap Memory [108]
The Bitmap Memory [108] is the memory representing the raster display of a graphics system, video memory, image memory or any other type of bitmap.
Details of operation of the components of system 201 : FIGs. 3-8
For the remainder of this description we will describe:
1. How a truncated or full-length run of order i [202] [208] is set into the Bitmap Memory [108] via the Bitmap Processor [106].
2. How the first truncated run of order i in the line segment is processed [202] by the Truncated Run Processor [ 102] .
3. How the full-length runs of order in the line segment [208] are processed by the Run Processor [104].
How a run of order i is set into the Bitmap Memory via the Bitmap Processor: FIG. 3
The Bitmap Processor [106] handles the process of setting the pixels of the Bitmap Memory [108]. To draw the line, the Bitmap Processor is given a set of commands [194][196] to draw a collection of runs of various orders into the Bitmap Memory. The information given in the command to draw a run is the length of the run, rf , and the order of the run, / [194][196]. The position of the run in the bitmap [130], ( j ],yj [ ]), is initialized [132] by the Truncated Run Processor [102] and is retrieved by the Bitmap Processor [136]. As the run is drawn, the coordinate is updated to the position of the next run of order i, and is stored for the next iteration [134].
The process of setting a run in the Bitmap Memory, involves reducing the run to a set of pixels and setting each individual pixel in the Bitmap Memory. Reducing the run of order i into runs of order 0 (pixels) is performed by recursively reducing the run of order k to runs of order k-1 for each order from k-i to k=2 resulting in a description of the run of order i in terms of runs of order 1. Each pixel in the run of order 1 is then set into memory.
We therefore describe: • How a full-length run of order i is reduced into runs of order i-1.
• How the first truncated run of order i is reduced into runs of order i-1.
• How the pixels of a run of order 1 are set into the Bitmap Memory.
In an alternative embodiment, if the Bitmap Memory [108] permits the setting of runs of pixels or runs of runs, etc., the process of reducing the run of order / to runs of order i-1 can be stopped at the permitted level. Therefore, instead of setting pixels into the Bitmap Memory, runs or runs of runs can also be used.
Reducing a full-length run of order k into runs of order k-1: FIG. 3
As described in the Description of related art, each run of any nonzero order i within the digital line has, at most, only two possible run lengths that are consecutive integers where the length is measured as the number of composite runs of the next lowest order, i-1. As a consequence of this, we can denote the occurrence of a short run by the symbol s and a long run by the symbol /. For example the runs of order 1 in the line segment (0, 0) to (41, 17) can be described by (Islslsslslsslslss) [l].
A run of order can then be defined recursively by:
• A run of order 1 is the maximal set of contiguous pixels with a similar abscissa. • A run of order i is the maximal set of contiguous runs of order i-1 such that each run has a shape ( s) [l'1] t (ls+) [ '], (s+l) ['-", or (s ) ["!1, where (/+) [-'] and ( ) li'l] denote the occurrence of one or more long and short runs of order /-/ respectively. We note that a run of order 2 can only possess the shape (ts) [l] or (ls*)[Ij '.
Each run of any given order in the line segment has the same shape. To determine for a given order which of the four shapes is to be used, we define the runs of each order to have a type, t[l] , which has a value 0 or 1. For a run of order i:
• If t('"1] = 0 and t = 0 the shape of the run of order i is s [,] = 0 : / • If t['-11 = 0 and t[,] = 1 the shape of the run of order i is s ,] - l : ls+ .
• If t['-'] = 1 and f"1 = 0 the shape of the run of order is rf = 2 : sl+ .
• If t['"1] = 1 and t[,] = 1 the shape of the run of order i is sl'] = 3 : s+l .
The type of order 1, t i] , is defined to be zero. The types of orders greater than 1 are calculated using structural parameters; the structural parameters and their calculation will be described in detail below.
To reduce a run of order i to the composite runs of order i-1, the procedure 301 shown in FIG. 3 is followed.
Inputs to the process are the length of the run of order i to be set [194] and the structure of the hierarchy of runs. The process will cease if the end point of the line has been reached [304].
If the order of the run is 1 [306], the pixels of the run are set directly [340] into the Bitmap Memory.
If the order of the run is at least 2, the run is reduced into its composite runs of the next lesser order and each run is set into the Bitmap Memory:
• If t ] = 0 andt1'1 = 0 the shape of the run is _j['] = 0 : l+s , therefore we set in order rf -l long runs of order i-l (length rfn = rfl] + 1 ) and one short run of order i-1 (length r i'-1] ).
This process follows the path from [308], [310], [312], [314].
• if '-'J = 0 andt[,] = 1 the shape of the run is s[, = l '- ls+ , we set one long run of order i-1 (length r "l] = rfl] + 1 ) and rf -l short runs of order i-1 (length rfl] ).
This process follows the path from [308], [310], [316], [318]. • If tl'~l] = andt1'1 = 0 the shape of the run is s[i] = 2 : sl+ , we set one short run of order i-1 (length rfn ) and rf -\ long runs of order i-1 (length r '~l] = rfl] + 1 )•
This process follows the path from [308], [320], [322], [324].
• If t1'"'1 = 1 andt1'1 = 1 the shape of the run is s[,] - 3 : s+l , we set rf -1 short runs of order i-1 (length rf]] ) an<^ °neng n of order i-1 (length r '~X] - rf1] + 1 ).
This process follows the path from [308], [320], [326], [328].
The type and length of the short and long runs of any order are stored in the structure of the hierarchy of runs [146].
Reducing the first truncated run of order k into runs of order k-T. FIG. 4
The process of reducing the first truncated run of order k into full-length runs of order k-1 follows directly from the instructions to reduce full-length runs. The only variation comes from the fact that a truncated run is defined to be a run not of its full-length. Therefore at least one run of order k-1 has been truncated from the run of order k. Because this is the first run in the line, the truncated run occurs at the beginning of the run. In a preferred embodiment, the truncated runs received by the Bitmap Processor have a length of at least one. Therefore the only situations that need to be handled differently are when shapes s[,] = \ : ls+ and s [,] = 2 : sl+ occur.
The process is shown at 401 in FIG. 4. As with the process for a full-length run, the inputs are the length of the run of order i that is to be set [194] and the structure of the hierarchy of runs [146]. The process 401 will cease if the end point of the line has been reached [404].
If the order of the run is 1 [406], the pixels of the run are set directly [440] into the Bitmap Memory If the order of the run is at least 2, the run is reduced into its composite runs of the next lesser order and each run is set into the Bitmap Memory:
• If t['~l] = 0 [408] andt[,] = 0 [410], the shape of the run is s [,] = : l+s . As the run is truncated, at least one run of order i-1 is removed from the beginning of the run. As the length of the truncated run is rf , this leaves rf - 1 long runs of order i-1 and the final short run of order i-l. For example if the first run at full length is the sequence of runs (lllls)['~l] and the initial truncated run length is rf = 3 , the truncated run comprises two long runs and the final short run of order i-1 : (lls '~I]. Therefore to set the initial truncated run length, we set in order rf -l long runs of order i-1 (length rfl] = rfU + 1 ) [412] and one short run of order i-1 (length rf]] ) [414].
• Similarly, if t 1 = 0 [408] andt1'1 = 1 [410], the shape of the run is s ll] = 1 : ls+ . The truncated run has less runs than a short run of order /, therefore given the shape of the run ls+, there can only be short runs of order i-1 comprises the truncated run. Therefore we set rf short runs of order i-1 (length rfl] ) [418].
• If '-|] = 1 [408] andt1'1 = 0 [420] the shape of the run is s [,] = 2 : sl+ , we set rf long runs of order i-1 (length r "n = rf ] + 1 ) [424].
• If '->] = l [408] and t[,1 = l [420] the shape of the run is s l'] = 3 : s+l , we set rf - 1 short runs of order i-l (length rfi] ) [426] and one long run of order i-1 (length rf* = rf + \ ) [428].
The type and length of the short and long runs of any order are stored in the structure of the hierarchy of runs [146].
Setting the pixels of a run of order 1 into the Bitmap Memory: FIG. 5 FIG. 5 is a flowchart 501 showing how to set the pixels of a run of order 1 [340]. The method requires as inputs the starting pixel [136], (xj l ], y1'1), the end point of the line [114], and the length of the run [194], rf , are required. The starting pixel is stored and updated internally [136]. The length of the run [194] is passed to the Bitmap Processor.
Each pixel in the run has a similar y-coordinate, which is the y-coordinate of the starting pixel [136], yj1] .
If the y-coordinate for the run being set is the same as the floor of the y-coordinate of the end point of the line, y}l ] = [y, J, the run being set is the last run in the line [402]. In this case:
• The termination condition [160] signaling that the end point of the line has been reached is set [406].
• The length of the run to be set [194] is changed to the difference between the x- coordinate of the start of the run being set and the ceiling of the x-coordinate of the endpoint ofthe line, rf ^x^- x [404].
• The run of pixels of length rf = μt, |- x1'1 is set in the Bitmap Memory at location
To set each of the pixels in the run into the Bitmap Memory, for each of the pixels in the run [410] [420] [426] starting at the pixel (x[0] , y[0]) = (x, y, ]) [412]:
• Set the pixel (xl°] , y 0] ) into the Bitmap Memory [422] .
• Move to the position of the next pixel, (x , y ], ) = (J 10] + 1, y ) [424] .
Once every pixel in the run has been set into the Bitmap Memory, the starting coordinate of the next run of order 1 in the line is calculated from the current coordinate value by incrementing the current y-coordinate of the next pixel position [430], How the first truncated run of order i in the line segment is processed by the Truncated Run Processor: FIGS. 6 and 12
To calculate the length of the initial truncated run length of the maximum order i [120] we calculate and set in the Bitmap Memory each initial truncated run length of order 1 to i in turn. This is shown in flowchart 601 of FIG. 6. If no truncated run length exists for any order, none is set. The process stops if:
• The endpoint of the line [110] is reached [514].
• The maximum depth of the hierarchy is reached [520]. • The desired maximum order is reached [530].
A truncated run length of order k is of course made up of run lengths of orders 0 through k- 1. In the above technique, the orders 1 through k are processed beginning with order / = 1 and moving order by order to i = k. With each of the orders, the bits for that order are set before the next higher order is processed. For a given order i, the bits set for order i -1 will always make up the complete truncated or untruncated first run of the order i .
Initialize the slope of the line [502] .
The endpoints of the line segment are the real number coordinates (x ,y0) and (x{,y{)
[112], such that x0 ≤ xx and y0 ≤ y{ , therefore the slope of the line, a , has a value between zero and one, 0 < < 1.
The slope of the line is calculated by a - (y, - y0)/(xi ~ x0) [502]. In example line 1201 of FIG. 12, the equation of the line is y - \lx/41 + 7/82 , therefore a = 17/41. Example line 1201's endpoint (xo, yo) 1203 is (1/2,12/41) ; its endpoint (xi.yi) 1207 is (41+1/2,17+12/41) . Note that while the coordinates of the endpoints are rational numbers in this case, a coordinate may be any real number.
Initialize order 1 starting pixel and error term [504]: FIGs. 7 and 13
The first step in the algorithm is to handle the pixel in which the start point of line lies as described in FIG. 13. At the completion of this step, the dark pixel 1301 at the start of the line will have been processed. As may be seen from FIG. 13, the coordinates of the lower left-hand corner 1303 of pixel 1301 that contains the start point 1203 of line 1201 is: . 01 =| l/2j= 0
• .y101 = | l2/4lj = 0
To decide whether to set the first pixel in the line separately from the first run we define the distance χ^l ] 703 from the start point of the line to the beginning of the pixel as described in Figure 7:
• Xo = -*-o - o or 1/2 in our example. If χQ [0] ≠ 0 , the first pixel must be set separately from the first run.
We also require the initial value error term βj°] of order zero normalized against the slope of the line. Given the average run length in the line r[1] = 41/17 in example line 1201, where yQ - y0 is the distance from the y coordinate of starting point 203 to the y
coordinate of the lower left-hand corner 1303 of pixel 1301 and τ = — - . a
Since χ[°] is nonzero, the Bitmap Processor sets a run of order 0 (a pixel) into the bitmap memory at the location (XQ [ ] , y^01 ) = (0,0) . There are two choices for the position of the next pixel in the line segment (1,0) or (1,1) . The choice from these two is made using the value of the error term /J0 0]. There are two choices for the position of the next pixel in the line segment (x{,0] + 1, _y|,01) and (xj,01 + 1, .yj,01 + 1) . The choice from these two is made by the value of the error term β^ . Firstly, increment the x coordinate and calculate the next error term of order 0: • 101 = 0] + l
In the example of FIG. 7, this comes out to 12/17 + 1 - 1/2 = 41/34, which is less than r1 , which equals 41/17. If the error term is less than the average run length of order 1 as shown at 701 in FIG. 7, the next pixel is pixel (xl°] + l,y^l ]) .
o y^ = y^
If the error term is greater than or equal to the average run length of order 1 as shown at 709 in FIG. 7, the next pixel is pixel ( °] + 1, yQl ] + 1) . Accordingly, the error term is also updated.
o Am = Ara -*-I,]
If χQ [ ] is zero, the values of position of the pixel and the error term are not altered and no pixel is set into the memory.
The position of the next run of order 1 in the line segment and the first error term of order 1 is now the position of the next order 0 run and error term of order 0.
[<] 0] xo = [ ~ XQ • y ['] -= y „%[°]
The coordinate (x , .yj,1 ]) is stored as the position of the next run in the line segment [130].
The error term β ] is stored [152] as the error term for the next run [150].
Setting the first truncated run of order i > 0 Once the first order has been initialized [504][506], the first truncated run of order 1 through / is set, where i is either the desired maximum order [122] or the maximum order in the hierarchy of runs in the line [124].
The process for setting the first truncated run of order k-1 is as follows. Starting at order k=l [506]:
1. Calculate the length of the first truncated run of order k [510] , r^k] .
2. Set the truncated run of order k into the Bitmap Memory [512] if the run is truncated.
3. Check that the end point of the line has not been reached [514]. If it has, cease processing and if it has not continue.
4. Calculate the next error term of order k [516].
5. Check if k is the maximum depth of the hierarchy of runs in the line [520]. If so, set the maximum order of runs [120] to be the maximum order of the hierarchy of runs [124], update and store [152] the final value of the error term [150] [590] and cease processing. If not continue.
6. Check if k is the desired maximum order of runs for the line [530]. If so, update and store [152] the final value of the error term [150] [590] and cease processing. If not continue.
7. The current error term of order k is the next error term for order k+1 [532]. 8. Move to the next order [534], k = k+l.
Structure of the hierarchy of runs
During this process the structure of the hierarchy of runs will be calculated and stored [140]. The structure of the hierarchy of runs stores a description of each level in the hierarchy from order 1 to the defined maximum order [120]. Each record of the description for order i stores the following entries:
• The slope of the line of order /, a[k] . o The slope of the line of order 1 is defined to be the slope of the line, α = α . o The slope of the line of order k>l, a[k] = uήxx(μ[k~'] , v[k~i]) .
• The average length of a run of order i in the line, τm = l/a[k] .
• The length of a short run of order i, r k] = • The length of a long run of order i, r/*1 = | τlk] \.
• The type of the runs of order i in the line, t[k] , either 0 or 1. o The type of order 1 is defined to be t1'1 = 0 . o The type of order k>l is defined to be t[k] = 0 if μ[k~1] ≤ y[k'l] ■ o The type of order k>l is defined to be t[k] = 1 if μ[k'n > v[k'l]
• The structural parameters μ[,] and ['] . o If the type of order k, t[k] = 0 , then the structural parameters of order k,
- W = rw - rw , and
- μ[k] = \ - yW o If the type of order k, t[k] = 1 , then the structural parameters of order k,
- μ[k] = τlk] - rf] , and yw = l ~ μ[k]
Geometry of the error parameter /jj'1 and the structural parameters ύ[> and μm : FIG. 15 As may be seen from the foregoing, the error parameter β['] is used to calculate lengths of runs and the structural parameters t5[,1 and μ['] are used to determine the type of an order. FIG. 15 shows geometrically why the error parameter and the structural parameters can be used in this fashion. The figure shows a first-order run y of pixels 1505 representing a portion of line 1507 with slope a . In first-order runs, the slope αI1] of the run is the same as the slope of the line 1507. Shown at 1503 is the last pixel of the run y"-l . The coordinates are the coordinates of the lower left-hand comer of the first pixel of run y; the coordinates (^, ™ ) are the coordinates of the lower left-hand comer of the first pixel of the first pixel of run j'+l. The values of the error parameter and the structural parameters are defined geometrically by means of lines that are parallel to line 1507 and intersect comers of the pixels of runy. Thus, line 1509 intersects the upper left-hand comer of pixel 1503; line 1511 intersects the upper left-hand comer of the last pixel 1506 in runy'; line 1513 intersects the bottom left-hand co er of the first pixel in runy'. The error parameter β^] is the distance on the line formed by the top of pixel 1506 between the intersections of lines 1507 and 1513 with that line. The greater the distance between lines 1507 and 1513, the shorter the next n must be. Moreover, since a line is drawn beginning with a partial ran of the maximum order k and the partial mn is made by beginning with a partial n of order 1, followed by a partial mn of order 2, and continuing through order k, the error term for the partial mn of order i is that resulting from order i - l.
The structural parameter ύ[n is the distance on the line formed by the top of pixel 1506 between the intersection of line 1513 with the line formed by the top of pixel 1506 and the upper left-hand comer of pixel 1506. The type of order 1 is defined to be 1, so the structural parameter μm =ι 1 - ύm . The stmctural parameters vary with the slope o '3 of the line as represented by mns of order i, and thus can be used to determine the type of order / + 1.
Calculation of the length of the truncated run
To calculate the length of the first truncated mn of order k [510], r0 [A1 , first check if the mn is truncated. If the mn is not truncated, the length of the first mn is assumed to be zero, rd*1 = 0 , and no mn is set into the Bitmap Memory [512]. The first mn of order k in the line is truncated if the stored error term [150], β0 [k'l] > 1 .
If the mn of order k is truncated, the length of the run is:
. ror*- = |T.*] _ *-«] I iftype w = 0.
k] = \ β[k~ ] | ifthe type t[tl = l .
If the mn is not tmncated, the error term for the next order is the same as this order k] = β0 [k~ ] . The mn of order k and length r0 [A1 can now be set into the Bitmap memory.
If the mn is tmncated the initial tmncated mn length and initial decision value of order k is:
• βo ] = ^ " τ["] + β ] if the type t1*1 = 0. • β^l = β[k' - rlk] if the type t [k] = 1 • At the end of the process of setting the initial tmncated mns, we have drawn the first tmncated mn of order i in the line segment. We have the position of the next mn of order i in the line if it exists, and the decision value . We therefore move to the next phase of the process which calculates the length of the next mn of order i in the line, which is then set into the memory. The length of the next mn of order / is decided from the two possible by the value of the decision variable, .
To update [590] the value of the error term of order i, , the value of adjusted by - vt,] , - v1'1 and this value is stored [152] for use by the Run Processor [104].
An example of setting orders 1-3: FIG. 14
FIG. 14 shows line 1201 and the pixels 1402 that will be generated to represent it according to the technique under discussion. At 1401 is shown how the first tmncated mn 1403 of order 1 is set; at 1405 is shown how the first truncated mn 1405 of order 2 is set; and at 1407 how the first tmncated run of order 3 is set.
Once the first order has been initialized [504][506], the first tmncated mn of order 1 through i is set, where / is either the desired maximum order [122] or the maximum order in the hierarchy of mns in the line [124]. For the sake of the example, we will take the desired order to be i = 3 . As part of the initialization, first pixel 1301 has been set and the position of the next pixel relative to first pixel 1301 has been determined as described above.
Order 1
The next step is to handle the first tmncated mn of order 1 if it exists. In the example line, the portion on the line that will be processed is described by the dark pixels 1403.
The definition of the hierarchy of mns at order 1 in [146] is: • The slope of the line of order 1, am = 17 / 41 .
• The average length of a run of order 1 in the line, τ = 41 / 17 .
• The length of a short mn of order 1, ήi] = [τ J = 2 . • The length of a long mn of order 1, r1] =|r |=3.
• The type of the mns of order 1 in the line is defined to be, t[I] = 0.
• The structural parameters μm and v[l] . o 1? = r _r [i]-= 7/17, and o μm = -yM = 10/17.
The length of the first tmncated mn of order 1 [510], r0 [1], is tmncated since the stored error term [150], fy0] = 41/34 > 1. The length of the tmncated mn is r0 m =|r[1]-/5101 |=[~41/17-41/34] = 2 since the type t = 0. The mn of order 1 and length r0 [1] = 2 can now be set into the Bitmap memory at position (x[ ] , yj,01 ) = (1,0) . The initialdecisionvalueoforderlis /51'1 = r0 - r[1] + /310] =2-41/17 + 41/34 = 27/34.
Order 2
The initial tmncated mn of order 21405 is described by the dark pixels 1407 in line 1201. The initial tmncated mn of order 2 has a length of one (i.e. one mn of order 1). The position of the initial tmncated mn of order 2 is (x , y{,2] ) = (x^] + r0 ['! , _y{,2] + 1) = (3,1) .
The hierarchy of mns at order 2 is described by the parameters:
• The slope of order 2, c[2] = min( [11,vcι]) = 7/17.
• The average length of a run of order 2 in the line, τ [2] =17 II . • The length of a short mn of order 2, = 2.
• The length of a long mn of order 2, r2] = 3.
• As μ[1] > v[l] : o t121=l o μ[2] = τ[2]-r[ s 2] = 3/l o [2] = l- i[2] = 4/7
The first mn of order 2 in the line is tmncated because the stored error term [150] renormalized to the slope of order 2, β ] = β0 [nτl2] = 27/14, is greater than 1. Therefore as t121 =l:
• #21=#,1-r„f21 =13/14
As the shape of the mns of order 2 is shape ls+ , the last mn of order 1 in a mn of order 2 is a short mn of order 1. A short mn of order 1 has a length of two pixels. Therefore two pixels are set in this stage.
Order 3
The initial tmncated mn of order 31409 is described by the dark pixels 1411. The initial tmncated mn of order 3 has a length of one (i.e. one mn of order 2). The mns of order 3 in the line have a shape s+l , the last mn of order 2 in a mn of order 3 is a long run. Therefore we will set a mn of order 2 of length three.
The hierarchy of mns at order 3 is described by the parameters: • The slope of order 3, = 3/7.
• The average length of a run of order 3 in the line, r[3) = 1/3.
• The length of a short mn of order 3, r/31 = 2.
• The length of a long n of order 3, r31 = 3.
• As/[21< [2]: o t[3] = 0 o y^ = τ[i]~rψ = l/3 o i[31 = l-v131 = 2/3
The first mn of order 2 in the line is tmncated because the stored error term [150] renormalized to the slope of order 3, β^[ ] = β ]τ[i] = 13/6 , is greater than 1. Therefore as t121 = 0:
. r131=|rt31-/3121|=[l/6] = l
• /5131=r0 (31-z-[31 + A21 = 5/6 Therefore, a single mn of order 2 comprises the mn of order 3. Now that the order chosen for the iterative portion of the technique has been reached, the normalized intercept value of order 3, β^i] = 516 , can be used to initialize the iterative decision process.
Setting full-length runs of order i in the line: FIG. 8
To set a full length mn of order i into the Bitmap Memory [108], the Run Processor [104] performs the steps shown in flowchart 801. The inputs are the maximum order of the mns (120), the stmcture of the hierarchy of mns [146] which was determined by tmncated mn processor [102] while processing the tmncated mns, and the error term β[l] provided by tmncated mn processor [102]. For each mn of order i, the mn processor determines the length of the mn of order i in the line and passes the mn's length and order to the Bitmap Processor [106] to set the actual pixels of the run into the Bitmap Memory [732]. The calculation of the length of the mn of order i is based on the type of order (i) [702] and the value of the error term [150] , βf , retrieved [158] by the Run Processor [710,720]. Once the length of the mn has been calculated, the error term is updated, βf , and stored [156] .
The flow chart branches involved here are [702, 710, 712, 714]; [702, 710, 716, 718]; [702, 720, 722, 724]; and [702, 720, 726, 728].
The calculation of the length of the mn of order i in the line, rf is as follows: • lftype t[,1 = 0 : o If βf > 0 [710] the mn is short [712], rf = rf , and βf = β - y[,] [714].
o If β)'] < 0 [710] the mn is long [716], rf = rf , and βf = βf + μ[,] [718].
• If type t[,, = l : o If βf > 0 [720] the mn is long [722], rf = rf , and βf = βf - v[,] [724]. o If βf < 0 [720] the mn is short [726], rf = rf , and βf = βf + μ[,] [728].
The values of the stmctural parameters μl'] and v['] and the length of a short and long mn, rf and rf , are retrieved [144] from the stmcture of the hierarchy of mns [140]. Once the length of the run is calculated, the mn is set into memory [194] by the Bitmap Processor [106] and [732]. The Run Processor keeps processing mns as just described until it reaches the end of the line segment [730].
Applications of the line drawing techniques
The line drawing techniques described herein can be employed in any application where techniques of the general class to which these techniques belong are useful. The techniques are of course particularly useful in applications where the coordinates of the endpoints of the lines may have real number values, including values that are irrational numbers. Such applications include the following:
Two-Dimensional Polygon Filling and Scan Conversion
Techniques for filling a polygon on a raster or bitmap display often step along the circumference of the polygon and fill or scan convert the polygon along the horizontal mns defining the interior of the polygon (see Lathrop 1990). A problem with using existing line drawing techniques for this purpose is that the endpoints of the line are defined at pixel or sub-pixels positions and using these algorithms to step along the circumference of the polygon can cause dropouts or multiply processed pixels to occur. The line drawing technique described can be used to step along the circumference of the polygon without these errors.
Three-Dimensional Polygon Scan Conversion
When a 3D polygon is being rendered into a 2D image using interpolative techniques such as Gouraud or Phong shading, typically a technique similar to the 2D polygon scan conversion embodiment is used. A technique that is also possible is to shade the polygon using lines of constant depth. Think of a plane parallel to the view plane being used. As the plane is moved backwards through the polygon, the line of intersection between the plane and the polygon can be defined. This line has a constant depth that can be used to make the shading technique more efficient. To shade the polygon you can step along this line using the line drawing technique described setting each pixel the color calculated by the shading algorithm.
Visibility Checking - Computer Games and Simulation In computer games and simulation a common problem is to determine if two points are visible to one another. If the environment that can occlude the two points can be defined on a 2D grid, the line drawing technique describe can be used to check each of the grid points linearly separating the two points to determine if they are occluded from one another.
Visibility Checking - Mobile Network Planning
In the mobile phone industry, one of the greatest problems is in planning the mobile phone base station network to ensure effective coverage. Mistakes in deciding where to place base stations and their power requirements can be very expensive. One common solution is to use two-dimensional ray tracing methods to simulate the working environment of a mobile network. Effectively the environment is modeled in two dimensions and rays are traced through the environment to determine the coverage achieved. If the space around the environment is modeled as a grid, the process for drawing a line can be used to traverse a ray through the grid. The line segment becomes a ray if no endpoint is assumed. As the line is traced through the environment, instead of drawing each pixel in the display bitmap, the grid cell can be checked.
Simulation of sonar propagation
In sonar propagation simulation, often laminar sheets of water or other media are traced with rays to determine the propagation of rays through the medium. If the media can be modeled on a discrete grid, the line drawing algorithm can be used to propagate the ray through the medium.
Height field rendering Ray tracing has long been used to render height fields or elevation maps. The mn-based ray line drawing technique can be adapted to traverse a ray over the height field to seek an intersection with an elevation.
Hough transform In line and shape detection problems in which the Hough Transform is used as a voting strategy, the voting process requires a line of votes to be cast into an array. The mn-based line digitization techniques described can be used to cast the votes.
Additional line drawing techniques that use the line structure information The line drawing techniques that are the subject matter of PCT/US02/24711, the parent of this patent application, require that information about the stmcture of the line being drawn be computed. The stmctural information can also be used to enhance other aspects of drawing a line. Three of these are discussed in the following: • techniques for drawing lines or computing rays in parallel;
• techniques for adding anti-aliasing pixels to lines drawn using mns of pixels; and
• techniques for improving memory setting processes based on mns.
Parallel techniques for determining the cells of a raster that are intercepted by a line: FIG. 16
An advantage of using mns of any order n to determine the cells of a raster that are intercepted by a line is that once the first tmncated mn of order n is drawn and the stmctural information about the line has been computed, it can be used to determine the positions in the raster of all of the other mns of order n of cells that are intercepted by the line. Consequently, if the hardware or software being used to determine the cells permits it, the cells belonging to the other mns of order n can be computed in parallel. The parallel computations can be performed by calculating each mn of order n in the cells intersected by the line in parallel; or by calculating the positions of groups of mns of order n in the cells intersected by the line in parallel and using the sequential version of the algorithm to draw each group. Another level of parallelism could be attained within each mn by setting multiple mns of a lower order or pixels per iteration of the sequential or parallel version of the algorithm. The mn of order n could be divided into mns of an order less than n, each of which could be processed in parallel.
FIG. 16 gives an overview of how mns may be computed in parallel. There are two parts: initialization 1615, which calculates and sets the first tmncated mn of cells and then computes the starting cells of each of the full mns of order i being set, and the part 1615 that sets the full mns in parallel. Beginning with start 1603, the first part of the initialization is done as shown in FIG. 6. As set forth in the explanation of FIG. 6, tmncated mn processor 102 receives as inputs the endpoints of the line; from the endpoints, it calculates the line's slope and determines the starting pixel and the starting point and error term β for the first mn tmncated mn of order 1. Then it proceeds as follows for that order and all others l..n: first it calculates the length of the tmncated mn of the order, then it sets the tmncated mn in the bitmap, and then it calculates the error term for the next order. At the end of the process, the location of the starting pixel of the first full mn of order n is known, along with the error term. From this information, the starting cells and stmcture parameters of each of the full mns of order n may be computed, as shown at 1610. This completes the initialization, and the full mns are set in parallel, with the last mn terminating when the line's end point is reached.
The apparatus of FIG. 2 may be modified to perform the processing of FIG. 16 by replacing bitmap processor [106] with a number of bitmap processors 106(a..j), which can operate on bitmap memory 108 in parallel. Run processor 104 would then give each bitmap processor 106(i) the starting cell and stmcture parameters for the mn that bitmap processor 106(i) is to set. The degree of order n may be determined by the number of bitmap processors 106; for example, if there are four bitmap processors, the degree of order n may be that at which the line contains full mns and a final tmncated or untmncated ran such that the total number of the full and final mns is divisible by 4. The degree of order n may be determined by the designer or based on external parameters such as the length and slope of the line. The bitmap processors may also be able to set an array of bits in a single operation; in that case, the order whose runs best fit the array that the bitmap processor can set might be the one for which the operation is parallelized.
Computing the starting points of the runs for order 1
To calculate the position of the j - th full length ran in the line, let us reconsider the linear equation given by
where βy is the intercept value of the first full length ran given at position (- , o )• We know that j = yy -y}- ' as the height of a mn is always one.
Therefore the position of the J - th full length mn in the line is
To increase the efficiency of the algorithm, we can normalize each of the values at order 1 by cr1' . This eliminates a number of division and multiplication operations.
Computing the starting points of the runs for order 2
To calculate the position of the j - th ran in the line, let us reconsider the linear equation given by
For order 2 we have
Define p , where h ≤ i, to be the number of runs of order h in the partial line up to the beginning of the j - th run of order i from the first full-length run of order 2. Therefore
/>!* --*' -4"
The above linear equation for order 2 becomes
For rans of order 2, shape 0, we have or'2' = μ^ = ( r'1' + l)cr'' - a*0' and by substituting for cr01into the previous equation we have
For this shape, each ran of order 2 must contain a long ran of order 1 and r^' + 1 short rans therefore a[l] = (r[,] + l)/?Jl] and
Similarly for shape 1 we get
Hence for shape 0
,W _ΛM + jcfiWpψ -βM a W
and for shape 1
To increase the efficiency of the algorithm, we can normalize each of the values at order 2 by cr2', as in order 1. This eliminates a number of division and multiplication operations. In this case we can also define cr2^ = min (v*-2',μ.^) to be the proportion of mns of order z'to order 1 where r'21 = l/cr21is the average mn length of order 2.
Computing the starting points of the runs for order i
To describe a general algorithm for any order twe can expand the definition of the algorithm for order 2. The main differences between the algorithm of order 2 and i, is that rans of any order i >2 occur in one of the four possible shapes not two. For orders beyond 2 however there is no restriction that the first mn in the line y = ccx is long, therefore all four shapes are possible. Apart from this key difference, the calculation of the stmctural parameters, the length of the initial truncated mn length, the starting point of each mn of order i and the length of each mn of order can be derived from order 2.
To expand on our idea of shape at order 2, we define the type instead of the shape of the mns of order > 1 to be type t[,] = 0 if μ['~l] < vM, type t[,] = 1 if v1'"'1 < / '1 and define the type of order 1 to be > = 0, we can calculate the shape by the relationship
s['] = t[>-ι] φ tl>]
where the operator Θ denotes the binary concatenation of the two types. For example if t'2' = l and t'3' = 0, shape s[ ] has the binary value "10", or decimal 2, and therefore, s*-3' = 2 : sl+ . We can use these definitions of type and shape for order 2 by assuming that the type of all mns of order 1 will always be type 0.
The method of calculating the position of the j - th mn of order i > 2 also follows from our discussion of order 2. To calculate the position of the j - th mn in the line, let us reconsider the linear equation given by J»' -AM - «I"W1 -*}J)-WI - JJ) or
By induction, it is possible to show that for order i , type 0
and for order i , type 1
Therefore, because py = y , we can substitute back to orders 1 and 0 where py = yf -yy and py = xy - xj,1 in a similar manner as we performed for order 2. To increase the efficiency of the algorithm, we can normalize each of the values at order i bycr'\ similarly to what we did for order 2. This eliminates a number of division and multiplication operations. In this case we can also define ά^ = min (v^'',μ}'') to be the proportion of mns of order tto order 1 where rf = l/cr'"is the average ran length of order 2.
Implementing the calculation of the starting positions and compositions of the full runs of order 1
In the following, μ and v are the stmctural parameters described in the parent of the present application. For each scanline, j, in the image given the line segment (x0,v0)to (JC,, ,) such that L)O J ≤ ./ ≤ [ i 1 where o > ^0 > ι > Vi <≡Λand x0 < *, :
1. If [_y0 J < j ≤ [~ , ] , the scan line intersects the line segment.
2. The starting point for the line is:
[0]
Vo = J
3. To handle the first pixel, the distance of the intercept to the position of the first pixel is calculated:
/?'=(y0-boJ)-( o- >J)α[l1
If /S'≥OfhenA01 =/?'. If /?'<0fhen β[° = β'+a [>] and the position of the first run is reset to = (W+l. J)-
4. Calculate the average run length of order 1. rt'l = ' x
5. The length of the initial truncated ran is
6. The intercept value at the start of the first full-length mn of order 1 is:
] = rM - (rM -W)
1. If the scanline intersects the start point, i.e. if y^' = j, set a mn length rj1' at pixel ( 0l, S01) and cease.
8. We now have |_y0 J < j ≤ ("v, "[ Set the reference point for the line to start of the first full-length ran of order 1 in the line
],y£]) = xP + rf,yW + )
9. The length of a short ran is
10. The portion of long rans of order 1 to the total number of run of order 1 in the line is
['! = = τl \
11. The vertical distance from the reference point to the intercept of the line and they-th run
12. The normalized intercept value of the line and they-th run is
13. The position of the run is
14. If the scanline intersects the end point of the line segment, i.e. if yf = y, , calculate the last tmncated mn length
Set a mn of length rf at pixel (x ,yy) and cease.
15. We now have [.j 0 J < y < |~y, ~| and only the intermediate rans remain. The length of the y-th mn is
Set a mn of length rf at pixel
Implementing the calculation of the starting positions and compositions of the full runs of order 2
We assume that the steps 1-5 and 7-10 have been executed and we have values for the parameters x[°],y[° xf ,yP,rf,rf,βf,vmll] . If j=0 and the first possibly tmncated mn in the line is to be set, we assume that the first possibly truncated mn of order 1 has been set.
1. Calculate the shape of the mn of order 1. Ifl-v[11<v[1]
^ = 0 else
,t2i = ι
2. Calculate the average ran length of order 1.
If*N=0 r[2]=l/(l-v[11) else r[2]=l/v[11
3. The length of the initial truncated mn is lfs[l]=0
,[2] τ[2]0 else
4. The intercept value at the start of the first full-length ran of order 1 is: lfs[2l=0 else
A"1 -A"'-',1"
5. If y = 0, set a mn of order 1 and length rf at pixel (x0 l0], yj° '). Then set a mn of order 2, length rj2' and shape s'2'at pixel (xf, y ) and cease. 6. Set the reference point for the line to start of the first full-length ran of order 2 in the line:
If s[2] = 0
( 2] !^])=( ,]^o[2lrill+i)-ι^S,1+^21) else
I. The length of a short ran is
8. The portion of long rans of order 1 to the total number of ran of order 1 in the line is lf5 [2l=0 else
9. The run-based distance from the reference point to the intercept of the line and they-th ranis:
10. The normalized intercept value of the line and they-th mn is
I I . The position of the ran is lfs[2]=0
else
12. The length of they-th ran is
13. Set a ran of length rf] shape s[l] = t[2] at pixel yf[ )
Implementing the calculation of the starting positions and compositions of the full runs of order i
We assume we have values for the parameters XQ , y^ ,ry' ,rf] , β0 [k] ,vlk][k] , where k = 0... i-1. If y'=0 and the first possibly tmncated mn of order i in the line is to be set, we assume that the first possibly tmncated ran of order i-1 has been set.
1. Calculate the shape of the run of order 1. If 1 - v[ 1 < v[-l] rf = else tt'l = l
2. Calculate the average mn length of order 1.
If t[,] = 0 r[,1 = l/(l -v['-1]) else
3. The length of the initial tmncated mn is If t[,] = 0
-[«] _ [.) _ Λ[-[l] I
't — r o I else ιH-lAMJ
4. The intercept value at the start of the first full-length mn of order 1 is: If t[,] = 0 else AM - AMH
5. If j = 0, set a ran of order / and length rf at pixel ( '-'1. vό'" )•
6. Set the reference point for the line to start of the first full-length ran of order 2 in the line:
δrm = r[,}
for k = t - l,...,l if t{,] = 0 else
,[<] + <5ir [0]
7. The length of a short ran is
8. The portion of long mns of order 1 to the total number of mn of order 1 in the line is If t[,] = 0 yi'J = r1'1 -I'! else
9. The mn-based distance from the reference point to the intercept of the line and they- th mn is:
10. The normalized intercept value of the line and they-th mn is
11. The position of the mn is
for k = i,...,l if t[,] = 0 else
12. The length of they-th mn is
13. Set a ran of length rf , shape sl'] = t["'] Θ t1'1 at pixel (xf,yf) . Optimizations
5 For the parallel algorithm, we can rearrange the calculations to move many of the expensive operations into the initialization phase of the algorithm. For example Algorithm 1 illustrates a possible implementation of an order 1 algorithm.
Algorithm 1 Calculating the length and position ofthej-th run of order 1 in the digital 10 line.
Constants pertaining to the line: r[.] _ 1
c[ιl = τ v[ι]
Constants pertaining to they-th ran of order 1.
2 .C0U rf c3 -- - -TT - - yicc0 [i] c c4N - - β<> ] +. ΓJT.μll] - - C C,M + ι r c3r μ ι
The position of they-th mn of order 1:
The length of they-th mn of order 1 :
The length of they-th mn of order 1 is long, rf = \ r 30 else The length of they-th mn of order 1 is short, rf = [τ[i] J.
From Algorithm 1, the constants cf and cf can be calculated once in the initialization of the algorithm. The constants cf and cf can be calculated iteratively as each new parallel task is created from preexisting constants. Therefore each mn can be set in parallel for a cost of approximately 6 additions, a multiplication and a comparison compared to a cost of 3 additions and two comparisons for the central loop of the sequential algorithm. Hence, the overhead imposed by the parallelization of the algorithm is quickly recouped.
Similarly, for an order 2 implementation as described in Algorithm 1, migrating to a parallel implementation would add two divisions and a multiplication to the cost of initializing the algorithm and 10 additions, a multiplication and division and a comparison to the cost of calculating the length and position of each mn of order 2.
Algorithm 2 Calculating the length and position of the y'-th run of order 2 in the digital line.
Constants pertaining to the line:
c[2]
c[2]
Constants pertaining to they-th mn of order 1:
+ . e -.3i2y2i
if M < vM
The length of they-th ran of order 2, shape 0: l+s if c[2]<CW
The length of they-th ran of order 2 is long, r Λf2]' = | τ Λ[2]
else
The length of they-th ran of order 2 is short, rf' =
The height of they full rans of order 2, shape 0: l+s : , = c[ ] + c[2] _ c[2]
else The length of they-th mn of order 2, shape 1 : ls+ :
The length of they-th mn of order 2 is short, rf' = else
The length of the y'-th mn of order 2 is long, rf] = \ τ[2] \. The height of they full rans of order 2, shape 1 : Is + :
The position of the y'-th run of order 2 (xy,yy) :
Algorithm 3 Calculating the length and position of they-th run of order i in the digital line.
Constants pertaining to the line:
c, αl ββfo[ cl>] = V[i] a
Constants pertaining to the y'-th ran of order i:
M - J - / [«l 3 ~^~J ° rf_βJ]+J ['] .H . .M..1.1 a
The type of the mn of order r. if H]<vHl
t['3=0 else The shape of the mn of order i:
The length of the y'-th mn of order i: if t[,] = 0 if J<c1,J
The length of they-th ran of order i is long, rf = | rl'J |. else
The length of they-th run of order i is short, rf = [τl'] j. else
The length of they-th ran of order isshort, rf = else
The length of the y'-th run of order / is long, rf = | τ[,] j.
The start point of they-th run of order i: for k = i-1 to 1 if t^ = 0 p Λ = *i else p ' = a[k-]]pf /a[k] -(βf - β[k])/a[k = c k]p -cf + cf ]
(4^!'])=W0]+ ^1,1 +^1)
Efficiency of parallelization
To compare the efficiency of the parallel and sequential versions of the algorithms, we carry out an asymptotic analysis of the time complexity of the overall hierarchy algorithm for rans to all orders. At the outset we point out that we assume a rational slope = a id . We assume a and d are positive integers with a < d. For the case of an algebraic irrational slope as described in the parent of the present application, a discussion of computing primitives would be required. However, given such a discussion, most of the rational slope analysis can be earned over to the algebraic irrational case. This follows because all of the operations involved in the algorithm are rational and it is well known that equations and inequalities in algebraic irrational numbers involving explicitly rational (in fact algebraic) operations can be decided.
It has been shown in P.D. Stephenson and B. Litow, "Why step when you can ran: Iterative line digitization algorithms based on hierarchies of runs", 7EEE Computer Graphics and Applications, 20(6):76-84, November/December 2000) that the number of orders in the hierarchy of runs for a line with slope is bounded above by O(log d) and that the number of rans in successive orders diminishes very much like partial quotients in the GCD algorithm for a and d. We will make use of this important observation in our analysis.
Initializations across orders are sequential, i.e., values for order i depend on values for order t-1. It is evident that at each order, initialization costs 0(1) rational arithmetic operations. We emphasize that the division occurs only within the scope of the floor function. This suggests that the precision needed for division can be reduced considerably below the obvious requirement.
Within each order the computation of ran lengths is actually an initialization and we count it as such. The ran positions can be computed in parallel. Each position costs 0(1) rational arithmetic operations. However, here division appears to require full precision. Assembling our accounting, we have that initialization over all orders costs O(log d) rational arithmetic operations. Idealizing slightly the partial quotients behavior of GCD, we credit order i with d 12' mns. If we allocate d 12' processors to the /-th mn, the time to compute mn positions across all orders is O(l) rational arithmetic operations. This gives a work (time x processors) value of θ(d) (l + l/ 2 + - - - + l/2Λ ), where h is the maximum order, h ≤log d. This yields a work value of 0(d). If we allocate fewer processors, the parallel time increases, but it should be possible to choose configurations that preserve the 0(d) work value.
In computer graphics and even computational geometry applications of the algorithm, the value of d will probably remain below, say, 104. The boundary condition here is the realization of the digitized line. In graphics the constraint that d < 104 seems realistic, since we would be resolving beyond 10 pixels were d to exceed 10 . For computational geometry applications, more thought about implicit representations of digitized objects is needed. Using hierarchical run-based methods has shown a significant improvement in the cost to digitize a line. An important reason for the improvement has been the structural information of the digital line provided by its mn-based description.
To implement a system based on one of the algorithms presented, the order of the algorithm must be decided either by the designer or dynamically by the system itself. While the length of the mns in the digital line increases exponentially with the order of the ran, the cost of initializing an algorithm also rises, albeit linearly. Given that the cost of an iteration to decide the position and length of the next mn in the line is so small, the number of mns in the line must be significant enough to warrant using a higher order algorithm.
Problems of ray traversal in three dimensions: FIG. 17 There are many situations where a program needs to compute the traversal of a ray through three-dimensional space. One example of such a program is one that produces a two- dimensional display of a three-dimensional object; another is one that determines how a signal is propagated through a volume. In both cases, there are two problems: representing the traversal in the program and accelerating the traversal through those parts of the three- dimensional space that do not affect the ray. A good general discussion of ray traversal in three dimensions can be found in Marc Levoy. Efficient ray tracing of volume data. ACM Transactions on Graphics, 9(3): 245-261, July 1990. FIG. 17, which shows how ray traversal may be used to make a two-dimensional representation of a three-dimensional object, is a slightly modified version of Levoy's FIG. 2.
The two-dimensional representation of the three-dimensional object is an image 1705 that contains P x P pixels. The image is effectively a "window" into an image space 1701 that contains P x P x W voxels. A voxel is the three-dimensional equivalent of a pixel: it is a data item that corresponds to a cell located at a point (x.y.z) in image space. The data in the voxel contains information about the cell; an example of such information is the color and opacity of the cell. If the color and opacity correspond to data values, the data in the voxel may also include the data values. If image space 1701 is non-empty, it will include one or more object spaces 1703. Each object space has as many voxels as are required to contain all of the voxels for a particular object in image space 1701. Each voxel 1709 in object space 1703 contains data as required for the portion of the object represented by the voxel. It should be noted that, as shown in FIG. 2, object space 1703 may not have the same x, y, and z-axes as image space 1701, and that consequently, a ray 1711 may pass through object space 1703 at any angle relative to the axes of object space 1703.
To make image 1705, one or more rays 1711 corresponding to one or more pixels 1715 in the image are traced through image space 1701. If ray 1711 passes through a voxel 1709 whose data affects the appearance of that pixel, the relevant information from the voxel becomes part of sample 1713 for the pixel. When ray 1711 has completely traversed image space 1701, the information in sample 1713 is used to determine the appearance of pixel 1715.
As can be seen from FIG. 17, an image space 1701 of any size has an enormous number of voxels, and most of the voxels traversed by a particular ray 1711 are either not part of an object space 1703, and therefore provide no information to the traversing ray, or are behind an opaque voxel and can provide no information to the traversing ray beyond what was obtained from the opaque voxel. Efficient traversal of image space 1701 by a particular ray thus requires both efficient techniques for computing the voxels that are intersected by the ray and efficient techniques for determining which of the voxels intersected by the ray contain information that is relevant to the pixel that corresponds to the ray. As will be explained in detail in the following, the mn-based techniques described in the parents of the present patent application may be employed both to provide efficient computation of the voxels that are intersected by a ray and to provide efficient determination of which of the voxels intersected by the ray contain information relevant to the ray's pixel. The same techniques can of course be employed in other applications where the information gathered by the ray traversal has uses other than or in addition to display generation.
Using run-based techniques to compute voxels intersected by a ray: FIGs. 18-22
Geometry of ray projection: FIG. 18 The techniques that are explained in detail in the following are based on the fact that a ray which is traversing a volume in which positions of points are defined relative to X, Y, and Z axes may be represented as two projections: one on the plane defined by the X and Y axes and another on the plane defined by the X and Z axes. This is shown in the diagram of FIG. 18.
FIG. 18 shows a volume 1801 that is being traversed by a ray 1816. Points in volume 1801 are specified by the triplet (x,y,z), where x is a value on X axis 1803, y is a value on Y axis 1805, and z is a value on Z axis 1807. X axis 1803 is termed the major axis with regard to traversing ray 1816 because the direction of traversing ray 1816 is closer to that of the X axis 1803 than it is to the other two axes. Expressed mathematically, X axis 1803 is the major axis because for any two points on ray 1816, (a,b,c) and (i,j,k), the difference δ between a and i will be greater than the difference θ between b andy or c and k.
Traversing ray 1816 passes through the top and bottom of volume 1801. The top is defined by the y,z plane 1815 made up of all of the points (x,y,z) where x= x(c). The bottom is defined by the y,z plane 1813 of points (x,y,z) where =x(0). The point at which ray 1816 intersects plane 1815 is point (x(c), y(d), z(e)) 1819; the point at which the ray intersects plane 1813 is (x(0),y(a), z(b)) 1817. Two other planes of interest are x,y plane 1833 made up of all points for which z=z(0) and x,z plane 1835 made up of all points for which =y(0). These planes are perpendicular to top plane 1815 and bottom plane 1813 and intersect at X axis 1803. As shown in FIG. 18, ray 1816 may be projected onto planes 1833 and 1835. One way of doing the projection onto plane 1833 is to construct a line on top plane 1815 which passes through point 1819 and is perpendicular to the edge of plane 1833 which intersects plane 1815, construct a line on bottom plane 1813 which passes through point 1817 and is perpendicular to the edge of plane 1933 which intersects plane 1813, and then construct the projection 1821 of the ray on plane 1833 by connecting the points at which the perpendicular lines intersect the edges. Projection 1827 on plane 1835 can be constructed in the same fashion.
Between them, projections 1821 and 1827 contain all of the information needed to determine the (x,y,z) coordinates of all of the points in volume 1801 that are on ray 1816; consequently, projections 1821 and 1827 together may be used to represent ray 1819. In the same fashion, a three-dimensional lattice of voxels in volume 1801 may be represented by two-dimensional lattices in planes 1833 and 1835 and the voxels intersected by ray 1816 may be determined from the lattice cells intersected in plane 1833 by projection 1821 and the lattice cells intersected in plane 1835 by projection 1827.
Using run-based techniques to compute voxels that are intersected by a ray: Figs. 19-22 Determining cells in a two-dimensional lattice that are intersected by a line is of course the problem addressed by the techniques described in the portion of the present patent application that are carried over from the present application's parents. As set forth there, given two points within a two-dimensional lattice, it is possible to describe lattice cells that are intersected by a line connecting the two points in terms of mns and mns of mns of cells. If the lattices are projection planes such as planes 1833 and 1835 and the lines are projections of a ray on the projection planes, then it is further possible to determine voxels intersected by the ray from the lattice cells intersected by the projection lines.
How voxels intersected by the ray are determined depends upon whether the intersected voxels may be related to each other as 26-connected voxels or must be related to each other as 6-connected voxels. Six-connected voxels must connected to each other face-to-face; since a given voxel has six faces, and it may be connected face-to-face with at most six other voxels; hence the term "six-connected". 26-connected voxels may also be connected to each other by any of their 8 comers and 12 edges, hence the term "26-connected". For volume rendering, the minimal 26-connected path of a ray suffices for many applications. In comparison, iso-surfacing volumetric data and ray tracing require the 6-connected ray path. In ray tracing, including edge and comer intersections can also be beneficial to avoid possibly expensive ray-object intersection tests.
Determining 26-connected voxels intersected by a ray: FIGs. 19 and 20
FIG. 19 shows how to determine 26-connected voxels intersected by a ray from mns of lattice cells on the XY plane 1833 and the XZ plane 1835 that are intersected by the projections of the ray on the XY and XZ planes. Volume 1801 in FIG. 19 has an X-axis 1803, a Y-axis 1805, and a Z-axis 1807, with the X-axis being the major axis. Projections of the ray have been made on XY plane 1833 and on XZ plane 1835, and the techniques described above have been used to determine lattice cells 1927 intercepted by the projection on the XY plane and lattice cells 1921 intercepted by the projection on the XZ plane. Lattice cells 1921 and 1923 are then used to determine voxels 1909 intersected by the ray.
Determining the mns in the XY plane and the XZ plane is done iteratively or in parallel a ran at a time with the corresponding runs of each traversal determining the length of the resultant mn of voxels. Starting at the point where the ray intersects bottom plane 1813, the initial mns of lattice cells intercepted by the projections onto the XY and XZ planes are calculated. The shorter of these two rans and the equivalent number of cells of the longer run map to the first ran of voxels intercepted by the ray. Thus, in FIG. 19, mn of lattice cells 1923 and the corresponding portion of mn 1929 map onto ran of voxel cells 1911. The remaining portion of the longer mn 1929 and a coπesponding portion of mn 1925 map onto run of voxel cells 1913. The remaining portion of ran 1925 and all of run 1931 are then mapped onto mn of voxel cells 1915. Voxels intersected by the three-dimensional line can therefore be determined by taking the length of the shorter of the two corresponding rans of cells as the length of the three-dimensional ran of voxels. The longer two-dimensional mn of cells is then reduced by the length of the shorter ran, which is replaced by the next two- dimensional ran in its traversal. The procedure is more precisely described in Algorithm 2001 in FIG. 20. The cells in the two-dimensional rans need only be 8-connected, i.e., by any of their four sides or four comers. Deteimininfi the 6-connected voxels intersected by a ray: FIG. 21
To constmct the 6-connected path of the ray from the ray's projections on primary and secondary projection planes 1833 and 1835, all that is needed is to include an extra cell at the beginning of each two-dimensional ran. This process is described in Figure 21. The runs 1919 and 1931 in plane 1833 and the mns 1923 and 1925 are calculated as described for FIG. 19; however, in set of rans 2101, a cell 2107 is added at the comer where ran 1929 and 1931 meet, and the same is done in set of mns 2109.
The 6-connected set of voxels that the ray intersects is shown at 2117. Run 2119 corresponds to ran 1923 and the corresponding portion of mn 1929; mn 2121 corresponds to the remaining portion of mn 1929, added cell 2115, and the part of mn 1925 corresponding to the remaining portion of mn 1929. Run 2123 corresponds to the remaining portion of mn 1925, added cell 2107, and mn 1931. All of the voxels in set of voxels 2117 are connected to one or more other voxels in the set by their faces.
Edge and comer intersections in sets of 6-connected voxels: FIGs. 22-25 With 6-connected sets of voxels that are intersected by a ray, ray-object intersection tests can be avoided if voxels in which the ray intersects only an edge or a comer of the voxel can be excluded from the 6-connected set of voxels. FIG. 22 shows the edge intersection case. First, the edge intersection case must be detected. For an edge intersection to occur in the set of 6-connected voxels intercepted by the ray, a comer intersection must occur in one of the two-dimensional sets of mns. This is shown in FIG. 22, where two-dimensional set of mns 2205 that intersects projection 2201 has a comer intersection 2209 between mns
2207 and 2211 , but two-dimensional set of mns 2213 that intersects projection 2203 does not have. In terms of the projections 2201 and 2203, the value of β at point 2209 is 0, while its value at 2218 is greater than 0. The edge intersection appears at 2225. When there is an edge intersection, the voxel corresponding to cell 2220 is not included in set of voxels
2219.
To detect an edge intersection, one proceeds as follows: when making the next mn of cells intersected by the projection, the distance β between the projection and the comer of the next mn is considered. If the distance is non-zero, no edge intersection occurs. If it is zero, an edge intersection occurs and no voxel corresponding to the cell that is added to the beginning of the next two-dimensional mn is added to the set of voxels. The algorithm is set forth more precisely at 2301 in FIG. 23, where β indicates a normalized value of β
For a comer intersection to occur in the set of voxels, there must be an edge intersection at the same place in the sets of cells that intersect the projections in planes 1833 and 1835. Therefore, a comer intersection in the set of voxels can only occur when the two projected mn lengths are the same length. This is shown in FIG. 24. Projected lines 2401 and 2403 produce sets of two-dimensional rans 2405 and 2413 in which rans 2407 and 2415 are the same length and for which δ for the next mn is 0. This results in comer intersections 2409 and 2417. Set of voxels 2421 then has a mn of voxels 2423 that corresponds to two- dimensional mns 2407 and 2415 and a mn of voxels 2427 that coπesponds to two- dimensional mns 2411 and 2419. Runs of voxels 2427 and 2423 are connected at comer 2425.
To detect mns of voxels that are connected at a comer, one proceeds as follows: If no edge intersection occurs, to get from the end of the previous mn of voxels (x', y, z) to the start of the next ran (x', y + 1, z + 1), the ray must intersect the voxel (x y + 1, z) or (x', y, z + 1) as shown in FIG. 22. Which cell can be determined from the relative value of the normalized intercept values β as described in algorithm 2501 of FIG. 25. In this algorithm, the position of the mn has already been updated to the start of the next ran. Therefore, the voxel intersected by the ray must be handled in retrospect once a comer intersection has been identified.
Efficiency of computing voxels intersected by a line from two-dimensional runs of cells intersected by projections of the line
The three-dimensional traversal algorithm requires two separate two-dimensional traversals of each of the projections of the line peφendicular to the major axis. If comer and edge intersections are ignored, the number of mns in the three- dimensional path of the ray is the sum of the number of rans in the two two-dimensional traversals. Therefore the order of the three-dimensional ray traversal algorithm is 0(n/τ), where r is now the average length in the three-dimensional path of the ray and n is the associated number of cells.
Using descriptions of rays as sets of runs of voxels to accelerate ray traversal: FIGs. 26-31 Using encoding runs to describe the voxels in a volume: FIG. 26
A problem in rendering the contents of a volume as pixels by traversing the volume with rays to obtain the information needed to define the appearance of the pixels is that in general, not all contained in the volume along the path traversed by a particular ray has anything to do with the appearance of the pixel. Two examples of this fact are the following:
• voxels that represent empty space can have no effect on the appearance of the pixel.
• once the ray that defines the appearance of the pixel has encountered a voxel that represents an opaque surface, the values of the further voxels traversed by the ray will have no effect on the appearance of the pixel.
The second idea, called early ray termination, only applies to certain rendering functions such as shaded rendering and isosurfaces. If the entire path of the ray through the volume must be determined, as for an X ray style or maximum intensity projection (MIP) rendering, early ray termination is not valid.
A general solution to the problem of skipping uninteresting space is to find some way of indicating that the content of a particular set of voxels will have no effect on a traversing ray. The technique generally used is to subdivide the space being traversed into regions that will affect a traversing ray and regions that will not. When the ray enters a region that does not affect it, there is no need to examine individual voxels in the region.
The technique used to subdivide the space into regions in a preferred embodiment is similar to the compression technique termed run-length encoding. Run-length encoding is used in situations where the data being compressed includes sequences of data in which the same value is repeated over and over again. Such a sequence of data may then be represented by giving the value and the number of repetitions. For example, the sequence of 10 eights, 8888888888 may be encoded as the pair {value, number of occurrences} , or {8,10} . The compressed data thus becomes a list of pairs {value, number of occurrences} . When the sequence of data represents pixels in an image, there may be a list of pairs corresponding to each row of pixels in the image. A row of pixels is of course a mn, and in the following, mns used for encoding will be termed encoding runs, to distinguish them from the rans of cells traversed by a line or ray. Similarly, when the sequence of data represents voxels in a volume, the encoding rans may be rows of voxels in the volume. FIG. 26 gives an example of an encoding ran 2603 in volume 1801. Encoding mn 2603 is a row of voxels in 1801 for which the coordinates are (x(i),y(0..n),z(j)). Similar encoding mns may of course be made where the voxels all have the same y and z coordinates and a range of x coordinates or the same x and y coordinates and a range of z coordinates. The best encoding mns to use with a particular ray are those for which the dimension with the range of coordinates is the dimension of the major axis of the ray. In encoding run 2603, there are only two areas 2605 and 2607 in which the contents of the voxels will affect a ray that traverses the voxel. Encoding ran 2603 can thus be encoded as a list of sets of three values as follows: {NULL,y(0),y(a)} ; {VALl,(y(b),y(b)};{NULL,y(c),y(d)}; {VAL2,(y(e),y(f)};{NULL,y(g),y(h)}, where a part of the mn that has no effect on the ray is indicated by NULL followed by the y coordinates of the beginning and end of the sequence of voxels that have no effect and a part of the mn that can affect a ray is indicated in the same way, except that NULL is replaced by value(s) that will affect the ray in the sequence.
Using runs of voxels traversed by a ray together with encoding runs to accelerate ray traversal: Figs. 27—30
If lists of encoding rans 2603 have been made for each of the principle axes of a volume, then the problem of determining how a ray is affected by the voxels of the volume can be solved by determining whether there are any voxels traversed by the ray (termed in the following ray voxels) in the list of encoding mns for the ray's major axis that are the same as voxels which the list of encoding runs indicate will affect the ray. These later voxels belong to what will be termed in the following significant runs of the encoding mn. If there are ray voxels that are the same as voxels in a significant mn, the data items corresponding to the voxels in the significant mn that match the ray voxels must be examined to determine how they affect the ray. Using the techniques just explained to determine the ray voxels for a ray make determining whether there are ray voxels that are the same as voxels in a significant mn in a particular encoding mn easier, since in order for there to be such voxels, a run of the ray voxels must intersect the significant mn. Further, as already described, the projections of the ray may be described using mns of orders greater than 1, and the mns of ray voxels may be thus made of any useful length. In general, of course, the emptier the volume is, the more acceleration results from the use of longer mns of ray voxels. How the ray voxels intersect significant mns is shown in FIG. 27. FIG. 27 shows a slice 2701 of a volume of voxels in which the voxels are associated with data from the Visible Human Project male dataset. The data describes the head and neck of a human male. Slice 2701 is a set of voxels that have the full range of x and v coordinates permitted by the volume and a single z coordinate. The interesting region of slice 2701 is represented as a list of encoding mns. The mn of voxels represented by one such mn, 2703(1), is shown in FIG. 27. As shown there, mn 2703(i) has three runs 2707 that contain no information that will affect a ray and two significant rans 2705; the encoding mn corresponding to mn of voxels 2703(i) will represent that fact as described above. A single ray 2709 is shown traversing the volume. The ray has the X-axis as its major axis; consequently, the encoding mns of interest are those for the X-axis. The ray is further parallel to the z-axis, and is thus completely contained in the encoding mns of slice 2701 throughout its traverse of the volume. The techniques described here can also be used in the case where the ray intersects more than one slice. Ray 2709 intersects a set of rans of ray voxels; one of the rans of ray voxels is shown at 2711; this ran also intersects an encoding ran 2703(1) whose voxels contain information that will affect ray 2709.
The problem of finding an intersection between ray 2709 and a significant mn 2705 of an encoding mn 2703 can be solved by detecting any intersection between the ran from the ray and a significant mn in the list of rans associated with the encoding ran. Given that the list of significant rans from the encoding ran is ordered, the search can be performed efficiently and a number of strategies are possible. The simplest is described in algorithm 2801 of FIG. 28. For each mn of ray voxels belonging to the ray, if the end of the mn of ray voxels is before the start of the significant mn being checked, there is no ray voxel in the ran which is identical with a voxel of the significant ran and a failing result can be returned for that mn of ray voxels. On the other hand, if the start of the ran of ray voxels is before the end of the significant ran being considered, an intersection has occmred and the voxels of the significant ran that also belong to the run of ray voxels must be considered in detail. In algorithm 2801, a linear search is used to locate the intersecting ray voxels and significant ran voxels. As shown in algorithm 2901 in FIG. 29, once it has been determined that there is an intersection, binary search techniques can be used to determine the intersecting ray voxels and significant mn voxels
Using statistical information about a significant portion of an encoding run to accelerate a ray traversal Further acceleration of ray traversal may be achieved by hierarchically grouping encoding mns that lie in the same or adjacent beams of the volume data. A beam is the maximum set of voxels in a slice with the same abscissa or ordinate. Therefore, voxels are arranged into beams, beams are arranged into slices, and slices are arranged into the volume. If the encoding mn has already been divided into significant mns, aggregate information may be maintained about each significant mn. For example, for a maximum intensity projection (MIP) rendering of a volumetric data set, storing the maximum value found within each significant mn would be useful. For a MIP rendering, as the ray intersects a significant mn, the maximum value of the mn can be compared against the current maximum for the ray. If the ray is already at or above the maximum intensity, there is no need to consider the voxels in the significant mn in detail. In many cases, including such statistical information about the mn dramatically reduces the number of times the original data set has to be accessed. The use of aggregate information as just described establishes a hierarchy of information concerning the encoding mn and permits each partition of an encoding mn to be checked in its entirety for relevance to the ray before the intersecting voxels of the ray and the significant mn are checked in detail.
Another example is isosurface rendering in which the surface that corresponds to a given value is reconstmcted from the volumetric data. To reconstruct an isosurface using ray- tracing, each ray is traced through the volume and where it would cross the isosurface is calculated. Therefore if the viewer is external to the volume and the exterior of the volume is assumed to be empty space, the voxel in which one of its neighboring values is greater than the isosurface value is sought. Within this voxel, the ray may cross the isosurface, and if so, the point of the intersection must be calculated. To quickly skip over regions of the volume in which no isosurface intersection can exist, the minimum and maximum values found within each significant mn can be kept. These values can be used to determine if an isosurface intersection can exist in any composite voxel. If not, the entire significant can be skipped.
Efficiency of run-length encoding of voxels
A three-dimensional mn length encoding of a volume provides an 0(kn ) compression of the volumetric data where k is proportional to the mean number of significant rans in the encoding mn lists and n is the size of the volume. Such mns are termed in the following significant runs. The maximum number of significant mns in list cannot exceed n/2 by definition. To traverse the mn length encoding of the volume using the mn-based ray traversal scheme, each run in the path of the ray is intersected with the significant runs in the encoded mn list. As it was implemented, the searching strategy is an 0(k) operation. The procedure in its entirety is therefore 0(n/τ + k). Hence at its worst the behavior of the algorithm is 0(n) when the absolute value of the slope of the two two-dimensional projections of the ray is 1. Typically the behavior will be 0(n/f) as k will typically be much less than n/2.
Organizing an encoding run into sets of partitions of various sizes: FIGs. 30 and 31
The three-dimensional ray traversal algorithm described is very efficient and for most of the rendering functions employed, such as isosurfacing and maximum intensity projection, the cost to process each voxel traversed by the ray is not high. The aim of using spatial subdivisions to accelerate the traversal process is to reduce the amount of the volume that has to be processed and to concentrate the processing performed to that part of the volume that affects the final image. However, if traversing the ray through the spatial subdivision introduces too much overhead, its contribution is limited.
Since only encoding voxels that are intersected by a mn of ray voxels belonging to a particular ray are of interest for the ray's traversal, it is useful to divide the encoding mns into sets of partitions of different sizes. Aggregate information for each partition is maintained, and when a ray traverses a volume, the size of partition that best fits the orientation of the ray is employed.
This is shown in FIG. 30. Shown at 3001 is again a slice of a volume of voxels in which the voxels are associated with data from the Visible Human Project male data set. The data describes the head and neck of a human male. Slice 3001 is a set of voxels that have the full range of x and v coordinates permitted by the volume and a single z coordinate. Ray 2709 intersects slice 3001. The voxels of ray 2709 occur in mns of two lengths: a short mn of 3 voxels is shown at 2711 and a long mn of four voxels is shown at 2612. The encoding mns 3003 have been divided into mn length partitions. The partitions 3005 at the lowest level of the hierarchy each have 4 voxels; each higher-level partition in the hierarchy would contain a greater number of voxels than the previous level. In FIG. 30, the increase in size is based on the powers of two. A partition at a given level k of the hierarchy contains 2k of the lowest-level partitions. Thus, in FIG. 30, partition 3005 contains four voxels, partition 3007 contains two partitions 3005 and therefore 8 voxels, and so forth for 1 < k < 4 . While the partitions of the hierarchy can be related to each other in other ways, use of the powers of 2 makes it easy to calculate the partition sizes.
Ray 2709 has mns of 3 and 4 voxels; consequently, the best size of partition to use for ray 2709's traversal of slice 3001 is partition 3005. Once the proper partition size has been selected, the algorithm is as shown at 3101 in FIG. 31. There are two cases: if the portion of the ray mn being processed extends beyond the partition and if it does not. In the first case, the partition's aggregate data is consulted to determine whether the partition is relevant to the ray; if it is, the voxels of interest in the partition are traversed. Thereupon, the length of the ray ran is decreased by the number of intersecting voxels, and the partition indicator is set to the next partition. In the second case, the partition's aggregate data is again consulted to determine whether the partition is relevant; if it is, the voxels of interest in the partition are traversed. Thereupon, the amount of the partition to be processed is reduced by the length of the ray mn.
Given the mn-based ray traversal algorithm, the problem is therefore how best to traverse the ray through the mn length partitioning and what is the best partition size to use. If the average length of a ray run is a lot smaller than the size of the partition, there will be little gain, as the aggregate statistics associated with the partition represent the entire partition and the number of ray runs that will be rejected is reduced. Further, if the partition size is much larger than the ray ran, the cost and complexity of checking for significant rans in the partition is greater. Therefore, the cost of traversing the partitioning must be balanced with the savings from finding voxels that need not be considered. If dealing with voxels that are relevant to the ray is expensive, it is better to use a small partition size. If that is not the case, a larger partition size can permit a faster traversal algorithm.
A good compromise is to choose a ran-length-partition size that is at least as large as the short ran length in the path of the ray, as was done when a partition size of 4 was chosen in FIG. 30. In this case, the ray at each step will traverse at most two partitions. Therefore, the loop to traverse the run through the partitions can be unrolled into a two-stage process, as is done in algorithm 3101. Efficiency of ray traversal with a partitioned hierarchy of runs
A three-dimensional ran length partitioning of a volume provides an 0(n3/p) compression of the volumetric data where p is the partition size and «3 is the size of the volume. To test a mn against a partitioning, at most \ (rj - )1 p |+ 1 partition checks must be performed.
The order of the ray traversal algorithm is 0(n/τ), where τ is the average run length in the path of the ray. Therefore the ray traversal process through the partitioning is 0(n/min(p, τ )). By choosing τ to be less than or equal to the partition size, the complexity of 0(n/τ) is maintained for the entire traversal process.
Conclusion
The foregoing Detailed Description has disclosed how to use the inventor's techniques for determining the voxels that are intersected by a ray using mns of cells that are intersected by projections of the ray on planes and for determining whether a ray intersects a voxel whose associated data will affect the ray and has further disclosed the best mode known to the inventor of practicing his techniques. It will, however, be immediately apparent to those skilled in the relevant technologies that many other ways of practicing the techniques are possible. For example, the techniques used to determine the cells of the planes that are intersected by the projections are those described in the parents of the present application; however, any other way of determining the cells that are intersected by the projections could be used as well. Similarly, any technique of determining the intersected voxels from the intersected cells could be used in addition to those disclosed herein. With regard to the techniques for determining whether a ray mn traverses a voxel of an encoding mn that affects the ray, any method of encoding that distinguishes significant mns from the remainder of the encoding mn may be used, and aggregate values may be maintained for any useful partition of the encoding runs. Finally, any useful representation of the mns of cells, the mns of voxels, and the encoding mns may be employed.
Since that is the case, the Detailed Description is to be regarded as being in all respects exemplary and not restrictive, and the breadth of the invention disclosed herein is to be determined not from the Detailed Description, but rather from the claims as inteφreted with the full breadth permitted by the patent laws.

Claims

What is claimed is:
1. A method practiced in a computer system of determining voxels in an object space that are intersected by a ray, the method comprising the steps of: making projections of the ray on a plurality of planes in the object space; determining cells in the planes that are intersected by the projections; and using the intersected cells to determine the intersected voxels.
2. The method set forth in claim 1 wherein the step of determining cells in the planes includes the step of: for each projection determining a set of mns of cells that are intersected by the projection.
3. The method set forth in claim 2 wherein: the mns may have an order greater than 1.
4. the method set forth in any one of claims 2 or 3 wherein: the object space has an axis that is the major axis relative to the ray; and in the step of using the intersected cells, at the beginning of the next mn of voxels, if the first-order mns of cells that include the points in the projections coπesponding to the beginning of the next mn of voxels end at the same major axis coordinate, the first-order mns of cells together determine the next mn of voxels through the ends of the first-order mns; and if the first order mns of cells that include the points in the projections corresponding to the beginning of the next mn of voxels do not end at the same major axis coordinate, the shorter first order mn of cells and the corresponding portion of the longer of the first order mns of cells determine the next mn of voxels, whereby the voxels intersected by the ray are 26-connected.
5. The method set forth in claim 4 wherein: in the step of using the intersected cells, an extra cell is added to the beginning of a first order mn of cells prior to using the first order mn of cells to determine a ran of voxels, whereby the voxels intersected by the ray are 6-connected.
6. The method set forth in any one of claims 2 or 3 wherein: in the step of determining a set of rans, the set of mns for a given projection are determined in parallel.
7. The method set forth in any one of claims 2 or 3 wherein: the step of using the intersected cells to determine the intersected voxels further includes the step of determining whether the intersected voxels are edge-connected or corner- connected.
8. The method set forth in claim 7 wherein: in the step of determining whether the intersected voxels are edge-connected or comer connected, if one of the first-order runs of cells has a comer connection at a point and the other first order mn of cells does not have a comer connection at the coπesponding point, the intersected voxels have an edge connection at the coπesponding point.
9. The method set forth in claim 7 wherein: in the step of determining whether the intersected voxels are edge-connected or comer connected, if both of the first-order mns of cells have comer connections at a corresponding point, the intersected voxels have a comer connection at the coπesponding point.
10. The method set forth in claim 1 wherein: the object space has an axis that is the major axis relative to the ray; and the plurality of planes is two planes which intersect along the major axis.
11. The method set forth in claim 10 wherein: the two planes intersect at right angles.
12. A method practiced in a computer system of traversing a volume with a particular ray of a plurality thereof, the volume being subdivided into first mns of voxels, certain of the voxels being associated with data that affects rays, and a ray intersecting one or more of the first mns and being defined as a set of second rans of voxels, and the method comprising the steps of: for a second mn belonging to the particular ray, determining whether the second mn includes a voxel of a first run that affects rays; and when the second ran includes such a voxel, examining the associated data.
13. The method set forth in claim 12 wherein the first mns contain significant mns that include the certain voxels; and the step of determining whether the particular ray's second mn includes a voxel of a first mn that affects rays includes determining whether the second mn includes a voxel of a significant mn.
14. The method set forth in claim 12 wherein: the volume has an axis that is the major axis for both the particular ray and the first mns of voxels.
15. The method set forth in claim 14 wherein: there are three sets of first rans, each set thereof having a different axis of the volume as its major axis.
16. The method set forth in any one of claims 12 through 15 wherein: aggregate information is associated with partitions of the first mns, the aggregate information associated with a partition indicating how one or more voxels in the partition affect rays; and in the step of determining whether second mn includes a voxel of a first mn that affects rays, the aggregate information associated with a partition is used to determine whether the partition contains a voxel that affects the particular ray.
17. The method set forth in claim 16 wherein: a first ran has associated therewith a plurality of sets of partitions, the partitions in each set having a different length in voxels; and the step of determining includes the step of selecting one of the sets of partitions in accordance with the lengths of the second mns in the particular ray.
18. The method set forth in claim 13 wherein: aggregate information is associated with the significant mns, the aggregate information associated with the significant ran indicating how one or more voxels in the partition affect rays; and the step of determining whether second mn includes a voxel of a first mn that affects rays includes using the aggregate information associated with a significant mn to determine whether the significant run contains a voxel that affects the particular ray.
EP03702002A 2002-01-07 2003-01-06 Using runs of cells to traverse a ray through a volume Withdrawn EP1472654A2 (en)

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
US34674102P 2002-01-07 2002-01-07
US346741P 2002-01-07
US24711 2002-08-02
PCT/US2002/024711 WO2003012599A2 (en) 2001-08-03 2002-08-02 Methods and apparatus for determining intersections of a particular line with cells in a lattice
PCT/US2002/039716 WO2003052733A1 (en) 2001-12-13 2002-12-12 Using line structure information to enhance line drawing in digital systems
US39176 2002-12-12
PCT/US2003/000240 WO2003058405A2 (en) 2002-01-07 2003-01-06 Using runs of cells to traverse a ray through a volume

Publications (1)

Publication Number Publication Date
EP1472654A2 true EP1472654A2 (en) 2004-11-03

Family

ID=33158419

Family Applications (1)

Application Number Title Priority Date Filing Date
EP03702002A Withdrawn EP1472654A2 (en) 2002-01-07 2003-01-06 Using runs of cells to traverse a ray through a volume

Country Status (3)

Country Link
EP (1) EP1472654A2 (en)
AU (1) AU2003202890A1 (en)
WO (1) WO2003058405A2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO03058405A2 *

Also Published As

Publication number Publication date
AU2003202890A1 (en) 2003-07-24
WO2003058405A2 (en) 2003-07-17
AU2003202890A8 (en) 2003-07-24
WO2003058405A3 (en) 2004-01-22

Similar Documents

Publication Publication Date Title
Sud et al. DiFi: Fast 3D distance field computation using graphics hardware
US7576743B2 (en) System and method for approximating an editable surface
Zhang et al. 3D finite element meshing from imaging data
Sramek et al. Fast ray-tracing of rectilinear volume data using distance transforms
US8570322B2 (en) Method, system, and computer program product for efficient ray tracing of micropolygon geometry
US7446770B2 (en) Apparatus of and method for drawing graphics, and computer program product
US6850234B2 (en) Method and system for determining visible parts of transparent and nontransparent surfaces of there-dimensional objects
Ogayar et al. Point in solid strategies
JP2002531905A (en) Method of forming perspective drawing from voxel space
US20050116951A1 (en) Using runs of cells to traverse a ray through a volume
Dobkin Computational geometry and computer graphics
Horvat et al. Ray-casting point-in-polyhedron test
US7289117B2 (en) Process for providing a vector image with removed hidden lines
EP1472654A2 (en) Using runs of cells to traverse a ray through a volume
Sud et al. Interactive computation of discrete generalized voronoi diagrams using range culling
US20040189641A1 (en) Method and apparatus for determining intersections of a particular line with cells in a lattice
US20050001840A1 (en) Using line struture information to enhance line drawing in digital systems
Crosnier et al. Tribox bounds for three-dimensional objects
Sud et al. Fast distance field computation using graphics hardware
Mesquita et al. Non-overlapping geometric shadow map
WO2003052733A1 (en) Using line structure information to enhance line drawing in digital systems
Gregorski et al. Multiresolution representation of datasets with material interfaces
Wood Improved isosurfacing through compression and sparse grid orientation estimation
JP2006524384A (en) Method and system for filling in a parallelogram
Gorte et al. Sweeping raster cross sections along trajectories in three-dimensional voxel models

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20040806

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LI LU MC NL PT SE SI SK TR

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION HAS BEEN WITHDRAWN

18W Application withdrawn

Effective date: 20070309