oops

Thu, 25 Apr 2024 14:48:54 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 25 Apr 2024 14:48:54 -0500
changeset 41
3e54b2b54029
parent 40
2464329e356d
child 42
ddcf355f0b2d

oops

src/PET/PlotResults.jl file | annotate | diff | comparison | revisions
src/PlotResults.jl file | annotate | diff | comparison | revisions
src/Stats.jl file | annotate | diff | comparison | revisions
--- a/src/PET/PlotResults.jl	Thu Apr 25 14:25:27 2024 -0500
+++ b/src/PET/PlotResults.jl	Thu Apr 25 14:48:54 2024 -0500
@@ -13,6 +13,8 @@
 
 export fv_plot, ssim_plot, psnr_plot
 
+using ...Stats: extract_parameters
+
 global mystart = 38
 global myend = 75
 
--- a/src/PlotResults.jl	Thu Apr 25 14:25:27 2024 -0500
+++ b/src/PlotResults.jl	Thu Apr 25 14:48:54 2024 -0500
@@ -10,6 +10,8 @@
 using Colors
 using Statistics
 
+using ..Stats: extract_parameters
+
 export fv_plot, ssim_plot, psnr_plot
 
 global mystart = 38
@@ -621,36 +623,5 @@
     return  plot([orig;identity;adhoc;rotation;affine;zerodual],layout)
 end
 
-######################
-# Parameter extraction
-######################
-function extract_parameters(filename :: String)
-        # Extracting parameters
-        params_line = readlines(filename)[1]
-
-        # Split the line by commas and trim each part
-        params_parts = map(strip, split(params_line, ','))
-
-        # Initialize variables to store parameter values
-        α_value, τ₀_value, σ₀_value = missing, missing, missing
-
-        # Look for specific substrings to identify the values of α, τ₀, and σ₀
-        for param_part in params_parts
-            if contains(param_part, "α = ")
-                α_value = parse(Float64, split(param_part, '=')[2])
-            elseif contains(param_part, "τ₀ = ")
-                τ₀_value = parse(Float64, split(param_part, '=')[2])
-            elseif contains(param_part, "σ₀ = ")
-                σ₀_value = parse(Float64, split(param_part, '=')[2])
-            end
-        end
-
-        # Assign the values to α, τ₀, and σ₀
-        α = α_value
-        τ₀ = τ₀_value
-        σ₀ = σ₀_value
-        return α, τ₀, σ₀
-end
-
 
 end # Module
\ No newline at end of file
--- a/src/Stats.jl	Thu Apr 25 14:25:27 2024 -0500
+++ b/src/Stats.jl	Thu Apr 25 14:48:54 2024 -0500
@@ -10,7 +10,36 @@
 using CSV, DataFrames
 using Statistics
 
-export calculate_statistics
+export calculate_statistics,
+       extract_parameters
+
+function extract_parameters(filename :: String)
+        # Extracting parameters
+        params_line = readlines(filename)[1]
+
+        # Split the line by commas and trim each part
+        params_parts = map(strip, split(params_line, ','))
+
+        # Initialize variables to store parameter values
+        α_value, τ₀_value, σ₀_value = missing, missing, missing
+
+        # Look for specific substrings to identify the values of α, τ₀, and σ₀
+        for param_part in params_parts
+            if contains(param_part, "α = ")
+                α_value = parse(Float64, split(param_part, '=')[2])
+            elseif contains(param_part, "τ₀ = ")
+                τ₀_value = parse(Float64, split(param_part, '=')[2])
+            elseif contains(param_part, "σ₀ = ")
+                σ₀_value = parse(Float64, split(param_part, '=')[2])
+            end
+        end
+
+        # Assign the values to α, τ₀, and σ₀
+        α = α_value
+        τ₀ = τ₀_value
+        σ₀ = σ₀_value
+        return α, τ₀, σ₀
+end
 
 function calculate_statistics()
     ImName = ("lighthouse200x300", "shepplogan256x256", "brainphantom256x256")

mercurial