-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
331 additions
and
14 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
\documentclass{standalone} %[varwidth] | ||
|
||
%\def\size{0.15\textwidth} | ||
%\def\sizespace{0.18\textwidth} | ||
|
||
\usepackage{tikz} | ||
\usetikzlibrary{calc} | ||
\usepackage{tikzscale} | ||
\usetikzlibrary{positioning,shapes,shapes.multipart} | ||
\usepackage{pgfplots} | ||
\pgfplotsset{compat=1.5.1} | ||
|
||
\tikzset{ | ||
../pics/square/.default={1}, | ||
../pics/square/.style = { | ||
code = { | ||
\draw[pic actions] (0,0) rectangle (#1,0.6#1); | ||
} | ||
} | ||
} | ||
|
||
\pgfplotsset{width=4.5cm,compat=1.5.1} | ||
\newcommand{\zb}[1]{\mbox{\boldmath{${#1}$}}} | ||
\newcommand{\zbs}[1]{\mbox{\boldmath\scriptsize{${#1}$}}} | ||
|
||
\begin{document} | ||
|
||
\begin{tikzpicture} | ||
\tikzstyle{nodered} = [inner sep = 1pt, draw=red, line width=1pt, fill=red] | ||
\tikzstyle{nodewhite} = [inner sep = 1pt, draw=white, line width=1pt, fill=white] | ||
|
||
%& Conc Series &$\lambda^1$ & $\lambda^1$ windowed & $\lambda^2$ windowed & mask & new reco \\ | ||
\node[inner sep=1pt] (conc1) at (0,0) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_bart_rf1.png}}; | ||
\node[right = 1pt of conc1, nodewhite] (conc2) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_bart_rf2.png}}; | ||
\node[right = 1pt of conc2, nodewhite] (conc3) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_bart_rf3.png}}; | ||
\node[right = 1pt of conc3, nodewhite] (conc4) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_bart_rf4.png}}; | ||
|
||
% Labels above figures | ||
\node[above = -0.2mm of conc1]{$R=1$}; | ||
\node[above = -0.2mm of conc2]{$R=2$}; | ||
\node[above = -0.2mm of conc3]{$R=3$}; | ||
\node[above = -0.2mm of conc4]{$R=4$}; | ||
|
||
\node[rotate=90, left = 2mm of conc1, xshift=5mm]{BART}; | ||
|
||
\node[inner sep=1pt, below = 2pt of conc1] (conc1) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_bart_rf1.png}}; | ||
\node[right = 1pt of conc1, nodewhite] (conc2) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_bart_rf2.png}}; | ||
\node[right = 1pt of conc2, nodewhite] (conc3) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_bart_rf3.png}}; | ||
\node[right = 1pt of conc3, nodewhite] (conc4) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_bart_rf4.png}}; | ||
\node[rotate=90, left = 2mm of conc1, xshift=9mm]{Diff BART}; | ||
|
||
\node[inner sep=1pt, below=2pt of conc1] (conc1) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_mrireco_toeplitz1_oversamp2.0_rf1.png}}; | ||
\node[right = 1pt of conc1, nodewhite] (conc2) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_mrireco_toeplitz1_oversamp2.0_rf2.png}}; | ||
\node[right = 1pt of conc2, nodewhite] (conc3) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_mrireco_toeplitz1_oversamp2.0_rf3.png}}; | ||
\node[right = 1pt of conc3, nodewhite] (conc4) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_mrireco_toeplitz1_oversamp2.0_rf4.png}}; | ||
\node[rotate=90, left = 2mm of conc1, xshift=8mm]{MRIReco}; | ||
|
||
|
||
\node[inner sep=1pt, below = 2pt of conc1] (conc1) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf1.png}}; | ||
\node[right = 1pt of conc1, nodewhite] (conc2) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf2.png}}; | ||
\node[right = 1pt of conc2, nodewhite] (conc3) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf3.png}}; | ||
\node[right = 1pt of conc3, nodewhite] (conc4) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf4.png}}; | ||
\node[rotate=90, left = 2mm of conc1, xshift=12mm]{Diff MRIReco}; | ||
|
||
\node[inner sep=1pt, below = 2pt of conc1] (conc1) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_rf1.png}}; | ||
\node[right = 1pt of conc1, nodewhite] (conc2) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_rf2.png}}; | ||
\node[right = 1pt of conc2, nodewhite] (conc3) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_rf3.png}}; | ||
\node[right = 1pt of conc3, nodewhite] (conc4) | ||
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_rf4.png}}; | ||
\node[rotate=90, left = 2mm of conc1, xshift=9mm]{Diff Both}; | ||
|
||
|
||
\centering | ||
\end{tikzpicture} | ||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
\documentclass{standalone} %[varwidth] | ||
\usepackage{pgfplots} | ||
\usepackage{pgfplotstable} | ||
\usetikzlibrary{calc} | ||
%s\usepackage{siunitx} | ||
%\def\size{0.15\textwidth} | ||
%\def\sizespace{0.18\textwidth} | ||
|
||
\usepackage{tikz} | ||
\usepackage{tikzscale} | ||
\usetikzlibrary{positioning,shapes,shapes.multipart} | ||
\usepackage{pgfplots} | ||
\pgfplotsset{compat=1.5.1} | ||
|
||
\tikzset{ | ||
../../../pics/square/.default={1}, | ||
../../../pics/square/.style = { | ||
code = { | ||
\draw[pic actions] (0,0) rectangle (#1,0.6#1); | ||
} | ||
} | ||
} | ||
|
||
\pgfplotsset{width=4.5cm,compat=1.5.1} | ||
\newcommand{\zb}[1]{\mbox{\boldmath{${#1}$}}} | ||
\newcommand{\zbs}[1]{\mbox{\boldmath\scriptsize{${#1}$}}} | ||
|
||
\definecolor{ibilight}{RGB}{193,216,237} | ||
\definecolor{ibidark}{RGB}{0,73,146} | ||
\definecolor{uke2}{RGB}{170,156,143} | ||
\definecolor{uke3}{RGB}{87,87,86} | ||
\definecolor{ukesec1}{RGB}{255,223,0} | ||
\definecolor{ukesec2}{RGB}{239,123,5} | ||
\definecolor{ukesec3}{RGB}{104,195,205} | ||
\definecolor{ukesec4}{RGB}{138,189,36} | ||
\definecolor{tuhh}{RGB}{45,198,214} | ||
|
||
\begin{document} | ||
|
||
|
||
|
||
\begin{tikzpicture}[node distance=-0.05cm and -0.05cm]%[scale=1, every node/.style={scale=0.8}] | ||
\def\sizex{6cm} | ||
\def\sizey{5cm} | ||
|
||
\pgfplotsset{footnotesize, | ||
grid=both, | ||
width=\sizex, | ||
height=\sizey, | ||
extra y ticks={1}, | ||
axis background/.style={fill=white}, | ||
ylabel=Time [s], | ||
legend style={%at={(0.99,0.98)},anchor=north east, | ||
at={(0.35,0.7)},anchor=west, | ||
cells={anchor=west},}}, | ||
|
||
\tikzset{every mark/.append style={scale=0.5}} | ||
|
||
|
||
|
||
\begin{axis}[ | ||
xtick={1,4,8,12}, | ||
extra y tick labels={}, | ||
title={$R=1$}, | ||
xlabel=\# Threads | ||
] | ||
|
||
\pgfplotstableread[col sep=comma]{../reco/recoTimes.csv}\DataBart | ||
\pgfplotstableread[col sep=comma]{../reco/recoTimes_mrireco_toeplitz1_oversamp2.0.csv}\DataMRIReco | ||
\pgfplotstableread[col sep=comma]{../reco/recoTimes_mrireco_toeplitz0_oversamp1.25.csv}\DataMRIRecoOver | ||
|
||
\addplot [ukesec2, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{1}] {\DataBart}; | ||
\addlegendentry{BART }; | ||
|
||
\addplot [ibidark, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{1}] {\DataMRIReco}; | ||
\addlegendentry{MRIReco}; | ||
|
||
\addplot [ukesec3, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{1}] {\DataMRIRecoOver}; | ||
\addlegendentry{MRIReco*}; | ||
|
||
\end{axis} | ||
|
||
|
||
\begin{axis}[ | ||
xtick={1,4,8,12}, | ||
extra y tick labels={}, | ||
xlabel=\# Threads, | ||
title={$R=4$}, xshift=\sizex | ||
] | ||
|
||
\pgfplotstableread[col sep=comma]{../reco/recoTimes.csv}\DataBart | ||
\pgfplotstableread[col sep=comma]{../reco/recoTimes_mrireco_toeplitz1_oversamp2.csv}\DataMRIReco | ||
\pgfplotstableread[col sep=comma]{../reco/recoTimes_mrireco_toeplitz0_oversamp1.25.csv}\DataMRIRecoOver | ||
|
||
\addplot [ukesec2, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{4}] {\DataBart}; | ||
%\addlegendentry{BART }; | ||
|
||
\addplot [ibidark, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{4}] {\DataMRIReco}; | ||
%\addlegendentry{MRIReco}; | ||
|
||
\addplot [ukesec3, mark=*,line width=2] table [x expr=\thisrowno{0}, y expr=\thisrowno{4}] {\DataMRIRecoOver}; | ||
|
||
|
||
\end{axis} | ||
|
||
\end{tikzpicture} | ||
|
||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using ImageUtils, HDF5, LinearAlgebra, RegularizedLeastSquares | ||
|
||
|
||
imagesBart = Any[] | ||
imagesMRIReco = Any[] | ||
imagesMRIReco2 = Any[] | ||
|
||
rf = [1,2,3,4] | ||
|
||
f_img = "./reco/imgCG_bart.h5" | ||
for i = 1:length(rf) | ||
h5open(f_img, "r") do file | ||
A = read(file, "/rf$(rf[i])_re") | ||
B = read(file, "/rf$(rf[i])_im") | ||
im_ = A.+im.*B | ||
push!(imagesBart, im_) | ||
filename = "./reco/imgCG_bart_rf$(rf[i]).png" | ||
exportImage(filename, abs.(im_), colormap="viridis") | ||
end | ||
end | ||
|
||
|
||
f_img = "./reco/imgCG_mrireco_toeplitz1_oversamp2.0.h5" | ||
for i = 1:length(rf) | ||
h5open(f_img, "r") do file | ||
A = read(file, "/rf$(rf[i])_re") | ||
B = read(file, "/rf$(rf[i])_im") | ||
im_ = A.+im.*B | ||
push!(imagesMRIReco, im_) | ||
filename = "./reco/imgCG_mrireco_toeplitz1_oversamp2.0_rf$(rf[i]).png" | ||
exportImage(filename, abs.(im_),colormap="viridis" ) | ||
end | ||
end | ||
|
||
f_img = "./reco/imgCG_mrireco_toeplitz0_oversamp1.25.h5" | ||
for i = 1:length(rf) | ||
h5open(f_img, "r") do file | ||
A = read(file, "/rf$(rf[i])_re") | ||
B = read(file, "/rf$(rf[i])_im") | ||
im_ = A.+im.*B | ||
push!(imagesMRIReco2, im_) | ||
filename = "./reco/imgCG_mrireco_toeplitz0_oversamp1.25_rf$(rf[i]).png" | ||
exportImage(filename, abs.(im_), colormap="viridis" ) | ||
end | ||
end | ||
|
||
function optimalScaling(I,Ireco) | ||
N = length(I) | ||
|
||
# This is a little trick. We usually are not interested in simple scalings | ||
# and therefore "calibrate" them away | ||
alpha = norm(Ireco)>0 ? (dot(vec(I),vec(Ireco))+dot(vec(Ireco),vec(I))) / | ||
(2*dot(vec(Ireco),vec(Ireco))) : 1.0 | ||
I2 = Ireco.*alpha | ||
|
||
return I2 | ||
end | ||
|
||
A1 = abs.(imagesMRIReco[1]) | ||
A1 .= A1 ./maximum(A1) | ||
|
||
B1 = abs.(imagesBart[1]) | ||
B1 .= B1 ./maximum(B1) | ||
|
||
for i = 1:length(rf) | ||
A = abs.(imagesMRIReco[i]) | ||
A .= A ./maximum(A) | ||
|
||
B = abs.(imagesBart[i]) | ||
B .= optimalScaling(A,B) | ||
|
||
D = A.-B | ||
filename = "./reco/imgCG_diff_rf$(rf[i]).png" | ||
exportImage(filename, D, colormap="viridis", vmin=-0.1, vmax=0.1, normalize=false ) | ||
|
||
### | ||
A .= optimalScaling(A1,A) | ||
D = A.-A1 | ||
filename = "./reco/imgCG_diff_mrireco_rf$(rf[i]).png" | ||
exportImage(filename, D, colormap="viridis", vmin=-0.1, vmax=0.1, normalize=false ) | ||
|
||
B .= optimalScaling(B1,B) | ||
D = B.-B1 | ||
filename = "./reco/imgCG_diff_bart_rf$(rf[i]).png" | ||
exportImage(filename, D, colormap="viridis", vmin=-0.1, vmax=0.1, normalize=false ) | ||
|
||
@info nrmsd(A,B) nrmsd(abs.(imagesMRIReco[1]),A) nrmsd(abs.(imagesBart[1]),B) | ||
|
||
end | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.