Biomedical Engineering Reference
In-Depth Information
Table 3.3 Summing a Data Array
void arraySum2Df(float2 coords :WPOS,
uniform samplerRECT inputTex,
out float4 color : COLOR)
{ color = float4(0.0, 0.0, 0.0, 1.0);
float2 topleft = ((coords-0.5)*2.0)+0.5;
float2 val1 = texRECT(inputTex, topleft).rg;
float2 val2 = texRECT(inputTex, topleft+float2(1,0)).rg;
float2 val3 = texRECT(inputTex, topleft+float2(1,1)).rg;
float2 val4 = texRECT(inputTex, topleft+float2(0,1)).rg;
color.rg = (val1 + val2 + val3 + val4);
}
The next shader performs a reduction operation to compute the sum of H
and
1
, which roughly equates to the labeling pixels as interior or exterior to the
zero level sets which smoothing numeric discontinuities (Algorithm 2).
The following shader reads in the full size texture array but uses a rendering
target texture a quarter of its size. For each pixel its up-sampled northwest neigh-
borhood is read from inputTex and the four values are summed. When the result
of the Heaviside shader is provided as initial input, the result is the sum of pixels
inside and outside the zero level set after log N iterations.
The rest of the shaders find the average intensities of the source image u 0
inside and outside the zero level set, compute the variance, and finally apply the
constants and sum the interior and exterior terms.
H
Distance Transform. To compute the distance transform over the zero level set
we use the jump flooding method described by [61]. They proposed a variation on
a flood fill algorithm which provides an inexact result in log n rendering passes
with additional passes resulting in fewer errors until it converges to the result of a
standard flood fill. In their follow-up paper they offer improvements and variants
on the algorithm to reduce errors and demonstrate its applicability to the 3D image
domain.
Figure 3.11 Example of performing multiple iterations of the jump flood algorithm. The initial
image on the left is composed of three intial seed pixels and the subsequent images show nearest
propagated seed pixel for each jump step size k .
Search WWH ::




Custom Search