|
@@ -17,25 +17,25 @@
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
- __kernel void backproject (global float *volume,
|
|
|
- __read_only image2d_t projection,
|
|
|
- const sampler_t sampler,
|
|
|
- const float2 x_region,
|
|
|
- const float2 y_region,
|
|
|
- const float2 z_region,
|
|
|
- const float8 tmatrix,
|
|
|
- const uint cumulate)
|
|
|
+__kernel void backproject (global float *volume,
|
|
|
+ __read_only image2d_t projection,
|
|
|
+ const sampler_t sampler,
|
|
|
+ const float2 x_region,
|
|
|
+ const float2 y_region,
|
|
|
+ const float2 z_region,
|
|
|
+ const float8 tmatrix,
|
|
|
+ const uint cumulate)
|
|
|
{
|
|
|
- int3 id = (int3) (get_global_id (0), get_global_id (1), get_global_id (2));
|
|
|
- float2 pixel;
|
|
|
- float3 voxel;
|
|
|
-
|
|
|
- voxel.x = mad((float) id.x, x_region.y, x_region.x);
|
|
|
- voxel.y = mad((float) id.y, y_region.y, y_region.x);
|
|
|
- voxel.z = mad((float) id.z, z_region.y, z_region.x);
|
|
|
-
|
|
|
- pixel.x = mad(voxel.x, tmatrix.s0, mad(voxel.y, tmatrix.s1, tmatrix.s3));
|
|
|
- pixel.y = mad(voxel.x, tmatrix.s4, mad(voxel.y, tmatrix.s5, mad(voxel.z, tmatrix.s6, tmatrix.s7)));
|
|
|
+ int3 id = (int3) (get_global_id (0), get_global_id (1), get_global_id (2));
|
|
|
+ float2 pixel;
|
|
|
+ float3 voxel;
|
|
|
+
|
|
|
+ voxel.x = mad((float) id.x, x_region.y, x_region.x);
|
|
|
+ voxel.y = mad((float) id.y, y_region.y, y_region.x);
|
|
|
+ voxel.z = mad((float) id.z, z_region.y, z_region.x);
|
|
|
+
|
|
|
+ pixel.x = mad(voxel.x, tmatrix.s0, mad(voxel.y, tmatrix.s1, tmatrix.s3));
|
|
|
+ pixel.y = mad(voxel.x, tmatrix.s4, mad(voxel.y, tmatrix.s5, mad(voxel.z, tmatrix.s6, tmatrix.s7)));
|
|
|
|
|
|
if (cumulate) {
|
|
|
volume[id.z * get_global_size (0) * get_global_size (1) +
|
|
@@ -45,7 +45,7 @@
|
|
|
volume[id.z * get_global_size (0) * get_global_size (1) +
|
|
|
id.y * get_global_size (0) + id.x] = read_imagef (projection, sampler, pixel).x;
|
|
|
}
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
|
|
|
__kernel void backproject_from_3d (global float *volume,
|