src/PredictPDPS.jl

changeset 34
aca9c90f151c
parent 29
6a0ca7047f68
child 35
74b1a9f0c35e
--- a/src/PredictPDPS.jl	Thu Apr 25 11:08:03 2024 -0500
+++ b/src/PredictPDPS.jl	Thu Apr 25 11:16:24 2024 -0500
@@ -22,7 +22,7 @@
 using AlgTools.StructTools
 using AlgTools.LinkedLists
 using AlgTools.Comms
-using ImageTools.Visualise: secs_ns, grayimg, do_visualise 
+using ImageTools.Visualise: secs_ns, grayimg, do_visualise
 using ImageTools.ImFilter: gaussian
 
 #####################
@@ -40,7 +40,8 @@
 include("AlgorithmBothNL.jl")
 include("AlgorithmFB.jl")
 include("AlgorithmFBDual.jl")
-include("PlotResults.jl")
+include("Stats.jl")
+#include("PlotResults.jl")
 
 
 # Additional
@@ -72,7 +73,8 @@
 
 using .ImGenerate
 using .OpticalFlow: DisplacementFull, DisplacementConstant
-using .PlotResults
+using .Stats
+#using .PlotResults
 using .PET
 
 ##############
@@ -85,14 +87,15 @@
        demo_unknown1,demo_unknown2,demo_unknown3,
        batchrun_denoising,
        batchrun_predictors,
-       demo_denoising1, demo_denoising2, demo_denoising3, 
+       demo_denoising1, demo_denoising2, demo_denoising3,
        demo_denoising4, demo_denoising5, demo_denoising6, demo_denoising7,
-       demo_petS1, demo_petS2, demo_petS3, 
+       demo_petS1, demo_petS2, demo_petS3,
        demo_petS4, demo_petS5, demo_petS6, demo_petS7,
-       demo_petB1, demo_petB2, demo_petB3, 
+       demo_petB1, demo_petB2, demo_petB3,
        demo_petB4, demo_petB5, demo_petB6, demo_petB7,
        batchrun_shepplogan, batchrun_brainphantom, batchrun_pet,
-       plot_denoising, plot_pet, calculate_statistics
+       calculate_statistics
+       #plot_denoising, plot_pet,
        
 ###################################
 # Parameterisation and experiments
@@ -218,17 +221,17 @@
     Experiment(AlgorithmDualScaling, DisplacementConstant, lighthouse,
                p_known₀_denoising),
     Experiment(AlgorithmGreedy, DisplacementConstant, lighthouse,
-               p_known₀_denoising),  
+               p_known₀_denoising),
     Experiment(AlgorithmNoPrediction, DisplacementConstant, lighthouse,
-               p_known₀_denoising),  
+               p_known₀_denoising),
     Experiment(AlgorithmPrimalOnly, DisplacementConstant, lighthouse,
-               p_known₀_denoising),                
+               p_known₀_denoising),
     Experiment(AlgorithmProximal, DisplacementConstant, lighthouse,
                p_known₀_denoising ⬿ (phantom_ρ = 100,)),
     Experiment(AlgorithmRotation, DisplacementConstant, lighthouse,
                p_known₀_denoising),
     Experiment(AlgorithmZeroDual, DisplacementConstant, lighthouse,
-               p_known₀_denoising),  
+               p_known₀_denoising),
 )
 
 const denoising_experiments_all = Iterators.flatten((
@@ -302,7 +305,7 @@
             wp("sigma", (e_params.σ₀ == 1 ? "" : "$(e_params.σ₀)") * "\\sigma_{\\max}")
         end
     end
-end                
+end
 
 function run_experiments(;visualise=true,
                           recalculate=true,
@@ -458,7 +461,7 @@
 
         d = take!(datachannel)
 
-        for iter=1:params.maxiter 
+        for iter=1:params.maxiter
             dnext = take!(datachannel)
             st = step(d.b_noisy, d.v, dnext.b_noisy) do calc_objective
                 stn = st
@@ -484,7 +487,7 @@
                     entry = LogEntry(iter, tm, value,
                                      #sc*d.v_cumul_true[1],
                                      #sc*d.v_cumul_true[2],
-                                     #sc*v[1], sc*v[2], 
+                                     #sc*v[1], sc*v[2],
                                      assess_psnr(x, d.b_true),
                                      assess_ssim(x, d.b_true),
                                      #assess_psnr(d.b_noisy, d.b_true),
@@ -585,7 +588,7 @@
                 GR.polyline(x, y)
             end
         end
-        GR.updatews() 
+        GR.updatews()
     end
 end
 
@@ -593,11 +596,11 @@
 # Plotting SSIM and PSNR
 #########################
 
-function plot_denoising(kwargs...)
-    ssim_plot("lighthouse")
-    psnr_plot("lighthouse")
-    fv_plot("lighthouse")
-end
+#function plot_denoising(kwargs...)
+#    ssim_plot("lighthouse")
+#    psnr_plot("lighthouse")
+#    fv_plot("lighthouse")
+#end
 
 
 ###############

mercurial