Commit 5547e2ab authored by William Clarke's avatar William Clarke
Browse files

Add 2H nucleus info, bug found in fsl_mrsi script, updated test.

parent c71d9d85
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# fsl_mrs - wrapper script for MRS fitting # fsl_mrs - wrapper script for MRS fitting
# #
# Author: Saad Jbabdi <saad@fmrib.ox.ac.uk> # Author: Saad Jbabdi <saad@fmrib.ox.ac.uk>
# William Carke <william.clarke@ndcn.ox.ac.uk> # William Clarke <william.clarke@ndcn.ox.ac.uk>
# #
# Copyright (C) 2019 University of Oxford # Copyright (C) 2019 University of Oxford
# SHBASECOPYRIGHT # SHBASECOPYRIGHT
......
...@@ -103,6 +103,8 @@ def main(): ...@@ -103,6 +103,8 @@ def main():
optional.add_argument('--ref_int_limits', type=float, default=None, nargs=2, optional.add_argument('--ref_int_limits', type=float, default=None, nargs=2,
help='Reference spectrum integration limits (low, high).' help='Reference spectrum integration limits (low, high).'
' No effect without setting --wref_metabolite.') ' No effect without setting --wref_metabolite.')
optional.add_argument('--h2o_scale', type=float, default=1.0,
help='Additional scaling modifier for external water referencing.')
optional.add_argument('--report', action="store_true", optional.add_argument('--report', action="store_true",
help='output html report') help='output html report')
optional.add_argument('--verbose', action="store_true", optional.add_argument('--verbose', action="store_true",
...@@ -210,7 +212,7 @@ def main(): ...@@ -210,7 +212,7 @@ def main():
if ppmlim is not None: if ppmlim is not None:
ppmlim = (ppmlim[0], ppmlim[1]) ppmlim = (ppmlim[0], ppmlim[1])
# Store info in disctionaries to be passed to MRS and fitting # Store info in dictionaries to be passed to MRS and fitting
Fitargs = {'ppmlim': ppmlim, 'method': args.algo, Fitargs = {'ppmlim': ppmlim, 'method': args.algo,
'baseline_order': args.baseline_order} 'baseline_order': args.baseline_order}
if args.lorentzian: if args.lorentzian:
......
...@@ -27,6 +27,7 @@ def test_fsl_mrsi(tmp_path): ...@@ -27,6 +27,7 @@ def test_fsl_mrsi(tmp_path):
'--output', str(tmp_path / 'fit_out'), '--output', str(tmp_path / 'fit_out'),
'--h2o', data['water'], '--h2o', data['water'],
'--TE', '30', '--TE', '30',
'--TR', '2.0',
'--add_MM', '--add_MM',
'--mask', data['mask'], '--mask', data['mask'],
'--tissue_frac', '--tissue_frac',
...@@ -42,6 +43,7 @@ def test_fsl_mrsi(tmp_path): ...@@ -42,6 +43,7 @@ def test_fsl_mrsi(tmp_path):
assert (tmp_path / 'fit_out/concs').exists() assert (tmp_path / 'fit_out/concs').exists()
assert (tmp_path / 'fit_out/concs/raw/NAA.nii.gz').exists() assert (tmp_path / 'fit_out/concs/raw/NAA.nii.gz').exists()
assert (tmp_path / 'fit_out/concs/molality/NAA.nii.gz').exists()
assert (tmp_path / 'fit_out/uncertainties/NAA_sd.nii.gz').exists() assert (tmp_path / 'fit_out/uncertainties/NAA_sd.nii.gz').exists()
assert (tmp_path / 'fit_out/qc/NAA_snr.nii.gz').exists() assert (tmp_path / 'fit_out/qc/NAA_snr.nii.gz').exists()
assert (tmp_path / 'fit_out/fit/fit.nii.gz').exists() assert (tmp_path / 'fit_out/fit/fit.nii.gz').exists()
...@@ -13,15 +13,18 @@ ...@@ -13,15 +13,18 @@
# MHz/tesla # MHz/tesla
H1_gamma = 42.576 H1_gamma = 42.576
GYRO_MAG_RATIO = {'1H': H1_gamma, GYRO_MAG_RATIO = {'1H': H1_gamma,
'2H': 6.536,
'13C': 10.7084, '13C': 10.7084,
'31P': 17.235} '31P': 17.235}
H2O_PPM_TO_TMS = 4.65 # Shift of water to Tetramethylsilane H2O_PPM_TO_TMS = 4.65 # Shift of water to Tetramethylsilane
PPM_SHIFT = {'1H': H2O_PPM_TO_TMS, PPM_SHIFT = {'1H': H2O_PPM_TO_TMS,
'2H': H2O_PPM_TO_TMS, # Placeholder
'13C': 0.0, '13C': 0.0,
'31P': 0.0} '31P': 0.0}
PPM_RANGE = {'1H': (0.2, 4.2), PPM_RANGE = {'1H': (0.2, 4.2),
'2H': (0.0, 6),
'13C': (10, 100), '13C': (10, 100),
'31P': (-20, 10)} '31P': (-20, 10)}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment