-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from markmikkelsen/dev
Update to v3.3.1
- Loading branch information
Showing
88 changed files
with
2,572 additions
and
1,547 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,11 +1,16 @@ | ||
function [output MRS_struct] = AlignUsingH2O(input,MRS_struct) | ||
%Align to water maximum (top-right plot) | ||
A=size(input) | ||
[number index] = max(abs(input),[],2); | ||
index=index-A(1)/2; | ||
for ii=1:A(2) | ||
output(:,ii)=circshift(input(:,ii),[-A 0]); | ||
function [output, MRS_struct] = AlignUsingH2O(input, MRS_struct) | ||
% Align to residual water magnitude | ||
|
||
A = size(input); | ||
[~, index] = max(abs(input),[],1); | ||
index = index - A(1)/2; | ||
|
||
for ii = 1:A(2) | ||
output(:,ii) = circshift(input(:,ii), -index(ii), 1); %#ok<AGROW> | ||
end | ||
|
||
MRS_struct.out.reject(:,MRS_struct.ii) = zeros(A(2),1); | ||
end | ||
MRS_struct.out.reject{MRS_struct.ii} = zeros(1,A(2)); | ||
|
||
fprintf('\n'); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function F = BaselineModel(x, freq) | ||
% Function for baseline model | ||
|
||
F = x(2) * (freq - x(1)) + x(3); |
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,105 @@ | ||
function MRS_struct = CalcIU(MRS_struct, vox, metab, ii) | ||
% Function for quantifying concentration in institutional units | ||
% Convert metabolite and water areas to institutional units | ||
% (pseudo-concentration in mmol/L) | ||
|
||
TR = MRS_struct.p.TR(ii)/1e3; | ||
TE = MRS_struct.p.TE(ii)/1e3; | ||
if isfield(MRS_struct.p,'TR_water') | ||
TR_water = MRS_struct.p.TR_water(ii)/1e3; | ||
else | ||
TR_water = TR; | ||
end | ||
if isfield(MRS_struct.p,'TE_water') | ||
TE_water = MRS_struct.p.TE_water(ii)/1e3; | ||
else | ||
TE_water = TE; | ||
end | ||
PureWaterConc = 55.51*1e3; % mol/kg | ||
WaterVisibility = 0.65; % this is approx the value from Ernst, Kreis, Ross (1993, JMR) | ||
T1_Water = 1.100; % average of WM and GM, Wansapura et al. 1999 (JMRI) | ||
T2_Water = 0.095; % average of WM and GM, Wansapura et al. 1999 (JMRI) | ||
N_H_Water = 2; | ||
|
||
switch metab | ||
case 'GABA' | ||
EditingEfficiency = 0.5; % For TE = 68 ms | ||
T1_Metab = 1.31; % Puts et al. 2013 (JMRI) | ||
T2_Metab = 0.088; % Edden et al. 2012 (JMRI) | ||
N_H_Metab = 2; | ||
MM = 0.45; % MM correction: fraction of GABA in GABA+ peak. (In TrypDep, 30 subjects: 55% of GABA+ was MM) | ||
% This fraction is platform- and implementation-dependent, based on length and | ||
% shape of editing pulses and ifis Henry method | ||
|
||
case 'Glx' | ||
EditingEfficiency = 0.4; % determined by FID-A simulations (for TE = 68 ms) | ||
T1_Metab = 1.23; % Posse et al. 2007 (MRM) | ||
T2_Metab = 0.18; % Ganji et al. 2012 (NMR Biomed) | ||
N_H_Metab = 1; | ||
MM = 1; | ||
|
||
case 'GSH' | ||
EditingEfficiency = 0.74; % At 3T based on Quantification of Glutathione in the Human Brain by MR Spectroscopy at 3 Tesla: | ||
% Comparison of PRESS and MEGA-PRESS | ||
% Faezeh Sanaei Nezhad etal. DOI 10.1002/mrm.26532, 2016 | ||
T1_Metab = 0.40; % At 3T based on Doubly selective multiple quantum chemical shift imaging and | ||
% T1 relaxation time measurement of glutathione (GSH) in the human brain in vivo | ||
% In-Young Choi et al. NMR Biomed. 2013; 26: 28-34 | ||
T2_Metab = 0.12; % At 3T based on the ISMRM abstract | ||
% T2 relaxation times of 18 brain metabolites determined in 83 healthy volunteers in vivo | ||
% Milan Scheidegger et al. Proc. Intl. Soc. Mag. Reson. Med. 22 (2014) | ||
N_H_Metab = 2; | ||
MM = 1; | ||
|
||
case 'Lac' | ||
EditingEfficiency = 0.94; % determined by FID-A simulations (for TE = 140 ms) | ||
T1_Metab = 1.50; % Wijnen et al. 2015 (NMR Biomed) | ||
T2_Metab = 0.24; % Madan et al. 2015 (MRM) (NB: this was estimated in brain tumors) | ||
N_H_Metab = 3; | ||
MM = 1; | ||
|
||
case 'EtOH' | ||
EditingEfficiency = 0.5; % assuming same as GABA for now | ||
T1_Metab = 1.31; % assuming same as GABA | ||
T2_Metab = 0.088; % assuming same as GABA | ||
N_H_Metab = 3; | ||
MM = 1; | ||
|
||
case 'Cr' % 3 ppm moiety | ||
EditingEfficiency = 1; % not edited, so 1 | ||
T1_Metab = (1.46 + 1.24)/2; % Mlynárik et al. 2001 (NMR in Biomed) | ||
T2_Metab = (166 + 144 + 148)/3/1e3; % Wyss et al. 2018 (MRM) | ||
N_H_Metab = 3; | ||
MM = 1; | ||
|
||
case 'Cho' % 3.2 ppm moiety | ||
EditingEfficiency = 1; % not edited, so 1 | ||
T1_Metab = (1.30 + 1.08)/2; % Mlynárik et al. 2001 (NMR in Biomed) | ||
T2_Metab = (218 + 222 + 274)/3/1e3; % Wyss et al. 2018 (MRM) | ||
N_H_Metab = 9; | ||
MM = 1; | ||
|
||
case 'NAA' % 2 ppm moiety | ||
EditingEfficiency = 1; % not edited, so 1 | ||
T1_Metab = (1.47 + 1.35)/2; % Mlynárik et al. 2001 (NMR in Biomed) | ||
T2_Metab = (343 + 263 + 253)/3/1e3; % Wyss et al. 2018 (MRM) | ||
N_H_Metab = 3; | ||
MM = 1; | ||
end | ||
|
||
T1_Factor = (1 - exp(-TR_water./T1_Water)) ./ (1 - exp(-TR./T1_Metab)); | ||
T2_Factor = exp(-TE_water./T2_Water) ./ exp(-TE./T2_Metab); | ||
|
||
if strcmp(MRS_struct.p.vendor, 'Siemens_rda') | ||
% Factor of 2 is appropriate for averaged Siemens data (read in separately as ON and OFF) | ||
MRS_struct.out.(vox).(metab).ConcIU(ii) = (MRS_struct.out.(vox).(metab).Area(ii) ./ MRS_struct.out.(vox).water.Area(ii)) ... | ||
.* PureWaterConc .* WaterVisibility .* T1_Factor .* T2_Factor .* (N_H_Water ./ N_H_Metab) ... | ||
.* MM ./ 2 ./ EditingEfficiency; | ||
else | ||
MRS_struct.out.(vox).(metab).ConcIU(ii) = (MRS_struct.out.(vox).(metab).Area(ii) ./ MRS_struct.out.(vox).water.Area(ii)) ... | ||
.* PureWaterConc .* WaterVisibility .* T1_Factor .* T2_Factor .* (N_H_Water ./ N_H_Metab) ... | ||
.* MM ./ EditingEfficiency; | ||
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.