18 |
int i; |
int i; |
19 |
float t,x,y,z,probedVal, maxValue = -INFINITY; |
float t,x,y,z,probedVal, maxValue = -INFINITY; |
20 |
float4 t_i, t_j, t_k, value, f, imgPt, pt, v; |
float4 t_i, t_j, t_k, value, f, imgPt, pt, v; |
21 |
|
int4 n1; |
22 |
int4 n; |
int4 n; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
float4 d = (float4) (h2[0],h1[0],h1[0],h2[0]); |
float4 d = (float4) (h2[0],h1[0],h1[0],h2[0]); |
27 |
float4 c = (float4) (h2[1],h1[1],h1[1],h2[1]); |
float4 c = (float4) (h2[1],h1[1],h1[1],h2[1]); |
28 |
float4 b = (float4) (h2[2],h1[2],h1[2],h2[2]); |
float4 b = (float4) (h2[2],h1[2],h1[2],h2[2]); |
50 |
dot(pos,transformMatrix.scdef)); |
dot(pos,transformMatrix.scdef)); |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
f.xyzw = (float4) (modf(imgPt.x,&x),modf(imgPt.y,&y),modf(imgPt.z,&z),1.0f); |
f.xyzw = (float4) (modf(imgPt.x,&x),modf(imgPt.y,&y),modf(imgPt.z,&z),1.0f); |
55 |
n = (int4)((int)x,(int)y,(int)z,1); |
n1 = (int4) ((int)x,(int)y,(int)z,1.0f); |
56 |
|
|
57 |
|
if( (n1.x > 1 && n1.x < 11) && |
58 |
|
(n1.y > 1 && n1.y < 12) && |
59 |
|
(n1.z > 1 && n1.z < 14)) |
60 |
|
{ |
61 |
|
|
62 |
|
|
63 |
// the t value for h(fx - i) |
// the t value for h(fx - i) |
64 |
t_i = (float4) (-1.0-f.x, -f.x,f.x - 1.0, f.x - 2.0); |
t_i = (float4) (-1.0-f.x, -f.x,f.x - 1.0, f.x - 2.0); |
65 |
|
|
66 |
// the t value for h(fy - j) |
// the t value for h(fy - j) |
67 |
t_j = (float4) (-1.0-f.y, -f.y, f.y - 1.0,f.x - 2.0); |
t_j = (float4) (-1.0-f.y, -f.y, f.y - 1.0,f.y - 2.0); |
68 |
|
|
69 |
// the t value for h(fx - k) |
// the t value for h(fx - k) |
70 |
t_k = (float4) (-1.0-f.z, -f.z, f.z - 1.0,f.z - 2.0); |
t_k = (float4) (-1.0-f.z, -f.z, f.z - 1.0,f.z - 2.0); |
75 |
(d + t_k * (c + t_k * (b + t_k * a)))); // h(fz - k) |
(d + t_k * (c + t_k * (b + t_k * a)))); // h(fz - k) |
76 |
|
|
77 |
|
|
78 |
n.x = abs((n.x-1) * length * width + n.y-1 * width + n.z-1); |
n = (int4) (((n1.x-1) * length * width + n1.y-1 * width + n1.z-1), |
79 |
n.y = abs(n.x * length * width + n.y * width + n.z); |
(n1.x * length * width + n1.y * width + n1.z), |
80 |
n.z = abs((n.x+1) * length * width + n.y+1 * width + n.z+1); |
((n1.x+1) * length * width + n1.y+1 * width + n1.z+1), |
81 |
n.w = abs((n.x+2) * length * width + n.y+2 * width + n.z+2); |
((n1.x+2) * length * width + n1.y+2 * width + n1.z+2)); |
82 |
|
|
83 |
|
|
|
/* if(n.x >= 2912 || n.y >= 2912 || n.z >= 2912 || n.w >= 2912) |
|
|
{ |
|
|
printf("Row:%d, Col:%d\n",row,col); |
|
|
} |
|
|
else |
|
84 |
v = (float4)(img[n.x], |
v = (float4)(img[n.x], |
85 |
img[n.y], |
img[n.y], |
86 |
img[n.z], |
img[n.z], |
87 |
img[n.w]); |
img[n.w]); |
88 |
|
|
|
*/ |
|
|
|
|
|
probedVal = dot(v,value); // V(n + <i,j,k>) * summations of h(x) components |
|
89 |
|
|
90 |
|
probedVal = dot(v,value); // V(n + <i,j,k>) * summations of the h(x) components |
91 |
|
|
92 |
// End Probe Operation |
// End Probe Operation |
93 |
|
|
94 |
if(maxValue < probedVal) |
if(maxValue < probedVal) |
95 |
maxValue = probedVal; |
maxValue = probedVal; |
96 |
} |
} |
97 |
|
if(row == 0 && col == 0) |
98 |
|
printf("IMG PT (%f,%f,%f)\n", imgPt.x,imgPt.y,imgPt.z ); |
99 |
|
} |
100 |
out[row * 200 + col] = maxValue; |
out[row * 200 + col] = maxValue; |
101 |
} |
} |
102 |
} |
} |