|
@@ -16,15 +16,22 @@ interpolate (global float *proj,
|
|
|
float oldx,
|
|
|
float oldy)
|
|
|
{
|
|
|
+ /* Check if vertically out of projection plane boundaries */
|
|
|
+ if (oldy < 0)
|
|
|
+ oldy = 0.5;;
|
|
|
+
|
|
|
+ if (oldy > param->proj_sy)
|
|
|
+ oldy = param->proj_sy - 0.5;
|
|
|
+
|
|
|
/* bilinear interpolation */
|
|
|
const float yf_1 = oldy - floor(oldy);
|
|
|
const float yf_0 = 1.0f - yf_1;
|
|
|
const float xf_1 = oldx - floor(oldx);
|
|
|
const float xf_0 = 1.0f - xf_1;
|
|
|
+
|
|
|
const int base = ((int) floor(oldx)) + ((int) floor(oldy)) * param->proj_sx;
|
|
|
float result;
|
|
|
|
|
|
- /* TODO: check that out of proj plain */
|
|
|
result = proj[base ] * xf_0 * yf_0;
|
|
|
result += proj[base + 1] * xf_1 * yf_0;
|
|
|
result += proj[base + param->proj_sx ] * xf_0 * yf_1;
|
|
@@ -87,8 +94,9 @@ lamino_bp_varied (global float *proj,
|
|
|
const float mat_4 = -sg * sf + cg * st * cf;
|
|
|
const float mat_5 = cg * ct;
|
|
|
|
|
|
- const float oldx = newx * mat_0 + newy * mat_1 + newz * mat_2 + param->proj_ox + newz / param->vol_sz * param->proj_ox_variation;
|
|
|
- const float oldy = newx * mat_3 + newy * mat_4 + newz * mat_5 + param->proj_oy;
|
|
|
+ /* Force newz values to be equal to 0 */
|
|
|
+ const float oldx = newx * mat_0 + newy * mat_1 /* + newz * mat_2 */ + param->proj_ox + newz / param->vol_sz * param->proj_ox_variation;
|
|
|
+ const float oldy = newx * mat_3 + newy * mat_4 /* + newz * mat_5 */ + param->proj_oy;
|
|
|
|
|
|
volume[idx] += interpolate (proj, param, oldx, oldy);
|
|
|
}
|