From cf9d1d0d0ae6f5c23b79b78f75eb01535150cb5c Mon Sep 17 00:00:00 2001
From: Layla Riemann <layla.riemann@ptb.de>
Date: Mon, 10 May 2021 12:59:57 +0000
Subject: [PATCH] Update Recon_Spectro_MB.m

---
 Recon_Spectro_MB.m | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/Recon_Spectro_MB.m b/Recon_Spectro_MB.m
index fbaa473..8fdf2a6 100644
--- a/Recon_Spectro_MB.m
+++ b/Recon_Spectro_MB.m
@@ -1,7 +1,7 @@
 % vGRAPPA decomposition algorithm
 % 
 % This algorithm decomposes simultaneously acquired multi-voxel 
-% data to their respective origin regions. Based on the split-slice GRAPPA code by Steen Moeller, University of Minnesota, USA.
+% data to their respective origin regions. Based on the split-slice GRAPPA code by Steen Moeller, University of Minnesota, USA. 
 %
 % Author: L.T. Riemann (Physikalisch-Technische Bundesanstalt, PTB)
 % version 0.1
@@ -71,12 +71,42 @@ inp = cal(:,1:2:end,:,2);
 input.mag2 = rsos(inp(:,:),2);
 
 xaxis = 1:length(input.mag1);
+f_0=297.158;
+Fs=1/0.000125;
+n=length(input.mag1);
+dF=Fs/n;
+ppm=-Fs/2:dF:Fs/2-dF+(dF/2)*mod(n,2);
+ppm=ppm/f_0-5.7;
+ppm=fftshift(ppm);
+
 figure;
 plot(xaxis,input.mag1, xaxis, mbreco.mag1)
+xlim([-4.7,-1])
+ylim([0,0.25])
+xticks([-4.5,-3.5,-2.5,-1.5])
+xticklabels([4.5,3.5,2.5,1.5])
+xlabel("chemical shift / ppm")
+ylabel("intensity / a.u.")
+legend("low SNR V1", "Decomposed MB V1")
 
 figure;
 plot(xaxis,input.mag2, xaxis, mbreco.mag2)
+xlim([-4.7,-1])
+ylim([0,0.25])
+xticks([-4.5,-3.5,-2.5,-1.5])
+xticklabels([4.5,3.5,2.5,1.5])
+xlabel("chemical shift / ppm")
+ylabel("intensity / a.u.")
+legend("low SNR V2", "Decomposed MB V2")
 
 figure;
 plot(xaxis,mbreco.mag1, xaxis, mbreco.mag2)
+xlim([-4.7,-1])
+ylim([0,0.25])
+xticks([-4.5,-3.5,-2.5,-1.5])
+xticklabels([4.5,3.5,2.5,1.5])
+xlabel("chemical shift / ppm")
+ylabel("intensity / a.u.")
+legend("Decomposed MB V1", "Decomposed MB V2")
+
 T=table(mbreco.mag1,mbreco.mag2,input.mag1,input.mag2,'VariableNames',{'V1reco','V2reco','V1_orig','V2_orig'});
-- 
GitLab