From 3b4cf4702bd9372756e77590aa1905780bc878bc Mon Sep 17 00:00:00 2001
From: Nicola Vigano <nicola.vigano@esrf.fr>
Date: Thu, 28 Apr 2016 18:29:46 +0200
Subject: [PATCH] 6D-reconstruction: added few more statistics

Signed-off-by: Nicola Vigano <nicola.vigano@esrf.fr>
---
 zUtil_Deformation/Gt6DBlobReconstructor.m | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/zUtil_Deformation/Gt6DBlobReconstructor.m b/zUtil_Deformation/Gt6DBlobReconstructor.m
index 27664839..43c9288e 100644
--- a/zUtil_Deformation/Gt6DBlobReconstructor.m
+++ b/zUtil_Deformation/Gt6DBlobReconstructor.m
@@ -43,6 +43,8 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
             self.statistics.add_task('cp_dual_update_l1', 'CP Dual variable (l1) update');
             self.statistics.add_task('cp_dual_update_tv', 'CP Dual variable (TV) update');
             self.statistics.add_task_partial('cp_dual_update_tv', 'cp_dual_tv_reduction', 'Volumes reduction');
+            self.statistics.add_task_partial('cp_dual_update_tv', 'cp_dual_tv_gradient', 'Gradient');
+            self.statistics.add_task_partial('cp_dual_update_tv', 'cp_dual_tv_divergence', 'Divergence');
             self.statistics.add_task('cp_dual_update_ODF', 'CP Dual variable (ODF) update');
             self.statistics.add_task_partial('cp_dual_update_ODF', 'cp_dual_ODF_compute', 'Compute Reconstructed ODF');
             self.statistics.add_task('cp_primal_update', 'CP Primal variable update');
@@ -304,7 +306,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
             sES = sigma * gtMathsSumCellVolumes(new_enh_sol);
             self.statistics.add_timestamp(toc(c), 'cp_dual_update_tv', 'cp_dual_tv_reduction');
 
+            c = tic();
             dsES = gtMathsGradient(sES);
+            self.statistics.add_timestamp(toc(c), 'cp_dual_update_tv', 'cp_dual_tv_gradient');
 
             if (self.algo_ops_c_functions)
                 q = gt6DUpdateDualTV_c(q, dsES, lambda, self.num_threads);
@@ -315,7 +319,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
                 end
             end
 
+            c = tic();
             mdivq = -gtMathsDivergence(q);
+            self.statistics.add_timestamp(toc(c), 'cp_dual_update_tv', 'cp_dual_tv_divergence');
         end
 
         function p = update_dual_detector(self, p, proj_bls, sigma, sigma_1)
@@ -360,8 +366,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
         function [curr_sol, curr_enh_sol, app_time] = update_primal(self, curr_sol, curr_enh_sol, corr_tomo, corr_l1, tau)
             c = tic();
             if (self.algo_ops_c_functions)
-                % We actually re-use the same allocated volumes, saving time and
-                % reducing problems with matlab's garbage collection
+                % We actually re-use the same allocated volumes, saving
+                % time and reducing problems with matlab's garbage
+                % collection
                 [curr_sol, curr_enh_sol] = gt6DUpdatePrimal_c(curr_sol, curr_enh_sol, corr_tomo, corr_l1, tau, self.num_threads);
             else
                 theta = 1;
-- 
GitLab