src/PET/PlotResults.jl

Sun, 21 Apr 2024 22:35:03 +0300

author
Neil Dizon <neil.dizon@helsinki.fi>
date
Sun, 21 Apr 2024 22:35:03 +0300
changeset 25
c9b06736a477
parent 24
2d9e64235ba7
child 28
f7c1007f0127
permissions
-rw-r--r--

added fv_plot

20
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
1 __precompile__()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
2
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
3 module PlotResults
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
4
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
5
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
6 ########################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
7 # Load external modules
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
8 ########################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
9
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
10 using DelimitedFiles, CSV, DataFrames
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
11 using PlotlyJS
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
12
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
13 export fv_plot, ssim_plot, psnr_plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
14
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
15 global mystart = 38
24
2d9e64235ba7 renamed generate_radon as generate_sinogram
Neil Dizon <neil.dizon@helsinki.fi>
parents: 23
diff changeset
16 global myend = 75
20
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
17
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
18 function fv_plot(name :: String, save_plot::Bool=true)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
19 save_path = "./img/$(name)256x256_pdps_known_fv_plot.html"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
20 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
21 orig = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
22 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
23 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
24 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
25 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
26
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
27 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
28 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
29 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
30
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
31 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
32 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
33 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
34 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
35
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
36 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
37 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
38 Y = Float64.(data[mystart:myend, :function_value])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
39
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
40 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
41 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
42
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
43 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
44 line_color=line_color, line_dash="dot", name="proxi")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
45 push!(orig, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
46 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
47
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
48 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
49 identity = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
50 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
51 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
52 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
53 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
54
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
55 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
56 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
57 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
58
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
59 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
60 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
61 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
62 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
63
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
64 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
65 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
66 Y = Float64.(data[mystart:myend, :function_value])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
67
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
68 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
69 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
70
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
71 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
72 line_color=line_color, line_dash="dashdot", name="primo")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
73 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
74 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
75
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
76
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
77 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
78 adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
79 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
80 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
81 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
82 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
83
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
84 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
85 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
86 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
87
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
88 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
89 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
90 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
91 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
92
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
93 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
94 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
95 Y = Float64.(data[mystart:myend, :function_value])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
96
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
97 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
98 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
99
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
100 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
101 line_color=line_color, line_dash="dash", name="greed Ï„")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
102 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
103 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
104
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
105
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
106 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
107 rotation = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
108 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
109 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
110 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
111 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
112
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
113 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
114 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
115 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
116
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
117 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
118 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
119 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
120 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
121
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
122 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
123 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
124 Y = Float64.(data[mystart:myend, :function_value])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
125
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
126 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
127 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
128
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
129 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
130 line_color=line_color, line_dash="longdashdot", name="rotat")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
131 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
132 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
133
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
134
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
135 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
136 affine = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
137 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
138 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
139 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
140 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
141
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
142 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
143 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
144 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
145
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
146 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
147 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
148 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
149 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
150
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
151 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
152 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
153 Y = Float64.(data[mystart:myend, :function_value])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
154
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
155 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
156 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
157
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
158 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
159 line_color=line_color, line_dash="solid", name="dusca")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
160 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
161 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
162
25
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
163 #####################################################
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
164 zerodual = Vector{GenericTrace{Dict{Symbol, Any}}}()
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
165 #####################################################
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
166 directory_path = "./img/"
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
167 files = readdir(directory_path)
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
168 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_zerodual") && endswith(file, "0.txt"), files)
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
169
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
170 # Define an array of line styles and colors
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
171 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
172 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
173
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
174 for (index,file) in enumerate(filtered_files)
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
175 filename = directory_path*file
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
176 #data = readdlm(filename, '\t', skipstart=1)
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
177 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
178
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
179 # Extract the columns you want to plot
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
180 X = Int64.(data[mystart:myend,:iter])
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
181 Y = Float64.(data[mystart:myend, :function_value])
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
182
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
183 #line_style = line_styles[i]
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
184 line_color = line_colors[index]
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
185
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
186 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
187 line_color=line_color, line_dash="longdash", name="zerod")
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
188 push!(identity, trace)
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
189 end
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
190
20
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
191 layout = Layout(legend_title_text="Function values") # Set legend title
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
192
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
193 if save_plot && !isempty(save_path)
25
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
194 plotlyjs = plot([orig;identity;adhoc;rotation;affine;zerodual],layout)
20
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
195 open(save_path, "w") do io
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
196 PlotlyBase.to_html(io, plotlyjs.plot)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
197 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
198 elseif save_plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
199 println("Please provide a valid save path.")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
200 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
201
25
c9b06736a477 added fv_plot
Neil Dizon <neil.dizon@helsinki.fi>
parents: 24
diff changeset
202 return plot([orig;identity;adhoc;rotation;affine;zerodual],layout)
20
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
203 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
204
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
205
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
206 #########################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
207 # FUNCTION FOR SSIM
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
208 #########################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
209 function ssim_plot(name :: String, save_plot::Bool=true)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
210 save_path = "./img/$(name)256x256_pdps_known_ssim_plot.html"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
211 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
212 orig = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
213 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
214 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
215 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
216 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
217
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
218 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
219 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
220 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
221
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
222 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
223 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
224 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
225 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
226
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
227 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
228 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
229 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
230
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
231 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
232 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
233
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
234 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
235 line_color=line_color, line_dash="dot", name="proxi")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
236 push!(orig, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
237 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
238
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
239 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
240 identity = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
241 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
242 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
243 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
244 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
245
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
246 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
247 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
248 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
249
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
250 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
251 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
252 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
253 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
254
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
255 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
256 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
257 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
258
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
259 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
260 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
261
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
262 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
263 line_color=line_color, line_dash="dashdot", name="primo")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
264 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
265 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
266
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
267
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
268 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
269 adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
270 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
271 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
272 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
273 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
274
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
275 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
276 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
277 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
278
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
279 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
280 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
281 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
282 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
283
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
284 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
285 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
286 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
287
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
288 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
289 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
290
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
291 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
292 line_color=line_color, line_dash="dash", name="greed")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
293 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
294 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
295
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
296
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
297 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
298 rotation = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
299 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
300 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
301 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
302 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
303
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
304 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
305 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
306 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
307
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
308 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
309 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
310 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
311 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
312
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
313 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
314 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
315 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
316
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
317 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
318 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
319
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
320 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
321 line_color=line_color, line_dash="longdashdot", name="rotat")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
322 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
323 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
324
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
325
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
326 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
327 affine = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
328 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
329 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
330 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
331 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
332
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
333 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
334 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
335 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
336
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
337 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
338 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
339 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
340 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
341
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
342 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
343 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
344 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
345
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
346 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
347 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
348
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
349 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
350 line_color=line_color, line_dash="solid", name="dusca")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
351 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
352 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
353
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
354 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
355 zerodual = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
356 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
357 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
358 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
359 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_zerodual") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
360
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
361 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
362 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
363 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
364
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
365 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
366 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
367 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
368 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
369
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
370 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
371 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
372 Y = Float64.(data[mystart:myend, :ssim])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
373
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
374 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
375 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
376
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
377 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
378 line_color=line_color, line_dash="longdash", name="zerod")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
379 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
380 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
381
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
382 layout = Layout(yaxis_type="log", legend_title_text="SSIM") # Set legend title
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
383
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
384 if save_plot && !isempty(save_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
385 plotlyjs = plot([orig;identity;adhoc;rotation;affine;zerodual], layout)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
386 open(save_path, "w") do io
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
387 PlotlyBase.to_html(io, plotlyjs.plot)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
388 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
389 elseif save_plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
390 println("Please provide a valid save path.")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
391 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
392
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
393 return plot([orig;identity;adhoc;rotation;affine;zerodual],layout)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
394 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
395
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
396
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
397
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
398 #########################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
399 # FUNCTION FOR PSNR
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
400 #########################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
401 function psnr_plot(name :: String, save_plot::Bool=true)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
402 save_path = "./img/$(name)256x256_pdps_known_psnr_plot.html"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
403 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
404 orig = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
405 #################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
406 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
407 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
408 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_proximal") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
409
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
410 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
411 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
412 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
413
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
414 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
415 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
416 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
417 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
418
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
419 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
420 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
421 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
422
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
423 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
424 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
425
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
426 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
427 line_color=line_color, line_dash="dot", name="proxi")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
428 push!(orig, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
429 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
430
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
431 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
432 identity = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
433 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
434 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
435 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
436 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_primalonly") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
437
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
438 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
439 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
440 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
441
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
442 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
443 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
444 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
445 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
446
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
447 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
448 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
449 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
450
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
451 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
452 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
453
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
454 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
455 line_color=line_color, line_dash="dashdot", name="primo")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
456 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
457 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
458
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
459
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
460 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
461 adhoc = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
462 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
463 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
464 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
465 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_greedy") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
466
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
467 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
468 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
469 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
470
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
471 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
472 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
473 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
474 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
475
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
476 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
477 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
478 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
479
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
480 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
481 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
482
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
483 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
484 line_color=line_color, line_dash="dash", name="greed")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
485 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
486 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
487
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
488
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
489 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
490 rotation = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
491 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
492 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
493 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
494 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_rotation") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
495
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
496 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
497 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
498 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
499
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
500 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
501 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
502 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
503 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
504
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
505 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
506 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
507 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
508
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
509 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
510 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
511
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
512 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
513 line_color=line_color, line_dash="longdashdot", name="rotat")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
514 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
515 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
516
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
517 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
518 affine = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
519 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
520 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
521 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
522 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_dualscaling") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
523
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
524 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
525 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
526 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
527
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
528 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
529 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
530 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
531 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
532
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
533 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
534 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
535 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
536
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
537 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
538 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
539
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
540 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
541 line_color=line_color, line_dash="solid", name="dusca")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
542 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
543 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
544
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
545 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
546 zerodual = Vector{GenericTrace{Dict{Symbol, Any}}}()
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
547 #####################################################
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
548 directory_path = "./img/"
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
549 files = readdir(directory_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
550 filtered_files = filter(file -> startswith(file, "$(name)256x256_pdps_known_zerodual") && endswith(file, "0.txt"), files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
551
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
552 # Define an array of line styles and colors
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
553 # line_styles = ["solid", "dash", "dot", "dashdot", "longdash"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
554 line_colors = ["blue", "red", "green", "orange", "purple", "cyan", "magenta", "yellow", "grey"]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
555
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
556 for (index,file) in enumerate(filtered_files)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
557 filename = directory_path*file
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
558 #data = readdlm(filename, '\t', skipstart=1)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
559 data = CSV.File(filename, delim='\t'; header = 2) |> DataFrame
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
560
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
561 # Extract the columns you want to plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
562 X = Int64.(data[mystart:myend,:iter])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
563 Y = Float64.(data[mystart:myend, :psnr])
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
564
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
565 #line_style = line_styles[i]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
566 line_color = line_colors[index]
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
567
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
568 trace = PlotlyJS.scatter(;x=X, y=Y, mode="lines", hovertemplate="%{x:.0f},%{y:.1f}",
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
569 line_color=line_color, line_dash="longdash", name="zerod")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
570 push!(identity, trace)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
571 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
572
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
573
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
574 layout = Layout(yaxis_type="log", legend_title_text="PSNR") # Set legend title
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
575
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
576 if save_plot && !isempty(save_path)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
577 plotlyjs = plot([orig;identity;adhoc;rotation;affine; zerodual], layout)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
578 open(save_path, "w") do io
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
579 PlotlyBase.to_html(io, plotlyjs.plot)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
580 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
581 elseif save_plot
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
582 println("Please provide a valid save path.")
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
583 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
584
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
585 return plot([orig;identity;adhoc;rotation;affine;zerodual],layout)
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
586 end
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
587
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
588
7d3a75b875fa added zero dual predictor for denoising
Neil Dizon <neil.dizon@helsinki.fi>
parents:
diff changeset
589 end # Module

mercurial