constants.py 4.38 KB
Newer Older
1
2
3
4
5
#!/usr/bin/env python

# constants.py - Definition of all the constants
#
# Author: Saad Jbabdi <saad@fmrib.ox.ac.uk>
6
#         William Clarke <william.clarke@ndcn.ox.ac.uk>
7
#
8
# Copyright (C) 2019 University of Oxford
9
10
# SHBASECOPYRIGHT

11
12
13
14
15
16
17
18
# From https://en.wikipedia.org/wiki/Gyromagnetic_ratio
# except for 1H https://physics.nist.gov/cgi-bin/cuu/Value?gammappbar
# MHz/tesla
H1_gamma = 42.576
GYRO_MAG_RATIO = {'1H': H1_gamma,
                  '13C': 10.7084,
                  '31P': 17.235}

19
H2O_PPM_TO_TMS = 4.65  # Shift of water to Tetramethylsilane
20
21
22
23
24
25
26
PPM_SHIFT = {'1H': H2O_PPM_TO_TMS,
             '13C': 0.0,
             '31P': 0.0}

PPM_RANGE = {'1H': (0.2, 4.2),
             '13C': (10, 100),
             '31P': (-20, 10)}
27

28
# Concentration scaling parameters
29
30
31
32
33
34
35
TISSUE_WATER_DENSITY = {'GM': 0.78, 'WM': 0.65, 'CSF': 0.97}
# TISSUE_WATER_DENSITY reference: Ernst T, Kreis R, Ross BD.
# Absolute Quantitation of Water and Metabolites in the Human Brain. I.
# Compartments and Water.
# Journal of Magnetic Resonance, Series B 1993;102:1–8
# doi: 10.1006/jmrb.1993.1055.

36
H2O_MOLECULAR_MASS = 18.01528   # g/mol
37
H2O_MOLALITY = 55.51E3    # mmol/kg
38
39
H2O_PROTONS = 2

40
41
42
43
44
45
46
# Water referencing metabolites
# Define a list of sensible metabolites to use and
# the number of protons between the default limits of 2 and 5
WATER_SCALING_METAB = ['Cr', 'PCr', 'NAA']
WATER_SCALING_METAB_PROTONS = [5, 5, 3]
WATER_SCALING_DEFAULT_LIMITS = [(2, 5), (2, 5), (1.8, 2.2)]

47
# T1 parameters
48
49
# Derived from a survey of the literature. References listed below.
# Metabolite values derived from an average of NAA, Cr and Cho peaks.
50
51
52
53
54
55
56
57
STANDARD_T1 = {'3T': {'H2O_WM': 0.97,  # Ref: 1-6
                      'H2O_GM': 1.50,  # Ref: 1-6
                      'H2O_CSF': 4.47,  # Ref: 4
                      'METAB': 1.29},  # Ref: 2, 7-9
               '7T': {'H2O_WM': 1.21,  # Ref: 1-6
                      'H2O_GM': 2.05,  # Ref: 1-6
                      'H2O_CSF': 4.43,  # Ref: 4
                      'METAB': 1.43}}  # Ref: 2, 7-9
58

59
# T2 parameters
60
61
62
63
64
65
66
67
STANDARD_T2 = {'3T': {'H2O_WM': 0.073,  # Ref: 1,3,10-11
                      'H2O_GM': 0.088,  # Ref: 1,3,10-11
                      'H2O_CSF': 2.030,  # Ref: 12
                      'METAB': 0.194},  # Ref: 7-9,13-15
               '7T': {'H2O_WM': 0.055,  # Ref: 1,3,10-11
                      'H2O_GM': 0.050,  # Ref: 1,3,10-11
                      'H2O_CSF': 1.050,  # Ref: 12
                      'METAB': 0.131}}  # Ref: 7-9,13-15
68
69
70
71
72

'''
T1 & T2 References:
1. Stanisz GJ et al. doi: 10.1002/mrm.20605.
2. Ethofer T et al. doi: 10.1002/mrm.10640.
73
74
3. Wansapura JP et al. doi: 10.1002/
(SICI)1522-2586(199904)9:4<531::AID-JMRI4>3.0.CO;2-L.
75
76
77
78
79
80
81
82
83
84
85
86
4. Rooney WD et al. doi: 10.1002/mrm.21122.
5. Dieringer MA et al. doi: 10.1371/journal.pone.0091318.
6. Wright PJ et al. doi: 10.1007/s10334-008-0104-8.
7. Mlynárik V et al. doi: 10.1002/nbm.713.
8. Li Y. doi: 10.4172/2155-9937.S1-002.
9. An L et al. doi: 10.1002/mrm.26612.
10. Gelman N et al. doi: 10.1148/radiology.210.3.r99fe41759.
11. Bartha R et al. doi: 10.1002/mrm.10112.
12. Spijkerman JM et al. doi: 10.1007/s10334-017-0659-3.
13. Marjańska M et al. doi: 10.1002/nbm.1754.
14. Träber F et al. doi: 10.1002/jmri.20053.
15. Wyss PO et al. doi: 10.1002/mrm.27067.
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
'''

'''
MCMC PRIORS
Modify these values to change the centre or width (SD) of
the Gaussian priors applied to the MCMC optimised fitting routine.
Priors are defined for the lorentzian and voigt (default) models.
Use the disable_mh_priors flag to fit_FSLModel or the
disable_MH_priors command line argument to set all priors to uniform.

'_loc' values are the centre and '_scale' values are the standard
deviation of the Guassian prior.
'''

MCMC_PRIORS = {'lorentzian': {'conc_loc': 0.0, 'conc_scale': 1E0,
                              'gamma_loc': 5.0, 'gamma_scale': 2.5,  # Hz
                              'eps_loc': 0.0, 'eps_scale': 0.005,    # ppm
                              'phi0_loc': 0.0, 'phi0_scale': 5.0,   # degrees
                              'phi1_loc': 0.0, 'phi1_scale': 1E-5},  # seconds
               'voigt': {'conc_loc': 0.0, 'conc_scale': 1E0,
                         'gamma_loc': 5.0, 'gamma_scale': 2.5,  # Hz
                         'sigma_loc': 5.0, 'sigma_scale': 2.5,  # Hz
                         'eps_loc': 0.0, 'eps_scale': 0.005,    # ppm
                         'phi0_loc': 0.0, 'phi0_scale': 5.0,   # degrees
                         'phi1_loc': 0.0, 'phi1_scale': 1E-5}}  # seconds