|
@@ -0,0 +1,129 @@
|
|
|
+#include "piv-nodes.h"
|
|
|
+#include "piv-ufo-base.h"
|
|
|
+
|
|
|
+struct piv_nodes *
|
|
|
+piv_nodes_copy(struct piv_nodes *src)
|
|
|
+{
|
|
|
+ GError *error = NULL;
|
|
|
+ struct piv_nodes *res = g_malloc (sizeof (struct piv_nodes));
|
|
|
+ PIV_COPY_TASK_NODE (res->denoise, src->denoise, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->contrast, src->contrast, &error);
|
|
|
+
|
|
|
+ PIV_COPY_TASK_NODE (res->broadcast_contrast, src->broadcast_contrast, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->broadcast_reader, src->broadcast_reader, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->copy_replicater, src->copy_replicater, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->replicater, src->replicater, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->replicate_reader, src->replicate_reader, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->duplicater, src->duplicater, &error);
|
|
|
+
|
|
|
+ PIV_COPY_TASK_NODE (res->ring_pattern, src->ring_pattern, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->ordfilt, src->ordfilt, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->filter_particle, src->filter_particle, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->concatenate_result, src->concatenate_result, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->get_dup_circ, src->get_dup_circ, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->remove_circle, src->remove_circle, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->multi_search, src->multi_search, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->dump_ring, src->dump_ring, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->fftmult, src->fftmult, &error);
|
|
|
+
|
|
|
+ PIV_COPY_TASK_NODE (res->reduce, src->reduce, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->writer, src->writer, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->ringwriter, src->ringwriter, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->fft, src->fft, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->ringfft, src->ringfft, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->loop_ringfft, src->loop_ringfft, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->ringifft, src->ringifft, &error);
|
|
|
+ PIV_COPY_TASK_NODE (res->ifft, src->ifft, &error);
|
|
|
+
|
|
|
+ if (error)
|
|
|
+ g_print("Error %s\n", error->message);
|
|
|
+ return res;
|
|
|
+}
|
|
|
+
|
|
|
+void
|
|
|
+piv_nodes_init(struct piv_nodes *piv, struct piv_ufo_base *base)
|
|
|
+{
|
|
|
+ GError *error = base->error;
|
|
|
+ UfoPluginManager *manager = base->manager;
|
|
|
+ piv->broadcast_reader = UFO_TASK_NODE (ufo_copy_task_new ());
|
|
|
+ piv->copy_replicater = UFO_TASK_NODE (ufo_copy_task_new ());
|
|
|
+ piv->broadcast_contrast = UFO_TASK_NODE (ufo_copy_task_new ());
|
|
|
+ piv->replicater = ufo_plugin_manager_get_task (manager, "buffer", &error);
|
|
|
+ piv->replicate_reader = ufo_plugin_manager_get_task (manager, "buffer", &error);
|
|
|
+ piv->duplicater = ufo_plugin_manager_get_task (manager, "buffer", &error);
|
|
|
+ piv->loop_ringfft = ufo_plugin_manager_get_task (manager, "buffer", &error);
|
|
|
+ piv->denoise = ufo_plugin_manager_get_task (manager, "denoise", &error);
|
|
|
+ piv->ring_pattern = ufo_plugin_manager_get_task (manager, "ring_pattern", &error);
|
|
|
+ piv->reduce = ufo_plugin_manager_get_task (manager, "reduce", &error);
|
|
|
+ piv->contrast = ufo_plugin_manager_get_task (manager, "contrast", &error);
|
|
|
+ piv->filter_particle = ufo_plugin_manager_get_task (manager, "filter_particle", &error);
|
|
|
+ piv->concatenate_result = ufo_plugin_manager_get_task (manager, "concatenate_result", &error);
|
|
|
+ piv->get_dup_circ = ufo_plugin_manager_get_task (manager, "get_dup_circ", &error);
|
|
|
+ piv->remove_circle = ufo_plugin_manager_get_task (manager, "remove_circle", &error);
|
|
|
+ piv->multi_search = ufo_plugin_manager_get_task (manager, "multi_search", &error);
|
|
|
+ piv->dump_ring = ufo_plugin_manager_get_task (manager, "dump_ring", &error);
|
|
|
+ piv->fftmult = ufo_plugin_manager_get_task (manager, "fftmult", &error);
|
|
|
+ piv->ordfilt = ufo_plugin_manager_get_task (manager, "ordfilt", &error);
|
|
|
+ piv->writer = ufo_plugin_manager_get_task (manager, "writer", &error);
|
|
|
+ piv->ringwriter = ufo_plugin_manager_get_task (manager, "ringwriter", &error);
|
|
|
+ piv->fft = ufo_plugin_manager_get_task (manager, "fft", &error);
|
|
|
+ piv->ringfft = ufo_plugin_manager_get_task (manager, "fft", &error);
|
|
|
+ piv->ringifft = ufo_plugin_manager_get_task (manager, "ifft", &error);
|
|
|
+ piv->ifft = ufo_plugin_manager_get_task (manager, "ifft", &error);
|
|
|
+}
|
|
|
+
|
|
|
+void piv_nodes_unref(struct piv_nodes *piv)
|
|
|
+{
|
|
|
+ g_object_unref (piv->broadcast_contrast);
|
|
|
+ g_object_unref (piv->broadcast_reader);
|
|
|
+ g_object_unref (piv->denoise);
|
|
|
+ g_object_unref (piv->contrast);
|
|
|
+ g_object_unref (piv->ring_pattern);
|
|
|
+ g_object_unref (piv->ordfilt);
|
|
|
+ g_object_unref (piv->filter_particle);
|
|
|
+ g_object_unref (piv->concatenate_result);
|
|
|
+ g_object_unref (piv->get_dup_circ);
|
|
|
+ g_object_unref (piv->remove_circle);
|
|
|
+ g_object_unref (piv->multi_search);
|
|
|
+ g_object_unref (piv->dump_ring);
|
|
|
+ g_object_unref (piv->fftmult);
|
|
|
+ g_object_unref (piv->writer);
|
|
|
+ g_object_unref (piv->ringwriter);
|
|
|
+ g_object_unref (piv->fft);
|
|
|
+ g_object_unref (piv->ringfft);
|
|
|
+ g_object_unref (piv->loop_ringfft);
|
|
|
+ g_object_unref (piv->ringifft);
|
|
|
+ g_object_unref (piv->ifft);
|
|
|
+ g_object_unref (piv->reduce);
|
|
|
+}
|
|
|
+
|
|
|
+void piv_nodes_set_gpu(struct piv_nodes *piv, UfoNode *proc_node)
|
|
|
+{
|
|
|
+ piv->proc_node = proc_node;
|
|
|
+ ufo_task_node_set_proc_node (piv->broadcast_reader, proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->broadcast_reader, proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->copy_replicater , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->broadcast_contrast , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->replicater , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->replicate_reader, proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->duplicater , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->loop_ringfft , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->denoise , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ring_pattern , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->reduce , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->contrast , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->filter_particle , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->concatenate_result, proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->get_dup_circ , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->remove_circle , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->multi_search , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->dump_ring , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->fftmult , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ordfilt , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->writer , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ringwriter , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->fft , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ringfft , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ringifft , proc_node);
|
|
|
+ ufo_task_node_set_proc_node (piv->ifft , proc_node);
|
|
|
+}
|