Computer-implemented method for generating a glyph representation for use in a rendering process
The method generates a glyph representation that encodes both foreground and background information efficiently, addressing performance issues in glyph rendering with visual effects, enhancing readability in medical imaging.
Patent Information
- Application Number
- DE102024208244
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-05
AI Technical Summary
Existing glyph rendering methods using glyph atlases compromise performance when applying visual effects like shadows due to increased computational and storage costs.
A method for generating a glyph representation that encodes both foreground and background information efficiently by setting first and second indices based on quantization and geometric relationships, allowing pre-calculated visual effects without additional memory overhead.
Enables efficient rendering of glyphs with visual effects, reducing computational and storage costs while maintaining readability, particularly in medical imaging applications.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[0001] The present invention relates to a computer-implemented method for generating a glyph representation for use in a rendering process and a computer-implemented method for using such a glyph representation to render a glyph. The present invention further relates to a set of machine-readable instructions for implementing the method, a machine-readable medium comprising such instructions, and an apparatus for implementing the method.
[0002] In computer-implemented rendering, such as text rendering, glyph atlases are commonly used to achieve better performance. A glyph atlas can be a 2D memory buffer that stores pre-rendered glyphs from which output text can be rendered glyph by glyph.
[0003] In some cases, it may be desirable to display output, such as output text, with an applied visual effect. For example, text readability can suffer when rendered against a heterogeneous background, such as when the text and background colors have a similar hue or brightness. This is common in medical imaging applications where text is overlaid on a medical image. In such applications, an effect can be applied to the text to improve readability. For instance, the text can be rendered with a shadow effect, so that the heterogeneous background is covered with a shadow, while the text is rendered over the shadow in its regular foreground color and style.Although such effects can improve the readability of text in certain applications, rendering with such effects may reduce the benefits of using a glyph atlas, as the computational and / or storage costs of using pre-rendered glyphs may be reduced.
[0004] According to a first aspect of the present invention, a computer-implemented method is described for generating a further glyph representation for use in a rendering process based on a source glyph representation, the method comprising: determining a first plurality of locations in the further glyph representation corresponding to a respective plurality of source locations in the source glyph representation and setting respective first indices for the first plurality of locations based on values assigned to the respective source locations; setting respective second indices based on a relationship between the given location and a source location in the source glyph representation for each given location of a further plurality of locations in the further glyph representation, wherein the further plurality of locations comprises the first plurality of locations and a second plurality of locations;and storing the first and second indices in association with the respective locations.
[0005] Setting the respective first indices of the first multitude of locations based on values assigned to the respective source locations may involve applying a quantization process to the values assigned to the respective source locations.
[0006] The relationship can include a geometric relationship between the given location and one or more of the source locations. The geometric relationship can include a distance metric.
[0007] Setting the second indices may involve performing a visual effect calculation based on the relationship between the given location and the one or more source locations in the source glyph representation.
[0008] The visual effect calculation can include a shadow effect calculation and / or a blur effect calculation.
[0009] The first and second indices can be stored in a number of bits per location in the further glyph representation that is less than or equal to the number of bits per location in which the values assigned to the respective source locations are stored in the source glyph representation.
[0010] The values assigned to the respective source locations can be visual parameter values, such as grayscale or color values.
[0011] According to a second aspect of the present invention, a computer-implemented method for rendering a glyph is provided, comprising using a glyph representation generated by a method according to the first aspect of the present invention: performing a background rendering process, comprising using the second indices of the glyph representation to determine visual background parameter values for a plurality of locations in a background region corresponding to the further plurality of locations in the glyph representation; and performing a foreground rendering process, comprising using the first indices of the glyph representation to determine visual foreground parameter values for a plurality of locations in a foreground region corresponding to the first plurality of locations in the glyph representation.
[0012] Determining the visual background parameter values for the multitude of locations in the background region can be based on a predetermined mapping between the second indices and the visual background parameter values; and / or determining the visual foreground parameter values for the multitude of locations in the foreground region can be based on a predetermined mapping between the first indices and the visual foreground parameter values.
[0013] The method for rendering a glyph can be applied in a medical rendering process and the method may include: selecting the predetermined mapping between the second indices and the visual background parameter values and / or the predetermined mapping between the first indices and the visual foreground parameter values based on a property of the medical rendering process.
[0014] According to a third aspect of the present invention, a machine-readable medium is provided which comprises one or more glyph representations generated by a method according to the first aspect of the present invention.
[0015] According to a fourth aspect of the present invention, a set of machine-readable instructions is provided which, when executed by a processor, cause a method according to the first aspect or the second aspect of the present invention to be carried out.
[0016] According to a fifth aspect of the present invention, a machine-readable medium is provided which comprises a set of machine-readable instructions according to the fourth aspect of the present invention.
[0017] According to a sixth aspect of the present invention, a device is provided comprising: a processor; and a memory comprising one or more glyph representations generated by a method according to the first aspect of the present invention and / or a set of machine-readable instructions according to the fourth aspect of the present invention.
[0018] The present invention will now be described by way of example only, with reference to the accompanying drawings. These show: Fig. 1 a flowchart of a computer-implemented procedure to generate another glyph representation for use in a rendering process based on a source glyph representation; Fig. 2. A flowchart of a computer-implemented procedure for rendering a glyph using a process by a process by Fig.1. Illustrated method for generating glyph representations; Fig. 3 a schematic drawing illustrating aspects of an exemplary procedure for generating a glyph representation; and Fig. 4 A schematic drawing showing a device for carrying out exemplary procedures described here.
[0019] Fig. Figure 1 is a flowchart of an exemplary computer-implemented procedure 100 to generate another glyph representation for use in a rendering process based on a source glyph representation.
[0020] A source glyph representation can be a representation of a specific glyph within a glyph atlas, which may be referred to as a source glyph atlas. The source glyph atlas may contain one or more other source glyph representations. For example, the source glyph atlas may contain several respective representations of different Latin or Arabic characters in a specific style and size. Each specific character in a particular style and size, for example, the Latin letter "A" in Arial, 11 points, may be referred to as a glyph. The representation of a specific glyph within the source glyph atlas may be called a source glyph representation. Each source glyph representation within the source glyph atlas may represent a specific glyph with an anti-aliasing effect applied to it.
[0021] The source glyph representation comprises a multitude of source locations, for example, a set of pixels, where each location has one or more values stored in association with it. These values can be referred to here as source values. The source values can be visual parameter values, such as grayscale or color values. In some examples, the source glyph representation might be a grayscale representation of the glyph and could include multiple pixels, each with an associated grayscale value. In other examples, the source glyph representation might be a color representation of the glyph and could include a multitude of pixels, each with one or more associated color values, for example, an R, G, and B value for each pixel.
[0022] The multitude of source locations in the source glyph can be a grid of pixels of any other suitable size, depending on the resolution of the source glyph representation and the size of the represented glyph. The grid of pixels can be regularly or irregularly shaped. In some examples, the multiple pixels representing the source glyph representation can be referred to as the "black box" of the source glyph representation.
[0023] The additional glyph representation generated by procedure 100 can be a representation of the glyph represented by the source glyph representation with a visual effect applied to it. For example, the additional glyph representation can depict the glyph with a background effect, such as a shadow effect, e.g., a blurred shadow effect, applied to it. The additional glyph representation can be part of a further glyph atlas that includes one or more other additional glyph representations. For example, each additional glyph representation in the further glyph atlas can correspond to a source glyph representation in the source glyph atlas with the visual effect applied to it.
[0024] The procedure includes in block 102 determining an initial multitude of locations in the further glyph representation corresponding to a respective multitude of source locations in the source glyph representation.
[0025] The first set of locations can, for example, be a set of pixels in the extended glyph representation, determined to correspond to the pixels of the source glyph representation's black box. These can be considered the foreground pixels of the extended glyph representation, as they represent the foreground text information corresponding to the original source glyph. In addition to those determined to correspond to the source types, the extended glyph representation also includes a second set of locations. This second set of locations can, for example, provide a border of pixels around the pixels corresponding to the source pixels and can be used to accommodate a visual effect, such as a shadow effect.The number and position of the second set of pixels relative to the first set of pixels can depend on the desired visual effect to be represented, as illustrated below.
[0026] In Block 102, the procedure also includes setting respective first indices for the first multitude of locations based on values assigned to the respective source locations.
[0027] As described above, the values assigned to the respective source locations, i.e., the source values, can be the respective grayscale values for each pixel in the black box of the source glyph representation. These values can be stored in a multitude of bits in the source glyph representation, for example, 4 bits or 8 bits per pixel.
[0028] Setting the respective first indices for the first set of locations can involve applying a quantization process to the source values. This quantization process can, for example, include defining quantization bins for the source values and determining, for each given location in the first set of locations, which quantization bin corresponds to the associated source value. Each quantization bin can be labeled with a value from the first index. In this way, the value of the first index for each given pixel can be determined by identifying the quantization bin to which the associated source value corresponds. Examples of this are described in more detail below.
[0029] In Block 104, the procedure involves setting respective second indices for each given location of a further plurality of locations based on a relationship between the given location and a given source location in the source glyph representation. The further plurality of locations includes the first plurality of locations, for example, the pixels corresponding to the black box of the source glyph representation, and the second plurality of locations, which, as described above, can be a second set of pixels outside the black box of the source glyph representation, thus providing a border for representing a shadow or other visual effect.
[0030] The relationship used to set the second index for a given location within the broader set of locations can, for example, be a geometric relationship between the given location and a location within the first set of locations corresponding to the given source location. The geometric relationship can be, for example, a distance metric, such as a Euclidean or Manhattan distance. Setting the second index for the given location based on the relationship can involve determining a value for the second index based on the relationship.
[0031] For example, the second index can be set based on a distance between a given pixel and one or more of the foreground pixels in the region of the further glyph representation, which corresponds to the black box of the source glyph representation. As an example, the second index for a given pixel can be set to represent a distance, e.g., a Manhattan distance in pixels, between the given pixel and a foreground pixel.
[0032] In some examples, the second index for a given pixel can be set based on the relationships between that pixel and more than one foreground pixel. For instance, each pixel in a predetermined region surrounding the given pixel can contribute to setting the second index on that pixel.
[0033] As described in more detail below, the second indices can be used to allow a visual effect, such as a background effect, to be rendered in the further glyph representation. For example, a background shadow effect can be provided, which can, for instance, fade in intensity with increasing distance from a foreground pixel. In other examples, a sharp outline or an opaque background field can be provided using the second indices.
[0034] In some examples, a visual effect calculation, such as a shadow effect calculation and / or a blur effect calculation, can be performed to determine the second indices. For example, setting the second index for a given pixel might involve determining a visual parameter value, such as a shadow effect grayscale or similar value, for the pixel based on the relationship between the pixel and one or more source pixels. In some such examples, the visual parameter value used to set the second index might additionally be based on the respective visual parameter values of the one or more source pixels. The second index can then be selected from the determined visual parameter value, applying, for example, a quantization process similar to that described above for the first index. An example of this is described in more detail below.In some such examples, where the second index is set based on a relationship between the given pixel and more than one foreground pixel, the value of the second index can be obtained by combining, for example alpha blending, the contributions from each of the foreground pixels.
[0035] In block 106, the procedure involves storing the first indices and the second indices in association with the respective locations.
[0036] The further glyph representation can involve multiple bits of storage per location, for example, 8 bits per pixel. For each location, an initial number of bits can be used to store the first index, and a second number of bits to store the second index.
[0037] The number of bits used to store the first and second indices can depend on the method used to set them. For example, the inventors observed that many antialiased glyphs can be represented with very few grayscale values, and therefore the grayscale values can be represented by a small number of first index values in quantized or compressed form without significant information loss. While, for example, each pixel of a source glyph representation can contain a grayscale value represented by 8 bits (allowing for 256 different grayscale values to be represented), only a few different grayscale values can be present in the source values.Accordingly, the 8-bit source values can be quantized to allow them to be represented by a first index occupying fewer bits without significant loss of information.
[0038] Similarly, index values used to encode a visual effect, such as a blur effect, can be represented with a small number of quantized values without degrading the visual impression, compared to their representation by a larger number of bits. These values can therefore be encoded using the second index in a relatively small number of bits. Accordingly, foreground and background information can be efficiently encoded, with some of the available bits per pixel used to store the first index, which represents the foreground information, and the remaining bits used to store the second index, which represents the background information.
[0039] This allows the generated glyph representation to represent both foreground and background information in a memory-efficient manner. For example, the source glyph representation can be 8 bits per pixel, and the first and second indices can be determined such that together they occupy less than or equal to 8 bits per pixel. Consequently, the subsequent glyph representation can occupy only a minimal amount of additional memory compared to the source glyph representation, with the additional memory being due to the extra pixels in the subsequent glyph representation that represent the border around the source pixels.
[0040] Fig. Figure 2 is a flowchart of an exemplary computer-implemented procedure 200 for rendering a glyph using a method 100 from Fig. 1 generated glyph representation.
[0041] Procedure 200 includes, in Block 202, performing a background rendering process. The background rendering process involves using the second indices of the glyph representation generated by Procedure 100 to determine visual background parameter values for multiple locations within a background region. The multiple locations in the background region correspond to the further plurality of locations in the glyph representation. The plurality of locations in the background region could, for example, be a plurality of pixels in a rendering of a background of the glyph representation. For instance, the background region could include a set of pixels used to render a background shadow effect for a glyph, upon which the foreground of the glyph can be rendered in a second rendering pass as described below.In one example, the background region could encompass a region of a medical image on which text with a background effect is to be rendered.
[0042] Determining the visual background parameter values can involve applying a predefined mapping between the second indices and the visual background parameter values. For example, a lookup table can provide such a mapping between the values of the second indices and the visual background parameter values. The second indices can be mapped to any visual parameter values suitable for providing a representation of the desired background effect. The visual background parameter values determined from the second indices could, for example, be grayscale values.
[0043] In Block 202, the second indices can be mapped to grayscale values representing a shadow effect or any other desired effect. For example, if the second index represents a distance between a given pixel and one or more foreground pixels, a mapping between the second indices can be provided to create a decaying shadow effect. For instance, second index values indicating close proximity to a foreground pixel can be mapped to low (i.e., dark) grayscale values, while second index values indicating greater distance from a foreground pixel are mapped to higher (i.e., lighter) grayscale values. The mapping can be linear, for example, to provide a linearly decaying shadow effect, or nonlinear to provide a shadow effect that decays in any desired way.
[0044] In other examples, any desired background effect can be provided by appropriately mapping the values of the second index to visual parameter values. For example, instead of a fading shadow effect, a mapping can be provided that results in a sharp outline, an opaque rectangle, or any other background effect.
[0045] In Block 204, Procedure 200 comprises performing a foreground rendering process. The foreground rendering process involves using the first indices of the glyph representation generated by Procedure 100 to determine visual foreground parameter values for a plurality of locations in a foreground region. The plurality of locations in the foreground region corresponds to the first plurality of locations in the glyph representation determined by Procedure 100.
[0046] The foreground rendering process allows a foreground of the glyph represented by the glyph representation to be rendered over the background effect rendered in block 202. For example, in block 204, the black box of the glyph can be rendered over a shadow effect rendered by the background rendering pass of block 202.
[0047] In this way, since the glyph representation generated by Method 100 encodes both foreground and background information of a glyph, it can be used in Method 200 to render both a visual background effect for the glyph and the foreground of the glyph. For example, a foreground of the glyph and a shadow effect can be rendered using the same glyph representation.
[0048] Because the glyph representation encodes both the foreground and background information of the visual effect, visual effect information does not need to be calculated in-flight during rendering. Furthermore, it may eliminate the need for a buffer to which glyphs are rendered to calculate visual effect information, as is the case with some existing methods that render text in a buffer and calculate a shadow effect in-flight in a separate rendering pass. This can reduce computational and storage costs.
[0049] The foreground rendering process can have any of the features described above with reference to the background rendering process. In particular, the background rendering process can include determining the visual foreground parameter values for each of the multiple locations in the foreground region according to a predetermined mapping between the first indices and visual parameter values, such as grayscale values. This can involve using a lookup table that maps first indice values to visual parameter values. The first indices can be mapped to any suitable visual parameter values for rendering the foreground of the glyph representation.For example, if determining the first indices in procedure 100 involves quantizing the pixel grayscale values of the source glyph representation's black box, the foreground rendering process may involve mapping the first indices back to quantized grayscale values representing the black box. In other examples, the first indices may be mapped to various visual parameter values to provide a desired visual effect for the foreground of the rendering. The mapping between the first indices and visual parameter values may be different from, or the same as, the mapping between the second indices and visual parameter values.
[0050] Using predefined mappings between the first and second indices and their respective visual parameter values allows you to benefit from pre-calculating the first and second indices while still enabling different rendering results by swapping the mappings as needed. For example, swapping the mapping between the second indices and visual parameter values can provide different background visual effects, such as by changing a lookup table. Similarly, using a different lookup table can provide different shadow effects without requiring a different shadow effect algorithm. Likewise, swapping the lookup table used to map the first indices to visual parameter values can achieve different foreground rendering effects.
[0051] Rendering using such predefined images can offer particular advantages in the context of medical rendering. For example, text can be rendered with visual effects that can be optimized to provide better readability of text rendered over a medical image. This method enables this in a computationally efficient manner, minimizing the impact on runtime performance. Furthermore, based on the current medical rendering task, a suitable visual effect for rendering text can be selected, or it can be easily switched between visual effects. For example, workflow mapping, user preferences, image metadata (e.g., DICOM data), hang protocol, or device DPI properties can be used to select a predefined image that provides a suitable visual effect for the given medical rendering task.
[0052] Because the visual effect information is not calculated in-flight during a rendering process, but instead pre-calculated and encoded in the second indices, the overall rendering result can be produced in a more device-independent manner. For example, if a shadow effect algorithm is calculated in-flight during rendering, the resulting visual impression can differ between different devices, for instance, due to how the different devices handle arithmetic rounding operations. This can be particularly valuable in applications where deterministic rendering is desirable for quality reasons, such as in medical rendering applications.Since, for example, the results of a medical rendering operation are usually reviewed by several experts, any differences in the visual impression should be minimized or avoided to help minimize confusion.
[0053] Now with reference to Fig. Figure 3 shows a schematic drawing illustrating aspects of an exemplary procedure for generating a glyph representation according to the procedure of Fig. 1 illustrates.
[0054] Fig. Figure 3 schematically shows a glyph representation 302, which in this example is referred to as a target glyph representation. The target glyph representation 302 has a height H. dst and a width W dst on, each measured as a number of pixels. In this example, H dst = 9 and W dst = 11.
[0055] The target glyph representation 302 includes a source region 304 with a height of H src of 5 pixels and a width of W src of 4 pixels. The pixels 305 in source region 304 can be called foreground pixels 305, since they correspond to the source pixels of a (not shown) source glyph representation on which the target glyph representation 302 is based. Source region 304 is surrounded by additional pixels 309 in the target glyph representation 302. These additional pixels 309 provide a border of pixels around source region 304, allowing a background effect, such as a blurred shadow, to be represented by the target glyph representation 302.
[0056] The positioning of the additional pixels 309 around the source region 304 is determined by a shadow environment 306. The shadow environment 306 can be used to determine the size and shape of a shadow produced by a given foreground pixel. The shadow environment 306 is defined with a given shape and size, which, in examples, can be selected in any way depending on the desired shadow effect. The shadow environment 306 has a width W S and a height H S each of which is measured as a number of pixels. In this example, W S = 7, while H S = 4 is.
[0057] The width W dst The glyph representation 302 corresponds to the respective latitudes W src and W S the source region 304 and the shadow environment 306 in the relationship W dst = W src + W S The height H is similar.dst the glyph representation 302 to the respective heights H src and H S the source region 304 and the shadow environment 306 in the relationship H dst = H src + H S An anchor point 307 and an anchor point offset a⇀s are defined for the shadow environment 306, which determines the position of the shadow environment 306 in relation to a given target pixel 308 that is being encoded.
[0058] The following steps are performed to generate the target glyph representation 302: A memory buffer for the target glyph representation is assigned a number of B. dst initialized by bits per pixel. B dst It could be, for example, 4, 8, or 16. In some examples, B can be... dst equal to a number of B srcThe number of bits per pixel of the source glyph representation can be, for example, 3028 bits per pixel for both the source glyph representation and the target glyph representation.
[0059] For each given pixel 308 with coordinates P dst in glyph representation 302: The shadow environment is anchored at point 307. Pdst−a⇀s positioned.
[0060] A relationship is determined between the given pixel 308 and one or more pixels of the foreground pixels 305 that lie in the shadow environment 306. Fig.Figure 3 shows a foreground pixel 310 located in the shadow environment 306, and in this example, a relationship is determined between the given pixel 308, which is being encoded, and the foreground pixel 310. The relationship can be a geometric one, for example, a distance metric, such as a Euclidean or Manhattan distance between the given pixel 308 and the foreground pixel 310. This specific relationship is used to determine an index I. s to set.
[0061] Where the definite relationship is a distance between pixel 308 and foreground pixel 310, the value of I can s It should be set so that it is proportional to the specified distance.
[0062] In some examples, the index I s For a given pixel, 308 can be set independently of the source value of the foreground pixels in the shadow environment 306. For example, the index I ssolely on the basis of a geometric relationship between the given pixel 308 and the foreground pixels in the shadow environment 306.
[0063] In other examples, the value of I can be s It can also be set based on a visual parameter value, such as the grayscale value, of the source pixel corresponding to foreground pixel 310. For example, a factor proportional to the distance between 308 and 310 can be multiplied by the grayscale value of the source pixel corresponding to foreground pixel 310 to provide a resulting grayscale value. This resulting grayscale value can be used to set the index I. s to set from a set of index values.
[0064] In such an example, a number N is used. f of quantization bins in an area 02 Bsrc] defined. Within this range, the quantization bins can be distributed in any way, for example, regularly or irregularly. In a simplified example, for 8-bit grayscale values in the range of 0 to 255, four quantization bins can be defined, e.g., Bin 0: 0-45, Bin 1: 46-85, Bin 2: 86-200, Bin 3: 201-255. The quantization bin into which the resulting grayscale value falls is determined, and the index I is assigned to it. s This is set as the identifier for this quantization bin, e.g., 0, 1, 2, or 3 in the example above, where four quantization bins are defined. This example is represented in Table 1. In this example, a resulting grayscale value of 89 would fall into the quantization bin labeled 2, resulting in a value of I. s = 2 leads. Table 1 Quantization bin Grayscale values 0 0-45 1 46-85 2 86-200 3 201-255
[0065] In examples where there is more than one foreground pixel 305 in the shadow environment 306, the index I s based on a relationship between the given pixel 308 and each of the foreground pixels 305 located in the shadow environment 306. For example, grayscale values representing the respective shadow contributions to pixel 308 from each of the foreground pixels 305 located in the shadow environment 306 can be calculated and combined in the manner described above, e.g., by alpha blending, to determine an overall resulting grayscale value for pixel 308. This overall resulting grayscale value can then be used to determine the index I. s to select from the set of index values, for example by a quantization process as described above.
[0066] In this way the index I can be sThis can be used to encode a shadow effect value for the given pixel 308. This shadow effect value can be used, as described in more detail below, when rendering a background of the glyph represented by glyph representation 302.
[0067] To create an index I f To set the index, it is determined whether the given pixel 308 is located in source region 304. If the given pixel 308 is located in source region 304, the source value, e.g., the grayscale value, of the source pixel corresponding to the given pixel 308 is used to set the index I. f to set.
[0068] In one example, a number of quantization bins are defined, and the quantization bin into which the source value falls is determined. The index I fis set as an identifier for this quantization bin. The definition of the quantization bins can be determined, for example, based on the grayscale values present in the source values. If, for example, only a few grayscale values are present in the source values, which can often be the case for the black-box text of a glyph, a small number of appropriately selected quantization bins can be used to represent the source values by index I without significant loss of visual information. f to represent. In this way, the source value of the source pixel corresponding to the given pixel 308 can be represented in a quantized or compressed manner by the value of the index I. f be represented.
[0069] The definition of the quantization bins, e.g., the number of bins of the range of grayscale values in each bin, can be used for the quantization bins that are used to set the index I. sare used in the example above, where such quantization bins are used to set the index I s They can be used, the same or different. In certain examples, the letters marked by the index I can be different. s On the other hand, represented shadow effect values benefit from the fact that a larger number of grayscale values can be represented. While, for example, the blackbox text of a glyph might be represented by only 3 or 4 grayscale values, it can be advantageous to represent a shadow effect with a larger number of grayscale values to achieve a visually smooth effect. In such examples, compared to the number of bits required to store the index I f A larger number of bits are used to determine the index I. s to save.
[0070] If it is determined that pixel 308 is not located in source region 304 (as is the case for the one in Fig.(Example 3 shown), the index I f This can be set to indicate this. For example, the index I f can be set with a blank value or a value of 0.
[0071] Index I s will be in B s Bits stored that are assigned to the given pixel 308, while the index I f in B f Bits are stored that are assigned to the given pixel 308, which are not used to store index I s The total number of bits per pixel for the target glyph representation B will be used. dst is dimensioned such that (B f + B S ) ≤ B dst is. In an example, the indices I s and I f For a given pixel 308, a single pixel value V is stored.
[0072] This procedure can be performed to encode each of one or more glyphs into their respective target glyph representations. The target glyph representations can be stored in a single glyph atlas by positioning the individual target glyph representations relative to each other appropriately using any suitable bin-packing algorithm.
[0073] In one example, rendering a glyph using the target glyph representation 302 is performed. Fig. 3. The following steps were performed.
[0074] In the first rendering pass, a background of the glyph, which in this example provides a shadow effect, is rendered. In this first rendering pass, for each pixel in the glyph rendering, the pixel value V of the corresponding pixel 308 in the target glyph representation 302 is read. From the value V, the index I is derived. sdecoded. This can be done by bit shifting and bit masking, so that only the bits corresponding to index I are displayed. s representing B s Bits remain.
[0075] Index I s is then used to determine a shadow effect grayscale value VS' for the pixel in the rendering using a lookup table T s to obtain, i.e. VS'=TS[IS]. The reference table T s has size N S ∈ [1, 2 BS For example, if the number of bits B s to store index I s If 2 is the index I s take up to 4 different values. Each of these different values of I s can be accessed via a row in the lookup table T s mapped to a shadow effect grayscale value. The grayscale values to which the values of Index I are mapped. sAny suitable values can be used to provide the desired shadow effect. For example, to provide a linearly decaying shadow effect, where increasing values of index I s To represent an increasing distance from a foreground pixel, a linear mapping can be defined such that increasing values of the index I s mapped to increasing grayscale values (i.e., lighter shades of grayscale values).
[0076] As described above, while the shadow environment 306 can be defined as the size and shape of a shadow produced by a given foreground pixel, depending on the mapping between values of the second index I sand grayscale values can be considered determining factors; the size and shape of the shadow may not fully correspond to shadow environment 306. For example, the rendered shadow may appear smaller than shadow environment 306 if, due to the mapping, values of the second index I s and grayscale values, the outermost pixels in the rendered background region are completely transparent.
[0077] In another example, where the second indices are set by determining a quantization bin into which a calculated shadow effect grayscale value falls, a lookup table can map the second index to a grayscale value related to the quantization bin used to set the second index value. For example, in the example from Table 1, each value of the second index can be mapped by the lookup table to the lowest grayscale value of the corresponding quantization bin, as shown in Table 2. Table 2 I s Grayscale value 0 0 1 46 2 86 3 201
[0078] In other examples, values of index I can be used. sThe image can be mapped to any suitable grayscale or other visual parameter values. Furthermore, the provided visual effect can be changed by replacing the image. Any additional coloring or effects can be applied using the grayscale value. VS' used as input to obtain a final pixel value for the background pixel when rendering the glyph.
[0079] In a second rendering pass, the foreground of the glyph is rendered. This second rendering pass is similar to the first in that, for each pixel in the glyph's rendering, the pixel value V of the corresponding pixel 308 in the glyph representation 302 is read. The index I is then derived from the value V. f decoded, which, similar to the above for index I sAs described, performing a bit shift and bit masking operation on the value V can involve until only the bits B are present. f , which index I f represent, remain.
[0080] Index I f is then mapped to a foreground grayscale value Vf' for the pixel during rendering using a lookup table T f to obtain, i.e. Vf'=Tf[If]. The reference table T f similar to the reference table T s described the size N f ∈ [1,2 Bf The relative sizes of the lookup tables T s and T f depend on the relative sizes of the number of bits B s from, which are used to encode index I s used, compared to the number of bits B f , which are used to encode index I f can be used. The illustration, which is provided by the lookup table Tf The figure provided may be the same or different from the figure provided by the lookup table T. s is provided. By replacing the lookup table T f , which are used to map the indices I f When used with grayscale values, various foreground rendering effects can be provided. Similar to the shadow effect grayscale value. VS' Any other color or additional effects can also be applied using the grayscale value. Vf' These values are used as input to obtain a final pixel value for the pixel during rendering. The grayscale values VS' and Vf' They can be combined in any suitable way to provide a final pixel value for rendering. For example, the values can be blended using alpha blending or any other suitable method.
[0081] The reference tables T s and T f can be defined such that they represent any suitable mapping of values of the indices I s and I f to provide visual parameter values. In some examples, multiple lookup tables may be available for one or both of the indices I. s and I f This can be defined, allowing the lookup table used to be changed, for example, depending on the rendering task being performed. For instance, as described above, different visual background effects can be achieved by changing the lookup table T. s , which is used to calculate the indices I s to map to grayscale values. As an example, as described above, the lookup table T can be used in a medical rendering application. sselected based on properties of the medical rendering task being performed, such as workflow mapping, user preferences, image metadata (e.g. DICOM data), hang protocol or device DPI properties.
[0082] Fig. Figure 4 is a schematic drawing of an exemplary system 401 in which an exemplary device 404 can use the methods described herein. The system 401 comprises the device 404 and a visualization unit 414. In examples, the system 401 may have fewer components than those described in Figure 4. Fig. The system may include the components shown in section 4 or additional components. For example, System 401 may include a computer network, such as the internet.
[0083] The device 404 comprises one or more processors 406 and memory in the form of one or more storage devices 408. The device 404 may, for example, include a GPU. In this example, the device 404 is designed to perform a method, according to the examples described above, for generating a glyph representation and a method, according to the examples described above, for rendering a glyph using such a glyph representation.
[0084] The storage medium 408 can comprise a machine-readable medium containing a set of machine-readable instructions which, when executed by the processor 406, cause the device 404 to perform an exemplary procedure described herein. The program can be stored on a computer-readable medium that can be read by the device 404 in order to execute the program.
[0085] The device 404 can be configured to receive a source glyph representation 410 directly, indirectly, or otherwise, and to generate a target glyph representation 412, to be stored in the memory 408, based on the source glyph representation 410. The source glyph representation 410 can form part of a (not shown) source glyph atlas comprising a plurality of source glyph representations. Similarly, the target glyph representation 412 can form part of a (not shown) target glyph atlas comprising a plurality of target glyph representations.
[0086] The device 404 can also be configured to receive, directly, indirectly, or otherwise, one or more respective lookup tables 405 for mapping values of the first and second indices in the target glyph representation 412 to visual parameter values, e.g., grayscale values. The lookup tables 405 can include one or more lookup tables for the first indices and one or more lookup tables for the second indices. For example, multiple lookup tables for mapping the second indices to grayscale values can be provided to enable the generation of various visual parameter effects. The device 404 can be configured to select one of these lookup tables for use during rendering, based on the rendering context.Alternatively or additionally, the device 404 can be designed to generate one or more lookup tables, for example based on source values of the source glyph representation 410 and / or one or more visual effect calculations.
[0087] The device 404 can also be configured to generate a rendering of a glyph that includes both visual background and foreground information, using the target glyph representation 412. For example, the device 404 can be configured to generate a rendering of text, including a background shadow effect, using the target glyph representation 412 and one or more other target glyph representations in a glyph atlas. The device 404 can be configured to transmit information, such as visual parameter information, e.g., grayscale values of color values representing the rendering, to a visualization unit 414. The transmission can be direct or indirect, for example, via a wired connection, a wireless connection, or the internet.
[0088] The visualization unit 414 may include visualization software for displaying the rendering produced by the device 404. For example, the text 416 rendered by the device 404 may be displayed by the visualization unit 414. The visualization unit 414 may include a display screen and one or more graphics hardware or software components. In some examples, the visualization unit 414 may be or include a mobile device. In some examples, the visualization unit 414 may include a virtual reality or augmented reality device. The visualization unit 414 may display a stereoscopic image in some examples.
[0089] In some examples, System 401 is a system for rendering medical images, with the rendered text 416 displayed over the medical image. In such examples, the device 404 may also be configured to generate a rendering of a medical dataset, for example, a volume rendering of a volumetric dataset, and to transmit information representing the medical image to the visualization unit 414. In some such examples, System 401 may also include a scanner (not shown) for generating a medical dataset, which may be, for example, a volumetric dataset representing part of a patient. The scanner may be a CT scanner (computed tomography), an MRI scanner (magnetic resonance imaging), a PET scanner (positron emission tomography), an ultrasound scanner, or the like.In such examples, the scanner may be connected to the device 404, for example via a wired or wireless connection, and may be designed to supply the medical data set to the device 404 for rendering.
[0090] While in certain examples described above the target glyph representation includes a single first index representing foreground information and a single second index representing background information, in other examples there may be more than one first index and / or more than one second index per pixel. For example, if the source glyph representation is a color representation, each pixel in the source glyph representation may contain more than one color value; for instance, respective R, G, and B values may be stored for each pixel. In such an example, three first indices may be stored in association with each pixel in the further glyph representation, with the first indices at that location representing R, G, and B color values, respectively. Each of these values can be generated and stored in association with the pixel in the manner described above.When rendering is used with glyph representation, each of the first indices can be used to determine a specific visual parameter value (e.g., R, G, or B color value) for the given pixel according to a predetermined mapping, such as using a lookup table. Similarly, there can be more than one second index per pixel in the target glyph representation, with each of these values also being generated and stored in association with the pixel in the manner described above. This can, for example, ensure that a background effect is encoded in a way that represents visual information in color rather than grayscale.
[0091] The embodiments described above are to be understood as illustrative examples of the invention. Other embodiments are considered. It is understood that any feature described in relation to any embodiment may be used alone or in combination with other described features, and may also be used in combination with one or more features of any other embodiment or any combination of any other embodiments. Furthermore, equivalents and modifications not described above may also be used without departing from the scope of protection of the invention as defined in the appended claims.
[0092] Regardless of the grammatical use of the term, persons with male, female or other gender identities are included in the term.
Claims
[1] Computer-implemented method (100) to generate another glyph representation (302, 412) for use in a rendering process based on a source glyph representation (410), wherein the method (100) comprises: Determine (102) a first plurality of locations (305) in the further glyph representation (302, 412) corresponding to a respective plurality of source locations in the source glyph representation (410) and set respective first indices for the first plurality of locations (305) on the basis of values assigned to the respective source locations; for each given location (308) of a further plurality of locations in the further glyph representation (302, 412) setting (104) respective second indices on the basis of a relationship between the given location (308) and a source location in the source glyph representation (410), wherein the further plurality of locations includes the first plurality of locations (305) and a second plurality of locations (309); and storing the first indices and the second indices in association with the respective locations (308). [2] Method according to claim 1, wherein the setting (104) of the respective first indices of the first plurality of locations (305) on the basis of values assigned to the respective source locations comprises the following: Applying a quantization process to the values assigned to the respective source locations. [3] Method according to claim 1 or claim 2, wherein the relationship comprises a geometric relationship between the given location (308) and one or more of the one or more source locations. [4] Method according to claim 3, wherein the geometric relationship comprises a distance metric. [5] Method according to any one of claims 1 to 4, wherein setting (104) the second indices comprises performing a visual effect calculation based on the relationship between the given location and the one or more source locations in the source glyph representation. [6] Method according to claim 5, wherein the visual effect calculation includes a shadow effect calculation and / or a blur effect calculation. [7] Method according to claims 1 to 6, wherein the first indices and the second indices are stored in a number of bits per location in the further glyph representation (302, 412) which is less than or equal to a number of bits per location in which the values assigned to the respective source locations are stored in the source glyph representation (410). [8] Method according to any one of claims 1 to 7, wherein the values assigned to the respective source locations are visual parameter values, such as grayscale or color values. [9] Computer-implemented method (200) for rendering a glyph, comprising: using a glyph representation (302, 412) generated by a method (100) according to any one of claims 1 to 8: Performing (202) a background rendering process, comprehensive use of the second indices of the glyph representation (302, 412) to determine visual background parameter values for a multitude of locations in a background region corresponding to the further multitude of locations in the glyph representation (302, 412); and Performing (204) a foreground rendering process, comprising using the first indices of the glyph representation (302, 412) to determine visual foreground parameter values for a plurality of locations in a foreground region corresponding to the first plurality of locations (305) in the glyph representation (302, 412). [10] Method according to claim 9, wherein the determination of the visual background parameter values for the plurality of locations in the background region is based on a predetermined mapping (405) between the second indices and the visual background parameter values; and / or wherein the determination of the visual foreground parameter values for the plurality of locations in the foreground region is based on a predetermined mapping (405) between the first indices and the visual foreground parameter values. [11] The method of claim 10, wherein the method for rendering a glyph is applied in a medical rendering process and wherein the method comprises: Selecting the predetermined mapping (405) between the second indices and the visual background parameter values and / or the predetermined mapping (405) between the first indices and the visual foreground parameter values based on a property of the medical rendering process. [12] Machine-readable medium comprising one or more glyph representations generated by a method (100, 200) according to any one of claims 1 to 8. [13] Set of machine-readable instructions which, when executed by a processor (406), cause a method (100) according to any one of claims 1 to 11 to be executed. [14] Machine-readable medium comprising a set of machine-readable instructions according to claim 13. [15] Device (404) comprising: a processor (406); and a storage device (408) comprising one or more glyph representations (412) generated by a method (100) according to any one of claims 1 to 8 and / or a set of machine-readable instructions according to claim 13.
Citation Information
Patent Citations
Creating and encoding glyphs
DE112007002225T5