The invention pertains to digital data processing and, more particularly, to image and signal processing and, still more particularly, by way of non-limiting example, to image processing operations that are based on convolution. The invention has application, by way of non-limiting example, in medical imaging, microscopy, and geo-sciences, to name but a few fields.
Convolution is an important image and signal processing operation. It is used, for example, in image reconstruction, image enhancement, and feature detection, among other critical operations. A formal statement of the challenge faced by designers of image and signal processing that perform convolution is as follows.
Given a digital image of size Nx×NyI(x,y), x=0, . . . , Nx−1, y=0, . . . , Ny−1, and a discrete filter kernel K(x,y), x=0, . . . , NxK−1, y=0, . . . , NyK−1 of size NxK×NyK, convolve or filter the image with that discrete filter kernel in accord with the formula:
This formula evaluates the digital image outside its domain to compute output values near the boundaries. Depending on the application, different approaches for the boundary treatment may be chosen including defining pixels outside the domain to be a constant value, mirroring of the image, wrapping around or constant continuation.
For sake of simplicity, the challenge or problem statement, above, is expressed with respect to 2D images, as is (again, for sake of simplicity) much of the discussion in the sections below. However, as will be appreciated from the text below, both the challenge and the inventive solutions provided hereby can be applied to 1D as well as 3D or higher dimensions.
In view of the foregoing, an object of the invention is to provide improved methods and apparatus for digital data processing and particularly, for example, for image and signal processing.
A further object of the invention is to provide such methods and apparatus as provide improved performance of image and signal and signal processing operations based on convolution. A related object of the invention is to provide such methods and apparatus as provide for convolution or filtering of digital image data with discrete kernels.
Yet further objects of the invention are to provide such methods and apparatus as can be implemented at lower cost and, yet, as provide optimal performance.
A related object of the invention is to provide such methods and apparatus as can be implemented using standard, off-the-shelf components.
The foregoing are among the objects attained by the invention, which provides, in some aspects, methods and apparatus for signal and/or image processing which perform convolution-based filtering utilizing a graphics processing unit (GPU, also called “graphics card”) to compute multiple output pixels at once. This has the advantage of saving memory bandwidth, while leveraging the GPUs vector multiplication and dot product units during the calculation.
Related aspects of the invention provide such methods and apparatus as are implemented on a GPU having programmable vertex shaders and programmable pixel shaders. Further related aspects of the invention provide such methods and apparatus in which multiple output pixels are computed simultaneously by using render targets with more than one channel, e.g., an RGBA render target, or multiple render targets, or a combination thereof.
Further aspects of the invention provide such methods and apparatus wherein a filter implemented on such a GPU performs convolution with a 9×1 kernel, by way of non-limiting example, by executing the steps of defining input image I(x,y) as input texture of size Nx×Ny; defining an RGBA render target (output) of size Nx/4×Ny; and, for each RGBA output pixel aggregating o(x,y) by (i) reading all input pixels I(x*4+i,y), with i=−4,0,4, and computing o(x,y) for the all four components of the output tuple.
Still further related aspects of the invention provide such methods and apparatus wherein the GPU is utilized to multiply two four-vectors and add the result to another four-vector in one operation. In these and other aspects of the invention, the input can be packed into RGBA (or other) tuples thereby saving read operations.
According to further related aspects of the invention, methods and apparatus as described above can store the filter kernel as constants in registers in pixel shaders of the GPU. Alternatively, or in addition, the kernel can be stored in a separate texture.
Further aspects of the invention provide methods and apparatus as described above in which output aggregation varies with kernel size, GPU hardware and/or driver software selection (e.g., maximum number of simultaneous outputs supported, maximum number of instructions allowed in a pixel shader, and/or maximum number of constants or registers available to store the kernel values, among other factors).
Yet other aspects of the invention provide methods and apparatus as described above which computes 1D convolutions, as well as 3D and higher-order convolutions. Such methods and apparatus for 1D convolutions can, by way of example, store multiple lines in one input image and, then, to process that image in the manner described above as a convolution of a 2D input image with a 1D kernel. Such methods and apparatus for 3D convolutions can use correspondingly dimensioned input texture and/or, alternatively, of a set of n lower dimensional textures. Still further, multiple slices of a volume can be packed into a lower dimensional texture in a tile-like fashion.
Yet still other aspects of the invention provide such methods and apparatus as provide optimized filtering using separable kernels. This can be achieved, for example, by using the results of row-wise convolutions as inputs to column-wise convolution and, more particularly, by treating convolution with the 2D filter kernel as equivalent to a 1D convolution of the rows of the image with Kx(·), followed by a 1D convolution of the columns with Ky(·), where those 1D convolutions are executed as described above.
In further related aspects of the invention, such methods and apparatus further optimize filtering with separable kernels by first computing the row-wise convolution, transposing the image, then performing a second row-wise convolution with Ky, followed by another transpose operation.
Still further aspects of the invention provide methods and apparatus of signal and/or image processing which perform convolutions involving constant filter kernels. Such methods and apparatus capitalize on the separable nature of constant filter kernels by implementing a recursive computation methodology (e.g., a “box car convolution”), e.g., on a GPU with programmable vertex shaders and programmable pixel shaders, yet, ensuring correct order of processing.
Related aspects of the invention provide such methods and apparatus as, in effect, draw vertical lines from left to right covering one column of the render target each. More particularly, these execute the steps of defining image I(x,y) as input texture Nx×Ny; defining a render target (output) of same size; defining render target as second input texture; initializing column 0 (leftmost) of render target with correct output values; for column 1 . . . Nx−1: for each pixel o(x,y) in that column read value o(x−1,y) from render target (second input texture); read
and
write out o(x,y)=o(x−1,y)+i1−i2.
Related aspects of the invention provide methods and apparatus as described above in which orderly processing order of pixels by the GPU is ensured by one or more of the following: sending a “flush” command after each line drawn; inserting “fence tokens” into the stream of commands sent to the GPU and querying for their them; using multiple render targets and swapping them after each line is drawn; correcting sporadically miscalculated pixels in subsequent render passes; issuing dummy geometry after each line; working with multiple advancing fronts.
Still further aspects of the invention provide methods and apparatus as described above in which parallelization in the GPU is exploited for efficiency by, instead of initializing the left-most column, initializing multiple columns spread across the image. Recursive computation is performed by drawing lines advancing from these seedlines.
Yet still further aspects of the invention provide methods and apparatus as described above in which hardware filtering on the GPU is utilized to decrease the number of instructions in the convolution filter code, leveraging additional hardware in the graphics device and further accelerating the filtering process. In related aspects of the invention, this additional filtering is carried out in parallel with calculations occurring within the pixel shaders. As a result, by way of example, according to some aspects of the invention, an entire 1D convolution can be calculated in a single pass.
Further aspects of the invention provide methods and apparatus as described above in which the operations ascribed above to a single GPU are carried out by multiple GPUs or other processing elements (such as array processors, game engine processors, and so forth).
These and other aspects of the invention are evident in the drawings and in the text that follows.
A more complete understanding of the invention may be attained by reference to the drawings, in which
Described below are methods and apparatus according to the invention which perform convolution filtering of signal and image data by utilizing a graphics processing unit (GPU, also called “graphics card”) to compute multiple output pixels at once, thereby saving memory bandwidth and leveraging the GPUs vector multiplication and dot product units during the calculation. Also described are methods and apparatus according to the invention which implement the well known “box car” convolution on a GPU for the special case of a constant filter.
The methods and devices described herein have numerous applications, for example, in medical imaging such as computed tomography (CT), position emission tomography (PET), single photon emission computed tomography (SPECT), and other medical applications. Non-medical applications, not limited to examples such as geo-sciences, microscopy, general computer tomography and confocal microscopy, can also utilize aspects of the present invention.
Such methods can be implemented in an imaging and digital processing environment of the type disclosed in copending, commonly assigned U.S. patent application Ser. No. 10/756,172, filed Jan. 12, 2004, entitled Improved Methods and Apparatus for Back-Projection and Forward-Projection, and specifically, in FIG. 1 thereof and the corresponding text, e.g., at page 7, line 14 through page 8, line 26, the teachings (including illustration) of which are incorporated herein by reference. Although that figure and the text refer, by way of example, to mammography systems and computed tomosynthesis, it will be appreciated that the invention hereof and its embodiments are more broadly applicable to the full range of medical (and non-medical) imaging applications and techniques, such as, by way of non-limiting example, geo-sciences, or microscopy, computer tomographs, magnetic resonance imaging devices, or confocal microscopes, to name just a few.
It will be further appreciated that methods as described above, when implemented in an imaging and digital processing environment of the type disclosed in the aforementioned incorporated-by-reference application, form apparatus according to practice of the present invention.
In view of the foregoing,
The system 10 includes an image acquisition apparatus 12 that generates multiple projection images 14 of an object 16 in a volume 18. In the illustrated system, this is accomplished in the conventional manner, e.g., by illuminating the object 16 with radiation from a source 22 and detecting by a detector 20, such as a charged-coupled device or other 2D sensor array, radiation not absorbed by the object 16. Generally, multiple projection images obtained at different respective angles are required for reconstructing a three-dimensional representation of the object. Such projection images can be captured by moving the source and/or the detector around the volume 16 to illuminate the object from different angles and to detect a portion of the illuminating radiation that is not absorbed by the object.
In the system of
To continue those examples, however,
Referring again to
Reconstruction of the volume from the projected images can be achieved by a number of mathematical reconstruction techniques. One non-limiting example is filtered back projection. In this technique, the various projections are summed with a weighting factor that acts to “filter” artifacts. In such an instance, Equation (1) can be used to implement the filtering, with I(x,y) acting as the projection image data and K(x,y) being the filtering function. Accordingly, embodiments of the present invention can be utilized to perform the filtered back projection operation; however, as noted previously, embodiments of the invention can be applied in a variety of other imaging operations—for reconstruction or otherwise.
Illustrated digital data processor 26 is a workstation, personal computer, mainframe, or other general or special-purpose computing device of the type conventionally known in the art, albeit adapted as discussed below for processing projections 14, including exercise of method and apparatus for convolution according to the invention. As shown in the drawing, it includes a central processing unit (CPU) 30, dynamic memory (RAM) 32, and I/O section 34, all of the type conventionally known the art. The digital data processor 26 may be coupled, via I/O section 34, with a monitor or other graphical display or presentation device 28, as shown.
Illustrated digital data processor 26 also includes a graphical processing unit (GPU) 36 that is coupled to the CPU 30, through which it can access the other elements of the digital data processor 26, as shown. In one embodiment, the GPU 36 serves as a coprocessor, operating under the control of the CPU 30 to convolve the imaging data, e.g., while reconstructing the volume 18 from the measured projection images. Other embodiments of the invention employ multiple GPUs for this purpose, each responsible for a respective portion of the convolution process. The GPU 30 is preferably of the variety having programmable vertex shaders and programmable pixel shaders that are commercially available from ATI research (for example, the Radeon™ 9700 processor), NVIDIA (for example, the GeForce™ FX and Quadro® processors). However, it will be appreciated that the invention can be practiced with processing elements other than commercially available GPUs. Thus, for example, it can be practiced with commercial, proprietary or other chips, chipsets, boards and/or processor configurations that are architected in the manner of the GPUs (e.g., as described below). It can also be practiced on such chips, chipsets, boards and/or processor configurations that, though of other architectures, are operated in the manner of GPUs described herein.
Components of the digital data processor 26 are coupled for communication with one another in the conventional manner known in the art. Thus, for example, a PCI or other bus 38 or backplane (industry standard or otherwise) may be provided to support communications, data transfer and other signaling between the components 30-36. Additional coupling may be provided among and between the components in the conventional manner known in the art or otherwise.
A typical architecture of the GPU 36 suitable for use in the practice of the invention is shown by way of expansion graphic in
Local memory 44 supports both the short-term and long-term storage requirements of the GPU 36. For example, it can be employed to buffer the projection image data 14, iterative estimates of the density distribution of the volume under reconstruction, forward-projection images generated based on those estimates as well as parameters, constants and other information (including programming instructions for the vector processors that make up the mapping and pixel processing sections).
In the illustrated embodiment, the mapping section 40 comprises a plurality of programmable vertex shaders 60-66 that generate mappings between the coordinate space of the projection images and that of the volume 18. For example, the vertex shaders map each pixel in a projection image to one or more voxels in the volume. The pixel processing section comprises a plurality of pixel shaders 80-94 that can adjust pixel intensities in forward-projection images generated from estimates of the density distributions of the volume, e.g., based on comparison of the forward-projection images with respective measured projection images, and to modify density values of voxels in the volume to reflect back-projection of those forward-projection images, as discussed in more detail below.
DMA engines 68 and 96 provide coupling between the local bus 46 and, respectively, the vertex shaders 60-66 and pixel shaders 80-94, facilitating access by those elements to local memory 44, interfaces 48, 50, or otherwise. A further DMS engine 98 provides additional coupling between the pixel shaders 80-94 and the bus 46. In addition, filters (labeled “F”) are coupled between the DMA engine 96 and the pixel shaders 80-94, as illustrated. These perform interpolation, anisotropic filtering or other desired functions. Also coupled to the vertex shaders 60-66 are respective iterators (labeled “I”), as illustrated. Each iterator generates addresses (in volume space) for the voxels defined by the corresponding vertex shaders 60-66.
With this context, described below are methods for operation of GPU 36 or other suitable processing elements, as described above. Those skilled in the art will appreciate how the elements referred to in the discussion below map to elements of the GPU (as well as to corresponding components of other suitable processing elements).
Example Case: 9×1 Filter
We first describe a simplistic implementation of a convolution filter on a GPU for the special case of a filter kernel with dimensions 9×1. Similar simplistic implementations have been proposed in the prior art. We then explain how systems and methods according to the invention implement the filter differently, thus, highlighting its operation and innovations. Then we explain the generalisation to other kernel.
Simplistic convolution on GPU can be accomplished as follows:
1. Define image I(x,y) as input texture of size Nx×Ny
2. Define a render target (output) of same size
3. For each output pixel o(x,y)
Convolution According to Practices of the Invention
In contrast, systems and methods according to the invention utilize a convolution filter with a significantly more efficient implementation. Thus, for example, that filter computes multiple output pixels at once. This can be realized by using render targets with more than one color channel, e.g., an RGBA render target, or multiple render targets, or a combination thereof.
Continuing the above example, a filter according to the invention utilizing a 9×1 kernel can be implemented on a GPU (e.g., GPU 36) for fast convolution by executing the steps of:
1. Define image I(x,y) as input texture of size Nx×Ny
2. Define an RGBA render target (output) of size Nx/4×Ny
3. For each RGBA output pixel aggregate o(x,y)
Modern GPU hardware, that is, graphics processing units having programmable vertex shaders and programmable pixel shaders (e.g., the offerings of ATI Research and Nvidia referred to in incorporated-by-reference U.S. patent application Ser. No. 10/756,172, or otherwise described in that application), are beneficially employed in systems and methods according to the invention to multiply two four-vectors and add the result to another four-vector in one operation (MAC). Thus the computation of one output value only requires three such operations plus one dot-product with a four-vector of ones to perform the final sum. As a further optimization, the input can be packed into RGBA tuples, as depicted in
Aspects of the example of
To calculate the output data points corresponding to o8, o9, o10, and o11 , Equation (1) can be applied to give the following relationship in terms of the scalar input data points, filter values, and scalar output data points:
The output data points can also be calculated using vector operations, as employed with by a GPU for example. The input data points can be arranged as input vectors IV0, IV1, IV2, . . . , where each input vector IVj has 4 corresponding input data points: [iv(4*j), iv(4*j+1), iv(4*j+2), iv(4*j+3)]. As well, the filter values that are used to convolute the input data points can also be arranged in a set of filter vectors KV0, KV1, KV2, . . . , KV10, KV11, where each filter vector has four components given as shown in
TV8=TV8+IVj*KV(j−1)
TV9=TV9+IVj*KV(3+j−1)
TV10=TV10+IVj*KV(6+j−1)
TV11=TV11+IVj*KV(9+j−1)
where each equation represents a float4 multiplication of two vectors and a vector summation, which can be performed as a single operation by a GPU. After all three input vectors IV1, IV2, and IV3 have been read, and used to create TV8, TV9, TV10, and TV11, the temporary vectors can be converted to corresponding output data values using the following dot product relationships:
o8=dot(TV8,[1,1,1,1])
o9=dot(TV9,[1,1,1,1])
o10=dot(TV10,[1,1,1,1])
o11=dot(TV11,[1,1,1,1])
As well, the output data points themselves can be stored in a corresponding output data vector.
The foregoing example clearly illustrates the advantage of systems and methods according to the invention. While prior art implementations of the type described earlier require nine read accesses for each output pixel produced, convolutions filters according to the invention require twelve reads for four output pixels, i.e., three reads per output pixel. This three-fold improvement in memory bandwidth utilization results in significantly improved performance. In addition, reading four pixels at a time decreases the number of texture reads and instructions within the shader, which are both limited on some architectures. This becomes increasingly important when processing multiple lines of the filter per pass in multi-dimensional filters.
In preferred embodiments of the invention, e.g., implementations of a 9×1 convolution according to the invention as described above, the filter kernel is encoded as constants in registers in pixel shaders of the GPU. Where this is not possible or not desired, e.g., for very large kernels, the kernel can be stored in a separate texture. Note that respective memory bandwidth savings apply for the kernel read access as well in the fast implementation.
General Kernel Sizes
Those skilled in the art will appreciate that systems and methods according to the invention are not restricted to 9×1 kernels nor to one dimensional kernels. For a given kernel size there are often different possible patterns of output aggregation. For illustration some examples are listed below:
The choice of the configuration for a given kernel size depends on the specific GPU hardware and driver software used. For example, GPUs currently available in the marketplace have limitations with respect to the maximum number of simultaneous outputs supported, e.g. four render targets of at most four channels each, i.e., sixteen simultaneous outputs. Furthermore the maximum number of instructions allowed in a pixel shader, the maximum number of constants or registers available to store the kernel values, the particular memory and cache subsystem design, the available input and output data type formats, as well as other properties of the GPU hardware and driver software influence performance. Therefore, where optimal performance is required, the best possible configuration for a given platform is determined by thorough analysis or empirically by benchmarking the different possible configurations. Such benchmark can be performed at run time.
It should be pointed out that the filtered image computed via GPU-based convolution according to the invention will be distributed across multiple render targets and/or across the RGBA tuples of a four-component render target. For many subsequent operations this is not a restriction. For example, for direct display it doesn't matter if the intensity values to be displayed are read from a single one-component texture or from multiple input textures, possibly with packed RGBA tuples. Where necessary, the filtered image can be copied into a single one-component texture in an additional render pass.
Generalization to 1D, 3D and Higher Dimensions
The described method can be generalized to 1D convolution by choosing the input and output images to be one pixel high. However, still further improved methods are provided for the case that multiple one dimensional convolutions need to be performed on input vectors of the same size. In these cases, it can be advantageous to store multiple lines in one input image and, then, to process that image in the manner described above as a convolution of a 2D input image with a 1D kernel. Because of the memory cache design and the way parallel execution of pixel shaders occurs on current generation GPU hardware, this can increase performance.
In order to generalize to 3D or higher dimensionalities, 3D or higher dimensional input textures are used. Since current-generation GPU hardware does not necessarily support 3D or higher dimensional input textures, a set of n lower dimensional textures can be used instead, or multiple slices of a volume can be packed into a lower dimensional texture in a tile-like fashion. The same applies to the output (render targets).
Separable Kernels
Embodiments of the invention can be configured to treat still more efficiently separable filter kernels, i.e., ones that can be written in the form of
K(x,y)=Kx(x)Ky(y)
In such a case the convolution with the 2D filter kernel is equivalent to a 1D convolution of the rows of the image with Kx(·), followed by a 1D convolution of the columns with Ky(·). As described in the previous section the proposed method applies to 1D convolutions as well. Therefore, an efficient implementation for separable kernels is possible, by using the result of the row-wise convolution as input to a second column-wise convolution.
In some embodiments, the output of the first pass (row-wise convolution) is distributed across multiple render targets and/or stored in RGBA tuples that span multiple horizontally neighboring pixels. This has to be taken into account for the second pass (column-wise convolution). It can be done by either reading from multiple render targets, or by operating on those horizontal RGBA tuples and thereby computing the convolution for four columns at once, or by performing an intermediate data reorganization pass.
Depending on kernel size, image size and hardware architecture, a further performance improvement is achieved in some embodiments by first computing the row-wise convolution, transposing the image, then performing a second row-wise convolution with Ky, followed by another transpose operation.
The same applies to separable 3D or higher dimensional filter kernels.
Constant Filter Kernels
Embodiments of the invention can also be configured to process still more efficiently cases involving constant filter kernels. Here the result of the convolution is the (scaled) average of the neighbours of a pixel in a neighborhood of size NxK×NyK.
The methods for convolution with constant filter kernels described below can, like those discussed above, be implemented in an imaging and digital processing environment of the type disclosed in copending, commonly assigned U.S. patent application Ser. No. 10/756,172, filed Jan. 12, 2004, entitled Improved Methods and Apparatus for Back-Projection and Forward-Projection, and specifically, in
A constant filter kernel is always separable. We therefore first focus on one dimensional kernels again. An interesting observation is that the output value of a pixel can be computed from the output value of its left neighbour with only a small correction term, as expressed by the following relation:
Of course, the processing does not necessarily need to proceed from left to right, but may also be right to left. Additionally, the other dimension can also be processed first (top to bottom or bottom to top). For illustrative purposes, in the present description, we'll choose a left-to-right implementation for the first pass and a top-to-bottom implementation for the second pass.
By taking advantage of this observation, a recursive computation scheme can be implemented which in the limit, only requires two memory reads and two additions per output pixel. In particular for larger filter kernels this can be a significant saving compared to straight-forward computation of each output pixel independently. This optimization is well known for central processor unit-based (CPU) implementations and is often referred to as the boxcar algorithm. The implementation of the boxcar filter on a GPU, however, is not straightforward because outputs are generated in parallel and out-of-order on the GPU. Simply reading the left neighbour will produce erroneous results since it may not have been computed yet. The following describes the convolution of a 2D image with a NxK×1 constant filter kernel, ensuring a correct order of processing, generation of correct results and excellent performance.
Embodiments of the invention implementing the boxcar filter force generation of the output pixels in a defined sequential order. Whereas a simplistic implementation of this type of algorithm would be to draw one (or few) large polygons to cover the entire render target and read the left result within the pixel shader, this produces erroneous results in the case of a GPU because of the inherent out-of-order processing of the GPU. The solution provided in embodiments of the invention is to draw vertical lines from left to right covering one column of the render target each:
1. Define image I(x,y) as input texture Nx×Ny
2. Define a render target (output) of same size
3. Define render target as second input texture
4. Initialize column 0 (leftmost) of render target with correct output values
5. For column 1 . . . Nx−1 do
and
It will be appreciated that the pixels are processed in left-to-right order, because the computation of one output pixel value relies on the previously computed value for its left neighbour. Depending on the specific hardware and drivers used, sending lines into the graphics pipeline in left-to-right order may not guarantee the right processing order on the pixel level. Current GPUs have a large number of pixel shaders that compute output pixels simultaneously. The order and pattern in which those pixels are computed varies with hardware and driver types and versions and is currently not defined in API standards like DirectX or OpenGL.
Listed below are multiple ways to force correct execution order. Which one is the most efficient depends on the specific hardware and driver.
Multiple Lines at Once
The parallelization in the GPU can in some cases be more efficient if the following modified method is used: Instead of only initializing the left-most column, multiple columns, spread across the image are initialized. Then, the recursive computation is performed by drawing lines advancing from these seedlines. Example: For an image with 100 columns one can have four simultaneously advancing fronts by initializing columns 0,24,49,74 and then drawing columns 1,25,50,75,2,26,51,76,
Such a methodology can not only improve performance, but also help avoiding execution order issues, as pointed out above.
Encoding the Filter Kernel in the Texture Address
In the embodiments described above, the input data has been point sampled and the kernels applied by a discrete multiplication within the pixel shader's vector processor. The GPU also includes hardware which is able to perform various filtering operations before the data is read into the vector processors. This hardware filtering can be taken advantage of to decrease the number of instructions in the filter code, leveraging additional hardware in the graphics device and further accelerating the filtering process. Additionally, since this operation is performed outside the pixel shader, these calculation may be carried out in parallel with calculations occurring within the pixel shader.
If the two adjacent filter kernel elements Kn and Kn+1 are both between 0 and 1 (inclusive) and sum to 1, Kn+1 can be used as the pixel address offset from the center of pixel Pm. If linear interpolation is then enabled in the sampler, the net effect is that the pixel read into the shader is Pm*Kn+Pm+1*Kn+1. This operation is performed in hardware prior to the data entering the pixel shader's vector registers and does not require any pixel shader instructions.
If the adjacent kernel values do not meet the aforementioned range and sum criteria, a scaling can be performed to enable this method. If we define S to be S=1/(Kn+Kn+1), then the address offset is S*Kn+1, which again would be calculated in the vertex shader (no additional instructions in the pixel shader). This does however, require that a multiplication by the constant 1/S be performed within the pixel shader to recover the result. Even with the introduction of this multiplication, this still results in fewer instructions then discretely reading the two samples, performing two multiplications and an add.
This method can be used to calculate an entire 1D convolution in a single pass: the vertex shader calculates the appropriate addresses for each kernel pair and they are passed through to the pixel shader. The pixel shader then performs a single sample for each kernel pair, summing the result and performing the 1/S multiplications where necessary.
Since the GPU can perform linear interpolation in multiple dimensions (e.g., 1D, 2D and 3D as described above), this method is readily extensible to higher dimensions. Additionally, as GPUs add additional hardware to perform more complex filtering in hardware, this method can be employed if the kernel accommodates it.
A further understanding of the foregoing may be appreciated by reference to the following publications, the teachings of which are incorporated herein by reference, the citation of which is not intended as, nor shall it be deemed, an admission that any or all of them is/are prior art: I. Viola, A. Kanitsar, E. Gröller, Hardware-Based Nonlinear Filtering and Segmentation using High-Level Shading Languages, Technical Report TR-186-2-03-07, May 2003, Vienna University of Technology; M. Hopf, T.Ertl, Accelerating 3D Convolution using Graphics Hardware, Proc. IEEE Visualization 1999, pp 471-474.
Described above are methods and apparatus meeting the objects set forth herein. Those skilled in the art will appreciate that the embodiments described above are merely examples of the invention and that other embodiments, incorporating changes thereto, fall within the scope of the invention. Thus, for example, it will be appreciated that in the embodiments described above, the GPU serves as a coprocessor, operating under the control of a CPU. Other embodiments of the invention employ multiple GPUs for this purpose, each responsible for a respective portion of processing. Still other embodiments use no GPU at all, relying on other types of processing elements (such as array processors, game engine processors, and so forth) to provide or supplement such processing, all in accord with the teachings hereof. In embodiments which use GPUs, e.g., as described above, preferred such devices are of the variety having programmable vertex shaders and programmable pixel shaders and are commercially available in the marketplace from ATI Research (for example, the Radeon™ 9700 processor), Nvidia (for example, the GeForce™ FX and Quadro® processors) and/or otherwise compatible with methods according to the invention discussed herein.
This application claims the benefit of a U.S. Provisional Patent Application Ser. No. 60/675,067, filed Apr. 26, 2005, the teachings of which are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
4746795 | Stewart et al. | May 1988 | A |
4984160 | Saint Felix et al. | Jan 1991 | A |
5128864 | Waggener et al. | Jul 1992 | A |
5218534 | Trousset et al. | Jun 1993 | A |
5241471 | Trousset et al. | Aug 1993 | A |
5253171 | Hsaio et al. | Oct 1993 | A |
5287274 | Saint Felix et al. | Feb 1994 | A |
5307264 | Waggener et al. | Apr 1994 | A |
5375156 | Kuo-Petravic et al. | Dec 1994 | A |
5412703 | Goodenough et al. | May 1995 | A |
5412764 | Tanaka | May 1995 | A |
5442672 | Bjorkholm et al. | Aug 1995 | A |
5602892 | Llacer | Feb 1997 | A |
5633951 | Moshfeghi | May 1997 | A |
5671265 | Andress | Sep 1997 | A |
5734915 | Roewer | Mar 1998 | A |
5813988 | Alfano et al. | Sep 1998 | A |
5821541 | Tumer | Oct 1998 | A |
5825842 | Taguchi | Oct 1998 | A |
5909476 | Cheng et al. | Jun 1999 | A |
5930384 | Guillemaud et al. | Jul 1999 | A |
5931789 | Alfano et al. | Aug 1999 | A |
5960056 | Lai | Sep 1999 | A |
5963612 | Navab | Oct 1999 | A |
5963613 | Navab | Oct 1999 | A |
5963658 | Klibanov et al. | Oct 1999 | A |
6002739 | Heumann | Dec 1999 | A |
6018562 | Willson | Jan 2000 | A |
6044132 | Navab | Mar 2000 | A |
6049582 | Navab | Apr 2000 | A |
6088423 | Krug et al. | Jul 2000 | A |
6108007 | Shochet | Aug 2000 | A |
6108576 | Alfano et al. | Aug 2000 | A |
6264610 | Zhu | Jul 2001 | B1 |
6268846 | Georgiev | Jul 2001 | B1 |
6282256 | Grass et al. | Aug 2001 | B1 |
6289235 | Webber et al. | Sep 2001 | B1 |
6304771 | Youdh et al. | Oct 2001 | B1 |
6320928 | Vaillant et al. | Nov 2001 | B1 |
6324241 | Besson | Nov 2001 | B1 |
6377266 | Baldwin | Apr 2002 | B1 |
6404843 | Vaillant | Jun 2002 | B1 |
6415013 | Hsieh et al. | Jul 2002 | B1 |
6470067 | Harding | Oct 2002 | B1 |
6475150 | Haddad | Nov 2002 | B2 |
6507633 | Elbakri et al. | Jan 2003 | B1 |
6510241 | Vaillant et al. | Jan 2003 | B1 |
6519355 | Nelson | Feb 2003 | B2 |
6615063 | Ntziachristos et al. | Sep 2003 | B1 |
6636623 | Nelson et al. | Oct 2003 | B2 |
6697508 | Nelson | Feb 2004 | B2 |
6707878 | Claus et al. | Mar 2004 | B2 |
6718195 | Van Der Mark et al. | Apr 2004 | B2 |
6731283 | Navab | May 2004 | B1 |
6741730 | Rahn et al. | May 2004 | B2 |
6744253 | Stolarczyk | Jun 2004 | B2 |
6744845 | Harding | Jun 2004 | B2 |
6745070 | Wexler et al. | Jun 2004 | B2 |
6747654 | Laksono et al. | Jun 2004 | B1 |
6754299 | Patch | Jun 2004 | B2 |
6765981 | Heumann | Jul 2004 | B2 |
6768782 | Hsieh et al. | Jul 2004 | B1 |
6770893 | Nelson | Aug 2004 | B2 |
6771733 | Katsevich | Aug 2004 | B2 |
6778127 | Stolarczyk et al. | Aug 2004 | B2 |
6919892 | Cheiky et al. | Jul 2005 | B1 |
7006881 | Hoffberg et al. | Feb 2006 | B1 |
7027662 | Baron | Apr 2006 | B2 |
7180074 | Crosetto | Feb 2007 | B1 |
20010026848 | Van Der Mark et al. | Oct 2001 | A1 |
20020099290 | Haddad | Jul 2002 | A1 |
20020123680 | Vaillant et al. | Sep 2002 | A1 |
20020138019 | Wexler et al. | Sep 2002 | A1 |
20020150202 | Harding et al. | Oct 2002 | A1 |
20020150285 | Nelson | Oct 2002 | A1 |
20030031352 | Nelson et al. | Feb 2003 | A1 |
20030065268 | Chen et al. | Apr 2003 | A1 |
20030103666 | Edic et al. | Jun 2003 | A1 |
20030123720 | Launay et al. | Jul 2003 | A1 |
20030194049 | Claus et al. | Oct 2003 | A1 |
20030220569 | Dione et al. | Nov 2003 | A1 |
20040010397 | Barbour et al. | Jan 2004 | A1 |
20040015062 | Ntziachristos et al. | Jan 2004 | A1 |
20040022348 | Heumann | Feb 2004 | A1 |
20040066891 | Freytag et al. | Apr 2004 | A1 |
20040102688 | Walker et al. | May 2004 | A1 |
20040125103 | Kaufman et al. | Jul 2004 | A1 |
20040147039 | Van Der Mark et al. | Jul 2004 | A1 |
20040162677 | Bednar et al. | Aug 2004 | A1 |
20050152590 | Thieret et al. | Jul 2005 | A1 |
20050270298 | Thieret | Dec 2005 | A1 |
Number | Date | Country |
---|---|---|
103 17 384 | Apr 2004 | DE |
0 492 897 | Jul 1992 | EP |
0 502 187 | Sep 1992 | EP |
0 611 181 | Aug 1994 | EP |
0 476 070 | Aug 1996 | EP |
0 925 556 | Jun 1999 | EP |
0 953 943 | Nov 1999 | EP |
0 964 366 | Dec 1999 | EP |
1 087 340 | Mar 2001 | EP |
00953943 | Jul 2004 | EP |
WO 9016072 | Dec 1990 | WO |
WO 9102320 | Feb 1991 | WO |
WO 9205507 | Apr 1992 | WO |
WO 9205507 | Apr 1992 | WO |
WO 9642022 | Dec 1996 | WO |
WO 9810378 | Mar 1998 | WO |
WO 9812667 | Mar 1998 | WO |
WO 9833057 | Jul 1998 | WO |
WO 0120546 | Mar 2001 | WO |
WO 0134027 | May 2001 | WO |
WO 0163561 | Aug 2001 | WO |
WO 0163561 | Aug 2001 | WO |
WO 0174238 | Oct 2001 | WO |
WO 0185022 | Nov 2001 | WO |
WO 0241760 | May 2002 | WO |
WO 02067201 | Aug 2002 | WO |
WO 02082065 | Oct 2002 | WO |
WO 03061454 | Jul 2003 | WO |
WO 03088133 | Oct 2003 | WO |
WO 03090171 | Oct 2003 | WO |
WO 03098539 | Nov 2003 | WO |
WO 2004019782 | Mar 2004 | WO |
WO 2004020996 | Mar 2004 | WO |
WO 2004020997 | Mar 2004 | WO |
WO 2004034087 | Apr 2004 | WO |
WO 2004044848 | May 2004 | WO |
WO 2004066215 | Aug 2004 | WO |
WO 2004072906 | Aug 2004 | WO |
Number | Date | Country | |
---|---|---|---|
60675067 | Apr 2005 | US |