|
@@ -25,6 +25,7 @@ struct _UfoFilterLaminoBPGenericPrivate {
|
|
|
cl_mem param_mem;
|
|
|
gint proj_idx;
|
|
|
CLParameters params;
|
|
|
+ gboolean finished;
|
|
|
size_t global_work_size[3];
|
|
|
};
|
|
|
|
|
@@ -135,7 +136,7 @@ static void
|
|
|
ufo_filter_lamino_bp_generic_initialize (UfoFilterReduce *filter, UfoBuffer *input[], guint **output_dims, gfloat *default_value, GError **error)
|
|
|
{
|
|
|
UfoFilterLaminoBPGenericPrivate *priv = UFO_FILTER_LAMINO_BP_GENERIC_GET_PRIVATE(filter);
|
|
|
- UfoResourceManager *manager = ufo_resource_manager();
|
|
|
+ UfoResourceManager *manager = ufo_filter_get_resource_manager(UFO_FILTER(filter));
|
|
|
GError *tmp_error = NULL;
|
|
|
cl_context context;
|
|
|
guint width, height;
|
|
@@ -253,11 +254,14 @@ ufo_filter_lamino_bp_generic_collect(UfoFilterReduce *filter, UfoBuffer *input[]
|
|
|
priv->proj_idx++;
|
|
|
}
|
|
|
|
|
|
-static void
|
|
|
+static gboolean
|
|
|
ufo_filter_lamino_bp_generic_reduce (UfoFilterReduce *filter, UfoBuffer *output[], gpointer cmd_queue, GError **error)
|
|
|
{
|
|
|
UfoFilterLaminoBPGenericPrivate *priv = UFO_FILTER_LAMINO_BP_GENERIC_GET_PRIVATE(filter);
|
|
|
|
|
|
+ if (priv->finished)
|
|
|
+ return FALSE;
|
|
|
+
|
|
|
// normalize volume after reconstruction
|
|
|
cl_kernel norm_vol_kernel = priv->norm_vol_kernel;
|
|
|
cl_mem output_mem = ufo_buffer_get_device_array (output[0], (cl_command_queue) cmd_queue);
|
|
@@ -271,6 +275,10 @@ ufo_filter_lamino_bp_generic_reduce (UfoFilterReduce *filter, UfoBuffer *output[
|
|
|
g_message("volume post-processing");
|
|
|
CHECK_OPENCL_ERROR(clEnqueueNDRangeKernel((cl_command_queue) cmd_queue, norm_vol_kernel,
|
|
|
vol_num_dims, NULL, priv->global_work_size, NULL, 0, NULL, NULL));
|
|
|
+
|
|
|
+ priv->finished = TRUE;
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
}
|
|
|
|
|
|
static void
|
|
@@ -485,6 +493,7 @@ ufo_filter_lamino_bp_generic_init(UfoFilterLaminoBPGeneric *self)
|
|
|
|
|
|
// initialize parameters here
|
|
|
self->priv = UFO_FILTER_LAMINO_BP_GENERIC_GET_PRIVATE(self);
|
|
|
+ self->priv->finished = FALSE;
|
|
|
|
|
|
CLParameters * prms = &(self->priv->params);
|
|
|
prms->theta = 0.0;
|